thermo.heat_capacity module¶

thermo.heat_capacity.Lastovka_Shaw(T, similarity_variable, cyclic_aliphatic=False)[source]

Calculate ideal-gas constant-pressure heat capacitiy with the similarity variable concept and method as shown in [R357].

$\begin{split}C_p^0 = \left(A_2 + \frac{A_1 - A_2}{1 + \exp(\frac{\alpha-A_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 [R357], [mol/g] Cpg : float Gas constant-pressure 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

 [R357] (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): 338-370. 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 ideal-gas constant-pressure heat capacitiy with the similarity variable concept and method as shown in [R358].

Parameters: T : float Temperature of gas [K] similarity_variable : float similarity variable as defined in [R358], [mol/g] H : float Difference in enthalpy from 0 K, [J/kg]

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

 [R358] (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): 338-370. 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 ideal-gas constant-pressure heat capacitiy with the similarity variable concept and method as shown in [R359].

Parameters: T : float Temperature of gas [K] similarity_variable : float similarity variable as defined in [R359], [mol/g] S : float Difference in entropy from 0 K, [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! Integral was computed with SymPy.

References

 [R359] (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): 338-370. 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 [R360].

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/(T-a_7)^2 )y^j \right)\\y = \frac{T-a_7}{T+a_6} \text{ for } T > a_7 \text{ otherwise } 0\end{aligned}\end{align}
Parameters: T : float Temperature [K] a1-a7 : float Coefficients Cp : float Ideal gas heat capacity , [J/mol/K]

Notes

j is set to 8. Analytical integrals are available for this expression.

References

 [R360] (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 [R361]. 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(1-y)+ \left\{a_3\left(1 + \frac{1}{1-y}\right) + a_4\left(7 + \frac{1}{1-y}\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{T-a_7}{T+a_6} \text{ for } T > a_7 \text{ otherwise } 0\end{aligned}\end{align}
Parameters: T : float Temperature [K] a1-a7 : float Coefficients I : float, optional Integral offset H-H(0) : float Difference in enthalpy from 0 K , [J/mol]

Notes

Analytical integral as provided in [R361] and verified with numerical integration.

References

 [R361] (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 [R362]. Best used as a delta only.

The difference in ideal-gas 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)^{6-i} - 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{T-a_7}{T+a_6} \text{ for } T > a_7 \text{ otherwise } 0\end{aligned}\end{align}
Parameters: T : float Temperature [K] a1-a7 : float Coefficients J : float, optional Integral offset S-S(0) : float Difference in entropy from 0 K , [J/mol/K]

Notes

Analytical integral as provided in [R362] and verified with numerical integration.

References

 [R362] (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]

Class for dealing with gas heat capacity as a function of temperature. Consists of two coefficient-based 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]

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 [R363] for modeling gas heat capacity. Coefficients for 1961 chemicals are available.
POLING:
Simple polynomials in [R364] 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 [R365]. 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 [R366] at 298.15 K; data is available for 533 gases.
POLING_CONST:
Constant values in [R364] at 298.15 K; available for 348 gases.
VDI_TABULAR:
Tabular data up to the critical point available in [R367]. Note that this data is along the saturation curve.

References

 [R363] (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.
 [R364] (1, 2, 3) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
 [R365] (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/
 [R366] (1, 2) Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014.
 [R367] (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 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 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 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, 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 = '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 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 constant-pressure heat capacitiy with the [R368] 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}{1-T_r} + \omega\left[ 4.2775 + \frac{6.3(1-T_r)^{1/3}}{T_r} + \frac{0.4355}{1-T_r}\right]$
Parameters: T : float Temperature of fluid [K] Tc : float Critical temperature of fluid [K] omega : float Acentric factor for fluid, [-] Cpgm : float Constant-pressure gas heat capacity, [J/mol/K] Cplm : float Liquid constant-pressure 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

 [R368] (1, 2) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill 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 constant-pressure heat capacitiy with the CSP method shown in [R369].

The heat capacity of a liquid is given by:

$\frac{Cp^L - Cp^{ig}}{R} = 1.45 + 0.45(1-T_r)^{-1} + 0.25\omega [17.11 + 25.2(1-T_r)^{1/3}T_r^{-1} + 1.742(1-T_r)^{-1}]$
Parameters: T : float Temperature of fluid [K] Tc : float Critical temperature of fluid [K] omega : float Acentric factor for fluid, [-] Cpgm : float Constant-pressure gas heat capacity, [J/mol/K] Cplm : float Liquid constant-pressure heat capacitiy, [J/mol/K]

Notes

Less accurate than Rowlinson_Poling.

References

 [R369] (1, 2) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
 [R370] Gesellschaft, V. D. I., ed. VDI Heat Atlas. 2nd edition. Berlin; New York:: Springer, 2010.
 [R371] 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 constant-pressure heat capacitiy with the similarity variable concept and method as shown in [R372].

$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 [R372], [mol/g] Cpl : float Liquid constant-pressure 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.8231E-05; a32 = 4.182E-04

References

 [R372] (1, 2, 3) Dadgostar, Nafiseh, and John M. Shaw. “A Predictive Correlation for the Constant-Pressure Specific Heat Capacity of Pure and Ill-Defined Liquid Hydrocarbons.” Fluid Phase Equilibria 313 (January 15, 2012): 211-226. 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 [R373].

$\frac{C}{R}=A_1\ln(1-T_r) + \frac{A_2}{1-T_r} + \sum_{j=0}^m A_{j+3} T_r^j$
Parameters: T : float Temperature [K] Tc : float Critical temperature of fluid, [K] a1-a6 : float Coefficients 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 [R373] when critical temperature was available for the fluid. Analytical integrals are available for this expression.

References

 [R373] (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 quasi-polynomial model developed in [R374].

Parameters: T : float Temperature [K] a1-a6 : float Coefficients 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

 [R374] (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 quasi-polynomial model developed in [R375].

Parameters: T : float Temperature [K] a1-a6 : float Coefficients 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

 [R375] (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 [R376].

$\frac{C}{R}=\sum_{j=0}^3 A_{j+1} \left(\frac{T}{100}\right)^j$
Parameters: T : float Temperature [K] a1-a4 : float Coefficients Cp : float Liquid heat capacity, [J/mol/K]

Notes

Most often form used in [R376]. Analytical integrals are available for this expression.

References

 [R376] (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 [R377].

Parameters: T : float Temperature [K] a1-a4 : float Coefficients H : float Difference in enthalpy from 0 K, [J/mol]

Notes

The analytical integral was derived with Sympy; it is a simple polynomial.

References

 [R377] (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 [R378].

Parameters: T : float Temperature [K] a1-a4 : float Coefficients 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

 [R378] (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

Quasi-polynomial object for calculating the heat capacity of a chemical. Implements the enthalpy and entropy integrals as well.

$\frac{C}{R}=A_1\ln(1-T_r) + \frac{A_2}{1-T_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 [R379]. uncertainty : str Uncertainty class of the heat capacity as given in [R379]. 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

 [R379] (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] 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] 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] 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 [R380] 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 [R380]. uncertainty : str Uncertainty class of the heat capacity as in [R380].

References

 [R380] (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] 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] 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] 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, constant-pressure', 'Zabransky quasipolynomial, constant-pressure', '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]

Class for dealing with liquid heat capacity as a function of temperature. Consists of six coefficient-based 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 Idea-gas molar heat capacity at T or callable for the same, [J/mol/K]

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 [R381] following critical evaluation of the available data. The spline methods use the form described in Zabransky_cubic over short ranges with varying coefficients to obtain a wider range. The quasi-polynomial methods use the form described in Zabransky_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 [R381] 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 quasi-polynomial method use the form described in Zabransky_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 [R385]. 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 [R383]. Very slow.
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 [R382] at 298.15 K; available for 245 liquids.
CRCSTD:
Consta values tabulated in [R384] at 298.15 K; data is available for 433 liquids.

References

 [R381] (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.
 [R382] (1, 2) Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
 [R383] (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/
 [R384] (1, 2) Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014.
 [R385] (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 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 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 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, 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 = '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, constant-pressure', 'Zabransky quasipolynomial, constant-pressure', '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; higher-temeprature 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 coefficient-based methods. For the CSP method Rowlinson_Poling, the model is considered valid for all temperatures. The simple method Dadgostar_Shaw is considered valid for all temperatures. For tabular data, extrapolation outside of the range is used if tabular_extrapolation_permitted is set; if it is, the extrapolation is considered valid for all temperatures.

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

Parameters: T : float Temperature at which to test the method, [K] method : str Name of the method to test validity : bool Whether or not a method is valid
units = '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 constant-pressure heat capacitiy with the similarity variable concept and method as shown in [R386].

$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 [R386], [mol/g] Cps : float Solid constant-pressure 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 hetero-atoms 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

 [R386] (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 Ill-Defined Organic Solids.” Fluid Phase Equilibria 268, no. 1-2 (June 25, 2008): 134-41. 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 constant-pressure heat capacitiy with the similarity variable concept and method as shown in [R387].

Uses a explicit form as derived with Sympy.

Parameters: T : float Temperature of solid [K] similarity_variable : float similarity variable as defined in [R387], [mol/g] H : float Difference in enthalpy from 0 K, [J/kg]

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

 [R387] (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 Ill-Defined Organic Solids.” Fluid Phase Equilibria 268, no. 1-2 (June 25, 2008): 134-41. 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 constant-pressure heat capacitiy with the similarity variable concept and method as shown in [R388].

Uses a explicit form as derived with Sympy.

Parameters: T : float Temperature of solid [K] similarity_variable : float similarity variable as defined in [R388], [mol/g] S : float Difference in entropy from 0 K, [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!

References

 [R388] (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 Ill-Defined Organic Solids.” Fluid Phase Equilibria 268, no. 1-2 (June 25, 2008): 134-41. 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 2-151", '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]

Class for dealing with solid heat capacity as a function of temperature. Consists of one temperature-dependent 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

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 [R390].

CRCSTD:
Values tabulated in [R389] 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

 [R389] (1, 2) Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of Chemistry and Physics. [Boca Raton, FL]: CRC press, 2014.
 [R390] (1, 2) Green, Don, and Robert Perry. Perry’s Chemical Engineers’ Handbook, Eighth Edition. McGraw-Hill 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 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 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 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, 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 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 2-151", '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 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. For the Lastovka_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 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]

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

 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 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 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 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 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 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 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 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]

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

 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 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 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 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 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 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 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 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]

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

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