lib.meos module

This module implement high accuracy multiparameter equation of state. The supported equation include the fundamental equation of state explicit in the Helmholtz energy and the modified Benedict-Webb-Rubin (mBWR) equation of state. The module implement too the calculation using the Peng-Robinson cubic equation of state.

The ideal gas contribution is equal for all equation of state implemented. It uses the equation for ideal gas specific heat so all fluid must define it in subclass fluid definition

\[\begin{split}\begin{array}[t]{l} f^o(\rho,T) = h^o(T)-RT-Ts^o(\rho,T)\\ h^o(T) = \intop_{T_{o}}^{T}C_{p}^{o}dT+h_{0}^{o}\\ s^o(T) = \intop_{T_o}^{T}\frac{C_{p}^{o}-R}{T}dT - R\ln\left(\frac{\rho}{\rho_0^o}\right)+s_{0}^{o}\\ \end{array}\end{split}\]

Helmholtz

Most modern, high-accuracy equation of state use this general form explicit in the free Helmholtz energy as a function of temperature and density.

\[\frac{A(\rho,T)}{RT} = \phi(\delta,\tau) = \phi^o(\delta,\tau) + \phi^r(\delta,\tau)\]

The residual contribution is a combination of term

\[\begin{split}\begin{array}[t]{l} \phi^r = \phi^r_{Pol}+\phi^r_{Exp}+\phi^r_{GBS}+\phi^r_{NA}+\phi^r_{ass}\\ \phi^r_{Pol} = \sum_i n_i\delta^{d_i}\tau^{t_i}\\ \phi^r_{Exp} = \sum_i n_i\delta^{d_i}\tau^{t_i} e^{-\gamma_i\delta^{c_i}}\\ \phi^r_{GBS} = \sum_i n_i\delta^{d_i}\tau^{t_i} e^{-\alpha(\delta- \epsilon_i)^2-\beta_i(\tau-\gamma_i)^2}\\ \phi^r_{NA} = \sum n\Delta^{b_i}\delta e^{-C_i\left(\delta-1\right)^2-D_i \left(\tau-1\right)^2}\\ \Delta = \theta^2+B_i\left(\left(\delta-1\right)^2\right)^{a_i}\\ \theta = (1-\tau)+A_i\left(\left(\delta-1\right)^2\right)^{1/2\beta_ i}\\ \phi^r_{ass} = \sum_i n_i\tau^{t_i}\delta^{d_i}e^{-\alpha_i\left(\delta- \epsilon_i\right)^2+\frac{1}{\beta_i\left(\tau-\gamma_i\right)^2+b_i}}\\ \end{array}\end{split}\]

The polynomial and exponential term are common to all equations, the Gaussian bell shaped are used to improved accuracy in critical region. The nonanalytic terms are used to represent the steep variation of icochoric heat capacity and speed of sound near the critical point. They are only used for water and carbon dioxide reference equation of state, they are very time computing. The associating term are used only for ammonia for a better representation of associating fluids.

MBWR (modified Benedict-Webb-Rubin)

Pressure explicit equation of state as a function of temperature and density

\[P = \sum_{n=1}^9a_n\rho^n + \exp\left(-\delta^2\right) \sum_{n=10}^{15}a_n\rho^{2n-17}\]

where:

\[\begin{split}\begin{array}[t]{l} \delta = \rho/\rho_c\\ a_1 = RT\\ a_2 = b_1T + b_2T^{1/2} + b_3 + b_4/T + b_5/T^2\\ a_3 = b_6T+b_7+b_8T+b_9/T^2\\ a_4 = b_{10}T+b_{11}+b_{12}/T\\ a_5 = b_{13}\\ a_6 = b_{14}/T+b_{15}/T^2\\ a_7 = b_{16}/T\\ a_8 = b_{17}/T+b_{18}/T^2\\ a_9 = b_{19}/T^2\\ a_{10} = b_{20}/T^2+b_{21}/T^3\\ a_{11} = b_{22}/T^2+b_{23}/T^4\\ a_{12} = b_{24}/T^2+b_{25}/T^3\\ a_{13} = b_{26}/T^2+b_{27}/T^4\\ a_{14} = b_{28}/T^2+b_{29}/T^3\\ a_{15} = b_{30}/T^2+b_{31}/T^3+b_{32}/T^4\\ \end{array}\end{split}\]

\(b_i\) are the coefficient of equation saved in dict

Cubic equation of state

Cubic pressure-explicit equations of state can be expressed with the general form:

\[P = \frac{RT}{V-b}-\frac{\alpha(T)}{\left(v+\Delta_1b\right) \left(v+\Delta_2b\right)}\]

From this formulation it’s possible calculate the Helmholtz free energy with the equation:

\[\begin{split}\begin{array}[t]{l} \alpha^r = \psi^{(-)}-\frac{\tau\alpha}{RT_c}\psi^{(+)}\\ \psi^{(-)} = -\ln \left(1-b\delta\rho_c\right)\\ \psi^{(+)} = \frac{\ln\left(\frac{\Delta_1b\rho_c\delta+1}{\Delta_2b\rho_c \delta+1}\right)}{b\left(\Delta_1-\Delta_2\right)}\\ \end{array}\end{split}\]

Module Code

The module include the following functions:

MEoS: Main class with all functionality

The module implement too high accuracy correlation for viscosity and thermal conductivity, see the documentation of its calculation procedure:

Other functions used in iteration calculation to try to speed up it:

lib.meos.translate(context: str, sourceText: str, disambiguation: str = None, n: int = -1) str
lib.meos._Helmholtz_phir(tau, delta, coef)[source]

Residual contribution to the free Helmholtz energy

Parameters:
taufloat

Inverse reduced temperature, Tc/T [-]

deltafloat

Reduced density, rho/rhoc [-]

coefdict

Parameters of multiparameter equation of state

Returns:
firfloat

\(\phi^r\), adimensional free Helmholtz energy, [-]

lib.meos._Helmholtz_phird(tau, delta, coef)[source]

Residual contribution to the free Helmholtz energy, delta derivative

Parameters:
taufloat

Inverse reduced temperature, Tc/T [-]

deltafloat

Reduced density, rho/rhoc [-]

coefdict

Parameters of multiparameter equation of state

Returns:
firdfloat

\(\left.\frac{\partial \phi^r}{\partial \delta}\right|_{\tau}\)

lib.meos._Helmholtz_phirt(tau, delta, coef)[source]

Residual contribution to the free Helmholtz energy, tau derivative

Parameters:
taufloat

Inverse reduced temperature, Tc/T [-]

deltafloat

Reduced density, rho/rhoc [-]

coefdict

Parameters of multiparameter equation of state

Returns:
firtfloat

\(\left.\frac{\partial \phi^r}{\partial \tau}\right|_{\delta}\)

lib.meos._MBWR_phir(T, rho, rhoc, M, coef)[source]

Residual contribution to the free Helmholtz energy for MBWR EoS

Parameters:
Tfloat

Temperature, [K]

rhofloat

Density, [kg/m³]

rhocfloat

Critical density, [kg/m³]

Mfloat

Molecular weight, [g/mol]

coefdict

Parameters of MBWR equation of state

Returns:
firfloat

\(\phi^r\), adimensional free Helmholtz energy, [-]

lib.meos._MBWR_phird(T, rho, rhoc, M, coef)[source]

Residual contribution to the free Helmholtz energy for MBWR EoS, delta derivative

Parameters:
Tfloat

Temperature, [K]

rhofloat

Density, [kg/m³]

rhocfloat

Critical density, [kg/m³]

Mfloat

Molecular weight, [g/mol]

coefdict

Parameters of MBWR equation of state

Returns:
firdfloat

\(\left.\frac{\partial \phi^r}{\partial \delta}\right|_{\tau}\)

lib.meos._MBWR_phirt(T, Tc, rho, rhoc, M, coef)[source]

Residual contribution to the free Helmholtz energy, tau derivative

Parameters:
Tfloat

Temperature, [K]

Tcfloat

Critical temperature, [K]

rhofloat

Density, [kg/m³]

rhocfloat

Critical density, [kg/m³]

Mfloat

Molecular weight, [g/mol]

coefdict

Parameters of MBWR equation of state

Returns:
firtfloat

\(\left.\frac{\partial \phi^r}{\partial \tau}\right|_{\delta}\)

lib.meos._PR_phir(tau, delta, **kw)[source]

Residual contribution to the free Helmholtz energy from a generic cubic equation of state with the form:

Parameters:
taufloat

Inverse reduced temperature, Tc/T [-]

deltafloat

Reduced density, rho/rhoc [-]

kwlist

Aditional parameters specific of cubic equation of state. The parameters include: rhoc, Tc, b, alfa, Delta1, Delta2

Returns:
firfloat

\(\phi^r\), adimensional free Helmholtz energy, [-]

lib.meos._PR_phird(tau, delta, **kw)[source]

Residual contribution to the free Helmholtz energy from a generic cubic equation of state, delta derivative

Parameters:
taufloat

Inverse reduced temperature, Tc/T [-]

deltafloat

Reduced density, rho/rhoc [-]

kwlist

Aditional parameters specific of cubic equation of state. The parameters include: rhoc, Tc, b, alfa, Delta1, Delta2

Returns:
firdfloat

\(\left.\frac{\partial \phi^r}{\partial \delta}\right|_{\tau}\)

lib.meos._PR_phirt(tau, delta, **kw)[source]

