Ideal-gas Models

The collection of ideal-gas contributions are described below. They are summed to yield the ideal-gas contribution from

αig=ixi(αiig(T,ρ)+ln(xi))

Null mole fractions xi=0 do not contribute to the summation because

limxi0xiln(xi)=0

IdealHelmholtzConstant

JSON arguments: "a"

αig=a

IdealHelmholtzLogT

JSON arguments: "a"

αig=aln(T)

which should be compared with the original form in GERG (and REFPROP and CoolProp)

αig=aln(τ)

with τ=Tr/T.

IdealHelmholtzLead

JSON arguments: "a_1", "a_2"

αig=ln(ρ)+a1+a2/T

which should be compared with the original form in GERG (and REFPROP and CoolProp)

αig=ln(δ)+a1+a2τ

Note that a1 contains an additive factor of ln(ρr) and a2 contains a multiplicative factor of Tr relative to the former because δ=ρ/ρr and τ=Tr/T.

IdealHelmholtzPowerT

JSON arguments: "n", "t"

αig=knkTtk

IdealHelmholtzPlanckEinstein

JSON arguments: "n", "theta"

αig=knkln(1exp(θk/T))

IdealHelmholtzPlanckEinsteinGeneralized

JSON arguments: "n", "c", "d", "theta"

αig=knkln(ck+dkexp(θk/T))

IdealHelmholtzGERG2004Cosh

JSON arguments: "n", "theta"

αig=knkln(|cosh(θk/T)|)

See Table 7.6 in GERG-2004 monograph

IdealHelmholtzGERG2004Sinh

JSON arguments: "n", "theta"

αig=knkln(|sinh(θk/T)|)

IdealHelmholtzCp0Constant

JSON arguments: "c", "T_0"

αig=c(TT0Tln(TT0))

from a term that is like

cp0R=c

IdealHelmholtzCp0PowerT

JSON arguments: "c", "t", "T_0"

αig=c[Tt(1t+11t)T0t+1T(t+1)+T0tt]

from a term that is like

cp0R=cTt,t0

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:

α=ln(δ)+a1+a2τ

with the * indicating the CoolProp formulation. The term reads like

α=ln(ρ)+a1+a2/T

in teqp. Refactoring the CoolProp term reads

α=ln(ρ)ln(ρr)+a1+a2(TrT)

so that a1=a1ln(ρr) and a2=a2Tr

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

α=a1+a2τ=a1+a2(TrT)

so that term can be rewritten as an IdealHelmholtzPowerT with coefficients of a1 and a2Tr 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 cp0/R follows:

α0=a0RT=1+lnρTρ0T0+h00RTs00R+1RTT0Tcp0(T)dT1RT0Tcp0(T)TdT
α0=a0RT=ln(ρ)+ln(T)ln(ρ0T0)1+h00RTs00R+1RTT0Tcp0(T)dT1RT0Tcp0(T)TdT

You can set the values of h00 and h00 to any value, including zero. So if you are converting a term from cp0/R, then you could do

α0=a0RT=ln(ρ)+ln(T)ln(ρ0T0)1+1RTT0Tcp0(T)dT1RT0Tcp0(T)TdT
[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