thermo.vapor_pressure module¶

thermo.vapor_pressure.Antoine(T, A, B, C, base=10.0)[source]

Calculates vapor pressure of a chemical using the Antoine equation. Parameters A, B, and C are chemical-dependent. Parameters can be found in numerous sources; however units of the coefficients used vary. Originally proposed by Antoine (1888) [R12951313].

$\log_{\text{base}} P^{\text{sat}} = A - \frac{B}{T+C}$
Parameters: Returns: T : float Temperature of fluid, [K] A, B, C : floats Regressed coefficients for Antoine equation for a chemical Psat : float Vapor pressure calculated with coefficients [Pa] Base : float Optional base of logarithm; 10 by default

Notes

Assumes coefficients are for calculating vapor pressure in Pascal. Coefficients should be consistent with input temperatures in Kelvin; however, if both the given temperature and units are specific to degrees Celcius, the result will still be correct.

Converting units in input coefficients:

• ln to log10: Divide A and B by ln(10)=2.302585 to change parameters for a ln equation to a log10 equation.
• log10 to ln: Multiply A and B by ln(10)=2.302585 to change parameters for a log equation to a ln equation.
• mmHg to Pa: Add log10(101325/760)= 2.1249 to A.
• kPa to Pa: Add log_{base}(1000)= 6.908 to A for log(base)
• °C to K: Subtract 273.15 from C only!

References

 [R12941313] (1, 2, 3) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
 [R12951313] (1, 2) Antoine, C. 1888. Tensions des Vapeurs: Nouvelle Relation Entre les Tensions et les Tempé. Compt.Rend. 107:681-684.
 [R12961313] (1, 2) Yaws, Carl L. The Yaws Handbook of Vapor Pressure: Antoine Coefficients. 1 edition. Houston, Tex: Gulf Publishing Company, 2007.

Examples

Methane, coefficients from [R12941313], at 100 K:

>>> Antoine(100.0, 8.7687, 395.744, -6.469)
34478.367349639906


Tetrafluoromethane, coefficients from [R12941313], at 180 K

>>> Antoine(180, A=8.95894, B=510.595, C=-15.95)
702271.0518579542


Oxygen at 94.91 K, with coefficients from [R12961313] in units of °C, mmHg, log10, showing the conversion of coefficients A (mmHg to Pa) and C (°C to K)

>>> Antoine(94.91, 6.83706+2.1249, 339.2095, 268.70-273.15)
162978.88655572367

thermo.vapor_pressure.Wagner_original(T, Tc, Pc, a, b, c, d)[source]

Calculates vapor pressure using the Wagner equation (3, 6 form).

Requires critical temperature and pressure as well as four coefficients specific to each chemical.

\begin{align}\begin{aligned}\ln P^{sat}= \ln P_c + \frac{a\tau + b \tau^{1.5} + c\tau^3 + d\tau^6} {T_r}\\\tau = 1 - \frac{T}{T_c}\end{aligned}\end{align}
Parameters: T : float Temperature of fluid, [K] Tc : float Critical temperature, [K] Pc : float Critical pressure, [Pa] a, b, c, d : floats Parameters for wagner equation. Specific to each chemical. [-] Psat : float Vapor pressure at T [Pa]

Notes

Warning: Pc is often treated as adjustable constant.

References

 [R12971316] Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
 [R12981316] (1, 2) McGarry, Jack. “Correlation and Prediction of the Vapor Pressures of Pure Liquids over Large Pressure Ranges.” Industrial & Engineering Chemistry Process Design and Development 22, no. 2 (April 1, 1983): 313-22. doi:10.1021/i200021a023.

Examples

Methane, coefficients from [R12981316], at 100 K.

>>> Wagner_original(100.0, 190.53, 4596420., a=-6.00435, b=1.1885,
... c=-0.834082, d=-1.22833)
34520.44601450496

thermo.vapor_pressure.Wagner(T, Tc, Pc, a, b, c, d)[source]

Calculates vapor pressure using the Wagner equation (2.5, 5 form).

Requires critical temperature and pressure as well as four coefficients specific to each chemical.