Residual contribution to the free Helmholtz energy from a generic cubic equation of state, tau derivative

Parameters:
taufloat

Inverse reduced temperature, Tc/T [-]

deltafloat

Reduced density, rho/rhoc [-]

kwlist

Aditional parameters specific of cubic equation of state. The parameters include: rhoc, Tc, b, alfa, Delta1, Delta2

Returns:
firtfloat

\(\left.\frac{\partial \phi^r}{\partial \tau}\right|_{\delta}\)

lib.meos._instanceBuilder(p2val, *args)[source]

Instance builder function

class lib.meos.MEoS(**kwargs)[source]

Bases: ThermoAdvanced

General class for implement multiparameter equation of state Each child class must define the parameters for the calculations

Compound definition:

  • name: Name of component

  • CASNumber: CAS Number of component

  • formula: Empiric formula

  • synonym: Alternate formula (Refrigerant name)

  • id: index of component in pychemqt database

  • _refPropName = Codename of compound in RefProp

  • _coolPropName = Coedename of compound in coolProp

Physical properties:

  • rhoc: Critical density, [kg/m³]

  • Tc: Critical temperature, [K]

  • Pc: Critical pressure, [Pa]

  • M: Molecular weigth, [g/mol]

  • Tt: Temperature of triple point, [K]

  • Tb: Normal boiling point temperature, [K]

  • f_acent: Acentric factor, [-]

  • momentoDipolar: Depole moment, [C·m]

Parameters of mEoS and transport correlation:

  • eq: List of pointer for mEoS correlations

  • _viscosity: List of pointer for viscosity correlations

  • _thermal: List of pointer for thermal conductivity correlations

Other properties correlations:

  • _vapor_Pressure: Parameters for vapor pressure ancillary equation

  • _liquid_Density: Parameters for liquid density ancillary equation

  • _vapor_Density: Parameters for vapor density ancillary equation

  • _dielectric: Parameters for dielectric constant calculation

  • _melting: Parameters for melting line calculation

  • _sublimation: Parameters for sublimation line calculation

  • _surface: Parameters for surface tension calculation

Parameters necessary only for special EoS:

  • _PR: Lin-Duan volume correction for Peng-Robinson equation of state

  • _Tr: Temperature parameter for generalized equation

  • _rhor: Density parameter for generalized equation

  • _w: Acentric factor for generalized equation

Attributes:
calculable

Check if instance has enough input to be calculated

id

Methods

__call__(**kwargs)

Make instance callable to let definition one parameters for one

calculo()

Calculate procedure

cleanOldValues(**kwargs)

Convert alternative input parameters

derivative(z, x, y, fase)

Calculate generic partial derivative: (δz/δx)y where x, y, z can be: P, T, v, 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

fsolve(f[, f2])

Procedure to iterate to calculate T and rho in input pair without some of that unknown

vtPR(rho, T)

Volume translation for Peng-Robinson equation of state for liquid phase as explain in [13]

id = None
_refPropName = ''
_coolPropName = ''
_Tr = None
_rhor = None
_w = None
eq = ()
_PR = None
_dielectric = None
_melting = None
_sublimation = None
_surface = None
_vapor_Pressure = None
_liquid_Density = None
_vapor_Density = None
_omega = None
_viscosity = None
_thermal = None
_critical = None
_T0_ecs = None
_rho0_ecs = None
_ecs_msg = ''
_test = []
status = 0
msg = 'Unknown Variables'
classmethod from_list(p1name, p1val, p2name, p2val)[source]

Speed up method using multiprocessing for multiple point calculation with a fixed input and changing other input parameter

Parameters:
p1namestr

string with name of fixed input parameter

p1valfloat

fixed input parameter value

p2namestr

string with name of changing input parameter

p2vallist

iterable with values of changing input parameter

Returns:
stateslist

list with calculated states

__init__(**kwargs)[source]

Constructor of instance, the definition can be done with any of this input pair:

  • T-P : Only for single phase region difinition

  • T-x : For two phase region definition with known temperature

  • P-x : For two phase region definition with known pressure

  • T-rho

  • T-s

  • T-u

  • P-rho

  • P-h

  • P-u

  • rho-h

  • rho-s

  • rho-u

  • h-s

  • s-u

Volume can be used as alternate input for density

Other input pair like T-h, P-s, h-u are supported but it isn’t recommended because they are bad state definition, there are several point with same T-h value.

>>> from lib.mEoS import H2O
>>> st1 = H2O(T=300, P=101325)
>>> st2 = H2O(T=300, h=st1.h)
>>> "%0.2f %0.2f" % (st1.T, st2.T)
'300.00 300.00'
>>> "%0.4f %0.4f" % (st1.x, st2.x)
'0.0000 0.0000'
>>> "%0.4f %0.4f" % (st1.h, st2.h)
'112654.8997 112654.8997'

As we can see, there are two point with same T-h values, so as input pair they are not a complete definition of state point.

The calculated instance has the following properties

  • T: Temperature, [K]

  • Tr: Reduced temperature, [-]

  • P: Pressure, [Pa]

  • Pr: Reduced Pressure, [-]

  • x: Quality, [-]

  • rho: Density, [kg/m³]

  • rhoM: Molar Density, [kmol/m³]

  • v: Volume, [m³/kg]

  • h: Enthalpy, [kJ/kg]

  • hM: Molar Enthalpy, [kJ/kmol]

  • s: Entropy, [kJ/kg·K]

  • sM: Molar Entropy, [kJ/kmol·K]

  • u: Internal Energy, [kJ/kg]

  • uM: Molar Internal Energy, [kJ/kmol]

  • a: Helmholtz Free Energy, [kJ/kg]

  • aM: Molar Helmholtz Free Energy, [kJ/kmol]

  • g: Gibbs Free Energy, [kJ/kg]

  • gM: Molar Gibbs Free Energy, [kJ/kmol]

  • cv: Specific isochoric heat capacity, [J/kg·K]

  • cvM: Molar Specific isochoric heat capacity, [J/kmol·K]

  • cp: Specific isobaric heat capacity, [J/kg·K]

  • cpM: Molar Specific isobaric heat capacity, [J/kmol·K]

  • cp_cv: Heat capacities ratio, [-]

  • w: Speed sound, [m/s]

  • Z: Compresibility, [-]

  • fi: Fugacity coefficient, [-]

  • f: Fugacity, [Pa]

  • gamma: Isoentropic exponent, [-]

  • alfav: Volume Expansivity, [1/K]

  • kappa: Isothermal compresibility, [1/Pa]

  • kappas: Adiabatic compresibility, [1/Pa]

  • alfap: Relative pressure coefficient, [1/K]

  • batap: Isothermal stress coefficient, [kg/m³]

  • joule: Joule-Thomson coefficient, [K/Pa]

  • deltat: Isothermal throttling coefficient, [kJ/kgPa]

  • Hvap: Vaporization heat, [kJ/kg]

  • Svap: Vaporization entropy, [kJ/kg·K]

  • betas: Isentropic temperature-pressure, [K/Pa]

  • Gruneisen: Gruneisen parameter, [-]

  • virialB: 2nd virial coefficient, [m³/kg]

  • virialC: 3er virial coefficient, [m⁶/kg²]

  • virialD: 4th virial coefficient, [m¹²/kg³]

  • dpdT_rho: (dp/dT)_rho, [Pa/K]

  • dpdrho_T: (dp/drho)_T, [Pam³/kg]

  • drhodT_P: (drho/dT)_P, [kg/m³·K]

  • drhodP_T: (drho/dP)_T, [kg/Pam³]

  • dhdT_rho: (dh/dT)_rho, [J/kg·K]

  • dhdP_T: (dh/dP)_T, [J/kgPa]

  • dhdT_P: (dh/dT)_P, [J/kg·K]

  • dhdrho_T: (dh/drho)_T, [kJm³/kg²]

  • dhdrho_P: (dh/drho)_P, [kJm³/kg²]

  • dhdP_rho: (dh/dP)_rho, [kJ/kgPa]

  • kt: Isothermal expansion coefficient, [-]

  • ks: Isentropic expansion coefficient, [-]

  • Ks: Adiabatic bulk modulus, [Pa]

  • Kt: Isothermal bulk modulus, [Pa]

  • IntP: Internal pressure, [Pa]

  • invT: Negative reciprocal temperature, [1/K]

  • hInput: Specific heat input, [J/kg]

  • epsilon: Dielectric constant, [-]

  • mu: Viscosity, [Pa·s]

  • k: Thermal conductivity, [W/m·K]

  • nu: Kinematic viscosity, [m²/s]

  • alfa: Thermal diffusivity, [m²/s]

  • sigma: Surface tension, [N/m]

  • Prandt: Prandtl number, [-]

  • v0: Ideal gas Specific volume, [m³/kg]

  • rho0: Ideal gas Density, [kg/m³]

  • h0: Ideal gas Specific enthalpy, [J/kg]

  • u0: Ideal gas Specific internal energy, [J/kg]

  • s0: Ideal gas Specific entropy, [J/kg·K]

  • a0: Ideal gas Specific Helmholtz free energy, [J/kg]

  • g0: Ideal gas Specific Gibbs free energy, [J/kg]

  • cp0: Ideal gas Specific isobaric heat capacity, [J/kg·K]

  • cv0: Ideal gas Specific isochoric heat capacity, [J/kg·K]

  • cp0_cv: Ideal gas heat capacities ratio, [-]

  • gamma0: Ideal gas Isoentropic exponent, [-]

  • d2Pdrho2: [∂²P/∂ρ²]T

  • d2PdrhodT: [∂²P/∂ρ∂T]

  • d2PdT2: [∂²P/∂∂T²]

  • d2sdrho2: [∂²s/∂ρ²]

  • d2sdrhodT: [∂²s/∂ρ∂T]

  • d2sdT2: [∂²s/∂T²]

  • d2udrho: [∂²u/∂ρ²]

  • d2udrhodT: [∂²u/∂ρ∂T]

  • d2udT2: [∂²u/∂T²]

  • d2hdrho2: [∂²h/∂ρ²]

  • d2hdrhodT: [∂²h/∂ρ∂T]

  • d2hdT2: [∂²h/∂ρ∂T²]

  • d2gdrho2: [∂²g/∂ρ²]

  • d2gdrhodT: [∂²g/∂ρ∂T]

  • d2gdT2: [∂²g/∂T²]

  • PIP: Phase identification parameter, [-]

