thermo.heat_capacity module¶

thermo.heat_capacity.
Lastovka_Shaw
(T, similarity_variable, cyclic_aliphatic=False)[source]¶ Calculate idealgas constantpressure heat capacitiy with the similarity variable concept and method as shown in [R814847].
\[\begin{split}C_p^0 = \left(A_2 + \frac{A_1  A_2}{1 + \exp(\frac{\alphaA_3}{A_4})}\right) + (B_{11} + B_{12}\alpha)\left(\frac{(C_{11} + C_{12}\alpha)}{T}\right)^2 \frac{\exp((C_{11} + C_{12}\alpha)/T)}{[1\exp((C_{11}+C_{12}\alpha)/T)]^2}\\ + (B_{21} + B_{22}\alpha)\left(\frac{(C_{21} + C_{22}\alpha)}{T}\right)^2 \frac{\exp((C_{21} + C_{22}\alpha)/T)}{[1\exp((C_{21}+C_{22}\alpha)/T)]^2}\end{split}\]Parameters: T : float
Temperature of gas [K]
similarity_variable : float
similarity variable as defined in [R814847], [mol/g]
Returns: Cpg : float
Gas constantpressure heat capacitiy, [J/kg/K]
Notes
Original model is in terms of J/g/K. Note that the model is for predicting mass heat capacity, not molar heat capacity like most other methods!
A1 = 0.58, A2 = 1.25, A3 = 0.17338003, A4 = 0.014, B11 = 0.73917383, B12 = 8.88308889, C11 = 1188.28051, C12 = 1813.04613, B21 = 0.0483019, B22 = 4.35656721, C21 = 2897.01927, C22 = 5987.80407.
References
[R814847] (1, 2, 3) Lastovka, Vaclav, and John M. Shaw. “Predictive Correlations for Ideal Gas Heat Capacities of Pure Hydrocarbons and Petroleum Fractions.” Fluid Phase Equilibria 356 (October 25, 2013): 338370. doi:10.1016/j.fluid.2013.07.023. Examples
>>> Lastovka_Shaw(1000.0, 0.1333) 2467.113309084757

thermo.heat_capacity.
Lastovka_Shaw_integral
(T, similarity_variable, cyclic_aliphatic=False)[source]¶ Calculate the integral of idealgas constantpressure heat capacitiy with the similarity variable concept and method as shown in [R815848].
Parameters: T : float
Temperature of gas [K]
similarity_variable : float
similarity variable as defined in [R815848], [mol/g]
Returns: H : float
Difference in enthalpy from 0 K, [J/kg]
See also
Notes
Original model is in terms of J/g/K. Note that the model is for predicting mass heat capacity, not molar heat capacity like most other methods! Integral was computed with SymPy.
References
[R815848] (1, 2, 3) Lastovka, Vaclav, and John M. Shaw. “Predictive Correlations for Ideal Gas Heat Capacities of Pure Hydrocarbons and Petroleum Fractions.” Fluid Phase Equilibria 356 (October 25, 2013): 338370. doi:10.1016/j.fluid.2013.07.023. Examples
>>> Lastovka_Shaw_integral(300.0, 0.1333) 5283095.816018478

thermo.heat_capacity.
Lastovka_Shaw_integral_over_T
(T, similarity_variable, cyclic_aliphatic=False)[source]¶ Calculate the integral over temperature of idealgas constantpressure heat capacitiy with the similarity variable concept and method as shown in [R816849].
Parameters: T : float
Temperature of gas [K]
similarity_variable : float
similarity variable as defined in [R816849], [mol/g]
Returns: S : float
Difference in entropy from 0 K, [J/kg/K]
See also
Notes
Original model is in terms of J/g/K. Note that the model is for predicting mass heat capacity, not molar heat capacity like most other methods! Integral was computed with SymPy.
References
[R816849] (1, 2, 3) Lastovka, Vaclav, and John M. Shaw. “Predictive Correlations for Ideal Gas Heat Capacities of Pure Hydrocarbons and Petroleum Fractions.” Fluid Phase Equilibria 356 (October 25, 2013): 338370. doi:10.1016/j.fluid.2013.07.023. Examples
>>> Lastovka_Shaw_integral_over_T(300.0, 0.1333) 3609.791928945323

thermo.heat_capacity.
TRCCp
(T, a0, a1, a2, a3, a4, a5, a6, a7)[source]¶ Calculates ideal gas heat capacity using the model developed in [R817850].
The ideal gas heat capacity is given by:
\[ \begin{align}\begin{aligned}C_p = R\left(a_0 + (a_1/T^2) \exp(a_2/T) + a_3 y^2 + (a_4  a_5/(Ta_7)^2 )y^j \right)\\y = \frac{Ta_7}{T+a_6} \text{ for } T > a_7 \text{ otherwise } 0\end{aligned}\end{align} \]Parameters: T : float
Temperature [K]
a1a7 : float
Coefficients
Returns: Cp : float
Ideal gas heat capacity , [J/mol/K]
Notes
j is set to 8. Analytical integrals are available for this expression.
References
[R817850] (1, 2) Kabo, G. J., and G. N. Roganov. Thermodynamics of Organic Compounds in the Gas State, Volume II: V. 2. College Station, Tex: CRC Press, 1994. Examples
>>> TRCCp(300, 4.0, 7.65E5, 720., 3.565, 0.052, 1.55E6, 52., 201.) 42.06525682312236