\begin{align}\begin{aligned}\ln P^{sat}= \ln P_c + \frac{a\tau + b \tau^{1.5} + c\tau^{2.5} + d\tau^5} {T_r}\\\tau = 1 - \frac{T}{T_c}\end{aligned}\end{align}
Parameters: T : float Temperature of fluid, [K] Tc : float Critical temperature, [K] Pc : float Critical pressure, [Pa] a, b, c, d : floats Parameters for wagner equation. Specific to each chemical. [-] Psat : float Vapor pressure at T [Pa]

Notes

Warning: Pc is often treated as adjustable constant.

References

 [R12991318] Wagner, W. “New Vapour Pressure Measurements for Argon and Nitrogen and a New Method for Establishing Rational Vapour Pressure Equations.” Cryogenics 13, no. 8 (August 1973): 470-82. doi:10.1016/0011-2275(73)90003-9
 [R13001318] (1, 2) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.

Examples

Methane, coefficients from [R13001318], at 100 K.

>>> Wagner(100., 190.551, 4599200, -6.02242, 1.26652, -0.5707, -1.366)
34415.00476263708

thermo.vapor_pressure.TRC_Antoine_extended(T, Tc, to, A, B, C, n, E, F)[source]

Calculates vapor pressure of a chemical using the TRC Extended Antoine equation. Parameters are chemical dependent, and said to be from the Thermodynamics Research Center (TRC) at Texas A&M. Coefficients for various chemicals can be found in [R13011320].

\begin{align}\begin{aligned}\log_{10} P^{sat} = A - \frac{B}{T + C} + 0.43429x^n + Ex^8 + Fx^{12}\\x = \max \left(\frac{T-t_o-273.15}{T_c}, 0 \right)\end{aligned}\end{align}
Parameters: T : float Temperature of fluid, [K] A, B, C, n, E, F : floats Regressed coefficients for the Antoine Extended (TRC) equation, specific for each chemical, [-] Psat : float Vapor pressure calculated with coefficients [Pa]

Notes

Assumes coefficients are for calculating vapor pressure in Pascal. Coefficients should be consistent with input temperatures in Kelvin;

References

 [R13011320] (1, 2, 3) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.

Examples

Tetrafluoromethane, coefficients from [R13011320], at 180 K:

>>> TRC_Antoine_extended(180.0, 227.51, -120., 8.95894, 510.595, -15.95,
... 2.41377, -93.74, 7425.9)
706317.0898414153

thermo.vapor_pressure.vapor_pressure_methods = ['WAGNER_MCGARRY', 'WAGNER_POLING', 'ANTOINE_EXTENDED_POLING', 'DIPPR_PERRY_8E', 'VDI_PPDS', 'COOLPROP', 'ANTOINE_POLING', 'VDI_TABULAR', 'AMBROSE_WALTON', 'LEE_KESLER_PSAT', 'Edalat', 'EOS', 'BOILING_CRITICAL', 'SANJARI']

Holds all methods available for the VaporPressure class, for use in iterating over them.

class thermo.vapor_pressure.VaporPressure(Tb=None, Tc=None, Pc=None, omega=None, CASRN='', eos=None)[source]

Class for dealing with vapor pressure as a function of temperature. Consists of four coefficient-based methods and four data sources, one source of tabular information, four corresponding-states estimators, any provided equation of state, and the external library CoolProp.

Parameters: Tb : float, optional Boiling point, [K] Tc : float, optional Critical temperature, [K] Pc : float, optional Critical pressure, [Pa] omega : float, optional Acentric factor, [-] CASRN : str, optional The CAS number of the chemical eos : object, optional Equation of State object after thermo.eos.GCEOS

Notes

To iterate over all methods, use the list stored in vapor_pressure_methods.

