31 template<
class Specie>
51 template<
class Specie>
67 template<
class Specie>
80 template<
class Specie>
87 const scalar Z = this->Z(
p,
T);
88 return p/(Z*this->
R()*
T);
92 template<
class Specie>
95 const scalar Pr =
p/Pc_;
96 const scalar Tr =
T/Tc_;
97 const scalar
B = 0.07780*Pr/Tr;
98 const scalar
kappa = 0.37464 + 1.54226*omega_ - 0.26992*
sqr(omega_);
101 const scalar Z = this->Z(
p,
T);
109 *
log((Z + 2.414*
B)/(Z - 0.414*
B))
114 template<
class Specie>
117 const scalar Tr =
T/Tc_;
118 const scalar a = 0.45724*
sqr(
RR*Tc_)/Pc_;
119 const scalar
b = 0.07780*
RR*Tc_/Pc_;
120 const scalar
kappa = 0.37464 + 1.54226*omega_ - 0.26992*
sqr(omega_);
124 const scalar
B =
b*
p/(
RR*
T);
126 const scalar Z = this->Z(
p,
T);
131 const scalar
M = (
sqr(Z) + 2*
B*Z -
sqr(
B))/(Z -
B);
132 const scalar N = ap*
B/(
b*
RR);
134 const scalar root2 =
sqrt(2.0);
138 app*(
T/(2*root2*
b))*
log((Z + (root2 + 1)*
B)/(Z - (root2 - 1)*
B))
145 template<
class Specie>
148 const scalar Pr =
p/Pc_;
149 const scalar Tr =
T/Tc_;
150 const scalar
B = 0.07780*Pr/Tr;
151 const scalar
kappa = 0.37464 + 1.54226*omega_ - 0.26992*
sqr(omega_);
154 const scalar Z = this->Z(
p,
T);
161 *
log((Z + 2.414*
B)/(Z - 0.414*
B))
166 template<
class Specie>
169 const scalar a = 0.45724*
sqr(
RR*Tc_)/Pc_;
170 const scalar
b = 0.07780*
RR*Tc_/Pc_;
171 const scalar
kappa = 0.37464 + 1.54226*omega_ - 0.26992*
sqr(omega_);
173 const scalar
B =
b*
p/(
RR*
T);
175 const scalar Z = this->Z(
p,
T);
179 const scalar root2 =
sqrt(2.0);
183 app*(
T/(2*root2*
b))*
log((Z + (root2 + 1)*
B)/(Z - (root2 - 1)*
B))
189 template<
class Specie>
196 const scalar Pr =
p/Pc_;
197 const scalar Tr =
T/Tc_;
198 const scalar
B = 0.07780*Pr/Tr;
199 const scalar
kappa = 0.37464 + 1.54226*omega_ - 0.26992*
sqr(omega_);
201 const scalar Z = this->Z(
p,
T);
210 *
log((Z + 2.414*
B)/(Z - 0.414*
B))
216 template<
class Specie>
228 template<
class Specie>
235 const scalar Z = this->Z(
p,
T);
237 return 1.0/(Z*this->
R()*
T);
241 template<
class Specie>
248 const scalar Tr =
T/Tc_;
249 const scalar a = 0.45724*
sqr(
RR*Tc_)/Pc_;
250 const scalar
b = 0.07780*
RR*Tc_/Pc_;
251 const scalar
kappa = 0.37464 + 1.54226*omega_ - 0.26992*
sqr(omega_);
255 const scalar
B =
b*
p/(
RR*
T);
257 const scalar a2 =
B - 1;
258 const scalar a1 =
A - 2*
B - 3*
sqr(
B);
261 const scalar Q = (3*a1 - a2*a2)/9.0;
262 const scalar Rl = (9*a2*a1 - 27*
a0 - 2*a2*a2*a2)/54.0;
264 const scalar Q3 = Q*Q*Q;
265 const scalar
D = Q3 + Rl*Rl;
272 const scalar qm = 2*
sqrt(-Q);
273 const scalar r1 = qm*
cos(th/3.0) - a2/3.0;
279 root =
max(r1,
max(r2, r3));
284 const scalar D05 =
sqrt(
D);
285 const scalar
S =
pow(Rl + D05, 1.0/3.0);
289 Tl = -
pow(
mag(Rl - D05), 1.0/3.0);
293 Tl =
pow(Rl - D05, 1.0/3.0);
296 root =
S + Tl - a2/3.0;
303 template<
class Specie>
310 const scalar Tr =
T/Tc_;
311 const scalar a = 0.45724*
sqr(
RR*Tc_)/Pc_;
312 const scalar
b = 0.07780*
RR*Tc_/Pc_;
313 const scalar
kappa = 0.37464 + 1.54226*omega_ - 0.26992*
sqr(omega_);
317 const scalar
B =
b*
p/(
RR*
T);
319 const scalar Z = this->Z(
p,
T);
322 const scalar
M = (
sqr(Z) + 2*
B*Z -
sqr(
B))/(Z -
B);
323 const scalar N = ap*
B/(
b*
RR);
325 return this->
R()*
sqr(M - N)/(
sqr(
M) - 2*
A*(Z +
B));
329 template<
class Specie>
343 template<
class Specie>
349 scalar X1 = this->
Y()/this->
W();
350 Specie::operator+=(pg);
352 if (
mag(this->
Y()) > small)
354 X1 *= this->
W()/this->
Y();
355 const scalar X2 = this->
W()*pg.Y()/(pg.W()*this->
Y());
357 Tc_ = X1*Tc_ + X2*pg.Tc_;
358 Vc_ = X1*Vc_ + X2*pg.Vc_;
359 Zc_ = X1*Zc_ + X2*pg.Zc_;
360 Pc_ =
RR*Zc_*Tc_/Vc_;
361 omega_ = X1*omega_ + X2*pg.omega_;
366 template<
class Specie>
369 Specie::operator*=(
s);
376 template<
class Specie>
385 static_cast<const Specie&
>(pg1)
386 +
static_cast<const Specie&
>(pg2)
389 if (
mag(sp.Y()) < small)
403 const scalar X1 = sp.W()*pg1.Y()/(pg1.W()*sp.Y());
404 const scalar X2 = sp.W()*pg2.Y()/(pg2.W()*sp.Y());
406 const scalar Tc = X1*pg1.Tc_ + X2*pg2.Tc_;
407 const scalar Vc = X1*pg1.Vc_ + X2*pg2.Vc_;
408 const scalar Zc = X1*pg1.Zc_ + X2*pg2.Zc_;
410 return PengRobinsonGas<Specie>
417 X1*pg1.omega_ + X2*pg2.omega_
423 template<
class Specie>
427 const PengRobinsonGas<Specie>& pg
430 return PengRobinsonGas<Specie>
432 s*
static_cast<const Specie&
>(pg),
442 template<
class Specie>
445 const PengRobinsonGas<Specie>& pg1,
446 const PengRobinsonGas<Specie>& pg2
449 return PengRobinsonGas<Specie>
451 static_cast<const Specie&
>(pg1) ==
static_cast<const Specie&
>(pg2),
static const Foam::dimensionedScalar A("A", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("B", Foam::dimless, 18.678)
static const Foam::dimensionedScalar D("D", Foam::dimTemperature, 257.14)
PengRobinsonGas cubic equation of state for gases.
scalar Cv(scalar p, scalar T) const
Return Cv contribution [J/(kg K].
scalar psi(scalar p, scalar T) const
Return compressibility [s^2/m^2].
scalar alphav(const scalar p, const scalar T) const
Return volumetric coefficient of thermal expansion [1/T].
scalar e(const scalar p, const scalar T) const
Return internal energy contribution [J/kg].
scalar rho(scalar p, scalar T) const
Return density [kg/m^3].
scalar CpMCv(scalar p, scalar T) const
Return (Cp - Cv) [J/(kg K].
scalar h(const scalar p, const scalar T) const
Return enthalpy contribution [J/kg].
scalar Cp(scalar p, scalar T) const
Return Cp contribution [J/(kg K].
autoPtr< PengRobinsonGas > clone() const
Construct and return a clone.
scalar sv(const scalar p, const scalar T) const
Return entropy contribution to the integral of Cv/T [J/kg/K].
scalar sp(const scalar p, const scalar T) const
Return entropy contribution to the integral of Cp/T [J/kg/K].
scalar Z(scalar p, scalar T) const
Return compression factor [].
void operator*=(const scalar)
PengRobinsonGas(const Specie &sp, const scalar &Tc, const scalar &Vc, const scalar &Zc, const scalar &Pc, const scalar &omega)
Construct from components.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Convenience class to handle the input of constant rotational speed. Reads an omega entry with default...
A class for handling words, derived from string.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
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))
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const dimensionedScalar a0
Bohr radius: default SI units: [m].
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
const dimensionedScalar RR
Universal gas constant: default SI units: [J/kmol/K].
const dimensionedScalar Pstd
Standard pressure.
tmp< fvMatrix< Type > > S(const Pair< tmp< volScalarField::Internal >> &, const VolField< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
dimensionedScalar pow3(const dimensionedScalar &ds)
word name(const bool)
Return a word representation of a bool.
dimensionedScalar log(const dimensionedScalar &ds)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
scalarList W(const fluidMulticomponentThermo &thermo)
dimensionedScalar sqrt(const dimensionedScalar &ds)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
static scalar R(const scalar a, const scalar x)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dimensionedScalar cos(const dimensionedScalar &ds)
dimensionedScalar acos(const dimensionedScalar &ds)
PtrList< volScalarField > & Y