thermo.heat_capacity.
TRCCp_integral
(T, a0, a1, a2, a3, a4, a5, a6, a7, I=0)[source]¶ Integrates ideal gas heat capacity using the model developed in [R818851]. Best used as a delta only.
The difference in enthalpy with respect to 0 K is given by:
\[ \begin{align}\begin{aligned}\frac{H(T)  H^{ref}}{RT} = a_0 + a_1x(a_2)/(a_2T) + I/T + h(T)/T\\h(T) = (a_5 + a_7)\left[(2a_3 + 8a_4)\ln(1y)+ \left\{a_3\left(1 + \frac{1}{1y}\right) + a_4\left(7 + \frac{1}{1y}\right)\right\}y + a_4\left\{3y^2 + (5/3)y^3 + y^4 + (3/5)y^5 + (1/3)y^6\right\} + (1/7)\left\{a_4  \frac{a_5}{(a_6+a_7)^2}\right\}y^7\right]\\h(T) = 0 \text{ for } T \le a_7\\y = \frac{Ta_7}{T+a_6} \text{ for } T > a_7 \text{ otherwise } 0\end{aligned}\end{align} \]Parameters: T : float
Temperature [K]
a1a7 : float
Coefficients
I : float, optional
Integral offset
Returns: HH(0) : float
Difference in enthalpy from 0 K , [J/mol]
Notes
Analytical integral as provided in [R818851] and verified with numerical integration.
References
[R818851] (1, 2, 3) Kabo, G. J., and G. N. Roganov. Thermodynamics of Organic Compounds in the Gas State, Volume II: V. 2. College Station, Tex: CRC Press, 1994. Examples
>>> TRCCp_integral(298.15, 4.0, 7.65E5, 720., 3.565, 0.052, 1.55E6, 52., ... 201., 1.2) 10802.532600592816

thermo.heat_capacity.
TRCCp_integral_over_T
(T, a0, a1, a2, a3, a4, a5, a6, a7, J=0)[source]¶ Integrates ideal gas heat capacity over T using the model developed in [R819852]. Best used as a delta only.
The difference in idealgas entropy with respect to 0 K is given by:
\[ \begin{align}\begin{aligned}\frac{S^\circ}{R} = J + a_0\ln T + \frac{a_1}{a_2^2}\left(1 + \frac{a_2}{T}\right)x(a_2) + s(T)\\s(T) = \left[\left\{a_3 + \left(\frac{a_4 a_7^2  a_5}{a_6^2}\right) \left(\frac{a_7}{a_6}\right)^4\right\}\left(\frac{a_7}{a_6}\right)^2 \ln z + (a_3 + a_4)\ln\left(\frac{T+a_6}{a_6+a_7}\right) +\sum_{i=1}^7 \left\{\left(\frac{a_4 a_7^2  a_5}{a_6^2}\right)\left( \frac{a_7}{a_6}\right)^{6i}  a_4\right\}\frac{y^i}{i}  \left\{\frac{a_3}{a_6}(a_6 + a_7) + \frac{a_5 y^6}{7a_7(a_6+a_7)} \right\}y\right]\\s(T) = 0 \text{ for } T \le a_7\\z = \frac{T}{T+a_6} \cdot \frac{a_7 + a_6}{a_7}\\y = \frac{Ta_7}{T+a_6} \text{ for } T > a_7 \text{ otherwise } 0\end{aligned}\end{align} \]Parameters: T : float
Temperature [K]
a1a7 : float
Coefficients
J : float, optional
Integral offset
Returns: SS(0) : float
Difference in entropy from 0 K , [J/mol/K]
Notes
Analytical integral as provided in [R819852] and verified with numerical integration.
References
[R819852] (1, 2, 3) Kabo, G. J., and G. N. Roganov. Thermodynamics of Organic Compounds in the Gas State, Volume II: V. 2. College Station, Tex: CRC Press, 1994. Examples
>>> TRCCp_integral_over_T(300, 4.0, 124000, 245, 50.539, 49.469, ... 220440000, 560, 78) 213.80148972435018

thermo.heat_capacity.
heat_capacity_gas_methods
= ['TRC Thermodynamics of Organic Compounds in the Gas State (1994)', 'Poling et al. (2001)', 'CoolProp', 'Lastovka and Shaw (2013)', 'CRC Standard Thermodynamic Properties of Chemical Substances', 'Poling et al. (2001) constant', 'VDI Heat Atlas']¶ Holds all methods available for the HeatCapacityGas class, for use in iterating over them.

class
thermo.heat_capacity.
HeatCapacityGas
(CASRN='', MW=None, similarity_variable=None)[source]¶ Bases:
thermo.utils.TDependentProperty
Class for dealing with gas heat capacity as a function of temperature. Consists of two coefficientbased methods, two constant methods, one tabular source, one simple estimator, and the external library CoolProp.
Parameters: CASRN : str, optional
The CAS number of the chemical
MW : float, optional
Molecular weight, [g/mol]
similarity_variable : float, optional
similarity variable, n_atoms/MW, [mol/g]
See also
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
heat_capacity_gas_methods
. TRCIG:
 A rigorous expression derived in [R820853] for modeling gas heat capacity. Coefficients for 1961 chemicals are available.
 POLING:
 Simple polynomials in [R821853] not suitable for extrapolation. Data is available for 308 chemicals.
 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 [R822853]. Very slow.
 LASTOVKA_SHAW:
 A basic estimation method using the similarity variable concept;
requires only molecular structure, so is very convenient. See
Lastovka_Shaw
for details.  CRCSTD:
 Constant values tabulated in [R823853] at 298.15 K; data is available for 533 gases.
 POLING_CONST:
 Constant values in [R821853] at 298.15 K; available for 348 gases.
 VDI_TABULAR:
 Tabular data up to the critical point available in [R824853]. Note that this data is along the saturation curve.
References
[R820853] (1, 2) Kabo, G. J., and G. N. Roganov. Thermodynamics of Organic Compounds in the Gas State, Volume II: V. 2. College Station, Tex: CRC Press, 1994. [R821853] (1, 2, 3) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGrawHill Professional, 2000. [R822853] (1, 2) Bell, Ian H., Jorrit Wronski, Sylvain Quoilin, and Vincent Lemort. “Pure and PseudoPure Fluid Thermophysical Property Evaluation and the OpenSource Thermophysical Property Library CoolProp.” Industrial & Engineering Chemistry Research 53, no. 6 (February 12, 2014): 24982508. doi:10.1021/ie4033999. http://www.coolprop.org/ [R823853] (1, 2) Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014. [R824853] (1, 2) Gesellschaft, V. D. I., ed. VDI Heat Atlas. 2nd edition. Berlin; New York:: Springer, 2010. 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 surface tension of a liquid 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
.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 test the validity of a specified method for a given temperature. test_property_validity
(prop)Method to test the validity of a calculated property. 
Tmax
= None¶ Maximum temperature at which no method can calculate the surface tension above.

