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);
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 EquationOfState::operator=(pt);
171 CpCoeffs_ = pt.CpCoeffs_;
172 hCoeffs_ = pt.hCoeffs_;
173 sCoeffs_ = pt.sCoeffs_;
177 template<
class EquationOfState,
int PolySize>
178 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator+=
183 scalar Y1 = this->
Y();
185 EquationOfState::operator+=(pt);
187 if (
mag(this->
Y()) > small)
190 const scalar Y2 = pt.Y()/this->
Y();
192 Hf_ = Y1*Hf_ + Y2*pt.Hf_;
193 Sf_ = Y1*Sf_ + Y2*pt.Sf_;
194 CpCoeffs_ = Y1*CpCoeffs_ + Y2*pt.CpCoeffs_;
195 hCoeffs_ = Y1*hCoeffs_ + Y2*pt.hCoeffs_;
196 sCoeffs_ = Y1*sCoeffs_ + Y2*pt.sCoeffs_;
201 template<
class EquationOfState,
int PolySize>
202 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator*=
207 EquationOfState::operator*=(s);
213 template<
class EquationOfState,
int PolySize>
220 EquationOfState eofs = pt1;
223 if (
mag(eofs.Y()) < small)
236 const scalar Y1 = pt1.Y()/eofs.Y();
237 const scalar Y2 = pt2.Y()/eofs.Y();
242 Y1*pt1.Hf_ + Y2*pt2.Hf_,
243 Y1*pt1.Sf_ + Y2*pt2.Sf_,
244 Y1*pt1.CpCoeffs_ + Y2*pt2.CpCoeffs_,
245 Y1*pt1.hCoeffs_ + Y2*pt2.hCoeffs_,
246 Y1*pt1.sCoeffs_ + Y2*pt2.sCoeffs_
252 template<
class EquationOfState,
int PolySize>
261 s*
static_cast<const EquationOfState&
>(pt),
271 template<
class EquationOfState,
int PolySize>
280 static_cast<const EquationOfState&>(pt1)
281 == static_cast<const EquationOfState&>(pt2)
284 const scalar Y1 = pt1.Y()/eofs.Y();
285 const scalar Y2 = pt2.Y()/eofs.Y();
290 Y2*pt2.Hf_ - Y1*pt1.Hf_,
291 Y2*pt2.Sf_ - Y1*pt1.Sf_,
292 Y2*pt2.CpCoeffs_ - Y1*pt1.CpCoeffs_,
293 Y2*pt2.hCoeffs_ - Y1*pt1.hCoeffs_,
294 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
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)].