iapws.ammonia module¶
Module with Ammonia-water mixture properties and related properties. The module include:
-
class
iapws.ammonia.
NH3
(**kwargs)[source]¶ Multiparameter equation of state for ammonia for internal procedures, see MEoS base class
Parameters: - T (float) – Temperature, [K]
- P (float) – Pressure, [MPa]
- rho (float) – Density, [kg/m³]
- v (float) – Specific volume, [m³/kg]
- h (float) – Specific enthalpy, [kJ/kg]
- s (float) – Specific entropy, [kJ/kgK]
- u (float) – Specific internal energy, [kJ/kg]
- x (float) – Vapor quality, [-]
- l (float, optional) – Wavelength of light, for refractive index, [μm]
- rho0 (float, optional) – Initial value of density, to improve iteration, [kg/m³]
- T0 (float, optional) – Initial value of temperature, to improve iteration, [K]
- x0 (Initial value of vapor quality, necessary in bad input pair definition) – where there are two valid solution (T-h, T-s)
Notes
- It needs two incoming properties of T, P, rho, h, s, u.
- v as a alternate input parameter to rho
- T-x, P-x, preferred input pair to specified a point in two phases region
The calculated instance has the following properties:
- P: Pressure, [MPa]
- T: Temperature, [K]
- x: Vapor quality, [-]
- g: Specific Gibbs free energy, [kJ/kg]
- a: Specific Helmholtz free energy, [kJ/kg]
- v: Specific volume, [m³/kg]
- r: 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]
- cv: Specific isochoric heat capacity, [kJ/kg·K]
- cp_cv: Heat capacity ratio, [-]
- Z: Compression factor, [-]
- fi: Fugacity coefficient, [-]
- f: Fugacity, [MPa]
- gamma: Isoentropic exponent, [-]
- alfav: Isobaric cubic expansion coefficient, [1/K]
- kappa: Isothermal compressibility, [1/MPa]
- kappas: Adiabatic compresibility, [1/MPa]
- alfap: Relative pressure coefficient, [1/K]
- betap: Isothermal stress coefficient, [kg/m³]
- joule: Joule-Thomson coefficient, [K/MPa]
- betas: Isoentropic temperature-pressure coefficient, [-]
- Gruneisen: Gruneisen parameter, [-]
- virialB: Second virial coefficient, [m³/kg]
- virialC: Third virial coefficient, [m⁶/kg²]
- dpdT_rho: Derivatives, dp/dT at constant rho, [MPa/K]
- dpdrho_T: Derivatives, dp/drho at constant T, [MPa·m³/kg]
- drhodT_P: Derivatives, drho/dT at constant P, [kg/m³·K]
- drhodP_T: Derivatives, drho/dP at constant T, [kg/m³·MPa]
- dhdT_rho: Derivatives, dh/dT at constant rho, [kJ/kg·K]
- dhdP_T: Isothermal throttling coefficient, [kJ/kg·MPa]
- dhdT_P: Derivatives, dh/dT at constant P, [kJ/kg·K]
- dhdrho_T: Derivatives, dh/drho at constant T, [kJ·m³/kg²]
- dhdrho_P: Derivatives, dh/drho at constant P, [kJ·m³/kg²]
- dhdP_rho: Derivatives, dh/dP at constant rho, [kJ/kg·MPa]
- kt: Isothermal Expansion Coefficient, [-]
- ks: Adiabatic Compressibility, [1/MPa]
- Ks: Adiabatic bulk modulus, [MPa]
- Kt: Isothermal bulk modulus, [MPa]
- v0: Ideal specific volume, [m³/kg]
- rho0: Ideal gas density, [kg/m³]
- u0: Ideal specific internal energy, [kJ/kg]
- h0: Ideal specific enthalpy, [kJ/kg]
- s0: Ideal specific entropy, [kJ/kg·K]
- a0: Ideal specific Helmholtz free energy, [kJ/kg]
- g0: Ideal specific Gibbs free energy, [kJ/kg]
- cp0: Ideal specific isobaric heat capacity, [kJ/kg·K]
- cv0: Ideal specific isochoric heat capacity, [kJ/kg·K]
- w0: Ideal speed of sound, [m/s]
- gamma0: Ideal isoentropic exponent, [-]
- w: Speed of sound, [m/s]
- mu: Dynamic viscosity, [Pa·s]
- nu: Kinematic viscosity, [m²/s]
- k: Thermal conductivity, [W/m·K]
- alfa: Thermal diffusivity, [m²/s]
- sigma: Surface tension, [N/m]
- epsilon: Dielectric constant, [-]
- n: Refractive index, [-]
- Prandt: Prandtl number, [-]
- Pr: Reduced Pressure, [-]
- Tr: Reduced Temperature, [-]
- Hvap: Vaporization heat, [kJ/kg]
- Svap: Vaporization entropy, [kJ/kg·K]
- Z_rho: \((Z-1)/\rho\), [m³/kg]
- IntP: Internal pressure, [MPa]
- invT: Negative reciprocal temperature, [1/K]
- hInput: Specific heat input, [kJ/kg]
References
Baehr, H.D., Tillner-Roth, R.; Thermodynamic Properties of Environmentally Acceptable Refrigerants: Equations of State and Tables for Ammonia, R22, R134a, R152a, and R123. Springer-Verlag, Berlin, 1994. http://doi.org/10.1007/978-3-642-79400-1
Attributes: - Gas
- Gruneisen
- Hvap
- IntP
- Ks
- Kt
- Liquid
- P
- Pr
- Prandt
- Svap
- T
- Tr
- Z
- Z_rho
- a
- a0
- alfa
- alfap
- alfav
- betap
- betas
calculable
Check 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 -
name
= 'ammonia'¶
-
CASNumber
= '7664-41-7'¶
-
formula
= 'NH3'¶
-
synonym
= 'R-717'¶
-
rhoc
= 225.0¶
-
Tc
= 405.4¶
-
Pc
= 11.333¶
-
M
= 17.03026¶
-
Tt
= 195.495¶
-
Tb
= 239.823¶
-
f_acent
= 0.25601¶
-
momentoDipolar
= 1.47¶
-
Fi0
= {'ao_exp': [], 'ao_hyp': [], 'ao_log': [1, -1], 'ao_pow': [-15.81502, 4.255726, 11.47434, -1.296211, 0.5706757], 'hyp': [], 'pow': [0, 1, 0.3333333333333333, -1.5, -1.75], 'titao': []}¶
-
_constants
= {'R': 8.314471, 'c2': [1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3], 'd1': [1, 2, 1, 4, 15], 'd2': [3, 3, 1, 8, 2, 8, 1, 1, 2, 3, 2, 4, 3, 1, 2, 4], 'gamma2': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 'nr1': [-1.858814, 0.04554431, 0.7238548, 0.0122947, 2.141882e-11], 'nr2': [-0.0143002, 0.3441324, -0.2873571, 2.352589e-05, -0.03497111, 0.001831117, 0.02397852, -0.04085375, 0.2379275, -0.03548972, -0.1823729, 0.02281556, -0.006663444, -0.008847486, 0.002272635, -0.0005588655], 't1': [1.5, -0.5, 0.5, 1.0, 3.0], 't2': [0, 3, 4, 4, 5, 5, 3, 6, 8, 8, 10, 10, 5, 7.5, 15, 30]}¶
-
_melting
= {'Pref': 1000, 'Tmax': 700.0, 'Tmin': 195.495, 'Tref': 195.495, 'a1': [], 'a2': [], 'a3': [2533.125], 'eq': 1, 'exp1': [], 'exp2': [], 'exp3': [1]}¶
-
_surf
= {'exp': [1.211, 5.585], 'sigma': [0.1028, -0.09453]}¶
-
_Pv
= {'ao': [-7.0993, -2.433, 8.7591, -6.4091, -2.1185], 'eq': 5, 'exp': [1.0, 1.5, 1.7, 1.95, 4.2]}¶
-
_rhoL
= {'ao': [34.488, -128.49, 173.82, -106.99, 30.339], 'eq': 1, 'exp': [0.58, 0.75, 0.9, 1.1, 1.3]}¶
-
_rhoG
= {'ao': [-0.38435, -4.0846, -6.6634, -31.881, 213.06, -246.48], 'eq': 3, 'exp': [0.218, 0.55, 1.5, 3.7, 5.5, 5.8]}¶
-
_visco
(rho, T, fase=None)[source]¶ Equation for the Viscosity
Parameters: Returns: mu – Viscosity [Pa·s]
Return type: References
Fenghour, A., Wakeham, W.A., Vesovic, V., Watson, J.T.R., Millat, J., and Vogel, E., The viscosity of ammonia, J. Phys. Chem. Ref. Data 24, 1649 (1995). doi:10.1063/1.555961
-
_thermo
(rho, T, fase)[source]¶ Equation for the thermal conductivity
Parameters: Returns: k – Thermal conductivity [W/mK]
Return type: References
Tufeu, R., Ivanov, D.Y., Garrabos, Y., and Le Neindre, B., Thermal conductivity of ammonia in a large temperature and pressure range including the critical region, Ber. Bunsenges. Phys. Chem., 88:422-427, 1984. doi:10.1002/bbpc.19840880421
-
class
iapws.ammonia.
H2ONH3
[source]¶ Ammonia-water mixtures.
-
_prop
(rho, T, x)[source]¶ Thermodynamic properties of ammonia-water mixtures
Parameters: Returns: prop –
Dictionary with thermodynamic properties of ammonia-water mixtures:
- M: Mixture molecular mass, [g/mol]
- P: Pressure, [MPa]
- u: Specific internal energy, [kJ/kg]
- s: Specific entropy, [kJ/kgK]
- h: Specific enthalpy, [kJ/kg]
- a: Specific Helmholtz energy, [kJ/kg]
- g: Specific gibbs energy, [kJ/kg]
- cv: Specific isochoric heat capacity, [kJ/kgK]
- cp: Specific isobaric heat capacity, [kJ/kgK]
- w: Speed of sound, [m/s]
- fugH2O: Fugacity of water, [-]
- fugNH3: Fugacity of ammonia, [-]
Return type: References
IAPWS, Guideline on the IAPWS Formulation 2001 for the Thermodynamic Properties of Ammonia-Water Mixtures, http://www.iapws.org/relguide/nh3h2o.pdf, Table 4
-
static
_phi0
(rho, T, x)[source]¶ Ideal gas Helmholtz energy of binary mixtures and derivatives
Parameters: Returns: prop – Dictionary with ideal adimensional helmholtz energy and derivatives:
- tau: the adimensional temperature variable, [-]
- delta: the adimensional density variable, [-]
- fio,[-]
- fiot: [∂fio/∂τ]δ [-]
- fiod: [∂fio/∂δ]τ [-]
- fiott: [∂²fio/∂τ²]δ [-]
- fiodt: [∂²fio/∂τ∂δ] [-]
- fiodd: [∂²fio/∂δ²]τ [-]
Return type: References
IAPWS, Guideline on the IAPWS Formulation 2001 for the Thermodynamic Properties of Ammonia-Water Mixtures, http://www.iapws.org/relguide/nh3h2o.pdf, Eq 2
-
_phir
(rho, T, x)[source]¶ Residual contribution to the free Helmholtz energy
Parameters: Returns: prop – dictionary with residual adimensional helmholtz energy and derivatives:
- tau: the adimensional temperature variable, [-]
- delta: the adimensional density variable, [-]
- fir, [-]
- firt: [∂fir/∂τ]δ,x [-]
- fird: [∂fir/∂δ]τ,x [-]
- firtt: [∂²fir/∂τ²]δ,x [-]
- firdt: [∂²fir/∂τ∂δ]x [-]
- firdd: [∂²fir/∂δ²]τ,x [-]
- firx: [∂fir/∂x]τ,δ [-]
- F: Function for fugacity calculation, [-]
Return type: References
IAPWS, Guideline on the IAPWS Formulation 2001 for the Thermodynamic Properties of Ammonia-Water Mixtures, http://www.iapws.org/relguide/nh3h2o.pdf, Eq 3
-
static
_Dphir
(tau, delta, x)[source]¶ Departure function to the residual contribution to the free Helmholtz energy
Parameters: Returns: prop – Dictionary with departure contribution to the residual adimensional helmholtz energy and derivatives:
- fir [-]
- firt: [∂Δfir/∂τ]δ,x [-]
- fird: [∂Δfir/∂δ]τ,x [-]
- firtt: [∂²Δfir/∂τ²]δ,x [-]
- firdt: [∂²Δfir/∂τ∂δ]x [-]
- firdd: [∂²Δfir/∂δ²]τ,x [-]
- firx: [∂Δfir/∂x]τ,δ [-]
Return type: References
IAPWS, Guideline on the IAPWS Formulation 2001 for the Thermodynamic Properties of Ammonia-Water Mixtures, http://www.iapws.org/relguide/nh3h2o.pdf, Eq 8
-
-
iapws.ammonia.
Ttr
(x)[source]¶ Equation for the triple point of ammonia-water mixture
Parameters: x (float) – Mole fraction of ammonia in mixture, [mol/mol] Returns: Ttr – Triple point temperature, [K] Return type: float Notes
Raise
NotImplementedError
if input isn’t in limit:- 0 ≤ x ≤ 1
References
IAPWS, Guideline on the IAPWS Formulation 2001 for the Thermodynamic Properties of Ammonia-Water Mixtures, http://www.iapws.org/relguide/nh3h2o.pdf, Eq 9