Tmin
= None¶ Minimum temperature at which no method can calculate the surface tension 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 surface tension of a liquid at temperature 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 heat capacity, [K]
method : str
Method name to use
Returns: Cp : float
Calculated heat capacity, [J/mol/K]

calculate_integral
(T1, T2, method)[source]¶ Method to calculate the integral of a property with respect to temperature, using a specified method. Implements the analytical integrals of all available methods except for tabular data.
Parameters: T1 : float
Lower limit of integration, [K]
T2 : float
Upper limit of integration, [K]
method : str
Method for which to find the integral
Returns: integral : float
Calculated integral of the property over the given range, [units*K]

calculate_integral_over_T
(T1, T2, method)[source]¶ Method to calculate the integral of a property over temperature with respect to temperature, using a specified method. Implements the analytical integrals of all available methods except for tabular data.
Parameters: T1 : float
Lower limit of integration, [K]
T2 : float
Upper limit of integration, [K]
method : str
Method for which to find the integral
Returns: integral : float
Calculated integral of the property over the given range, [units]

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
, andall_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
= 'gas heat capacity'¶

property_max
= 10000.0¶ Maximum valid of Heat capacity; arbitrarily set. For fluids very near the critical point, this value can be obscenely high.

property_min
= 0¶ Heat capacities have a minimum value of 0 at 0 K.

ranked_methods
= ['TRC Thermodynamics of Organic Compounds in the Gas State (1994)', 'Poling et al. (2001)', 'CoolProp', 'Lastovka and Shaw (2013)', 'CRC Standard Thermodynamic Properties of Chemical Substances', 'Poling et al. (2001) constant', 'VDI Heat Atlas']¶ 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; gases are fairly linear in heat capacity at high temperatures even if not low temperatures.

test_method_validity
(T, method)[source]¶ Method to test the validity of a specified method for a given temperature.
‘TRC’ and ‘Poling’ both have minimum and maimum temperatures. The constant temperatures in POLING_CONST and CRCSTD are considered valid for 50 degrees around their specified temperatures.
Lastovka_Shaw
is considered valid for the whole range of 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 determine the validity of the method, [K]
method : str
Name of the method to test
Returns: validity : bool
Whether or not a specifid method is valid

units
= 'J/mol/K'¶

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.heat_capacity.
Rowlinson_Poling
(T, Tc, omega, Cpgm)[source]¶ Calculate liquid constantpressure heat capacitiy with the [R825858] CSP method.
This equation is not terrible accurate.
The heat capacity of a liquid is given by:
\[\frac{Cp^{L}  Cp^{g}}{R} = 1.586 + \frac{0.49}{1T_r} + \omega\left[ 4.2775 + \frac{6.3(1T_r)^{1/3}}{T_r} + \frac{0.4355}{1T_r}\right]\]Parameters: T : float
Temperature of fluid [K]
Tc : float
Critical temperature of fluid [K]
omega : float
Acentric factor for fluid, []
Cpgm : float
Constantpressure gas heat capacity, [J/mol/K]
Returns: Cplm : float
Liquid constantpressure heat capacitiy, [J/mol/K]
Notes
Poling compared 212 substances, and found error at 298K larger than 10% for 18 of them, mostly associating. Of the other 194 compounds, AARD is 2.5%.
References
[R825858] (1, 2) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGrawHill Professional, 2000. Examples
>>> Rowlinson_Poling(350.0, 435.5, 0.203, 91.21) 143.80194441498296

thermo.heat_capacity.
Rowlinson_Bondi
(T, Tc, omega, Cpgm)[source]¶ Calculate liquid constantpressure heat capacitiy with the CSP method shown in [R826859].
The heat capacity of a liquid is given by:
\[\frac{Cp^L  Cp^{ig}}{R} = 1.45 + 0.45(1T_r)^{1} + 0.25\omega [17.11 + 25.2(1T_r)^{1/3}T_r^{1} + 1.742(1T_r)^{1}]\]Parameters: T : float
Temperature of fluid [K]
Tc : float
Critical temperature of fluid [K]
omega : float
Acentric factor for fluid, []
Cpgm : float
Constantpressure gas heat capacity, [J/mol/K]
Returns: Cplm : float
Liquid constantpressure heat capacitiy, [J/mol/K]
Notes
Less accurate than Rowlinson_Poling.
References
[R826859] (1, 2) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGrawHill Professional, 2000. [R827859] Gesellschaft, V. D. I., ed. VDI Heat Atlas. 2nd edition. Berlin; New York:: Springer, 2010. [R828859] J.S. Rowlinson, Liquids and Liquid Mixtures, 2nd Ed., Butterworth, London (1969). Examples
>>> Rowlinson_Bondi(T=373.28, Tc=535.55, omega=0.323, Cpgm=119.342) 175.39760730048116

thermo.heat_capacity.
Dadgostar_Shaw
(T, similarity_variable)[source]¶ Calculate liquid constantpressure heat capacitiy with the similarity variable concept and method as shown in [R829862].
\[C_{p} = 24.5(a_{11}\alpha + a_{12}\alpha^2)+ (a_{21}\alpha + a_{22}\alpha^2)T +(a_{31}\alpha + a_{32}\alpha^2)T^2\]Parameters: T : float
Temperature of liquid [K]
similarity_variable : float
similarity variable as defined in [R829862], [mol/g]
Returns: Cpl : float
Liquid constantpressure heat capacitiy, [J/kg/K]
Notes
Many restrictions on its use.
Original model is in terms of J/g/K. Note that the model is for predicting mass heat capacity, not molar heat capacity like most other methods!
a11 = 0.3416; a12 = 2.2671; a21 = 0.1064; a22 = 0.3874l; a31 = 9.8231E05; a32 = 4.182E04
References
[R829862] (1, 2, 3) Dadgostar, Nafiseh, and John M. Shaw. “A Predictive Correlation for the ConstantPressure Specific Heat Capacity of Pure and IllDefined Liquid Hydrocarbons.” Fluid Phase Equilibria 313 (January 15, 2012): 211226. doi:10.1016/j.fluid.2011.09.015. Examples
>>> Dadgostar_Shaw(355.6, 0.139) 1802.5291501191516

