# Cubic Equation of State Alpha Functions (thermo.eos_alpha_functions)¶

This module contains implementations of the calculation of pure-component EOS $a \alpha$ parameters in a vectorized way. Functions for calculating their temperature derivatives as may be necessary are included as well.

For certain alpha functions, a class is available to provide these functions to and class that inherits from it.

A mixing rule must be used on the a_alphas to get the overall a_alpha term.

## Vectorized Alpha Functions¶

thermo.eos_alpha_functions.PR_a_alphas_vectorized(T, Tcs, ais, kappas, a_alphas=None)[source]

Calculates the a_alpha terms for the Peng-Robinson equation of state given the critical temperatures Tcs, constants ais, and kappas.

$a_i\alpha(T)_i=a_i [1+\kappa_i(1-\sqrt{T_{r,i}})]^2$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}$, [Pa*m^6/mol^2]

kappas

kappa parameters of Peng-Robinson EOS; formulas vary, but the original form uses $\kappa_i=0.37464+1.54226\omega_i-0.26992\omega^2_i$, [-]

a_alphaslist[float], optional

Vector for pure component a_alpha terms in the cubic EOS to be calculated and stored in, [Pa*m^6/mol^2]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

Examples

>>> Tcs = [469.7, 507.4, 540.3]
>>> ais = [2.0698956357716662, 2.7018068455659545, 3.3725793885832323]
>>> kappas = [0.74192743008, 0.819919992, 0.8800122140799999]
>>> PR_a_alphas_vectorized(322.29, Tcs=Tcs, ais=ais, kappas=kappas)
[2.6306811679, 3.6761503348, 4.8593286234]

thermo.eos_alpha_functions.SRK_a_alphas_vectorized(T, Tcs, ais, ms, a_alphas=None)[source]

Calculates the a_alpha terms for the SRK equation of state given the critical temperatures Tcs, constants ais, and kappas.

$a_i\alpha(T)_i = \left[1 + m_i\left(1 - \sqrt{\frac{T}{T_{c,i}}} \right)\right]^2$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=\frac{0.42748\cdot R^2(T_{c,i})^{2}}{P_{c,i}}$, [Pa*m^6/mol^2]

ms

m parameters of SRK EOS; formulas vary, but the original form uses $m_i = 0.480 + 1.574\omega_i - 0.176\omega_i^2$, [-]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

Examples

>>> Tcs = [469.7, 507.4, 540.3]
>>> ais = [1.9351940385541342, 2.525982668162287, 3.1531036708059315]
>>> ms = [0.8610138239999999, 0.9436976, 1.007889024]
>>> SRK_a_alphas_vectorized(322.29, Tcs=Tcs, ais=ais, ms=ms)
[2.549485814512, 3.586598245260, 4.76614806648]

thermo.eos_alpha_functions.PRSV_a_alphas_vectorized(T, Tcs, ais, kappa0s, kappa1s, a_alphas=None)[source]

Calculates the a_alpha terms for the Peng-Robinson-Stryjek-Vera equation of state given the critical temperatures Tcs, constants ais, PRSV parameters kappa0s and kappa1s.

$a_i\alpha_i = a_i \left(\left(\kappa_{0} + \kappa_{1} \left(\sqrt{\frac{ T}{T_{c,i}}} + 1\right) \left(- \frac{T}{T_{c,i}} + \frac{7}{10}\right) \right) \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right) + 1\right)^{2}$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}$, [Pa*m^6/mol^2]

kappa0s

kappa0 parameters of PRSV EOS; the original form uses $\kappa_{0,i} = 0.378893 + 1.4897153\omega_i - 0.17131848\omega_i^2 + 0.0196554\omega_i^3$, [-]

kappa1s

Fit parameters, can be set to 0 if unknown [-]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

Examples

>>> Tcs = [507.6]
>>> ais = [2.6923169620277805]
>>> kappa0s = [0.8074380841890093]
>>> kappa1s = [0.05104]
>>> PRSV_a_alphas_vectorized(299.0, Tcs=Tcs, ais=ais, kappa0s=kappa0s, kappa1s=kappa1s)
[3.81298569831]

thermo.eos_alpha_functions.PRSV2_a_alphas_vectorized(T, Tcs, ais, kappa0s, kappa1s, kappa2s, kappa3s, a_alphas=None)[source]

