31 template<
class Thermo,
template<
class>
class Type>
41 template<
class Thermo,
template<
class>
class Type>
54 template<
class Thermo,
template<
class>
class Type>
58 return Type<thermo<Thermo, Type>>::enthalpy();
62 template<
class Thermo,
template<
class>
class Type>
66 return Type<thermo<Thermo, Type>>::energyName();
70 template<
class Thermo,
template<
class>
class Type>
74 return Type<thermo<Thermo, Type>>::Cpv(*
this, p, T);
78 template<
class Thermo,
template<
class>
class Type>
82 const scalar
Cp = this->
Cp(p, T);
83 return Cp/(Cp - this->CpMCv(p, T));
87 template<
class Thermo,
template<
class>
class Type>
91 return Type<thermo<Thermo, Type>>::HE(*
this, p, T);
95 template<
class Thermo,
template<
class>
class Type>
99 return this->
Ha(p, T) - T*this->
S(p, T);
103 template<
class Thermo,
template<
class>
class Type>
107 return this->
Ea(p, T) - T*this->
S(p, T);
111 template<
class Thermo,
template<
class>
class Type>
115 return this->
Cp(p, T)*this->
W();
119 template<
class Thermo,
template<
class>
class Type>
123 return this->
Ha(p, T)*this->
W();
127 template<
class Thermo,
template<
class>
class Type>
131 return this->
Hs(p, T)*this->
W();
135 template<
class Thermo,
template<
class>
class Type>
139 return this->Hf()*this->
W();
143 template<
class Thermo,
template<
class>
class Type>
147 return this->
S(p, T)*this->
W();
151 template<
class Thermo,
template<
class>
class Type>
155 return this->HE(p, T)*this->
W();
159 template<
class Thermo,
template<
class>
class Type>
163 return this->
Cv(p, T)*this->
W();
167 template<
class Thermo,
template<
class>
class Type>
171 return this->
Es(p, T)*this->
W();
175 template<
class Thermo,
template<
class>
class Type>
179 return this->
Ea(p, T)*this->
W();
183 template<
class Thermo,
template<
class>
class Type>
187 return this->
G(p, T)*this->
W();
191 template<
class Thermo,
template<
class>
class Type>
195 return this->A(p, T)*this->
W();
199 template<
class Thermo,
template<
class>
class Type>
203 scalar arg = -this->
Y()*this->Gstd(T)/(
RR*
T);
216 template<
class Thermo,
template<
class>
class Type>
224 template<
class Thermo,
template<
class>
class Type>
228 const scalar nm = this->
Y()/this->
W();
230 if (
equal(nm, small))
241 template<
class Thermo,
template<
class>
class Type>
248 const scalar nm = this->
Y()/this->
W();
250 if (
equal(nm, small))
256 return Kp(p, T)*
pow(
Pstd/p, nm);
261 template<
class Thermo,
template<
class>
class Type>
269 const scalar nm = this->
Y()/this->
W();
271 if (
equal(nm, small))
277 return Kp(p, T)*
pow(n*
Pstd/p, nm);
283 template<
class Thermo,
template<
class>
class Type>
284 template<
class ThermoType,
class FType,
class dFdTType,
class LimitType>
287 const ThermoType& thermo,
294 const bool diagnostics
300 <<
"Negative initial temperature T0: " << T0
306 scalar Ttol = T0*tol_;
311 const unsigned int width = IOstream::defaultPrecision() + 8;
314 <<
"Energy -> temperature conversion failed to converge:" <<
endl;
316 <<
setw(width) <<
"Test" 317 <<
setw(width) <<
"e/h" 318 <<
setw(width) <<
"Cv/p" 319 <<
setw(width) <<
"Tnew" 327 (Test - ((thermo.*F)(p, Test) - f)/(thermo.*dFdT)(p, Test));
331 const unsigned int width = IOstream::defaultPrecision() + 8;
334 <<
setw(width) << Test
335 <<
setw(width) << ((thermo.*
F)(p, Test))
336 <<
setw(width) << ((thermo.*dFdT)(p, Test))
337 <<
setw(width) << Tnew
341 if (iter++ > maxIter_)
345 T(thermo, f, p, T0, F, dFdT, limit,
true);
349 <<
"Maximum number of iterations exceeded: " << maxIter_
353 }
while (
mag(Tnew - Test) > Ttol);
359 template<
class Thermo,
template<
class>
class Type>
367 return Type<thermo<Thermo, Type>>::THE(*
this, he, p, T0);
371 template<
class Thermo,
template<
class>
class Type>
392 template<
class Thermo,
template<
class>
class Type>
413 template<
class Thermo,
template<
class>
class Type>
434 template<
class Thermo,
template<
class>
class Type>
455 template<
class Thermo,
template<
class>
class Type>
463 const scalar dKcdTbyKc =
464 (this->
S(
Pstd, T) + this->Gstd(T)/
T)*this->
Y()/(
RR*
T);
466 const scalar nm = this->
Y()/this->
W();
467 if (
equal(nm, small))
473 return dKcdTbyKc - nm/
T;
478 template<
class Thermo,
template<
class>
class Type>
482 return this->dCpdT(p, T)*this->
W();;
488 template<
class Thermo,
template<
class>
class Type>
489 inline void Foam::species::thermo<Thermo, Type>::operator+=
494 Thermo::operator+=(st);
498 template<
class Thermo,
template<
class>
class Type>
501 Thermo::operator*=(s);
507 template<
class Thermo,
template<
class>
class Type>
516 static_cast<const Thermo&
>(st1) + static_cast<const Thermo&>(st2)
521 template<
class Thermo,
template<
class>
class Type>
530 s*
static_cast<const Thermo&
>(st)
535 template<
class Thermo,
template<
class>
class Type>
544 static_cast<const Thermo&
>(st1) == static_cast<const Thermo&>(st2)
scalar Cv(const scalar p, const scalar T) const
void limit(const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phi, surfaceScalarField &phiPsi, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin, const bool returnCorr)
scalar TEs(const scalar E, const scalar p, const scalar T0) const
Temperature from sensible internal energy.
scalar dKcdTbyKc(const scalar p, const scalar T) const
Derivative of B (according to Niemeyer et al.)
const dimensionedScalar F
Faraday constant: default SI units: [C/mol].
scalar G(const scalar p, const scalar T) const
Gibbs free energy [J/kg].
scalar A(const scalar p, const scalar T) const
Helmholtz free energy [J/kg].
scalar Hs(const scalar p, const scalar T) const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
scalar ha(const scalar p, const scalar T) const
Absolute enthalpy [J/kmol].
scalar he(const scalar p, const scalar T) const
Enthalpy/Internal energy [J/kmol].
scalar Es(const scalar p, const scalar T) const
static bool enthalpy()
Return true if energy type is enthalpy.
scalar Kn(const scalar p, const scalar T, const scalar n) const
Equilibrium constant [] i.t.o. number of moles.
scalar dcpdT(const scalar p, const scalar T) const
Derivative of cp w.r.t. temperature.
scalar s(const scalar p, const scalar T) const
Entropy [J/kmol/K].
Ostream & endl(Ostream &os)
Add newline and flush stream.
scalar Kx(const scalar p, const scalar T) const
Equilibrium constant [] i.t.o. mole-fractions.
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.
const dimensionedScalar G
Newtonian constant of gravitation.
scalar g(const scalar p, const scalar T) const
Gibbs free energy [J/kmol].
CGAL::Exact_predicates_exact_constructions_kernel K
static word heName()
Name of Enthalpy/Internal energy.
scalar THa(const scalar H, const scalar p, const scalar T0) const
Temperature from absolute enthalpy.
const dimensionedScalar RR
Universal gas constant: default SI units: [J/kmol/K].
scalar HE(const scalar p, const scalar T) const
Enthalpy/Internal energy [J/kg].
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.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
dimensionedScalar exp(const dimensionedScalar &ds)
A class for handling words, derived from string.
tmp< fvMatrix< Type > > S(const Pair< tmp< volScalarField::Internal >> &, const GeometricField< Type, fvPatchField, volMesh > &)
scalar hc() const
Enthalpy of formation [J/kmol].
scalar Cpv(const scalar p, const scalar T) const
Heat capacity at constant pressure/volume [J/kg/K].
scalar gamma(const scalar p, const scalar T) const
Gamma = Cp/Cv [].
errorManip< error > abort(error &err)
scalar a(const scalar p, const scalar T) const
Helmholtz free energy [J/kmol].
Istream and Ostream manipulators taking arguments.
scalar cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/kmol/K].
const dimensionedScalar Pstd
Standard pressure.
scalar ea(const scalar p, const scalar T) const
Absolute internal energy [J/kmol].
scalar TEa(const scalar E, const scalar p, const scalar T0) const
Temperature from absolute internal energy.
scalar hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kmol].
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
bool equal(const T &s1, const T &s2)
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
prefixOSstream Pout(cout, "Pout")
const scalarList W(::W(thermo))
PtrList< volScalarField > & Y
void operator*=(const scalar)
thermo(const Thermo &sp)
Construct from components.
scalar Cp(const scalar p, const scalar T) const
scalar Kc(const scalar p, const scalar T) const
Equilibrium constant i.t.o. molar concentration.
scalar THs(const scalar Hs, const scalar p, const scalar T0) const
Temperature from sensible enthalpy given an initial T0.
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar Ha(const scalar p, const scalar T) const
Omanip< int > setw(const int i)
scalar cv(const scalar p, const scalar T) const
Heat capacity at constant volume [J/kmol/K].
scalar es(const scalar p, const scalar T) const
Sensible internal energy [J/kmol].
scalar K(const scalar p, const scalar T) const
Equilibrium constant [] i.t.o fugacities.
scalar Ea(const scalar p, const scalar T) const
scalar THE(const scalar H, const scalar p, const scalar T0) const
Temperature from enthalpy or internal energy.
scalar Kp(const scalar p, const scalar T) const
Equilibrium constant [] i.t.o. partial pressures.
#define InfoInFunction
Report an information message using Foam::Info.