thermo.heat_capacity.
Zabransky_quasi_polynomial
(T, Tc, a1, a2, a3, a4, a5, a6)[source]¶ Calculates liquid heat capacity using the model developed in [R830863].
\[\frac{C}{R}=A_1\ln(1T_r) + \frac{A_2}{1T_r} + \sum_{j=0}^m A_{j+3} T_r^j\]Parameters: T : float
Temperature [K]
Tc : float
Critical temperature of fluid, [K]
a1a6 : float
Coefficients
Returns: Cp : float
Liquid heat capacity, [J/mol/K]
Notes
Used only for isobaric heat capacities, not saturation heat capacities. Designed for reasonable extrapolation behavior caused by using the reduced critical temperature. Used by the authors of [R830863] when critical temperature was available for the fluid. Analytical integrals are available for this expression.
References
[R830863] (1, 2, 3) Zabransky, M., V. Ruzicka Jr, V. Majer, and Eugene S. Domalski. Heat Capacity of Liquids: Critical Review and Recommended Values. 2 Volume Set. Washington, D.C.: Amer Inst of Physics, 1996. Examples
>>> Zabransky_quasi_polynomial(330, 591.79, 3.12743, 0.0857315, 13.7282, 1.28971, 6.42297, 4.10989) 165.4728226923247

thermo.heat_capacity.
Zabransky_quasi_polynomial_integral
(T, Tc, a1, a2, a3, a4, a5, a6)[source]¶ Calculates the integral of liquid heat capacity using the quasipolynomial model developed in [R831864].
Parameters: T : float
Temperature [K]
a1a6 : float
Coefficients
Returns: H : float
Difference in enthalpy from 0 K, [J/mol]
Notes
The analytical integral was derived with SymPy; it is a simple polynomial plus some logarithms.
References
[R831864] (1, 2) Zabransky, M., V. Ruzicka Jr, V. Majer, and Eugene S. Domalski. Heat Capacity of Liquids: Critical Review and Recommended Values. 2 Volume Set. Washington, D.C.: Amer Inst of Physics, 1996. Examples
>>> H2 = Zabransky_quasi_polynomial_integral(300, 591.79, 3.12743, ... 0.0857315, 13.7282, 1.28971, 6.42297, 4.10989) >>> H1 = Zabransky_quasi_polynomial_integral(200, 591.79, 3.12743, ... 0.0857315, 13.7282, 1.28971, 6.42297, 4.10989) >>> H2  H1 14662.026406892925

thermo.heat_capacity.
Zabransky_quasi_polynomial_integral_over_T
(T, Tc, a1, a2, a3, a4, a5, a6)[source]¶ Calculates the integral of liquid heat capacity over T using the quasipolynomial model developed in [R832865].
Parameters: T : float
Temperature [K]
a1a6 : float
Coefficients
Returns: S : float
Difference in entropy from 0 K, [J/mol/K]
Notes
The analytical integral was derived with Sympy. It requires the Polylog(2,x) function, which is unimplemented in SciPy. A very accurate numerical approximation was implemented as
thermo.utils.polylog2
. Relatively slow due to the use of that special function.References
[R832865] (1, 2) Zabransky, M., V. Ruzicka Jr, V. Majer, and Eugene S. Domalski. Heat Capacity of Liquids: Critical Review and Recommended Values. 2 Volume Set. Washington, D.C.: Amer Inst of Physics, 1996. Examples
>>> S2 = Zabransky_quasi_polynomial_integral_over_T(300, 591.79, 3.12743, ... 0.0857315, 13.7282, 1.28971, 6.42297, 4.10989) >>> S1 = Zabransky_quasi_polynomial_integral_over_T(200, 591.79, 3.12743, ... 0.0857315, 13.7282, 1.28971, 6.42297, 4.10989) >>> S2  S1 59.16997291893654

thermo.heat_capacity.
Zabransky_cubic
(T, a1, a2, a3, a4)[source]¶ Calculates liquid heat capacity using the model developed in [R833866].
\[\frac{C}{R}=\sum_{j=0}^3 A_{j+1} \left(\frac{T}{100}\right)^j\]Parameters: T : float
Temperature [K]
a1a4 : float
Coefficients
Returns: Cp : float
Liquid heat capacity, [J/mol/K]
Notes
Most often form used in [R833866]. Analytical integrals are available for this expression.
References
[R833866] (1, 2, 3) Zabransky, M., V. Ruzicka Jr, V. Majer, and Eugene S. Domalski. Heat Capacity of Liquids: Critical Review and Recommended Values. 2 Volume Set. Washington, D.C.: Amer Inst of Physics, 1996. Examples
>>> Zabransky_cubic(298.15, 20.9634, 10.1344, 2.8253, 0.256738) 75.31462591538556

thermo.heat_capacity.
Zabransky_cubic_integral
(T, a1, a2, a3, a4)[source]¶ Calculates the integral of liquid heat capacity using the model developed in [R834867].
Parameters: T : float
Temperature [K]
a1a4 : float
Coefficients
Returns: H : float
Difference in enthalpy from 0 K, [J/mol]
Notes
The analytical integral was derived with Sympy; it is a simple polynomial.
References
[R834867] (1, 2) Zabransky, M., V. Ruzicka Jr, V. Majer, and Eugene S. Domalski. Heat Capacity of Liquids: Critical Review and Recommended Values. 2 Volume Set. Washington, D.C.: Amer Inst of Physics, 1996. Examples
>>> Zabransky_cubic_integral(298.15, 20.9634, 10.1344, 2.8253, 0.256738) 31051.679845520586

thermo.heat_capacity.
Zabransky_cubic_integral_over_T
(T, a1, a2, a3, a4)[source]¶ Calculates the integral of liquid heat capacity over T using the model developed in [R835868].
Parameters: T : float
Temperature [K]
a1a4 : float
Coefficients
Returns: S : float
Difference in entropy from 0 K, [J/mol/K]
Notes
The analytical integral was derived with Sympy; it is a simple polynomial, plus a logarithm
References
[R835868] (1, 2) Zabransky, M., V. Ruzicka Jr, V. Majer, and Eugene S. Domalski. Heat Capacity of Liquids: Critical Review and Recommended Values. 2 Volume Set. Washington, D.C.: Amer Inst of Physics, 1996. Examples
>>> Zabransky_cubic_integral_over_T(298.15, 20.9634, 10.1344, 2.8253, ... 0.256738) 24.73245695987246

