Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
GasDef.h
Go to the documentation of this file.
1#ifndef GAS_DEF_H
2#define GAS_DEF_H
3
6
7namespace Heed {
8
9/// Definition of a gas.
10/// haracteristic feature of the Gas class is that it consists of molecules.
11/// Additional feature is that the density can be calculated by temperature
12/// and pressure. But this is not always, and therefore it is not characteristic
13/// feature. Then with only one this feature (consisting of molecules)
14/// we can describe as gas also some other substances, for example, the liquids.
15///
16/// Only the basic information: the data of matter, plus the pressure.
17/// Note that the class AtomMixDef undirectly appear twice.
18/// It is the base class of matter and molecula. Therefore it is
19/// indirectly the base class of GasDef, and the base class
20/// of its external elements molech.
21///
22/// As the base class of GasDef, the class AtomMixDef determines only the
23/// relative weights of atoms of different sorts. Also note that
24/// the atoms of the same sorts participated in different molecules,
25/// included in AtomMixDef as different atoms.
26///
27/// As the base class of MoleculeDef, the class AtomMixDef determines
28/// also only the relative weights of atoms of different sorts in the given
29/// molecule, since the class AtomMixDef doesn't have space to encapsulate
30/// the number of atoms. But the latter number is also necessary: consider H2,
31/// the relative weight of H is 1, and nothing says that there are two atoms.
32/// Therefore in the class MoleculeDef there is additional array, which
33/// gives the numbers of atoms of each sort, and also there is another
34/// parameter giving the total number of atoms in molecule.
35///
36/// 1998-2004 I. Smirnov
37
38class GasDef : public MatterDef {
39 double pressureh = 0.;
40 /// Number of different molecules
41 long qmolech = 0;
42 std::vector<MoleculeDef*> molech;
43 std::vector<double> weight_quan_molech; // sum is 1
44 std::vector<double> weight_mass_molech; // sum is 1
45 public:
46 double pressure() const { return pressureh; }
47 long qmolec() const { return qmolech; }
48 const std::vector<MoleculeDef*>& molec() const {
49 return molech;
50 }
51 MoleculeDef* molec(long n) const { return molech[n]; }
52 const std::vector<double>& weight_quan_molec() const {
53 return weight_quan_molech;
54 }
55 const std::vector<double>& weight_mass_molec() const {
56 return weight_mass_molech;
57 }
58 double weight_quan_molec(const long n) const {
59 return weight_quan_molech[n];
60 }
61 double weight_mass_molec(const long n) const {
62 return weight_mass_molech[n];
63 }
64 /// Mean charge of molecules in this gas
65 double Z_mean_molec() const;
66
67 GasDef();
68 // for calculation of density assume ideal gas:
69 GasDef(const std::string& fname, const std::string& fnotation, long fqmolec,
70 const std::vector<std::string>& fmolec_not,
71 const std::vector<double>& fweight_quan_molec, double fpressure,
72 double ftemperature, double fdensity = -1.0);
73 // for calculation of density assume Van der Waals
74 // for the components for which the parameters are defined:
75 GasDef(const std::string& fname, const std::string& fnotation, long fqmolec,
76 const std::vector<std::string>& fmolec_not,
77 const std::vector<double>& fweight_volume_molec, double fpressure,
78 double ftemperature, int s1,
79 int s2); // s1 and s2 are to distinguish the constructor
80 // for calculation of density assume ideal gas:
81 GasDef(const std::string& fname, const std::string& fnotation,
82 const std::string& fmolec_not, double fpressure, double ftemperature,
83 double fdensity = -1.0);
84 // for calculation of density assume Van der Waals gas:
85 GasDef(const std::string& fname, const std::string& fnotation,
86 const std::string& fmolec_not, double fpressure, double ftemperature,
87 int s1, int s2);
88 // for calculation of density assume ideal gas:
89 GasDef(const std::string& fname, const std::string& fnotation,
90 const std::string& fmolec_not1, double fweight_quan_molec1,
91 const std::string& fmolec_not2, double fweight_quan_molec2,
92 double fpressure, double ftemperature, double fdensity = -1.0);
93 // for calculation of density assume Van der Waals gas:
94 GasDef(const std::string& fname, const std::string& fnotation,
95 const std::string& fmolec_not1, double fweight_volume_molec1,
96 const std::string& fmolec_not2, double fweight_volume_molec2,
97 double fpressure, double ftemperature, int s1, int s2);
98 // for calculation of density assume ideal gas:
99 GasDef(const std::string& fname, const std::string& fnotation,
100 const std::string& fmolec_not1, double fweight_quan_molec1,
101 const std::string& fmolec_not2, double fweight_quan_molec2,
102 const std::string& fmolec_not3, double fweight_quan_molec3,
103 double fpressure, double ftemperature, double fdensity = -1.0);
104 // for calculation of density assume Van der Waals gas:
105 GasDef(const std::string& fname, const std::string& fnotation,
106 const std::string& fmolec_not1, double fweight_volume_molec1,
107 const std::string& fmolec_not2, double fweight_volume_molec2,
108 const std::string& fmolec_not3, double fweight_volume_molec3,
109 double fpressure, double ftemperature, int s1, int s2);
110 // for calculation of density assume ideal gas:
111 GasDef(const std::string& fname, const std::string& fnotation,
112 const GasDef& gd, double fpressure, double ftemperature,
113 double fdensity = -1.0);
114
115 void print(std::ostream& file, int l = 0) const;
116 GasDef* copy() const { return new GasDef(*this); }
117};
118std::ostream& operator<<(std::ostream& file, const GasDef& f);
119
120}
121
122#endif
double Z_mean_molec() const
Mean charge of molecules in this gas.
Definition: GasDef.cpp:281
GasDef * copy() const
Definition: GasDef.h:116
void print(std::ostream &file, int l=0) const
Definition: GasDef.cpp:290
long qmolec() const
Definition: GasDef.h:47
const std::vector< double > & weight_quan_molec() const
Definition: GasDef.h:52
MoleculeDef * molec(long n) const
Definition: GasDef.h:51
double weight_quan_molec(const long n) const
Definition: GasDef.h:58
const std::vector< double > & weight_mass_molec() const
Definition: GasDef.h:55
const std::vector< MoleculeDef * > & molec() const
Definition: GasDef.h:48
double pressure() const
Definition: GasDef.h:46
double weight_mass_molec(const long n) const
Definition: GasDef.h:61
Definition: BGMesh.cpp:6
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
Definition: BGMesh.cpp:37