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);
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>
505 const thermo<Thermo, Type>& st
508 return thermo<Thermo, Type>
510 s*
static_cast<const Thermo&
>(st)
515 template<
class Thermo,
template<
class>
class Type>
518 const thermo<Thermo, Type>& st1,
519 const thermo<Thermo, Type>& st2
522 return thermo<Thermo, Type>
524 static_cast<const Thermo&
>(st1) == static_cast<const Thermo&>(st2)
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 (acooding to Niemeyer et al.) w.r.t. temperature.
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].
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
scalar Hs(const scalar p, const scalar T) const
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
bool equal(const T &a, const T &b)
Compare two values for equality.
#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
const dimensionedScalar G
Newtonian constant of gravitation.
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)].
scalar Kx(const scalar p, const scalar T) const
Equilibrium constant [] i.t.o. mole-fractions.
const volScalarField & Cv
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 CpByCpv(const scalar p, const scalar T) const
Ratio of heat capacity at constant pressure to that at.
scalar THa(const scalar H, const scalar p, const scalar T0) const
Temperature from absolute enthalpy.
scalar HE(const scalar p, const scalar T) const
Enthalpy/Internal energy [J/kg].
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
dimensionedScalar exp(const dimensionedScalar &ds)
A class for handling words, derived from Foam::string.
complex limit(const complex &c1, const complex &c2)
scalar hc() const
Chemical enthalpy [J/kmol].
volVectorField F(fluid.F())
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 [].
const dimensionedScalar Pstd
Standard pressure.
errorManip< error > abort(error &err)
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
scalar a(const scalar p, const scalar T) const
Helmholtz free energy [J/kmol].
scalar cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/(kmol K)].
const volScalarField & Cp
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
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)
PtrList< volScalarField > & Y
void operator*=(const scalar)
thermo(const Thermo &sp)
Construct from components.
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.
scalar Ha(const scalar p, const scalar T) const
const scalar RR
Universal gas constant: default in [J/(kmol K)].
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].
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))
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
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.