Parameters:
Tfloat

Temperature, [K]

Pfloat

Pressure, [Pa]

rhofloat

Density, [kg/m³]

vfloat

Specific volume, [m³/kg]

hfloat

Specific enthalpy, [kJ/kg]

sfloat

Specific entropy, [kJ/kg·K]

ufloat

Specific internal energy, [kJ/kg·K]

xfloat

Quality, [-]

eqint, default 0

Index of equation to use. This variable can be too string with several option:

  • Codename of equation to use, the name of equation dict

  • PR: To use the Peng-Robinson cubic equation

  • Generalised: To use a generalized mEoS

  • GERG: To use the GERG-2008 equation of Kunz-Wagner

viscoint, default 0

Index of correlation for viscosity calculation

thermalint, default 0

Index of correlation for thermal conductivity calculation

refstr

Code with enthalpy-entropy reference state:

  • OTO: h,s=0 at 25ºC and 1 atm

  • NBP: h,s=0 saturated liquid at Tb

  • IIR: h=200,s=1 saturated liquid 0ºC

  • ASHRAE: h,s=0 saturated liquid at -40ºC

  • CUSTOM: custom user defined reference state

refvalues: list

List with custom values of reference state, only necessary if ref has CUSTOM value. The list must be the variables in the order:

  • Tref: Reference temperature, [K]

  • Pref: Reference pressure, [kPa]

  • ho: Enthalpy in reference state, [kJ/kg]

  • so: Entropy in reference state, [kJ/kg·K]

rho0float

Initial density value for improve iteration convergence, [kg/m³]

T0float

Initial teperature value for improve iteration convergence, [K]

kwargs = {'P': 0.0, 'T': 0.0, 'T0': 0, 'eq': 0, 'h': None, 'ref': None, 'refvalues': None, 'rho': None, 'rho0': 0, 's': None, 'thermal': 0, 'u': None, 'v': 0.0, 'visco': 0, 'x': None}
cleanOldValues(**kwargs)[source]

Convert alternative input parameters

property calculable

Check if instance has enough input to be calculated

_TP()[source]

Temperature-Pressure input definition

_Th()[source]

Temperature-enthalpy input definition

This input pair isn’t a good pair state definition Temperature and enthalpy don’t represent totally independent variables, for examples there is isobar lines crossing in the region near to saturated liquid. In other words, there are several point with equal enthalpy value at same temperature, one as saturated liquid and other in two phases region near to saturation

>>> from lib.mEoS import H2O
>>> st1 = H2O(T=300, P=101325)
>>> def f(x):
...     return H2O(T=300, x=x).h-st1.h
>>> x = newton(f, 0.1)
>>> st2 = H2O(T=300, x=x)
>>> abs(round(st1.h-st2.h, 5))
0.0

Both point has same enthalpy so if we defined the point with that temperature and enthalpy, what point do we need the function return?

_Ts()[source]

Temperature-entropy input definition

_Tu()[source]

Temperature-internal energy input definition

_Prho()[source]

Pressure-density input definition

_Ph()[source]
calculo()[source]

Calculate procedure

fsolve(f, f2=None, **kwargs)[source]

Procedure to iterate to calculate T and rho in input pair without some of that unknown

Parameters:
fcallable

function to iterate in single phase region

f2callable

function to iterate in two phases region

kwargsdict

Other parameters like:

  • T : Known temperature,[K]

  • P : Known pressure, [Pa]

  • rho : Known density, [kg/m³]

  • h : Known enthalpy, [kJ/kg]

  • s : Known entropy, [kJ/kgK]

  • u : Known internal energy, [kJ/kg]

  • T0 : initial values for temperature, [K]

  • rho0 : initial values for density, [kg/m³]

Returns:
propdict

Dict with the calculated properties:

  • T : Calculated temperature,[K]

  • rho : Calculated bulk density, [kg/m³]

  • rhoG : Calculated gas phase density, [kg/m³]

  • rhoL : Calculated liquid phase density, [kg/m³]

  • x : Calculated quality, [-]

fill(fase, estado)[source]

Fill phase properties

References

[27] Thorade, M., Saadat, A.; Partial derivatives of thermodynamic state properties for dynamic simulation. Environ Eartth Sci 70(8) (2013) 3497-3503

_saturation(T=None)[source]

Saturation calculation for two phase search

References

[9] Akasaka, R.; A Reliable and Useful Method to Determine the Saturation State from Helmholtz Energy Equations of State. J. Thermal Sci. Tech. 3(3) (2008) 442-451

_eq(rho, T)[source]

Define the calculation method to use

_phir(tau, delta)[source]

Residual contribution to the free Helmholtz energy

_phird(tau, delta)[source]

Residual contribution to the free Helmholtz energy, delta derivative

_phirt(tau, delta)[source]

Residual contribution to the free Helmholtz energy, tau derivative

_Generalised()[source]

Generalised mEoS based in Helmholtz free energy. Referenced in [10], section 7.2.2, pag. 300

References

[10] Span, R.; Multiparameter Equations of State: An Accurate Source of Thermodynamic Property Data. Springer, 2000

_ref(ref, refvalues=None)[source]

Define reference state

Parameters:
ref: str

Name of standard OTO | NBP | IIR | ASHRAE | CUSTOM None to use the default reference state in EoS False to no use reference state offset

refvalues: list

Only necessary when ref is CUSTOM. List with custom refvalues:

  • Tref: Reference temperature, [K]

  • Pref: Reference pressure, [kPa]

  • ho: Enthalpy in reference state, [kJ/kg]

  • so: Entropy in reference state, [kJ/kg·K]

_refOffset(ref, refvalues)[source]
_prop0(rho, T)[source]

Ideal gas properties

_PHIO(cp)[source]

Convert cp dict in phi0 dict when the cp expression isn’t in Helmholtz free energy terms

_phi0(cp, tau, delta)[source]

Ideal gas Helmholtz free energy and derivatives The ideal gas specific heat can have different contributions

\[\frac{C_p^o}{R} = c_o + \sum_i c_iT_r^i + \sum_jc_j\frac{e^{\theta T_r}} {\left(1-e^{\theta T_r}\right)^2} + \sum_k \gamma_k\frac{\xi/T_r}{\sinh(\xi/T_r)} + \sum_l \delta_l\frac{\epsilon_l/T_r}{\cosh(\epsilon_l/T_r)}\]

The dict with the definition of ideal gas specific heat must define the parameters:

  • ao: Independent of temperature coefficient

  • an: Polynomial term coefficient

  • pow: Polynomial term temperature exponent

  • ao_exp: Exponential term coefficient

  • exp: Exponential term exponent

  • ao_sinh: Hyperbolic sine term coefficient

  • sinh: Hyperbolic sine term exponent

  • ao_cosh: Hyperbolic cosine term coefficient

  • cosh: Hyperbolic cosine term exponent

Parameters:
cpdict

Ideal gas properties parameters, can be in Cp term of directly in helmholtz free energy

taufloat

Inverse reduced temperature, Tc/T [-]

deltafloat

Reduced density, rho/rhoc [-]

Returns:
propdictionary with ideal adimensional helmholtz energy and deriv

fio [-] fiot: [∂fio/∂τ]δ [-] fiod: [∂fio/∂δ]τ [-] fiott: [∂²fio/∂τ²]δ [-] fiodt: [∂²fio/∂τ∂δ] [-] fiodd: [∂²fio/∂δ²]τ [-]

_Helmholtz(tau, delta)[source]

Residual contribution to the free Helmholtz energy