class
thermo.heat_capacity.
Zabransky_quasipolynomial
(CAS, name, uncertainty, Tmin, Tmax, Tc, coeffs)[source]¶ Bases:
object
Quasipolynomial object for calculating the heat capacity of a chemical. Implements the enthalpy and entropy integrals as well.
\[\frac{C}{R}=A_1\ln(1T_r) + \frac{A_2}{1T_r} + \sum_{j=0}^m A_{j+3} T_r^j\]Parameters: CAS : str
CAS number.
name : str
Name of the chemical as given in [R836869].
uncertainty : str
Uncertainty class of the heat capacity as given in [R836869].
Tmin : float
Minimum temperature any experimental data was available at.
Tmax : float
Maximum temperature any experimental data was available at.
Tc : float
Critical temperature of the chemical, as used in the formula.
coeffs : list[float]
Six coefficients for the equation.
References
[R836869] (1, 2, 3) Zabransky, M., V. Ruzicka Jr, V. Majer, and Eugene S. Domalski. Heat Capacity of Liquids: Critical Review and Recommended Values. 2 Volume Set. Washington, D.C.: Amer Inst of Physics, 1996. Methods
calculate
(T)Method to actually calculate heat capacity as a function of temperature. calculate_integral
(T1, T2)Method to compute the enthalpy integral of heat capacity from T1 to T2. calculate_integral_over_T
(T1, T2)Method to compute the entropy integral of heat capacity from T1 to T2. 
CAS
¶ CAS number.

Tc
¶ Critical temperature of the chemical, as used in the formula.

Tmax
¶ Maximum temperature any experimental data was available at.

Tmin
¶ Minimum temperature any experimental data was available at.

calculate
(T)[source]¶ Method to actually calculate heat capacity as a function of temperature.
Parameters: T : float
Temperature, [K]
Returns: Cp : float
Liquid heat capacity as T, [J/mol/K]

calculate_integral
(T1, T2)[source]¶  Method to compute the enthalpy integral of heat capacity from
 T1 to T2.
Parameters: T1 : float
Initial temperature, [K]
T2 : float
Final temperature, [K]
Returns: dH : float
Enthalpy difference between T1 and T2, [J/mol]

calculate_integral_over_T
(T1, T2)[source]¶  Method to compute the entropy integral of heat capacity from
 T1 to T2.
Parameters: T1 : float
Initial temperature, [K]
T2 : float
Final temperature, [K]
Returns: dS : float
Entropy difference between T1 and T2, [J/mol/K]

coeffs
¶ Six coefficients for the equation.

name
¶ Name of the chemical.

uncertainty
¶ Uncertainty class of the heat capacity.


class
thermo.heat_capacity.
Zabransky_spline
(CAS, name, uncertainty)[source]¶ Bases:
object
Implementation of the cubic spline method presented in [R837870] for calculating the heat capacity of a chemical. Implements the enthalpy and entropy integrals as well.
\[\frac{C}{R}=\sum_{j=0}^3 A_{j+1} \left(\frac{T}{100}\right)^j\]Parameters: CAS : str
CAS number.
name : str
Name of the chemical as in [R837870].
uncertainty : str
Uncertainty class of the heat capacity as in [R837870].
References
[R837870] (1, 2, 3, 4) Zabransky, M., V. Ruzicka Jr, V. Majer, and Eugene S. Domalski. Heat Capacity of Liquids: Critical Review and Recommended Values. 2 Volume Set. Washington, D.C.: Amer Inst of Physics, 1996. Methods
add_coeffs
(Tmin, Tmax, coeffs)Called internally during the parsing of the Zabransky database, to calculate
(T)Method to actually calculate heat capacity as a function of temperature. calculate_integral
(T1, T2)Method to compute the enthalpy integral of heat capacity from T1 to T2. calculate_integral_over_T
(T1, T2)Method to compute the entropy integral of heat capacity from T1 to T2. 
CAS
¶ CAS number.

Ts
¶ Temperatures at which the coefficient sets transition.

add_coeffs
(Tmin, Tmax, coeffs)[source]¶ Called internally during the parsing of the Zabransky database, to add coefficients as they are read one per line

calculate
(T)[source]¶ Method to actually calculate heat capacity as a function of temperature.
Parameters: T : float
Temperature, [K]
Returns: Cp : float
Liquid heat capacity as T, [J/mol/K]

calculate_integral
(T1, T2)[source]¶ Method to compute the enthalpy integral of heat capacity from T1 to T2. Analytically integrates across the piecewise spline as necessary.
Parameters: T1 : float
Initial temperature, [K]
T2 : float
Final temperature, [K]
Returns: dS : float
Enthalpy difference between T1 and T2, [J/mol/K]

calculate_integral_over_T
(T1, T2)[source]¶ Method to compute the entropy integral of heat capacity from T1 to T2. Analytically integrates across the piecewise spline as necessary.
Parameters: T1 : float
Initial temperature, [K]
T2 : float
Final temperature, [K]
Returns: dS : float
Entropy difference between T1 and T2, [J/mol/K]

coeff_sets
¶ Actual coefficients used to describe the chemical.

n
¶ Number of coefficient sets used to describe the chemical.

name
¶ Name of the chemical.

uncertainty
¶ Uncertainty class of the heat capacity.


thermo.heat_capacity.
heat_capacity_liquid_methods
= ['Zabransky spline, averaged heat capacity', 'Zabransky quasipolynomial, averaged heat capacity', 'Zabransky spline, constantpressure', 'Zabransky quasipolynomial, constantpressure', 'Zabransky spline, saturation', 'Zabransky quasipolynomial, saturation', 'VDI Heat Atlas', 'Rowlinson and Poling (2001)', 'Rowlinson and Bondi (1969)', 'CoolProp', 'Dadgostar and Shaw (2011)', 'Poling et al. (2001) constant', 'CRC Standard Thermodynamic Properties of Chemical Substances']¶ Holds all methods available for the HeatCapacityLiquid class, for use in iterating over them.