Calculates the a_alpha terms for the Peng-Robinson-Stryjek-Vera 2 equation of state given the critical temperatures Tcs, constants ais, PRSV2 parameters kappa0s, kappa1s, kappa2s, and kappa3s.

$a_i\alpha_i = a_{i} \left(\left(1 - \sqrt{\frac{T}{T_{c,i}}}\right) \left(\kappa_{0,i} + \left(\kappa_{1,i} + \kappa_{2,i} \left(1 - \sqrt{\frac{T}{T_{c,i}}}\right) \left(- \frac{T}{T_{c,i}} + \kappa_{3,i}\right)\right) \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(- \frac{T}{T_{c,i}} + \frac{7}{10}\right)\right) + 1\right)^{2}$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}$, [Pa*m^6/mol^2]

kappa0s

kappa0 parameters of PRSV EOS; the original form uses $\kappa_{0,i} = 0.378893 + 1.4897153\omega_i - 0.17131848\omega_i^2 + 0.0196554\omega_i^3$, [-]

kappa1s

Fit parameters, can be set to 0 if unknown [-]

kappa2s

Fit parameters, can be set to 0 if unknown [-]

kappa3s

Fit parameters, can be set to 0 if unknown [-]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

Examples

>>> PRSV2_a_alphas_vectorized(400.0, Tcs=[507.6], ais=[2.6923169620277805], kappa0s=[0.8074380841890093], kappa1s=[0.05104], kappa2s=[0.8634], kappa3s=[0.460])
[3.2005700986984]

thermo.eos_alpha_functions.APISRK_a_alphas_vectorized(T, Tcs, ais, S1s, S2s, a_alphas=None)[source]

Calculates the a_alpha terms for the API SRK equation of state given the critical temperatures Tcs, constants ais, and API parameters S1s and S2s.

$a_i\alpha(T)_i = a_i \left[1 + S_{1,i}\left(1-\sqrt{T_{r,i}}\right) + S_{2,i} \frac{1- \sqrt{T_{r,i}}}{\sqrt{T_{r,i}}}\right]^2$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=\frac{0.42748\cdot R^2(T_{c,i})^{2}}{P_{c,i}}$, [Pa*m^6/mol^2]

S1s

S1 parameters of API SRK EOS; regressed or estimated with $S_{1,i} = 0.48508 + 1.55171\omega_i - 0.15613\omega_i^2$, [-]

S2s

S2 parameters of API SRK EOS; regressed or set to zero, [-]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

Examples

>>> APISRK_a_alphas_vectorized(T=430.0, Tcs=[514.0], ais=[1.2721974560809934],  S1s=[1.678665], S2s=[-0.216396])
[1.60465652994097]

thermo.eos_alpha_functions.RK_a_alphas_vectorized(T, Tcs, ais, a_alphas=None)[source]

Calculates the a_alpha terms for the RK equation of state given the critical temperatures Tcs, and a parameters ais.

$a_i\alpha_i = \frac{a_i}{\sqrt{\frac{T}{T_{c,i}}}}$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=\frac{0.42748\cdot R^2(T_{c,i})^{2}}{P_{c,i}}$, [Pa*m^6/mol^2]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

Examples

>>> Tcs = [469.7, 507.4, 540.3]
>>> ais = [1.9351940385541342, 2.525982668162287, 3.1531036708059315]
>>> RK_a_alphas_vectorized(322.29, Tcs=Tcs, ais=ais)
[2.3362073307, 3.16943743055, 4.0825575798]


## Vectorized Alpha Functions With Derivatives¶

thermo.eos_alpha_functions.PR_a_alpha_and_derivatives_vectorized(T, Tcs, ais, kappas, a_alphas=None, da_alpha_dTs=None, d2a_alpha_dT2s=None)[source]

Calculates the a_alpha terms and their first two temperature derivatives for the Peng-Robinson equation of state given the critical temperatures Tcs, constants ais, and kappas.

$a_i\alpha(T)_i=a_i[1+\kappa_i(1-\sqrt{T_{r,i}})]^2$
$\frac{d a_i\alpha_i}{dT} = - \frac{a_i \kappa_i}{T^{0.5} {T_c}_i^{0.5}} \left(\kappa_i \left(- \frac{T^{0.5}}{{T_c}_i^{0.5}} + 1\right) + 1\right)$
$\frac{d^2 a_i\alpha_i}{dT^2} = 0.5 a_i \kappa_i \left(- \frac{1}{T^{1.5} {T_c}_i^{0.5}} \left(\kappa_i \left(\frac{T^{0.5}}{{T_c}_i^{0.5}} - 1\right) - 1\right) + \frac{\kappa_i}{T {T_c}_i}\right)$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}$ [Pa*m^6/mol^2]

