thermo.volume module

thermo.volume.Yen_Woods_saturation(T, Tc, Vc, Zc)[source]

Calculates saturation liquid volume, using the Yen and Woods [R13781403] CSP method and a chemical’s critical properties.

The molar volume of a liquid is given by:

\[ \begin{align}\begin{aligned}Vc/Vs = 1 + A(1-T_r)^{1/3} + B(1-T_r)^{2/3} + D(1-T_r)^{4/3}\\D = 0.93-B\\A = 17.4425 - 214.578Z_c + 989.625Z_c^2 - 1522.06Z_c^3\\B = -3.28257 + 13.6377Z_c + 107.4844Z_c^2-384.211Z_c^3 \text{ if } Zc \le 0.26\\B = 60.2091 - 402.063Z_c + 501.0 Z_c^2 + 641.0 Z_c^3 \text{ if } Zc \ge 0.26\end{aligned}\end{align} \]
Parameters:

T : float

Temperature of fluid [K]

Tc : float

Critical temperature of fluid [K]

Vc : float

Critical volume of fluid [m^3/mol]

Zc : float

Critical compressibility of fluid, [-]

Returns:

Vs : float

Saturation liquid volume, [m^3/mol]

Notes

Original equation was in terms of density, but it is converted here.

No example has been found, nor are there points in the article. However, it is believed correct. For compressed liquids with the Yen-Woods method, see the YenWoods_compressed function.

References

[R13781403](1, 2) Yen, Lewis C., and S. S. Woods. “A Generalized Equation for Computer Calculation of Liquid Densities.” AIChE Journal 12, no. 1 (1966): 95-99. doi:10.1002/aic.690120119

Examples

>>> Yen_Woods_saturation(300, 647.14, 55.45E-6, 0.245)
1.7695330765295693e-05
thermo.volume.Rackett(T, Tc, Pc, Zc)[source]

Calculates saturation liquid volume, using Rackett CSP method and critical properties.

The molar volume of a liquid is given by:

\[V_s = \frac{RT_c}{P_c}{Z_c}^{[1+(1-{T/T_c})^{2/7} ]}\]

Units are all currently in m^3/mol - this can be changed to kg/m^3

Parameters:

T : float

Temperature of fluid [K]

Tc : float

Critical temperature of fluid [K]

Pc : float

Critical pressure of fluid [Pa]

Zc : float

Critical compressibility of fluid, [-]

Returns:

Vs : float

Saturation liquid volume, [m^3/mol]

Notes

Units are dependent on gas constant R, imported from scipy According to Reid et. al, underpredicts volume for compounds with Zc < 0.22

References

[R13791404]Rackett, Harold G. “Equation of State for Saturated Liquids.” Journal of Chemical & Engineering Data 15, no. 4 (1970): 514-517. doi:10.1021/je60047a012

Examples

Propane, example from the API Handbook

>>> Vm_to_rho(Rackett(272.03889, 369.83, 4248000.0, 0.2763), 44.09562)
531.3223212651092
thermo.volume.Yamada_Gunn(T, Tc, Pc, omega)[source]

Calculates saturation liquid volume, using Yamada and Gunn CSP method and a chemical’s critical properties and acentric factor.

The molar volume of a liquid is given by:

\[V_s = \frac{RT_c}{P_c}{(0.29056-0.08775\omega)}^{[1+(1-{T/T_c})^{2/7}]}\]

Units are in m^3/mol.

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 for fluid, [-]

Returns:

Vs : float

saturation liquid volume, [m^3/mol]

Notes

This equation is an improvement on the Rackett equation. This is often presented as the Rackett equation. The acentric factor is used here, instead of the critical compressibility A variant using a reference fluid also exists

References

[R13801405]Gunn, R. D., and Tomoyoshi Yamada. “A Corresponding States Correlation of Saturated Liquid Volumes.” AIChE Journal 17, no. 6 (1971): 1341-45. doi:10.1002/aic.690170613
[R13811405]Yamada, Tomoyoshi, and Robert D. Gunn. “Saturated Liquid Molar Volumes. Rackett Equation.” Journal of Chemical & Engineering Data 18, no. 2 (1973): 234-36. doi:10.1021/je60057a006

Examples

>>> Yamada_Gunn(300, 647.14, 22048320.0, 0.245)
2.1882836429895796e-05
thermo.volume.Townsend_Hales(T, Tc, Vc, omega)[source]

Calculates saturation liquid density, using the Townsend and Hales CSP method as modified from the original Riedel equation. Uses chemical critical volume and temperature, as well as acentric factor

The density of a liquid is given by:

\[Vs = V_c/\left(1+0.85(1-T_r)+(1.692+0.986\omega)(1-T_r)^{1/3}\right)\]
Parameters:

T : float

Temperature of fluid [K]

Tc : float

Critical temperature of fluid [K]

Vc : float

Critical volume of fluid [m^3/mol]

omega : float

Acentric factor for fluid, [-]

Returns:

Vs : float

Saturation liquid volume, [m^3/mol]

Notes

The requirement for critical volume and acentric factor requires all data.

References

[R13821407]Hales, J. L, and R Townsend. “Liquid Densities from 293 to 490 K of Nine Aromatic Hydrocarbons.” The Journal of Chemical Thermodynamics 4, no. 5 (1972): 763-72. doi:10.1016/0021-9614(72)90050-X

Examples

>>> Townsend_Hales(300, 647.14, 55.95E-6, 0.3449)
1.8007361992619923e-05
thermo.volume.Bhirud_normal(T, Tc, Pc, omega)[source]

Calculates saturation liquid density using the Bhirud [R13831408] CSP method. Uses Critical temperature and pressure and acentric factor.

The density of a liquid is given by:

\[ \begin{align}\begin{aligned}&\ln \frac{P_c}{\rho RT} = \ln U^{(0)} + \omega\ln U^{(1)}\\&\ln U^{(0)} = 1.396 44 - 24.076T_r+ 102.615T_r^2 -255.719T_r^3+355.805T_r^4-256.671T_r^5 + 75.1088T_r^6\\&\ln U^{(1)} = 13.4412 - 135.7437 T_r + 533.380T_r^2- 1091.453T_r^3+1231.43T_r^4 - 728.227T_r^5 + 176.737T_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 for fluid, [-]

Returns:

Vm : float

Saturated liquid molar volume, [mol/m^3]

Notes

Claimed inadequate by others.

An interpolation table for ln U values are used from Tr = 0.98 - 1.000. Has terrible behavior at low reduced temperatures.

References

[R13831408](1, 2) Bhirud, Vasant L. “Saturated Liquid Densities of Normal Fluids.” AIChE Journal 24, no. 6 (November 1, 1978): 1127-31. doi:10.1002/aic.690240630

Examples

Pentane

>>> Bhirud_normal(280.0, 469.7, 33.7E5, 0.252)
0.00011249654029488583
thermo.volume.COSTALD(T, Tc, Vc, omega)[source]

Calculate saturation liquid density using the COSTALD CSP method.

A popular and accurate estimation method. If possible, fit parameters are used; alternatively critical properties work well.

The density of a liquid is given by:

\[ \begin{align}\begin{aligned}V_s=V^*V^{(0)}[1-\omega_{SRK}V^{(\delta)}]\\V^{(0)}=1-1.52816(1-T_r)^{1/3}+1.43907(1-T_r)^{2/3} - 0.81446(1-T_r)+0.190454(1-T_r)^{4/3}\\V^{(\delta)}=\frac{-0.296123+0.386914T_r-0.0427258T_r^2-0.0480645T_r^3} {T_r-1.00001}\end{aligned}\end{align} \]

Units are that of critical or fit constant volume.

Parameters:

T : float

Temperature of fluid [K]

Tc : float

Critical temperature of fluid [K]

Vc : float

Critical volume of fluid [m^3/mol]. This parameter is alternatively a fit parameter

omega : float

(ideally SRK) Acentric factor for fluid, [-] This parameter is alternatively a fit parameter.

Returns:

Vs : float

Saturation liquid volume

Notes

196 constants are fit to this function in [R13841409]. Range: 0.25 < Tr < 0.95, often said to be to 1.0

This function has been checked with the API handbook example problem.

References

[R13841409](1, 2) Hankinson, Risdon W., and George H. Thomson. “A New Correlation for Saturated Densities of Liquids and Their Mixtures.” AIChE Journal 25, no. 4 (1979): 653-663. doi:10.1002/aic.690250412

Examples

Propane, from an example in the API Handbook

>>> Vm_to_rho(COSTALD(272.03889, 369.83333, 0.20008161E-3, 0.1532), 44.097)
530.3009967969841
thermo.volume.Campbell_Thodos(T, Tb, Tc, Pc, M, dipole=None, hydroxyl=False)[source]

Calculate saturation liquid density using the Campbell-Thodos [R13851410] CSP method.

An old and uncommon estimation method.

\[ \begin{align}\begin{aligned}V_s = \frac{RT_c}{P_c}{Z_{RA}}^{[1+(1-T_r)^{2/7}]}\\Z_{RA} = \alpha + \beta(1-T_r)\\\alpha = 0.3883-0.0179s\\s = T_{br} \frac{\ln P_c}{(1-T_{br})}\\\beta = 0.00318s-0.0211+0.625\Lambda^{1.35}\\\Lambda = \frac{P_c^{1/3}} { M^{1/2} T_c^{5/6}}\end{aligned}\end{align} \]

For polar compounds:

\[ \begin{align}\begin{aligned}\theta = P_c \mu^2/T_c^2\\\alpha = 0.3883 - 0.0179s - 130540\theta^{2.41}\\\beta = 0.00318s - 0.0211 + 0.625\Lambda^{1.35} + 9.74\times 10^6 \theta^{3.38}\end{aligned}\end{align} \]

Polar Combounds with hydroxyl groups (water, alcohols)

\[ \begin{align}\begin{aligned}\alpha = \left[0.690T_{br} -0.3342 + \frac{5.79\times 10^{-10}} {T_{br}^{32.75}}\right] P_c^{0.145}\\\beta = 0.00318s - 0.0211 + 0.625 \Lambda^{1.35} + 5.90\Theta^{0.835}\end{aligned}\end{align} \]
Parameters:

T : float

Temperature of fluid [K]

Tb : float

Boiling temperature of the fluid [K]

Tc : float

Critical temperature of fluid [K]

Pc : float

Critical pressure of fluid [Pa]

M : float

Molecular weight of the fluid [g/mol]

dipole : float, optional

Dipole moment of the fluid [debye]

hydroxyl : bool, optional

Swith to use the hydroxyl variant for polar fluids

Returns:

Vs : float

Saturation liquid volume

Notes

If a dipole is provided, the polar chemical method is used. The paper is an excellent read. Pc is internally converted to atm.

References

[R13851410](1, 2, 3) Campbell, Scott W., and George Thodos. “Prediction of Saturated Liquid Densities and Critical Volumes for Polar and Nonpolar Substances.” Journal of Chemical & Engineering Data 30, no. 1 (January 1, 1985): 102-11. doi:10.1021/je00039a032.

Examples

Ammonia, from [R13851410].

>>> Campbell_Thodos(T=405.45, Tb=239.82, Tc=405.45, Pc=111.7*101325, M=17.03, dipole=1.47)
7.347363635885525e-05
thermo.volume.SNM0(T, Tc, Vc, omega, delta_SRK=None)[source]

Calculates saturated liquid density using the Mchaweh, Moshfeghian model [R13861411]. Designed for simple calculations.

\[ \begin{align}\begin{aligned}V_s = V_c/(1+1.169\tau^{1/3}+1.818\tau^{2/3}-2.658\tau+2.161\tau^{4/3}\\\tau = 1-\frac{(T/T_c)}{\alpha_{SRK}}\\\alpha_{SRK} = [1 + m(1-\sqrt{T/T_C}]^2\\m = 0.480+1.574\omega-0.176\omega^2\end{aligned}\end{align} \]

If the fit parameter delta_SRK is provided, the following is used:

\[V_s = V_C/(1+1.169\tau^{1/3}+1.818\tau^{2/3}-2.658\tau+2.161\tau^{4/3}) /\left[1+\delta_{SRK}(\alpha_{SRK}-1)^{1/3}\right]\]
Parameters:

T : float

Temperature of fluid [K]

Tc : float

Critical temperature of fluid [K]

Vc : float

Critical volume of fluid [m^3/mol]

omega : float

Acentric factor for fluid, [-]

delta_SRK : float, optional

Fitting parameter [-]

Returns:

Vs : float

Saturation liquid volume, [m^3/mol]

Notes

73 fit parameters have been gathered from the article.

References

[R13861411](1, 2) Mchaweh, A., A. Alsaygh, Kh. Nasrifar, and M. Moshfeghian. “A Simplified Method for Calculating Saturated Liquid Densities.” Fluid Phase Equilibria 224, no. 2 (October 1, 2004): 157-67. doi:10.1016/j.fluid.2004.06.054

Examples

Argon, without the fit parameter and with it. Tabulated result in Perry’s is 3.4613e-05. The fit increases the error on this occasion.

>>> SNM0(121, 150.8, 7.49e-05, -0.004)
3.4402256402733416e-05
>>> SNM0(121, 150.8, 7.49e-05, -0.004, -0.03259620)
3.493288100008123e-05
thermo.volume.CRC_inorganic(T, rho0, k, Tm)[source]

Calculates liquid density of a molten element or salt at temperature above the melting point. Some coefficients are given nearly up to the boiling point.

The mass density of the inorganic liquid is given by:

\[\rho = \rho_{0} - k(T-T_m)\]
Parameters:

T : float

Temperature of the liquid, [K]

rho0 : float

Mass density of the liquid at Tm, [kg/m^3]

k : float

Linear temperature dependence of the mass density, [kg/m^3/K]

Tm : float

The normal melting point, used in the correlation [K]

Returns:

rho : float

Mass density of molten metal or salt, [kg/m^3]

Notes

[R13871412] has units of g/mL. While the individual densities could have been converted to molar units, the temperature coefficient could only be converted by refitting to calculated data. To maintain compatibility with the form of the equations, this was not performed.

This linear form is useful only in small temperature ranges. Coefficients for one compound could be used to predict the temperature dependence of density of a similar compound.

References

[R13871412](1, 2) Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of Chemistry and Physics, 95E. [Boca Raton, FL]: CRC press, 2014.

Examples

>>> CRC_inorganic(300, 2370.0, 2.687, 239.08)
2206.30796
thermo.volume.volume_liquid_methods = ['PERRYDIPPR', 'VDI_PPDS', 'COOLPROP', 'MMSNM0FIT', 'VDI_TABULAR', 'HTCOSTALDFIT', 'RACKETTFIT', 'CRC_INORG_L', 'CRC_INORG_L_CONST', 'MMSNM0', 'HTCOSTALD', 'YEN_WOODS_SAT', 'RACKETT', 'YAMADA_GUNN', 'BHIRUD_NORMAL', 'TOWNSEND_HALES', 'CAMPBELL_THODOS']

Holds all low-pressure methods available for the VolumeLiquid class, for use in iterating over them.

thermo.volume.volume_liquid_methods_P = ['COOLPROP', 'COSTALD_COMPRESSED', 'EOS']

Holds all high-pressure methods available for the VolumeLiquid class, for use in iterating over them.

class thermo.volume.VolumeLiquid(MW=None, Tb=None, Tc=None, Pc=None, Vc=None, Zc=None, omega=None, dipole=None, Psat=None, CASRN='', eos=None)[source]

Bases: thermo.utils.TPDependentProperty

Class for dealing with liquid molar volume as a function of temperature and pressure.

For low-pressure (at 1 atm while under the vapor pressure; along the saturation line otherwise) liquids, there are six coefficient-based methods from five data sources, one source of tabular information, one source of constant values, eight corresponding-states estimators, and the external library CoolProp.

For high-pressure liquids (also, <1 atm liquids), there is one corresponding-states estimator, and the external library CoolProp.

Parameters:

CASRN : str, optional

The CAS number of the chemical

MW : float, optional

Molecular weight, [g/mol]

Tb : float, optional

Boiling point, [K]

Tc : float, optional

Critical temperature, [K]

Pc : float, optional

Critical pressure, [Pa]

Vc : float, optional

Critical volume, [m^3/mol]

Zc : float, optional

Critical compressibility

omega : float, optional

Acentric factor, [-]

dipole : float, optional

Dipole, [debye]

Psat : float or callable, optional

Vapor pressure at a given temperature, or callable for the same [Pa]

eos : object, optional

Equation of State object after thermo.eos.GCEOS

Notes

A string holding each method’s name is assigned to the following variables in this module, intended as the most convenient way to refer to a method. To iterate over all methods, use the lists stored in surface_tension_methods and volume_liquid_methods_P for low and high pressure methods respectively.

Low pressure methods:

PERRYDIPPR:
A simple polynomial as expressed in [R13881413], with data available for 344 fluids. Temperature limits are available for all fluids. Believed very accurate.
VDI_PPDS:
Coefficients for a equation form developed by the PPDS, published openly in [R13901413]. Valid up to the critical temperature, and extrapolates to very low temperatures well.
MMSNM0FIT:
Uses a fit coefficient for better accuracy in the SNM0 method, Coefficients available for 73 fluids from [R13891413]. Valid to the critical point.
HTCOSTALDFIT:
A method with two fit coefficients to the COSTALD method. Coefficients available for 192 fluids, from [R13901413]. Valid to the critical point.
RACKETTFIT:
The Racket method, with a fit coefficient Z_RA. Data is available for 186 fluids, from [R13901413]. Valid to the critical point.
CRC_INORG_L:
Single-temperature coefficient linear model in terms of mass density for the density of inorganic liquids; converted to molar units internally. Data is available for 177 fluids normally valid over a narrow range above the melting point, from [R13911413]; described in CRC_inorganic.
MMSNM0:
CSP method, described in SNM0.
HTCOSTALD:
CSP method, described in COSTALD.
YEN_WOODS_SAT:
CSP method, described in Yen_Woods_saturation.
RACKETT:
CSP method, described in Rackett.
YAMADA_GUNN:
CSP method, described in Yamada_Gunn.
BHIRUD_NORMAL:
CSP method, described in Bhirud_normal.
TOWNSEND_HALES:
CSP method, described in Townsend_Hales.
CAMPBELL_THODOS:
CSP method, described in Campbell_Thodos.
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 [R13921413]. Very slow.
CRC_INORG_L_CONST:
Constant inorganic liquid densities, in [R13911413].
VDI_TABULAR:
Tabular data in [R13931413] along the saturation curve; interpolation is as set by the user or the default.

High pressure methods:

COSTALD_COMPRESSED:
CSP method, described in COSTALD_compressed. Calculates a low-pressure molar volume first, using T_dependent_property.
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 [R13921413]. Very slow, but unparalled in accuracy for pressure dependence.
EOS:
Equation of state provided by user.

References

[R13881413](1, 2) Green, Don, and Robert Perry. Perry’s Chemical Engineers’ Handbook, 8E. McGraw-Hill Professional, 2007.
[R13891413](1, 2) Mchaweh, A., A. Alsaygh, Kh. Nasrifar, and M. Moshfeghian. “A Simplified Method for Calculating Saturated Liquid Densities.” Fluid Phase Equilibria 224, no. 2 (October 1, 2004): 157-67. doi:10.1016/j.fluid.2004.06.054
[R13901413](1, 2, 3, 4) Hankinson, Risdon W., and George H. Thomson. “A New Correlation for Saturated Densities of Liquids and Their Mixtures.” AIChE Journal 25, no. 4 (1979): 653-663. doi:10.1002/aic.690250412
[R13911413](1, 2, 3) Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014.
[R13921413](1, 2, 3) 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/
[R13931413](1, 2) Gesellschaft, V. D. I., ed. VDI Heat Atlas. 2nd edition. Berlin; New York:: Springer, 2010.

Attributes

TP_cached  
T_cached  
interpolation_P  
interpolation_T  
interpolation_property  
interpolation_property_inv  
method  
method_P  

Methods

TP_dependent_property(T, P) Method to calculate the property with sanity checking and without specifying a specific method.
TP_dependent_property_derivative_P(T, P[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to pressure at constant temperature, of a given order.
TP_dependent_property_derivative_T(T, P[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to temperature at constant pressure, of a given order.
TP_or_T_dependent_property(T, P)
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, P) Convenience method to calculate the property; calls TP_dependent_property.
calculate(T, method) Method to calculate low-pressure liquid molar volume at tempearture T with a given method.
calculate_P(T, P, method) Method to calculate pressure-dependent liquid molar volume at temperature T and pressure P 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_derivative_P(P, T, method[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to pressure at constant temperature, of a given order using a specified method.
calculate_derivative_T(T, P, method[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to temperature at constant pressure, 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.
interpolate_P(T, P, name) Method to perform interpolation on a given tabular data set previously added via set_tabular_data_P.
load_all_methods() Method which picks out coefficients for the specified chemical from the various dictionaries and DataFrames storing it.
plot_TP_dependent_property([Tmin, Tmax, ...]) Method to create a plot of the property vs temperature and pressure according to either a specified list of methods, or user methods (if set), or all methods.
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.
plot_isobar(P[, Tmin, Tmax, methods_P, pts, ...]) Method to create a plot of the property vs temperature at a specific pressure according to either a specified list of methods, or user methods (if set), or all methods.
plot_isotherm(T[, Pmin, Pmax, methods_P, ...]) Method to create a plot of the property vs pressure at a specified temperature according to either a specified list of methods, or the 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.
select_valid_methods_P(T, P) Method to obtain a sorted list 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_tabular_data_P(Ts, Ps, properties[, ...]) 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.
set_user_methods_P(user_methods_P[, forced_P]) Method to set the pressure-dependent property methods desired for consideration by the user.
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_method_validity_P(T, P, method) Method to check the validity of a high-pressure method.
test_property_validity(prop) Method to test the validity of a calculated property.
Tmax = None

Maximum temperature at which no method can calculate the liquid molar volume above.

Tmin = None

Minimum temperature at which no method can calculate the liquid molar volume under.

all_methods = None

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

all_methods_P = None

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

calculate(T, method)[source]

Method to calculate low-pressure liquid molar volume at tempearture T with a given method.

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

Parameters:

T : float

Temperature at which to calculate molar volume, [K]

method : str

Name of the method to use

Returns:

Vm : float

Molar volume of the liquid at T and a low pressure, [m^3/mol]

calculate_P(T, P, method)[source]

Method to calculate pressure-dependent liquid molar volume at temperature T and pressure P with a given method.

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

Parameters:

T : float

Temperature at which to calculate molar volume, [K]

P : float

Pressure at which to calculate molar volume, [K]

method : str

Name of the method to use

Returns:

Vm : float

Molar volume of the liquid at T and P, [m^3/mol]

interpolation_P = None

No interpolation transformation by default.

interpolation_T = None

No interpolation transformation by default.

interpolation_property = None

No interpolation transformation by default.

interpolation_property_inv = None

No interpolation transformation by default.

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, all_methods and obj:all_methods_P 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.

name = 'Liquid molar volume'
property_max = 0.002

Maximum valid value of liquid molar volume. Generous limit.

property_min = 0

Mimimum valid value of liquid molar volume. It should normally occur at the triple point, and be well above this.

ranked_methods = ['PERRYDIPPR', 'VDI_PPDS', 'COOLPROP', 'MMSNM0FIT', 'VDI_TABULAR', 'HTCOSTALDFIT', 'RACKETTFIT', 'CRC_INORG_L', 'CRC_INORG_L_CONST', 'MMSNM0', 'HTCOSTALD', 'YEN_WOODS_SAT', 'RACKETT', 'YAMADA_GUNN', 'BHIRUD_NORMAL', 'TOWNSEND_HALES', 'CAMPBELL_THODOS', 'EOS']

Default rankings of the low-pressure methods.

ranked_methods_P = ['COOLPROP', 'COSTALD_COMPRESSED', 'EOS']

Default rankings of the high-pressure methods.

sorted_valid_methods = None

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

sorted_valid_methods_P = None

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

tabular_data = None

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

tabular_data_P = None

tabular_data_P, dict: Stored (Ts, Ps, 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_data_interpolators_P = None

tabular_data_interpolators_P, dict: Stored (extrapolator, spline) tuples which are interp2d instances for each set of tabular data; indexed by tuple of (name, interpolation_T, interpolation_P, 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 = True

Allow tabular extrapolation by default.

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.

BHIRUD_NORMAL behaves poorly at low temperatures and is not used under 0.35Tc. The constant value available for inorganic chemicals, from method CRC_INORG_L_CONST, is considered valid for all temperatures.

Parameters:

T : float

Temperature at which to test the method, [K]

method : str

Name of the method to test

Returns:

validity : bool

Whether or not a method is valid

test_method_validity_P(T, P, method)[source]

Method to check the validity of a high-pressure method. For COOLPROP, the fluid must be both a liquid and under the maximum pressure of the fluid’s EOS. COSTALD_COMPRESSED is considered valid for all values of temperature and pressure. However, it very often will not actually work, due to the form of the polynomial in terms of Tr, the result of which is raised to a negative power. 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 and pressures.

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]

P : float

Pressure at which to test the method, [Pa]

method : str

Name of the method to test

Returns:

validity : bool

Whether or not a method is valid

units = 'mol/m^3'
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.

user_methods_P = None

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

thermo.volume.COSTALD_compressed(T, P, Psat, Tc, Pc, omega, Vs)[source]

Calculates compressed-liquid volume, using the COSTALD [R13941419] CSP method and a chemical’s critical properties.

The molar volume of a liquid is given by:

\[ \begin{align}\begin{aligned}V = V_s\left( 1 - C \ln \frac{B + P}{B + P^{sat}}\right)\\\frac{B}{P_c} = -1 + a\tau^{1/3} + b\tau^{2/3} + d\tau + e\tau^{4/3}\\e = \exp(f + g\omega_{SRK} + h \omega_{SRK}^2)\\C = j + k \omega_{SRK}\end{aligned}\end{align} \]
Parameters:

T : float

Temperature of fluid [K]

P : float

Pressure of fluid [Pa]

Psat : float

Saturation pressure of the fluid [Pa]

Tc : float

Critical temperature of fluid [K]

Pc : float

Critical pressure of fluid [Pa]

omega : float

(ideally SRK) Acentric factor for fluid, [-] This parameter is alternatively a fit parameter.

Vs : float

Saturation liquid volume, [m^3/mol]

Returns:

V_dense : float

High-pressure liquid volume, [m^3/mol]

Notes

Original equation was in terms of density, but it is converted here.

The example is from DIPPR, and exactly correct. This is DIPPR Procedure 4C: Method for Estimating the Density of Pure Organic Liquids under Pressure.

References

[R13941419](1, 2) Thomson, G. H., K. R. Brobst, and R. W. Hankinson. “An Improved Correlation for Densities of Compressed Liquids and Liquid Mixtures.” AIChE Journal 28, no. 4 (July 1, 1982): 671-76. doi:10.1002/aic.690280420

Examples

>>> COSTALD_compressed(303., 9.8E7, 85857.9, 466.7, 3640000.0, 0.281, 0.000105047)
9.287482879788506e-05
thermo.volume.Amgat(xs, Vms)[source]

Calculate mixture liquid density using the Amgat mixing rule. Highly inacurate, but easy to use. Assumes idea liquids with no excess volume. Average molecular weight should be used with it to obtain density.

\[V_{mix} = \sum_i x_i V_i\]

or in terms of density:

\[\rho_{mix} = \sum\frac{x_i}{\rho_i}\]
Parameters:

xs: array

Mole fractions of each component, []

Vms : array

Molar volumes of each fluids at conditions [m^3/mol]

Returns:

Vm : float

Mixture liquid volume [m^3/mol]

Notes

Units are that of the given volumes. It has been suggested to use this equation with weight fractions, but the results have been less accurate.

Examples

>>> Amgat([0.5, 0.5], [4.057e-05, 5.861e-05])
4.9590000000000005e-05
thermo.volume.Rackett_mixture(T, xs, MWs, Tcs, Pcs, Zrs)[source]

Calculate mixture liquid density using the Rackett-derived mixing rule as shown in [R13961420].

\[V_m = \sum_i\frac{x_i T_{ci}}{MW_i P_{ci}} Z_{R,m}^{(1 + (1 - T_r)^{2/7})} R \sum_i x_i MW_i\]
Parameters:

T : float

Temperature of liquid [K]

xs: list

Mole fractions of each component, []

MWs : list

Molecular weights of each component [g/mol]

Tcs : list

Critical temperatures of each component [K]

Pcs : list

Critical pressures of each component [Pa]

Zrs : list

Rackett parameters of each component []

Returns:

Vm : float

Mixture liquid volume [m^3/mol]

Notes

Model for pure compounds in [R13951420] forms the basis for this model, shown in [R13961420]. Molecular weights are used as weighing by such has been found to provide higher accuracy in [R13961420]. The model can also be used without molecular weights, but results are somewhat different.

As with the Rackett model, critical compressibilities may be used if Rackett parameters have not been regressed.

Critical mixture temperature, and compressibility are all obtained with simple mixing rules.

References

[R13951420](1, 2) Rackett, Harold G. “Equation of State for Saturated Liquids.” Journal of Chemical & Engineering Data 15, no. 4 (1970): 514-517. doi:10.1021/je60047a012
[R13961420](1, 2, 3, 4, 5) Danner, Ronald P, and Design Institute for Physical Property Data. Manual for Predicting Chemical Process Design Data. New York, N.Y, 1982.

Examples

Calculation in [R13961420] for methanol and water mixture. Result matches example.

>>> Rackett_mixture(T=298., xs=[0.4576, 0.5424], MWs=[32.04, 18.01], Tcs=[512.58, 647.29], Pcs=[8.096E6, 2.209E7], Zrs=[0.2332, 0.2374])
2.625288603174508e-05
thermo.volume.COSTALD_mixture(xs, T, Tcs, Vcs, omegas)[source]

Calculate mixture liquid density using the COSTALD CSP method.

A popular and accurate estimation method. If possible, fit parameters are used; alternatively critical properties work well.

The mixing rules giving parameters for the pure component COSTALD equation are:

\[ \begin{align}\begin{aligned}T_{cm} = \frac{\sum_i\sum_j x_i x_j (V_{ij}T_{cij})}{V_m}\\V_m = 0.25\left[ \sum x_i V_i + 3(\sum x_i V_i^{2/3})(\sum_i x_i V_i^{1/3})\right]\\V_{ij}T_{cij} = (V_iT_{ci}V_{j}T_{cj})^{0.5}\\\omega = \sum_i z_i \omega_i\end{aligned}\end{align} \]
Parameters:

xs: list

Mole fractions of each component

T : float

Temperature of fluid [K]

Tcs : list

Critical temperature of fluids [K]

Vcs : list

Critical volumes of fluids [m^3/mol]. This parameter is alternatively a fit parameter

omegas : list

(ideally SRK) Acentric factor of all fluids, [-] This parameter is alternatively a fit parameter.

Returns:

Vs : float

Saturation liquid mixture volume

Notes

Range: 0.25 < Tr < 0.95, often said to be to 1.0 No example has been found. Units are that of critical or fit constant volume.

References

[R13971422]Hankinson, Risdon W., and George H. Thomson. “A New Correlation for Saturated Densities of Liquids and Their Mixtures.” AIChE Journal 25, no. 4 (1979): 653-663. doi:10.1002/aic.690250412

Examples

>>> COSTALD_mixture([0.4576, 0.5424], 298.,  [512.58, 647.29],[0.000117, 5.6e-05], [0.559,0.344] )
2.706588773271354e-05
thermo.volume.ideal_gas(T, P)[source]

Calculates ideal gas molar volume. The molar volume of an ideal gas is given by:

\[V = \frac{RT}{P}\]
Parameters:

T : float

Temperature of fluid [K]

P : float

Pressure of fluid [Pa]

Returns:

V : float

Gas volume, [m^3/mol]

Examples

>>> ideal_gas(298.15, 101325.)
0.02446539540458919
thermo.volume.volume_gas_methods = ['COOLPROP', 'EOS', 'CRC_VIRIAL', 'TSONOPOULOS_EXTENDED', 'TSONOPOULOS', 'ABBOTT', 'PITZER_CURL', 'IDEAL']

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

class thermo.volume.VolumeGas(CASRN='', MW=None, Tc=None, Pc=None, omega=None, dipole=None, eos=None)[source]

Bases: thermo.utils.TPDependentProperty

Class for dealing with gas molar volume as a function of temperature and pressure.

All considered methods are both temperature and pressure dependent. Included are four CSP methods for calculating second virial coefficients, one source of polynomials for calculating second virial coefficients, one equation of state (Peng-Robinson), and the ideal gas law.

Parameters:

CASRN : str, optional

The CAS number of the chemical

MW : float, optional

Molecular weight, [g/mol]

Tc : float, optional

Critical temperature, [K]

Pc : float, optional

Critical pressure, [Pa]

omega : float, optional

Acentric factor, [-]

dipole : float, optional

Dipole, [debye]

Notes

A string holding each method’s name is assigned to the following variables in this module, intended as the most convenient way to refer to a method. To iterate over all methods, use the list stored in volume_gas_methods.

PR:
Peng-Robinson Equation of State. See the appropriate module for more information.
CRC_VIRIAL:

Short polynomials, for 105 fluids from [R13981423]. The full expression is:

\[B = \sum_1^4 a_i\left[T_0/298.15-1\right]^{i-1}\]
TSONOPOULOS_EXTENDED:
CSP method for second virial coefficients, described in thermo.virial.BVirial_Tsonopoulos_extended
TSONOPOULOS:
CSP method for second virial coefficients, described in thermo.virial.BVirial_Tsonopoulos
ABBOTT:
CSP method for second virial coefficients, described in thermo.virial.BVirial_Abbott. This method is the simplest CSP method implemented.
PITZER_CURL:
CSP method for second virial coefficients, described in thermo.virial.BVirial_Pitzer_Curl.
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 [R13991423]. Very slow, but unparalled in accuracy for pressure dependence.

References

[R13981423](1, 2) Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014.
[R13991423](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/

Attributes

TP_cached  
T_cached  
interpolation_P  
interpolation_T  
interpolation_property  
interpolation_property_inv  
method  
method_P  

Methods

TP_dependent_property(T, P) Method to calculate the property with sanity checking and without specifying a specific method.
TP_dependent_property_derivative_P(T, P[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to pressure at constant temperature, of a given order.
TP_dependent_property_derivative_T(T, P[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to temperature at constant pressure, of a given order.
TP_or_T_dependent_property(T, P)
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, P) Convenience method to calculate the property; calls TP_dependent_property.
calculate(T, method) Method to calculate a property with a specified method, with no validity checking or error handling.
calculate_P(T, P, method) Method to calculate pressure-dependent gas molar volume at temperature T and pressure P 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_derivative_P(P, T, method[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to pressure at constant temperature, of a given order using a specified method.
calculate_derivative_T(T, P, method[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to temperature at constant pressure, 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.
interpolate_P(T, P, name) Method to perform interpolation on a given tabular data set previously added via set_tabular_data_P.
load_all_methods() Method which picks out coefficients for the specified chemical from the various dictionaries and DataFrames storing it.
plot_TP_dependent_property([Tmin, Tmax, ...]) Method to create a plot of the property vs temperature and pressure according to either a specified list of methods, or user methods (if set), or all methods.
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.
plot_isobar(P[, Tmin, Tmax, methods_P, pts, ...]) Method to create a plot of the property vs temperature at a specific pressure according to either a specified list of methods, or user methods (if set), or all methods.
plot_isotherm(T[, Pmin, Pmax, methods_P, ...]) Method to create a plot of the property vs pressure at a specified temperature according to either a specified list of methods, or the 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.
select_valid_methods_P(T, P) Method to obtain a sorted list 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_tabular_data_P(Ts, Ps, properties[, ...]) 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.
set_user_methods_P(user_methods_P[, forced_P]) Method to set the pressure-dependent property methods desired for consideration by the user.
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 test the validity of a specified method for a given temperature.
test_method_validity_P(T, P, method) Method to check the validity of a pressure and temperature dependent gas molar volume method.
test_property_validity(prop) Method to test the validity of a calculated property.
Pmax = 1000000000.0

Maximum pressure at which no method can calculate gas molar volume above.

Pmin = 0

Minimum pressure at which no method can calculate gas molar volume under.

Tmax = None

Maximum temperature at which no method can calculate the gas molar volume above.

Tmin = None

Minimum temperature at which no method can calculate the gas molar volume under.

all_methods_P = None

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

calculate_P(T, P, method)[source]

Method to calculate pressure-dependent gas molar volume at temperature T and pressure P with a given method.

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

Parameters:

T : float

Temperature at which to calculate molar volume, [K]

P : float

Pressure at which to calculate molar volume, [K]

method : str

Name of the method to use

Returns:

Vm : float

Molar volume of the gas at T and P, [m^3/mol]

interpolation_P = None

No interpolation transformation by default.

interpolation_T = None

No interpolation transformation by default.

interpolation_property = None

No interpolation transformation by default.

interpolation_property_inv = None

No interpolation transformation by default.

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 obj:all_methods_P 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.

name = 'Gas molar volume'
property_max = 10000000000.0

Maximum valid value of gas molar volume. Set roughly at an ideal gas at 1 Pa and 2 billion K.

property_min = 0

Mimimum valid value of gas molar volume. It should normally be well above this.

ranked_methods = []

Default rankings of the low-pressure methods.

ranked_methods_P = ['COOLPROP', 'EOS', 'TSONOPOULOS_EXTENDED', 'TSONOPOULOS', 'ABBOTT', 'PITZER_CURL', 'CRC_VIRIAL', 'IDEAL']

Default rankings of the pressure-dependent methods.

sorted_valid_methods_P = None

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

tabular_data = None

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

tabular_data_P = None

tabular_data_P, dict: Stored (Ts, Ps, 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_data_interpolators_P = None

tabular_data_interpolators_P, dict: Stored (extrapolator, spline) tuples which are interp2d instances for each set of tabular data; indexed by tuple of (name, interpolation_T, interpolation_P, 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 = True

Allow tabular extrapolation by default.

test_method_validity_P(T, P, method)[source]

Method to check the validity of a pressure and temperature dependent gas molar volume method. For the four CSP methods that calculate second virial coefficient, the method is considered valid for all temperatures and pressures, with validity checking based on the result only. For CRC_VIRIAL, there is no limit but there should be one; at some conditions, a negative volume will result! For COOLPROP, the fluid must be both a gas at the given conditions and under the maximum pressure of the fluid’s EOS.

For the equation of state PR, the determined phase must be a gas. For IDEAL, there are no limits.

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 and pressures.

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]

P : float

Pressure at which to test the method, [Pa]

method : str

Name of the method to test

Returns:

validity : bool

Whether or not a method is valid

units = 'mol/m^3'
user_methods_P = None

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

thermo.volume.Goodman(T, Tt, rhol)[source]

Calculates solid density at T using the simple relationship by a member of the DIPPR.

The molar volume of a solid is given by:

\[\frac{1}{V_m} = \left( 1.28 - 0.16 \frac{T}{T_t}\right) \frac{1}{{Vm}_L(T_t)}\]
Parameters:

T : float

Temperature of fluid [K]

Tt : float

Triple temperature of fluid [K]

rhol : float

Liquid density, [m^3/mol]

Returns:

rhos : float

Solid volume, [m^3/mol]

Notes

Works to the next solid transition temperature or to approximately 0.3Tt.

References

[R14001425]Goodman, Benjamin T., W. Vincent Wilding, John L. Oscarson, and Richard L. Rowley. “A Note on the Relationship between Organic Solid Density and Liquid Density at the Triple Point.” Journal of Chemical & Engineering Data 49, no. 6 (2004): 1512-14. doi:10.1021/je034220e.

Examples

>>> Goodman(281.46, 353.43, 7.6326)
8.797191839062899
thermo.volume.volume_solid_methods = ['GOODMAN', 'CRC_INORG_S']

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

class thermo.volume.VolumeSolid(CASRN='', MW=None, Tt=None, Vml_Tt=None)[source]

Bases: thermo.utils.TDependentProperty

Class for dealing with solid molar volume as a function of temperature. Consists of one constant value source, and one simple estimator based on liquid molar volume.

Parameters:

CASRN : str, optional

CAS number

MW : float, optional

Molecular weight, [g/mol]

Tt : float, optional

Triple temperature

Vml_Tt : float, optional

Liquid molar volume at the triple point

See also

Goodman

Notes

A string holding each method’s name is assigned to the following variables in this module, intended as the most convenient way to refer to a method. To iterate over all methods, use the list stored in volume_solid_methods.

CRC_INORG_S:
Constant values in [R14011426], for 1872 chemicals.
GOODMAN:
Simple method using the liquid molar volume. Good up to 0.3*Tt. See Goodman for details.

References

[R14011426](1, 2) Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014.

Attributes

T_cached  
interpolation_T  
interpolation_property  
interpolation_property_inv  
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 the molar volume of a solid at tempearture 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.
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 the solid molar volume above; assumed 10 000 K even under ultra-high pressure.

Tmin = None

Minimum temperature at which no method can calculate the solid molar volume 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 the molar volume of a solid at tempearture T with a given method.

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

Parameters:

T : float

Temperature at which to calculate molar volume, [K]

method : str

Name of the method to use

Returns:

Vms : float

Molar volume of the solid at T, [m^3/mol]

interpolation_T = None

No interpolation transformation by default.

interpolation_property = None

No interpolation transformation by default.

interpolation_property_inv = None

No interpolation transformation by default.

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.

name = 'Solid molar volume'
property_max = 0.002

Maximum value of Heat capacity; arbitrarily set to 0.002, as the largest in the data is 0.00136.

property_min = 0

Molar volume cannot be under 0.

ranked_methods = ['CRC_INORG_S']

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 = True

Allow tabular extrapolation by default.

test_method_validity(T, method)[source]

Method to check the validity of a method. Follows the given ranges for all coefficient-based methods. 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

Returns:

validity : bool

Whether or not a method is valid

units = 'mol/m^3'
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.

class thermo.volume.VolumeLiquidMixture(MWs=[], Tcs=[], Pcs=[], Vcs=[], Zcs=[], omegas=[], CASs=[], VolumeLiquids=[])[source]

Bases: thermo.utils.MixtureProperty

Class for dealing with the molar volume of a liquid mixture as a function of temperature, pressure, and composition. Consists of one electrolyte-specific method, four corresponding states methods which do not use pure-component volumes, and one mole-weighted averaging method.

Prefered method is SIMPLE, or Laliberte if the mixture is aqueous and has electrolytes.

Parameters:

MWs : list[float], optional

Molecular weights of all species in the mixture, [g/mol]

Tcs : list[float], optional

Critical temperatures of all species in the mixture, [K]

Pcs : list[float], optional

Critical pressures of all species in the mixture, [Pa]

Vcs : list[float], optional

Critical molar volumes of all species in the mixture, [m^3/mol]

Zcs : list[float], optional

Critical compressibility factors of all species in the mixture, [Pa]

omegas : list[float], optional

Accentric factors of all species in the mixture, [-]

CASs : list[str], optional

The CAS numbers of all species in the mixture

VolumeLiquids : list[VolumeLiquid], optional

VolumeLiquid objects created for all species in the mixture, normally created by thermo.chemical.Chemical.

Notes

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

Laliberte:
Aqueous electrolyte model equation with coefficients; see thermo.electrochem.Laliberte_density for more details.
COSTALD mixture:
CSP method described in COSTALD_mixture.
COSTALD mixture parameters:
CSP method described in COSTALD_mixture, with two mixture composition independent fit coefficients, Vc and omega.
RACKETT:
CSP method described in Rackett_mixture.
RACKETT Parameters:
CSP method described in Rackett_mixture, but with a mixture independent fit coefficient for compressibility factor for each species.
SIMPLE:
Linear mole fraction mixing rule described in thermo.utils.mixing_simple; also known as Amgat’s law.

References

[R14021427]Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.

Attributes

TP_zs_ws_cached  
method  
prop_cached  

Methods

__call__(T, P, zs, ws) Convenience method to calculate the property; calls mixture_property.
calculate(T, P, zs, ws, method) Method to calculate molar volume of a liquid mixture at temperature T, pressure P, mole fractions zs and weight fractions ws with a given method.
calculate_derivative_P(P, T, zs, ws, method) Method to calculate a derivative of a mixture property with respect to pressure at constant temperature and composition of a given order using a specified method.
calculate_derivative_T(T, P, zs, ws, method) Method to calculate a derivative of a mixture property with respect to temperature at constant pressure and composition of a given order using a specified method.
load_all_methods() Method to initialize the object by precomputing any values which may be used repeatedly and by retrieving mixture-specific variables.
mixture_property(T, P, zs, ws) Method to calculate the property with sanity checking and without specifying a specific method.
plot_isobar(P, zs, ws[, Tmin, Tmax, ...]) Method to create a plot of the property vs temperature at a specific pressure and composition according to either a specified list of methods, or user methods (if set), or all methods.
plot_isotherm(T, zs, ws[, Pmin, Pmax, ...]) Method to create a plot of the property vs pressure at a specified temperature and composition according to either a specified list of methods, or the user methods (if set), or all methods.
plot_property(zs, ws[, Tmin, Tmax, Pmin, ...]) Method to create a plot of the property vs temperature and pressure according to either a specified list of methods, or user methods (if set), or all methods.
property_derivative_P(T, P, zs, ws[, order]) Method to calculate a derivative of a mixture property with respect to pressure at constant temperature and composition, of a given order.
property_derivative_T(T, P, zs, ws[, order]) Method to calculate a derivative of a mixture property with respect to temperature at constant pressure and composition, of a given order.
select_valid_methods(T, P, zs, ws) Method to obtain a sorted list of methods which are valid at T, P, zs, ws, and possibly Vfls, according to test_method_validity.
set_user_method(user_methods[, forced]) Method to set the T, P, and composition dependent property methods desired for consideration by the user.
test_method_validity(T, P, zs, ws, method) Method to test the validity of a specified method for the given conditions.
test_property_validity(prop) Method to test the validity of a calculated property.
Tmax = None

Maximum temperature at which no method can calculate the liquid molar volume above.

Tmin = None

Minimum temperature at which no method can calculate the liquid molar volume under.

all_methods = None

Set of all methods available for a given set of information; filled by load_all_methods.

calculate(T, P, zs, ws, method)[source]

Method to calculate molar volume of a liquid mixture at temperature T, pressure P, mole fractions zs and weight fractions ws with a given method.

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

Parameters:

T : float

Temperature at which to calculate the property, [K]

P : float

Pressure at which to calculate the property, [Pa]

zs : list[float]

Mole fractions of all species in the mixture, [-]

ws : list[float]

Weight fractions of all species in the mixture, [-]

method : str

Name of the method to use

Returns:

Vm : float

Molar volume of the liquid mixture at the given conditions, [m^3/mol]

load_all_methods()[source]

Method to initialize the object by precomputing any values which may be used repeatedly and by retrieving mixture-specific variables. All data are stored as attributes. This method also sets Tmin, Tmax, and all_methods as a set of methods which should work to calculate the property.

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.

name = 'Liquid volume'
property_max = 0.002

Maximum valid value of liquid molar volume. Generous limit.

property_min = 0

Mimimum valid value of liquid molar volume. It should normally occur at the triple point, and be well above this.

ranked_methods = ['Laliberte', 'SIMPLE', 'COSTALD mixture parameters', 'RACKETT Parameters', 'COSTALD mixture', 'RACKETT']
sorted_valid_methods = None

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

test_method_validity(T, P, zs, ws, method)[source]

Method to test the validity of a specified method for the given conditions. No methods have implemented checks or strict ranges of validity.

Parameters:

T : float

Temperature at which to check method validity, [K]

P : float

Pressure at which to check method validity, [Pa]

zs : list[float]

Mole fractions of all species in the mixture, [-]

ws : list[float]

Weight fractions of all species in the mixture, [-]

method : str

Method name to use

Returns:

validity : bool

Whether or not a specifid method is valid

units = 'm^3/mol'
user_methods = None

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

class thermo.volume.VolumeGasMixture(eos=None, CASs=[], VolumeGases=[])[source]

Bases: thermo.utils.MixtureProperty

Class for dealing with the molar volume of a gas mixture as a function of temperature, pressure, and composition. Consists of an equation of state, the ideal gas law, and one mole-weighted averaging method.

Prefered method is EOS, or IDEAL if critical properties of components are unavailable.

Parameters:

CASs : list[str], optional

The CAS numbers of all species in the mixture

VolumeGases : list[VolumeGas], optional

VolumeGas objects created for all species in the mixture, normally created by thermo.chemical.Chemical.

eos : container[EOS Object], optional

Equation of state object, normally created by thermo.chemical.Mixture.

Notes

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

EOS:
Equation of State object, normally provided by thermo.chemical.Mixture. See thermo.eos_mix for more details.
SIMPLE:
Linear mole fraction mixing rule described in thermo.utils.mixing_simple; more correct than the ideal gas law.
IDEAL:
The ideal gas law.

References

[R14031428]Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.

Attributes

TP_zs_ws_cached  
method  
prop_cached  

Methods

__call__(T, P, zs, ws) Convenience method to calculate the property; calls mixture_property.
calculate(T, P, zs, ws, method) Method to calculate molar volume of a gas mixture at temperature T, pressure P, mole fractions zs and weight fractions ws with a given method.
calculate_derivative_P(P, T, zs, ws, method) Method to calculate a derivative of a mixture property with respect to pressure at constant temperature and composition of a given order using a specified method.
calculate_derivative_T(T, P, zs, ws, method) Method to calculate a derivative of a mixture property with respect to temperature at constant pressure and composition of a given order using a specified method.
load_all_methods() Method to initialize the object by precomputing any values which may be used repeatedly and by retrieving mixture-specific variables.
mixture_property(T, P, zs, ws) Method to calculate the property with sanity checking and without specifying a specific method.
plot_isobar(P, zs, ws[, Tmin, Tmax, ...]) Method to create a plot of the property vs temperature at a specific pressure and composition according to either a specified list of methods, or user methods (if set), or all methods.
plot_isotherm(T, zs, ws[, Pmin, Pmax, ...]) Method to create a plot of the property vs pressure at a specified temperature and composition according to either a specified list of methods, or the user methods (if set), or all methods.
plot_property(zs, ws[, Tmin, Tmax, Pmin, ...]) Method to create a plot of the property vs temperature and pressure according to either a specified list of methods, or user methods (if set), or all methods.
property_derivative_P(T, P, zs, ws[, order]) Method to calculate a derivative of a mixture property with respect to pressure at constant temperature and composition, of a given order.
property_derivative_T(T, P, zs, ws[, order]) Method to calculate a derivative of a mixture property with respect to temperature at constant pressure and composition, of a given order.
select_valid_methods(T, P, zs, ws) Method to obtain a sorted list of methods which are valid at T, P, zs, ws, and possibly Vfls, according to test_method_validity.
set_user_method(user_methods[, forced]) Method to set the T, P, and composition dependent property methods desired for consideration by the user.
test_method_validity(T, P, zs, ws, method) Method to test the validity of a specified method for the given conditions.
test_property_validity(prop) Method to test the validity of a calculated property.
Tmax = None

Maximum temperature at which no method can calculate the gas molar volume above.

Tmin = None

Minimum temperature at which no method can calculate the gas molar volume under.

all_methods = None

Set of all methods available for a given set of information; filled by load_all_methods.

calculate(T, P, zs, ws, method)[source]

Method to calculate molar volume of a gas mixture at temperature T, pressure P, mole fractions zs and weight fractions ws with a given method.

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

Parameters:

T : float

Temperature at which to calculate the property, [K]

P : float

Pressure at which to calculate the property, [Pa]

zs : list[float]

Mole fractions of all species in the mixture, [-]

ws : list[float]

Weight fractions of all species in the mixture, [-]

method : str

Name of the method to use

Returns:

Vm : float

Molar volume of the gas mixture at the given conditions, [m^3/mol]

load_all_methods()[source]

Method to initialize the object by precomputing any values which may be used repeatedly and by retrieving mixture-specific variables. All data are stored as attributes. This method also sets Tmin, Tmax, and all_methods as a set of methods which should work to calculate the property.

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.

name = 'Gas volume'
property_max = 10000000000.0

Maximum valid value of gas molar volume. Set roughly at an ideal gas at 1 Pa and 2 billion K.

property_min = 0

Mimimum valid value of gas molar volume. It should normally be well above this.

ranked_methods = ['EOS', 'SIMPLE', 'IDEAL']
sorted_valid_methods = None

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

test_method_validity(T, P, zs, ws, method)[source]

Method to test the validity of a specified method for the given conditions. No methods have implemented checks or strict ranges of validity.

Parameters:

T : float

Temperature at which to check method validity, [K]

P : float

Pressure at which to check method validity, [Pa]

zs : list[float]

Mole fractions of all species in the mixture, [-]

ws : list[float]

Weight fractions of all species in the mixture, [-]

method : str

Method name to use

Returns:

validity : bool

Whether or not a specifid method is valid

units = 'm^3/mol'
user_methods = None

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

class thermo.volume.VolumeSolidMixture(CASs=[], VolumeSolids=[])[source]

Bases: thermo.utils.MixtureProperty

Class for dealing with the molar volume of a solid mixture as a function of temperature, pressure, and composition. Consists of only mole-weighted averaging.

Parameters:

CASs : list[str], optional

The CAS numbers of all species in the mixture

VolumeSolids : list[VolumeSolid], optional

VolumeSolid objects created for all species in the mixture, normally created by thermo.chemical.Chemical.

Notes

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

SIMPLE:
Linear mole fraction mixing rule described in thermo.utils.mixing_simple.

Attributes

TP_zs_ws_cached  
method  
prop_cached  

Methods

__call__(T, P, zs, ws) Convenience method to calculate the property; calls mixture_property.
calculate(T, P, zs, ws, method) Method to calculate molar volume of a solid mixture at temperature T, pressure P, mole fractions zs and weight fractions ws with a given method.
calculate_derivative_P(P, T, zs, ws, method) Method to calculate a derivative of a mixture property with respect to pressure at constant temperature and composition of a given order using a specified method.
calculate_derivative_T(T, P, zs, ws, method) Method to calculate a derivative of a mixture property with respect to temperature at constant pressure and composition of a given order using a specified method.
load_all_methods() Method to initialize the object by precomputing any values which may be used repeatedly and by retrieving mixture-specific variables.
mixture_property(T, P, zs, ws) Method to calculate the property with sanity checking and without specifying a specific method.
plot_isobar(P, zs, ws[, Tmin, Tmax, ...]) Method to create a plot of the property vs temperature at a specific pressure and composition according to either a specified list of methods, or user methods (if set), or all methods.
plot_isotherm(T, zs, ws[, Pmin, Pmax, ...]) Method to create a plot of the property vs pressure at a specified temperature and composition according to either a specified list of methods, or the user methods (if set), or all methods.
plot_property(zs, ws[, Tmin, Tmax, Pmin, ...]) Method to create a plot of the property vs temperature and pressure according to either a specified list of methods, or user methods (if set), or all methods.
property_derivative_P(T, P, zs, ws[, order]) Method to calculate a derivative of a mixture property with respect to pressure at constant temperature and composition, of a given order.
property_derivative_T(T, P, zs, ws[, order]) Method to calculate a derivative of a mixture property with respect to temperature at constant pressure and composition, of a given order.
select_valid_methods(T, P, zs, ws) Method to obtain a sorted list of methods which are valid at T, P, zs, ws, and possibly Vfls, according to test_method_validity.
set_user_method(user_methods[, forced]) Method to set the T, P, and composition dependent property methods desired for consideration by the user.
test_method_validity(T, P, zs, ws, method) Method to test the validity of a specified method for the given conditions.
test_property_validity(prop) Method to test the validity of a calculated property.
Tmax = None

Maximum temperature at which no method can calculate the solid molar volume above; assumed 10 000 K even under ultra-high pressure.

Tmin = None

Minimum temperature at which no method can calculate the solid molar volume under.

all_methods = None

Set of all methods available for a given set of information; filled by load_all_methods.

calculate(T, P, zs, ws, method)[source]

Method to calculate molar volume of a solid mixture at temperature T, pressure P, mole fractions zs and weight fractions ws with a given method.

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

Parameters:

T : float

Temperature at which to calculate the property, [K]

P : float

Pressure at which to calculate the property, [Pa]

zs : list[float]

Mole fractions of all species in the mixture, [-]

ws : list[float]

Weight fractions of all species in the mixture, [-]

method : str

Name of the method to use

Returns:

Vm : float

Molar volume of the solid mixture at the given conditions, [m^3/mol]

load_all_methods()[source]

Method to initialize the object by precomputing any values which may be used repeatedly and by retrieving mixture-specific variables. All data are stored as attributes. This method also sets Tmin, Tmax, and all_methods as a set of methods which should work to calculate the property.

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.

name = 'Solid molar volume'
property_max = 0.002

Maximum value of Heat capacity; arbitrarily set to 0.002, as the largest in the data is 0.00136.

property_min = 0

Molar volume cannot be under 0.

ranked_methods = ['SIMPLE']
sorted_valid_methods = None

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

test_method_validity(T, P, zs, ws, method)[source]

Method to test the validity of a specified method for the given conditions. No methods have implemented checks or strict ranges of validity.

Parameters:

T : float

Temperature at which to check method validity, [K]

P : float

Pressure at which to check method validity, [Pa]

zs : list[float]

Mole fractions of all species in the mixture, [-]

ws : list[float]

Weight fractions of all species in the mixture, [-]

method : str

Method name to use

Returns:

validity : bool

Whether or not a specifid method is valid

units = 'm^3/mol'
user_methods = None

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