Go to the documentation of this file.
33 template<
class Thermo,
template<
class>
class Type>
43 template<
class Thermo,
template<
class>
class Type>
58 <<
"Negative initial temperature T0: " <<
T0
64 scalar Ttol =
T0*tol_;
72 (Test - ((this->*F)(
p, Test) -
f)/(this->*dFdT)(
p, Test));
74 if (iter++ > maxIter_)
77 <<
"Maximum number of iterations exceeded: " << maxIter_
78 <<
" when starting from T0:" <<
T0
79 <<
" old T:" << Test <<
" new T:" << Tnew
86 }
while (
mag(Tnew - Test) > Ttol);
94 template<
class Thermo,
template<
class>
class Type>
107 template<
class Thermo,
template<
class>
class Type>
111 return Type<thermo<Thermo, Type>>::energyName();
115 template<
class Thermo,
template<
class>
class Type>
119 return Type<thermo<Thermo, Type>>::Cpv(*
this,
p,
T);
123 template<
class Thermo,
template<
class>
class Type>
128 volatile const scalar
Cp = this->
Cp(p,
T);
130 const scalar
Cp = this->
Cp(p,
T);
133 return Cp/(
Cp - this->CpMCv(
p,
T));
137 template<
class Thermo,
template<
class>
class Type>
145 return Type<thermo<Thermo, Type>>::CpByCpv(*
this,
p,
T);
149 template<
class Thermo,
template<
class>
class Type>
153 return Type<thermo<Thermo, Type>>::HE(*
this,
p,
T);
157 template<
class Thermo,
template<
class>
class Type>
161 return this->
Ha(p,
T) -
T*this->S(
p,
T);
165 template<
class Thermo,
template<
class>
class Type>
169 return this->
Ea(p,
T) -
T*this->S(
p,
T);
173 template<
class Thermo,
template<
class>
class Type>
177 return this->
Cp(p,
T)*this->W();
181 template<
class Thermo,
template<
class>
class Type>
185 return this->
Ha(p,
T)*this->W();
189 template<
class Thermo,
template<
class>
class Type>
193 return this->
Hs(p,
T)*this->W();
197 template<
class Thermo,
template<
class>
class Type>
201 return this->Hc()*this->W();
205 template<
class Thermo,
template<
class>
class Type>
209 return this->S(
p,
T)*this->W();
213 template<
class Thermo,
template<
class>
class Type>
217 return this->HE(
p,
T)*this->W();
221 template<
class Thermo,
template<
class>
class Type>
225 return this->
Cv(p,
T)*this->W();
229 template<
class Thermo,
template<
class>
class Type>
233 return this->
Es(p,
T)*this->W();
237 template<
class Thermo,
template<
class>
class Type>
241 return this->
Ea(p,
T)*this->W();
245 template<
class Thermo,
template<
class>
class Type>
249 return this->
G(p,
T)*this->W();
253 template<
class Thermo,
template<
class>
class Type>
257 return this->
A(p,
T)*this->W();
261 template<
class Thermo,
template<
class>
class Type>
265 scalar arg = -this->
Y()*this->
G(
Pstd, T)/(
RR*
T);
278 template<
class Thermo,
template<
class>
class Type>
286 template<
class Thermo,
template<
class>
class Type>
290 const scalar nm = this->
Y()/this->W();
292 if (
equal(nm, SMALL))
303 template<
class Thermo,
template<
class>
class Type>
310 const scalar nm = this->
Y()/this->W();
312 if (
equal(nm, SMALL))
323 template<
class Thermo,
template<
class>
class Type>
331 const scalar nm = this->
Y()/this->W();
333 if (
equal(nm, SMALL))
344 template<
class Thermo,
template<
class>
class Type>
352 return Type<thermo<Thermo, Type>>::THE(*
this,
he,
p,
T0);
356 template<
class Thermo,
template<
class>
class Type>
376 template<
class Thermo,
template<
class>
class Type>
396 template<
class Thermo,
template<
class>
class Type>
416 template<
class Thermo,
template<
class>
class Type>
436 template<
class Thermo,
template<
class>
class Type>
444 const scalar dKcdTbyKc =
445 (this->S(
Pstd,
T) + this->Gstd(
T)/
T)*this->
Y()/(
RR*
T);
447 const scalar nm = this->
Y()/this->W();
448 if (
equal(nm, SMALL))
454 return dKcdTbyKc - nm/
T;
459 template<
class Thermo,
template<
class>
class Type>
463 return this->dCpdT(
p,
T)*this->W();
468 template<
class Thermo,
template<
class>
class Type>
474 Thermo::operator+=(st);
478 template<
class Thermo,
template<
class>
class Type>
481 Thermo::operator*=(
s);
487 template<
class Thermo,
template<
class>
class Type>
496 static_cast<const Thermo&
>(st1) +
static_cast<const Thermo&
>(st2)
501 template<
class Thermo,
template<
class>
class Type>
510 s*
static_cast<const Thermo&
>(st)
515 template<
class Thermo,
template<
class>
class Type>
524 static_cast<const Thermo&
>(st1) ==
static_cast<const Thermo&
>(st2)
const scalar RR
Universal gas constant: default in [J/(kmol K)].
scalar ea(const scalar p, const scalar T) const
Absolute internal energy [J/kmol].
A class for handling words, derived from Foam::string.
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)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
scalar Cpv(const scalar p, const scalar T) const
Heat capacity at constant pressure/volume [J/(kg K)].
const dimensionedScalar G
Newtonian constant of gravitation.
scalar a(const scalar p, const scalar T) const
Helmholtz free energy [J/kmol].
scalar Hs(const scalar p, const scalar T) const
const dimensionedScalar Pstd
Standard pressure.
scalar he(const scalar p, const scalar T) const
Enthalpy/Internal energy [J/kmol].
const volScalarField & Cv
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
volVectorField F(fluid.F())
thermo(const Thermo &sp)
Construct from components.
dimensionedScalar exp(const dimensionedScalar &ds)
scalar THs(const scalar Hs, const scalar p, const scalar T0) const
Temperature from sensible enthalpy given an initial T0.
scalar Kp(const scalar p, const scalar T) const
Equilibrium constant [] i.t.o. partial pressures.
scalar Ea(const scalar p, const scalar T) const
void operator*=(const scalar)
CGAL::Exact_predicates_exact_constructions_kernel K
scalar TEa(const scalar E, const scalar p, const scalar T0) const
Temperature from absolute internal energy.
static word heName()
Name of Enthalpy/Internal energy.
scalar THE(const scalar H, const scalar p, const scalar T0) const
Temperature from enthalpy or internal energy.
scalar K(const scalar p, const scalar T) const
Equilibrium constant [] i.t.o fugacities.
scalar hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kmol].
scalar dcpdT(const scalar p, const scalar T) const
Derivative of cp w.r.t. temperature.
scalar hc() const
Chemical enthalpy [J/kmol].
scalar s(const scalar p, const scalar T) const
Entropy [J/(kmol K)].
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
scalar es(const scalar p, const scalar T) const
Sensible internal energy [J/kmol].
scalar CpByCpv(const scalar p, const scalar T) const
Ratio of heat capacity at constant pressure to that at.
errorManip< error > abort(error &err)
PtrList< volScalarField > & Y
scalar G(const scalar p, const scalar T) const
Gibbs free energy [J/kg].
scalar ha(const scalar p, const scalar T) const
Absolute Enthalpy [J/kmol].
scalar Kn(const scalar p, const scalar T, const scalar n) const
Equilibrium constant [] i.t.o. number of moles.
scalar cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/(kmol K)].
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
scalar dKcdTbyKc(const scalar p, const scalar T) const
Derivative of B (acooding to Niemeyer et al.) w.r.t. temperature.
scalar Es(const scalar p, const scalar T) const
scalar A(const scalar p, const scalar T) const
Helmholtz free energy [J/kg].
scalar TEs(const scalar E, const scalar p, const scalar T0) const
Temperature from sensible internal energy.
scalar Kx(const scalar p, const scalar T) const
Equilibrium constant [] i.t.o. mole-fractions.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const volScalarField & Cp
scalar Ha(const scalar p, const scalar T) const
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
scalar gamma(const scalar p, const scalar T) const
Gamma = Cp/Cv [].
scalar g(const scalar p, const scalar T) const
Gibbs free energy [J/kmol].
scalar HE(const scalar p, const scalar T) const
Enthalpy/Internal energy [J/kg].
scalar Kc(const scalar p, const scalar T) const
Equilibrium constant i.t.o. molar concentration.
scalar THa(const scalar H, const scalar p, const scalar T0) const
Temperature from absolute enthalpy.
scalar cv(const scalar p, const scalar T) const
Heat capacity at constant volume [J/(kmol K)].