kappas

kappa parameters of Peng-Robinson EOS; formulas vary, but the original form uses $\kappa_i=0.37464+1.54226\omega_i-0.26992\omega^2_i$, [-]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

da_alpha_dTs

First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]

d2a_alpha_dT2s

Second temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K^2)]

Examples

>>> Tcs = [469.7, 507.4, 540.3]
>>> ais = [2.0698956357716662, 2.7018068455659545, 3.3725793885832323]
>>> kappas = [0.74192743008, 0.819919992, 0.8800122140799999]
>>> PR_a_alpha_and_derivatives_vectorized(322.29, Tcs=Tcs, ais=ais, kappas=kappas)
([2.63068116797, 3.67615033489, 4.859328623453], [-0.0044497546430, -0.00638993749167, -0.0085372308846], [1.066668360e-05, 1.546687574587e-05, 2.07440632117e-05])

thermo.eos_alpha_functions.SRK_a_alpha_and_derivatives_vectorized(T, Tcs, ais, ms, a_alphas=None, da_alpha_dTs=None, d2a_alpha_dT2s=None)[source]

Calculates the a_alpha terms and their first and second temperature derivatives for the SRK equation of state given the critical temperatures Tcs, constants ais, and kappas.

$a_i\alpha(T)_i = \left[1 + m_i\left(1 - \sqrt{\frac{T}{T_{c,i}}} \right)\right]^2$
$\frac{d a_i\alpha_i}{dT} = \frac{a_i m_i}{T} \sqrt{\frac{T}{T_{c,i}}} \left(m_i \left(\sqrt{\frac{T}{T{c,i}}} - 1\right) - 1\right)$
$\frac{d^2 a_i\alpha_i}{dT^2} = \frac{a_i m_i \sqrt{\frac{T}{T_{c,i}}}} {2 T^{2}} \left(m_i + 1\right)$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=\frac{0.42748\cdot R^2(T_{c,i})^{2}}{P_{c,i}}$, [Pa*m^6/mol^2]

ms

m parameters of SRK EOS; formulas vary, but the original form uses $m_i = 0.480 + 1.574\omega_i - 0.176\omega_i^2$, [-]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

da_alpha_dTs

First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]

d2a_alpha_dT2s

Second temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K^2)]

Examples

>>> Tcs = [469.7, 507.4, 540.3]
>>> ais = [1.9351940385541342, 2.525982668162287, 3.1531036708059315]
>>> ms = [0.8610138239999999, 0.9436976, 1.007889024]
>>> SRK_a_alpha_and_derivatives_vectorized(322.29, Tcs=Tcs, ais=ais, ms=ms)
([2.549485814512, 3.586598245260, 4.76614806648], [-0.004915469296196, -0.00702410108423, -0.00936320876945], [1.236441916324e-05, 1.77752796719e-05, 2.37231823137e-05])

thermo.eos_alpha_functions.PRSV_a_alpha_and_derivatives_vectorized(T, Tcs, ais, kappa0s, kappa1s, a_alphas=None, da_alpha_dTs=None, d2a_alpha_dT2s=None)[source]

Calculates the a_alpha terms and their first and second derivative for the Peng-Robinson-Stryjek-Vera equation of state given the critical temperatures Tcs, constants ais, PRSV parameters kappa0s and kappa1s.