class
thermo.heat_capacity.
HeatCapacityLiquid
(CASRN='', MW=None, similarity_variable=None, Tc=None, omega=None, Cpgm=None)[source]¶ Bases:
thermo.utils.TDependentProperty
Class for dealing with liquid heat capacity as a function of temperature. Consists of six coefficientbased methods, two constant methods, one tabular source, two CSP methods based on gas heat capacity, one simple estimator, and the external library CoolProp.
Parameters: CASRN : str, optional
The CAS number of the chemical
MW : float, optional
Molecular weight, [g/mol]
similarity_variable : float, optional
similarity variable, n_atoms/MW, [mol/g]
Tc : float, optional
Critical temperature, [K]
omega : float, optional
Acentric factor, []
Cpgm : float or callable, optional
Ideagas molar heat capacity at T or callable for the same, [J/mol/K]
See also
Zabransky_quasi_polynomial
,Zabransky_cubic
,Rowlinson_Poling
,Rowlinson_Bondi
,Dadgostar_Shaw
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
heat_capacity_gas_methods
.ZABRANSKY_SPLINE, ZABRANSKY_QUASIPOLYNOMIAL, ZABRANSKY_SPLINE_C, and ZABRANSKY_QUASIPOLYNOMIAL_C:
Rigorous expressions developed in [R838871] following critical evaluation of the available data. The spline methods use the form described inZabransky_cubic
over short ranges with varying coefficients to obtain a wider range. The quasipolynomial methods use the form described inZabransky_quasi_polynomial
, more suitable for extrapolation, and over then entire range. Respectively, there is data available for 588, 146, 51, and 26 chemicals. ‘C’ denotes constant pressure data available from more precise experiments. The others are heat capacity values averaged over a temperature changed. ZABRANSKY_SPLINE_SAT and ZABRANSKY_QUASIPOLYNOMIAL_SAT:
 Rigorous expressions developed in [R838871] following critical evaluation
of the available data. The spline method use the form described in
Zabransky_cubic
over short ranges with varying coefficients to obtain a wider range. The quasipolynomial method use the form described inZabransky_quasi_polynomial
, more suitable for extrapolation, and over their entire range. Respectively, there is data available for 203, and 16 chemicals. Note that these methods are for the saturation curve!  VDI_TABULAR:
 Tabular data up to the critical point available in [R842871]. Note that this data is along the saturation curve.
 ROWLINSON_POLING:
 CSP method described in
Rowlinson_Poling
. Requires a ideal gas heat capacity value at the same temperature as it is to be calculated.  ROWLINSON_BONDI:
 CSP method described in
Rowlinson_Bondi
. Requires a ideal gas heat capacity value at the same temperature as it is to be calculated.  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 [R840871]. Very slow.
 DADGOSTAR_SHAW:
 A basic estimation method using the similarity variable concept;
requires only molecular structure, so is very convenient. See
Dadgostar_Shaw
for details.  POLING_CONST:
 Constant values in [R839871] at 298.15 K; available for 245 liquids.
 CRCSTD:
 Consta values tabulated in [R841871] at 298.15 K; data is available for 433 liquids.
References
[R838871] (1, 2, 3) Zabransky, M., V. Ruzicka Jr, V. Majer, and Eugene S. Domalski. Heat Capacity of Liquids: Critical Review and Recommended Values. 2 Volume Set. Washington, D.C.: Amer Inst of Physics, 1996. [R839871] (1, 2) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGrawHill Professional, 2000. [R840871] (1, 2) Bell, Ian H., Jorrit Wronski, Sylvain Quoilin, and Vincent Lemort. “Pure and PseudoPure Fluid Thermophysical Property Evaluation and the OpenSource Thermophysical Property Library CoolProp.” Industrial & Engineering Chemistry Research 53, no. 6 (February 12, 2014): 24982508. doi:10.1021/ie4033999. http://www.coolprop.org/ [R841871] (1, 2) Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014. [R842871] (1, 2) Gesellschaft, V. D. I., ed. VDI Heat Atlas. 2nd edition. Berlin; New York:: Springer, 2010. 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 heat capacity of a liquid 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
.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 heat capacity above.

Tmin
= None¶ Minimum temperature at which no method can calculate the heat capacity 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 heat capacity of a liquid at temperature 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 heat capacity, [K]
method : str
Name of the method to use
Returns: Cp : float
Heat capacity of the liquid at T, [J/mol/K]

calculate_integral
(T1, T2, method)[source]¶ Method to calculate the integral of a property with respect to temperature, using a specified method. Implements the analytical integrals of all available methods except for tabular data, the case of multiple coefficient sets needed to encompass the temperature range of any of the ZABRANSKY methods, and the CSP methods using the vapor phase properties.
Parameters: T1 : float
Lower limit of integration, [K]
T2 : float
Upper limit of integration, [K]
method : str
Method for which to find the integral
Returns: integral : float
Calculated integral of the property over the given range, [units*K]

calculate_integral_over_T
(T1, T2, method)[source]¶ Method to calculate the integral of a property over temperature with respect to temperature, using a specified method. Implements the analytical integrals of all available methods except for tabular data, the case of multiple coefficient sets needed to encompass the temperature range of any of the ZABRANSKY methods, and the CSP methods using the vapor phase properties.
Parameters: T1 : float
Lower limit of integration, [K]
T2 : float
Upper limit of integration, [K]
method : str
Method for which to find the integral
Returns: integral : float
Calculated integral of the property over the given range, [units]

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
, andall_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
= 'Liquid heat capacity'¶

property_max
= 10000.0¶ Maximum valid of Heat capacity; arbitrarily set. For fluids very near the critical point, this value can be obscenely high.

property_min
= 1¶ Allow very low heat capacities; arbitrarily set; liquid heat capacity should always be somewhat substantial.

ranked_methods
= ['Zabransky spline, averaged heat capacity', 'Zabransky quasipolynomial, averaged heat capacity', 'Zabransky spline, constantpressure', 'Zabransky quasipolynomial, constantpressure', 'Zabransky spline, saturation', 'Zabransky quasipolynomial, saturation', 'VDI Heat Atlas', 'Dadgostar and Shaw (2011)', 'Rowlinson and Poling (2001)', 'Rowlinson and Bondi (1969)', 'CoolProp', 'Poling et al. (2001) constant', 'CRC Standard Thermodynamic Properties of Chemical Substances']¶ 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; highertemeprature behavior is not well predicted by most extrapolation.

