28 template<
class EquationOfState>
31 const EquationOfState& st,
46 template<
class EquationOfState>
53 EquationOfState(
name, ct),
61 template<
class EquationOfState>
74 template<
class EquationOfState>
84 template<
class EquationOfState>
95 template<
class EquationOfState>
106 template<
class EquationOfState>
113 return hs(
p,
T) + hf();
117 template<
class EquationOfState>
124 template<
class EquationOfState>
131 return Cp_*
log(
T/
Tstd) + EquationOfState::sp(
p,
T);
135 template<
class EquationOfState>
141 return Cp_*(
T - Tref_) + hsRef_ + hf() - Cp_*
T*
log(
T/
Tstd);
145 template<
class EquationOfState>
158 template<
class EquationOfState>
164 scalar Y1 = this->
Y();
166 EquationOfState::operator+=(ct);
168 if (
mag(this->
Y()) > small)
177 <<
"Tref " << Tref_ <<
" for "
178 << (this->
name().size() ? this->
name() :
"others")
179 <<
" != " << ct.Tref_ <<
" for "
180 << (ct.name().size() ? ct.name() :
"others")
185 const scalar Y2 = ct.Y()/this->
Y();
187 Cp_ = Y1*Cp_ + Y2*ct.Cp_;
188 hf_ = Y1*hf_ + Y2*ct.hf_;
189 hsRef_ = Y1*hsRef_ + Y2*ct.hsRef_;
196 template<
class EquationOfState>
205 static_cast<const EquationOfState&
>(ct1)
206 +
static_cast<const EquationOfState&
>(ct2)
209 if (
mag(eofs.Y()) < small)
224 hConstThermo<EquationOfState>::debug
229 <<
"Tref " << ct1.Tref_ <<
" for "
230 << (ct1.name().size() ? ct1.name() :
"others")
231 <<
" != " << ct2.Tref_ <<
" for "
232 << (ct2.name().size() ? ct2.name() :
"others")
236 return hConstThermo<EquationOfState>
239 ct1.Y()/eofs.Y()*ct1.Cp_
240 + ct2.Y()/eofs.Y()*ct2.Cp_,
241 ct1.Y()/eofs.Y()*ct1.hf_
242 + ct2.Y()/eofs.Y()*ct2.hf_,
244 ct1.Y()/eofs.Y()*ct1.hsRef_
245 + ct2.Y()/eofs.Y()*ct2.hsRef_
251 template<
class EquationOfState>
255 const hConstThermo<EquationOfState>& ct
258 return hConstThermo<EquationOfState>
260 s*
static_cast<const EquationOfState&
>(ct),
269 template<
class EquationOfState>
272 const hConstThermo<EquationOfState>& ct1,
273 const hConstThermo<EquationOfState>& ct2
278 static_cast<const EquationOfState&
>(ct1)
279 ==
static_cast<const EquationOfState&
>(ct2)
284 hConstThermo<EquationOfState>::debug
289 <<
"Tref " << ct1.Tref_ <<
" for "
290 << (ct1.name().size() ? ct1.name() :
"others")
291 <<
" != " << ct2.Tref_ <<
" for "
292 << (ct2.name().size() ? ct2.name() :
"others")
296 return hConstThermo<EquationOfState>
299 ct2.Y()/eofs.Y()*ct2.Cp_
300 - ct1.Y()/eofs.Y()*ct1.Cp_,
301 ct2.Y()/eofs.Y()*ct2.hf_
302 - ct1.Y()/eofs.Y()*ct1.hf_,
304 ct2.Y()/eofs.Y()*ct2.hsRef_
305 - ct1.Y()/eofs.Y()*ct1.hsRef_
scalar hs(const scalar p, const scalar T) const
scalar Cp(const scalar p, const scalar T) const
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Enthalpy based thermodynamics package using a constant heat capacity at constant pressure.
scalar gStd(const scalar T) const
Gibbs free energy of the mixture in the standard state [J/kg].
scalar limit(const scalar T) const
Limit the temperature to be in the range Tlow_ to Thigh_.
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.
scalar Cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/kg/K].
scalar ha(const scalar p, const scalar T) const
Absolute enthalpy [J/kg].
autoPtr< hConstThermo > clone() const
Construct and return a clone.
scalar hf() const
Enthalpy of formation [J/kg].
hConstThermo(const EquationOfState &st, const scalar Cp, const scalar hf, const scalar Tref, const scalar hsRef)
Construct from components.
scalar hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar Tstd
Standard temperature.
const dimensionedScalar h
Planck constant.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool notEqual(const Scalar s1, const Scalar s2)
word name(const bool)
Return a word representation of a bool.
dimensionedScalar log(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
PtrList< volScalarField > & Y