$a_i\alpha_i = a_i \left(\left(\kappa_{0} + \kappa_{1} \left(\sqrt{\frac{ T}{T_{c,i}}} + 1\right) \left(- \frac{T}{T_{c,i}} + \frac{7}{10}\right) \right) \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right) + 1\right)^{2}$
$\frac{d a_i\alpha_i}{dT} =a_{i} \left(\left(1 - \sqrt{\frac{T}{T_{c,i}}} \right) \left(\kappa_{0,i} + \kappa_{1,i} \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(- \frac{T}{T_{c,i}} + \frac{7}{10}\right)\right) + 1\right) \left(2 \left(1 - \sqrt{\frac{T}{T_{c,i}}}\right) \left( - \frac{\kappa_{1,i} \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right)}{T_{c,i}} + \frac{\kappa_{1,i} \sqrt{\frac{T}{T_{c,i}}} \left(- \frac{T}{T_{c,i}} + \frac{7}{10}\right)}{2 T}\right) - \frac{\sqrt{\frac{T}{T_{c,i}}} \left(\kappa_{0,i} + \kappa_{1,i} \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(- \frac{T}{T_{c,i}} + \frac{7}{10}\right)\right)}{T} \right)$
$\frac{d^2 a_i\alpha_i}{dT^2} = \frac{a_{i} \left(\left(\kappa_{1,i} \left(\sqrt{\frac{T}{T_{c,i}}} - 1\right) \left(\frac{20 \left(\sqrt{ \frac{T}{T_{c,i}}} + 1\right)}{T_{c,i}} + \frac{\sqrt{\frac{T}{T_{c,i}}} \left(\frac{10 T}{T_{c,i}} - 7\right)}{T}\right) - \frac{\sqrt{\frac{T} {T_{c,i}}} \left(10 \kappa_{0,i} - \kappa_{1,i} \left(\sqrt{\frac{T} {T_{c,i}}} + 1\right) \left(\frac{10 T}{T_{c,i}} - 7\right)\right)}{T} \right)^{2} - \frac{\sqrt{\frac{T}{T_{c,i}}} \left(\left(10 \kappa_{0,i} - \kappa_{1,i} \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(\frac{10 T}{T_{c,i}} - 7\right)\right) \left(\sqrt{\frac{T} {T_{c,i}}} - 1\right) - 10\right) \left(\kappa_{1,i} \left(\frac{40} {T_{c,i}} - \frac{\frac{10 T}{T_{c,i}} - 7}{T}\right) \left(\sqrt{ \frac{T}{T_{c,i}}} - 1\right) + 2 \kappa_{1,i} \left(\frac{20 \left( \sqrt{\frac{T}{T_{c,i}}} + 1\right)}{T_{c,i}} + \frac{\sqrt{\frac{T} {T_{c,i}}} \left(\frac{10 T}{T_{c,i}} - 7\right)}{T}\right) + \frac{10 \kappa_{0,i} - \kappa_{1,i} \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(\frac{10 T}{T_{c,i}} - 7\right)}{T}\right)}{T}\right)}{200}$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}$, [Pa*m^6/mol^2]

kappa0s

kappa0 parameters of PRSV EOS; the original form uses $\kappa_{0,i} = 0.378893 + 1.4897153\omega_i - 0.17131848\omega_i^2 + 0.0196554\omega_i^3$, [-]

kappa1s

Fit parameters, can be set to 0 if unknown [-]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

da_alpha_dTs

First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]

d2a_alpha_dT2s

Second temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K^2)]

Examples

>>> Tcs = [507.6]
>>> ais = [2.6923169620277805]
>>> kappa0s = [0.8074380841890093]
>>> kappa1s = [0.05104]
>>> PRSV_a_alpha_and_derivatives_vectorized(299.0, Tcs=Tcs, ais=ais, kappa0s=kappa0s, kappa1s=kappa1s)
([3.8129856983], [-0.0069769034748], [2.00265608110e-05])

thermo.eos_alpha_functions.PRSV2_a_alpha_and_derivatives_vectorized(T, Tcs, ais, kappa0s, kappa1s, kappa2s, kappa3s, a_alphas=None, da_alpha_dTs=None, d2a_alpha_dT2s=None)[source]

Calculates the a_alpha terms and their first and second derivatives for the Peng-Robinson-Stryjek-Vera 2 equation of state given the critical temperatures Tcs, constants ais, PRSV2 parameters kappa0s, kappa1s, kappa2s, and kappa3s.