test_method_validity
(T, method)[source]¶ Method to check the validity of a method. Follows the given ranges for all coefficientbased methods. For the CSP method
Rowlinson_Poling
, the model is considered valid for all temperatures. The simple methodDadgostar_Shaw
is considered valid for all temperatures. For tabular data, extrapolation outside of the range is used iftabular_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
= 'J/mol/K'¶

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.heat_capacity.
Lastovka_solid
(T, similarity_variable)[source]¶ Calculate solid constantpressure heat capacitiy with the similarity variable concept and method as shown in [R843876].
\[C_p = 3(A_1\alpha + A_2\alpha^2)R\left(\frac{\theta}{T}\right)^2 \frac{\exp(\theta/T)}{[\exp(\theta/T)1]^2} + (C_1\alpha + C_2\alpha^2)T + (D_1\alpha + D_2\alpha^2)T^2\]Parameters: T : float
Temperature of solid [K]
similarity_variable : float
similarity variable as defined in [R843876], [mol/g]
Returns: Cps : float
Solid constantpressure heat capacitiy, [J/kg/K]
Notes
Many restrictions on its use. Trained on data with MW from 12.24 g/mol to 402.4 g/mol, C mass fractions from 61.3% to 95.2%, H mass fractions from 3.73% to 15.2%, N mass fractions from 0 to 15.4%, O mass fractions from 0 to 18.8%, and S mass fractions from 0 to 29.6%. Recommended for organic compounds with low mass fractions of heteroatoms and especially when molar mass exceeds 200 g/mol. This model does not show and effects of phase transition but should not be used passed the triple point.
Original model is in terms of J/g/K. Note that the model s for predicting mass heat capacity, not molar heat capacity like most other methods!
A1 = 0.013183; A2 = 0.249381; theta = 151.8675; C1 = 0.026526; C2 = 0.024942; D1 = 0.000025; D2 = 0.000123.
References
[R843876] (1, 2, 3) Laštovka, Václav, Michal Fulem, Mildred Becerra, and John M. Shaw. “A Similarity Variable for Estimating the Heat Capacity of Solid Organic Compounds: Part II. Application: Heat Capacity Calculation for IllDefined Organic Solids.” Fluid Phase Equilibria 268, no. 12 (June 25, 2008): 13441. doi:10.1016/j.fluid.2008.03.018. Examples
>>> Lastovka_solid(300, 0.2139) 1682.063629222013

thermo.heat_capacity.
Lastovka_solid_integral
(T, similarity_variable)[source]¶ Integrates solid constantpressure heat capacitiy with the similarity variable concept and method as shown in [R844877].
Uses a explicit form as derived with Sympy.
Parameters: T : float
Temperature of solid [K]
similarity_variable : float
similarity variable as defined in [R844877], [mol/g]
Returns: H : float
Difference in enthalpy from 0 K, [J/kg]
See also
Notes
Original model is in terms of J/g/K. Note that the model is for predicting mass heat capacity, not molar heat capacity like most other methods!
References
[R844877] (1, 2, 3) Laštovka, Václav, Michal Fulem, Mildred Becerra, and John M. Shaw. “A Similarity Variable for Estimating the Heat Capacity of Solid Organic Compounds: Part II. Application: Heat Capacity Calculation for IllDefined Organic Solids.” Fluid Phase Equilibria 268, no. 12 (June 25, 2008): 13441. doi:10.1016/j.fluid.2008.03.018. Examples
>>> Lastovka_solid_integral(300, 0.2139) 283246.1242170376

thermo.heat_capacity.
Lastovka_solid_integral_over_T
(T, similarity_variable)[source]¶ Integrates over T solid constantpressure heat capacitiy with the similarity variable concept and method as shown in [R845878].
Uses a explicit form as derived with Sympy.
Parameters: T : float
Temperature of solid [K]
similarity_variable : float
similarity variable as defined in [R845878], [mol/g]
Returns: S : float
Difference in entropy from 0 K, [J/kg/K]
See also
Notes
Original model is in terms of J/g/K. Note that the model is for predicting mass heat capacity, not molar heat capacity like most other methods!
References
[R845878] (1, 2, 3) Laštovka, Václav, Michal Fulem, Mildred Becerra, and John M. Shaw. “A Similarity Variable for Estimating the Heat Capacity of Solid Organic Compounds: Part II. Application: Heat Capacity Calculation for IllDefined Organic Solids.” Fluid Phase Equilibria 268, no. 12 (June 25, 2008): 13441. doi:10.1016/j.fluid.2008.03.018. Examples
>>> Lastovka_solid_integral_over_T(300, 0.2139) 1947.553552666818

thermo.heat_capacity.
heat_capacity_solid_methods
= ["Perry's Table 2151", 'CRC Standard Thermodynamic Properties of Chemical Substances', 'Lastovka, Fulem, Becerra and Shaw (2008)']¶ Holds all methods available for the HeatCapacitySolid class, for use in iterating over them.

class
thermo.heat_capacity.
HeatCapacitySolid
(CASRN='', similarity_variable=None, MW=None)[source]¶ Bases:
thermo.utils.TDependentProperty
Class for dealing with solid heat capacity as a function of temperature. Consists of one temperaturedependent simple expression, one constant value source, and one simple estimator.
Parameters: similarity_variable : float, optional
similarity variable, n_atoms/MW, [mol/g]
MW : float, optional
Molecular weight, [g/mol]
CASRN : str, optional
The CAS number of the chemical
See also
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
heat_capacity_solid_methods
. PERRY151:
Simple polynomials with vaious exponents selected for each expression. Coefficients are in units of calories/mol/K. The full expression is:
\[Cp = a + bT + c/T^2 + dT^2\]Data is available for 284 solids, from [R847879].
 CRCSTD:
 Values tabulated in [R846879] at 298.15 K; data is available for 529 solids.
 LASTOVKA_S:
 A basic estimation method using the similarity variable concept;
requires only molecular structure, so is very convenient. See
Lastovka_solid
for details.
References
[R846879] (1, 2) Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014. [R847879] (1, 2) Green, Don, and Robert Perry. Perry’s Chemical Engineers’ Handbook, Eighth Edition. McGrawHill Professional, 2007. 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 heat capacity of a solid 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
.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 heat capacity above.

