Ideal-gas Models¶
The collection of ideal-gas contributions are described below. They are summed to yield the ideal-gas contribution from
Null mole fractions \(x_i=0\) do not contribute to the summation because
IdealHelmholtzConstant¶
JSON arguments: "a"
IdealHelmholtzLogT¶
JSON arguments: "a"
which should be compared with the original form in GERG (and REFPROP and CoolProp)
with \(\tau=T_r/T\).
IdealHelmholtzLead¶
JSON arguments: "a_1"
, "a_2"
which should be compared with the original form in GERG (and REFPROP and CoolProp)
Note that \(a_1\) contains an additive factor of \(-\ln(\rho_r)\) and \(a_2\) contains a multiplicative factor of \(T_r\) relative to the former because \(\delta=\rho/\rho_r\) and \(\tau=T_r/T\).
IdealHelmholtzPowerT¶
JSON arguments: "n"
, "t"
IdealHelmholtzPlanckEinstein¶
JSON arguments: "n"
, "theta"
IdealHelmholtzPlanckEinsteinGeneralized¶
JSON arguments: "n"
, "c"
, "d"
, "theta"
IdealHelmholtzGERG2004Cosh¶
JSON arguments: "n"
, "theta"
See Table 7.6 in GERG-2004 monograph
IdealHelmholtzGERG2004Sinh¶
JSON arguments: "n"
, "theta"
IdealHelmholtzCp0Constant¶
JSON arguments: "c"
, "T_0"
from a term that is like
IdealHelmholtzCp0PowerT¶
JSON arguments: "c"
, "t"
, "T_0"
from a term that is like
The C++ classes implementing these functions are at:
Conversion¶
Conversion of terms from CoolProp format to teqp format is carried out in the function CoolProp2teqp_alphaig_term_reformatter().
For instance the leading term in CoolProp goes like:
with the * indicating the CoolProp formulation. The term reads like
in teqp. Refactoring the CoolProp term reads
so that \(a_1 = a_1^*-\ln(\rho_r)\) and \(a_2=a_2^*T_r\)
In some cases reconstitutions of terms are required, as the supported terms in the libraries are somewhat different. The term used in CoolProp to do the offsets to enthalpy and entropy is of the form
so that term can be rewritten as an IdealHelmholtzPowerT
with coefficients of \(a_1^*\) and \(a_2^*T_r\) and exponents of 0 and -1.
Most of the remaining terms can be converted in a straightforward fashion, except for some of GERG formulations that are a bit trickier. Mostly, the only conversion required is to multiply or divide by reducing temperatures so that all arguments are in terms of temperature as independent variable.
The mathematics describing how to do the conversion from a term in \(c_p^0/R\) follows:
You can set the values of \(h_0^0\) and \(h_0^0\) to any value, including zero. So if you are converting a term from \(c_p^0/R\), then you could do
[1]:
import teqp, os, numpy as np, json
display(teqp.__version__)
'0.22.0'
[2]:
path = teqp.get_datapath()+'/dev/fluids/n-Propane.json'
assert(os.path.exists(path))
jig = teqp.convert_CoolProp_idealgas(path, 0)
print('As in the fluid file (matches Lemmon JPCRD 2009 exactly)::::')
print(json.dumps(json.load(open(path))['EOS'][0]['alpha0'],indent=1))
print('\n\nAnd after conversion::::')
print(json.dumps(jig,indent=1))
As in the fluid file (matches Lemmon JPCRD 2009 exactly)::::
[
{
"a1": -4.970583,
"a2": 4.29352,
"type": "IdealGasHelmholtzLead"
},
{
"a": 3,
"type": "IdealGasHelmholtzLogTau"
},
{
"n": [
3.043,
5.874,
9.337,
7.922
],
"t": [
1.062478,
3.344237,
5.363757,
11.762957
],
"type": "IdealGasHelmholtzPlanckEinstein"
}
]
And after conversion::::
{
"R": 8.314472,
"terms": [
{
"R": 8.314472,
"a_1": -13.487776191416238,
"a_2": 1588.1301128,
"type": "Lead"
},
{
"R": 8.314472,
"a": 17.739616992418114,
"type": "Constant"
},
{
"R": 8.314472,
"a": -3.0,
"type": "LogT"
},
{
"R": 8.314472,
"n": [
3.043,
5.874,
9.337,
7.922
],
"theta": [
392.99998742,
1236.99982393,
1984.0000767299998,
4351.00016473
],
"type": "PlanckEinstein"
}
]
}
Note that the two leading terms of Lemmon generates three terms in teqp because the forms of the terms are slightly different
[3]:
# As an worked example, the conversions can be carried out like so, with the values from Lemmon given name of b instead of a
b_1 = -4.970583
b_2 = 4.29352
Tr = 369.89 # K
rhor = 5000 # mol/m^3
print('a_1:', b_1-np.log(rhor))
print('a_2:', b_2*Tr)
# The 3*ln(tau) term turns into 3*ln(Tr) - 3*ln(T)
print(np.log(Tr)*3)
# and the theta values are obtained
t = np.array([1.062478, 3.344237, 5.363757, 11.762957])
print((t*Tr).tolist())
a_1: -13.487776191416238
a_2: 1588.1301128
17.739616992418114
[392.99998742, 1236.99982393, 1984.0000767299998, 4351.00016473]
[4]:
aig = teqp.IdealHelmholtz([jig])
-aig.get_Ar20(300, 3, np.array([1.0]))
[4]:
7.863830967842212