33template<
class EquationOfState,
int PolySize>
34inline Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
36 const EquationOfState& pt,
39 const Polynomial<PolySize>& CpCoeffs,
40 const typename Polynomial<PolySize>::intPolyType& hCoeffs,
41 const Polynomial<PolySize>& sCoeffs
55template<
class EquationOfState,
int PolySize>
56inline Foam::hPolynomialThermo<EquationOfState, PolySize>::hPolynomialThermo
62 EquationOfState(
name, pt),
65 CpCoeffs_(pt.CpCoeffs_),
66 hCoeffs_(pt.hCoeffs_),
73template<
class EquationOfState,
int PolySize>
83template<
class EquationOfState,
int PolySize>
86 const scalar
p,
const scalar
T
89 return CpCoeffs_.value(
T) + EquationOfState::Cp(
p,
T);
93template<
class EquationOfState,
int PolySize>
96 const scalar
p,
const scalar
T
99 return hCoeffs_.value(
T) + EquationOfState::H(
p,
T);
103template<
class EquationOfState,
int PolySize>
106 const scalar
p,
const scalar
T
113template<
class EquationOfState,
int PolySize>
121template<
class EquationOfState,
int PolySize>
128 return sCoeffs_.value(
T) + EquationOfState::S(
p,
T);
132template<
class EquationOfState,
int PolySize>
138 return hCoeffs_.value(
T) - sCoeffs_.value(
T)*
T;
142template<
class EquationOfState,
int PolySize>
151 CpCoeffs_.derivative(
T)
157template<
class EquationOfState,
int PolySize>
163 scalar Y1 = this->
Y();
165 EquationOfState::operator+=(pt);
167 if (
mag(this->
Y()) > SMALL)
170 const scalar Y2 = pt.Y()/this->
Y();
172 Hf_ = Y1*Hf_ + Y2*pt.Hf_;
173 Sf_ = Y1*Sf_ + Y2*pt.Sf_;
174 CpCoeffs_ = Y1*CpCoeffs_ + Y2*pt.CpCoeffs_;
175 hCoeffs_ = Y1*hCoeffs_ + Y2*pt.hCoeffs_;
176 sCoeffs_ = Y1*sCoeffs_ + Y2*pt.sCoeffs_;
181template<
class EquationOfState,
int PolySize>
187 EquationOfState::operator*=(
s);
193template<
class EquationOfState,
int PolySize>
196 const hPolynomialThermo<EquationOfState, PolySize>& pt1,
197 const hPolynomialThermo<EquationOfState, PolySize>& pt2
200 EquationOfState eofs = pt1;
203 if (
mag(eofs.Y()) < SMALL)
205 return hPolynomialThermo<EquationOfState, PolySize>
216 const scalar Y1 = pt1.Y()/eofs.Y();
217 const scalar Y2 = pt2.Y()/eofs.Y();
219 return hPolynomialThermo<EquationOfState, PolySize>
222 Y1*pt1.Hf_ + Y2*pt2.Hf_,
223 Y1*pt1.Sf_ + Y2*pt2.Sf_,
224 Y1*pt1.CpCoeffs_ + Y2*pt2.CpCoeffs_,
225 Y1*pt1.hCoeffs_ + Y2*pt2.hCoeffs_,
226 Y1*pt1.sCoeffs_ + Y2*pt2.sCoeffs_
232template<
class EquationOfState,
int PolySize>
236 const hPolynomialThermo<EquationOfState, PolySize>& pt
239 return hPolynomialThermo<EquationOfState, PolySize>
241 s*
static_cast<const EquationOfState&
>(pt),
251template<
class EquationOfState,
int PolySize>
254 const hPolynomialThermo<EquationOfState, PolySize>& pt1,
255 const hPolynomialThermo<EquationOfState, PolySize>& pt2
260 static_cast<const EquationOfState&
>(pt1)
261 ==
static_cast<const EquationOfState&
>(pt2)
264 const scalar Y1 = pt1.Y()/eofs.Y();
265 const scalar Y2 = pt2.Y()/eofs.Y();
267 return hPolynomialThermo<EquationOfState, PolySize>
270 Y2*pt2.Hf_ - Y1*pt1.Hf_,
271 Y2*pt2.Sf_ - Y1*pt1.Sf_,
272 Y2*pt2.CpCoeffs_ - Y1*pt1.CpCoeffs_,
273 Y2*pt2.hCoeffs_ - Y1*pt1.hCoeffs_,
274 Y2*pt2.sCoeffs_ - Y1*pt1.sCoeffs_
scalar Ha(const scalar p, const scalar T) const
Thermodynamics package templated on the equation of state, using polynomial functions for cp,...
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
friend Ostream & operator(Ostream &, const hPolynomialThermo &)
scalar dCpdT(const scalar p, const scalar T) const
Temperature derivative of heat capacity at constant pressure.
scalar Cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/(kg K)].
scalar Hc() const
Chemical enthalpy [J/kg].
scalar S(const scalar p, const scalar T) const
Entropy [J/(kg K)].
scalar Ha(const scalar p, const scalar T) const
Absolute Enthalpy [J/kg].
scalar limit(const scalar) const
Limit temperature to be within the range.
scalar Gstd(const scalar T) const
Gibbs free energy of the mixture in the standard state [J/kg].
A class for handling words, derived from Foam::string.
PtrList< volScalarField > & Y
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)