Go to the documentation of this file.
31 template<
class EquationOfState>
40 <<
"attempt to evaluate hPowerThermo<EquationOfState>"
41 " for negative temperature " <<
T
47 template<
class EquationOfState>
54 EquationOfState(
name, jt),
64 template<
class EquationOfState>
67 const EquationOfState& st,
82 template<
class EquationOfState>
93 template<
class EquationOfState>
104 template<
class EquationOfState>
117 template<
class EquationOfState>
127 template<
class EquationOfState>
130 const scalar
p,
const scalar
T
133 return c0_*
pow(
T/Tref_, n0_);
137 template<
class EquationOfState>
140 const scalar
p,
const scalar
T
143 return hs(
p,
T) + hc();
147 template<
class EquationOfState>
150 const scalar
p,
const scalar
T
154 c0_*(
pow(
T, n0_ + 1) -
pow(
Tstd, n0_ + 1))/(
pow(Tref_, n0_)*(n0_ + 1));
158 template<
class EquationOfState>
165 template<
class EquationOfState>
168 const scalar
p,
const scalar
T
179 template<
class EquationOfState>
185 scalar molr1 = this->nMoles();
187 EquationOfState::operator+=(ct);
188 molr1 /= this->nMoles();
189 scalar molr2 = ct.nMoles()/this->nMoles();
191 Hf_ = molr1*Hf_ + molr2*ct.Hf_;
192 c0_ = molr1*c0_ + molr2*ct.c0_;
193 n0_ = molr1*n0_ + molr2*ct.n0_;
194 Tref_ = molr1*Tref_ + molr2*ct.Tref_;
198 template<
class EquationOfState>
204 scalar molr1 = this->nMoles();
206 EquationOfState::operator-=(ct);
208 molr1 /= this->nMoles();
209 scalar molr2 = ct.nMoles()/this->nMoles();
211 Hf_ = molr1*Hf_ - molr2*ct.Hf_;
212 c0_ = (molr1*c0_ - molr2*ct.c0_);
213 n0_ = (molr1*n0_ - molr2*ct.n0_);
214 Tref_ = (molr1*Tref_ - molr2*ct.Tref_);
220 template<
class EquationOfState>
229 static_cast<const EquationOfState&
>(ct1)
230 +
static_cast<const EquationOfState&
>(ct2)
236 ct1.nMoles()/eofs.nMoles()*ct1.
c0_
237 + ct2.nMoles()/eofs.nMoles()*ct2.c0_,
238 ct1.nMoles()/eofs.nMoles()*ct1.
n0_
239 + ct2.nMoles()/eofs.nMoles()*ct2.n0_,
240 ct1.nMoles()/eofs.nMoles()*ct1.
Tref_
241 + ct2.nMoles()/eofs.nMoles()*ct2.Tref_,
242 ct1.nMoles()/eofs.nMoles()*ct1.
Hf_
243 + ct2.nMoles()/eofs.nMoles()*ct2.Hf_
248 template<
class EquationOfState>
251 const hPowerThermo<EquationOfState>& ct1,
252 const hPowerThermo<EquationOfState>& ct2
257 static_cast<const EquationOfState&
>(ct1)
258 +
static_cast<const EquationOfState&
>(ct2)
261 return hPowerThermo<EquationOfState>
264 ct1.nMoles()/eofs.nMoles()*ct1.
c0_
265 - ct2.nMoles()/eofs.nMoles()*ct2.c0_,
266 ct1.nMoles()/eofs.nMoles()*ct1.
n0_
267 - ct2.nMoles()/eofs.nMoles()*ct2.n0_,
268 ct1.nMoles()/eofs.nMoles()*ct1.
Tref_
269 - ct2.nMoles()/eofs.nMoles()*ct2.Tref_,
270 ct1.nMoles()/eofs.nMoles()*ct1.
Hf_
271 - ct2.nMoles()/eofs.nMoles()*ct2.Hf_
276 template<
class EquationOfState>
280 const hPowerThermo<EquationOfState>& ct
283 return hPowerThermo<EquationOfState>
285 s*
static_cast<const EquationOfState&
>(ct),
294 template<
class EquationOfState>
297 const hPowerThermo<EquationOfState>& ct1,
298 const hPowerThermo<EquationOfState>& ct2
A class for handling words, derived from string.
Power-function based thermodynamics package templated on EquationOfState.
hPowerThermo(const EquationOfState &st, const scalar c0, const scalar n0, const scalar Tref, const scalar Hf)
Construct from components.
scalar limit(const scalar T) const
Limit the temperature to be in the range Tlow_ to Thigh_.
static autoPtr< hPowerThermo > New(Istream &is)
Selector from Istream.
const dimensionedScalar Tstd
Standard temperature.
scalar ha(const scalar p, const scalar T) const
Absolute enthalpy [J/kmol].
void checkT(const scalar T) const
Check given temperature is within the range of the fitted coeffs.
scalar cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/(kg K)].
scalar hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
autoPtr< hPowerThermo > clone() const
Construct and return a clone.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
scalar hc() const
Chemical enthalpy [J/kg].
A list of keyword definitions, which are a keyword followed by any number of values (e....
errorManip< error > abort(error &err)
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))
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
scalar s(const scalar p, const scalar T) const
Entropy [J/(kmol K)].
word name(const complex &)
Return a string representation of a complex.