The dict with equation of state definition must define the parameters:

  • nr1: Polynomial term coefficient

  • d1: Polynomial term delta exponent

  • t1: Polynomial term tau exponent

  • nr2: Exponential term coefficient

  • d2: Exponential term delta exponent

  • t2: Exponential term tau exponent

  • c2: Exponential term delta exponent in exponential

  • gamma2: Exponential term exponential coefficient

  • nr3: Gaussian term coefficient

  • d3: Gaussian term delta exponent

  • t3: Gaussian term tau exponent

  • epsilon3: Gaussian term delta correction in exponential

  • gamma3: Gaussian term tau correction in exponential

  • alfa3: Gaussian term exponential tau term coefficient

  • beta3: Gaussian term exponential tau term coefficient

  • exp1: Gaussian term exponential delta term exponential, default 2

  • exp2: Gaussian term exponential tau term exponential, default 2

  • nr4: Nonanalytic term coefficient

  • a4: Nonanalytic term exponent in Δ expression

  • b4: Nonanalytic term Δ exponent

  • B: Nonanalytic term coefficient in Δ expression

  • C: Nonanalytic term delta coefficient in exponential

  • D: Nonanalytic term tau coefficient in exponential

  • A: Nonanalytic term coefficient in θ expression

  • beta4: Nonanalytic term exponent in θ expression

  • nr_ass: Association term coefficient

  • d_ass: Association term delta exponent

  • t_ass: Association term tau exponent

  • epsilon_ass: Association term delta correction in exponential

  • gamma_ass: Association term tau correction in exponential

  • alfa_ass: Association term exponential tau term coefficient

  • beta_ass: Association term exponential tau term coefficient

  • b_ass: Association special last term

exp1 and exp2 are used only for Lemmon-Jacobsen correlation for R125, normally don’t used and using the default value 2.

Parameters:
taufloat

Inverse reduced temperature, Tc/T [-]

deltafloat

Reduced density, rho/rhoc [-]

Returns:
propdict

Dictionary with residual adimensional helmholtz energy and derivatives:

  • fir [-]

  • firt: [∂fir/∂τ]δ,x [-]

  • fird: [∂fir/∂δ]τ,x [-]

  • firtt: [∂²fir/∂τ²]δ,x [-]

  • firdt: [∂²fir/∂τ∂δ]x [-]

  • firdd: [∂²fir/∂δ²]τ,x [-]

_MBWR(rho, T)[source]

Residual contribution to the free Helmholtz energy and derivatives for modified Benedict-Webb-Rubin (mBWR) equation of state. Derived calculation defined in Appendix B in [11]

The dict with equation of state definition must define the parameters:

  • b: coefficient of \(a_i\) equations

  • gamma: optional reducing density value in exponential term

Parameters:
rhofloat

Density, [kg/m³]

Tfloat

Temperature, [K]

Returns:
propdict

Dictionary with residual adimensional helmholtz energy and derivatives:

  • fir [-]

  • firt: [∂fir/∂τ]δ,x [-]

  • fird: [∂fir/∂δ]τ,x [-]

  • firtt: [∂²fir/∂τ²]δ,x [-]

  • firdt: [∂²fir/∂τ∂δ]x [-]

  • firdd: [∂²fir/∂δ²]τ,x [-]

References

[11] Younglove, B.A., McLinden, M.O.; An International Standard Equation of State for the Thermodynamic Properties of Refrigerant 123 (2,2-Dichloro-1,1,1-trifluoroethane). J. Phys. Chem. Ref. Data, 23(5) (1994) 731-779

_PengRobinson(rho, T)[source]

Residual contribution to the free Helmholtz energy and derivatives for Peng-Robinson cubic equation of state as explain in [12]. Optionally can use the Lin-Duan volume correction as explain in [13] Helmholtz energy and derivatives calculation defined in [14].

Parameters:
rhofloat

Density, [kg/m³]

Tfloat

Temperature, [K]

Returns:
propdict

Dictionary with residual adimensional helmholtz energy and derivatives:

  • fir [-]

  • firt: [∂fir/∂τ]δ,x [-]

  • fird: [∂fir/∂δ]τ,x [-]

  • firtt: [∂²fir/∂τ²]δ,x [-]

  • firdt: [∂²fir/∂τ∂δ]x [-]

  • firdd: [∂²fir/∂δ²]τ,x [-]

References

[12] Peng, D.-Y., Robinson, D.B.; A New Two-Constant Equation of State. Ind. Eng. Chem. Fund. 15(1) (1976) 59-64

[13] Lin, H., Duan, Y.-Y.; Empirical correction to the Peng-Robinson equation of state for the saturated region. Fluid Phase Equilibria 233 (2005) 194-203

[14] Bell, I.H., Jäger, A.; Helmholtz Energy Transformations of Common Cubic Equations of State for Use with Pure Fluids and Mixtures. J. Res. of NIST 121 (2016) 236-263

vtPR(rho, T)[source]

Volume translation for Peng-Robinson equation of state for liquid phase as explain in [13]

Returns:
vfloat

Specific volume, [m³/kg]

References

[13] Lin, H., Duan, Y.-Y.; Empirical correction to the Peng-Robinson equation of state for the saturated region. Fluid Phase Equilibria 233 (2005) 194-203

derivative(z, x, y, fase)[source]

Calculate generic partial derivative: (δz/δx)y where x, y, z can be: P, T, v, u, h, s, g, a

_Vapor_Pressure(T)[source]

Vapor Pressure ancillary equation

_Liquid_Density(T)[source]

Saturated liquid density ancillary equation

_Vapor_Density(T)[source]

Saturated vapor density ancillary equation

_Surface(T)[source]

Equation for the surface tension

\[\sigma(T) = \sum_i \sigma_i\left(1-\frac{T}{T_c}\right)^{n_i}\]

The subclass must define the parameters of correlation in _surface:

  • sigma: Coefficient of polynomial term

  • exp: Exponential of polynomial term

  • Tc: Optional to define a different reducing parameter than Tc

References

[1] Mulero, A., Cachadiña, I., Parra, M.I.; Recommended Correlations for the Surface Tension of Common Fluids. J. Phys. Chem. Ref. Data 41(4) (2012) 043105

_Dielectric(rho, T)[source]

Calculate the dielectric constant as explain in [24].

Calculate first the electric polarization

\[\begin{split}\begin{array}[t]{l} \frac{P}{\rho} = A_{\epsilon}+\frac{A_{\mu}}{T}+B_{\epsilon}\rho + C\rho^D\\ A_{\epsilon} = a_0+a_1\left(\frac{T}{T_0}-1\right)\\ B_{\epsilon} = b_0+b_1\left(\frac{T_0}{T}-1\right)\\ C_{\epsilon} = c_0+c_1\left(\frac{T_0}{T}-1\right)\\ \end{array}\end{split}\]

and then calculate the dielectric constant using the appropiate correlation

