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>
61 CpCoeffs_(pt.CpCoeffs_),
62 hCoeffs_(pt.hCoeffs_),
67 template<
class EquationOfState,
int PolySize>
74 EquationOfState(name, pt),
77 CpCoeffs_(pt.CpCoeffs_),
78 hCoeffs_(pt.hCoeffs_),
85 template<
class EquationOfState,
int PolySize>
95 template<
class EquationOfState,
int PolySize>
98 const scalar p,
const scalar T
105 template<
class EquationOfState,
int PolySize>
108 const scalar p,
const scalar T
115 template<
class EquationOfState,
int PolySize>
118 const scalar p,
const scalar T
121 return ha(p, T) -
hc();
125 template<
class EquationOfState,
int PolySize>
133 template<
class EquationOfState,
int PolySize>
146 template<
class EquationOfState,
int PolySize>
147 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator=
152 EquationOfState::operator=(pt);
156 CpCoeffs_ = pt.CpCoeffs_;
157 hCoeffs_ = pt.hCoeffs_;
158 sCoeffs_ = pt.sCoeffs_;
162 template<
class EquationOfState,
int PolySize>
163 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator+=
168 scalar molr1 = this->nMoles();
170 EquationOfState::operator+=(pt);
172 molr1 /= this->nMoles();
173 scalar molr2 = pt.nMoles()/this->nMoles();
175 Hf_ = molr1*Hf_ + molr2*pt.Hf_;
176 Sf_ = molr1*Sf_ + molr2*pt.Sf_;
177 CpCoeffs_ = molr1*CpCoeffs_ + molr2*pt.CpCoeffs_;
178 hCoeffs_ = molr1*hCoeffs_ + molr2*pt.hCoeffs_;
179 sCoeffs_ = molr1*sCoeffs_ + molr2*pt.sCoeffs_;
183 template<
class EquationOfState,
int PolySize>
184 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator-=
189 scalar molr1 = this->nMoles();
191 EquationOfState::operator-=(pt);
193 molr1 /= this->nMoles();
194 scalar molr2 = pt.nMoles()/this->nMoles();
196 Hf_ = molr1*Hf_ - molr2*pt.Hf_;
197 Sf_ = molr1*Sf_ - molr2*pt.Sf_;
198 CpCoeffs_ = molr1*CpCoeffs_ - molr2*pt.CpCoeffs_;
199 hCoeffs_ = molr1*hCoeffs_ - molr2*pt.hCoeffs_;
200 sCoeffs_ = molr1*sCoeffs_ - molr2*pt.sCoeffs_;
204 template<
class EquationOfState,
int PolySize>
205 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator*=
210 EquationOfState::operator*=(s);
216 template<
class EquationOfState,
int PolySize>
223 EquationOfState eofs = pt1;
226 scalar molr1 = pt1.nMoles()/eofs.nMoles();
227 scalar molr2 = pt2.nMoles()/eofs.nMoles();
232 molr1*pt1.Hf_ + molr2*pt2.Hf_,
233 molr1*pt1.Sf_ + molr2*pt2.Sf_,
234 molr1*pt1.CpCoeffs_ + molr2*pt2.CpCoeffs_,
235 molr1*pt1.hCoeffs_ + molr2*pt2.hCoeffs_,
236 molr1*pt1.sCoeffs_ + molr2*pt2.sCoeffs_
241 template<
class EquationOfState,
int PolySize>
248 EquationOfState eofs = pt1;
251 scalar molr1 = pt1.nMoles()/eofs.nMoles();
252 scalar molr2 = pt2.nMoles()/eofs.nMoles();
257 molr1*pt1.Hf_ - molr2*pt2.Hf_,
258 molr1*pt1.Sf_ - molr2*pt2.Sf_,
259 molr1*pt1.CpCoeffs_ - molr2*pt2.CpCoeffs_,
260 molr1*pt1.hCoeffs_ - molr2*pt2.hCoeffs_,
261 molr1*pt1.sCoeffs_ - molr2*pt2.sCoeffs_
266 template<
class EquationOfState,
int PolySize>
275 s*
static_cast<const EquationOfState&
>(pt),
285 template<
class EquationOfState,
int PolySize>
scalar ha(const scalar p, const scalar T) const
Absolute Enthalpy [J/kmol].
scalar hc() const
Chemical enthalpy [J/kmol].
scalar s(const scalar p, const scalar T) const
Entropy [J/(kmol K)].
Thermodynamics package templated on the equation of state, using polynomial functions for cp...
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.
const volScalarField & cp
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
scalar cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/(kmol K)].
const dimensionedScalar h
Planck constant.
scalar limit(const scalar) const
Limit the temperature to be in the range Tlow_ to Thigh_.
scalar hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kmol].