$a_i\alpha_i = a_{i} \left(\left(1 - \sqrt{\frac{T}{T_{c,i}}}\right) \left(\kappa_{0,i} + \left(\kappa_{1,i} + \kappa_{2,i} \left(1 - \sqrt{\frac{T}{T_{c,i}}}\right) \left(- \frac{T}{T_{c,i}} + \kappa_{3,i}\right)\right) \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(- \frac{T}{T_{c,i}} + \frac{7}{10}\right)\right) + 1\right)^{2}$
$\frac{d a_i\alpha_i}{dT} = a_{i} \left(\left(1 - \sqrt{\frac{T}{T_{c,i} }}\right) \left(\kappa_{0,i} + \left(\kappa_{1,i} + \kappa_{2,i} \left( 1 - \sqrt{\frac{T}{T_{c,i}}}\right) \left(- \frac{T}{T_{c,i}} + \kappa_{3,i}\right)\right) \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(- \frac{T}{T_{c,i}} + \frac{7}{10}\right)\right) + 1\right) \left(2 \left(1 - \sqrt{\frac{T}{T_{c,i}}}\right) \left(\left(\sqrt{ \frac{T}{T_{c,i}}} + 1\right) \left(- \frac{T}{T_{c,i}} + \frac{7}{10} \right) \left(- \frac{\kappa_{2,i} \left(1 - \sqrt{\frac{T}{T_{c,i}}} \right)}{T_{c,i}} - \frac{\kappa_{2,i} \sqrt{\frac{T}{T_{c,i}}} \left( - \frac{T}{T_{c,i}} + \kappa_{3,i}\right)}{2 T}\right) - \frac{\left( \kappa_{1,i} + \kappa_{2,i} \left(1 - \sqrt{\frac{T}{T_{c,i}}}\right) \left(- \frac{T}{T_{c,i}} + \kappa_{3,i}\right)\right) \left(\sqrt{ \frac{T}{T_{c,i}}} + 1\right)}{T_{c,i}} + \frac{\sqrt{\frac{T}{T_{c,i} }} \left(\kappa_{1,i} + \kappa_{2,i} \left(1 - \sqrt{\frac{T}{T_{c,i}}} \right) \left(- \frac{T}{T_{c,i}} + \kappa_{3,i}\right)\right) \left( - \frac{T}{T_{c,i}} + \frac{7}{10}\right)}{2 T}\right) - \frac{\sqrt{ \frac{T}{T_{c,i}}} \left(\kappa_{0,i} + \left(\kappa_{1,i} + \kappa_{2,i} \left(1 - \sqrt{\frac{T}{T_{c,i}}}\right) \left( - \frac{T}{T_{c,i}} + \kappa_{3,i}\right)\right) \left(\sqrt{\frac{T} {T_{c,i}}} + 1\right) \left(- \frac{T}{T_{c,i}} + \frac{7}{10}\right) \right)}{T}\right)$
$\frac{d^2 a_i\alpha_i}{dT^2} = - \frac{a_{i} \left(\left(\left(10 \kappa_{0,i} - \left(\kappa_{1,i} + \kappa_{2,i} \left(\sqrt{\frac{T} {T_{c,i}}} - 1\right) \left(\frac{T}{T_{c,i}} - \kappa_{3,i}\right) \right) \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(\frac{10 T} {T_{c,i}} - 7\right)\right) \left(\sqrt{\frac{T}{T_{c,i}}} - 1\right) - 10\right) \left(\left(\sqrt{\frac{T}{T_{c,i}}} - 1\right) \left( \frac{40 \kappa_{2,i} \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left( \frac{2 \left(\sqrt{\frac{T}{T_{c,i}}} - 1\right)}{T_{c,i}} + \frac{ \sqrt{\frac{T}{T_{c,i}}} \left(\frac{T}{T_{c,i}} - \kappa_{3,i}\right)} {T}\right)}{T_{c,i}} + \frac{\kappa_{2,i} \sqrt{\frac{T}{T_{c,i}}} \left(\frac{4}{T_{c,i}} - \frac{\frac{T}{T_{c,i}} - \kappa_{3,i}}{T} \right) \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(\frac{10 T} {T_{c,i}} - 7\right)}{T} + \frac{2 \kappa_{2,i} \sqrt{\frac{T}{T_{c,i}}} \left(\frac{10 T}{T_{c,i}} - 7\right) \left(\frac{2 \left(\sqrt{\frac {T}{T_{c,i}}} - 1\right)}{T_{c,i}} + \frac{\sqrt{\frac{T}{T_{c,i}}} \left(\frac{T}{T_{c,i}} - \kappa_{3,i}\right)}{T}\right)}{T} + \frac{40 \sqrt{\frac{T}{T_{c,i}}} \left(\kappa_{1,i} + \kappa_{2,i} \left(\sqrt{ \frac{T}{T_{c,i}}} - 1\right) \left(\frac{T}{T_{c,i}} - \kappa_{3,i} \right)\right)}{T T_{c,i}} - \frac{\sqrt{\frac{T}{T_{c,i}}} \left( \kappa_{1,i} + \kappa_{2,i} \left(\sqrt{\frac{T}{T_{c,i}}} - 1\right) \left(\frac{T}{T_{c,i}} - \kappa_{3,i}\right)\right) \left(\frac{10 T} {T_{c,i}} - 7\right)}{T^{2}}\right) + \frac{2 \sqrt{\frac{T}{T_{c,i}}} \left(\kappa_{2,i} \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(\frac{10 T}{T_{c,i}} - 7\right) \left(\frac{2 \left(\sqrt{ \frac{T}{T_{c,i}}} - 1\right)}{T_{c,i}} + \frac{\sqrt{\frac{T} {T_{c,i}}} \left(\frac{T}{T_{c,i}} - \kappa_{3,i}\right)}{T}\right) + \frac{20 \left(\kappa_{1,i} + \kappa_{2,i} \left(\sqrt{\frac{T} {T_{c,i}}} - 1\right) \left(\frac{T}{T_{c,i}} - \kappa_{3,i}\right) \right) \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right)}{T_{c,i}} + \frac{\sqrt{\frac{T}{T_{c,i}}} \left(\kappa_{1,i} + \kappa_{2,i} \left(\sqrt{\frac{T}{T_{c,i}}} - 1\right) \left(\frac{T}{T_{c,i}} - \kappa_{3,i}\right)\right) \left(\frac{10 T}{T_{c,i}} - 7\right)} {T}\right)}{T} + \frac{\sqrt{\frac{T}{T_{c,i}}} \left(10 \kappa_{0,i} - \left(\kappa_{1,i} + \kappa_{2,i} \left(\sqrt{\frac{T}{T_{c,i}}} - 1\right) \left(\frac{T}{T_{c,i}} - \kappa_{3,i}\right)\right) \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(\frac{10 T}{T_{c,i}} - 7\right)\right)}{T^{2}}\right) - \left(\left(\sqrt{\frac{T}{T_{c,i}}} - 1\right) \left(\kappa_{2,i} \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(\frac{10 T}{T_{c,i}} - 7\right) \left(\frac{2 \left(\sqrt{ \frac{T}{T_{c,i}}} - 1\right)}{T_{c,i}} + \frac{\sqrt{\frac{T}{T_{c,i}}} \left(\frac{T}{T_{c,i}} - \kappa_{3,i}\right)}{T}\right) + \frac{20 \left(\kappa_{1,i} + \kappa_{2,i} \left(\sqrt{\frac{T}{T_{c,i}}} - 1\right) \left(\frac{T}{T_{c,i}} - \kappa_{3,i}\right)\right) \left( \sqrt{\frac{T}{T_{c,i}}} + 1\right)}{T_{c,i}} + \frac{\sqrt{\frac{T} {T_{c,i}}} \left(\kappa_{1,i} + \kappa_{2,i} \left(\sqrt{\frac{T} {T_{c,i}}} - 1\right) \left(\frac{T}{T_{c,i}} - \kappa_{3,i}\right) \right) \left(\frac{10 T}{T_{c,i}} - 7\right)}{T}\right) - \frac{ \sqrt{\frac{T}{T_{c,i}}} \left(10 \kappa_{0,i} - \left(\kappa_{1,i} + \kappa_{2,i} \left(\sqrt{\frac{T}{T_{c,i}}} - 1\right) \left(\frac{T} {T_{c,i}} - \kappa_{3,i}\right)\right) \left(\sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(\frac{10 T}{T_{c,i}} - 7\right)\right)}{T}\right)^{2} \right)}{200}$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}$, [Pa*m^6/mol^2]

