iapws.humidAir module
Module with Air-water mixture properties and related properties. The module include:
_virial(): Virial equations for humid air
_fugacity(): Fugacity equation for humid air
MEoSBlend: Special MEoS subclass to implement pseudocomponent blend with ancillary dew and bubble point
Air: Multiparameter equation of state for Air as pseudocomponent
HumidAir: Humid air mixture with complete functionality
- iapws.humidAir._virial(T)[source]
Virial equations for humid air
- Parameters:
T (float) – Temperature [K]
- Returns:
prop –
Dictionary with critical coefficient:
Baa: Second virial coefficient of dry air, [m³/mol]
Baw: Second air-water cross virial coefficient, [m³/mol]
Bww: Second virial coefficient of water, [m³/mol]
Caaa: Third virial coefficient of dry air, [m⁶/mol]
Caaw: Third air-water cross virial coefficient, [m⁶/mol]
Caww: Third air-water cross virial coefficient, [m⁶/mol]
Cwww: Third virial coefficient of dry air, [m⁶/mol]
Bawt: dBaw/dT, [m³/molK]
Bawtt: d²Baw/dT², [m³/molK²]
Caawt: dCaaw/dT, [m⁶/molK]
Caawtt: d²Caaw/dT², [m⁶/molK²]
Cawwt: dCaww/dT, [m⁶/molK]
Cawwtt: d²Caww/dT², [m⁶/molK²]
- Return type:
Notes
Raise
Warningif T isn’t in range of validity:Baa: 60 ≤ T ≤ 2000
Baw: 130 ≤ T ≤ 2000
Bww: 130 ≤ T ≤ 1273
Caaa: 60 ≤ T ≤ 2000
Caaw: 193 ≤ T ≤ 493
Caww: 173 ≤ T ≤ 473
Cwww: 130 ≤ T ≤ 1273
Examples
>>> _virial(200)["Baa"] -3.92722567e-5
References
IAPWS, Guideline on a Virial Equation for the Fugacity of H2O in Humid Air, http://www.iapws.org/relguide/VirialFugacity.html
IAPWS, Guideline on an Equation of State for Humid Air in Contact with Seawater and Ice, Consistent with the IAPWS Formulation 2008 for the Thermodynamic Properties of Seawater, Table 10, http://www.iapws.org/relguide/SeaAir.html
- iapws.humidAir._fugacity(T, P, x)[source]
Fugacity equation for humid air
- Parameters:
- Returns:
fv – fugacity coefficient, [MPa]
- Return type:
Notes
Raise
NotImplementedErrorif input isn’t in range of validity:193 ≤ T ≤ 473
0 ≤ P ≤ 5
0 ≤ x ≤ 1
Really the xmax is the xsaturation but isn’t implemented
Examples
>>> _fugacity(300, 1, 0.1) 0.0884061686
References
IAPWS, Guideline on a Virial Equation for the Fugacity of H2O in Humid Air, http://www.iapws.org/relguide/VirialFugacity.html
- class iapws.humidAir.MEoSBlend(**kwargs)[source]
Special meos class to implement pseudocomponent blend and defining its ancillary dew and bubble point
- Attributes:
- Gas
- Gruneisen
- Hvap
- IntP
- Ks
- Kt
- Liquid
- M
- P
- Pc
- Pr
- Prandt
- Svap
- T
- Tc
- Tr
- Tt
- Vapor
- Z
- Z_rho
- a
- a0
- alfa
- alfap
- alfav
- betap
- betas
calculableCheck if inputs are enough to define state
- cp
- cp0
- cp0_cv
- cp_cv
- cv
- cv0
- dhdP_T
- dhdP_rho
- dhdT_P
- dhdT_rho
- dhdrho_P
- dhdrho_T
- dpdT_rho
- dpdrho_T
- drhodP_T
- drhodT_P
- epsilon
- f
- fi
- g
- g0
- gamma
- gamma0
- h
- h0
- hInput
- invT
- joule
- k
- kappa
- ks
- kt
- mu
- n
- name
- nu
- phase
- rho
- rho0
- rhoc
- s
- s0
- sigma
- u
- u0
- v
- v0
- virialB
- virialC
- w
- x
Methods
__call__(**kwargs)Make instance callable to can add input parameter one to one
calculo()Calculate procedure
derivative(z, x, y, fase)Wrapper derivative for custom derived properties where x, y, z can be: P, T, v, rho, u, h, s, g, a
fill(fase, estado)Fill phase properties
from_list(p1name, p1val, p2name, p2val)Speed up method using multiprocessing for multiple point calculation with a fixed input and changing other input parameter
- _blend = {}
- class iapws.humidAir.Air(**kwargs)[source]
Multiparameter equation of state for Air as pseudocomponent for internal procedures, see MEoS base class
References
Lemmon, E.W., Jacobsen, R.T, Penoncello, S.G., Friend, D.G.; Thermodynamic Properties of Air and Mixtures of Nitrogen, Argon, and Oxygen From 60 to 2000 K at Pressures to 2000 MPa. J. Phys. Chem. Ref. Data 29, 331 (2000). http://dx.doi.org/10.1063/1.1285884
- Attributes:
- Gas
- Gruneisen
- Hvap
- IntP
- Ks
- Kt
- Liquid
- P
- Pr
- Prandt
- Svap
- T
- Tr
- Vapor
- Z
- Z_rho
- a
- a0
- alfa
- alfap
- alfav
- betap
- betas
calculableCheck if inputs are enough to define state
- cp
- cp0
- cp0_cv
- cp_cv
- cv
- cv0
- dhdP_T
- dhdP_rho
- dhdT_P
- dhdT_rho
- dhdrho_P
- dhdrho_T
- dpdT_rho
- dpdrho_T
- drhodP_T
- drhodT_P
- epsilon
- f
- fi
- g
- g0
- gamma
- gamma0
- h
- h0
- hInput
- invT
- joule
- k
- kappa
- ks
- kt
- mu
- n
- nu
- phase
- rho
- rho0
- s
- s0
- sigma
- u
- u0
- v
- v0
- virialB
- virialC
- w
- x
Methods
__call__(**kwargs)Make instance callable to can add input parameter one to one
calculo()Calculate procedure
derivative(z, x, y, fase)Wrapper derivative for custom derived properties where x, y, z can be: P, T, v, rho, u, h, s, g, a
fill(fase, estado)Fill phase properties
from_list(p1name, p1val, p2name, p2val)Speed up method using multiprocessing for multiple point calculation with a fixed input and changing other input parameter
- name = 'air'
- CASNumber = '1'
- formula = 'N2+Ar+O2'
- synonym = 'R-729'
- rhoc = 302.622436442
- Tc = 132.6306
- Pc = 3.786
- M = 28.96546
- Tt = 59.75
- Tb = 78.903
- f_acent = 0.0335
- momentoDipolar = 0.0
- Fi0 = {'ao_exp': [0.791309509, 0.212236768], 'ao_exp2': [-0.197938904], 'ao_log': [1, 2.490888032], 'ao_pow': [6.057194e-08, -2.10274769e-05, -0.000158860716, 9.7450251743948, 10.0986147428912, -0.00019536342], 'pow': [-3, -2, -1, 0, 1, 1.5], 'sum2': [0.6666666666666666], 'titao': [25.36365, 16.90741], 'titao2': [87.31279]}
- _constants = {'R': 8.31451, 'Tref': 132.6312, 'c2': [1, 1, 1, 1, 2, 2, 2, 3, 3], 'd1': [1, 1, 1, 2, 3, 3, 4, 4, 4, 6], 'd2': [1, 3, 5, 6, 1, 3, 11, 1, 3], 'gamma2': [1, 1, 1, 1, 1, 1, 1, 1, 1], 'nr1': [0.118160747229, 0.713116392079, -1.61824192067, 0.0714140178971, -0.0865421396646, 0.134211176704, 0.0112626704218, -0.0420533228842, 0.0349008431982, 0.000164957183186], 'nr2': [-0.101365037912, -0.17381369097, -0.0472103183731, -0.0122523554253, -0.146629609713, -0.0316055879821, 0.000233594806142, 0.0148287891978, -0.00938782884667], 'rhoref': 302.622436442, 't1': [0, 0.33, 1.01, 0, 0, 0.15, 0, 0.2, 0.35, 1.35], 't2': [1.6, 0.8, 0.95, 1.25, 3.6, 6, 3.25, 3.5, 15]}
- _blend = {'Pj': 3.78502, 'Tj': 132.6312, 'bubble': {'i': [1, 2, 3, 4, 5, 6], 'n': [0.2260724, -7.080499, 5.700283, -12.44017, 17.81926, -10.81364]}, 'dew': {'i': [1, 2, 5, 8], 'n': [-0.1567266, -5.539635, 0.7567212, -3.514322]}}
- _melting = {'Pref': 5.265, 'Tmax': 2000.0, 'Tmin': 59.75, 'Tref': 78.903, 'a1': [1, 35493.5, -35493.5], 'a2': [], 'a3': [], 'eq': 1, 'exp1': [0, 1.78963, 0], 'exp2': [], 'exp3': []}
- _surf = {'exp': [1.28], 'sigma': [0.03046]}
- _rhoG = {'ao': [-2.0466, -4.752, -13.259, -47.652], 'eq': 3, 'exp': [0.41, 1, 2.8, 6.5]}
- _Pv = {'ao': [-0.1567266, -5.539635, 0.7567212, -3.514322], 'exp': [0.5, 1, 2.5, 4]}
- static _visco(rho, T, fase=None)[source]
Equation for the Viscosity
- Parameters:
- Returns:
μ – Viscosity, [Pa·s]
- Return type:
References
Lemmon, E.W., Jacobsen, R.T. Viscosity and Thermal Conductivity Equations for Nitrogen, Oxygen, Argon, and Air. Int. J. Thermophys. 25 (1) (2004) 21-69. http://dx.doi.org/10.1023/B:IJOT.0000022327.04529.f3
- _thermo(rho, T, fase=None)[source]
Equation for the thermal conductivity
- Parameters:
- Returns:
k – Thermal conductivity, [W/mK]
- Return type:
References
Lemmon, E.W., Jacobsen, R.T. Viscosity and Thermal Conductivity Equations for Nitrogen, Oxygen, Argon, and Air. Int. J. Thermophys. 25 (1) (2004) 21-69. http://dx.doi.org/10.1023/B:IJOT.0000022327.04529.f3
- class iapws.humidAir.HumidAir(**kwargs)[source]
Humid air class with complete functionality
- Parameters:
T (float) – Temperature, [K]
P (float) – Pressure, [MPa]
rho (float) – Density, [kg/m³]
v (float) – Specific volume, [m³/kg]
A (float) – Mass fraction of dry air in humid air, [kg/kg]
xa (float) – Mole fraction of dry air in humid air, [-]
W (float) – Mass fraction of water in humid air, [kg/kg]
xw (float) – Mole fraction of water in humid air, [-]
HR (float) – Humidity ratio, Mass fraction of water in dry air, [kg/kg]
Notes
It needs two incoming properties of T, P, rho.
v as a alternate input parameter to rho
For composition need one of A, xa, W, xw, HR.
The calculated instance has the following properties:
P: Pressure, [MPa]
T: Temperature, [K]
g: Specific Gibbs free energy, [kJ/kg]
a: Specific Helmholtz free energy, [kJ/kg]
v: Specific volume, [m³/kg]
rho: Density, [kg/m³]
h: Specific enthalpy, [kJ/kg]
u: Specific internal energy, [kJ/kg]
s: Specific entropy, [kJ/kg·K]
cp: Specific isobaric heat capacity, [kJ/kg·K]
w: Speed of sound, [m/s]
alfav: Isobaric cubic expansion coefficient, [1/K]
betas: Isoentropic temperature-pressure coefficient, [-]
xkappa: Isothermal Expansion Coefficient, [-]
ks: Adiabatic Compressibility, [1/MPa]
A: Mass fraction of dry air in humid air, [kg/kg]
W: Mass fraction of water in humid air, [kg/kg]
xa: Mole fraction of dry air, [-]
xw: Mole fraction of water, [-]
Pv: Partial pressure of water, [MPa]
xa_sat: Mole fraction of dry air at saturation state, [-]
mu: Relative chemical potential, [kJ/kg]
muw: Chemical potential of water, [kJ/kg]
M: Molar mass of humid air, [g/mol]
HR: Humidity ratio, Mass fraction of water in dry air, [kg/kg]
RH: Relative humidity, [-]
- Attributes:
- A
- HR
- M
- P
- Pv
- RH
- T
- W
- alfav
- betas
calculableCheck if inputs are enough to define state
- cp
- g
- h
- ks
- mu
- muw
- rho
- s
- u
- v
- w
- xa
- xa_sat
- xkappa
- xw
Methods
__call__(**kwargs)Make instance callable to can add input parameter one to one
calculo()Calculate procedure
derivative(z, x, y)Wrapper derivative for custom derived properties where x, y, z can be: P, T, v, rho, u, h, s, g, a
- status = 0
- msg = 'Undefined'
- _mode = None
- _composition = None
- T = None
- rho = None
- v = None
- P = None
- s = None
- cp = None
- h = None
- g = None
- u = None
- alfav = None
- betas = None
- xkappa = None
- ks = None
- w = None
- A = None
- W = None
- mu = None
- muw = None
- M = None
- HR = None
- xa = None
- xw = None
- Pv = None
- xa_sat = None
- RH = None
- kwargs = {'A': None, 'HR': None, 'P': 0.0, 'T': 0.0, 'W': None, 'rho': 0.0, 'v': 0.0, 'xa': None, 'xw': None}
- property calculable
Check if inputs are enough to define state
- derivative(z, x, y)[source]
Wrapper derivative for custom derived properties where x, y, z can be: P, T, v, rho, u, h, s, g, a
- static _prop(T, rho, fav)[source]
Thermodynamic properties of humid air
- Parameters:
- Returns:
prop –
Dictionary with thermodynamic properties of humid air:
P: Pressure, [MPa]
s: Specific entropy, [kJ/kgK]
cp: Specific isobaric heat capacity, [kJ/kgK]
h: Specific enthalpy, [kJ/kg]
g: Specific gibbs energy, [kJ/kg]
alfav: Thermal expansion coefficient, [1/K]
betas: Isentropic T-P coefficient, [K/MPa]
xkappa: Isothermal compressibility, [1/MPa]
ks: Isentropic compressibility, [1/MPa]
w: Speed of sound, [m/s]
- Return type:
References
IAPWS, Guideline on an Equation of State for Humid Air in Contact with Seawater and Ice, Consistent with the IAPWS Formulation 2008 for the Thermodynamic Properties of Seawater, Table 5, http://www.iapws.org/relguide/SeaAir.html
- static _coligative(rho, A, fav)[source]
Miscelaneous properties of humid air
- Parameters:
- Returns:
prop –
Dictionary with calculated properties:
mu: Relative chemical potential, [kJ/kg]
muw: Chemical potential of water, [kJ/kg]
M: Molar mass of humid air, [g/mol]
HR: Humidity ratio, [-]
xa: Mole fraction of dry air, [-]
xw: Mole fraction of water, [-]
- Return type:
References
IAPWS, Guideline on an Equation of State for Humid Air in Contact with Seawater and Ice, Consistent with the IAPWS Formulation 2008 for the Thermodynamic Properties of Seawater, Table 12, http://www.iapws.org/relguide/SeaAir.html
- _fav(T, rho, A)[source]
Specific Helmholtz energy of humid air and derivatives
- Parameters:
- Returns:
prop –
Dictionary with helmholtz energy and derivatives:
fir, [kJ/kg]
fira: \(\left.\frac{\partial f_{av}}{\partial A}\right|_{T,\rho}\), [kJ/kg]
firt: \(\left.\frac{\partial f_{av}}{\partial T}\right|_{A,\rho}\), [kJ/kgK]
fird: \(\left.\frac{\partial f_{av}}{\partial \rho}\right|_{A,T}\), [kJ/m³kg²]
firaa: \(\left.\frac{\partial^2 f_{av}}{\partial A^2}\right|_{T, \rho}\), [kJ/kg]
firat: \(\left.\frac{\partial^2 f_{av}}{\partial A \partial T}\right|_{\rho}\), [kJ/kgK]
firad: \(\left.\frac{\partial^2 f_{av}}{\partial A \partial \rho}\right|_T\), [kJ/m³kg²]
firtt: \(\left.\frac{\partial^2 f_{av}}{\partial T^2}\right|_{A, \rho}\), [kJ/kgK²]
firdt: \(\left.\frac{\partial^2 f_{av}}{\partial \rho \partial T}\right|_A\), [kJ/m³kg²K]
firdd: \(\left.\frac{\partial^2 f_{av}}{\partial \rho^2}\right|_{A, T}\), [kJ/m⁶kg³]
- Return type:
References
IAPWS, Guideline on an Equation of State for Humid Air in Contact with Seawater and Ice, Consistent with the IAPWS Formulation 2008 for the Thermodynamic Properties of Seawater, Table 6, http://www.iapws.org/relguide/SeaAir.html
- static _fmix(T, rho, A)[source]
Specific Helmholtz energy of air-water interaction
- Parameters:
- Returns:
prop –
Dictionary with helmholtz energy and derivatives:
fir, [kJ/kg]
fira: \(\left.\frac{\partial f_{mix}}{\partial A}\right|_{T,\rho}\), [kJ/kg]
firt: \(\left.\frac{\partial f_{mix}}{\partial T}\right|_{A,\rho}\), [kJ/kgK]
fird: \(\left.\frac{\partial f_{mix}}{\partial \rho}\right|_{A,T}\), [kJ/m³kg²]
firaa: \(\left.\frac{\partial^2 f_{mix}}{\partial A^2}\right|_{T, \rho}\), [kJ/kg]
firat: \(\left.\frac{\partial^2 f_{mix}}{\partial A \partial T}\right|_{\rho}\), [kJ/kgK]
firad: \(\left.\frac{\partial^2 f_{mix}}{\partial A \partial \rho}\right|_T\), [kJ/m³kg²]
firtt: \(\left.\frac{\partial^2 f_{mix}}{\partial T^2}\right|_{A, \rho}\), [kJ/kgK²]
firdt: \(\left.\frac{\partial^2 f_{mix}}{\partial \rho \partial T}\right|_A\), [kJ/m³kg²K]
firdd: \(\left.\frac{\partial^2 f_{mix}}{\partial \rho^2}\right|_{A, T}\), [kJ/m⁶kg³]
- Return type:
References
IAPWS, Guideline on an Equation of State for Humid Air in Contact with Seawater and Ice, Consistent with the IAPWS Formulation 2008 for the Thermodynamic Properties of Seawater, Table 10, http://www.iapws.org/relguide/SeaAir.html