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 return this->
Cp(p,
T)*this->
W();
120 template<
class Thermo,
template<
class>
class Type>
124 return this->
Ha(p,
T)*this->
W();
128 template<
class Thermo,
template<
class>
class Type>
132 return this->
Hs(p,
T)*this->
W();
136 template<
class Thermo,
template<
class>
class Type>
140 return this->Hf()*this->
W();
144 template<
class Thermo,
template<
class>
class Type>
148 return this->
S(p,
T)*this->
W();
152 template<
class Thermo,
template<
class>
class Type>
156 return this->HE(
p,
T)*this->
W();
160 template<
class Thermo,
template<
class>
class Type>
164 return this->
Cv(p,
T)*this->
W();
168 template<
class Thermo,
template<
class>
class Type>
172 return this->
Es(p,
T)*this->
W();
176 template<
class Thermo,
template<
class>
class Type>
180 return this->
Ea(p,
T)*this->
W();
184 template<
class Thermo,
template<
class>
class Type>
188 return this->
G(p,
T)*this->
W();
192 template<
class Thermo,
template<
class>
class Type>
196 return this->
A(p,
T)*this->
W();
200 template<
class Thermo,
template<
class>
class Type>
204 scalar arg = -this->
Y()*this->Gstd(
T)/(
RR*
T);
217 template<
class Thermo,
template<
class>
class Type>
225 template<
class Thermo,
template<
class>
class Type>
229 const scalar nm = this->
Y()/this->
W();
231 if (
equal(nm, small))
242 template<
class Thermo,
template<
class>
class Type>
249 const scalar nm = this->
Y()/this->
W();
251 if (
equal(nm, small))
262 template<
class Thermo,
template<
class>
class Type>
270 const scalar nm = this->
Y()/this->
W();
272 if (
equal(nm, small))
284 template<
class Thermo,
template<
class>
class Type>
285 template<
class ThermoType,
class FType,
class dFdTType,
class LimitType>
295 const bool diagnostics
301 <<
"Negative initial temperature T0: " <<
T0
307 scalar Ttol =
T0*tol_;
315 <<
"Energy -> temperature conversion failed to converge:" <<
endl;
317 <<
setw(width) <<
"Test"
318 <<
setw(width) <<
"e/h"
319 <<
setw(width) <<
"Cv/p"
320 <<
setw(width) <<
"Tnew"
335 <<
setw(width) << Test
338 <<
setw(width) << Tnew
342 if (iter++ > maxIter_)
350 <<
"Maximum number of iterations exceeded: " << maxIter_
354 }
while (
mag(Tnew - Test) > Ttol);
360 template<
class Thermo,
template<
class>
class Type>
368 return Type<thermo<Thermo, Type>>::THE(*
this,
he,
p,
T0);
372 template<
class Thermo,
template<
class>
class Type>
393 template<
class Thermo,
template<
class>
class Type>
414 template<
class Thermo,
template<
class>
class Type>
435 template<
class Thermo,
template<
class>
class Type>
456 template<
class Thermo,
template<
class>
class Type>
464 const scalar dKcdTbyKc =
465 (this->
S(
Pstd, T) + this->Gstd(
T)/
T)*this->
Y()/(
RR*
T);
467 const scalar nm = this->
Y()/this->
W();
468 if (
equal(nm, small))
474 return dKcdTbyKc - nm/
T;
479 template<
class Thermo,
template<
class>
class Type>
483 return this->dCpdT(
p,
T)*this->
W();;
489 template<
class Thermo,
template<
class>
class Type>
495 Thermo::operator+=(st);
499 template<
class Thermo,
template<
class>
class Type>
502 Thermo::operator*=(
s);
508 template<
class Thermo,
template<
class>
class Type>
517 static_cast<const Thermo&
>(st1) +
static_cast<const Thermo&
>(st2)
522 template<
class Thermo,
template<
class>
class Type>
526 const thermo<Thermo, Type>& st
529 return thermo<Thermo, Type>
531 s*
static_cast<const Thermo&
>(st)
536 template<
class Thermo,
template<
class>
class Type>
539 const thermo<Thermo, Type>& st1,
540 const thermo<Thermo, Type>& st2
543 return thermo<Thermo, Type>
545 static_cast<const Thermo&
>(st1) ==
static_cast<const Thermo&
>(st2)
static const Foam::dimensionedScalar A("A", Foam::dimPressure, 611.21)
scalar Ha(const scalar p, const scalar T) const
scalar Hs(const scalar p, const scalar T) const
scalar Cp(const scalar p, const scalar T) const
scalar Cv(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 g(const scalar p, const scalar T) const
Gibbs free energy [J/kmol].
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 G(const scalar p, const scalar T) const
Gibbs free energy [J/kg].
scalar TEs(const scalar E, const scalar p, const scalar T0) const
Temperature from sensible internal energy.
scalar THE(const scalar H, const scalar p, const scalar T0) const
Temperature from enthalpy or internal energy.
scalar HE(const scalar p, const scalar T) const
Enthalpy/Internal energy [J/kg].
scalar s(const scalar p, const scalar T) const
Entropy [J/kmol/K].
scalar a(const scalar p, const scalar T) const
Helmholtz free energy [J/kmol].
scalar TEa(const scalar E, const scalar p, const scalar T0) const
Temperature from absolute internal energy.
scalar hc() const
Enthalpy of formation [J/kmol].
static word heName()
Name of Enthalpy/Internal energy.
scalar he(const scalar p, const scalar T) const
Enthalpy/Internal energy [J/kmol].
scalar ea(const scalar p, const scalar T) const
Absolute internal energy [J/kmol].
scalar K(const scalar p, const scalar T) const
Equilibrium constant [] i.t.o fugacities.
scalar cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/kmol/K].
scalar cv(const scalar p, const scalar T) const
Heat capacity at constant volume [J/kmol/K].
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 ha(const scalar p, const scalar T) const
Absolute enthalpy [J/kmol].
scalar A(const scalar p, const scalar T) const
Helmholtz free energy [J/kg].
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.
static bool enthalpy()
Return true if energy type is enthalpy.
scalar es(const scalar p, const scalar T) const
Sensible internal energy [J/kmol].
scalar THa(const scalar H, const scalar p, const scalar T0) const
Temperature from absolute enthalpy.
scalar dcpdT(const scalar p, const scalar T) const
Derivative of cp w.r.t. temperature.
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.)
scalar THs(const scalar Hs, const scalar p, const scalar T0) const
Temperature from sensible enthalpy given an initial T0.
void operator*=(const scalar)
scalar hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kmol].
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/mol].
const dimensionedScalar Pstd
Standard pressure.
const dimensionedScalar G
Newtonian constant of gravitation.
tmp< fvMatrix< Type > > S(const Pair< tmp< volScalarField::Internal >> &, const VolField< Type > &)
bool equal(const T &s1, const T &s2)
dimensionedScalar exp(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
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")
word name(const complex &)
Return a string representation of a complex.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
PtrList< volScalarField > & Y