mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: liquidMixturePropertues - contribution by dkxls
- replaced TMax() function by pvInvert(X) - added pseudo triple point temperature function
This commit is contained in:
@ -103,12 +103,62 @@ Foam::scalar Foam::liquidMixtureProperties::Tc(const scalarField& x) const
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::liquidMixtureProperties::TMax(const scalar p) const
|
||||
Foam::scalar Foam::liquidMixtureProperties::Tpt(const scalarField& x) const
|
||||
{
|
||||
scalar T = -GREAT;
|
||||
scalar Tpt = 0.0;
|
||||
forAll(properties_, i)
|
||||
{
|
||||
T = max(T, properties_[i].pvInvert(p));
|
||||
Tpt += x[i]*properties_[i].Tt();
|
||||
}
|
||||
|
||||
return Tpt;
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::liquidMixtureProperties::pvInvert
|
||||
(
|
||||
const scalar p,
|
||||
const scalarField& x
|
||||
) const
|
||||
{
|
||||
// Set upper and lower bounds
|
||||
scalar Thi = Tc(x);
|
||||
scalar Tlo = Tpt(x);
|
||||
|
||||
// Check for critical and solid phase conditions
|
||||
if (p >= pv(p, Thi, x))
|
||||
{
|
||||
return Thi;
|
||||
}
|
||||
else if (p < pv(p, Tlo, x))
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"Foam::scalar Foam::liquidMixtureProperties::pvInvert"
|
||||
"("
|
||||
" const scalar,"
|
||||
" const scalarField&"
|
||||
") const"
|
||||
) << "Pressure below triple point pressure: "
|
||||
<< "p = " << p << " < Pt = " << pv(p, Tlo, x) << nl << endl;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Set initial guess
|
||||
scalar T = (Thi + Tlo)*0.5;
|
||||
|
||||
while ((Thi - Tlo) > 1.0e-4)
|
||||
{
|
||||
if ((pv(p, T, x) - p) <= 0.0)
|
||||
{
|
||||
Tlo = T;
|
||||
}
|
||||
else
|
||||
{
|
||||
Thi = T;
|
||||
}
|
||||
|
||||
T = (Thi + Tlo)*0.5;
|
||||
}
|
||||
|
||||
return T;
|
||||
|
||||
@ -141,8 +141,9 @@ public:
|
||||
//- Calculate the critical temperature of mixture
|
||||
scalar Tc(const scalarField& x) const;
|
||||
|
||||
//- Calculate the maximum temperature of mixture at given pressure
|
||||
scalar TMax(const scalar p) const;
|
||||
//- Invert the vapour pressure relationship to retrieve the boiling
|
||||
// temperature of the mixture as a function of pressure
|
||||
scalar pvInvert(const scalar p, const scalarField& x) const;
|
||||
|
||||
//- Return pseudocritical temperature according to Kay's rule
|
||||
scalar Tpc(const scalarField& x) const;
|
||||
@ -150,6 +151,9 @@ public:
|
||||
//- Return pseudocritical pressure (modified Prausnitz and Gunn)
|
||||
scalar Ppc(const scalarField& x) const;
|
||||
|
||||
//- Return pseudo triple point temperature (mole averaged formulation)
|
||||
scalar Tpt(const scalarField& x) const;
|
||||
|
||||
//- Return mixture accentric factor
|
||||
scalar omega(const scalarField& x) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user