3. Heat Capacity¶
-
class
gasthermo.cp.
CpIdealGas
(dippr_no: str = None, compound_name: str = None, cas_number: str = None, T_min_fit: float = None, T_max_fit: float = None, n_points_fit: int = 1000, poly_order: int = 2, T_units='K', Cp_units='J/mol/K')[source]¶ Heat Capacity \(C_{\mathrm{p}}^{\mathrm{IG}}\) [J/mol/K] at Constant Pressure of Inorganic and Organic Compounds in the Ideal Gas State Fit to Hyperbolic Functions [RWO+07]
(1)¶\[C_{\mathrm{p}}^{\mathrm{IG}} = C_1 + C_2\left[\frac{C_3/T}{\sinh{(C_3/T)}}\right] + C_4 \left[\frac{C_5/T}{\cosh{(C_5/T)}}\right]^2\]where \(C_{\mathrm{p}}^{\mathrm{IG}}\) is in J/mol/K and \(T\) is in K.
Computing integrals of Equation (1) is challenging. Instead, the function is fit to a polynomial within a range of interest so that it can be integrated by using an antiderivative that is a polynomial.
- Parameters
dippr_no (str, optional) – dippr_no of compound by DIPPR table, defaults to None
compound_name (str, optional) – name of chemical compound, defaults to None
cas_number (str, optional) – CAS registry number for chemical compound, defaults to None
MW (float, derived from input) – molecular weight in g/mol
T_min (float, derived from input) – minimum temperature of validity for relationship [K]
T_max (float, derived from input) – maximum temperature of validity [K]
T_min_fit – minimum temperature for fitting, defaults to Tmin
T_max_fit – maximum temperature for fitting, defaults to Tmax
C1 (float, derived from input) – parameter in Equation (1)
C2 (float, derived from input) – parameter in Equation (1)
C3 (float, derived from input) – parameter in Equation (1)
C4 (float, derived from input) – parameter in Equation (1)
C5 (float, derived from input) – parameter in Equation (1)
Cp_units (str, optional) – units for \(C_{\mathrm{p}}^{\mathrm{IG}}\), defaults to J/mol/K
T_units (str, optional) – units for \(T\), defaults to K
n_points_fit (int, optional) – number of points for fitting polynomial and plotting, defaults to 1000
poly_order (int, optional) – order of polynomial for fitting, defaults to 2
-
cp_integral
(T_a, T_b)[source]¶ Evaluate integral
(2)¶\[\int_{T_a}^{T_b}C_{\mathrm{p}}^{\mathrm{IG}}(T^\prime) \mathrm{d}T^\prime\]- Parameters
T_a – start temperature in K
T_b – finish temperature in K
- Returns
integral
-
eval
(T, f_sinh=<ufunc 'sinh'>, f_cosh=<ufunc 'cosh'>)[source]¶ Evaluate heat capacity
- Parameters
T – temperature in K
f_sinh (callable) – function for hyperbolic sine, defaults to
np.sinh
f_cosh (callable) – function for hyperbolic cosine, defaults to
np.cosh
- Returns
\(C_{\mathrm{p}}^{\mathrm{IG}}\) J/mol/K (see equation (1))
-
class
gasthermo.cp.
CpStar
(T_ref: float, **kwargs)[source]¶ Dimensionless Heat Capacity at Constant Pressure of Inorganic and Organic Compounds in the Ideal Gas State Fit to Hyperbolic Functions [RWO+07]
The dimensionless form is obtained by introducing the following variables
\[\begin{split}\begin{align} C_{\mathrm{p}}^\star &= \frac{C_\mathrm{p}^\mathrm{IG}}{\text{R}} \\ T^\star &= \frac{T}{T_\text{ref}} \end{align}\end{split}\]where R is the gas constant in units of J/mol/K, and \(T_\text{ref}\) is a reference temperature [K] input by the user (see
T_ref
)The heat capacity in dimensionless form becomes
(3)¶\[C_{\mathrm{p}}^\star = C_1^\star + C_2^\star \left[\frac{C_3^\star/T^\star}{\sinh{(C_3^\star/T^\star)}}\right] + C_4^\star \left[\frac{C_5^\star/T^\star}{\cosh{(C_5^\star/T^\star)}}\right]^2\]where
\[\begin{split}\begin{align} C_1^\star &= \frac{C_1}{\text{R}} \\ C_2^\star &= \frac{C_2}{\text{R}} \\ C_3^\star &= \frac{C_3}{T_\text{ref}} \\ C_4^\star &= \frac{C_4}{\text{R}} \\ C_5^\star &= \frac{C_5}{T_\text{ref}} \end{align}\end{split}\]- Parameters
T_ref (float) – reference temperature [K] for dimensionless computations
-
eval
(T, f_sinh=<ufunc 'sinh'>, f_cosh=<ufunc 'cosh'>)[source]¶ - Parameters
T – temperature in K
f_sinh (callable) – function for hyperbolic sine, defaults to
np.sinh
f_cosh (callable) – function for hyperbolic cosine, defaults to
np.cosh
- Returns
\(C_{\mathrm{p}}^{\star}\) [dimensionless] (see equation (3))
-
class
gasthermo.cp.
CpRawData
(T_raw: list, Cp_raw: list, T_min_fit: float = None, T_max_fit: float = None, poly_order: int = 2, T_units='K', Cp_units='J/mol/K')[source]¶ Obtain heat capacity relationships from raw data
Using input raw data # fit to polynomial of temperature # fit polynomial to antiderivative
- Parameters
T_min_fit (float, optional) – minimum temperature for fitting function [K]
T_max_fit (float, optional) – maximum temperature for fitting function [K]
poly_order (int, optional) – order of polynomial for fitting, defaults to 2
T_raw (list) – raw temperatures in K
Cp_raw (list) – raw heat capacities in J/K/mol
Cp_units (str, optional) – units for \(C_{\mathrm{p}}\), defaults to J/mol/K
T_units (str, optional) – units for \(T\), defaults to K