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
86 return CpCoeffs_.value(T) + EquationOfState::Cp(p, 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);
131 template<
class EquationOfState,
int PolySize>
132 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator=
137 EquationOfState::operator=(pt);
141 CpCoeffs_ = pt.CpCoeffs_;
142 hCoeffs_ = pt.hCoeffs_;
143 sCoeffs_ = pt.sCoeffs_;
147 template<
class EquationOfState,
int PolySize>
148 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator+=
153 scalar
Y1 = this->
Y();
155 EquationOfState::operator+=(pt);
157 if (
mag(this->
Y()) > SMALL)
160 const scalar
Y2 = pt.Y()/this->
Y();
162 Hf_ = Y1*Hf_ + Y2*pt.Hf_;
163 Sf_ = Y1*Sf_ + Y2*pt.Sf_;
164 CpCoeffs_ = Y1*CpCoeffs_ + Y2*pt.CpCoeffs_;
165 hCoeffs_ = Y1*hCoeffs_ + Y2*pt.hCoeffs_;
166 sCoeffs_ = Y1*sCoeffs_ + Y2*pt.sCoeffs_;
171 template<
class EquationOfState,
int PolySize>
172 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator*=
177 EquationOfState::operator*=(s);
183 template<
class EquationOfState,
int PolySize>
190 EquationOfState eofs = pt1;
193 if (
mag(eofs.Y()) < SMALL)
206 const scalar
Y1 = pt1.Y()/eofs.Y();
207 const scalar
Y2 = pt2.Y()/eofs.Y();
212 Y1*pt1.Hf_ + Y2*pt2.Hf_,
213 Y1*pt1.Sf_ + Y2*pt2.Sf_,
214 Y1*pt1.CpCoeffs_ + Y2*pt2.CpCoeffs_,
215 Y1*pt1.hCoeffs_ + Y2*pt2.hCoeffs_,
216 Y1*pt1.sCoeffs_ + Y2*pt2.sCoeffs_
222 template<
class EquationOfState,
int PolySize>
231 s*
static_cast<const EquationOfState&
>(pt),
241 template<
class EquationOfState,
int PolySize>
250 static_cast<const EquationOfState&>(pt1)
251 == static_cast<const EquationOfState&>(pt2)
254 const scalar
Y1 = pt1.Y()/eofs.Y();
255 const scalar
Y2 = pt2.Y()/eofs.Y();
260 Y2*pt2.Hf_ - Y1*pt1.Hf_,
261 Y2*pt2.Sf_ - Y1*pt1.Sf_,
262 Y2*pt2.CpCoeffs_ - Y1*pt1.CpCoeffs_,
263 Y2*pt2.hCoeffs_ - Y1*pt1.hCoeffs_,
264 Y2*pt2.sCoeffs_ - Y1*pt1.sCoeffs_
PtrList< volScalarField > & Y1
scalar S(const scalar p, const scalar T) const
Entropy [J/(kg K)].
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].
PtrList< volScalarField > & Y2
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
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar Cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/(kg K)].