4. Cubic Equation of State

class scithermo.eos.cubic.Cubic(sigma: float, epsilon: float, Omega: float, Psi: float, dippr_no: str = None, compound_name: str = None, cas_number: str = None, **kwargs)[source]

Generic Cubic Equation of State Defined as in [GP07]

\[P = \frac{RT}{V - b} - \frac{a(T)}{(V + \epsilon b)(V + \sigma b)}\]

where \(\epsilon\) and \(\sigma\) are pure numbers–the same for all substances. \(a(T)\) and \(b\) are substance-dependent.

Parameters
  • R (float, hard-coded) – gas constant, set to SI units

  • sigma (float) – Parameter defined by specific equation of state, \(\sigma\)

  • epsilon (float) – Parameter defined by specific equation of state, \(\epsilon\)

  • Omega (float) – Parameter defined by specific equation of state, \(\Omega\)

  • Psi (float) – Parameter defined by specific equation of state, \(\Psi\)

  • tol (float) – tolerance for percent difference between compressilibity factor calculated iteratively, set to 0.01

G_R_RT_expr(P, V, T, log=None)[source]

Dimensionless residual gibbs

\[\frac{G^\mathrm{R}}{RT} = Z - 1 + \ln(Z-\beta) - qI\]
Returns

Expression for residual gibbs free (divided by RT) – dimensionless

H_R_RT_expr(P, V, T, log=None)[source]

Dimensionless residual enthalpy

\[\frac{H^\mathrm{R}}{RT} = Z - 1 + \left[\frac{\mathrm{d} \ln \alpha(T_\mathrm{r})}{\mathrm{d} \ln T_\mathrm{r}} - 1\right]qI\]
Returns

Expression for residual enthalpy (divided by RT) – dimensionless

H_expr(P, V, T, T_ref, val_ref=0.0, log=None)[source]

Expression for fluid enthalpy

Parameters
  • P – pressure in Pa

  • V – molar volume [m**3/mol]

  • T – temperautre in K

  • T_ref – reference temperature in K

  • val_ref – value at reference temperature [J/mol/K]

  • log – function used for logarithm

Returns

\(H\) [J/mol/K]

I_expr(P, V, T, log=None)[source]
\[I = \frac{1}{\sigma - \epsilon}\ln{\left( \frac{Z + \sigma \beta}{Z + \epsilon \beta} \right)}\]
Parameters

log (callable, optional) – function to be used for natural logarithm, defaults to np.log

S_R_R_expr(P, V, T, log=None)[source]

Dimensionless residual entropy

\[\frac{S^\mathrm{R}}{R} = \ln(Z-\beta) + \frac{\mathrm{d} \ln \alpha(T_\mathrm{r})}{\mathrm{d} \ln T_\mathrm{r}} qI\]
Returns

Expression for residual entropy (divided by R) – dimensionless

Z_liquid_RHS(Z, beta, q)[source]

Compressibility of vapor [GP07]

(1)\[\beta + (Z + \epsilon\beta)(Z + \sigma\beta)\left(\frac{1 + \beta - Z}{q\beta}\right)\]
Z_vapor_RHS(Z, beta, q)[source]

Compressibility of vapor [GP07]

(2)\[1 + \beta - \frac{q\beta (Z - \beta)}{(Z + \epsilon\beta)(Z + \sigma\beta)}\]
Returns

a_expr(T)[source]
\[a(T) = \Psi \frac{\alpha(T_r)R^2T_{\mathrm{c}}^2}{P_{\mathrm{c}}}\]
Parameters

T – temperautre in K

alpha_expr(T_r)[source]

An empirical expression, specific to a particular form of the equation of state

Parameters

T_r – reduced temperature (T/Tc), dimensionless

Returns

\(\alpha (T_r)\)

beta_expr(T, P)[source]
\[\beta = \Omega\frac{P_\mathrm{r}}{T_\mathrm{r}}\]
Parameters
  • T – temperature in K

  • P – pressure in Pa

Returns

\(\beta\)

cardano_constants(T, P)[source]
Parameters
  • T – temperature [T]

  • P – pressure [Pa]

Returns

cardano constants p, q

Return type

tuple

coefficients(T, P)[source]

Polynomial oefficients for cubic equation of state

\[Z^3 c_0 + Z^2c_1 + Z*c_2 + c_3 = 0\]
Returns

(c_0, c_1, c_2, c_3)

d_ln_alpha_d_ln_Tr(T_r)[source]
Parameters

T_r – reduced temperature [dimensionless]

Returns

Expression for \(\frac{\mathrm{d} \ln \alpha(T_\mathrm{r})}{\mathrm{d} \ln T_\mathrm{r}}\)

iterate_to_solve_Z(T, P, phase) → float[source]
Parameters
  • T – temperature in K

  • P – pressure in Pa

  • phase (str) – phase [vapor or liquid]

Returns

compressibility factor

num_roots(T, P)[source]

Find number of roots

See [ML12][Dei02]

Parameters
  • T – temperature in K

  • P – pressure in Pa

Returns

number of roots

plot_Z_vs_P(T, P_min, P_max, phase='vapor', symbol='o', ax=None, **kwargs)[source]

Plot compressibility as a function of pressure

Parameters
  • T (float) – temperature [K]

  • P_min (float) – minimum pressure for plotting [Pa]

  • P_max (float) – maximum pressure for plotting [Pa]

  • phase (str) – phase type (liquid or vapor), defaults to vapor

  • symbol (str) – marker symbol, defaults to ‘o’

  • ax (plt.axis) – matplotlib axes for plotting, defaults to None

  • kwargs – keyword arguments for plotting

print_roots(T, P)[source]

Check to see if all conditions have one root

q_expr(T)[source]
\[q = \frac{\Psi \alpha(T_\mathrm{r})}{\Omega T_\mathrm{r}}\]
Parameters

T – temperautre in K

residual(P, V, T)[source]
Parameters
  • P – pressure in Pa

  • V – volume in [mol/m**3]

  • T – temperature in K

Returns

residual for cubic equation of state

class scithermo.eos.cubic.RedlichKwong(**kwargs)[source]

Redlich-Kwong Equation of State [RK49]

alpha_expr(T_r)[source]

An empirical expression, specific to a particular form of the equation of state

Parameters

T_r – reduced temperature (T/Tc), dimensionless

Returns

\(\alpha (T_r)\)

d_ln_alpha_d_ln_Tr(T_r)[source]
Parameters

T_r – reduced temperature [dimensionless]

Returns

Expression for \(\frac{\mathrm{d} \ln \alpha(T_\mathrm{r})}{\mathrm{d} \ln T_\mathrm{r}}\)

class scithermo.eos.cubic.SoaveRedlichKwong(**kwargs)[source]

Soave Redlich-Kwong Equation of State [Soa72]

Parameters

f_w (float, derived) – empirical expression used in \(\alpha\) [dimensionless?]

alpha_expr(T_r)[source]

An empirical expression, specific to a particular form of the equation of state

Parameters

T_r – reduced temperature (T/Tc), dimensionless

Returns

\(\alpha (T_r)\)

d_ln_alpha_d_ln_Tr(T_r)[source]
Parameters

T_r – reduced temperature [dimensionless]

Returns

Expression for \(\frac{\mathrm{d} \ln \alpha(T_\mathrm{r})}{\mathrm{d} \ln T_\mathrm{r}}\)

class scithermo.eos.cubic.PengRobinson(**kwargs)[source]

Peng-Robinson Equation of State [PR76]

Parameters

f_w (float, derived) – empirical expression used in \(\alpha\) [dimensionless?]