WAGNER_MCGARRY:
The Wagner 3,6 original model equation documented in Wagner_original, with data for 245 chemicals, from [R13021321],
WAGNER_POLING:
The Wagner 2.5, 5 model equation documented in Wagner in [R13031321], with data for 104 chemicals.
ANTOINE_EXTENDED_POLING:
The TRC extended Antoine model equation documented in TRC_Antoine_extended with data for 97 chemicals in [R13031321].
ANTOINE_POLING:
Standard Antoine equation, as documented in the function Antoine and with data for 325 fluids from [R13031321]. Coefficients were altered to be in units of Pa and Celcius.
DIPPR_PERRY_8E:
A collection of 341 coefficient sets from the DIPPR database published openly in [R13061321]. Provides temperature limits for all its fluids. thermo.dippr.EQ101 is used for its fluids.
VDI_PPDS:
Coefficients for a equation form developed by the PPDS, published openly in [R13051321].
COOLPROP:
CoolProp external library; with select fluids from its library. Range is limited to that of the equations of state it uses, as described in [R13041321]. Very slow.
BOILING_CRITICAL:
Fundamental relationship in thermodynamics making several approximations; see boiling_critical_relation for details. Least accurate method in most circumstances.
LEE_KESLER_PSAT:
CSP method documented in Lee_Kesler. Widely used.
AMBROSE_WALTON:
CSP method documented in Ambrose_Walton.
SANJARI:
CSP method documented in Sanjari.
EDALAT:
CSP method documented in Edalat.
VDI_TABULAR:
Tabular data in [R13051321] along the saturation curve; interpolation is as set by the user or the default.
EOS:
Equation of state provided by user; must implement thermo.eos.GCEOS.Psat

References

 [R13021321] (1, 2) McGarry, Jack. “Correlation and Prediction of the Vapor Pressures of Pure Liquids over Large Pressure Ranges.” Industrial & Engineering Chemistry Process Design and Development 22, no. 2 (April 1, 1983): 313-22. doi:10.1021/i200021a023.
 [R13031321] (1, 2, 3, 4) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
 [R13041321] (1, 2) Bell, Ian H., Jorrit Wronski, Sylvain Quoilin, and Vincent Lemort. “Pure and Pseudo-Pure Fluid Thermophysical Property Evaluation and the Open-Source Thermophysical Property Library CoolProp.” Industrial & Engineering Chemistry Research 53, no. 6 (February 12, 2014): 2498-2508. doi:10.1021/ie4033999. http://www.coolprop.org/
 [R13051321] (1, 2, 3) Gesellschaft, V. D. I., ed. VDI Heat Atlas. 2nd edition. Berlin; New York:: Springer, 2010.
 [R13061321] (1, 2) Green, Don, and Robert Perry. Perry’s Chemical Engineers’ Handbook, Eighth Edition. McGraw-Hill Professional, 2007.

Attributes

 T_cached method

Methods

 T_dependent_property(T) Method to calculate the property with sanity checking and without specifying a specific method. T_dependent_property_derivative(T[, order]) Method to obtain a derivative of a property with respect to temperature, of a given order. T_dependent_property_integral(T1, T2) Method to calculate the integral of a property with respect to temperature, using a specified method. T_dependent_property_integral_over_T(T1, T2) Method to calculate the integral of a property over temperature with respect to temperature, using a specified method. __call__(T) Convenience method to calculate the property; calls T_dependent_property. calculate(T, method) Method to calculate vapor pressure of a fluid at temperature T with a given method. calculate_derivative(T, method[, order]) Method to calculate a derivative of a property with respect to temperature, of a given order using a specified method. calculate_integral(T1, T2, method) Method to calculate the integral of a property with respect to temperature, using a specified method. calculate_integral_over_T(T1, T2, method) Method to calculate the integral of a property over temperature with respect to temperature, using a specified method. extrapolate_tabular(T) interpolate(T, name) Method to perform interpolation on a given tabular data set previously added via set_tabular_data. interpolation_T(T) 1/T interpolation transformation by default. interpolation_property(P) log(P) interpolation transformation by default. interpolation_property_inv(P) exp(P) interpolation transformation by default; reverses load_all_methods() Method which picks out coefficients for the specified chemical from the various dictionaries and DataFrames storing it. plot_T_dependent_property([Tmin, Tmax, ...]) Method to create a plot of the property vs temperature according to either a specified list of methods, or user methods (if set), or all methods. select_valid_methods(T) Method to obtain a sorted list of methods which are valid at T according to test_method_validity. set_tabular_data(Ts, properties[, name, ...]) Method to set tabular data to be used for interpolation. set_user_methods(user_methods[, forced]) Method used to select certain property methods as having a higher priority than were set by default. solve_prop(goal[, reset_method]) Method to solve for the temperature at which a property is at a specified value. test_method_validity(T, method) Method to check the validity of a method. test_property_validity(prop) Method to test the validity of a calculated property.
