eos¶
Data and methods related to equations of state.
-
class
thermosteam.properties.eos.
GCEOS
[source]¶ Class for solving a generic Pressure-explicit three-parameter cubic equation of state. Does not implement any parameters itself; must be subclassed by an equation of state class which uses it. Works for mixtures or pure species for all properties except fugacity. All properties are derived with the CAS SymPy, not relying on any derivations previously published.
\[P=\frac{RT}{V-b}-\frac{a\alpha(T)}{V^2 + \delta V + \epsilon}\]Main methods (in order they are called) are solve, set_from_PT, volume_solutions, set_properties_from_solution, and derivatives_and_departures.
solve calls check_sufficient_input, which checks if two of T, P, and V were set. It then solves for the remaining variable. If T is missing, method solve_T is used; it is parameter specific, and so must be implemented in each specific EOS. If P is missing, it is directly calculated. If V is missing, it is calculated with the method volume_solutions. At this point, either three possible volumes or one user specified volume are known. The value of a_alpha, and its first and second temperature derivative are calculated with the EOS-specific method a_alpha_and_derivatives.
If V is not provided, volume_solutions calculates the three possible molar volumes which are solutions to the EOS; in the single-phase region, only one solution is real and correct. In the two-phase region, all volumes are real, but only the largest and smallest solution are physically meaningful, with the largest being that of the gas and the smallest that of the liquid.
set_from_PT is called to sort out the possible molar volumes. For the case of a user-specified V, the possibility of there existing another solution is ignored for speed. If there is only one real volume, the method set_properties_from_solution is called with it. If there are two real volumes, set_properties_from_solution is called once with each volume. The phase is returned by set_properties_from_solution, and the volumes is set to either V_l or V_g as appropriate.
set_properties_from_solution is a beast which calculates all relevant partial derivatives and properties of the EOS. 15 derivatives and excess enthalpy and entropy are calculated first. If the method was called with the quick flag, the method derivatives_and_departures uses a mess derived with SymPy’s cse function to perform the calculation as quickly as possible. Otherwise, the independent formulas for each property are used.
set_properties_from_solution next calculates beta (isobaric expansion coefficient), kappa (isothermal compressibility), Cp_minus_Cv, Cv_dep, Cp_dep, V_dep molar volume departure, U_dep internal energy departure, G_dep Gibbs energy departure, A_dep Helmholtz energy departure, fugacity, and phi (fugacity coefficient). It then calculates PIP or phase identification parameter, and determines the fluid phase with it. Finally, it sets all these properties as attibutes or either the liquid or gas phase with the convention of adding on _l or _g to the variable names.
-
check_sufficient_inputs
()[source]¶ Method to an exception if none of the pairs (T, P), (T, V), or (P, V) are given.
-
solve
()[source]¶ First EOS-generic method; should be called by all specific EOSs. For solving for T, the EOS must provide the method solve_T. For all cases, the EOS must provide a_alpha_and_derivatives. Calls set_from_PT once done.
-
set_from_PT
(Vs)[source]¶ Counts the number of real volumes in Vs, and determines what to do. If there is only one real volume, the method set_properties_from_solution is called with it. If there are two real volumes, set_properties_from_solution is called once with each volume. The phase is returned by set_properties_from_solution, and the volumes is set to either V_l or V_g as appropriate.
- Parameters
Vs (list[float]) – Three possible molar volumes, [m^3/mol]
-
set_properties_from_solution
(T, P, V, b, delta, epsilon, a_alpha, da_alpha_dT, d2a_alpha_dT2, quick=True)[source]¶ Sets all interesting properties which can be calculated from an EOS alone. Determines which phase the fluid is on its own; for details, see phase_identification_parameter.
The list of properties set is as follows, with all properties suffixed with ‘_l’ or ‘_g’.
dP_dT, dP_dV, dV_dT, dV_dP, dT_dV, dT_dP, d2P_dT2, d2P_dV2, d2V_dT2, d2V_dP2, d2T_dV2, d2T_dP2, d2V_dPdT, d2P_dTdV, d2T_dPdV, H_dep, S_dep, beta, kappa, Cp_minus_Cv, V_dep, U_dep, G_dep, A_dep, fugacity, phi, and PIP.
- Parameters
T (float) – Temperature, [K]
P (float) – Pressure, [Pa]
V (float) – Molar volume, [m^3/mol]
b (float) – Coefficient calculated by EOS-specific method, [m^3/mol]
delta (float) – Coefficient calculated by EOS-specific method, [m^3/mol]
epsilon (float) – Coefficient calculated by EOS-specific method, [m^6/mol^2]
a_alpha (float) – Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
da_alpha_dT (float) – Temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K]
d2a_alpha_dT2 (float) – Second temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K**2]
quick (bool, optional) – Whether to use a SymPy cse-derived expression (3x faster) or individual formulas
- Returns
phase – Either ‘l’ or ‘g’
- Return type
str
Notes
The individual formulas for the derivatives and excess properties are as follows. For definitions of beta, see isobaric_expansion; for kappa, see isothermal_compressibility; for Cp_minus_Cv, see Cp_minus_Cv; for phase_identification_parameter, see phase_identification_parameter.
First derivatives; in part using the Triple Product Rule [2]_, [3]_:
\[ \begin{align}\begin{aligned}\left(\frac{\partial P}{\partial T}\right)_V = \frac{R}{V - b} - \frac{a \frac{d \alpha{\left (T \right )}}{d T}}{V^{2} + V \delta + \epsilon}\\\left(\frac{\partial P}{\partial V}\right)_T = - \frac{R T}{\left( V - b\right)^{2}} - \frac{a \left(- 2 V - \delta\right) \alpha{ \left (T \right )}}{\left(V^{2} + V \delta + \epsilon\right)^{2}}\\\left(\frac{\partial V}{\partial T}\right)_P =-\frac{ \left(\frac{\partial P}{\partial T}\right)_V}{ \left(\frac{\partial P}{\partial V}\right)_T}\\\left(\frac{\partial V}{\partial P}\right)_T =-\frac{ \left(\frac{\partial V}{\partial T}\right)_P}{ \left(\frac{\partial P}{\partial T}\right)_V}\\\left(\frac{\partial T}{\partial V}\right)_P = \frac{1} {\left(\frac{\partial V}{\partial T}\right)_P}\\\left(\frac{\partial T}{\partial P}\right)_V = \frac{1} {\left(\frac{\partial P}{\partial T}\right)_V}\end{aligned}\end{align} \]Second derivatives with respect to one variable; those of T and V use identities shown in [1]_ and verified numerically:
\[ \begin{align}\begin{aligned}\left(\frac{\partial^2 P}{\partial T^2}\right)_V = - \frac{a \frac{d^{2} \alpha{\left (T \right )}}{d T^{2}}}{V^{2} + V \delta + \epsilon}\\\left(\frac{\partial^2 P}{\partial V^2}\right)_T = 2 \left(\frac{ R T}{\left(V - b\right)^{3}} - \frac{a \left(2 V + \delta\right)^{ 2} \alpha{\left (T \right )}}{\left(V^{2} + V \delta + \epsilon \right)^{3}} + \frac{a \alpha{\left (T \right )}}{\left(V^{2} + V \delta + \epsilon\right)^{2}}\right)\\\left(\frac{\partial^2 T}{\partial P^2}\right)_V = -\left(\frac{ \partial^2 P}{\partial T^2}\right)_V \left(\frac{\partial P}{ \partial T}\right)^{-3}_V\\\left(\frac{\partial^2 V}{\partial P^2}\right)_T = -\left(\frac{ \partial^2 P}{\partial V^2}\right)_T \left(\frac{\partial P}{ \partial V}\right)^{-3}_T\\\left(\frac{\partial^2 T}{\partial V^2}\right)_P = -\left[ \left(\frac{\partial^2 P}{\partial V^2}\right)_T \left(\frac{\partial P}{\partial T}\right)_V - \left(\frac{\partial P}{\partial V}\right)_T \left(\frac{\partial^2 P}{\partial T \partial V}\right) \right] \left(\frac{\partial P}{\partial T}\right)^{-2}_V + \left[\left(\frac{\partial^2 P}{\partial T\partial V}\right) \left(\frac{\partial P}{\partial T}\right)_V - \left(\frac{\partial P}{\partial V}\right)_T \left(\frac{\partial^2 P}{\partial T^2}\right)_V\right] \left(\frac{\partial P}{\partial T}\right)_V^{-3} \left(\frac{\partial P}{\partial V}\right)_T\\\left(\frac{\partial^2 V}{\partial T^2}\right)_P = -\left[ \left(\frac{\partial^2 P}{\partial T^2}\right)_V \left(\frac{\partial P}{\partial V}\right)_T - \left(\frac{\partial P}{\partial T}\right)_V \left(\frac{\partial^2 P}{\partial T \partial V}\right) \right] \left(\frac{\partial P}{\partial V}\right)^{-2}_T + \left[\left(\frac{\partial^2 P}{\partial T\partial V}\right) \left(\frac{\partial P}{\partial V}\right)_T - \left(\frac{\partial P}{\partial T}\right)_V \left(\frac{\partial^2 P}{\partial V^2}\right)_T\right] \left(\frac{\partial P}{\partial V}\right)_T^{-3} \left(\frac{\partial P}{\partial T}\right)_V\end{aligned}\end{align} \]Second derivatives with respect to the other two variables; those of T and V use identities shown in [1]_ and verified numerically:
\[ \begin{align}\begin{aligned}\left(\frac{\partial^2 P}{\partial T \partial V}\right) = - \frac{ R}{\left(V - b\right)^{2}} + \frac{a \left(2 V + \delta\right) \frac{d \alpha{\left (T \right )}}{d T}}{\left(V^{2} + V \delta + \epsilon\right)^{2}}\\\left(\frac{\partial^2 T}{\partial P\partial V}\right) = - \left[\left(\frac{\partial^2 P}{\partial T \partial V}\right) \left(\frac{\partial P}{\partial T}\right)_V - \left(\frac{\partial P}{\partial V}\right)_T \left(\frac{\partial^2 P}{\partial T^2}\right)_V \right]\left(\frac{\partial P}{\partial T}\right)_V^{-3}\\ \left(\frac{\partial^2 V}{\partial T\partial P}\right) = - \left[\left(\frac{\partial^2 P}{\partial T \partial V}\right) \left(\frac{\partial P}{\partial V}\right)_T - \left(\frac{\partial P}{\partial T}\right)_V \left(\frac{\partial^2 P}{\partial V^2}\right)_T \right]\left(\frac{\partial P}{\partial V}\right)_T^{-3}\end{aligned}\end{align} \]Excess properties
\[ \begin{align}\begin{aligned}H_{dep} = \int_{\infty}^V \left[T\frac{\partial P}{\partial T}_V - P\right]dV + PV - RT= P V - R T + \frac{2}{\sqrt{ \delta^{2} - 4 \epsilon}} \left(T a \frac{d \alpha{\left (T \right )}}{d T} - a \alpha{\left (T \right )}\right) \operatorname{atanh} {\left (\frac{2 V + \delta}{\sqrt{\delta^{2} - 4 \epsilon}} \right)}\\S_{dep} = \int_{\infty}^V\left[\frac{\partial P}{\partial T} - \frac{R}{V}\right] dV + R\log\frac{PV}{RT} = - R \log{\left (V \right )} + R \log{\left (\frac{P V}{R T} \right )} + R \log{\left (V - b \right )} + \frac{2 a \frac{d\alpha{\left (T \right )}}{d T} }{\sqrt{\delta^{2} - 4 \epsilon}} \operatorname{atanh}{\left (\frac {2 V + \delta}{\sqrt{\delta^{2} - 4 \epsilon}} \right )}\\V_{dep} = V - \frac{RT}{P}\\U_{dep} = H_{dep} - P V_{dep}\\G_{dep} = H_{dep} - T S_{dep}\\A_{dep} = U_{dep} - T S_{dep}\\\text{fugacity} = P\exp\left(\frac{G_{dep}}{RT}\right)\\\phi = \frac{\text{fugacity}}{P}\\C_{v, dep} = T\int_\infty^V \left(\frac{\partial^2 P}{\partial T^2}\right) dV = - T a \left(\sqrt{\frac{1}{\delta^{2} - 4 \epsilon}} \log{\left (V - \frac{\delta^{2}}{2} \sqrt{\frac{1}{ \delta^{2} - 4 \epsilon}} + \frac{\delta}{2} + 2 \epsilon \sqrt{ \frac{1}{\delta^{2} - 4 \epsilon}} \right )} - \sqrt{\frac{1}{ \delta^{2} - 4 \epsilon}} \log{\left (V + \frac{\delta^{2}}{2} \sqrt{\frac{1}{\delta^{2} - 4 \epsilon}} + \frac{\delta}{2} - 2 \epsilon \sqrt{\frac{1}{\delta^{2} - 4 \epsilon}} \right )} \right) \frac{d^{2} \alpha{\left (T \right )} }{d T^{2}}\\C_{p, dep} = (C_p-C_v)_{\text{from EOS}} + C_{v, dep} - R\end{aligned}\end{align} \]References
- 1
Thorade, Matthis, and Ali Saadat. “Partial Derivatives of Thermodynamic State Properties for Dynamic Simulation.” Environmental Earth Sciences 70, no. 8 (April 10, 2013): 3497-3503. doi:10.1007/s12665-013-2394-z.
- 2
Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
- 3
Walas, Stanley M. Phase Equilibria in Chemical Engineering. Butterworth-Heinemann, 1985.
-
a_alpha_and_derivatives
(T, full=True, quick=True)[source]¶ Dummy method to calculate a_alpha and its first and second derivatives. Should be implemented with the same function signature in each EOS variant; this only raises a NotImplemented Exception. Should return ‘a_alpha’, ‘da_alpha_dT’, and ‘d2a_alpha_dT2’.
For use in solve_T, returns only a_alpha if full is False.
- Parameters
T (float) – Temperature, [K]
full (bool, optional) – If False, calculates and returns only a_alpha
quick (bool, optional) – Whether to use a SymPy cse-derived expression (3x faster) or individual formulas
- Returns
a_alpha (float) – Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
da_alpha_dT (float) – Temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K]
d2a_alpha_dT2 (float) – Second temperature derivative of coefficient calculated by EOS-specific method, [J^2/mol^2/Pa/K**2]
-
solve_T
(P, V, quick=True)[source]¶ Generic method to calculate T from a specified P and V. Provides SciPy’s newton solver, and iterates to solve the general equation for P, recalculating a_alpha as a function of temperature using a_alpha_and_derivatives each iteration.
- Parameters
P (float) – Pressure, [Pa]
V (float) – Molar volume, [m^3/mol]
quick (bool, optional) – Whether to use a SymPy cse-derived expression (3x faster) or individual formulas - not applicable where a numerical solver is used.
- Returns
T – Temperature, [K]
- Return type
float
-
static
volume_solutions
(T, P, b, delta, epsilon, a_alpha, quick=True)[source]¶ Solution of this form of the cubic EOS in terms of volumes. Returns three values, all with some complex part.
- Parameters
T (float) – Temperature, [K]
P (float) – Pressure, [Pa]
b (float) – Coefficient calculated by EOS-specific method, [m^3/mol]
delta (float) – Coefficient calculated by EOS-specific method, [m^3/mol]
epsilon (float) – Coefficient calculated by EOS-specific method, [m^6/mol^2]
a_alpha (float) – Coefficient calculated by EOS-specific method, [J^2/mol^2/Pa]
quick (bool, optional) – Whether to use a SymPy cse-derived expression (3x faster) or individual formulas
- Returns
Vs – Three possible molar volumes, [m^3/mol]
- Return type
list[float]
Notes
Using explicit formulas, as can be derived in the following example, is faster than most numeric root finding techniques, and finds all values explicitly. It takes several seconds.
>>> from sympy import * >>> P, T, V, R, b, a, delta, epsilon, alpha = symbols('P, T, V, R, b, a, delta, epsilon, alpha') >>> Tc, Pc, omega = symbols('Tc, Pc, omega') >>> CUBIC = R*T/(V-b) - a*alpha/(V*V + delta*V + epsilon) - P >>> #solve(CUBIC, V)
-
Psat
(T, polish=False)[source]¶ Generic method to calculate vapor pressure for a specified T.
From Tc to 0.32Tc, uses a 10th order polynomial of the following form:
\[\ln\frac{P_r}{T_r} = \sum_{k=0}^{10} C_k\left(\frac{\alpha}{T_r} -1\right)^{k}\]If polish is True, SciPy’s newton solver is launched with the calculated vapor pressure as an initial guess in an attempt to get more accuracy. This may not converge however.
Results above the critical temperature are meaningless. A first-order polynomial is used to extrapolate under 0.32 Tc; however, there is normally not a volume solution to the EOS which can produce that low of a pressure.
- Parameters
T (float) – Temperature, [K]
polish (bool, optional) – Whether to attempt to use a numerical solver to make the solution more precise or not
- Returns
Psat – Vapor pressure, [Pa]
- Return type
float
Notes
EOSs sharing the same b, delta, and epsilon have the same coefficient sets.
All coefficients were derived with numpy’s polyfit. The intersection between the polynomials is continuous, but there is a step change in its derivative.
Form for the regression is inspired from [1]_.
References
- 1
Soave, G. “Direct Calculation of Pure-Compound Vapour Pressures through Cubic Equations of State.” Fluid Phase Equilibria 31, no. 2 (January 1, 1986): 203-7. doi:10.1016/0378-3812(86)90013-0.
-
dPsat_dT
(T)[source]¶ Generic method to calculate the temperature derivative of vapor pressure for a specified T. Implements the analytical derivative of the two polynomials described in Psat.
As with Psat, results above the critical temperature are meaningless. The first-order polynomial which is used to calculate it under 0.32 Tc may not be physicall meaningful, due to there normally not being a volume solution to the EOS which can produce that low of a pressure.
- Parameters
T (float) – Temperature, [K]
- Returns
dPsat_dT – Derivative of vapor pressure with respect to temperature, [Pa/K]
- Return type
float
Notes
There is a small step change at 0.32 Tc for all EOS due to the two switch between polynomials at that point.
Useful for calculating enthalpy of vaporization with the Clausius Clapeyron Equation. Derived with SymPy’s diff and cse.
-
V_l_sat
(T)[source]¶ Method to calculate molar volume of the liquid phase along the saturation line.
- Parameters
T (float) – Temperature, [K]
- Returns
V_l_sat – Liquid molar volume along the saturation line, [m^3/mol]
- Return type
float
Notes
Computers Psat, and then uses volume_solutions to obtain the three possible molar volumes. The lowest value is returned.
-
V_g_sat
(T)[source]¶ Method to calculate molar volume of the vapor phase along the saturation line.
- Parameters
T (float) – Temperature, [K]
- Returns
V_g_sat – Gas molar volume along the saturation line, [m^3/mol]
- Return type
float
Notes
Computers Psat, and then uses volume_solutions to obtain the three possible molar volumes. The highest value is returned.
-
Hvap
(T)[source]¶ Method to calculate enthalpy of vaporization for a pure fluid from an equation of state, without iteration.
\[\frac{dP^{sat}}{dT}=\frac{\Delta H_{vap}}{T(V_g - V_l)}\]Results above the critical temperature are meaningless. A first-order polynomial is used to extrapolate under 0.32 Tc; however, there is normally not a volume solution to the EOS which can produce that low of a pressure.
- Parameters
T (float) – Temperature, [K]
- Returns
Hvap – Increase in enthalpy needed for vaporization of liquid phase along the saturation line, [J/mol]
- Return type
float
Notes
Calculates vapor pressure and its derivative with Psat and dPsat_dT as well as molar volumes of the saturation liquid and vapor phase in the process.
Very near the critical point this provides unrealistic results due to Psat’s polynomials being insufficiently accurate.
References
- 1
Walas, Stanley M. Phase Equilibria in Chemical Engineering. Butterworth-Heinemann, 1985.
-
-
class
thermosteam.properties.eos.
ALPHA_FUNCTIONS
[source]¶ Basic class with a number of attached alpha functions for different applications, all of which have no parameters attached. These alpha functions should be used for fitting purposes; new EOSs should have their alpha functions added here. The first and second derivatives should also be implemented. Efficient implementations are discouraged but possible.
All parameters should be in self.alpha_function_coeffs. This object is inspired by the work of [1]_, where most of the alpha functions have been found.
Examples
Swap out the default alpha function from the SRK EOS, replace it the same, a new method that takes a manually specified coefficient.
>>> eos = SRK(Tc=507.6, Pc=3025000, omega=0.2975, T=299., P=1E6) >>> [eos.m, eos.a_alpha_and_derivatives(299)] [0.9326878999999999, (3.7271789178606376, -0.007332989159328508, 1.947612023379061e-05)]
>>> class SRK_Soave_1972(SRK): ... a_alpha_and_derivatives = ALPHA_FUNCTIONS.Soave_1972 >>> SRK_Soave_1972.alpha_function_coeffs = [0.9326878999999999] >>> a = SRK_Soave_1972(Tc=507.6, Pc=3025000, omega=0.2975, T=299., P=1E6) >>> a.a_alpha_and_derivatives(299) (3.7271789178606376, -0.007332989159328508, 1.947612023379061e-05)
References
- 1
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.
-
static
Soave_1972
(self, T, full=True, quick=True)[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_function_coeffs to be set. One coefficient needed.
\[\alpha = \left(c_{1} \left(- \sqrt{\frac{T}{Tc}} + 1\right) + 1\right)^{2}\]References
- 1
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.
-
static
Heyen
(self, T, full=True, quick=True)[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}{Tc}\right)^{c_{2}} + 1\right)}\]References
- 1
Heyen, G. Liquid and Vapor Properties from a Cubic Equation of State. In “Proceedings of the 2nd International Conference on Phase Equilibria and Fluid Properties in the Chemical Industry”. DECHEMA: Frankfurt, 1980; p 9-13.
-
static
Harmens_Knapp
(self, T, full=True, quick=True)[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}{Tc}} + 1\right) - c_{2} \left(1 - \frac{Tc}{T}\right) + 1\right)^{2}\]References
- 1
Harmens, A., and H. Knapp. “Three-Parameter Cubic Equation of State for Normal Substances.” Industrial & Engineering Chemistry Fundamentals 19, no. 3 (August 1, 1980): 291-94. doi:10.1021/i160075a010.
-
static
Mathias
(self, T, full=True, quick=True)[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}{Tc}} + 1\right) - c_{2} \left(- \frac{T}{Tc} + 0.7\right) \left(- \frac{T}{Tc} + 1\right) + 1\right)^{2}\]References
- 1
Mathias, Paul M. “A Versatile Phase Equilibrium Equation of State.” Industrial & Engineering Chemistry Process Design and Development 22, no. 3 (July 1, 1983): 385-91. doi:10.1021/i200022a008.
-
static
Mathias_Copeman
(self, T, full=True, quick=True)[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}{Tc}} + 1\right) + c_{2} \left(- \sqrt{\frac{T}{Tc}} + 1\right)^{2} + c_{3} \left( - \sqrt{\frac{T}{Tc}} + 1\right)^{3} + 1\right)^{2}\]References
- 1
Mathias, Paul M., and Thomas W. Copeman. “Extension of the Peng-Robinson Equation of State to Complex Mixtures: Evaluation of the Various Forms of the Local Composition Concept.” Fluid Phase Equilibria 13 (January 1, 1983): 91-108. doi:10.1016/0378-3812(83)80084-3.
-
static
Gibbons_Laughton
(self, T, full=True, quick=True)[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}{Tc} - 1\right) + c_{2} \left(\sqrt{\frac{T}{Tc}} - 1\right) + 1\]References
- 1
Gibbons, Richard M., and Andrew P. Laughton. “An Equation of State for Polar and Non-Polar Substances and Mixtures” 80, no. 9 (January 1, 1984): 1019-38. doi:10.1039/F29848001019.
-
static
Soave_1984
(self, T, full=True, quick=True)[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}{Tc} + 1\right) + c_{2} \left(-1 + \frac{Tc}{T}\right) + 1\]References
- 1
Soave, G. “Improvement of the Van Der Waals Equation of State.” Chemical Engineering Science 39, no. 2 (January 1, 1984): 357-69. doi:10.1016/0009-2509(84)80034-2.
-
static
Yu_Lu
(self, T, full=True, quick=True)[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}{Tc} + 1\right) \left( \frac{T^{2} c_{3}}{Tc^{2}} + \frac{T c_{2}}{Tc} + c_{1}\right)}\]References
- 1
Yu, Jin-Min, and Benjamin C. -Y. Lu. “A Three-Parameter Cubic Equation of State for Asymmetric Mixture Density Calculations.” Fluid Phase Equilibria 34, no. 1 (January 1, 1987): 1-19. doi:10.1016/0378-3812(87)85047-1.
-
static
Trebble_Bishnoi
(self, T, full=True, quick=True)[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}{Tc} + 1\right)}\]References
- 1
Trebble, M. A., and P. R. Bishnoi. “Development of a New Four- Parameter Cubic Equation of State.” Fluid Phase Equilibria 35, no. 1 (September 1, 1987): 1-18. doi:10.1016/0378-3812(87)80001-8.
-
static
Melhem
(self, T, full=True, quick=True)[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}{Tc} + 1\right) + c_{2} \left(- \sqrt{\frac{T}{Tc}} + 1\right)^{2}}\]References
- 1
Melhem, Georges A., Riju Saini, and Bernard M. Goodwin. “A Modified Peng-Robinson Equation of State.” Fluid Phase Equilibria 47, no. 2 (August 1, 1989): 189-237. doi:10.1016/0378-3812(89)80176-1.
-
static
Androulakis
(self, T, full=True, quick=True)[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}{Tc}\right)^{\frac{2}{3}} + 1\right) + c_{2} \left(- \left(\frac{T}{Tc}\right)^{\frac{2}{3}} + 1\right)^{2} + c_{3} \left(- \left(\frac{T}{Tc}\right)^{ \frac{2}{3}} + 1\right)^{3} + 1\]References
- 1
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.
-
static
Schwartzentruber
(self, T, full=True, quick=True)[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}{Tc}} + 1\right) - \left(- \sqrt{\frac{T}{Tc}} + 1\right) \left(\frac{T^{2} c_{3}} {Tc^{2}} + \frac{T c_{2}}{Tc} + c_{1}\right) + 1\right)^{2}\]References
- 1
J. Schwartzentruber, H. Renon, and S. Watanasiri, “K-values for Non-Ideal Systems:An Easier Way,” Chem. Eng., March 1990, 118-124.
-
static
Almeida
(self, T, full=True, quick=True)[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}{Tc} + 1\right) \left|{ \frac{T}{Tc} - 1}\right|^{c_{2} - 1} + c_{3} \left(-1 + \frac{Tc}{T}\right)}\]References
- 1
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.
-
static
Twu
(self, T, full=True, quick=True)[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}{Tc}\right)^{c_{3} \left(c_{2} - 1\right)} e^{c_{1} \left(- \left(\frac{T}{Tc} \right)^{c_{2} c_{3}} + 1\right)}\]References
- 1
Twu, Chorng H., David Bluck, John R. Cunningham, and John E. Coon. “A Cubic Equation of State with a New Alpha Function and a New Mixing Rule.” Fluid Phase Equilibria 69 (December 10, 1991): 33-50. doi:10.1016/0378-3812(91)90024-2.
-
static
Soave_1993
(self, T, full=True, quick=True)[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}{Tc} + 1\right) + c_{2} \left(- \sqrt{\frac{T}{Tc}} + 1\right)^{2} + 1\]References
- 1
Soave, G. “Improving the Treatment of Heavy Hydrocarbons by the SRK EOS.” Fluid Phase Equilibria 84 (April 1, 1993): 339-42. doi:10.1016/0378-3812(93)85131-5.
-
static
Gasem
(self, T, full=True, quick=True)[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}{Tc}\right)^{c_{3}} + 1\right) \left(\frac{T c_{2}}{Tc} + c_{1}\right)}\]References
- 1
Gasem, K. A. M, W Gao, Z Pan, and R. L Robinson Jr. “A Modified Temperature Dependence for the Peng-Robinson Equation of State.” Fluid Phase Equilibria 181, no. 1–2 (May 25, 2001): 113-25. doi:10.1016/S0378-3812(01)00488-5.
-
static
Coquelet
(self, T, full=True, quick=True)[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}{Tc} + 1\right) \left(c_{2} \left(- \sqrt{\frac{T}{Tc}} + 1\right)^{2} + c_{3} \left(- \sqrt{\frac{T}{Tc}} + 1\right)^{3} + 1\right)^{2}}\]References
- 1
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.
-
static
Haghtalab
(self, T, full=True, quick=True)[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}^{\log{\left (\frac{T}{Tc} \right )}} + 1\right) \left(- \frac{T c_{2}}{Tc} + c_{1}\right)}\]References
- 1
Haghtalab, A., M. J. Kamali, S. H. Mazloumi, and P. Mahmoodi. “A New Three-Parameter Cubic Equation of State for Calculation Physical Properties and Vapor-liquid Equilibria.” Fluid Phase Equilibria 293, no. 2 (June 25, 2010): 209-18. doi:10.1016/j.fluid.2010.03.029.
-
static
Saffari
(self, T, full=True, quick=True)[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}}{Tc} + c_{2} \log{\left (\frac{T}{Tc} \right )} + c_{3} \left(- \sqrt{\frac{T}{Tc}} + 1\right)}\]References
- 1
Saffari, Hamid, and Alireza Zahedi. “A New Alpha-Function for the Peng-Robinson Equation of State: Application to Natural Gas.” Chinese Journal of Chemical Engineering 21, no. 10 (October 1, 2013): 1155-61. doi:10.1016/S1004-9541(13)60581-9.
-
static
Chen_Yang
(self, T, full=True, quick=True)[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}^{\log{\left (\frac{T}{Tc} \right )}} + 1\right) \left(- \frac{T c_{2}}{Tc} + c_{1}\right)}\]References
- 1
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
thermosteam.properties.eos.
PR
(Tc, Pc, omega, T=None, P=None, V=None)[source]¶ Class for solving the Peng-Robinson cubic equation of state for a pure compound. Subclasses CUBIC_EOS, which provides the methods for solving the EOS and calculating its assorted relevant thermodynamic properties. Solves the EOS on initialization.
Implemented methods here are a_alpha_and_derivatives, which calculates a_alpha and its first and second derivatives, and solve_T, which from a specified P and V obtains T.
Two of T, P, and V are needed to solve the EOS.
\[ \begin{align}\begin{aligned}P = \frac{RT}{v-b}-\frac{a\alpha(T)}{v(v+b)+b(v-b)}\\a=0.45724\frac{R^2T_c^2}{P_c}\\ b=0.07780\frac{RT_c}{P_c}\\\alpha(T)=[1+\kappa(1-\sqrt{T_r})]^2\\\kappa=0.37464+1.54226\omega-0.26992\omega^2\end{aligned}\end{align} \]- Parameters
Tc (float) – Critical temperature, [K]
Pc (float) – Critical pressure, [Pa]
omega (float) – Acentric factor, [-]
T (float, optional) – Temperature, [K]
P (float, optional) – Pressure, [Pa]
V (float, optional) – Molar volume, [m^3/mol]
Examples
T-P initialization, and exploring each phase’s properties:
>>> eos = PR(Tc=507.6, Pc=3025000, omega=0.2975, T=400., P=1E6) >>> eos.V_l, eos.V_g (0.00015607313188529268, 0.0021418760907613724) >>> eos.phase 'l/g' >>> eos.H_dep_l, eos.H_dep_g (-26111.868721160878, -3549.2993749373945) >>> eos.S_dep_l, eos.S_dep_g (-58.09842815106099, -6.439449710478305) >>> eos.U_dep_l, eos.U_dep_g (-22942.157933046172, -2365.391545698767) >>> eos.G_dep_l, eos.G_dep_g (-2872.497460736482, -973.5194907460723) >>> eos.A_dep_l, eos.A_dep_g (297.21332737822377, 210.38833849255525) >>> eos.beta_l, eos.beta_g (0.0026933709177837514, 0.01012322391117497) >>> eos.kappa_l, eos.kappa_g (9.33572154382935e-09, 1.9710669809793307e-06) >>> eos.Cp_minus_Cv_l, eos.Cp_minus_Cv_g (48.510145807408, 44.54414603000346) >>> eos.Cv_dep_l, eos.Cp_dep_l (18.89210627002112, 59.08779227742912)
P-T initialization, liquid phase, and round robin trip:
>>> eos = PR(Tc=507.6, Pc=3025000, omega=0.2975, T=299., P=1E6) >>> eos.phase, eos.V_l, eos.H_dep_l, eos.S_dep_l ('l', 0.00013022208100139945, -31134.740290463425, -72.47559475426019)
T-V initialization, liquid phase:
>>> eos = PR(Tc=507.6, Pc=3025000, omega=0.2975, T=299., V=0.00013022208100139953) >>> eos.P, eos.phase (1000000.0000020266, 'l')
P-V initialization at same state:
>>> eos = PR(Tc=507.6, Pc=3025000, omega=0.2975, V=0.00013022208100139953, P=1E6) >>> eos.T, eos.phase (298.99999999999926, 'l')
Notes
The constants in the expresions for a and b are given to full precision in the actual code, as derived in [3]_.
References
- 1
Peng, Ding-Yu, and Donald B. Robinson. “A New Two-Constant Equation of State.” Industrial & Engineering Chemistry Fundamentals 15, no. 1 (February 1, 1976): 59-64. doi:10.1021/i160057a011.
- 2
Robinson, Donald B., Ding-Yu Peng, and Samuel Y-K Chung. “The Development of the Peng - Robinson Equation and Its Application to Phase Equilibrium in a System Containing Methanol.” Fluid Phase Equilibria 24, no. 1 (January 1, 1985): 25-41. doi:10.1016/0378-3812(85)87035-7.
- 3
Privat, R., and J.-N. Jaubert. “PPR78, a Thermodynamic Model for the Prediction of Petroleum Fluid-Phase Behaviour,” 11. EDP Sciences, 2011. doi:10.1051/jeep/201100011.
-
a_alpha_and_derivatives
(T, full=True, quick=True)[source]¶ Method to calculate a_alpha and its first and second derivatives for this EOS. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Uses the set values of Tc, kappa, and a.
For use in solve_T, returns only a_alpha if full is False.
\[ \begin{align}\begin{aligned}a\alpha = a \left(\kappa \left(- \frac{T^{0.5}}{Tc^{0.5}} + 1\right) + 1\right)^{2}\\\frac{d a\alpha}{dT} = - \frac{1.0 a \kappa}{T^{0.5} Tc^{0.5}} \left(\kappa \left(- \frac{T^{0.5}}{Tc^{0.5}} + 1\right) + 1\right)\\\frac{d^2 a\alpha}{dT^2} = 0.5 a \kappa \left(- \frac{1}{T^{1.5} Tc^{0.5}} \left(\kappa \left(\frac{T^{0.5}}{Tc^{0.5}} - 1\right) - 1\right) + \frac{\kappa}{T^{1.0} Tc^{1.0}}\right)\end{aligned}\end{align} \]
-
solve_T
(P, V, quick=True)[source]¶ Method to calculate T from a specified P and V for the PR EOS. Uses Tc, a, b, and kappa as well, obtained from the class’s namespace.
- Parameters
P (float) – Pressure, [Pa]
V (float) – Molar volume, [m^3/mol]
quick (bool, optional) – Whether to use a SymPy cse-derived expression (3x faster) or individual formulas
- Returns
T – Temperature, [K]
- Return type
float
Notes
The exact solution can be derived as follows, and is excluded for breviety.
>>> from sympy import * >>> P, T, V = symbols('P, T, V') >>> Tc, Pc, omega = symbols('Tc, Pc, omega') >>> R, a, b, kappa = symbols('R, a, b, kappa')
>>> a_alpha = a*(1 + kappa*(1-sqrt(T/Tc)))**2 >>> PR_formula = R*T/(V-b) - a_alpha/(V*(V+b)+b*(V-b)) - P >>> #solve(PR_formula, T)
-
class
thermosteam.properties.eos.
PR78
(Tc, Pc, omega, T=None, P=None, V=None)[source]¶ Class for solving the Peng-Robinson cubic equation of state for a pure compound according to the 1978 variant. Subclasses PR, which provides everything except the variable kappa. Solves the EOS on initialization. See PR for further documentation.
\[ \begin{align}\begin{aligned}P = \frac{RT}{v-b}-\frac{a\alpha(T)}{v(v+b)+b(v-b)}\\a=0.45724\frac{R^2T_c^2}{P_c}\\ b=0.07780\frac{RT_c}{P_c}\\\alpha(T)=[1+\kappa(1-\sqrt{T_r})]^2\\\kappa_i = 0.37464+1.54226\omega_i-0.26992\omega_i^2 \text{ if } \omega_i \le 0.491\\\kappa_i = 0.379642 + 1.48503 \omega_i - 0.164423\omega_i^2 + 0.016666 \omega_i^3 \text{ if } \omega_i > 0.491\end{aligned}\end{align} \]- Parameters
Tc (float) – Critical temperature, [K]
Pc (float) – Critical pressure, [Pa]
omega (float) – Acentric factor, [-]
T (float, optional) – Temperature, [K]
P (float, optional) – Pressure, [Pa]
V (float, optional) – Molar volume, [m^3/mol]
Examples
P-T initialization (furfuryl alcohol), liquid phase:
>>> eos = PR78(Tc=632, Pc=5350000, omega=0.734, T=299., P=1E6) >>> eos.phase, eos.V_l, eos.H_dep_l, eos.S_dep_l ('l', 8.351960066075009e-05, -63764.649480508735, -130.73710891262687)
Notes
This variant is recommended over the original.
References
- 1
Robinson, Donald B, and Ding-Yu Peng. The Characterization of the Heptanes and Heavier Fractions for the GPA Peng-Robinson Programs. Tulsa, Okla.: Gas Processors Association, 1978.
- 2
Robinson, Donald B., Ding-Yu Peng, and Samuel Y-K Chung. “The Development of the Peng - Robinson Equation and Its Application to Phase Equilibrium in a System Containing Methanol.” Fluid Phase Equilibria 24, no. 1 (January 1, 1985): 25-41. doi:10.1016/0378-3812(85)87035-7.
-
class
thermosteam.properties.eos.
PRSV
(Tc, Pc, omega, T=None, P=None, V=None, kappa1=0)[source]¶ Class for solving the Peng-Robinson-Stryjek-Vera equations of state for a pure compound as given in [1]_. The same as the Peng-Robinson EOS, except with a different kappa formula and with an optional fit parameter. Subclasses PR, which provides only several constants. See PR for further documentation and examples.
\[ \begin{align}\begin{aligned}P = \frac{RT}{v-b}-\frac{a\alpha(T)}{v(v+b)+b(v-b)}\\a=0.45724\frac{R^2T_c^2}{P_c}\\ b=0.07780\frac{RT_c}{P_c}\\\alpha(T)=[1+\kappa(1-\sqrt{T_r})]^2\\\kappa = \kappa_0 + \kappa_1(1 + T_r^{0.5})(0.7 - T_r)\\\kappa_0 = 0.378893 + 1.4897153\omega - 0.17131848\omega^2 + 0.0196554\omega^3\end{aligned}\end{align} \]- Parameters
Tc (float) – Critical temperature, [K]
Pc (float) – Critical pressure, [Pa]
omega (float) – Acentric factor, [-]
T (float, optional) – Temperature, [K]
P (float, optional) – Pressure, [Pa]
V (float, optional) – Molar volume, [m^3/mol]
kappa1 (float, optional) – Fit parameter; available in [1]_ for over 90 compounds, [-]
Examples
P-T initialization (hexane, with fit parameter in [1]_), liquid phase:
>>> eos = PRSV(Tc=507.6, Pc=3025000, omega=0.2975, T=299., P=1E6, kappa1=0.05104) >>> eos.phase, eos.V_l, eos.H_dep_l, eos.S_dep_l ('l', 0.000130126869448406, -31698.916002476693, -74.16749024350415)
Notes
[1]_ recommends that kappa1 be set to 0 for Tr > 0.7. This is not done by default; the class boolean kappa1_Tr_limit may be set to True and the problem re-solved with that specified if desired. kappa1_Tr_limit is not supported for P-V inputs.
Solutions for P-V solve for T with SciPy’s newton solver, as there is no analytical solution for T
[2]_ and [3]_ are two more resources documenting the PRSV EOS. 4 lists kappa values for 69 additional compounds. See also PRSV2. Note that tabulated kappa values should be used with the critical parameters used in their fits. Both [1]_ and 4 only considered vapor pressure in fitting the parameter.
References
- 1
Stryjek, R., and J. H. Vera. “PRSV: An Improved Peng-Robinson Equation of State for Pure Compounds and Mixtures.” The Canadian Journal of Chemical Engineering 64, no. 2 (April 1, 1986): 323-33. doi:10.1002/cjce.5450640224.
- 2
Stryjek, R., and J. H. Vera. “PRSV - An Improved Peng-Robinson Equation of State with New Mixing Rules for Strongly Nonideal Mixtures.” The Canadian Journal of Chemical Engineering 64, no. 2 (April 1, 1986): 334-40. doi:10.1002/cjce.5450640225.
- 3
Stryjek, R., and J. H. Vera. “Vapor-liquid Equilibrium of Hydrochloric Acid Solutions with the PRSV Equation of State.” Fluid Phase Equilibria 25, no. 3 (January 1, 1986): 279-90. doi:10.1016/0378-3812(86)80004-8.
- 4(1,2)
Proust, P., and J. H. Vera. “PRSV: The Stryjek-Vera Modification of the Peng-Robinson Equation of State. Parameters for Other Pure Compounds of Industrial Interest.” The Canadian Journal of Chemical Engineering 67, no. 1 (February 1, 1989): 170-73. doi:10.1002/cjce.5450670125.
-
solve_T
(P, V, quick=True)[source]¶ Method to calculate T from a specified P and V for the PRSV EOS. Uses Tc, a, b, kappa0 and kappa as well, obtained from the class’s namespace.
- Parameters
P (float) – Pressure, [Pa]
V (float) – Molar volume, [m^3/mol]
quick (bool, optional) – Whether to use a SymPy cse-derived expression (somewhat faster) or individual formulas.
- Returns
T – Temperature, [K]
- Return type
float
Notes
Not guaranteed to produce a solution. There are actually two solution, one much higher than normally desired; it is possible the solver could converge on this.
-
a_alpha_and_derivatives
(T, full=True, quick=True)[source]¶ Method to calculate a_alpha and its first and second derivatives for this EOS. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Uses the set values of Tc, kappa0, kappa1, and a.
For use in root-finding, returns only a_alpha if full is False.
The a_alpha function is shown below; its first and second derivatives are long available through the SymPy expression under it.
\[a\alpha = a \left(\left(\kappa_{0} + \kappa_{1} \left(\sqrt{\frac{ T}{Tc}} + 1\right) \left(- \frac{T}{Tc} + \frac{7}{10}\right) \right) \left(- \sqrt{\frac{T}{Tc}} + 1\right) + 1\right)^{2}\]>>> from sympy import * >>> P, T, V = symbols('P, T, V') >>> Tc, Pc, omega = symbols('Tc, Pc, omega') >>> R, a, b, kappa0, kappa1 = symbols('R, a, b, kappa0, kappa1') >>> kappa = kappa0 + kappa1*(1 + sqrt(T/Tc))*(Rational(7, 10)-T/Tc) >>> a_alpha = a*(1 + kappa*(1-sqrt(T/Tc)))**2 >>> # diff(a_alpha, T) >>> # diff(a_alpha, T, 2)
-
class
thermosteam.properties.eos.
PRSV2
(Tc, Pc, omega, T=None, P=None, V=None, kappa1=0, kappa2=0, kappa3=0)[source]¶ Class for solving the Peng-Robinson-Stryjek-Vera 2 equations of state for a pure compound as given in [1]_. The same as the Peng-Robinson EOS, except with a different kappa formula and with three fit parameters. Subclasses PR, which provides only several constants. See PR for further documentation and examples. PRSV provides only one constant.
\[ \begin{align}\begin{aligned}P = \frac{RT}{v-b}-\frac{a\alpha(T)}{v(v+b)+b(v-b)}\\a=0.45724\frac{R^2T_c^2}{P_c}\\ b=0.07780\frac{RT_c}{P_c}\\\alpha(T)=[1+\kappa(1-\sqrt{T_r})]^2\\\kappa = \kappa_0 + [\kappa_1 + \kappa_2(\kappa_3 - T_r)(1-T_r^{0.5})] (1 + T_r^{0.5})(0.7 - T_r)\\\kappa_0 = 0.378893 + 1.4897153\omega - 0.17131848\omega^2 + 0.0196554\omega^3\end{aligned}\end{align} \]- Parameters
Tc (float) – Critical temperature, [K]
Pc (float) – Critical pressure, [Pa]
omega (float) – Acentric factor, [-]
T (float, optional) – Temperature, [K]
P (float, optional) – Pressure, [Pa]
V (float, optional) – Molar volume, [m^3/mol]
kappa1 (float, optional) – Fit parameter; available in [1]_ for over 90 compounds, [-]
kappa2 (float, optional) – Fit parameter; available in [1]_ for over 90 compounds, [-]
kappa (float, optional) – Fit parameter; available in [1]_ for over 90 compounds, [-]
Examples
P-T initialization (hexane, with fit parameter in [1]_), liquid phase:
>>> eos = PRSV2(Tc=507.6, Pc=3025000, omega=0.2975, T=299., P=1E6, kappa1=0.05104, kappa2=0.8634, kappa3=0.460) >>> eos.phase, eos.V_l, eos.H_dep_l, eos.S_dep_l ('l', 0.00013018821346475235, -31496.173493225797, -73.61525801151421)
Notes
Solutions for P-V solve for T with SciPy’s newton solver, as there is no analytical solution for T
Note that tabulated kappa values should be used with the critical parameters used in their fits. [1]_ considered only vapor pressure in fitting the parameter.
References
- 1
Stryjek, R., and J. H. Vera. “PRSV2: A Cubic Equation of State for Accurate Vapor-liquid Equilibria Calculations.” The Canadian Journal of Chemical Engineering 64, no. 5 (October 1, 1986): 820-26. doi:10.1002/cjce.5450640516.
-
solve_T
(P, V, quick=True)[source]¶ Method to calculate T from a specified P and V for the PRSV2 EOS. Uses Tc, a, b, kappa0, kappa1, kappa2, and kappa3 as well, obtained from the class’s namespace.
- Parameters
P (float) – Pressure, [Pa]
V (float) – Molar volume, [m^3/mol]
quick (bool, optional) – Whether to use a SymPy cse-derived expression (somewhat faster) or individual formulas.
- Returns
T – Temperature, [K]
- Return type
float
Notes
Not guaranteed to produce a solution. There are actually 8 solutions, six with an imaginary component at a tested point. The two temperature solutions are quite far apart, with one much higher than the other; it is possible the solver could converge on the higher solution, so use T inputs with care. This extra solution is a perfectly valid one however.
-
a_alpha_and_derivatives
(T, full=True, quick=True)[source]¶ Method to calculate a_alpha and its first and second derivatives for this EOS. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Uses the set values of Tc, kappa0, kappa1, kappa2, kappa3, and a.
For use in solve_T, returns only a_alpha if full is False.
The first and second derivatives of a_alpha are available through the following SymPy expression.
>>> from sympy import * >>> P, T, V = symbols('P, T, V') >>> Tc, Pc, omega = symbols('Tc, Pc, omega') >>> R, a, b, kappa0, kappa1, kappa2, kappa3 = symbols('R, a, b, kappa0, kappa1, kappa2, kappa3') >>> Tr = T/Tc >>> kappa = kappa0 + (kappa1 + kappa2*(kappa3-Tr)*(1-sqrt(Tr)))*(1+sqrt(Tr))*(Rational('0.7')-Tr) >>> a_alpha = a*(1 + kappa*(1-sqrt(T/Tc)))**2 >>> # diff(a_alpha, T) >>> # diff(a_alpha, T, 2)
-
class
thermosteam.properties.eos.
VDW
(Tc, Pc, T=None, P=None, V=None, omega=None)[source]¶ Class for solving the Van der Waals cubic equation of state for a pure compound. Subclasses CUBIC_EOS, which provides the methods for solving the EOS and calculating its assorted relevant thermodynamic properties. Solves the EOS on initialization.
Implemented methods here are a_alpha_and_derivatives, which sets a_alpha and its first and second derivatives, and solve_T, which from a specified P and V obtains T. main_derivatives_and_departures is a re-implementation with VDW specific methods, as the general solution has ZeroDivisionError errors.
Two of T, P, and V are needed to solve the EOS.
\[ \begin{align}\begin{aligned}P=\frac{RT}{V-b}-\frac{a}{V^2}\\a=\frac{27}{64}\frac{(RT_c)^2}{P_c}\\b=\frac{RT_c}{8P_c}\end{aligned}\end{align} \]- Parameters
Tc (float) – Critical temperature, [K]
Pc (float) – Critical pressure, [Pa]
T (float, optional) – Temperature, [K]
P (float, optional) – Pressure, [Pa]
V (float, optional) – Molar volume, [m^3/mol]
Examples
>>> eos = VDW(Tc=507.6, Pc=3025000, T=299., P=1E6) >>> eos.phase, eos.V_l, eos.H_dep_l, eos.S_dep_l ('l', 0.00022332978038490077, -13385.722837649315, -32.65922018109096)
Notes
omega is allowed as an input for compatibility with the other EOS forms, but is not used.
References
- 1
Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
- 2
Walas, Stanley M. Phase Equilibria in Chemical Engineering. Butterworth-Heinemann, 1985.
-
a_alpha_and_derivatives
(T, full=True, quick=True)[source]¶ Method to calculate a_alpha and its first and second derivatives for this EOS. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Uses the set values of a.
\[ \begin{align}\begin{aligned}a\alpha = a\\\frac{d a\alpha}{dT} = 0\\\frac{d^2 a\alpha}{dT^2} = 0\end{aligned}\end{align} \]
-
solve_T
(P, V)[source]¶ Method to calculate T from a specified P and V for the VDW EOS. Uses a, and b, obtained from the class’s namespace.
\[T = \frac{1}{R V^{2}} \left(P V^{2} \left(V - b\right) + V a - a b\right)\]- Parameters
P (float) – Pressure, [Pa]
V (float) – Molar volume, [m^3/mol]
- Returns
T – Temperature, [K]
- Return type
float
-
static
main_derivatives_and_departures
(T, P, V, b, delta, epsilon, a_alpha, da_alpha_dT, d2a_alpha_dT2, quick=True)[source]¶ Re-implementation of derivatives and excess property calculations, as ZeroDivisionError errors occur with the general solution. The following derivation is the source of these formulas.
>>> from sympy import * >>> P, T, V, R, b, a = symbols('P, T, V, R, b, a') >>> P_vdw = R*T/(V-b) - a/(V*V) >>> vdw = P_vdw - P >>> >>> dP_dT = diff(vdw, T) >>> dP_dV = diff(vdw, V) >>> d2P_dT2 = diff(vdw, T, 2) >>> d2P_dV2 = diff(vdw, V, 2) >>> d2P_dTdV = diff(vdw, T, V) >>> H_dep = integrate(T*dP_dT - P_vdw, (V, oo, V)) >>> H_dep += P*V - R*T >>> S_dep = integrate(dP_dT - R/V, (V,oo,V)) >>> S_dep += R*log(P*V/(R*T)) >>> Cv_dep = T*integrate(d2P_dT2, (V,oo,V)) >>> >>> dP_dT, dP_dV, d2P_dT2, d2P_dV2, d2P_dTdV, H_dep, S_dep, Cv_dep (R/(V - b), -R*T/(V - b)**2 + 2*a/V**3, 0, 2*(R*T/(V - b)**3 - 3*a/V**4), -R/(V - b)**2, P*V - R*T - a/V, R*(-log(V) + log(V - b)) + R*log(P*V/(R*T)), 0)
-
class
thermosteam.properties.eos.
RK
(Tc, Pc, T=None, P=None, V=None, omega=None)[source]¶ Class for solving the Redlich-Kwong cubic equation of state for a pure compound. Subclasses CUBIC_EOS, which provides the methods for solving the EOS and calculating its assorted relevant thermodynamic properties. Solves the EOS on initialization.
Implemented methods here are a_alpha_and_derivatives, which sets a_alpha and its first and second derivatives, and solve_T, which from a specified P and V obtains T.
Two of T, P, and V are needed to solve the EOS.
\[ \begin{align}\begin{aligned}P =\frac{RT}{V-b}-\frac{a}{V\sqrt{T}(V+b)}\\a=\left(\frac{R^2(T_c)^{2.5}}{9(\sqrt[3]{2}-1)P_c} \right) =\frac{0.42748\cdot R^2(T_c)^{2.5}}{P_c}\\b=\left( \frac{(\sqrt[3]{2}-1)}{3}\right)\frac{RT_c}{P_c} =\frac{0.08664\cdot R T_c}{P_c}\end{aligned}\end{align} \]- Parameters
Tc (float) – Critical temperature, [K]
Pc (float) – Critical pressure, [Pa]
T (float, optional) – Temperature, [K]
P (float, optional) – Pressure, [Pa]
V (float, optional) – Molar volume, [m^3/mol]
Examples
>>> eos = RK(Tc=507.6, Pc=3025000, T=299., P=1E6) >>> eos.phase, eos.V_l, eos.H_dep_l, eos.S_dep_l ('l', 0.00015189341729751862, -26160.833620674086, -63.01311649400544)
Notes
omega is allowed as an input for compatibility with the other EOS forms, but is not used.
References
- 1
Redlich, Otto., and J. N. S. Kwong. “On the Thermodynamics of Solutions. V. An Equation of State. Fugacities of Gaseous Solutions.” Chemical Reviews 44, no. 1 (February 1, 1949): 233-44. doi:10.1021/cr60137a013.
- 2
Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
- 3
Walas, Stanley M. Phase Equilibria in Chemical Engineering. Butterworth-Heinemann, 1985.
-
a_alpha_and_derivatives
(T, full=True, quick=True)[source]¶ Method to calculate a_alpha and its first and second derivatives for this EOS. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Uses the set values of a.
\[ \begin{align}\begin{aligned}a\alpha = \frac{a}{\sqrt{T}}\\\frac{d a\alpha}{dT} = - \frac{a}{2 T^{\frac{3}{2}}}\\\frac{d^2 a\alpha}{dT^2} = \frac{3 a}{4 T^{\frac{5}{2}}}\end{aligned}\end{align} \]
-
solve_T
(P, V, quick=True)[source]¶ Method to calculate T from a specified P and V for the RK EOS. Uses a, and b, obtained from the class’s namespace.
- Parameters
P (float) – Pressure, [Pa]
V (float) – Molar volume, [m^3/mol]
quick (bool, optional) – Whether to use a SymPy cse-derived expression (3x faster) or individual formulas
- Returns
T – Temperature, [K]
- Return type
float
Notes
The exact solution can be derived as follows; it is excluded for breviety.
>>> from sympy import * >>> P, T, V, R = symbols('P, T, V, R') >>> Tc, Pc = symbols('Tc, Pc') >>> a, b = symbols('a, b')
>>> RK = Eq(P, R*T/(V-b) - a/sqrt(T)/(V*V + b*V)) >>> # solve(RK, T)
-
class
thermosteam.properties.eos.
SRK
(Tc, Pc, omega, T=None, P=None, V=None)[source]¶ Class for solving the Soave-Redlich-Kwong cubic equation of state for a pure compound. Subclasses CUBIC_EOS, which provides the methods for solving the EOS and calculating its assorted relevant thermodynamic properties. Solves the EOS on initialization.
Implemented methods here are a_alpha_and_derivatives, which sets a_alpha and its first and second derivatives, and solve_T, which from a specified P and V obtains T.
Two of T, P, and V are needed to solve the EOS.
\[ \begin{align}\begin{aligned}P = \frac{RT}{V-b} - \frac{a\alpha(T)}{V(V+b)}\\a=\left(\frac{R^2(T_c)^{2}}{9(\sqrt[3]{2}-1)P_c} \right) =\frac{0.42748\cdot R^2(T_c)^{2}}{P_c}\\b=\left( \frac{(\sqrt[3]{2}-1)}{3}\right)\frac{RT_c}{P_c} =\frac{0.08664\cdot R T_c}{P_c}\\\alpha(T) = \left[1 + m\left(1 - \sqrt{\frac{T}{T_c}}\right)\right]^2\\m = 0.480 + 1.574\omega - 0.176\omega^2\end{aligned}\end{align} \]- Parameters
Tc (float) – Critical temperature, [K]
Pc (float) – Critical pressure, [Pa]
omega (float) – Acentric factor, [-]
T (float, optional) – Temperature, [K]
P (float, optional) – Pressure, [Pa]
V (float, optional) – Molar volume, [m^3/mol]
Examples
>>> eos = SRK(Tc=507.6, Pc=3025000, omega=0.2975, T=299., P=1E6) >>> eos.phase, eos.V_l, eos.H_dep_l, eos.S_dep_l ('l', 0.00014682102759032003, -31754.65309653571, -74.3732468359525)
References
- 1
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
Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
- 3
Walas, Stanley M. Phase Equilibria in Chemical Engineering. Butterworth-Heinemann, 1985.
-
a_alpha_and_derivatives
(T, full=True, quick=True)[source]¶ Method to calculate a_alpha and its first and second derivatives for this EOS. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Uses the set values of Tc, m, and a.
\[ \begin{align}\begin{aligned}a\alpha = a \left(m \left(- \sqrt{\frac{T}{Tc}} + 1\right) + 1\right)^{2}\\\frac{d a\alpha}{dT} = \frac{a m}{T} \sqrt{\frac{T}{Tc}} \left(m \left(\sqrt{\frac{T}{Tc}} - 1\right) - 1\right)\\\frac{d^2 a\alpha}{dT^2} = \frac{a m \sqrt{\frac{T}{Tc}}}{2 T^{2}} \left(m + 1\right)\end{aligned}\end{align} \]
-
solve_T
(P, V, quick=True)[source]¶ Method to calculate T from a specified P and V for the SRK EOS. Uses a, b, and Tc obtained from the class’s namespace.
- Parameters
P (float) – Pressure, [Pa]
V (float) – Molar volume, [m^3/mol]
quick (bool, optional) – Whether to use a SymPy cse-derived expression (3x faster) or individual formulas
- Returns
T – Temperature, [K]
- Return type
float
Notes
The exact solution can be derived as follows; it is excluded for breviety.
>>> from sympy import * >>> P, T, V, R, a, b, m = symbols('P, T, V, R, a, b, m') >>> Tc, Pc, omega = symbols('Tc, Pc, omega') >>> a_alpha = a*(1 + m*(1-sqrt(T/Tc)))**2 >>> SRK = R*T/(V-b) - a_alpha/(V*(V+b)) - P >>> # solve(SRK, T)
-
class
thermosteam.properties.eos.
APISRK
(Tc, Pc, omega=None, T=None, P=None, V=None, S1=None, S2=0)[source]¶ Class for solving the Refinery Soave-Redlich-Kwong cubic equation of state for a pure compound shown in the API Databook [1]_. Subclasses CUBIC_EOS, which provides the methods for solving the EOS and calculating its assorted relevant thermodynamic properties. Solves the EOS on initialization.
Implemented methods here are a_alpha_and_derivatives, which sets a_alpha and its first and second derivatives, and solve_T, which from a specified P and V obtains T. Two fit constants are used in this expresion, with an estimation scheme for the first if unavailable and the second may be set to zero.
Two of T, P, and V are needed to solve the EOS.
\[ \begin{align}\begin{aligned}P = \frac{RT}{V-b} - \frac{a\alpha(T)}{V(V+b)}\\a=\left(\frac{R^2(T_c)^{2}}{9(\sqrt[3]{2}-1)P_c} \right) =\frac{0.42748\cdot R^2(T_c)^{2}}{P_c}\\b=\left( \frac{(\sqrt[3]{2}-1)}{3}\right)\frac{RT_c}{P_c} =\frac{0.08664\cdot R T_c}{P_c}\\\alpha(T) = \left[1 + S_1\left(1-\sqrt{T_r}\right) + S_2\frac{1 - \sqrt{T_r}}{\sqrt{T_r}}\right]^2\\S_1 = 0.48508 + 1.55171\omega - 0.15613\omega^2 \text{ if S1 is not tabulated }\end{aligned}\end{align} \]- Parameters
Tc (float) – Critical temperature, [K]
Pc (float) – Critical pressure, [Pa]
omega (float, optional) – Acentric factor, [-]
T (float, optional) – Temperature, [K]
P (float, optional) – Pressure, [Pa]
V (float, optional) – Molar volume, [m^3/mol]
S1 (float, optional) – Fit constant or estimated from acentric factor if not provided [-]
S2 (float, optional) – Fit constant or 0 if not provided [-]
Examples
>>> eos = APISRK(Tc=514.0, Pc=6137000.0, S1=1.678665, S2=-0.216396, P=1E6, T=299) >>> eos.phase, eos.V_l, eos.H_dep_l, eos.S_dep_l ('l', 7.045692682173235e-05, -42826.271630638774, -103.62694391379836)
References
- 1
API Technical Data Book: General Properties & Characterization. American Petroleum Institute, 7E, 2005.
-
a_alpha_and_derivatives
(T, full=True, quick=True)[source]¶ Method to calculate a_alpha and its first and second derivatives for this EOS. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Uses the set values of Tc, a, S1, and S2.
\[ \begin{align}\begin{aligned}a\alpha(T) = a\left[1 + S_1\left(1-\sqrt{T_r}\right) + S_2\frac{1 - \sqrt{T_r}}{\sqrt{T_r}}\right]^2\\\frac{d a\alpha}{dT} = a\frac{Tc}{T^{2}} \left(- S_{2} \left(\sqrt{ \frac{T}{Tc}} - 1\right) + \sqrt{\frac{T}{Tc}} \left(S_{1} \sqrt{ \frac{T}{Tc}} + S_{2}\right)\right) \left(S_{2} \left(\sqrt{\frac{ T}{Tc}} - 1\right) + \sqrt{\frac{T}{Tc}} \left(S_{1} \left(\sqrt{ \frac{T}{Tc}} - 1\right) - 1\right)\right)\\\frac{d^2 a\alpha}{dT^2} = a\frac{1}{2 T^{3}} \left(S_{1}^{2} T \sqrt{\frac{T}{Tc}} - S_{1} S_{2} T \sqrt{\frac{T}{Tc}} + 3 S_{1} S_{2} Tc \sqrt{\frac{T}{Tc}} + S_{1} T \sqrt{\frac{T}{Tc}} - 3 S_{2}^{2} Tc \sqrt{\frac{T}{Tc}} + 4 S_{2}^{2} Tc + 3 S_{2} Tc \sqrt{\frac{T}{Tc}}\right)\end{aligned}\end{align} \]
-
solve_T
(P, V, quick=True)[source]¶ Method to calculate T from a specified P and V for the API SRK EOS. Uses a, b, and Tc obtained from the class’s namespace.
- Parameters
P (float) – Pressure, [Pa]
V (float) – Molar volume, [m^3/mol]
quick (bool, optional) – Whether to use a SymPy cse-derived expression (3x faster) or individual formulas
- Returns
T – Temperature, [K]
- Return type
float
Notes
If S2 is set to 0, the solution is the same as in the SRK EOS, and that is used. Otherwise, newton’s method must be used to solve for T. There are 8 roots of T in that case, six of them real. No guarantee can be made regarding which root will be obtained.
-
class
thermosteam.properties.eos.
TWUPR
(Tc, Pc, omega, T=None, P=None, V=None)[source]¶ Class for solving the Twu [1]_ variant of the Peng-Robinson cubic equation of state for a pure compound. Subclasses PR, which provides the methods for solving the EOS and calculating its assorted relevant thermodynamic properties. Solves the EOS on initialization.
Implemented methods here are a_alpha_and_derivatives, which sets a_alpha and its first and second derivatives, and solve_T, which from a specified P and V obtains T.
Two of T, P, and V are needed to solve the EOS.
\[ \begin{align}\begin{aligned}P = \frac{RT}{v-b}-\frac{a\alpha(T)}{v(v+b)+b(v-b)}\\ a=0.45724\frac{R^2T_c^2}{P_c}\\ b=0.07780\frac{RT_c}{P_c}\\\alpha = \alpha^{(0)} + \omega(\alpha^{(1)}-\alpha^{(0)})\\\alpha^{(i)} = T_r^{N(M-1)}\exp[L(1-T_r^{NM})]\end{aligned}\end{align} \]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
Tc (float) – Critical temperature, [K]
Pc (float) – Critical pressure, [Pa]
omega (float) – Acentric factor, [-]
T (float, optional) – Temperature, [K]
P (float, optional) – Pressure, [Pa]
V (float, optional) – Molar volume, [m^3/mol]
Examples
>>> eos = TWUPR(Tc=507.6, Pc=3025000, omega=0.2975, T=299., P=1E6) >>> eos.V_l, eos.H_dep_l, eos.S_dep_l (0.0001301754975832378, -31652.72639160809, -74.11282530917981)
Notes
Claimed to be more accurate than the PR, PR78 and PRSV equations.
There is no analytical solution for T. There are multiple possible solutions for T under certain conditions; no guaranteed are provided regarding which solution is obtained.
References
- 1
Twu, Chorng H., John E. Coon, and John R. Cunningham. “A New Generalized Alpha Function for a Cubic Equation of State Part 1. Peng-Robinson Equation.” Fluid Phase Equilibria 105, no. 1 (March 15, 1995): 49-59. doi:10.1016/0378-3812(94)02601-V.
-
a_alpha_and_derivatives
(T, full=True, quick=True)[source]¶ Method to calculate a_alpha and its first and second derivatives for this EOS. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Uses the set values of Tc, omega, and a.
Because of its similarity for the TWUSRK EOS, this has been moved to an external TWU_a_alpha_common function. See it for further documentation.
-
class
thermosteam.properties.eos.
TWUSRK
(Tc, Pc, omega, T=None, P=None, V=None)[source]¶ Class for solving the Soave-Redlich-Kwong cubic equation of state for a pure compound. Subclasses CUBIC_EOS, which provides the methods for solving the EOS and calculating its assorted relevant thermodynamic properties. Solves the EOS on initialization.
Implemented methods here are a_alpha_and_derivatives, which sets a_alpha and its first and second derivatives, and solve_T, which from a specified P and V obtains T.
Two of T, P, and V are needed to solve the EOS.
\[ \begin{align}\begin{aligned}P = \frac{RT}{V-b} - \frac{a\alpha(T)}{V(V+b)}\\a=\left(\frac{R^2(T_c)^{2}}{9(\sqrt[3]{2}-1)P_c} \right) =\frac{0.42748\cdot R^2(T_c)^{2}}{P_c}\\b=\left( \frac{(\sqrt[3]{2}-1)}{3}\right)\frac{RT_c}{P_c} =\frac{0.08664\cdot R T_c}{P_c}\\\alpha = \alpha^{(0)} + \omega(\alpha^{(1)}-\alpha^{(0)})\\\alpha^{(i)} = T_r^{N(M-1)}\exp[L(1-T_r^{NM})]\end{aligned}\end{align} \]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
Tc (float) – Critical temperature, [K]
Pc (float) – Critical pressure, [Pa]
omega (float) – Acentric factor, [-]
T (float, optional) – Temperature, [K]
P (float, optional) – Pressure, [Pa]
V (float, optional) – Molar volume, [m^3/mol]
Examples
>>> eos = TWUSRK(Tc=507.6, Pc=3025000, omega=0.2975, T=299., P=1E6) >>> eos.phase, eos.V_l, eos.H_dep_l, eos.S_dep_l ('l', 0.00014689217317770398, -31612.591872087483, -74.02294100343829)
Notes
There is no analytical solution for T. There are multiple possible solutions for T under certain conditions; no guaranteed are provided regarding which solution is obtained.
References
- 1
Twu, Chorng H., John E. Coon, and John R. Cunningham. “A New Generalized Alpha Function for a Cubic Equation of State Part 2. Redlich-Kwong Equation.” Fluid Phase Equilibria 105, no. 1 (March 15, 1995): 61-69. doi:10.1016/0378-3812(94)02602-W.
-
a_alpha_and_derivatives
(T, full=True, quick=True)[source]¶ Method to calculate a_alpha and its first and second derivatives for this EOS. Returns a_alpha, da_alpha_dT, and d2a_alpha_dT2. See GCEOS.a_alpha_and_derivatives for more documentation. Uses the set values of Tc, omega, and a.
Because of its similarity for the TWUPR EOS, this has been moved to an external TWU_a_alpha_common function. See it for further documentation.