kappa0s

kappa0 parameters of PRSV EOS; the original form uses $\kappa_{0,i} = 0.378893 + 1.4897153\omega_i - 0.17131848\omega_i^2 + 0.0196554\omega_i^3$, [-]

kappa1s

Fit parameters, can be set to 0 if unknown [-]

kappa2s

Fit parameters, can be set to 0 if unknown [-]

kappa3s

Fit parameters, can be set to 0 if unknown [-]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

da_alpha_dTs

First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]

d2a_alpha_dT2s

Second temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K^2)]

Examples

>>> PRSV2_a_alpha_and_derivatives_vectorized(400.0, Tcs=[507.6], ais=[2.6923169620277805], kappa0s=[0.8074380841890093], kappa1s=[0.05104], kappa2s=[0.8634], kappa3s=[0.460])
([3.2005700986], [-0.005301195971], [1.11181477576e-05])

thermo.eos_alpha_functions.APISRK_a_alpha_and_derivatives_vectorized(T, Tcs, ais, S1s, S2s, a_alphas=None, da_alpha_dTs=None, d2a_alpha_dT2s=None)[source]

Calculates the a_alpha terms and their first two temperature derivatives for the API SRK equation of state given the critical temperatures Tcs, constants ais, and API parameters S1s and S2s.

