-
猪头
Geant4
讲
座第五讲
——
材料定义
本讲座为蒙卡学术论坛(
)专
题讲座,任何人未经作者本人许可不得转载至其他论坛,作者保留追究转载者相关
责任的权利!
此帖售价
20
金币
,
已有
44
人购买
几何结构类
< br>(
DetectorConstruction
)属于
强制初始化类,其主要功能是构建模拟问题的几何结
构,包括各部分的材料、形状、尺寸
、位置等信息。
因此,在这个类里面我们就
< br>必须完成上述几个信息的设置工作。
首先,材料定义。
材料可以分为单质
和化合
物(混合物)两种。而不管是单质还是化合物都是由元素组成的,因此在定义材料
前,必须首先定义元素。而元素的定义将决定在模拟过程中需要使用的截面库的选
择(大部分是自动选择的,这里不重点讲)。
那么下面我们来看如何定义元素。
我
们知道,每一种元素都可能有多个同位
素,但是所有这些同位素的原子序数(核内质子数
)都是相同的,其摩尔质量也可
以根据各个同位素所占份额计算出来。因此,只需要有原
子序数
Z
和摩尔质量
A
就可以定义出一个元素。这就是元素的直接定义法,参考
$$G4INSTL
L/source/materials/include/
,如下:
< br> // Constructor to Build an
element
directly; no reference to isotopes
//
G4Element(const G4String& name, //its
name
const G4String& symbol, //its
symbol
G4double Zeff, //atomic number
G4double Aeff; //mass of mole
其中元素名称和符号只是个标记,并不会影响元素的物理性质。
$$G4INSTALL/example/novice/N02
中氮元素的定义就是采用的直接定义法。
G4Element* N = new
G4Element(
此外,既然
每种元素都是由不同的同位素组成的,那如果事先定义了同位素,
加上每个同位素所占份
额不也可以确定一种元素,而不必麻烦地去计算摩尔质量
吗?
确实如此,在
Geant4
中同样提供
了另一种定义元素的方法,我将之称为间接
定义法。
同样参考
$$G4INSTLL/source/materials/i
nclude/
,如下:
//
Constructor to Build an element from
isotopes via AddIsotope
//
G4Element(const G4String& name, //its name const
G4String& symbol, //its
symbol
G4int nbIsotopes; //nb of isotopes
void AddIsotope(G4Isotope* isotope,
//isotope
G4double RelativeAbundance;
//fraction of nb of
//atomes per volume
而同位素的定义则参考
$$G4INSTLL/source/m
aterials/include/
G4Isotope(const
G4String& name, //its name
G4int z,
//atomic number
G4int n, //number of
nucleons
G4double a = 0.; //mass of
mole
$$G4INSTALL/example/novice/N03
中铀元素的定义就是采用的间接定义法。
//
define an Element from isotopes, by relative
abundance
//
G4Isotope* U5 =
new G4Isotope(
G4Isotope* U8 = new
G4Isotope(
G4Element* U = new
G4Element(
U->AddIsotope(U5, abundance=
90.*perCent;
U->AddIsotope(U8,
abundance= 10.*perCent;
定义完元素之后我们就可以定义材料了。
前面我们说了,材料可以分为单质
(只有一种元素)和化合物(或混合物,含有两种
或两种以上的元素)。
不管是单质还是化合物,如果我们知道
其中每种元素的份额(单质可以认为其
组成元素的份额是
100
%
),那我们就可以确定这种材料的组成了。再加上密度等
信息
就可以确定这种材料的具体状态了。这就是
Geant4
中的一
种材料定义法。而
Geant4
中为了方便定义材料,将份额还
分为了两种,分别是原子数份额和质量份
额。
定义方法参考
$$G4INSTLL/source/materials/in
clude/
如下:
//
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
//