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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
a parameters of cubic EOS, \(a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}\), [Pa*m^6/mol^2]
- kappaslist[float]
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_alphaslist[float]
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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
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]
- mslist[float]
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_alphaslist[float]
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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
a parameters of cubic EOS, \(a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}\), [Pa*m^6/mol^2]
- kappa0slist[float]
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\), [-]
- kappa1slist[float]
Fit parameters, can be set to 0 if unknown [-]
- Returns
- a_alphaslist[float]
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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
a parameters of cubic EOS, \(a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}\), [Pa*m^6/mol^2]
- kappa0slist[float]
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\), [-]
- kappa1slist[float]
Fit parameters, can be set to 0 if unknown [-]
- kappa2slist[float]
Fit parameters, can be set to 0 if unknown [-]
- kappa3slist[float]
Fit parameters, can be set to 0 if unknown [-]
- Returns
- a_alphaslist[float]
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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
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]
- S1slist[float]
S1 parameters of API SRK EOS; regressed or estimated with \(S_{1,i} = 0.48508 + 1.55171\omega_i - 0.15613\omega_i^2\), [-]
- S2slist[float]
S2 parameters of API SRK EOS; regressed or set to zero, [-]
- Returns
- a_alphaslist[float]
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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
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_alphaslist[float]
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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
a parameters of cubic EOS, \(a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}\) [Pa*m^6/mol^2]
- kappaslist[float]
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_alphaslist[float]
Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]
- da_alpha_dTslist[float]
First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]
- d2a_alpha_dT2slist[float]
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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
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]
- mslist[float]
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_alphaslist[float]
Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]
- da_alpha_dTslist[float]
First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]
- d2a_alpha_dT2slist[float]
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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
a parameters of cubic EOS, \(a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}\), [Pa*m^6/mol^2]
- kappa0slist[float]
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\), [-]
- kappa1slist[float]
Fit parameters, can be set to 0 if unknown [-]
- Returns
- a_alphaslist[float]
Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]
- da_alpha_dTslist[float]
First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]
- d2a_alpha_dT2slist[float]
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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
a parameters of cubic EOS, \(a_i=0.45724\frac{R^2T_{c,i}^2}{P_{c,i}}\), [Pa*m^6/mol^2]
- kappa0slist[float]
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\), [-]
- kappa1slist[float]
Fit parameters, can be set to 0 if unknown [-]
- kappa2slist[float]
Fit parameters, can be set to 0 if unknown [-]
- kappa3slist[float]
Fit parameters, can be set to 0 if unknown [-]
- Returns
- a_alphaslist[float]
Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]
- da_alpha_dTslist[float]
First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]
- d2a_alpha_dT2slist[float]
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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
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]
- S1slist[float]
S1 parameters of API SRK EOS; regressed or estimated with \(S_{1,i} = 0.48508 + 1.55171\omega_i - 0.15613\omega_i^2\), [-]
- S2slist[float]
S2 parameters of API SRK EOS; regressed or set to zero, [-]
- Returns
- a_alphaslist[float]
Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]
- da_alpha_dTslist[float]
First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]
- d2a_alpha_dT2slist[float]
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]
- Tcslist[float]
Critical temperatures of components, [K]
- aislist[float]
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_alphaslist[float]
Pure component a_alpha terms in the cubic EOS, [Pa*m^6/mol^2]
- da_alpha_dTslist[float]
First temperature derivative of pure component a_alpha, [Pa*m^6/(mol^2*K)]
- d2a_alpha_dT2slist[float]
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.Almeida_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
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
- class thermo.eos_alpha_functions.Androulakis_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
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
- class thermo.eos_alpha_functions.Chen_Yang_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
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.
- class thermo.eos_alpha_functions.Coquelet_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
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}} \]References
- 1(1,2)
Coquelet, C., A. Chapoy, and D. Richon. “Development of a New Alpha Function for the Peng–Robinson Equation of State: Comparative Study of Alpha Function Models for Pure Gases (Natural Gas Components) and Water-Gas Systems.” International Journal of Thermophysics 25, no. 1 (January 1, 2004): 133-58. doi:10.1023/B:IJOT.0000022331.46865.2f.
- class thermo.eos_alpha_functions.Gasem_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Gasem (2001) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Gasem (2001) [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^{\left(- \left(\frac{T}{T_{c,i}}\right)^{c_{3}} + 1\right) \left(\frac{T c_{2}}{T_{c,i}} + c_{1}\right)} \]References
- class thermo.eos_alpha_functions.Gibbons_Laughton_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Gibbons and Laughton (1984) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Gibbons and Laughton (1984) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Two coefficients needed.
\[\alpha = c_{1} \left(\frac{T}{T_{c,i}} - 1\right) + c_{2} \left(\sqrt{\frac{T}{T_{c,i}}} - 1\right) + 1 \]References
- class thermo.eos_alpha_functions.Haghtalab_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Haghtalab et al. (2010) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Haghtalab et al. (2010) [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^{\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
- class thermo.eos_alpha_functions.Harmens_Knapp_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Harmens and Knapp (1980) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Harmens and Knapp (1980) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Two coefficients needed.
\[\alpha = \left(c_{1} \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right) - c_{2} \left(1 - \frac{T_{c,i}}{T}\right) + 1\right)^{2} \]References
- class thermo.eos_alpha_functions.Heyen_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Heyen (1980) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Heyen (1980) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Two coefficients needed.
\[\alpha = e^{c_{1} \left(- \left(\frac{T}{T_{c,i}}\right)^{c_{2}} + 1\right)} \]References
- class thermo.eos_alpha_functions.Mathias_1983_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Mathias (1983) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Mathias (1983) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Two coefficients needed.
\[\alpha = \left(c_{1} \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right) - c_{2} \left(- \frac{T}{T_{c,i}} + 0.7\right) \left(- \frac{T}{T_{c,i}} + 1\right) + 1\right)^{2} \]References
- class thermo.eos_alpha_functions.Mathias_Copeman_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Mathias and Copeman (1983) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Mathias and Copeman (1983) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Three coefficients needed.
\[\alpha = \left(c_{1} \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right) + 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} \]References
- class thermo.eos_alpha_functions.Mathias_Copeman_poly_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
a_alpha_and_derivatives_pure
a_alpha_and_derivatives_vectorized
a_alpha_pure
a_alphas_vectorized
- class thermo.eos_alpha_functions.Mathias_Copeman_untruncated_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Mathias and Copeman (1983) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Mathias and Copeman (1983) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Three coefficients needed.
\[\alpha = \left(c_{1} \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right) + 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} \]References
- class thermo.eos_alpha_functions.Melhem_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Melhem 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 Melhem et al. (1989) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Two coefficients needed.
\[\alpha = e^{c_{1} \left(- \frac{T}{T_{c,i}} + 1\right) + c_{2} \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right)^{2}} \]References
- class thermo.eos_alpha_functions.Poly_a_alpha[source]¶
Bases:
object
Methods
Method to calculate a_alpha and its first and second derivatives given that there is a polynomial equation for \(\alpha\).
a_alpha_pure
(T)Method to calculate a_alpha given that there is a polynomial equation for \(\alpha\).
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives given that there is a polynomial equation for \(\alpha\).
\[a \alpha = a\cdot \text{poly}(T) \]- Parameters
- Tfloat
Temperature, [K]
- Returns
- a_alphaslist[float]
Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
- da_alpha_dTslist[float]
Temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K]
- d2a_alpha_dT2slist[float]
Second temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K**2]
- class thermo.eos_alpha_functions.Saffari_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Saffari and Zahedi (2013) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Saffari and Zahedi (2013) [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^{\frac{T c_{1}}{T_{c,i}} + c_{2} \ln{\left (\frac{T}{T_{c,i}} \right )} + c_{3} \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right)} \]References
- class thermo.eos_alpha_functions.Schwartzentruber_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Schwartzentruber et al. (1990) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Schwartzentruber et al. (1990) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Three coefficients needed.
\[\alpha = \left(c_{4} \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right) - \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right) \left(\frac{T^{2} c_{3}} {Tc^{2}} + \frac{T c_{2}}{T_{c,i}} + c_{1}\right) + 1\right)^{2} \]References
- class thermo.eos_alpha_functions.Soave_1972_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Soave (1972) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Soave (1972) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Same as SRK.a_alpha_and_derivatives but slower and requiring alpha_coeffs to be set. One coefficient needed.
\[\alpha = \left(c_{0} \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right) + 1\right)^{2} \]References
- 1(1,2)
Soave, Giorgio. “Equilibrium Constants from a Modified Redlich- Kwong Equation of State.” Chemical Engineering Science 27, no. 6 (June 1972): 1197-1203. doi:10.1016/0009-2509(72)80096-4.
- 2
Young, André F., Fernando L. P. Pessoa, and Victor R. R. Ahón. “Comparison of 20 Alpha Functions Applied in the Peng–Robinson Equation of State for Vapor Pressure Estimation.” Industrial & Engineering Chemistry Research 55, no. 22 (June 8, 2016): 6506-16. doi:10.1021/acs.iecr.6b00721.
- class thermo.eos_alpha_functions.Soave_1984_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Soave (1984) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Soave (1984) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Two coefficients needed.
\[\alpha = c_{1} \left(- \frac{T}{T_{c,i}} + 1\right) + c_{2} \left(-1 + \frac{T_{c,i}}{T}\right) + 1 \]References
- class thermo.eos_alpha_functions.Soave_1979_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Soave (1979) [1].
a_alpha_and_derivatives_vectorized
a_alpha_pure
a_alphas_vectorized
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Soave (1979) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. Three coefficients are needed.
\[\alpha = 1 + (1 - T_r)(M + \frac{N}{T_r}) \]References
- 1(1,2)
Soave, G. “Rigorous and Simplified Procedures for Determining the Pure-Component Parameters in the Redlich—Kwong—Soave Equation of State.” Chemical Engineering Science 35, no. 8 (January 1, 1980): 1725-30. https://doi.org/10.1016/0009-2509(80)85007-X.
- class thermo.eos_alpha_functions.Soave_1993_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Soave (1983) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Soave (1983) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Two coefficient needed.
\[\alpha = c_{1} \left(- \frac{T}{T_{c,i}} + 1\right) + c_{2} \left(- \sqrt{\frac{T}{T_{c,i}}} + 1\right)^{2} + 1 \]References
- class thermo.eos_alpha_functions.Trebble_Bishnoi_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Trebble and Bishnoi (1987) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Trebble and Bishnoi (1987) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. One coefficient needed.
\[\alpha = e^{c_{1} \left(- \frac{T}{T_{c,i}} + 1\right)} \]References
- class thermo.eos_alpha_functions.Twu91_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Twu et al. (1991) [1].
Method to calculate the pure-component a_alphas and their first and second derivatives for TWU91 alpha function EOS.
a_alpha_pure
a_alphas_vectorized
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Twu 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 = \left(\frac{T}{T_{c,i}}\right)^{c_{3} \left(c_{2} - 1\right)} e^{c_{1} \left(- \left(\frac{T}{T_{c,i}} \right)^{c_{2} c_{3}} + 1\right)} \]References
- a_alpha_and_derivatives_vectorized(T)[source]¶
Method to calculate the pure-component a_alphas and their first and second derivatives for TWU91 alpha function EOS. This vectorized implementation is added for extra speed.
\[\alpha = \left(\frac{T}{T_{c,i}}\right)^{c_{3} \left(c_{2} - 1\right)} e^{c_{1} \left(- \left(\frac{T}{T_{c,i}} \right)^{c_{2} c_{3}} + 1\right)} \]- Parameters
- Tfloat
Temperature, [K]
- Returns
- a_alphaslist[float]
Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
- da_alpha_dTslist[float]
Temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K]
- d2a_alpha_dT2slist[float]
Second temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K**2]
- class thermo.eos_alpha_functions.TwuPR95_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate \(a \alpha\) and its first and second derivatives for the Twu alpha function.
a_alpha_pure
(T)Method to calculate \(a \alpha\) for the Twu alpha function.
a_alpha_and_derivatives_vectorized
a_alphas_vectorized
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate \(a \alpha\) and its first and second derivatives for the Twu alpha function. Uses the set values of Tc, omega and a.
\[\alpha = \alpha^{(0)} + \omega(\alpha^{(1)}-\alpha^{(0)}) \]\[\alpha^{(i)} = T_r^{N(M-1)}\exp[L(1-T_r^{NM})] \]For sub-critical conditions:
L0, M0, N0 = 0.125283, 0.911807, 1.948150;
L1, M1, N1 = 0.511614, 0.784054, 2.812520
For supercritical conditions:
L0, M0, N0 = 0.401219, 4.963070, -0.2;
L1, M1, N1 = 0.024955, 1.248089, -8.
- Parameters
- Tfloat
Temperature at which to calculate the values, [-]
- Returns
- a_alphafloat
Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
- da_alpha_dTfloat
Temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K]
- d2a_alpha_dT2float
Second temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K^2]
Notes
This method does not alter the object’s state and the temperature provided can be a different than that of the object.
The derivatives are somewhat long and are not described here for brevity; they are obtainable from the following SymPy expression.
>>> from sympy import * >>> T, Tc, omega, N1, N0, M1, M0, L1, L0 = symbols('T, Tc, omega, N1, N0, M1, M0, L1, L0') >>> Tr = T/Tc >>> alpha0 = Tr**(N0*(M0-1))*exp(L0*(1-Tr**(N0*M0))) >>> alpha1 = Tr**(N1*(M1-1))*exp(L1*(1-Tr**(N1*M1))) >>> alpha = alpha0 + omega*(alpha1-alpha0) >>> diff(alpha, T) >>> diff(alpha, T, T)
- a_alpha_pure(T)[source]¶
Method to calculate \(a \alpha\) for the Twu alpha function. Uses the set values of Tc, omega and a.
\[\alpha = \alpha^{(0)} + \omega(\alpha^{(1)}-\alpha^{(0)}) \]\[\alpha^{(i)} = T_r^{N(M-1)}\exp[L(1-T_r^{NM})] \]For sub-critical conditions:
L0, M0, N0 = 0.125283, 0.911807, 1.948150;
L1, M1, N1 = 0.511614, 0.784054, 2.812520
For supercritical conditions:
L0, M0, N0 = 0.401219, 4.963070, -0.2;
L1, M1, N1 = 0.024955, 1.248089, -8.
- Parameters
- Tfloat
Temperature at which to calculate the value, [-]
- Returns
- a_alphafloat
Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
Notes
This method does not alter the object’s state and the temperature provided can be a different than that of the object.
- class thermo.eos_alpha_functions.TwuSRK95_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate \(a \alpha\) and its first and second derivatives for the Twu alpha function.
a_alpha_pure
(T)Method to calculate \(a \alpha\) for the Twu alpha function.
a_alpha_and_derivatives_vectorized
a_alphas_vectorized
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate \(a \alpha\) and its first and second derivatives for the Twu alpha function. Uses the set values of Tc, omega and a.
\[\alpha = \alpha^{(0)} + \omega(\alpha^{(1)}-\alpha^{(0)}) \]\[\alpha^{(i)} = T_r^{N(M-1)}\exp[L(1-T_r^{NM})] \]For sub-critical conditions:
L0, M0, N0 = 0.141599, 0.919422, 2.496441
L1, M1, N1 = 0.500315, 0.799457, 3.291790
For supercritical conditions:
L0, M0, N0 = 0.441411, 6.500018, -0.20
L1, M1, N1 = 0.032580, 1.289098, -8.0
- Parameters
- Tfloat
Temperature at which to calculate the values, [-]
- Returns
- a_alphafloat
Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
- da_alpha_dTfloat
Temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K]
- d2a_alpha_dT2float
Second temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K^2]
Notes
This method does not alter the object’s state and the temperature provided can be a different than that of the object.
The derivatives are somewhat long and are not described here for brevity; they are obtainable from the following SymPy expression.
>>> from sympy import * >>> T, Tc, omega, N1, N0, M1, M0, L1, L0 = symbols('T, Tc, omega, N1, N0, M1, M0, L1, L0') >>> Tr = T/Tc >>> alpha0 = Tr**(N0*(M0-1))*exp(L0*(1-Tr**(N0*M0))) >>> alpha1 = Tr**(N1*(M1-1))*exp(L1*(1-Tr**(N1*M1))) >>> alpha = alpha0 + omega*(alpha1-alpha0) >>> diff(alpha, T) >>> diff(alpha, T, T)
- a_alpha_pure(T)[source]¶
Method to calculate \(a \alpha\) for the Twu alpha function. Uses the set values of Tc, omega and a.
\[\alpha = \alpha^{(0)} + \omega(\alpha^{(1)}-\alpha^{(0)}) \]\[\alpha^{(i)} = T_r^{N(M-1)}\exp[L(1-T_r^{NM})] \]For sub-critical conditions:
L0, M0, N0 = 0.141599, 0.919422, 2.496441
L1, M1, N1 = 0.500315, 0.799457, 3.291790
For supercritical conditions:
L0, M0, N0 = 0.441411, 6.500018, -0.20
L1, M1, N1 = 0.032580, 1.289098, -8.0
- Parameters
- Tfloat
Temperature at which to calculate the value, [-]
- Returns
- a_alphafloat
Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
Notes
This method does not alter the object’s state and the temperature provided can be a different than that of the object.
- class thermo.eos_alpha_functions.Yu_Lu_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate a_alpha and its first and second derivatives according to Yu and Lu (1987) [1].
a_alpha_pure
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate a_alpha and its first and second derivatives according to Yu and Lu (1987) [1]. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Four coefficients needed.
\[\alpha = 10^{c_{4} \left(- \frac{T}{T_{c,i}} + 1\right) \left( \frac{T^{2} c_{3}}{Tc^{2}} + \frac{T c_{2}}{T_{c,i}} + c_{1}\right)} \]References