Tmin
= None¶ Minimum temperature at which no method can calculate the heat capacity 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 heat capacity of a solid at temperature 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 heat capacity, [K]
method : str
Name of the method to use
Returns: Cp : float
Heat capacity of the solid at T, [J/mol/K]

calculate_integral
(T1, T2, method)[source]¶ Method to calculate the integral of a property with respect to temperature, using a specified method. Implements the analytical integrals of all available methods except for tabular data.
Parameters: T1 : float
Lower limit of integration, [K]
T2 : float
Upper limit of integration, [K]
method : str
Method for which to find the integral
Returns: integral : float
Calculated integral of the property over the given range, [units*K]

calculate_integral_over_T
(T1, T2, method)[source]¶ Method to calculate the integral of a property over temperature with respect to temperature, using a specified method. Implements the analytical integrals of all available methods except for tabular data.
Parameters: T1 : float
Lower limit of integration, [K]
T2 : float
Upper limit of integration, [K]
method : str
Method for which to find the integral
Returns: integral : float
Calculated integral of the property over the given range, [units]

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
, andall_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 heat capacity'¶

property_max
= 10000.0¶ Maximum value of Heat capacity; arbitrarily set.

property_min
= 0¶ Heat capacities have a minimum value of 0 at 0 K.

ranked_methods
= ["Perry's Table 2151", 'CRC Standard Thermodynamic Properties of Chemical Substances', 'Lastovka, Fulem, Becerra and Shaw (2008)']¶ 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; a theoretical solid phase exists for all chemicals at sufficiently high pressures, although few chemicals could stably exist in those conditions.

test_method_validity
(T, method)[source]¶ Method to check the validity of a method. Follows the given ranges for all coefficientbased 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. For theLastovka_solid
method, it is considered valid under 10000K.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
= 'J/mol/K'¶

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.heat_capacity.
HeatCapacitySolidMixture
(CASs=[], HeatCapacitySolids=[])[source]¶ Bases:
thermo.utils.MixtureProperty
Class for dealing with solid heat capacity of a mixture as a function of temperature, pressure, and composition. Consists only of mole weighted averaging.
Parameters: CASs : list[str], optional
The CAS numbers of all species in the mixture
HeatCapacitySolids : list[HeatCapacitySolid], optional
HeatCapacitySolid 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
heat_capacity_solid_mixture_methods
. SIMPLE:
 Mixing rule described in
thermo.utils.mixing_simple
.
Attributes
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 heat capacity 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 mixturespecific 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 heat capacity above.

Tmin
= None¶ Minimum temperature at which no method can calculate the heat capacity 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 heat capacity 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: Cpsm : float
Molar heat capacity of the solid mixture at the given conditions, [J/mol]

load_all_methods
()[source]¶ Method to initialize the object by precomputing any values which may be used repeatedly and by retrieving mixturespecific variables. All data are stored as attributes. This method also sets
Tmin
,Tmax
, andall_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 heat capacity'¶

property_max
= 10000.0¶ Maximum value of Heat capacity; arbitrarily set.

property_min
= 0¶ Heat capacities have a minimum value of 0 at 0 K.

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
= 'J/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.heat_capacity.
HeatCapacityGasMixture
(CASs=[], HeatCapacityGases=[])[source]¶ Bases:
thermo.utils.MixtureProperty
Class for dealing with the gas heat capacity of a mixture as a function of temperature, pressure, and composition. Consists only of mole weighted averaging.
Parameters: CASs : list[str], optional
The CAS numbers of all species in the mixture
HeatCapacityGases : list[HeatCapacityGas], optional
HeatCapacityGas 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
heat_capacity_gas_mixture_methods
. SIMPLE:
 Mixing rule described in
thermo.utils.mixing_simple
.
Attributes
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 heat capacity 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 mixturespecific 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 heat capacity above.

Tmin
= None¶ Minimum temperature at which no method can calculate the heat capacity 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 heat capacity 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: Cpgm : float
Molar heat capacity of the gas mixture at the given conditions, [J/mol]

load_all_methods
()[source]¶ Method to initialize the object by precomputing any values which may be used repeatedly and by retrieving mixturespecific variables. All data are stored as attributes. This method also sets
Tmin
,Tmax
, andall_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 heat capacity'¶

property_max
= 10000.0¶ Maximum valid of Heat capacity; arbitrarily set. For fluids very near the critical point, this value can be obscenely high.

property_min
= 0¶ Heat capacities have a minimum value of 0 at 0 K.

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
= 'J/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.heat_capacity.
HeatCapacityLiquidMixture
(MWs=[], CASs=[], HeatCapacityLiquids=[])[source]¶ Bases:
thermo.utils.MixtureProperty
Class for dealing with liquid heat capacity of a mixture as a function of temperature, pressure, and composition. Consists only of mole weighted averaging, and the Laliberte method for aqueous electrolyte solutions.
Parameters: MWs : list[float], optional
Molecular weights of all species in the mixture, [g/mol]
CASs : str, optional
The CAS numbers of all species in the mixture
HeatCapacityLiquids : list[HeatCapacityLiquid], optional
HeatCapacityLiquid 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
heat_capacity_liquid_mixture_methods
. LALIBERTE:
 Electrolyte model equation with coefficients; see
thermo.electrochem.Laliberte_heat_capacity
for more details.  SIMPLE:
 Mixing rule described in
thermo.utils.mixing_simple
.
Attributes
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 heat capacity 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 mixturespecific 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 heat capacity above.

Tmin
= None¶ Minimum temperature at which no method can calculate the heat capacity 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 heat capacity 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: Cplm : float
Molar heat capacity of the liquid mixture at the given conditions, [J/mol]

load_all_methods
()[source]¶ Method to initialize the object by precomputing any values which may be used repeatedly and by retrieving mixturespecific variables. All data are stored as attributes. This method also sets
Tmin
,Tmax
, andall_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 heat capacity'¶

property_max
= 10000.0¶ Maximum valid of Heat capacity; arbitrarily set. For fluids very near the critical point, this value can be obscenely high.

property_min
= 1¶ Allow very low heat capacities; arbitrarily set; liquid heat capacity should always be somewhat substantial.

ranked_methods
= ['Laliberte', '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
= 'J/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.