$a_i\alpha(T)_i = a_i \left[1 + S_{1,i}\left(1-\sqrt{T_{r,i}}\right) + S_{2,i} \frac{1- \sqrt{T_{r,i}}}{\sqrt{T_{r,i}}}\right]^2$
$\frac{d a_i\alpha_i}{dT} = a_i\frac{T_{c,i}}{T^{2}} \left(- S_{2,i} \left(\sqrt{ \frac{T}{T_{c,i}}} - 1\right) + \sqrt{\frac{T}{T_{c,i}}} \left(S_{1,i} \sqrt{ \frac{T}{T_{c,i}}} + S_{2,i}\right)\right) \left(S_{2,i} \left(\sqrt{\frac{ T}{T_{c,i}}} - 1\right) + \sqrt{\frac{T}{T_{c,i}}} \left(S_{1,i} \left(\sqrt{ \frac{T}{T_{c,i}}} - 1\right) - 1\right)\right)$
$\frac{d^2 a_i\alpha_i}{dT^2} = a_i\frac{1}{2 T^{3}} \left(S_{1,i}^{2} T \sqrt{\frac{T}{T_{c,i}}} - S_{1,i} S_{2,i} T \sqrt{\frac{T}{T_{c,i}}} + 3 S_{1,i} S_{2,i} T_{c,i} \sqrt{\frac{T}{T_{c,i}}} + S_{1,i} T \sqrt{\frac{T}{T_{c,i}}} - 3 S_{2,i}^{2} T_{c,i} \sqrt{\frac{T}{T_{c,i}}} + 4 S_{2,i}^{2} T_{c,i} + 3 S_{2,i} T_{c,i} \sqrt{\frac{T}{T_{c,i}}}\right)$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=\frac{0.42748\cdot R^2(T_{c,i})^{2}}{P_{c,i}}$, [Pa*m^6/mol^2]

S1s

S1 parameters of API SRK EOS; regressed or estimated with $S_{1,i} = 0.48508 + 1.55171\omega_i - 0.15613\omega_i^2$, [-]

S2s

S2 parameters of API SRK EOS; regressed or set to zero, [-]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

da_alpha_dTs

First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]

d2a_alpha_dT2s

Second temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K^2)]

Examples

>>> APISRK_a_alpha_and_derivatives_vectorized(T=430.0, Tcs=[514.0], ais=[1.2721974560809934],  S1s=[1.678665], S2s=[-0.216396])
([1.60465652994], [-0.0043155855337], [8.9931026263e-06])

thermo.eos_alpha_functions.RK_a_alpha_and_derivatives_vectorized(T, Tcs, ais, a_alphas=None, da_alpha_dTs=None, d2a_alpha_dT2s=None)[source]

Calculates the a_alpha terms and their first and second temperature derivatives for the RK equation of state given the critical temperatures Tcs, and a parameters ais.

$a_i\alpha_i = \frac{a_i}{\sqrt{\frac{T}{T_{c,i}}}}$
$\frac{d a_i\alpha_i}{dT} = - \frac{a_i}{2 T\sqrt{\frac{T}{T_{c,i}}}}$
$\frac{d^2 a_i\alpha_i}{dT^2} = \frac{3 a_i}{4 T^{2}\sqrt{\frac{T}{T_{c,i}}}}$
Parameters
Tfloat

Temperature, [K]

Tcs

Critical temperatures of components, [K]

ais

a parameters of cubic EOS, $a_i=\frac{0.42748\cdot R^2(T_{c,i})^{2}}{P_{c,i}}$, [Pa*m^6/mol^2]

Returns
a_alphas

Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]

da_alpha_dTs

First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]

d2a_alpha_dT2s

Second temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K^2)]

Examples

