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>
83 const scalar p,
const scalar T
90 template<
class EquationOfState,
int PolySize>
93 const scalar p,
const scalar T
96 return hCoeffs_.value(T) + EquationOfState::H(p, T);
100 template<
class EquationOfState,
int PolySize>
103 const scalar p,
const scalar T
106 return Ha(p, T) -
Hc();
110 template<
class EquationOfState,
int PolySize>
118 template<
class EquationOfState,
int PolySize>
125 return sCoeffs_.value(T) + EquationOfState::S(p, T);
129 template<
class EquationOfState,
int PolySize>
138 hCoeffs_.derivative(T)
139 - T*sCoeffs_.derivative(T)
145 template<
class EquationOfState,
int PolySize>
154 CpCoeffs_.derivative(T)
161 template<
class EquationOfState,
int PolySize>
162 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator+=
167 scalar Y1 = this->
Y();
169 EquationOfState::operator+=(pt);
171 if (
mag(this->
Y()) > small)
174 const scalar Y2 = pt.Y()/this->
Y();
176 Hf_ = Y1*Hf_ + Y2*pt.Hf_;
177 Sf_ = Y1*Sf_ + Y2*pt.Sf_;
178 CpCoeffs_ = Y1*CpCoeffs_ + Y2*pt.CpCoeffs_;
179 hCoeffs_ = Y1*hCoeffs_ + Y2*pt.hCoeffs_;
180 sCoeffs_ = Y1*sCoeffs_ + Y2*pt.sCoeffs_;
185 template<
class EquationOfState,
int PolySize>
186 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator*=
191 EquationOfState::operator*=(s);
197 template<
class EquationOfState,
int PolySize>
204 EquationOfState eofs = pt1;
207 if (
mag(eofs.Y()) < small)
220 const scalar Y1 = pt1.Y()/eofs.Y();
221 const scalar Y2 = pt2.Y()/eofs.Y();
226 Y1*pt1.Hf_ + Y2*pt2.Hf_,
227 Y1*pt1.Sf_ + Y2*pt2.Sf_,
228 Y1*pt1.CpCoeffs_ + Y2*pt2.CpCoeffs_,
229 Y1*pt1.hCoeffs_ + Y2*pt2.hCoeffs_,
230 Y1*pt1.sCoeffs_ + Y2*pt2.sCoeffs_
236 template<
class EquationOfState,
int PolySize>
245 s*
static_cast<const EquationOfState&
>(pt),
255 template<
class EquationOfState,
int PolySize>
264 static_cast<const EquationOfState&>(pt1)
265 == static_cast<const EquationOfState&>(pt2)
268 const scalar Y1 = pt1.Y()/eofs.Y();
269 const scalar Y2 = pt2.Y()/eofs.Y();
274 Y2*pt2.Hf_ - Y1*pt1.Hf_,
275 Y2*pt2.Sf_ - Y1*pt1.Sf_,
276 Y2*pt2.CpCoeffs_ - Y1*pt1.CpCoeffs_,
277 Y2*pt2.hCoeffs_ - Y1*pt1.hCoeffs_,
278 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].
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 Hc() const
Chemical enthalpy [J/kg].
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 dGdT(const scalar p, const scalar T) const
Derivative of Gibbs free energy w.r.t. temperature.
scalar Cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/kg/K].