Tmax = None

Maximum temperature at which no method can calculate vapor pressure above; by definition the critical point.

Tmin = None

Minimum temperature at which no method can calculate vapor pressure under.

all_methods = None

Set of all methods available for a given CASRN and properties; filled by load_all_methods.

calculate(T, method)[source]

Method to calculate vapor pressure of a fluid at temperature T with a given method.

This method has no exception handling; see T_dependent_property for that.

Parameters: T : float Temperature at calculate vapor pressure, [K] method : str Name of the method to use Psat : float Vapor pressure at T, [pa]
interpolation_T(T)

1/T interpolation transformation by default.

interpolation_property(P)

log(P) interpolation transformation by default.

interpolation_property_inv(P)

exp(P) interpolation transformation by default; reverses interpolation_property_inv.

load_all_methods()[source]

Method which picks out coefficients for the specified chemical from the various dictionaries and DataFrames storing it. All data is stored as attributes. This method also sets Tmin, Tmax, and all_methods as a set of methods for which the data exists for.

Called on initialization only. See the source code for the variables at which the coefficients are stored. The coefficients can safely be altered once the class is initialized. This method can be called again to reset the parameters.

method = None

The method was which was last used successfully to calculate a property; set only after the first property calculation.

name = 'Vapor pressure'
property_max = 10000000000.0

Maximum valid value of vapor pressure. Set slightly above the critical point estimated for Iridium; Mercury’s 160 MPa critical point is the highest known.

property_min = 0

Mimimum valid value of vapor pressure.

ranked_methods = ['WAGNER_MCGARRY', 'WAGNER_POLING', 'ANTOINE_EXTENDED_POLING', 'DIPPR_PERRY_8E', 'VDI_PPDS', 'COOLPROP', 'ANTOINE_POLING', 'VDI_TABULAR', 'AMBROSE_WALTON', 'LEE_KESLER_PSAT', 'Edalat', 'BOILING_CRITICAL', 'EOS', 'SANJARI']

Default rankings of the available methods.

sorted_valid_methods = None

sorted_valid_methods, list: Stored methods which were found valid at a specific temperature; set by T_dependent_property.

tabular_data = None

tabular_data, dict: Stored (Ts, properties) for any tabular data; indexed by provided or autogenerated name.

tabular_data_interpolators = None

tabular_data_interpolators, dict: Stored (extrapolator, spline) tuples which are interp1d instances for each set of tabular data; indexed by tuple of (name, interpolation_T, interpolation_property, interpolation_property_inv) to ensure that if an interpolation transform is altered, the old interpolator which had been created is no longer used.

tabular_extrapolation_permitted = False

Disallow tabular extrapolation by default; CSP methods prefered normally.

test_method_validity(T, method)[source]

Method to check the validity of a method. Follows the given ranges for all coefficient-based methods. For CSP methods, the models are considered valid from 0 K to the critical point. For tabular data, extrapolation outside of the range is used if tabular_extrapolation_permitted is set; if it is, the extrapolation is considered valid for all temperatures.

It is not guaranteed that a method will work or give an accurate prediction simply because this method considers the method valid.

Parameters: T : float Temperature at which to test the method, [K] method : str Name of the method to test validity : bool Whether or not a method is valid
units = 'Pa'
user_methods = None

user_methods, list: Stored methods which were specified by the user in a ranked order of preference; set by T_dependent_property.

thermo.vapor_pressure.boiling_critical_relation(T, Tb, Tc, Pc)[source]

Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship as in [R13071326]; requires a chemical’s critical temperature and pressure as well as boiling point.

The vapor pressure is given by:

\begin{align}\begin{aligned}\ln P^{sat}_r = h\left( 1 - \frac{1}{T_r}\right)\\h = T_{br} \frac{\ln(P_c/101325)}{1-T_{br}}\end{aligned}\end{align}
Parameters: T : float Temperature of fluid [K] Tb : float Boiling temperature of fluid [K] Tc : float Critical temperature of fluid [K] Pc : float Critical pressure of fluid [Pa] Psat : float Vapor pressure at T [Pa]

Notes

Units are Pa. Formulation makes intuitive sense; a logarithmic form of interpolation.

References

 [R13071326] (1, 2, 3) Reid, Robert C..; Prausnitz, John M.;; Poling, Bruce E. The Properties of Gases and Liquids. McGraw-Hill Companies, 1987.

Examples

Example as in [R13071326] for ethylbenzene

>>> boiling_critical_relation(347.2, 409.3, 617.1, 36E5)
15209.467273093938

thermo.vapor_pressure.Lee_Kesler(T, Tc, Pc, omega)[source]

Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [R13081327]; requires a chemical’s critical temperature and acentric factor.

The vapor pressure is given by:

\begin{align}\begin{aligned}\ln P^{sat}_r = f^{(0)} + \omega f^{(1)}\\f^{(0)} = 5.92714-\frac{6.09648}{T_r}-1.28862\ln T_r + 0.169347T_r^6\\f^{(1)} = 15.2518-\frac{15.6875}{T_r} - 13.4721 \ln T_r + 0.43577T_r^6\end{aligned}\end{align}
Parameters: T : float Temperature of fluid [K] Tc : float Critical temperature of fluid [K] Pc : float Critical pressure of fluid [Pa] omega : float Acentric factor [-] Psat : float Vapor pressure at T [Pa]

Notes

This equation appears in [R13081327] in expanded form. The reduced pressure form of the equation ensures predicted vapor pressure cannot surpass the critical pressure.

References

 [R13081327] (1, 2, 3) Lee, Byung Ik, and Michael G. Kesler. “A Generalized Thermodynamic Correlation Based on Three-Parameter Corresponding States.” AIChE Journal 21, no. 3 (1975): 510-527. doi:10.1002/aic.690210313.
 [R13091327] (1, 2) Reid, Robert C..; Prausnitz, John M.;; Poling, Bruce E. The Properties of Gases and Liquids. McGraw-Hill Companies, 1987.

Examples

Example from [R13091327]; ethylbenzene at 347.2 K.

>>> Lee_Kesler(347.2, 617.1, 36E5, 0.299)
13078.694162949312

thermo.vapor_pressure.Ambrose_Walton(T, Tc, Pc, omega)[source]

Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [R13101329]; requires a chemical’s critical temperature and acentric factor.

The vapor pressure is given by:

\begin{align}\begin{aligned}\ln P_r=f^{(0)}+\omega f^{(1)}+\omega^2f^{(2)}\\f^{(0)}=\frac{-5.97616\tau + 1.29874\tau^{1.5}- 0.60394\tau^{2.5} -1.06841\tau^5}{T_r}\\f^{(1)}=\frac{-5.03365\tau + 1.11505\tau^{1.5}- 5.41217\tau^{2.5} -7.46628\tau^5}{T_r}\\f^{(2)}=\frac{-0.64771\tau + 2.41539\tau^{1.5}- 4.26979\tau^{2.5} +3.25259\tau^5}{T_r}\\\tau = 1-T_{r}\end{aligned}\end{align}
Parameters: T : float Temperature of fluid [K] Tc : float Critical temperature of fluid [K] Pc : float Critical pressure of fluid [Pa] omega : float Acentric factor [-] Psat : float Vapor pressure at T [Pa]

Notes

Somewhat more accurate than the Lee_Kesler formulation.

References

 [R13101329] (1, 2) Ambrose, D., and J. Walton. “Vapour Pressures up to Their Critical Temperatures of Normal Alkanes and 1-Alkanols.” Pure and Applied Chemistry 61, no. 8 (1989): 1395-1403. doi:10.1351/pac198961081395.
 [R13111329] (1, 2) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.

