30 template<
class EquationOfState,
int PolySize>
33 const EquationOfState& pt,
36 const Polynomial<PolySize>& CvCoeffs,
37 const typename Polynomial<PolySize>::intPolyType& eCoeffs,
38 const Polynomial<PolySize>& sCoeffs
52 template<
class EquationOfState,
int PolySize>
59 EquationOfState(name, pt),
62 CvCoeffs_(pt.CvCoeffs_),
63 eCoeffs_(pt.eCoeffs_),
70 template<
class EquationOfState,
int PolySize>
80 template<
class EquationOfState,
int PolySize>
91 template<
class EquationOfState,
int PolySize>
98 return eCoeffs_.value(T) + EquationOfState::E(p, T);
102 template<
class EquationOfState,
int PolySize>
109 return Es(p, T) +
Hf();
113 template<
class EquationOfState,
int PolySize>
121 template<
class EquationOfState,
int PolySize>
128 return sCoeffs_.value(T) + EquationOfState::Sv(p, T);
132 template<
class EquationOfState,
int PolySize>
144 template<
class EquationOfState,
int PolySize>
152 return CvCoeffs_.derivative(T);
158 template<
class EquationOfState,
int PolySize>
159 inline void Foam::ePolynomialThermo<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 CvCoeffs_ = Y1*CvCoeffs_ + Y2*pt.CvCoeffs_;
176 eCoeffs_ = Y1*eCoeffs_ + Y2*pt.eCoeffs_;
177 sCoeffs_ = Y1*sCoeffs_ + Y2*pt.sCoeffs_;
182 template<
class EquationOfState,
int PolySize>
183 inline void Foam::ePolynomialThermo<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.CvCoeffs_ + Y2*pt2.CvCoeffs_,
226 Y1*pt1.eCoeffs_ + Y2*pt2.eCoeffs_,
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.CvCoeffs_ - Y1*pt1.CvCoeffs_,
274 Y2*pt2.eCoeffs_ - Y1*pt1.eCoeffs_,
275 Y2*pt2.sCoeffs_ - Y1*pt1.sCoeffs_
Thermodynamics package templated on the equation of state, using polynomial functions for cv...
scalar Es(const scalar p, const scalar T) const
Sensible internal energy [J/kg].
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.
const volScalarField & Cv
scalar Gstd(const scalar T) const
Gibbs free energy of the mixture in the standard state [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].
scalar Cv(const scalar p, const scalar T) const
Heat capacity at constant volume [J/kg/K].
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 > &)
const dimensionedScalar & Pstd
Standard pressure.
scalar Ea(const scalar p, const scalar T) const
Absolute internal energy [J/kg].
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.