add: Taparan;
change: section big design
This commit is contained in:
parent
fb9e9ee7fc
commit
bb829079e6
@ -88,7 +88,8 @@
|
||||
"xstring": "cpp",
|
||||
"xtr1common": "cpp",
|
||||
"xtree": "cpp",
|
||||
"xutility": "cpp"
|
||||
"xutility": "cpp",
|
||||
"bbox_action": "cpp"
|
||||
}
|
||||
}
|
||||
}
|
BIN
docs/Shell.png
Normal file
BIN
docs/Shell.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 427 KiB |
BIN
docs/Taparan.png
Normal file
BIN
docs/Taparan.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 226 KiB |
BIN
docs/Tianhe.jpg
Normal file
BIN
docs/Tianhe.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 361 KiB |
BIN
docs/空间站无太阳能板.stl
Normal file
BIN
docs/空间站无太阳能板.stl
Normal file
Binary file not shown.
@ -11,4 +11,4 @@ public:
|
||||
void Build() const override;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -5,4 +5,4 @@
|
||||
|
||||
void DefineMaterials();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
3
main.cpp
3
main.cpp
@ -9,7 +9,6 @@
|
||||
#include "G4VisExecutive.hh"
|
||||
#include "QBBC.hh"
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
G4UIExecutive* ui = nullptr;
|
||||
if (argc == 1) ui = new G4UIExecutive(argc, argv);
|
||||
@ -37,4 +36,4 @@ int main(int argc, char** argv) {
|
||||
delete runManager;
|
||||
delete visManager;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -5,4 +5,4 @@ ActionInitialization::ActionInitialization() {}
|
||||
|
||||
ActionInitialization::~ActionInitialization() {}
|
||||
|
||||
void ActionInitialization::Build() const { SetUserAction(new PrimaryGeneratorAction); }
|
||||
void ActionInitialization::Build() const { SetUserAction(new PrimaryGeneratorAction); }
|
||||
|
@ -2,34 +2,89 @@
|
||||
#include "Material.h"
|
||||
|
||||
#include "G4Box.hh"
|
||||
#include "G4IntersectionSolid.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4SubtractionSolid.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4UnionSolid.hh"
|
||||
|
||||
DetectorConstruction::DetectorConstruction() {}
|
||||
|
||||
DetectorConstruction::~DetectorConstruction() {}
|
||||
|
||||
static G4double ConstrustSectionBig(G4LogicalVolume* fMotherLogical, G4double zBias) {
|
||||
G4double pRmaxBig = 4.2 / 2 * m;
|
||||
G4double hzBig = 6.72 / 2 * m;
|
||||
G4double hxBigBox = 2.4 / 2 * m;
|
||||
G4double pRmaxBigMid = pRmaxBig - 10 * cm;
|
||||
G4ThreeVector pos1 = G4ThreeVector(0, 0, -(zBias + hzBig));
|
||||
G4double pos2 = -(zBias + hzBig * 2) + 9.8 * cm;
|
||||
|
||||
// 外壳
|
||||
G4Tubs* solidShellAl1 = new G4Tubs("sectionBigShellAl1", pRmaxBig - 2, pRmaxBig, hzBig, 0, 360);
|
||||
G4LogicalVolume* logicShellAl1 = new G4LogicalVolume(
|
||||
solidShellAl1, G4Material::GetMaterial("AluminumAlloySeries5"), "sectionBigShellAl1");
|
||||
new G4PVPlacement(0, pos1, logicShellAl1, "sectionBigShellAl1", fMotherLogical, false, 0, true);
|
||||
|
||||
G4Tubs* solidShellTap = new G4Tubs("sectionBigShellTap", pRmaxBig - 55, pRmaxBig - 45, hzBig, 0, 360);
|
||||
G4LogicalVolume* logicShellTap = new G4LogicalVolume(
|
||||
solidShellTap, G4Material::GetMaterial("Taparan"), "sectionBigShellTap");
|
||||
new G4PVPlacement(0, pos1, logicShellTap, "sectionBigShellTap", fMotherLogical, false, 0, true);
|
||||
|
||||
G4Tubs* solidShellAl2 = new G4Tubs("sectionBigShellAl2", pRmaxBigMid, pRmaxBigMid + 5, hzBig, 0, 360);
|
||||
G4LogicalVolume* logicShellAl2 = new G4LogicalVolume(
|
||||
solidShellAl2, G4Material::GetMaterial("AluminumAlloySeries5"), "sectionBigShellAl2");
|
||||
new G4PVPlacement(0, pos1, logicShellAl2, "sectionBigShellAl2", fMotherLogical, false, 0, true);
|
||||
|
||||
// 填充
|
||||
G4Tubs* solidMidTubs = new G4Tubs("sectionBigMidTubs", 0, pRmaxBigMid, hzBig, 0, 360);
|
||||
G4Box* solidMidBox = new G4Box("sectionBigMidBox", hxBigBox, hxBigBox, hzBig);
|
||||
G4SubtractionSolid* solidMid =
|
||||
new G4SubtractionSolid("sectionBigMid", solidMidTubs, solidMidBox);
|
||||
G4LogicalVolume* logicMid =
|
||||
new G4LogicalVolume(solidMid, G4Material::GetMaterial("G4_Al"), "sectionBigMid");
|
||||
new G4PVPlacement(0, pos1, logicMid, "sectionBigMid", fMotherLogical, false, 0, true);
|
||||
|
||||
// 空气
|
||||
G4Box* solidAir = new G4Box("sectionBigAirBox", hxBigBox, hxBigBox, hzBig);
|
||||
G4LogicalVolume* logicAir =
|
||||
new G4LogicalVolume(solidAir, G4Material::GetMaterial("G4_AIR"), "sectionBigAir");
|
||||
new G4PVPlacement(0, pos1, logicAir, "sectionBigAir", fMotherLogical, false, 0, true);
|
||||
|
||||
// 尾部
|
||||
G4Tubs* solidTailAl1 = new G4Tubs("sectionBigTailAl1", 0, pRmaxBigMid, 2.5, 0, 360);
|
||||
G4LogicalVolume* logicTailAl1 = new G4LogicalVolume(
|
||||
solidTailAl1, G4Material::GetMaterial("AluminumAlloySeries5"), "sectionBigTailAl1");
|
||||
new G4PVPlacement(0, G4ThreeVector(0, 0, pos2 - 2.5), logicTailAl1, "sectionBigTailAl1", fMotherLogical, false, 0, true);
|
||||
|
||||
G4Tubs* solidTailTap = new G4Tubs("sectionBigTailTap", 0, pRmaxBigMid, 5, 0, 360);
|
||||
G4LogicalVolume* logicTailTap = new G4LogicalVolume(
|
||||
solidTailTap, G4Material::GetMaterial("Taparan"), "sectionBigTailTap");
|
||||
new G4PVPlacement(0, G4ThreeVector(0, 0, pos2 - 50), logicTailTap, "sectionBigTailTap", fMotherLogical, false, 0, true);
|
||||
|
||||
G4Tubs* solidTailAl2 = new G4Tubs("sectionBigTailAl2", 0, pRmaxBig, 1, 0, 360);
|
||||
G4LogicalVolume* logicTailAl2 = new G4LogicalVolume(
|
||||
solidTailAl2, G4Material::GetMaterial("AluminumAlloySeries5"), "sectionBigTailAl2");
|
||||
new G4PVPlacement(0, G4ThreeVector(0, 0, pos2 - 99), logicTailAl2, "sectionBigTailAl2", fMotherLogical, false, 0, true);
|
||||
|
||||
return zBias + hzBig;
|
||||
}
|
||||
|
||||
G4VPhysicalVolume* DetectorConstruction::Construct() {
|
||||
G4double zBias = 0.815 * m;
|
||||
|
||||
// Define materials
|
||||
DefineMaterials();
|
||||
|
||||
// World
|
||||
G4Box* solid_world = new G4Box("World", 3. * m, 3. * m, 10. * m);
|
||||
G4LogicalVolume* logic_world = new G4LogicalVolume(solid_world, G4Material::GetMaterial("Vacuum"), "World");
|
||||
G4VPhysicalVolume* physics_world = new G4PVPlacement(0, G4ThreeVector(), logic_world, "World", 0, false, 0, true);
|
||||
G4Box* solidWorld = new G4Box("World", 3. * m, 3. * m, 10. * m);
|
||||
G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, G4Material::GetMaterial("Vacuum"), "World");
|
||||
G4VPhysicalVolume* physicsWorld = new G4PVPlacement(0, G4ThreeVector(), logicWorld, "World", 0, false, 0, true);
|
||||
|
||||
// 大柱段
|
||||
// 生活控制舱
|
||||
G4double pRmin_big = 2.2 / 2 * m;
|
||||
G4double pRmax_big = 4.2 / 2 * m;
|
||||
G4double zLength = 4.32 * m;
|
||||
G4ThreeVector pos1 = G4ThreeVector(0, 0, -(0.815 * m + zLength / 2));
|
||||
G4Tubs* solid_section_big_life = new G4Tubs("section_big_life", pRmin_big, pRmax_big, zLength / 2, 0, 360);
|
||||
G4LogicalVolume* logic_section_big_life = new G4LogicalVolume(
|
||||
solid_section_big_life, G4Material::GetMaterial("Aluminum alloy Series 5"), "section_big_life");
|
||||
new G4PVPlacement(0, pos1, logic_section_big_life, "section_big_life", logic_world, false, 0, true);
|
||||
zBias = ConstrustSectionBig(logicWorld, zBias);
|
||||
|
||||
return physics_world;
|
||||
return physicsWorld;
|
||||
}
|
||||
|
@ -6,12 +6,16 @@
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
void DefineMaterials() {
|
||||
G4double a, z; // 摩尔质量, 原子序数
|
||||
G4int ncomponents, fractionmass; // 组分数, 质量分数
|
||||
G4double a, z; // 摩尔质量, 原子序数
|
||||
G4int ncomponents, fractionmass, natoms; // 组分数, 质量分数, 原子数
|
||||
G4double density, pressure, temperature;
|
||||
|
||||
G4NistManager* nist = G4NistManager::Instance();
|
||||
|
||||
// 已有
|
||||
nist->FindOrBuildMaterial("G4_AIR");
|
||||
nist->FindOrBuildMaterial("G4_Al");
|
||||
|
||||
// 真空
|
||||
density = universe_mean_density;
|
||||
pressure = 3.e-18 * pascal;
|
||||
@ -20,16 +24,24 @@ void DefineMaterials() {
|
||||
|
||||
// 5系铝合金 0.4 Si + 0.35 Fe + 0.1 Cu + 0.7 Mn + 4.5 Mg + 0.15 Cr + 0.25 Zn + 0.15 Ti + 93.4 Al
|
||||
density = 2.68 * g / cm3;
|
||||
G4Material* Al_alloy_5 = new G4Material("Aluminum alloy Series 5", density, ncomponents = 9);
|
||||
Al_alloy_5->AddElement(nist->FindOrBuildElement("Si"), fractionmass = .4 * perCent);
|
||||
Al_alloy_5->AddElement(nist->FindOrBuildElement("Fe"), fractionmass = .35 * perCent);
|
||||
Al_alloy_5->AddElement(nist->FindOrBuildElement("Cu"), fractionmass = .1 * perCent);
|
||||
Al_alloy_5->AddElement(nist->FindOrBuildElement("Mn"), fractionmass = .7 * perCent);
|
||||
Al_alloy_5->AddElement(nist->FindOrBuildElement("Mg"), fractionmass = 4.5 * perCent);
|
||||
Al_alloy_5->AddElement(nist->FindOrBuildElement("Cr"), fractionmass = .15 * perCent);
|
||||
Al_alloy_5->AddElement(nist->FindOrBuildElement("Zn"), fractionmass = .25 * perCent);
|
||||
Al_alloy_5->AddElement(nist->FindOrBuildElement("Ti"), fractionmass = .15 * perCent);
|
||||
Al_alloy_5->AddElement(nist->FindOrBuildElement("Al"), fractionmass = 93.4 * perCent);
|
||||
G4Material* AlAlloyS5 = new G4Material("AluminumAlloySeries5", density, ncomponents = 9);
|
||||
AlAlloyS5->AddElement(nist->FindOrBuildElement("Si"), fractionmass = .4 * perCent);
|
||||
AlAlloyS5->AddElement(nist->FindOrBuildElement("Fe"), fractionmass = .35 * perCent);
|
||||
AlAlloyS5->AddElement(nist->FindOrBuildElement("Cu"), fractionmass = .1 * perCent);
|
||||
AlAlloyS5->AddElement(nist->FindOrBuildElement("Mn"), fractionmass = .7 * perCent);
|
||||
AlAlloyS5->AddElement(nist->FindOrBuildElement("Mg"), fractionmass = 4.5 * perCent);
|
||||
AlAlloyS5->AddElement(nist->FindOrBuildElement("Cr"), fractionmass = .15 * perCent);
|
||||
AlAlloyS5->AddElement(nist->FindOrBuildElement("Zn"), fractionmass = .25 * perCent);
|
||||
AlAlloyS5->AddElement(nist->FindOrBuildElement("Ti"), fractionmass = .15 * perCent);
|
||||
AlAlloyS5->AddElement(nist->FindOrBuildElement("Al"), fractionmass = 93.4 * perCent);
|
||||
|
||||
// 泰普龙 Taparan
|
||||
density = 1.44 * g / cm3;
|
||||
G4Material* Taparan = new G4Material("Taparan", density, ncomponents = 4);
|
||||
Taparan->AddElement(nist->FindOrBuildElement("C"), natoms = 14);
|
||||
Taparan->AddElement(nist->FindOrBuildElement("H"), natoms = 10);
|
||||
Taparan->AddElement(nist->FindOrBuildElement("N"), natoms = 2);
|
||||
Taparan->AddElement(nist->FindOrBuildElement("O"), natoms = 2);
|
||||
|
||||
std::cout << *(G4Material::GetMaterialTable()) << std::endl;
|
||||
}
|
||||
}
|
||||
|
3
vis.mac
3
vis.mac
@ -33,7 +33,8 @@
|
||||
|
||||
# 设置颜色
|
||||
/vis/geometry/set/visibility World 0 false
|
||||
/vis/geometry/set/colour section_big_life 0 0 0 1 .3
|
||||
/vis/geometry/set/colour sectionBigMid 0 0.631373 0.686275 0.733333 0.584314
|
||||
/vis/geometry/set/colour sectionBigAir 0 0.631373 0.686275 0.733333 0.584314
|
||||
/vis/viewer/set/style surface
|
||||
|
||||
# 坐标轴
|
||||
|
Loading…
Reference in New Issue
Block a user