\[\begin{split}\begin{array}[t]{l} P_{CM} = \frac{\epsilon-1}{\epsilon+2}\\ P_{K} = \frac{(\epsilon-1)(2\epsilon+1}{9\epsilon}\\ \end{array}\end{split}\]

The Clausius-Mosotti (CM} is more appropiate for nonpolar fluids, the Kirkwood is for polar fluids.

The dict with coefficient must define the properties:

  • eq: Type of equation

  • ai: Parameter of virial coefficient \(A_{\epsilon}\)

  • bi: Parameter of virial coefficient \(B_{\epsilon}\)

  • ci: Parameter of parameter C

  • Au: Parameter \(A_{mu}\)

  • D: Exponential of density in last term

Parameters:
rhofloat

Density [kg/m³]

Tfloat

Temperature [K]

Returns:
epsilonfloat

Static dielectric constant, [-]

References

[24] Harvey, A.H., Lemmon, E.W.; Method for Estimating the Dielectric Constant of Natural Gas Mixtures . Int. J. Thermophys. 26(1) (2005) 31-46

[29] Harvey, A.H., Mountain, R.D.; Correlations for the Dielectric Constants of H2S, SO2 and SF6. Int. J. Thermophys. 38 (2017) 147

classmethod _Melting_Pressure(T, melting=None)[source]

Calculate the melting pressure.

\[\begin{split}\begin{array}[t]{l} \frac{P_m}{P_r} = a_o + \sum a_{1i}\theta^{t_{1i}} + \sum a_{2i}\left(\theta^{t_{2i}}-1\right) + \sum a_{3i}\log \theta^{t_{3i}} + \sum a_{4i}\left(\theta-1\right)^{t_{4i}}\\ P_m - P_r = a_o + \sum a_{1i}\theta^{t_{1i}} + \sum a_{2i}\left(\theta^{t_{2i}}-1\right) + \sum a_{3i}\log \theta^{t_{3i}} + \sum a_{4i}\left(\theta-1\right)^{t_{4i}}\\ \ln\frac{P_m}{P_r} = a_o + \sum a_{1i}\theta^{t_{1i}} + \sum a_{2i}\left(\theta^{t_{2i}}-1\right) + \sum a_{3i}\log \theta^{t_{3i}} + \sum a_{4i}\left(\theta-1\right)^{t_{4i}}\\ \theta = \frac{T}{T_r}\\ \end{array}\end{split}\]

The dict with coefficient must define the properties:

  • eq: Type of equation

  • __doi__: Dict with reference of correlation

  • Tmin: Lower temperature limit, [K]

  • Tmax: Upper temperature limit, [K]

  • Tref: Reducing temperature, [K]

  • Pref: Reducing pressure, [Pa]

  • a0: Zero dependence coefficient

  • a1: Polynomial term coefficient

  • exp1: Polynomial term exponent

  • a2: Polynomial θ^t-1 term coefficient

  • exp2: Polynomial θ^t-1 term exponent

  • a3: Logarithmic term coefficient

  • exp3: Logarithmic term exponent

  • a4: Polynomial (θ-1)^t term coefficient

  • exp4: Polynomial (θ-1)^t term exponent

Parameters:
Tfloat

Temperature, [K]

Returns:
Pfloat

Melting pressure, [Pa]

classmethod _Sublimation_Pressure(T)[source]

Calculate the sublimation pressure.

\[\begin{split}\begin{array}[t]{l} \frac{P}{P_r} = a_o + \sum a_{1i}\theta^{t_{1i}} + \sum a_{2i}\left(1-\theta\right)^{t_{2i}} + \sum a_{3i}\log \theta^{t_{3i}}\\ P - P_r = a_o + \sum a_{1i}\theta^{t_{1i}} + \sum a_{2i}\left(1-\theta\right)^{t_{2i}} + \sum a_{3i}\log \theta^{t_{3i}}\\ \ln\frac{P}{P_r} = a_o + \sum a_{1i}\theta^{t_{1i}} + \sum a_{2i}\left(1-\theta\right)^{t_{2i}} + \sum a_{3i}\log \theta^{t_{3i}}\\ \theta = \frac{T}{T_r}\\ \end{array}\end{split}\]

The dict with coefficient must define the properties:

  • eq: Type of equation

  • __doi__: Dict with reference of correlation

  • Tmin: Lower temperature limit, [K]

  • Tmax: Upper temperature limit, [K]

  • Tref: Reducing temperature, [K]

  • Pref: Reducing pressure, [Pa]

  • a0: Zero dependence coefficient

  • a1: Polynomial term coefficient

  • exp1: Polynomial term exponent

  • a2: Polynomial 1-θ term coefficient

  • exp2: Polynomial 1-θ term exponent

  • a3: Logarithmic term coefficient

  • exp3: Logarithmic term exponent

Parameters:
Tfloat

Temperature, [K]

Returns:
Pfloat

Sublimation pressure, [Pa]

_Viscosity(rho, T, fase, coef=False, residual=False)[source]

Viscosity calculation procedure, implement several general method

The derived class must define a dict object with the parameters for the method. The key eq define the procedure to use:

  • 0 - Hardcoded for special procedures (i.e.: R23, H2O, …)

  • 1 - General formulation with different contribution

  • 2 - Younglove formulation

  • 3 - Extended corresponding states correlation

  • 4 - Quiñones-Cisneros friction theory model

Hardcoded procedures

Special procedures easier to implement as harcoded in subclasses, used in component as: He, D2O, H2, H20, R23, Ethylene

  • method: Name of procedure with code

General formulation

Normal formulation with several contribution, so the more flexible for implement correlation

\[\eta = \eta^o(T)+\eta^1(T)\rho+\eta^r(\tau,\delta)+\eta^{CP}\]

Initial density terms, second virial coefficient

\[\begin{split}\begin{array}[t]{l} \eta^1(T) = B_\eta \eta^0\\ B_\eta = \eta_r B^*_\eta\\ B^*_\eta = \sum_in_i\tau^t\\ \end{array}\end{split}\]
  • Tref_virial: Initial density reference temperature

  • muref_virial: Initial density reference viscosity

  • n_virial: Initial density parameter

  • t_virial: Initial density tau exponent

Residual fluid contribution

\[\eta^r(\tau,\delta) = \sum_{i=1}^nN_i\tau^{t_i}\delta^{d_i} \exp\left(-\gamma_i\delta^{c_i}\right) + \frac{\sum_{i} ^nN_i\tau^{t_i}\delta^{d_i}\exp\left(-\gamma_i\delta^{c_i} \right)}{\sum_{i}^nN_i\tau^{t_i}\delta^{d_i}\exp\left( -\gamma_i\delta^{c_i}\right)}\]
  • Tref_res: Residual viscosity reference temperature

  • rhoref_res: Residual viscosity reference density

  • muref_res: Residual viscosity reference viscosity

  • nr: Residual viscosity parameter

  • tr: Residual viscosity tau exponent

  • dr: Residual viscosity delta exponent

  • gr: Residual viscosity exponential parameter

  • cr: Reisidual viscosity delta exponent in exponential term

  • nr_num: Fractional numerator coefficient

  • tr_num: Fractional numerator temperature exponent

  • dr_num: Fractional numerator density exponent

  • gr_num: Fractional numerator exponential coefficient

  • cr_num: Fractional numerator exponential density exponent

  • nr_den: Fractional denominator coefficient

  • tr_den: Fractional denominator temperature exponent

  • dr_den: Fractional denominator density exponent

  • gr_den: Fractional denominator exponential coefficient

  • cr_den: Fractional denominator exponential density exponent

Modified Batschinkski-Hildebrand contribution

\[\begin{split}\begin{array}[t]{l} \eta^{CP} = f\left(\frac{\delta}{\delta_0(\tau)-\delta}- \frac{\delta}{\delta_0(\tau)}\right)\\ \delta_0(\tau) = g_1\left(1+\sum_i g_i\tau^{t_i}\right)\\ \end{array}\end{split}\]
  • CPf: f parameter for closed packed term

  • CPg1: g1 parameter for closed packed term

  • CPgi: g parameter for aditional term of closed packed term

  • CPti: tau exponent for aditional term of closed packed term

Special terms

A hardcoded term for any non standard formulation term

  • special: Name of procedure with hardcoded method

Younglove formulation

Formulation as explain in [4] and [5]

\[\begin{split}\begin{array}[t]{l} \eta = \eta^o(T)+\eta^1(T)\rho+\eta^r(\tau,\delta)\\ \eta^1 = F_{[1]}+F_{[2]}\left(F_{[3]}-\ln\left(\frac{T} {F_{[4]}}\right)\right)^2\\ \eta^2 = \exp(F)-\exp(G)\\ G = E_{[1]}+\frac{E_{[2]}}{T}\\ H = \frac{\rho^{0.5}\left(\rho-\rho_c\right)}{\rho_c}\\ F_{4} = E_{[1]} + E_{[2]} H + \left(E_{[3]} + \frac{E_{[4]}}{T^{1.5}}\right)\rho^{0.1} + H \left(E_{[5]} + \frac{E_{[6]}}{T}+\frac{E_{[7]}}{T^2}\right)\\ F_{5} = G + \left(E_{[3]}+\frac{E_{[4]}}{T^{1.5}}\right)\rho^ {0.1}+ H \left(E_{[5]}+\frac{E_{[6]}}{T}+\frac{E_{[7]}}{T^2} \right)\\ \end{array}\end{split}\]

The derived class must define the variables:

  • mod: Boolean with the reference from correlation, True if [4], False if [5] for minor changes in correlation, default False

  • F: η1 contribution parameters (4 terms)

  • E: η2 contribution parameters (7 terms)

  • rhoc: Reducing density, [mol/l]

Although both references use (almost) same correlation the density is in g/cm³ in [4] and mol/l in [5], the parameters are maintain with values in references.

Extended corresponding states (ECS) model

Formulation as explain in [20] and [22].

\[\begin{split}\begin{array}[t]{l} \eta = \eta^o(T) + \Delta\eta_o(T_o,\rho_o)F_{\eta}(T,\rho)\\ \eta^o=\frac{5\sqrt{\pi Mk_bT}}{16\pi\sigma^2\Omega^{(2,2)}}\\ T_o = T/f\\ \rho_o = \rho h\\ f = \frac{T_c}{T_{c0}}\vartheta\\ h = \frac{\rho_{c0}}{\rho_c}\varphi\\ F_{\eta} = \frac{f^{1/2}}{h^{3/2}}\left(\frac{M}{M_0}\right)^ {1/2}\\ \end{array}\end{split}\]

where \(\Omega^{(2,2)}\) is the collision integral, see lib.physics.Collision_Neufeld()

The residual contribution to the viscosity is calculated using the correlation of reference fluid at conformal temperature and density. These are calculated by iteration to meet the conditions

\[\begin{split}\begin{array}[t]{l} \alpha^r(T, \rho) = \alpha_0^r(T_0, \rho_0)\\ Z(T, \rho) = Z_0(T_0, \rho_0)\\ \end{array}\end{split}\]

So it necessary accurate mEoS for both reference fluid and fluid to calculate viscosity.

Furthermore the method can be based in experimental data using a correction factor for the conformal density

\[\begin{split}\begin{array}[t]{l} \rho_{0,\eta}(T, \rho) = \rho_0(T, \rho)\psi(\rho_r)\\ \psi = \sum_k C_k\rho_r^k \end{array}\end{split}\]

Quiñones-Cisneros formulation

Formulation as explain in [2] and [3]

\[\begin{split}\begin{array}[t]{l} \eta = \eta^o + \kappa_iP_{id} + \kappa_r\Delta P_r + \kappa_aP_a + \kappa_{ii}P_{id}^2 + \kappa_{rr}\Delta P_r^2 + \kappa_{aa}P_a^2 + \kappa_{rrr}P_r^3 + \kappa_{aaa}P_a^3\\ \kappa_a = \Gamma\left(a_0+a_1\psi_1+a_2\psi_2\right)\\ \kappa_{aa} = \Gamma^3\left(A_0+A_1\psi_1+A_2\psi_2\right)\\ \kappa_r = \Gamma\left(b_0+b_1\psi_1+b_2\psi_2\right)\\ \kappa_{rr} = \Gamma^3\left(B_0+B_1\psi_1+B_2\psi_2\right)\\ \kappa_i = \Gamma\left(c_0+c_1\psi_1+c_2\psi_2\right)\\ \kappa_{ii} = \Gamma^3\left(C_0+C_1\psi_1+C_2\psi_2\right)\\ \kappa_{rrr} = \Gamma\left(D_0+D_1\psi_1+D_2\psi_2\right)\\ \kappa_{aaa} = \Gamma\left(E_0+E_1\psi_1+E_2\psi_2\right)\\ \Gamma = \frac{T_c}{T}\\ \psi_1 = \exp(\Gamma)-1\\ \psi_2 = \exp(\Gamma^2)-1\\ \end{array}\end{split}\]

The derived class must define the variables:

  • a: Ka correlation coefficients

  • A: Kaa correlation coefficients

  • b: Kr correlation coefficients

  • B: Krr correlation coefficients

  • c: Ki correlation coefficients

  • C: Kii correlation coefficients

  • D: Krrr correlation coefficients

  • E: Kaaa correlation coefficients

In all cases the dilute-gas limit density is calculate in a separate procedure _Visco0, see its docs for its parameters

Parameters:
rhofloat

Density [kg/m³]

Tfloat

Temperature [K]

fasedict

phase properties

coefdict

dictionary with correlation parameters

residualboolean

return only the residual contribution. Used in ecs correlation

Returns:
mufloat

Viscosity of fluid, [Pa·s] If residual options is True the returned value would be the residual contribution to viscosity in μPas

References

[2] Quiñones-Cisneros, S.E., Deiters, U.K.; Generalization of the Friction Theory for Viscosity Modeling. J. Phys. Chem. B, 110(25) (2006) 12820-12834

[3] Quiñones-Cisneros, S.E., Huber, M.L., Deiters, U.K.; Correlation for the Viscosity of Sulfur Hexafluoride (SF6) from the Triple Point to 1000 K and Pressures to 50 MPa. J. Phys. Chem. Ref. Data 41(2) (2012) 023102

[4] Younglove, B.A.; Thermophysical Properties of Fluids. I. Argon, Ethylene, Parahydrogen, Nitrogen, Nitrogen Trifluoride, and Oxygen. J. Phys. Chem. Ref. Data, 11(Suppl. 1) (1982)

[5] Younglove, B.A., Ely, J.F.; Thermophysical Properties of Fluids. II. Methane, Ethane, Propane, Isobutane, and Normal Butane. J. Phys. Chem. Ref. Data 16(4) (1987) 577-798

[20] Huber, M.L., Laesecke, A., Perkins, R.A.; Model for the Viscosity and Thermal Conductivity of Refrigerants, Including a New Correlation for the Viscosity of R134a. Ind. Eng. Chem. Res., 42(13) (2003) 3163-3178

[22] McLinden, M.O., Klein, S.A., Perkins, R.A.; An Extended corresponding states model for the thermal conductivity of refrigerants and refrigerant mixtures. Int. J. Refrigeration 23 (2000) 43-63

_Visco0(T, coef=None)[source]

Dilute gas viscosity calculation

\[\begin{split}\begin{array}[t]{l} \eta^o(T) = \frac{N_{chapman}\left(MT\right)^{t_{chapman}}} {\sigma^2\Omega(T^*)} + \sum_{i}^nN_i\tau^{t_i} + \frac{\sum_{i}^nN_i\tau^{t_i}}{\sum_{i}^nN_i\tau^{t_i}} + \exp \left(\sum_{i}^n a_i\left(\ln(\tau)\right)^t_i\right) + \eta_{hc}^o\\ T^* = \frac{T}{ε/k}\\ \tau = \frac{T}{T_r}\\ \end{array}\end{split}\]

The collision integral is calculated in separate procedure _Omega, see its docs for parameters

Returns:
muofloat

Viscosity of ideal gas, [μPa·s]

Notes

The derived class must define a dict object with the parameters for the method

Champman-Enskop:

  • ek: Lennard-Jones energy parameter, [K]

  • sigma: Lennard-Jones size parameter, [nm]

  • Tref: Dilute gas viscosity reference temperature, default=1

  • rhoref: Dilute gas viscosity reference density, default=1

  • n_chapman: Dilute gas viscosity parameter, default=0.0266958

  • t_chapman: Dilute gas viscosity temperature exponent, default=0.5

Polynomial terms:

  • Toref: Polynomial terms reference temperature, default=1

  • no: Polynomial terms coefficient

  • to: Polynomial terms tau exponent

Fractional terms:

  • no_num: Fractional numerator coefficient for dilute gas viscosity

  • to_num: Fractional numerator temperature exponent

  • no_den: Fraction denominator coefficient for dilute gas viscosity

  • to_den: Fraction denominator temperature exponent

Exponential terms:

  • no_exp: Exponential term coefficient

  • to_exp: Exponential term exponent

  • logo_exp: 1 to use ln in sum term

Custom Hardcoded terms:

  • special0: Name of procedure with hardcoded method

_Omega(T, coef)[source]

Collision integral calculations

The derived class must define a dict object with the parameters for the method:

  • omega: Collision integral procedure calculation

    • 0 - None

    • 1 - Lemmon expression from [6]: Air, N2, O2…

      \[\ln \Omega = \sum_i^nb_i\ln\left(T/εk\right)^i\]
    • 2 - Younglove expression from [5]: C1, C2, C3, iC4, nC4

      \[\Omega = \frac{1}{\sum_i^n\left(b_i\frac{εk}{T} \right)^{(n+2)/3}}\]
    • 3 - Inverse temperature polinomial form exponential [7]

    (cC6)

    \[\ln \Omega = \sum_i^n \frac{b_i}{T_r^i}\]
    • 4 - Inverse temperature polinomial form [3] (H2S)

      \[\begin{split}\Omega = \sum_i^n \frac{b_i}{T_r^i}\\\end{split}\]
    • 5 - Neufeld correlation for Lennard-Jones 6-12 potential [8]

      \[\Omega_5 = \frac{1.16145}{T_r^{0.14874}} + \frac {0.52487}{\exp(0.7732T_r)} + \frac{2.16178} {\exp(2.4378T_r)} - 6.435e^{-4} T_r^{0.14874}\sin \left(\frac{18.0323}{T_r^{0.76830}}-7.27371\right)\]
  • collision: Alternate contributions values for collision integral

References

[6] 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

[5] Younglove, B.A., Ely, J.F.; Thermophysical Properties of Fluids. II. Methane, Ethane, Propane, Isobutane, and Normal Butane. J. Phys. Chem. Ref. Data 16(4) (1987) 577-798

[7] Tariq, U., Jusoh, A.R.B., Riesco, N., Vesovic, V.; Reference Correlation of the Viscosity of Cyclohexane from the Triple Point to 700K and up to 110 MPa. J. Phys. Chem. Ref. Data 43(3) (2014) 033101

[3] Quiñones-Cisneros, S.E., Huber, M.L., Deiters, U.K.; Correlation for the Viscosity of Sulfur Hexafluoride (SF6) from the Triple Point to 1000 K and Pressures to 50 MPa. J. Phys. Chem. Ref. Data 41(2) (2012) 023102

[8] Neufeld, P.D., Janzen, A.R., Aziz, R.A.; Empirical Equations to Calculate 16 of the Transport Collision Integrals Ω for the Lennard-Jones Potential. J. Chem. Phys. 57(3) (1972) 1100-1102

_ViscoCritical(rho, T, fase, coef=False)[source]

Critical Enhancement viscosity calculation

In general the critical enhancement for viscosity correlation only are significative in a narrow region near the critical region. Implemented only for very few compounds as water or xenon

The model is defined in _visco[“critical”]. The defined models are:
  • 0 : No critical enhancement

  • 1 : Bhattacharjee-Ferrell

Bhattacharjee-Ferrell

Method defined in [25]

\[\Delta\eta_c = \exp\left(x_{\mu}Y\right)\]

where \(x_\mu\) is the critical exponent and the function Y is defined for two ranges of correlation length ξ.

\[Y = \frac{1}{5}q_C\xi (q_D\xi)^5 \left(1-q_C\xi +(q_C\xi)^2-\frac{765}{504}\left(q_D\xi\right)^2\right)\]
\[\begin{split}\begin{array}[t]{c} Y = \frac{1}{12}\sin \left(3\psi_D\right) - \frac{1}{4q_C\xi} \sin \left(2\psi_D\right) + \frac{1}{\left(q_C\xi\right)^2} \left[1-\frac{5}{4} \left(q_C\xi\right)^2\right]\sin(\psi_D)\\ -\frac{1}{\left(q_C\xi\right)^3} \left\{\left[1-\frac{3}{2} \left(q_C\xi\right)^2\right]\psi_D - \left| \left(q_c\xi\right) ^2-1\right|^{3/2} L(w)\right\} \end{array}\end{split}\]

with:

\[\begin{split}\begin{array}[t]{l} \Phi_D = \arccos\left(\left(1+q_D^2\xi^2\right)^{-1/2}\right)\\ L\left(w\right)=\begin{cases}\begin{array}{ll} ln\frac{1+w}{1-w}, & q_{C}\xi>1\\ 2\arctan|w|, & q_{C}\xi\leq1\\ \end{array}\end{cases}\\ \xi = \xi_0\left(\frac{\Delta\tilde{\chi}}{\Gamma}\right) ^{v/\gamma}\\ \Delta\tilde{\chi} = \tilde{\chi}(T,\rho) - \tilde{\chi} (T_R,\rho)\frac{T_R}{T}\\ \tilde{\chi}(T,\rho) = \frac{P_c\rho}{\rho_c^2}\left(\frac {\partial\rho}{\partial P}\right)_T\\ \end{array}\end{split}\]

The derived class must define the variables:

  • Tcref: Reference temperature far above the Tc, [K]

  • gnu: critical exponent parameter, [-]

  • gam0: critical exponent parameter, [-]

  • Xio: Amplitude of the asymptotic power laws for ξ, [m]

  • Xic: Critical value for ξ to use the Y correlation, [m]

  • gamma: Amplitude of the asymptotic power laws for χ, [-]

  • qd : finite wave-number cutoff, [m]

  • qc : finite upper cutoff, [m]

  • xu: Critical exponent, [-]

Water and heavy water has the Bhattacharjee-Ferrell method hardcoded in iapws library.

References

[25] Bhattacharjee, J.K., Ferrell, R.A., Basu, R.S., Sengers, J.V.; Crossover function for the critical viscosity of a classical fluid. Physical Review A 24(3) (1981) 1469-1475

_ThCond(rho, T, fase, coef=False, contribution=False)[source]

Thermal conductivity calculation procedure

The derived class must define a dict object with the parameters for the method. The key eq define the procedure to use:

  • 0 - Hardcoded for special procedures (i.e.: R23, H2O, …)

  • 1 - General formulation with different contribution

  • 2 : Younglove #1 form, used in N2, O2, Ar.

  • 3 : Younglove #2 form, used in CH4, C2, C3, C4, iC4.

  • 4 - Extended corresponding states correlation

Hardcoded procedures

Special procedures easier to implement as harcoded in subclasses, used in component as:

  • method: Name of procedure with code

General formulation

Normal formulation with several contribution, so the more flexible for implement correlations

\[\lambda = \lambda_o + \lambda_r + \lambda_c\]

Dilute gas thermal conductivity

\[\lambda_o = N_o\mu_o + N_o\mu_o\left(3.75+\sum_i n_i\tau^{t_i}\left(\frac{Cp^o}{R} -2.5\right)\right) + \sum_i N_i\tau^{t_i} + \frac{\sum_i ^nN_i\tau^{t_i}}{\sum_{i}^nN_i\tau^{t_i}}\]
  • Toref: Dilute gas reference temperature, default 1

  • no_visco: Dilute gas viscosity term coefficient

  • no_viscoCP: Dilute gas specific heat term coefficient

  • to_viscoCP: Dilute gas specific heat term τ exponent

  • no: Dilute gas polynomial parameter

  • to: Dilute gas polynomial tau exponent

  • no_num: Fractional numerator coefficient

  • to_num: Fractional numerator τ exponent

  • no_den: Fractional denominator coefficient

  • to_den: Fractional denominator τ exponent

Background term

\[\frac{\lambda^b}{\lambda_r} = \sum_{i}N_i\tau^{t_i}\delta^ {d_i}\exp\left(-\gamma_i\delta^{c_i}\right)\]
  • Tref_res: Background reference temperature

  • rhoref_res: Background reference density

  • kref_res: Background reference thermal conductivity

  • nr: Background thermal conductivity parameter

  • tr: Background thermal conductivity tau exponent

  • dr: Background thermal conductivity delta exponent

  • gr: Background thermal conductivity exponential parameter

  • cr: Background thermal conductivity delta exponent in

exponential term

Special terms

A hardcoded term for any non standard formulation term

  • special: Name of procedure with hardcoded method

Critical enhancement

See thermal conductivity critical enhancement procedure documentation, MEoS._KCritical()

Younglove formulation #1

Formulation as explain in [4]

\[\begin{split}\begin{array}[t]{l} \lambda = \lambda^o(T)+\lambda^1(T)\rho+\lambda^2(\tau,\delta) +\lambda_c(\tau,\delta)\\ \lambda^o = \sum_iG_iT^{(4-1)/3}\\ \lambda^1 = F_{[1]}+F_{[2]}\left(F_{[3]}-\ln\left(\frac{T} {F_{[4]}}\right)\right)^2\\ \lambda^2 = \exp(F)-\exp(G)\\ G = E_{[1]}+\frac{E_{[2]}}{T}\\ H = \frac{\rho^{0.5}\left(\rho-\rho_c\right)}{\rho_c}\\ F = G + \left(E_{[3]}+\frac{E_{[4]}}{T^{1.5}}\right)\rho^{0.1}+ H \left(E_{[5]}+\frac{E_{[6]}}{T}+\frac{E_{[7]}}{T^2}\right)\\ \end{array}\end{split}\]

The derived class must define the variables:

  • F: η1 contribution parameters (4 terms)

  • E: η2 contribution parameters (7 terms)

  • rhoc: Reducing density, [mol/l]

Younglove formulation #2

Formulation as explain in [5]

\[\lambda = \lambda_0 + \frac{\left(F_0+F_1\rho\right)\rho} {1-F_2\rho}+\lambda_c\]
\[\lambda_0 = \eta_0\left(3.75R+\left(C_p^0-2.5R\right) \left(G_1+G_2\epsilon/kT\right)\right)\]
\[F_0 = \sum_{n=1}^3E_nT^{1-n}\]
\[F_1 = \sum_{n=4}^6E_nT^{4-n}\]
\[F_2 = \sum_{n=7}^8E_nT^{7-n}\]

The derived class must define the variables:

  • ek: Lennard-Jones energy parameter, [K]

  • G: λ0 contribution parameters (2 terms)

  • E: λ1 contribution parameters (8 terms)

Extended corresponding states (ECS) model

Formulation as explain in [20] and [22].

\[\begin{split}\begin{array}[t]{l} \lambda = \lambda^{int}(T)+\lambda^{trans}(T, \rho)\\ \lambda^{int} = \frac{f_{int}\eta^o}{M}\left(C_p^o-\frac{5}{2} R\right)\\ f_{int}=a_0+a_1T\\ \lambda^{trans} = \lambda^o+\lambda^r+\lambda^c\\ \lambda^o = \frac{15}{4}R\eta^o\\ \lambda_r(T,\rho) = \lambda_0^r(T_0,\rho_0)F_{\lambda}\\ F_{\lambda} = \frac{f^{1/2}}{h^{3/2}}\left(\frac{M_0}{M} \right)^{1/2}\\ \end{array}\end{split}\]

The residual contribution to the thermal conductivity is calculated using the correlation of reference fluid at conformal temperature and density. These are calculated by iteration to meet the conditions

\[\begin{split}\begin{array}[t]{l} \alpha^r(T, \rho) = \alpha_0^r(T_0, \rho_0)\\ Z(T, \rho) = Z_0(T_0, \rho_0)\\ \end{array}\end{split}\]

So it necessary accurate mEoS for both reference fluid and fluid to calculate thermal conductivity.

Furthermore the method can be based in experimental data using a correction factor for the conformal density

\[\begin{split}\begin{array}[t]{l} \rho_{0,\lambda}(T, \rho) = \rho_0(T, \rho)\chi(\rho_r)\\ \chi = \sum_k b_k\rho_r^k \end{array}\end{split}\]

The critical enhancement is calculated with the Olchowy and Sengers model, see MEoS._KCritical().

Parameters:
rhofloat

Density [kg/m³]

Tfloat

Temperature [K]

fase: dict

phase properties

coefdict

dictionary with correlation parameters

contributionboolean

return the contribution

Returns:
kfloat

Thermal conductivity, [W/m·K]

References

[6] 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

[4] Younglove, B.A.; Thermophysical Properties of Fluids. I. Argon, Ethylene, Parahydrogen, Nitrogen, Nitrogen Trifluoride, and Oxygen. J. Phys. Chem. Ref. Data, 11(Suppl. 1) (1982)

[5] Younglove, B.A., Ely, J.F.; Thermophysical Properties of Fluids. II. Methane, Ethane, Propane, Isobutane, and Normal Butane. J. Phys. Chem. Ref. Data 16(4) (1987) 577-798

[17] Friend, D.G., Ely, J.F., Ingham, H.; Thermophysical Properties of Methane. J. Phys. Chem. Ref. Data 18(2) (1989) 583-638

[18] Friend, D.G., Ingham, H., Ely, J.F.; Thermophysical Properties of Ethane. J. Phys. Chem. Ref. Data 20, 275 (1991)

[20] Huber, M.L., Laesecke, A., Perkins, R.A.; Model for the Viscosity and Thermal Conductivity of Refrigerants, Including a New Correlation for the Viscosity of R134a. Ind. Eng. Chem. Res., 42(13) (2003) 3163-3178

[22] McLinden, M.O., Klein, S.A., Perkins, R.A.; An Extended corresponding states model for the thermal conductivity of refrigerants and refrigerant mixtures. Int. J. Refrigeration 23 (2000) 43-63

_KCritical(rho, T, fase)[source]

Enchancement thermal conductivity calculation for critical region The model is defined in _thermal[“critical”]. The defined models are:

  • 0 : No critical enhancement

  • 1 : Younglove #1 form, used in N2, O2, Ar.

  • 2 : Younglove #2 form, used in CH4, C2, C3, C4, iC4.

  • 3 : Olchowy-Sengers

  • 4 : Gaussian term, used in Laesecke correlation for R123

Furthermore, each thermal conductivity correlation can define a special critical enhancement method hardoded as a procedure in its class. For that use the name of procedure in _thermal[“critical” must be the name of procedure. See Friend correlation for methane as example.

Younglove #1 form

Method used in [4] and [19]

\[\begin{split}\begin{array}[t]{l} \Delta \lambda_c = \Delta \lambda' e^{-18.66\left( \frac{T-T_c}{T_c}\right)^2-4.25\left(\frac{\rho-\rho_c} {\rho_c}\right)}\\ \Delta \lambda' = \frac{kT^2}{Y} \left(\frac{\partial P} {\partial T} \right)_{\rho} K_T^{1/2}\\ Y = 6\pi\eta l\left(kT\rho\frac{N_a}{M}\right)^{1/2}\\ l = f(\gamma_m^5\rho\frac{N_a}{M}\frac{e/k}{T})^{1/2}\\ K_T = \frac{1}{\rho}\left(\frac{\partial \rho}{\partial P} \right)_T\\ \end{array}\end{split}\]

where:

  • k: Boltzmann constant

  • Na: Avogadro constant

The derived class must define in the correlation dictionary the variables:

  • rhoc: Critical density, [g/cm³}

  • Tc: Critical temperature, [K]

  • ek: Lennard-Jones energy parameter, [K]

  • f: Potencial function parameter, [-]

  • gm: Molecular separation parameter, [m]

This method don’t work nowadays, a tiny bug relevant only in region near to critical point.

Younglove #2 form

Method used in [5]

\[\begin{split}\begin{array}[t]{l} \lambda_c = \frac{\Delta\lambda'}{6Z\pi\eta} e^{X_1\Delta T^4-X_2\Delta\rho^4}\\ \Delta\lambda' = X_4k_bP_c\left(\frac{T^*}{\rho^*} \frac{\partial\rho^*}{\partial T^*}\right)^2\xi^{X_2}\\ \xi = (\xi^*)^{X_5}\\ \xi^* = \rho^*\frac{\partial\rho^*}{\partial P^*}\\ P^* = \frac{P}{P_c}\\ T^* = \frac{T}{T_c}\\ \rho^* = \frac{\rho}{\rho_c}\\ \Delta T = \frac{|T-T_c|}{T_c}\\ \Delta\rho = \frac{|\rho-\rho_c|}{\rho_c}\\ \end{array}\end{split}\]

The derived class must define in the correlation dictionary the variables:

  • rhoc: Critical density, [g/cm³}

  • Tc: Critical temperature, [K]

  • X: Array with for parameter Xi of correlation, [-]

  • Z: Parameter of denominator term, [-]

Olchowy-Sengers

Method defined in [16], and very popular in the state-of-art thermal conductivity correlations.

\[\begin{split}\begin{array}[t]{l} \lambda_c = \rho c_p \frac{R_ok_BT}{6\pi\eta\xi} \left(\bar{\Omega}-\bar{\Omega}_0\right)\\ \bar{\Omega} = \frac{2}{\pi}\left[\left(\frac{c_p-c_v}{c_p} \right)\arctan\left(q_D\xi\right)+\frac{c_v}{c_p}q_D\xi\right]\\ \bar{\Omega}_0 = \frac{2}{\pi}\left[1-\exp\left(-\frac{1} {\frac{1}{q_D\xi}+\frac{(q_D\xi\rho_c)^2}{\rho^23}}\right) \right]\\ \xi = \xi_0\left(\frac{\Delta\tilde{\chi}}{\Gamma}\right) ^{v/\gamma}\\ \Delta\tilde{\chi} = \tilde{\chi}(T,\rho) - \tilde{\chi} (T_R,\rho)\frac{T_R}{T}\\ \tilde{\chi}(T,\rho) = \frac{P_c\rho}{\rho_c^2}\left(\frac {\partial\rho}{\partial P}\right)_T\\ \end{array}\end{split}\]

The derived class must define the variables:

  • Tcref: Reference temperature far above the Tc, [K]

  • gnu: critical exponent parameter, [-]

  • gam0: critical exponent parameter, [-]

  • Xio: Amplitude of the asymptotic power laws for ξ, [m]

  • gamma: Amplitude of the asymptotic power laws for χ, [-]

  • R0: Amplitude parameter, [-]

  • qd : finite upper cutoff, [m]

Gaussian terms

Really only used in [15] for R123, but implemented here as a general method for possible future use

\[\ln\frac{\lambda_c}{\lambda_r} = \sum n\left(\tau-\alpha\right) ^t \left(\delta-\beta\right)^d\]

The derived class must define the variables:

  • Trefc: Reference temperature, [K]

  • rhorefc: Reference density, [kg/m³]

  • krefc: Reference thermal conductivity, [W/m·K]

  • nc: Polynomial coefficient

  • alfac: τ term translation

  • tc: τ exponent

  • betac: δ term translation

  • dc: δ exponent

References

[4] Younglove, B.A.; Thermophysical Properties of Fluids. I. Argon, Ethylene, Parahydrogen, Nitrogen, Nitrogen Trifluoride, and Oxygen. J. Phys. Chem. Ref. Data, 11(Suppl. 1) (1982)

[5] Younglove, B.A., Ely, J.F.; Thermophysical Properties of Fluids. II. Methane, Ethane, Propane, Isobutane, and Normal Butane. J. Phys. Chem. Ref. Data 16(4) (1987) 577-798

[15] Laesecke, A., Perkins, R.A., Howley, J.B.; An improved correlation for the thermal conductivity of HCFC123 (2,2-dichloro-1,1,1-trifluoroethane). Int. J. Refrigeration 19(4) (1996) 231-238

[16] Olchowy, G.A., Sengers, J.V.; A Simplified Representation for the Thermal Conductivity of Fluids in the Critical Region. Int. J. Thermophys. 10(2) (1989) 417-426

[19] Hanley H.J.M., McCarty, R.D., Haynes, W.M.; The Viscosity and Thermal Conductivity Coefficient for Dense Gaseous and Liquid Argon, Krypton, Xenon, Nitrogen and Oxigen. J. Phys. Chem. Ref. Data 3(4) (1974) 979-1018

_ECSEstela(delta, tau, ref)[source]

Calculation of shape factor for conformal state as explain in [21]

The correlation is only recommended for nonpolar fluids so it´s use may be very inaccuracy

\[\begin{split}\begin{array}[t]{l} \vartheta = 1+(\omega-\omega_0)(A_1+A_2e^{-\delta^2}+\Psi_ {\vartheta})\\ \varphi = \frac{Z_{c0}}{Z_c}(1+(\omega-\omega_0)(A_3+A_4e^ {-\delta^2}+\Psi_{\varphi}))\\ A_i = a_{i,1}-a_{i,2}\ln\tau\\ \Psi_{\vartheta} = b_1\delta e^{-b_2\Delta^2}\\ \Psi_{\varphi} = c_1\delta e^{-c_2\Delta^2}\\ \Delta = (\delta-1)^2+(\frac{1}{\tau}-1)^2\\ \end{array}\end{split}\]
Parameters:
taufloat

Inverse reduced temperature, Tc/T [-]

deltafloat

Reduced density, rho/rhoc [-]

reflib.meos.MEoS

Class with the reference fluid

Returns:
propdict

Calculated shape factor: teta, phi.

References

[21] Estela-Uribe, J.F., Trusler, J.P.M.; Extended corresponding states model for fluids and fluidmixtures I. Shape factor model for pure fluids. Fluid Phase Equilibria 204 (2003) 15-40

_IdealCurve(name, T, rho0=None)[source]

Ideal curve pressure calculation procedure. The ideal curves are used as a test for extrapolation behaviour of a EoS. There are curves where the real fluid has a property equal to the value for the ideal gas, compressibility factor and its first derivatives.

  • Classical ideal curve, Z=1

\[\left(\frac{\partial \alpha^r}{\partial \delta}\right)_{\tau} = 0\]
  • Boyle curve

\[\left(\frac{\partial Z}{\partial \rho}\right)_T\]
\[\left(\frac{\partial \alpha^r}{\partial \delta}\right)_{\tau} + \delta \left(\frac{\partial^2 \alpha^r}{\partial \delta^2}\right) _{\tau} = 0\]
  • Joule-Thomson inversion curve

\[\left(\frac{\partial Z}{\partial T}\right)_P\]
\[\left(\frac{\partial \alpha^r}{\partial \delta}\right)_{\tau} + \delta \left(\frac{\partial^2 \alpha^r}{\partial \delta^2}\right) _{\tau} + \tau \left(\frac{\partial^2 \alpha^r} {\partial \delta \partial \tau}\right) = 0\]
  • Joule inversion curve

\[\left(\frac{\partial Z}{\partial T}\right)_{\rho}\]
\[\left(\frac{\partial^2\alpha^r}{\partial \delta \partial \tau} \right) = 0\]

Definition and equation based in residual Helmholtz energy from Table 4.11, pag.168 in reference [10]

Parameters:
namestr

Name of curve to calculate:

  • ideal

  • boyle

  • joule-thomson

  • joule

Tfloat

Temperature of point to calculate, [K]

Returns:
Pfloat

Pressure of point, [Pa]

References

[10] Span, R.; Multiparameter Equations of State: An Accurate Source of Thermodynamic Property Data. Springer, 2000

class lib.meos.MEoSBlend(**kwargs)[source]

Bases: MEoS

Special meos class to implement pseudocomponent blend and defining its ancillary dew and bubble point

classmethod _dewP(T, eq=0)[source]

Using ancillary equation return the pressure of dew point

classmethod _bubbleP(T, eq=0)[source]

Using ancillary equation return the pressure of bubble point

classmethod _Vapor_Pressure(T, eq=0)[source]

Vapor Pressure ancillary equation

References