11using CLHEP::k_Boltzmann;
17using CLHEP::hep_pascal;
22 const double R = k_Boltzmann * Avogadro;
24 Vkh = R * 3.0 / 8.0 * Tkh / Pkh;
25 ah = 3 * Pkh * Vkh * Vkh;
30 mfunname(
"VanDerWaals::volume_of_mole(...)");
35 Cubic cb(Pr, -1.0 / 3.0 * (Pr + 8 * Tr), 3, -1);
42 s_not_single = q == 2 ? 1 : 0;
50 "std::ostream& operator << (std::ostream& file, const VanDerWaals& f)");
51 Ifile <<
"VanDerWaals:\n";
53 Iprintn(file, f.
Pk() / (CLHEP::atmosphere));
56 Ifile <<
"For comparison, the volume of a mole of ideal gas\n";
57 Ifile <<
"at the same conditions takes\n";
58 Iprintn(file, (k_Boltzmann * Avogadro * f.
Tk() / f.
Pk()) / (cm3 * mole));
59 Iprintn(file, f.
a() / (CLHEP::atmosphere * cm3 * cm3));
66 long fqatom,
const std::vector<std::string>& fatom_not,
67 const std::vector<long>& fqatom_ps,
68 std::shared_ptr<VanDerWaals> fvdw)
72 qatom_psh(fqatom_ps) {
73 mfunname(
"MoleculeDef::MoleculeDef(...)");
74 m_vdw = std::move(fvdw);
75 for (
long n = 0; n <
qatom(); n++) {
76 Z_totalh += qatom_psh[n] *
atom(n)->Z();
77 A_totalh += qatom_psh[n] *
atom(n)->A();
78 tqatomh += qatom_psh[n];
85 const std::string& fatom_not,
long fqatom_ps,
86 std::shared_ptr<VanDerWaals> fvdw) :
87 MoleculeDef(fname, fnotation, 1, {fatom_not}, {fqatom_ps}, fvdw) {
92 const std::string& fatom_not1,
long fqatom_ps1,
93 const std::string& fatom_not2,
long fqatom_ps2,
94 std::shared_ptr<VanDerWaals> fvdw) :
95 MoleculeDef(fname, fnotation, 2, {fatom_not1, fatom_not2},
96 {fqatom_ps1, fqatom_ps2}, fvdw) {
102 const std::string& fatom_not1,
long fqatom_ps1,
103 const std::string& fatom_not2,
long fqatom_ps2,
104 const std::string& fatom_not3,
long fqatom_ps3,
105 std::shared_ptr<VanDerWaals> fvdw) :
106 MoleculeDef(fname, fnotation, 3, {fatom_not1, fatom_not2, fatom_not3},
107 {fqatom_ps1, fqatom_ps2, fqatom_ps3}, fvdw) {
112 if (l > 0) file << (*this);
116 mfunnamep(
"std::ostream& operator << (std::ostream&, const MoleculeDef&)");
117 constexpr double gpm = gram / mole;
118 Ifile <<
"MoleculeDef: name=" << std::setw(10) << f.
name()
119 <<
" notation=" << std::setw(3) << f.
notation() <<
'\n';
122 <<
" A_total()/(gram/mole)=" << f.
A_total() / gpm
123 <<
" tqatom()=" << f.
tqatom() <<
'\n';
126 for (
long n = 0; n < f.
qatom(); n++) {
127 Ifile <<
"n=" << n <<
" atom(n)->notation=" << f.
atom(n)->notation()
128 <<
" qatom_ps(n)=" << f.
qatom_ps(n) <<
'\n';
131 f.AtomMixDef::print(file, 1);
134 Ifile <<
"Density at the crucial conditions for ideal gas (for debug):\n";
135 double rydberg = k_Boltzmann * Avogadro;
140 f.
A_total() * at->Pk() / (rydberg * at->Tk()) / (gram / cm3));
141 Ifile <<
"For the Waals:\n";
148std::list<MoleculeDef> MoleculeDefs::molecules;
151 Ifile <<
"MoleculeDefs::printMolecules:\n";
159 if (molecule.notation() == fnotation)
return &molecule;
165 if (!molecules.empty())
return molecules;
166 molecules.emplace_back(
MoleculeDef(
"Hydrogen",
"H2",
"H", 2));
167 molecules.emplace_back(
MoleculeDef(
"Helium",
"He",
"He", 1));
168 molecules.emplace_back(
MoleculeDef(
"Nitrogen",
"N2",
"N", 2));
169 molecules.emplace_back(
MoleculeDef(
"Oxygen",
"O2",
"O", 2));
170 molecules.emplace_back(
MoleculeDef(
"Neon",
"Ne",
"Ne", 1));
173 molecules.emplace_back(
MoleculeDef(
"Argon",
"Ar",
"Ar", 1,
174 std::make_shared<VanDerWaals>(48.6 * bar, 150.7 * kelvin)));
175 molecules.emplace_back(
MoleculeDef(
"Krypton",
"Kr",
"Kr", 1,
176 std::make_shared<VanDerWaals>(55.0 * bar, 209.4 * kelvin)));
177 molecules.emplace_back(
MoleculeDef(
"Xenon",
"Xe",
"Xe", 1,
178 std::make_shared<VanDerWaals>(55.0 * bar, 209.4 * kelvin)));
180 molecules.emplace_back(
MoleculeDef(
"NH3",
"NH3",
"N", 1,
"H", 3));
181 molecules.emplace_back(
MoleculeDef(
"N2O",
"N2O",
"N", 2,
"O", 1));
182 molecules.emplace_back(
MoleculeDef(
"CO2",
"CO2",
"C", 1,
"O", 2));
183 molecules.emplace_back(
MoleculeDef(
"CH4",
"CH4",
"C", 1,
"H", 4,
184 std::make_shared<VanDerWaals>(4.64e6 * hep_pascal,
185 (273.15 - 82.5) * kelvin)));
186 molecules.emplace_back(
MoleculeDef(
"CF4",
"CF4",
"C", 1,
"F", 4,
187 std::make_shared<VanDerWaals>(42.5 * bar, 369.8 * kelvin)));
188 molecules.emplace_back(
MoleculeDef(
"SF4",
"SF4",
"S", 1,
"F", 4));
189 molecules.emplace_back(
MoleculeDef(
"SF6",
"SF6",
"S", 1,
"F", 6));
190 molecules.emplace_back(
MoleculeDef(
"C2H2",
"C2H2",
"C", 2,
"H", 2));
191 molecules.emplace_back(
MoleculeDef(
"C2H4",
"C2H4",
"C", 2,
"H", 4));
192 molecules.emplace_back(
MoleculeDef(
"C2H6",
"C2H6",
"C", 2,
"H", 6));
193 molecules.emplace_back(
MoleculeDef(
"C3H8",
"C3H8",
"C", 3,
"H", 8,
194 std::make_shared<VanDerWaals>(42.5 * bar, 369.8 * kelvin)));
195 molecules.emplace_back(
MoleculeDef(
"C4H10",
"C4H10",
"C", 4,
"H", 10,
196 std::make_shared<VanDerWaals>(40.0 * bar, 418.3 * kelvin)));
197 molecules.emplace_back(
MoleculeDef(
"C2H2F4",
"C2H2F4",
"C", 2,
"F", 4,
"H", 2));
198 molecules.emplace_back(
MoleculeDef(
"H2O",
"H2O",
"H", 2,
"O", 1,
199 std::make_shared<VanDerWaals>(22.9e6 * hep_pascal, (273.15 + 374.15) * kelvin)));
200 molecules.emplace_back(
MoleculeDef(
"Methylal",
"Methylal",
"O", 2,
"C", 3,
"H", 8,
201 std::make_shared<VanDerWaals>(39.5 * bar, 480.6 * kelvin)));
204 molecules.emplace_back(
MoleculeDef(
"C5H12",
"C5H12",
"C", 5,
"H", 12));
205 molecules.emplace_back(
MoleculeDef(
"NO",
"NO",
"N", 1,
"O", 1));
206 molecules.emplace_back(
MoleculeDef(
"CO",
"CO",
"C", 1,
"O", 1));
207 molecules.emplace_back(
MoleculeDef(
"DME",
"DME",
"C", 2,
"H", 6,
"O", 1));
208 molecules.emplace_back(
MoleculeDef(
"C2F6",
"C2F6",
"C", 2,
"F", 6));
209 molecules.emplace_back(
MoleculeDef(
"C3H6",
"C3H6",
"C", 3,
"H", 6));
210 molecules.emplace_back(
MoleculeDef(
"CH3OH",
"CH3OH",
"C", 1,
"H", 4,
"O", 1));
211 molecules.emplace_back(
MoleculeDef(
"C2H5OH",
"C2H5OH",
"C", 2,
"H", 6,
"O", 1));
212 molecules.emplace_back(
MoleculeDef(
"C3H7OH",
"C3H7OH",
"C", 3,
"H", 8,
"O", 1));
213 molecules.emplace_back(
MoleculeDef(
"Cs",
"Cs",
"Cs", 1));
214 molecules.emplace_back(
MoleculeDef(
"F2",
"F2",
"F", 2));
215 molecules.emplace_back(
MoleculeDef(
"CS2",
"CS2",
"C", 1,
"S", 2));
216 molecules.emplace_back(
MoleculeDef(
"COS",
"COS",
"C", 1,
"O", 1,
"S", 1));
217 molecules.emplace_back(
MoleculeDef(
"BF3",
"BF3",
"B", 1,
"F", 3));
218 molecules.emplace_back(
MoleculeDef(
"C2HF5",
"C2HF5",
"C", 2,
"H", 1,
"F", 5));
219 molecules.emplace_back(
MoleculeDef(
"CHF3",
"CHF3",
"C", 1,
"H", 1,
"F", 3));
220 molecules.emplace_back(
MoleculeDef(
"CF3Br",
"CF3Br",
"C", 1,
"F", 3,
"Br", 1));
221 molecules.emplace_back(
MoleculeDef(
"C3F8",
"C3F8",
"C", 3,
"F", 8));
222 molecules.emplace_back(
MoleculeDef(
"O3",
"O3",
"O", 3));
223 molecules.emplace_back(
MoleculeDef(
"Hg",
"Hg",
"Hg", 1));
224 molecules.emplace_back(
MoleculeDef(
"H2S",
"H2S",
"H", 2,
"S", 1));
225 molecules.emplace_back(
MoleculeDef(
"GeH4",
"GeH4",
"Ge", 1,
"H", 4));
226 molecules.emplace_back(
MoleculeDef(
"SiH4",
"SiH4",
"Si", 1,
"H", 4));
227 molecules.emplace_back(
MoleculeDef(
"CCl4",
"CCl4",
"C", 1,
"Cl", 4));
#define check_econd11(a, signb, stream)
#define mfunnamep(string)
AtomMixDef()=default
Default constructor.
const std::vector< const AtomDef * > & atom() const
Find solution to cubic equation.
int find_real_zero(double z[3]) const
const std::vector< long > & qatom_ps() const
const std::string & name() const
void print(std::ostream &file, int l) const
const std::string & notation() const
const std::shared_ptr< VanDerWaals > & vdw() const
static const MoleculeDef * getMolecule(const std::string &fnotation)
static const std::list< MoleculeDef > & getMolecules()
static void printMolecules(std::ostream &file)
Print all registered molecules.
Helper class for Van-der-Waals equation.
VanDerWaals * copy() const
double volume_of_mole(double T, double p, int &s_not_single)
VanDerWaals(double fPk, double fTk)
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
#define Iprintn(file, name)
#define Iprint2n(file, name1, name2)