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
101 return CpCoeffs_.value(T);
105 template<
class EquationOfState,
int PolySize>
108 const scalar p,
const scalar T
111 return hCoeffs_.value(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>
148 Foam::hPolynomialThermo<EquationOfState, PolySize>::operator=
153 EquationOfState::operator=(pt);
157 CpCoeffs_ = pt.CpCoeffs_;
158 hCoeffs_ = pt.hCoeffs_;
159 sCoeffs_ = pt.sCoeffs_;
165 template<
class EquationOfState,
int PolySize>
166 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator+=
171 scalar molr1 = this->nMoles();
173 EquationOfState::operator+=(pt);
175 molr1 /= this->nMoles();
176 scalar molr2 = pt.nMoles()/this->nMoles();
178 Hf_ = molr1*Hf_ + molr2*pt.Hf_;
179 Sf_ = molr1*Sf_ + molr2*pt.Sf_;
180 CpCoeffs_ = molr1*CpCoeffs_ + molr2*pt.CpCoeffs_;
181 hCoeffs_ = molr1*hCoeffs_ + molr2*pt.hCoeffs_;
182 sCoeffs_ = molr1*sCoeffs_ + molr2*pt.sCoeffs_;
186 template<
class EquationOfState,
int PolySize>
187 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator-=
192 scalar molr1 = this->nMoles();
194 EquationOfState::operator-=(pt);
196 molr1 /= this->nMoles();
197 scalar molr2 = pt.nMoles()/this->nMoles();
199 Hf_ = molr1*Hf_ - molr2*pt.Hf_;
200 Sf_ = molr1*Sf_ - molr2*pt.Sf_;
201 CpCoeffs_ = molr1*CpCoeffs_ - molr2*pt.CpCoeffs_;
202 hCoeffs_ = molr1*hCoeffs_ - molr2*pt.hCoeffs_;
203 sCoeffs_ = molr1*sCoeffs_ - molr2*pt.sCoeffs_;
207 template<
class EquationOfState,
int PolySize>
208 inline void Foam::hPolynomialThermo<EquationOfState, PolySize>::operator*=
213 EquationOfState::operator*=(s);
219 template<
class EquationOfState,
int PolySize>
226 EquationOfState eofs = pt1;
229 scalar molr1 = pt1.nMoles()/eofs.nMoles();
230 scalar molr2 = pt2.nMoles()/eofs.nMoles();
235 molr1*pt1.Hf_ + molr2*pt2.Hf_,
236 molr1*pt1.Sf_ + molr2*pt2.Sf_,
237 molr1*pt1.CpCoeffs_ + molr2*pt2.CpCoeffs_,
238 molr1*pt1.hCoeffs_ + molr2*pt2.hCoeffs_,
239 molr1*pt1.sCoeffs_ + molr2*pt2.sCoeffs_
244 template<
class EquationOfState,
int PolySize>
251 EquationOfState eofs = pt1;
254 scalar molr1 = pt1.nMoles()/eofs.nMoles();
255 scalar molr2 = pt2.nMoles()/eofs.nMoles();
260 molr1*pt1.Hf_ - molr2*pt2.Hf_,
261 molr1*pt1.Sf_ - molr2*pt2.Sf_,
262 molr1*pt1.CpCoeffs_ - molr2*pt2.CpCoeffs_,
263 molr1*pt1.hCoeffs_ - molr2*pt2.hCoeffs_,
264 molr1*pt1.sCoeffs_ - molr2*pt2.sCoeffs_
269 template<
class EquationOfState,
int PolySize>
278 s*
static_cast<const EquationOfState&
>(pt),
288 template<
class EquationOfState,
int PolySize>
scalar cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/(kmol K)].
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 ))
scalar limit(const scalar) const
Limit the temperature to be in the range Tlow_ to Thigh_.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
scalar ha(const scalar p, const scalar T) const
Absolute Enthalpy [J/kmol].
A class for handling words, derived from string.
scalar hc() const
Chemical enthalpy [J/kmol].
Thermodynamics package templated on the equation of state, using polynomial functions for cp...
scalar s(const scalar p, const scalar T) const
Entropy [J/(kmol K)].
scalar hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kmol].