pyaga8.Detail¶
- class pyaga8.Detail¶
AGA8 DETAIL equation of state, AGA Report No. 8, Part 1, Third Edition, April 2017.
Wrapper around
aga8::detail::Detailin the Rust crate aga8 0.6.1. The units are those of the aga8 crate (https://docs.rs/aga8/0.6.1/aga8/detail/struct.Detail.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__()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()¶
Calculate the molar density
d(mol/l) fromtemperature(K) andpressure(kPa).Iterative solution of the DETAIL equation of state, starting from the ideal-gas density, or from
abs(d)ifdis negative before the call. Updatesdandz; callcalc_propertiesafterwards for the other properties.No checks are made to determine the phase boundary. If the state point is 2-phase, the density represents a metastable state (aga8 0.6.1 documentation).
- Raises:
ValueError – If the pressure is too low (zero).
dis then set to 0.0.RuntimeError – If the calculation fails to converge.
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,pressure,dp_dd,d2p_dd2,d2p_dtd(set to 0.0),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.
Not calculated by the DETAIL implementation in aga8 0.6.1:
calc_propertiessets it to 0.0.
- 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.calc_propertiesoverwrites it with the pressure calculated fromtemperatureandd.
- 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).