Examples

Example from [R13111329]; ethylbenzene at 347.25 K.

>>> Ambrose_Walton(347.25, 617.15, 36.09E5, 0.304)
13278.878504306222

thermo.vapor_pressure.Edalat(T, Tc, Pc, omega)[source]

Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [R13121331]. Requires a chemical’s critical temperature, pressure, and acentric factor. Claimed to have a higher accuracy than the Lee-Kesler CSP relationship.

The vapor pressure of a chemical at T is given by:

\begin{align}\begin{aligned}\ln(P^{sat}/P_c) = \frac{a\tau + b\tau^{1.5} + c\tau^3 + d\tau^6} {1-\tau}\\a = -6.1559 - 4.0855\omega\\b = 1.5737 - 1.0540\omega - 4.4365\times 10^{-3} d\\c = -0.8747 - 7.8874\omega\\d = \frac{1}{-0.4893 - 0.9912\omega + 3.1551\omega^2}\\\tau = 1 - \frac{T}{T_c}\end{aligned}\end{align}
Parameters: T : float Temperature of fluid [K] Tc : float Critical temperature of fluid [K] Pc : float Critical pressure of fluid [Pa] omega : float Acentric factor [-] Psat : float Vapor pressure, [Pa]

Notes

[R13121331] found an average error of 6.06% on 94 compounds and 1106 data points.

References

 [R13121331] (1, 2, 3) Edalat, M., R. B. Bozar-Jomehri, and G. A. Mansoori. “Generalized Equation Predicts Vapor Pressure of Hydrocarbons.” Oil and Gas Journal; 91:5 (February 1, 1993).

Examples

>>> Edalat(347.2, 617.1, 36E5, 0.299)
13461.273080743307

thermo.vapor_pressure.Sanjari(T, Tc, Pc, omega)[source]

Calculates vapor pressure of a fluid at arbitrary temperatures using a CSP relationship by [R13131332]. Requires a chemical’s critical temperature, pressure, and acentric factor. Although developed for refrigerants, this model should have some general predictive ability.

The vapor pressure of a chemical at T is given by:

\begin{align}\begin{aligned}P^{sat} = P_c\exp(f^{(0)} + \omega f^{(1)} + \omega^2 f^{(2)})\\f^{(0)} = a_1 + \frac{a_2}{T_r} + a_3\ln T_r + a_4 T_r^{1.9}\\f^{(1)} = a_5 + \frac{a_6}{T_r} + a_7\ln T_r + a_8 T_r^{1.9}\\f^{(2)} = a_9 + \frac{a_{10}}{T_r} + a_{11}\ln T_r + a_{12} T_r^{1.9}\end{aligned}\end{align}
Parameters: T : float Temperature of fluid [K] Tc : float Critical temperature of fluid [K] Pc : float Critical pressure of fluid [Pa] omega : float Acentric factor [-] Psat : float Vapor pressure, [Pa]

Notes

a[1-12] are as follows: 6.83377, -5.76051, 0.90654, -1.16906, 5.32034, -28.1460, -58.0352, 23.57466, 18.19967, 16.33839, 65.6995, -35.9739.

For a claimed fluid not included in the regression, R128, the claimed AARD was 0.428%. A re-calculation using 200 data points from 125.45 K to 343.90225 K evenly spaced by 1.09775 K as generated by NIST Webbook April 2016 produced an AARD of 0.644%. It is likely that the author’s regression used more precision in its coefficients than was shown here. Nevertheless, the function is reproduced as shown in [R13131332].

For Tc=808 K, Pc=1100000 Pa, omega=1.1571, this function actually declines after 770 K.

References

 [R13131332] (1, 2, 3) Sanjari, Ehsan, Mehrdad Honarmand, Hamidreza Badihi, and Ali Ghaheri. “An Accurate Generalized Model for Predict Vapor Pressure of Refrigerants.” International Journal of Refrigeration 36, no. 4 (June 2013): 1327-32. doi:10.1016/j.ijrefrig.2013.01.007.

Examples

>>> Sanjari(347.2, 617.1, 36E5, 0.299)
13651.916109552498