30 template<
class EquationOfState,
int PolySize>
33 const EquationOfState& pt,
36 const Polynomial<PolySize>& CpCoeffs,
37 const typename Polynomial<PolySize>::intPolyType& hCoeffs,
38 const Polynomial<PolySize>& sCoeffs
52 template<
class EquationOfState,
int PolySize>
59 EquationOfState(name, pt),
62 CpCoeffs_(pt.CpCoeffs_),
63 hCoeffs_(pt.hCoeffs_),
70 template<
class EquationOfState,
int PolySize>
80 template<
class EquationOfState,
int PolySize>
91 template<
class EquationOfState,
int PolySize>
98 return Ha(p, T) -
Hf();
102 template<
class EquationOfState,
int PolySize>
109 return hCoeffs_.value(T) + EquationOfState::H(p, T);
113 template<
class EquationOfState,
int PolySize>
121 template<
class EquationOfState,
int PolySize>
132 template<
class EquationOfState,
int PolySize>
138 return hCoeffs_.value(T) - sCoeffs_.value(T)*
T;
142 template<
class EquationOfState,
int PolySize>
151 CpCoeffs_.derivative(T)
158 template<
class EquationOfState,
int PolySize>
159 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator+=
164 scalar Y1 = this->
Y();
166 EquationOfState::operator+=(pt);
168 if (
mag(this->
Y()) > small)
171 const scalar Y2 = pt.Y()/this->
Y();
173 Hf_ = Y1*Hf_ + Y2*pt.Hf_;
174 Sf_ = Y1*Sf_ + Y2*pt.Sf_;
175 CpCoeffs_ = Y1*CpCoeffs_ + Y2*pt.CpCoeffs_;
176 hCoeffs_ = Y1*hCoeffs_ + Y2*pt.hCoeffs_;
177 sCoeffs_ = Y1*sCoeffs_ + Y2*pt.sCoeffs_;
182 template<
class EquationOfState,
int PolySize>
183 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator*=
188 EquationOfState::operator*=(s);
194 template<
class EquationOfState,
int PolySize>
201 EquationOfState eofs = pt1;
204 if (
mag(eofs.Y()) < small)
217 const scalar Y1 = pt1.Y()/eofs.Y();
218 const scalar Y2 = pt2.Y()/eofs.Y();
223 Y1*pt1.Hf_ + Y2*pt2.Hf_,
224 Y1*pt1.Sf_ + Y2*pt2.Sf_,
225 Y1*pt1.CpCoeffs_ + Y2*pt2.CpCoeffs_,
226 Y1*pt1.hCoeffs_ + Y2*pt2.hCoeffs_,
227 Y1*pt1.sCoeffs_ + Y2*pt2.sCoeffs_
233 template<
class EquationOfState,
int PolySize>
242 s*
static_cast<const EquationOfState&
>(pt),
252 template<
class EquationOfState,
int PolySize>
261 static_cast<const EquationOfState&>(pt1)
262 == static_cast<const EquationOfState&>(pt2)
265 const scalar Y1 = pt1.Y()/eofs.Y();
266 const scalar Y2 = pt2.Y()/eofs.Y();
271 Y2*pt2.Hf_ - Y1*pt1.Hf_,
272 Y2*pt2.Sf_ - Y1*pt1.Sf_,
273 Y2*pt2.CpCoeffs_ - Y1*pt1.CpCoeffs_,
274 Y2*pt2.hCoeffs_ - Y1*pt1.hCoeffs_,
275 Y2*pt2.sCoeffs_ - Y1*pt1.sCoeffs_
scalar S(const scalar p, const scalar T) const
Entropy [J/kg/K].
scalar dCpdT(const scalar p, const scalar T) const
Temperature derivative of heat capacity at constant pressure.
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
scalar Gstd(const scalar T) const
Gibbs free energy of the mixture in the standard state [J/kg].
Thermodynamics package templated on the equation of state, using polynomial functions for cp...
scalar Ha(const scalar p, const scalar T) const
Absolute enthalpy [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))
A class for handling words, derived from string.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
scalar Hf() const
Enthalpy of formation [J/kg].
const tmp< volScalarField::Internal > & Sp
scalar limit(const scalar) const
Limit the temperature to be in the range Tlow_ to Thigh_.
PtrList< volScalarField > & Y
scalar Cp(const scalar p, const scalar T) const
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar Cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/kg/K].