Cubic Equation of State Alpha Functions (thermo.eos_alpha_functions)¶
This module contains implementations of the calculation of pure-component EOS 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.
- Parameters
- T
float
Temperature, [K]
- Tcs
list
[float
] Critical temperatures of components, [K]
- ais
list
[float
] a parameters of cubic EOS, , [Pa*m^6/mol^2]
- kappas
list
[float
] kappa parameters of Peng-Robinson EOS; formulas vary, but the original form uses , [-]
- a_alphas
list
[float
],optional
Vector for pure component a_alpha terms in the cubic EOS to be calculated and stored in, [Pa*m^6/mol^2]
- T
- Returns
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.
- Parameters
- Returns
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.
- Parameters
- Returns
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.
- Parameters
- T
float
Temperature, [K]
- Tcs
list
[float
] Critical temperatures of components, [K]
- ais
list
[float
] a parameters of cubic EOS, , [Pa*m^6/mol^2]
- kappa0s
list
[float
] kappa0 parameters of PRSV EOS; the original form uses , [-]
- kappa1s
list
[float
] Fit parameters, can be set to 0 if unknown [-]
- kappa2s
list
[float
] Fit parameters, can be set to 0 if unknown [-]
- kappa3s
list
[float
] Fit parameters, can be set to 0 if unknown [-]
- T
- Returns
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.
- Parameters
- Returns
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.
- Parameters
- Returns
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.
- Parameters
- Returns
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.
- Parameters
- Returns
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.
- Parameters
- Returns
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.
- Parameters
- T
float
Temperature, [K]
- Tcs
list
[float
] Critical temperatures of components, [K]
- ais
list
[float
] a parameters of cubic EOS, , [Pa*m^6/mol^2]
- kappa0s
list
[float
] kappa0 parameters of PRSV EOS; the original form uses , [-]
- kappa1s
list
[float
] Fit parameters, can be set to 0 if unknown [-]
- kappa2s
list
[float
] Fit parameters, can be set to 0 if unknown [-]
- kappa3s
list
[float
] Fit parameters, can be set to 0 if unknown [-]
- T
- Returns
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.
- Parameters
- Returns
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.
- Parameters
- Returns
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
- 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
- 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.
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.
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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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 .
a_alpha_pure
(T)Method to calculate a_alpha given that there is a polynomial equation for .
- 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 .
- Parameters
- T
float
Temperature, [K]
- T
- Returns
- a_alphas
list
[float
] Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
- da_alpha_dTs
list
[float
] Temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K]
- d2a_alpha_dT2s
list
[float
] Second temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K**2]
- a_alphas
- 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
- 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
- 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.
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
- 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.
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
- 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
- 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.
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.
- Parameters
- T
float
Temperature, [K]
- T
- Returns
- a_alphas
list
[float
] Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
- da_alpha_dTs
list
[float
] Temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K]
- d2a_alpha_dT2s
list
[float
] Second temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K**2]
- a_alphas
- class thermo.eos_alpha_functions.TwuPR95_a_alpha[source]¶
Bases:
thermo.eos_alpha_functions.a_alpha_base
Methods
Method to calculate and its first and second derivatives for the Twu alpha function.
a_alpha_pure
(T)Method to calculate for the Twu alpha function.
a_alpha_and_derivatives_vectorized
a_alphas_vectorized
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate and its first and second derivatives for the Twu alpha function. Uses the set values of Tc, omega and a.
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
- T
float
Temperature at which to calculate the values, [-]
- T
- Returns
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 for the Twu alpha function. Uses the set values of Tc, omega and a.
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
- T
float
Temperature at which to calculate the value, [-]
- T
- Returns
- a_alpha
float
Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
- a_alpha
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 and its first and second derivatives for the Twu alpha function.
a_alpha_pure
(T)Method to calculate for the Twu alpha function.
a_alpha_and_derivatives_vectorized
a_alphas_vectorized
- a_alpha_and_derivatives_pure(T)[source]¶
Method to calculate and its first and second derivatives for the Twu alpha function. Uses the set values of Tc, omega and a.
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
- T
float
Temperature at which to calculate the values, [-]
- T
- Returns
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 for the Twu alpha function. Uses the set values of Tc, omega and a.
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
- T
float
Temperature at which to calculate the value, [-]
- T
- Returns
- a_alpha
float
Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
- a_alpha
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