30 template<
class EquationOfState,
int PolySize>
33 const EquationOfState& pt,
50 template<
class EquationOfState,
int PolySize>
57 EquationOfState(
name, pt),
60 CpCoeffs_(pt.CpCoeffs_),
61 hCoeffs_(pt.hCoeffs_),
68 template<
class EquationOfState,
int PolySize>
78 template<
class EquationOfState,
int PolySize>
89 template<
class EquationOfState,
int PolySize>
96 return Ha(
p,
T) - Hf();
100 template<
class EquationOfState,
int PolySize>
107 return hCoeffs_.value(
T) + EquationOfState::H(
p,
T);
111 template<
class EquationOfState,
int PolySize>
119 template<
class EquationOfState,
int PolySize>
130 template<
class EquationOfState,
int PolySize>
136 return hCoeffs_.value(
T) - sCoeffs_.value(
T)*
T;
140 template<
class EquationOfState,
int PolySize>
149 CpCoeffs_.derivative(
T)
156 template<
class EquationOfState,
int PolySize>
162 scalar Y1 = this->
Y();
164 EquationOfState::operator+=(pt);
166 if (
mag(this->
Y()) > small)
169 const scalar Y2 = pt.Y()/this->
Y();
171 Hf_ = Y1*Hf_ + Y2*pt.Hf_;
172 Sf_ = Y1*Sf_ + Y2*pt.Sf_;
173 CpCoeffs_ = Y1*CpCoeffs_ + Y2*pt.CpCoeffs_;
174 hCoeffs_ = Y1*hCoeffs_ + Y2*pt.hCoeffs_;
175 sCoeffs_ = Y1*sCoeffs_ + Y2*pt.sCoeffs_;
180 template<
class EquationOfState,
int PolySize>
186 EquationOfState::operator*=(
s);
192 template<
class EquationOfState,
int PolySize>
199 EquationOfState eofs = pt1;
202 if (
mag(eofs.Y()) < small)
215 const scalar Y1 = pt1.Y()/eofs.Y();
216 const scalar Y2 = pt2.Y()/eofs.Y();
218 return hPolynomialThermo<EquationOfState, PolySize>
221 Y1*pt1.Hf_ + Y2*pt2.Hf_,
222 Y1*pt1.Sf_ + Y2*pt2.Sf_,
223 Y1*pt1.CpCoeffs_ + Y2*pt2.CpCoeffs_,
224 Y1*pt1.hCoeffs_ + Y2*pt2.hCoeffs_,
225 Y1*pt1.sCoeffs_ + Y2*pt2.sCoeffs_
231 template<
class EquationOfState,
int PolySize>
235 const hPolynomialThermo<EquationOfState, PolySize>& pt
238 return hPolynomialThermo<EquationOfState, PolySize>
240 s*
static_cast<const EquationOfState&
>(pt),
250 template<
class EquationOfState,
int PolySize>
253 const hPolynomialThermo<EquationOfState, PolySize>& pt1,
254 const hPolynomialThermo<EquationOfState, PolySize>& pt2
259 static_cast<const EquationOfState&
>(pt1)
260 ==
static_cast<const EquationOfState&
>(pt2)
263 const scalar Y1 = pt1.Y()/eofs.Y();
264 const scalar Y2 = pt2.Y()/eofs.Y();
266 return hPolynomialThermo<EquationOfState, PolySize>
269 Y2*pt2.Hf_ - Y1*pt1.Hf_,
270 Y2*pt2.Sf_ - Y1*pt1.Sf_,
271 Y2*pt2.CpCoeffs_ - Y1*pt1.CpCoeffs_,
272 Y2*pt2.hCoeffs_ - Y1*pt1.hCoeffs_,
273 Y2*pt2.sCoeffs_ - Y1*pt1.sCoeffs_
scalar Ha(const scalar p, const scalar T) const
scalar Cp(const scalar p, const scalar T) const
Polynomial templated on size (order):
Enthalpy based thermodynamics package using a polynomial function of temperature for the constant hea...
scalar Hf() const
Enthalpy of formation [J/kg].
hPolynomialThermo(const EquationOfState &pt, const scalar Hf, const scalar Sf, const Polynomial< PolySize > &CpCoeffs, const typename Polynomial< PolySize >::intPolyType &hCoeffs, const Polynomial< PolySize > &sCoeffs)
Construct from components.
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
scalar dCpdT(const scalar p, const scalar T) const
Temperature derivative of heat capacity at constant pressure.
scalar Cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/kg/K].
scalar S(const scalar p, const scalar T) const
Entropy [J/kg/K].
scalar Ha(const scalar p, const scalar T) const
Absolute enthalpy [J/kg].
scalar limit(const scalar) const
Limit the temperature to be in the range Tlow_ to Thigh_.
scalar Gstd(const scalar T) const
Gibbs free energy of the mixture in the standard state [J/kg].
A class for handling words, derived from string.
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))
tmp< VolField< Type > > Sp(const volScalarField &sp, const VolField< Type > &vf)
dimensioned< scalar > mag(const dimensioned< Type > &)
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