>>> Tcs = [469.7, 507.4, 540.3]
>>> ais = [1.9351940385541342, 2.525982668162287, 3.1531036708059315]
>>> RK_a_alpha_and_derivatives_vectorized(322.29, Tcs=Tcs, ais=ais)
([2.3362073307, 3.16943743055, 4.08255757984], [-0.00362438693525, -0.0049170582868, -0.00633367088622], [1.6868597855e-05, 2.28849403652e-05, 2.94781294155e-05])


## Class With Alpha Functions¶

The class-based ones van save a little code when implementing a new EOS. If there is not a standalone function available for an alpha function, it has not yet been accelerated in a nice vectorized way.

class thermo.eos_alpha_functions.a_alpha_base[source]

Bases: object

class thermo.eos_alpha_functions.Almeida_a_alpha[source]

Methods

 Method to calculate a_alpha and its first and second derivatives according to Almeida et al. (1991) [1].
 a_alpha_pure
a_alpha_and_derivatives_pure(T)[source]

Method to calculate a_alpha and its first and second derivatives according to Almeida et al. (1991) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Three coefficients needed.

$\alpha = e^{c_{1} \left(- \frac{T}{T_{c,i}} + 1\right) \left|{ \frac{T}{T_{c,i}} - 1}\right|^{c_{2} - 1} + c_{3} \left(-1 + \frac{T_{c,i}}{T}\right)}$

References

1(1,2)

Almeida, G. S., M. Aznar, and A. S. Telles. “Uma Nova Forma de Dependência Com a Temperatura Do Termo Atrativo de Equações de Estado Cúbicas.” RBE, Rev. Bras. Eng., Cad. Eng. Quim 8 (1991): 95.

a_alpha_pure(T)[source]
class thermo.eos_alpha_functions.Androulakis_a_alpha[source]

Methods

 Method to calculate a_alpha and its first and second derivatives according to Androulakis et al. (1989) [1].
 a_alpha_pure
a_alpha_and_derivatives_pure(T)[source]

Method to calculate a_alpha and its first and second derivatives according to Androulakis et al. (1989) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Three coefficients needed.

$\alpha = c_{1} \left(- \left(\frac{T}{T_{c,i}}\right)^{\frac{2}{3}} + 1\right) + c_{2} \left(- \left(\frac{T}{T_{c,i}}\right)^{\frac{2}{3}} + 1\right)^{2} + c_{3} \left(- \left(\frac{T}{T_{c,i}}\right)^{ \frac{2}{3}} + 1\right)^{3} + 1$

References

1(1,2)

Androulakis, I. P., N. S. Kalospiros, and D. P. Tassios. “Thermophysical Properties of Pure Polar and Nonpolar Compounds with a Modified VdW-711 Equation of State.” Fluid Phase Equilibria 45, no. 2 (April 1, 1989): 135-63. doi:10.1016/0378-3812(89)80254-7.

a_alpha_pure(T)[source]
class thermo.eos_alpha_functions.Chen_Yang_a_alpha[source]

Methods

 Method to calculate a_alpha and its first and second derivatives according to Hamid and Yang (2017) [1].
 a_alpha_pure
a_alpha_and_derivatives_pure(T)[source]

Method to calculate a_alpha and its first and second derivatives according to Hamid and Yang (2017) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Seven coefficients needed.

$\alpha = e^{\left(- c_{3}^{\ln{\left (\frac{T}{T_{c,i}} \right )}} + 1\right) \left(- \frac{T c_{2}}{T_{c,i}} + c_{1}\right)}$

References

1(1,2)

Chen, Zehua, and Daoyong Yang. “Optimization of the Reduced Temperature Associated with Peng-Robinson Equation of State and Soave-Redlich-Kwong Equation of State To Improve Vapor Pressure Prediction for Heavy Hydrocarbon Compounds.” Journal of Chemical & Engineering Data, August 31, 2017. doi:10.1021/acs.jced.7b00496.

a_alpha_pure(T)[source]
class thermo.eos_alpha_functions.Coquelet_a_alpha[source]

Methods

 Method to calculate a_alpha and its first and second derivatives according to Coquelet et al. (2004) [1].
 a_alpha_pure
a_alpha_and_derivatives_pure(T)[source]

Method to calculate a_alpha and its first and second derivatives according to Coquelet et al. (2004) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Three coefficients needed.

$\alpha = e^{c_{1} \left(- \frac{T}{T_{c,i}} + 1\right) \left(c_{2} \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right)^{2} + c_{3} \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right)^{3} + 1\right)^{2}}$