32 template<
class Thermo,
template<
class>
class Type>
42 template<
class Thermo,
template<
class>
class Type>
55 template<
class Thermo,
template<
class>
class Type>
59 return Type<thermo<Thermo, Type>>::enthalpy();
63 template<
class Thermo,
template<
class>
class Type>
67 return Type<thermo<Thermo, Type>>::energyName();
71 template<
class Thermo,
template<
class>
class Type>
75 return Type<thermo<Thermo, Type>>::Cpv(*
this,
p,
T);
79 template<
class Thermo,
template<
class>
class Type>
83 const scalar
Cp = this->
Cp(p,
T);
84 return Cp/(
Cp - this->CpMCv(
p,
T));
88 template<
class Thermo,
template<
class>
class Type>
92 return Type<thermo<Thermo, Type>>
::he(*
this,
p,
T);
96 template<
class Thermo,
template<
class>
class Type>
100 return this->
ha(p,
T) -
T*this->
s(p,
T);
104 template<
class Thermo,
template<
class>
class Type>
108 return this->
ea(p,
T) -
T*this->
s(p,
T);
112 template<
class Thermo,
template<
class>
class Type>
116 scalar arg = -this->
Y()*this->gStd(
T)/(
RR*
T);
129 template<
class Thermo,
template<
class>
class Type>
137 template<
class Thermo,
template<
class>
class Type>
141 const scalar nm = this->
Y()/this->
W();
143 if (
equal(nm, small))
154 template<
class Thermo,
template<
class>
class Type>
161 const scalar nm = this->
Y()/this->
W();
163 if (
equal(nm, small))
174 template<
class Thermo,
template<
class>
class Type>
182 const scalar nm = this->
Y()/this->
W();
184 if (
equal(nm, small))
196 template<
class Thermo,
template<
class>
class Type>
197 template<
class ThermoType,
class FType,
class dFdTType,
class LimitType>
207 const bool diagnostics
213 <<
"Negative initial temperature T0: " <<
T0
219 scalar Ttol =
T0*tol_;
227 <<
"Energy -> temperature conversion failed to converge:" <<
endl;
229 <<
setw(width) <<
"Test"
230 <<
setw(width) <<
"e/h"
231 <<
setw(width) <<
"Cv/p"
232 <<
setw(width) <<
"Tnew"
247 <<
setw(width) << Test
250 <<
setw(width) << Tnew
254 if (iter++ > maxIter_)
262 <<
"Maximum number of iterations exceeded: " << maxIter_
266 }
while (
mag(Tnew - Test) > Ttol);
272 template<
class Thermo,
template<
class>
class Type>
280 return Type<thermo<Thermo, Type>>::The(*
this,
he,
p,
T0);
284 template<
class Thermo,
template<
class>
class Type>
305 template<
class Thermo,
template<
class>
class Type>
326 template<
class Thermo,
template<
class>
class Type>
347 template<
class Thermo,
template<
class>
class Type>
368 template<
class Thermo,
template<
class>
class Type>
376 const scalar dKcdTbyKc =
377 (this->
s(
Pstd, T) + this->gStd(
T)/
T)*this->
Y()/(
RR*
T);
379 const scalar nm = this->
Y()/this->
W();
380 if (
equal(nm, small))
386 return dKcdTbyKc - nm/
T;
393 template<
class Thermo,
template<
class>
class Type>
399 Thermo::operator+=(st);
403 template<
class Thermo,
template<
class>
class Type>
406 Thermo::operator*=(
s);
412 template<
class Thermo,
template<
class>
class Type>
421 static_cast<const Thermo&
>(st1) +
static_cast<const Thermo&
>(st2)
426 template<
class Thermo,
template<
class>
class Type>
430 const thermo<Thermo, Type>& st
433 return thermo<Thermo, Type>
435 s*
static_cast<const Thermo&
>(st)
440 template<
class Thermo,
template<
class>
class Type>
443 const thermo<Thermo, Type>& st1,
444 const thermo<Thermo, Type>& st2
447 return thermo<Thermo, Type>
449 static_cast<const Thermo&
>(st1) ==
static_cast<const Thermo&
>(st2)
scalar hs(const scalar p, const scalar T) const
scalar Cp(const scalar p, const scalar T) const
scalar ha(const scalar p, const scalar T) const
scalar es(const scalar p, const scalar T) const
scalar ea(const scalar p, const scalar T) const
Istream and Ostream manipulators taking arguments.
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
static unsigned int defaultPrecision()
Return the default precision.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
scalar Tes(const scalar E, const scalar p, const scalar T0) const
Temperature from sensible internal energy.
scalar g(const scalar p, const scalar T) const
Gibbs free energy [J/kg].
scalar Kx(const scalar p, const scalar T) const
Equilibrium constant [] i.t.o. mole-fractions.
scalar Kc(const scalar p, const scalar T) const
Equilibrium constant i.t.o. molar concentration.
scalar a(const scalar p, const scalar T) const
Helmholtz free energy [J/kg].
static word heName()
Name of Enthalpy/Internal energy.
scalar he(const scalar p, const scalar T) const
Enthalpy/Internal energy [J/kg].
scalar K(const scalar p, const scalar T) const
Equilibrium constant [] i.t.o fugacities.
thermo(const Thermo &sp)
Construct from components.
scalar Cpv(const scalar p, const scalar T) const
Heat capacity at constant pressure/volume [J/kg/K].
scalar The(const scalar H, const scalar p, const scalar T0) const
Temperature from enthalpy or internal energy.
scalar THs(const scalar hs, const scalar p, const scalar T0) const
Temperature from sensible enthalpy given an initial T0.
scalar gamma(const scalar p, const scalar T) const
Gamma = Cp/Cv [].
static scalar T(const ThermoType &thermo, const scalar f, const scalar p, const scalar T0, FType F, dFdTType dFdT, LimitType limit, const bool diagnostics=false)
Return the temperature corresponding to the value of the.
scalar Tha(const scalar H, const scalar p, const scalar T0) const
Temperature from absolute enthalpy.
static bool enthalpy()
Return true if energy type is enthalpy.
scalar Tea(const scalar E, const scalar p, const scalar T0) const
Temperature from absolute internal energy.
scalar Kn(const scalar p, const scalar T, const scalar n) const
Equilibrium constant [] i.t.o. number of moles.
scalar dKcdTbyKc(const scalar p, const scalar T) const
Derivative of B (according to Niemeyer et al.)
void operator*=(const scalar)
scalar Kp(const scalar p, const scalar T) const
Equilibrium constant [] i.t.o. partial pressures.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
#define InfoInFunction
Report an information message using Foam::Info.
const dimensionedScalar RR
Universal gas constant: default SI units: [J/kmol/K].
const dimensionedScalar F
Faraday constant: default SI units: [C/kmol].
const dimensionedScalar Pstd
Standard pressure.
bool equal(const T &s1, const T &s2)
dimensionedScalar exp(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
Omanip< int > setw(const int i)
errorManip< error > abort(error &err)
complex limit(const complex &, const complex &)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
scalarList W(const fluidMulticomponentThermo &thermo)
dimensioned< scalar > mag(const dimensioned< Type > &)
prefixOSstream Pout(cout, "Pout")
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
PtrList< volScalarField > & Y