Search is not available for this dataset
text stringlengths 75 104k |
|---|
def ionic_strength(mis, zis):
r'''Calculate the ionic strength of a solution in one of two ways,
depending on the inputs only. For Pitzer and Bromley models,
`mis` should be molalities of each component. For eNRTL models,
`mis` should be mole fractions of each electrolyte in the solution.
This will ... |
def Kweq_1981(T, rho_w):
r'''Calculates equilibrium constant for OH- and H+ in water, according to
[1]_. Second most recent formulation.
.. math::
\log_{10} K_w= A + B/T + C/T^2 + D/T^3 + (E+F/T+G/T^2)\log_{10} \rho_w
Parameters
----------
T : float
Temperature of fluid [K]
... |
def Kweq_IAPWS_gas(T):
r'''Calculates equilibrium constant for OH- and H+ in water vapor,
according to [1]_.
This is the most recent formulation available.
.. math::
-log_{10} K_w^G = \gamma_0 + \gamma_1 T^{-1} + \gamma_2 T^{-2} + \gamma_3 T^{-3}
Parameters
----------
T : float
... |
def Kweq_IAPWS(T, rho_w):
r'''Calculates equilibrium constant for OH- and H+ in water, according to
[1]_.
This is the most recent formulation available.
.. math::
Q = \rho \exp(\alpha_0 + \alpha_1 T^{-1} + \alpha_2 T^{-2} \rho^{2/3})
- \log_{10} K_w = -2n \left[ \log_{10}(1+Q) ... |
def ion_balance_proportional(anion_charges, cation_charges, zs, n_anions,
n_cations, balance_error, method):
'''Helper method for balance_ions for the proportional family of methods.
See balance_ions for a description of the methods; parameters are fairly
obvious.
'''
... |
def balance_ions(anions, cations, anion_zs=None, cation_zs=None,
anion_concs=None, cation_concs=None, rho_w=997.1,
method='increase dominant', selected_ion=None):
r'''Performs an ion balance to adjust measured experimental ion
compositions to electroneutrality. Can accept ei... |
def permittivity_IAPWS(T, rho):
r'''Calculate the relative permittivity of pure water as a function of.
temperature and density. Assumes the 1997 IAPWS [1]_ formulation.
.. math::
\epsilon(\rho, T) =\frac{1 + A + 5B + (9 + 2A + 18B + A^2 + 10AB +
9B^2)^{0.5}}{4(1-B)}
A(\rh... |
def load_all_methods(self):
r'''Method which picks out coefficients for the specified chemical
from the various dictionaries and DataFrames storing it. All data is
stored as attributes. This method also sets :obj:`Tmin`, :obj:`Tmax`,
and :obj:`all_methods` as a set of methods for which t... |
def calculate(self, T, method):
r'''Method to calculate permittivity 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 ... |
def Hcombustion(atoms, Hf=None, HfH2O=-285825, HfCO2=-393474,
HfSO2=-296800, HfBr2=30880, HfI2=62417, HfHCl=-92173,
HfHF=-272711, HfP4O10=-3009940, HfO2=0, HfN2=0):
'''Calculates the heat of combustion, in J/mol.
Value non-hydrocarbons is not correct, but still calculable.
P... |
def REFPROP(T, Tc, sigma0, n0, sigma1=0, n1=0, sigma2=0, n2=0):
r'''Calculates air-liquid surface tension using the REFPROP [1]_
regression-based method. Relatively recent, and most accurate.
.. math::
\sigma(T)=\sigma_0\left(1-\frac{T}{T_c}\right)^{n_0}+
\sigma_1\left(1-\frac{T}{T_c}\righ... |
def Somayajulu(T, Tc, A, B, C):
r'''Calculates air-water surface tension using the [1]_
emperical (parameter-regressed) method. Well regressed, no recent data.
.. math::
\sigma=aX^{5/4}+bX^{9/4}+cX^{13/4}
X=(T_c-T)/T_c
Parameters
----------
T : float
Temperature of flu... |
def Brock_Bird(T, Tb, Tc, Pc):
r'''Calculates air-water surface tension using the [1]_
emperical method. Old and tested.
.. math::
\sigma = P_c^{2/3}T_c^{1/3}Q(1-T_r)^{11/9}
Q = 0.1196 \left[ 1 + \frac{T_{br}\ln (P_c/1.01325)}{1-T_{br}}\right]-0.279
Parameters
----------
T : ... |
def Pitzer(T, Tc, Pc, omega):
r'''Calculates air-water surface tension using the correlation derived
by [1]_ from the works of [2]_ and [3]_. Based on critical property CSP
methods.
.. math::
\sigma = P_c^{2/3}T_c^{1/3}\frac{1.86 + 1.18\omega}{19.05}
\left[ \frac{3.75 + 0.91 \omega}{0.2... |
def Sastri_Rao(T, Tb, Tc, Pc, chemicaltype=None):
r'''Calculates air-water surface tension using the correlation derived by
[1]_ based on critical property CSP methods and chemical classes.
.. math::
\sigma = K P_c^xT_b^y T_c^z\left[\frac{1-T_r}{1-T_{br}}\right]^m
Parameters
----------
... |
def Zuo_Stenby(T, Tc, Pc, omega):
r'''Calculates air-water surface tension using the reference fluids
methods of [1]_.
.. math::
\sigma^{(1)} = 40.520(1-T_r)^{1.287}
\sigma^{(2)} = 52.095(1-T_r)^{1.21548}
\sigma_r = \sigma_r^{(1)}+ \frac{\omega - \omega^{(1)}}
{\omega^{(2)}-... |
def Hakim_Steinberg_Stiel(T, Tc, Pc, omega, StielPolar=0):
r'''Calculates air-water surface tension using the reference fluids methods
of [1]_.
.. math::
\sigma = 4.60104\times 10^{-7} P_c^{2/3}T_c^{1/3}Q_p \left(\frac{1-T_r}{0.4}\right)^m
Q_p = 0.1574+0.359\omega-1.769\chi-13.69\chi^2-0.5... |
def Miqueu(T, Tc, Vc, omega):
r'''Calculates air-water surface tension using the methods of [1]_.
.. math::
\sigma = k T_c \left( \frac{N_a}{V_c}\right)^{2/3}
(4.35 + 4.14 \omega)t^{1.26}(1+0.19t^{0.5} - 0.487t)
Parameters
----------
T : float
Temperature of fluid [K]
T... |
def Aleem(T, MW, Tb, rhol, Hvap_Tb, Cpl):
r'''Calculates vapor-liquid surface tension using the correlation derived by
[1]_ based on critical property CSP methods.
.. math::
\sigma = \phi \frac{MW^{1/3}} {6N_A^{1/3}}\rho_l^{2/3}\left[H_{vap}
+ C_{p,l}(T_b-T)\right]
\phi = 1 - 0.004... |
def Mersmann_Kind_surface_tension(T, Tm, Tb, Tc, Pc, n_associated=1):
r'''Estimates the surface tension of organic liquid substances
according to the method of [1]_.
.. math::
\sigma^* = \frac{\sigma n_{ass}^{1/3}} {(kT_c)^{1/3} T_{rm}P_c^{2/3}}
\sigma^* = \left(\frac{T_b - T_m}{T_... |
def Winterfeld_Scriven_Davis(xs, sigmas, rhoms):
r'''Calculates surface tension of a liquid mixture according to
mixing rules in [1]_ and also in [2]_.
.. math::
\sigma_M = \sum_i \sum_j \frac{1}{V_L^{L2}}\left(x_i V_i \right)
\left( x_jV_j\right)\sqrt{\sigma_i\cdot \sigma_j}
Parameter... |
def Diguilio_Teja(T, xs, sigmas_Tb, Tbs, Tcs):
r'''Calculates surface tension of a liquid mixture according to
mixing rules in [1]_.
.. math::
\sigma = 1.002855(T^*)^{1.118091} \frac{T}{T_b} \sigma_r
T^* = \frac{(T_c/T)-1}{(T_c/T_b)-1}
\sigma_r = \sum x_i \sigma_i
T_b = ... |
def load_all_methods(self):
r'''Method which picks out coefficients for the specified chemical
from the various dictionaries and DataFrames storing it. All data is
stored as attributes. This method also sets :obj:`Tmin`, :obj:`Tmax`,
and :obj:`all_methods` as a set of methods for which t... |
def calculate(self, T, method):
r'''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 whi... |
def load_all_methods(self):
r'''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 :obj:`Tmin`,
:obj:`Tmax`, and :obj:`all_methods` as a set of met... |
def calculate(self, T, P, zs, ws, method):
r'''Method to calculate surface tension 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.
... |
def load_group_assignments_DDBST():
'''Data is stored in the format
InChI key\tbool bool bool \tsubgroup count ...\tsubgroup count \tsubgroup count...
where the bools refer to whether or not the original UNIFAC, modified
UNIFAC, and PSRK group assignments were completed correctly.
The subgroups and ... |
def UNIFAC_RQ(groups, subgroup_data=None):
r'''Calculates UNIFAC parameters R and Q for a chemical, given a dictionary
of its groups, as shown in [1]_. Most UNIFAC methods use the same subgroup
values; however, a dictionary of `UNIFAC_subgroup` instances may be
specified as an optional second parameter... |
def UNIFAC_psi(T, subgroup1, subgroup2, subgroup_data, interaction_data,
modified=False):
r'''Calculates the interaction parameter psi(m, n) for two UNIFAC
subgroups, given the system temperature, the UNIFAC subgroups considered
for the variant of UNIFAC used, the interaction parameters fo... |
def UNIFAC(T, xs, chemgroups, cached=None, subgroup_data=None,
interaction_data=None, modified=False):
r'''Calculates activity coefficients using the UNIFAC model (optionally
modified), given a mixture's temperature, liquid mole fractions,
and optionally the subgroup data and interaction param... |
def dipole_moment(CASRN, AvailableMethods=False, Method=None):
r'''This function handles the retrieval of a chemical's dipole moment.
Lookup is based on CASRNs. Will automatically select a data source to use
if no Method is provided; returns None if the data is not available.
Prefered source is 'CCCBDB... |
def Pc(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[SURF]):
r'''This function handles the retrieval of a chemical's critical
pressure. Lookup is based on CASRNs. Will automatically select a data
source to use if no Method is provided; returns None if the data is not
available.
Prefere... |
def Vc(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[SURF]):
r'''This function handles the retrieval of a chemical's critical
volume. Lookup is based on CASRNs. Will automatically select a data
source to use if no Method is provided; returns None if the data is not
available.
Prefered ... |
def Zc(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[COMBINED]):
r'''This function handles the retrieval of a chemical's critical
compressibility. Lookup is based on CASRNs. Will automatically select a
data source to use if no Method is provided; returns None if the data is
not available.
... |
def Mersmann_Kind_predictor(atoms, coeff=3.645, power=0.5,
covalent_radii=rcovs_Mersmann_Kind):
r'''Predicts the critical molar volume of a chemical based only on its
atomic composition according to [1]_ and [2]_. This is a crude approach,
but provides very reasonable
estima... |
def Ihmels(Tc=None, Pc=None, Vc=None):
r'''Most recent, and most recommended method of estimating critical
properties from each other. Two of the three properties are required.
This model uses the "critical surface", a general plot of Tc vs Pc vs Vc.
The model used 421 organic compounds to derive equati... |
def Meissner(Tc=None, Pc=None, Vc=None):
r'''Old (1942) relationship for estimating critical
properties from each other. Two of the three properties are required.
This model uses the "critical surface", a general plot of Tc vs Pc vs Vc.
The model used 42 organic and inorganic compounds to derive the equ... |
def Grigoras(Tc=None, Pc=None, Vc=None):
r'''Relatively recent (1990) relationship for estimating critical
properties from each other. Two of the three properties are required.
This model uses the "critical surface", a general plot of Tc vs Pc vs Vc.
The model used 137 organic and inorganic compounds to... |
def critical_surface(Tc=None, Pc=None, Vc=None, AvailableMethods=False,
Method=None):
r'''Function for calculating a critical property of a substance from its
other two critical properties. Calls functions Ihmels, Meissner, and
Grigoras, each of which use a general 'Critical surface' ty... |
def third_property(CASRN=None, T=False, P=False, V=False):
r'''Function for calculating a critical property of a substance from its
other two critical properties, but retrieving the actual other critical
values for convenient calculation.
Calls functions Ihmels, Meissner, and
Grigoras, each of which... |
def Li(zs, Tcs, Vcs):
r'''Calculates critical temperature of a mixture according to
mixing rules in [1]_. Better than simple mixing rules.
.. math::
T_{cm} = \sum_{i=1}^n \Phi_i T_{ci}\\
\Phi = \frac{x_i V_{ci}}{\sum_{j=1}^n x_j V_{cj}}
Parameters
----------
zs : array-like
... |
def Chueh_Prausnitz_Tc(zs, Tcs, Vcs, taus):
r'''Calculates critical temperature of a mixture according to
mixing rules in [1]_.
.. math::
T_{cm} = \sum_i^n \theta_i Tc_i + \sum_i^n\sum_j^n(\theta_i \theta_j
\tau_{ij})T_{ref}
\theta = \frac{x_i V_{ci}^{2/3}}{\sum_{j=1}^n x_j V_{cj}^... |
def Grieves_Thodos(zs, Tcs, Aijs):
r'''Calculates critical temperature of a mixture according to
mixing rules in [1]_.
.. math::
T_{cm} = \sum_{i} \frac{T_{ci}}{1 + (1/x_i)\sum_j A_{ij} x_j}
For a binary mxiture, this simplifies to:
.. math::
T_{cm} = \frac{T_{c1}}{1 + (x_2/x_1)A_... |
def modified_Wilson_Tc(zs, Tcs, Aijs):
r'''Calculates critical temperature of a mixture according to
mixing rules in [1]_. Equation
.. math::
T_{cm} = \sum_i x_i T_{ci} + C\sum_i x_i \ln \left(x_i + \sum_j x_j A_{ij}\right)T_{ref}
For a binary mxiture, this simplifies to:
.. math::
... |
def Tc_mixture(Tcs=None, zs=None, CASRNs=None, AvailableMethods=False, Method=None): # pragma: no cover
'''This function handles the retrival of a mixture's critical temperature.
This API is considered experimental, and is expected to be removed in a
future release in favor of a more complete object-orien... |
def Pc_mixture(Pcs=None, zs=None, CASRNs=None, AvailableMethods=False, Method=None): # pragma: no cover
'''This function handles the retrival of a mixture's critical temperature.
This API is considered experimental, and is expected to be removed in a
future release in favor of a more complete object-orien... |
def Chueh_Prausnitz_Vc(zs, Vcs, nus):
r'''Calculates critical volume of a mixture according to
mixing rules in [1]_ with an interaction parameter.
.. math::
V_{cm} = \sum_i^n \theta_i V_{ci} + \sum_i^n\sum_j^n(\theta_i \theta_j \nu_{ij})V_{ref}
\theta = \frac{x_i V_{ci}^{2/3}}{\sum_{j=1}^n ... |
def modified_Wilson_Vc(zs, Vcs, Aijs):
r'''Calculates critical volume of a mixture according to
mixing rules in [1]_ with parameters. Equation
.. math::
V_{cm} = \sum_i x_i V_{ci} + C\sum_i x_i \ln \left(x_i + \sum_j x_j A_{ij}\right)V_{ref}
For a binary mxiture, this simplifies to:
.. ma... |
def Vc_mixture(Vcs=None, zs=None, CASRNs=None, AvailableMethods=False, Method=None): # pragma: no cover
'''This function handles the retrival of a mixture's critical temperature.
This API is considered experimental, and is expected to be removed in a
future release in favor of a more complete object-orien... |
def checkCAS(CASRN):
'''Checks if a CAS number is valid. Returns False if the parser cannot
parse the given string..
Parameters
----------
CASRN : string
A three-piece, dash-separated set of numbers
Returns
-------
result : bool
Boolean value if CASRN was valid. If par... |
def CAS_from_any(ID, autoload=False):
'''Looks up the CAS number of a chemical by searching and testing for the
string being any of the following types of chemical identifiers:
* Name, in IUPAC form or common form or a synonym registered in PubChem
* InChI name, prefixed by 'InChI=1S/' or 'InChI=1/... |
def mixture_from_any(ID):
'''Looks up a string which may represent a mixture in the database of
thermo to determine the key by which the composition of that mixture can
be obtained in the dictionary `_MixtureDict`.
Parameters
----------
ID : str
A string or 1-element list containing th... |
def charge(self):
'''Charge of the species as an integer. Computed as a property as most
species do not have a charge and so storing it would be a waste of
memory.
'''
try:
return self._charge
except AttributeError:
self._charge = charge_from_form... |
def load_included_indentifiers(self, file_name):
'''Loads a file with newline-separated integers representing which
chemical should be kept in memory; ones not included are ignored.
'''
self.restrict_identifiers = True
included_identifiers = set()
with open(file_n... |
def EQ100(T, A=0, B=0, C=0, D=0, E=0, F=0, G=0, order=0):
r'''DIPPR Equation # 100. Used in calculating the molar heat capacities
of liquids and solids, liquid thermal conductivity, and solid density.
All parameters default to zero. As this is a straightforward polynomial,
no restrictions on parameters ... |
def EQ102(T, A, B, C, D, order=0):
r'''DIPPR Equation # 102. Used in calculating vapor viscosity, vapor
thermal conductivity, and sometimes solid heat capacity. High values of B
raise an OverflowError.
All 4 parameters are required. C and D are often 0.
.. math::
Y = \frac{A\cdot T^B}{1 + \... |
def EQ104(T, A, B, C, D, E, order=0):
r'''DIPPR Equation #104. Often used in calculating second virial
coefficients of gases. All 5 parameters are required.
C, D, and E are normally large values.
.. math::
Y = A + \frac{B}{T} + \frac{C}{T^3} + \frac{D}{T^8} + \frac{E}{T^9}
Parameters
-... |
def EQ105(T, A, B, C, D):
r'''DIPPR Equation #105. Often used in calculating liquid molar density.
All 4 parameters are required. C is sometimes the fluid's critical
temperature.
.. math::
Y = \frac{A}{B^{1 + (1-\frac{T}{C})^D}}
Parameters
----------
T : float
Temperature, ... |
def EQ106(T, Tc, A, B, C=0, D=0, E=0):
r'''DIPPR Equation #106. Often used in calculating liquid surface tension,
and heat of vaporization.
Only parameters A and B parameters are required; many fits include no
further parameters. Critical temperature is also required.
.. math::
Y = A(1-T_r)... |
def EQ107(T, A=0, B=0, C=0, D=0, E=0, order=0):
r'''DIPPR Equation #107. Often used in calculating ideal-gas heat capacity.
All 5 parameters are required.
Also called the Aly-Lee equation.
.. math::
Y = A + B\left[\frac{C/T}{\sinh(C/T)}\right]^2 + D\left[\frac{E/T}{
\cosh(E/T)}\right]^2... |
def EQ114(T, Tc, A, B, C, D, order=0):
r'''DIPPR Equation #114. Rarely used, normally as an alternate liquid
heat capacity expression. All 4 parameters are required, as well as
critical temperature.
.. math::
Y = \frac{A^2}{\tau} + B - 2AC\tau - AD\tau^2 - \frac{1}{3}C^2\tau^3
- \frac{1... |
def EQ115(T, A, B, C=0, D=0, E=0):
r'''DIPPR Equation #115. No major uses; has been used as an alternate
liquid viscosity expression, and as a model for vapor pressure.
Only parameters A and B are required.
.. math::
Y = \exp\left(A + \frac{B}{T} + C\log T + D T^2 + \frac{E}{T^2}\right)
Pa... |
def EQ116(T, Tc, A, B, C, D, E, order=0):
r'''DIPPR Equation #116. Used to describe the molar density of water fairly
precisely; no other uses listed. All 5 parameters are needed, as well as
the critical temperature.
.. math::
Y = A + B\tau^{0.35} + C\tau^{2/3} + D\tau + E\tau^{4/3}
\t... |
def EQ127(T, A, B, C, D, E, F, G, order=0):
r'''DIPPR Equation #127. Rarely used, and then only in calculating
ideal-gas heat capacity. All 7 parameters are required.
.. math::
Y = A+B\left[\frac{\left(\frac{C}{T}\right)^2\exp\left(\frac{C}{T}
\right)}{\left(\exp\frac{C}{T}-1 \right)^2}\rig... |
def CoolProp_T_dependent_property(T, CASRN, prop, phase):
r'''Calculates a property of a chemical in either the liquid or gas phase
as a function of temperature only. This means that the property is
either at 1 atm or along the saturation curve.
Parameters
----------
T : float
Temperatu... |
def Stockmayer(Tm=None, Tb=None, Tc=None, Zc=None, omega=None,
CASRN='', AvailableMethods=False, Method=None):
r'''This function handles the retrieval or calculation a chemical's
Stockmayer parameter. Values are available from one source with lookup
based on CASRNs, or can be estimated from 7... |
def molecular_diameter(Tc=None, Pc=None, Vc=None, Zc=None, omega=None,
Vm=None, Vb=None, CASRN='', AvailableMethods=False, Method=None):
r'''This function handles the retrieval or calculation a chemical's
L-J molecular diameter. Values are available from one source with lookup
based on CASRNs, or ... |
def sigma_Tee_Gotoh_Steward_2(Tc, Pc, omega):
r'''Calculates Lennard-Jones molecular diameter.
Uses critical temperature, pressure, and acentric factor. CSP method by
[1]_.
.. math::
\sigma = (2.3551 - 0.0874\omega)\left(\frac{T_c}{P_c}\right)^{1/3}
Parameters
----------
Tc : float... |
def sigma_Silva_Liu_Macedo(Tc, Pc):
r'''Calculates Lennard-Jones molecular diameter.
Uses critical temperature and pressure. CSP method by [1]_.
.. math::
\sigma_{LJ}^3 = 0.17791 + 11.779 \left( \frac{T_c}{P_c}\right)
- 0.049029\left( \frac{T_c}{P_c}\right)^2
Parameters
----------
... |
def collision_integral_Neufeld_Janzen_Aziz(Tstar, l=1, s=1):
r'''Calculates Lennard-Jones collision integral for any of 16 values of
(l,j) for the wide range of 0.3 < Tstar < 100. Values are accurate to
0.1 % of actual values, but the calculation of actual values is
computationally intensive and so thes... |
def collision_integral_Kim_Monroe(Tstar, l=1, s=1):
r'''Calculates Lennard-Jones collision integral for any of 16 values of
(l,j) for the wide range of 0.3 < Tstar < 400. Values are accurate to
0.007 % of actual values, but the calculation of actual values is
computationally intensive and so these simpl... |
def Tstar(T, epsilon_k=None, epsilon=None):
r'''This function calculates the parameter `Tstar` as needed in performing
collision integral calculations.
.. math::
T^* = \frac{kT}{\epsilon}
Examples
--------
>>> Tstar(T=318.2, epsilon_k=308.43)
1.0316765554582887
Parameters
... |
def Hf(CASRN, AvailableMethods=False, Method=None):
r'''This function handles the retrieval of a chemical's standard-phase
heat of formation. The lookup is based on CASRNs. Selects the only
data source available ('API TDB') if the chemical is in it.
Returns None if the data is not available.
Functi... |
def Hf_l(CASRN, AvailableMethods=False, Method=None):
r'''This function handles the retrieval of a chemical's liquid standard
phase heat of formation. The lookup is based on CASRNs. Selects the only
data source available, Active Thermochemical Tables (l), if the chemical is
in it. Returns None if the da... |
def Hf_g(CASRN, AvailableMethods=False, Method=None):
r'''This function handles the retrieval of a chemical's gas heat of
formation. Lookup is based on CASRNs. Will automatically select a data
source to use if no Method is provided; returns None if the data is not
available.
Prefered sources are 'A... |
def omega(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=['LK', 'DEFINITION']):
r'''This function handles the retrieval of a chemical's acentric factor,
`omega`, or its calculation from correlations or directly through the
definition of acentric factor if possible. Requires a known boiling point,... |
def LK_omega(Tb, Tc, Pc):
r'''Estimates the acentric factor of a fluid using a correlation in [1]_.
.. math::
\omega = \frac{\ln P_{br}^{sat} - 5.92714 + 6.09648/T_{br} + 1.28862
\ln T_{br} -0.169347T_{br}^6}
{15.2518 - 15.6875/T_{br} - 13.4721 \ln T_{br} + 0.43577 T_{br}^6}
Parame... |
def omega_mixture(omegas, zs, CASRNs=None, Method=None,
AvailableMethods=False):
r'''This function handles the calculation of a mixture's acentric factor.
Calculation is based on the omegas provided for each pure component. Will
automatically select a method to use if no Method is provided... |
def StielPolar(Tc=None, Pc=None, omega=None, CASRN='', Method=None,
AvailableMethods=False):
r'''This function handles the calculation of a chemical's Stiel Polar
factor, directly through the definition of Stiel-polar factor if possible.
Requires Tc, Pc, acentric factor, and a vapor pressure ... |
def VDI_tabular_data(CASRN, prop):
r'''This function retrieves the tabular data available for a given chemical
and a given property. Lookup is based on CASRNs. Length of data returned
varies between chemicals. All data is at saturation condition from [1]_.
Function has data for 58 chemicals.
Param... |
def ViswanathNatarajan2(T, A, B):
'''
This function is known to produce values 10 times too low.
The author's data must have an error.
I have adjusted it to fix this.
# DDBST has 0.0004580 as a value at this temperature
>>> ViswanathNatarajan2(348.15, -5.9719, 1007.0)
0.00045983686956829517... |
def ViswanathNatarajan3(T, A, B, C):
r'''Calculate the viscosity of a liquid using the 3-term Antoine form
representation developed in [1]_. Requires input coefficients. The `A`
coefficient is assumed to yield coefficients in centipoise, as all
coefficients found so far have been.
.. math::
... |
def Letsou_Stiel(T, MW, Tc, Pc, omega):
r'''Calculates the viscosity of a liquid using an emperical model
developed in [1]_. However. the fitting parameters for tabulated values
in the original article are found in ChemSep.
.. math::
\xi = \frac{2173.424 T_c^{1/6}}{\sqrt{MW} P_c^{2/3}}
... |
def Przedziecki_Sridhar(T, Tm, Tc, Pc, Vc, Vm, omega, MW):
r'''Calculates the viscosity of a liquid using an emperical formula
developed in [1]_.
.. math::
\mu=\frac{V_o}{E(V-V_o)}
E=-1.12+\frac{V_c}{12.94+0.10MW-0.23P_c+0.0424T_{m}-11.58(T_{m}/T_c)}
V_o = 0.0085\omega T_c-2.02+\f... |
def Lucas(T, P, Tc, Pc, omega, P_sat, mu_l):
r'''Adjustes for pressure the viscosity of a liquid using an emperical
formula developed in [1]_, but as discussed in [2]_ as the original source
is in German.
.. math::
\frac{\mu}{\mu_{sat}}=\frac{1+D(\Delta P_r/2.118)^A}{1+C\omega \Delta P_r}
... |
def Yoon_Thodos(T, Tc, Pc, MW):
r'''Calculates the viscosity of a gas using an emperical formula
developed in [1]_.
.. math::
\eta \xi \times 10^8 = 46.10 T_r^{0.618} - 20.40 \exp(-0.449T_r) + 1
9.40\exp(-4.058T_r)+1
\xi = 2173.424 T_c^{1/6} MW^{-1/2} P_c^{-2/3}
Parameters
... |
def Stiel_Thodos(T, Tc, Pc, MW):
r'''Calculates the viscosity of a gas using an emperical formula
developed in [1]_.
.. math::
TODO
Parameters
----------
T : float
Temperature of the fluid [K]
Tc : float
Critical temperature of the fluid [K]
Pc : float
C... |
def lucas_gas(T, Tc, Pc, Zc, MW, dipole=0, CASRN=None):
r'''Estimate the viscosity of a gas using an emperical
formula developed in several sources, but as discussed in [1]_ as the
original sources are in German or merely personal communications with the
authors of [1]_.
.. math::
\eta = \... |
def Gharagheizi_gas_viscosity(T, Tc, Pc, MW):
r'''Calculates the viscosity of a gas using an emperical formula
developed in [1]_.
.. math::
\mu = 10^{-7} | 10^{-5} P_cT_r + \left(0.091-\frac{0.477}{M}\right)T +
M \left(10^{-5}P_c-\frac{8M^2}{T^2}\right)
\left(\frac{10.7639}{T_c}-\fr... |
def Herning_Zipperer(zs, mus, MWs):
r'''Calculates viscosity of a gas mixture according to
mixing rules in [1]_.
.. math::
TODO
Parameters
----------
zs : float
Mole fractions of components
mus : float
Gas viscosities of all components, [Pa*S]
MWs : float
... |
def Wilke(ys, mus, MWs):
r'''Calculates viscosity of a gas mixture according to
mixing rules in [1]_.
.. math::
\eta_{mix} = \sum_{i=1}^n \frac{y_i \eta_i}{\sum_{j=1}^n y_j \phi_{ij}}
\phi_{ij} = \frac{(1 + \sqrt{\eta_i/\eta_j}(MW_j/MW_i)^{0.25})^2}
{\sqrt{8(1+MW_i/MW_j)}}
Par... |
def Brokaw(T, ys, mus, MWs, molecular_diameters, Stockmayers):
r'''Calculates viscosity of a gas mixture according to
mixing rules in [1]_.
.. math::
\eta_{mix} = \sum_{i=1}^n \frac{y_i \eta_i}{\sum_{j=1}^n y_j \phi_{ij}}
\phi_{ij} = \left( \frac{\eta_i}{\eta_j} \right)^{0.5} S_{ij} A_{ij}... |
def _round_whole_even(i):
r'''Round a number to the nearest whole number. If the number is exactly
between two numbers, round to the even whole number. Used by
`viscosity_index`.
Parameters
----------
i : float
Number, [-]
Returns
-------
i : int
Rounded number, [-]... |
def viscosity_index(nu_40, nu_100, rounding=False):
r'''Calculates the viscosity index of a liquid. Requires dynamic viscosity
of a liquid at 40°C and 100°C. Value may either be returned with or
without rounding. Rounding is performed per the standard.
if nu_100 < 70:
.. math::
L, H = inte... |
def viscosity_converter(val, old_scale, new_scale, extrapolate=False):
r'''Converts kinematic viscosity values from different scales which have
historically been used. Though they may not be in use much, some standards
still specify values in these scales.
Parameters
----------
val : float
... |
def load_all_methods(self):
r'''Method which picks out coefficients for the specified chemical
from the various dictionaries and DataFrames storing it. All data is
stored as attributes. This method also sets :obj:`Tmin`, :obj:`Tmax`,
:obj:`all_methods` and obj:`all_methods_P` as a set of... |
def calculate(self, T, method):
r'''Method to calculate low-pressure liquid viscosity at tempearture
`T` with a given method.
This method has no exception handling; see `T_dependent_property`
for that.
Parameters
----------
T : float
Temperature at w... |
def calculate_P(self, T, P, method):
r'''Method to calculate pressure-dependent liquid viscosity at
temperature `T` and pressure `P` with a given method.
This method has no exception handling; see `TP_dependent_property`
for that.
Parameters
----------
T : float... |
def load_all_methods(self):
r'''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 :obj:`Tmin`,
:obj:`Tmax`, and :obj:`all_methods` as a set of met... |
def calculate(self, T, P, zs, ws, method):
r'''Method to calculate viscosity 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.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.