猪头Geant4讲座(7)

时间:2025-04-20

G4Isotope* U8 = new G4Isotope("U238", iz=92, n=238, a=238.03*g/mole);

G4Element* U = new G4Element("enriched Uranium",symbol="U",ncomponents=2);

U->AddIsotope(U5, abundance= 90.*perCent);

U->AddIsotope(U8, abundance= 10.*perCent);

定义完元素之后我们就可以定义材料了。

前面我们说了,材料可以分为单质(只有一种元素)和化合物(或混合物,含有两种或两种以上的元素)。 不管是单质还是化合物,如果我们知道其中每种元素的份额(单质可以认为其组成元素的份额是100%),那我们就可以确定这种材料的组成了。再加上密度等信息就可以确定这种材料的具体状态了。这就是Geant4中的一种材料定义法。而Geant4中为了方便定义材料,将份额还分为了两种,分别是原子数份额和质量份额。

定义方法参考$G4INSTLL/source/materials/include/G4Material.hh如下:

// Constructor to create a material from a combination of elements

// and/or materials subsequently added via AddElement and/or AddMaterial

//

G4Material(const G4String& name, //its name

G4double density, //density

G4int nComponents, //nbOfComponents

G4State state = kStateUndefined, //solid,gas

G4double temp = STP_Temperature, //temperature

G4double pressure = STP_Pressure); //pressure

//

// Add an element, giving number of atoms

//

void AddElement(G4Element* element, //the element

G4int nAtoms); //nb of atoms in

// a molecule

//

// Add an element or material, giving fraction of mass

//

void AddElement (G4Element* element , //the element

G4double fraction); //fractionOfMass

$G4INSTALL/example/novice/N03中二氧化硅就是采用的原子数份额定义的,而空气则是采用的质量份额定义的。

G4Material* SiO2 =

new G4Material("quartz",density= 2.200*g/cm3, ncomponents=2);

SiO2->AddElement(Si, natoms=1);

SiO2->AddElement(O , natoms=2);

G4Material* Air =

new G4Material("Air" , density= 1.290*mg/cm3, ncomponents=2);

Air->AddElement(N, fractionmass=0.7);

Air->AddElement(O, fractionmass=0.3);

猪头Geant4讲座(7).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219