pyaga8.Gerg2008¶
- class pyaga8.Gerg2008¶
GERG-2008 equation of state, AGA Report No. 8, Part 2, First Edition, April 2017.
Wrapper around
aga8::gerg2008::Gerg2008in the Rust crate aga8 0.6.1. The units are those of the aga8 crate (https://docs.rs/aga8/0.6.1/aga8/gerg2008/struct.Gerg2008.html):temperature: Kpressure: kPad(molar concentration): mol/lmm(molar mass): g/molu,h,g(internal energy, enthalpy, Gibbs energy): J/mols,cv,cp(entropy, isochoric and isobaric heat capacity): J/(mol-K)w(speed of sound): m/sjt(Joule-Thomson coefficient): K/kPaz(compressibility factor) andkappa(isentropic exponent): dimensionless
The object holds the state. Set the composition with
set_composition, settemperatureandpressure, callcalc_densityand thencalc_properties, and read the results from the properties of this object. No unit conversion is done.- __init__()¶
Methods
__init__()calc_density(flag)Calculate the molar density
d(mol/l) fromtemperature(K) andpressure(kPa).Calculate the molar mass of the current composition.
Calculate the pressure from
temperature(K) andd(mol/l).Calculate the thermodynamic properties from
temperature(K) andd(mol/l).set_composition(comp)Check and set the gas composition.
Attributes
Isobaric heat capacity in J/(mol-K).
Isochoric heat capacity in J/(mol-K).
Molar concentration (molar density) in mol/l.
Second derivative of pressure with respect to density at constant temperature in kPa/(mol/l)^2.
Second derivative of pressure with respect to temperature and density in kPa/(mol/l)/K.
First derivative of pressure with respect to density at constant temperature in kPa/(mol/l).
First derivative of pressure with respect to temperature at constant density in kPa/K.
Gibbs energy in J/mol.
Enthalpy in J/mol.
Joule-Thomson coefficient in K/kPa.
Isentropic exponent (dimensionless).
Molar mass in g/mol.
Pressure in kPa.
Entropy in J/(mol-K).
Temperature in K.
Internal energy in J/mol.
Speed of sound in m/s.
Compressibility factor (dimensionless).
- calc_density(flag)¶
Calculate the molar density
d(mol/l) fromtemperature(K) andpressure(kPa).Iterative solution of the GERG-2008 equation of state. Updates
dandz; forflag > 0the 2-phase check also runscalc_properties. Callcalc_propertiesafterwards to get all the other properties at the converged state.- Parameters:
flag (int) – Passed to
aga8::gerg2008::Gerg2008::density(iflag). In aga8 0.6.1 the iteration starts from the ideal-gas density, or forflag == 2from three times the pseudo-critical density (liquid region). Ifdis negative before the call,abs(d)is used as the start value instead. Forflag > 0the converged state is also checked for a possible 2-phase state, and the calculation fails if the check fails. Use0for no check.- Raises:
RuntimeError – If the calculation fails to converge, or the 2-phase check fails.
dthen holds the ideal-gas density.
- calc_molar_mass()¶
Calculate the molar mass of the current composition.
The result is stored in
mm(g/mol). Returns None.
- calc_pressure()¶
Calculate the pressure from
temperature(K) andd(mol/l).Also updates
z. Thepressureproperty is not changed.- Returns:
Pressure in kPa.
- Return type:
float
- calc_properties()¶
Calculate the thermodynamic properties from
temperature(K) andd(mol/l).Updates
mm,z,dp_dd,d2p_dd2,d2p_dtd,dp_dt,u,h,s,cv,cp,w,g,jtandkappa. Ifdis not known, callcalc_densityfirst. Returns None.
- cp¶
Isobaric heat capacity in J/(mol-K).
- cv¶
Isochoric heat capacity in J/(mol-K).
- d¶
Molar concentration (molar density) in mol/l.
Result of
calc_density; input tocalc_pressureandcalc_properties.
- d2p_dd2¶
Second derivative of pressure with respect to density at constant temperature in kPa/(mol/l)^2.
- d2p_dtd¶
Second derivative of pressure with respect to temperature and density in kPa/(mol/l)/K.
- dp_dd¶
First derivative of pressure with respect to density at constant temperature in kPa/(mol/l).
- dp_dt¶
First derivative of pressure with respect to temperature at constant density in kPa/K.
- g¶
Gibbs energy in J/mol.
- h¶
Enthalpy in J/mol.
- jt¶
Joule-Thomson coefficient in K/kPa.
- kappa¶
Isentropic exponent (dimensionless).
- mm¶
Molar mass in g/mol.
- pressure¶
Pressure in kPa.
Input to
calc_density.
- s¶
Entropy in J/(mol-K).
- set_composition(comp)¶
Check and set the gas composition.
The mole fractions are copied from
comp. Later changes tocomphave no effect untilset_compositionis called again.- Parameters:
comp (Composition) – Gas composition in mole fractions.
- Raises:
ValueError – If the composition is empty (sum of the mole fractions is zero), or if the sum of the mole fractions differs from 1.0 by more than 0.01.
- temperature¶
Temperature in K.
- u¶
Internal energy in J/mol.
- w¶
Speed of sound in m/s.
- z¶
Compressibility factor (dimensionless).