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