# thermo.viscosity module¶

thermo.viscosity.ViswanathNatarajan2(T, A, B)[source]

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

thermo.viscosity.ViswanathNatarajan2Exponential(T, C, D)[source]

This function is genuinely bad at what it does.

>>> ViswanathNatarajan2Exponential(298.15, 4900800,  -3.8075)
0.0018571903840928496

thermo.viscosity.ViswanathNatarajan3(T, A, B, C)[source]

Calculate the viscosity of a liquid using the 3-term Antoine form representation developed in [R619]. Requires input coefficients. The A coefficient is assumed to yield coefficients in centipoise, as all coefficients found so far have been.

$\log_{10} \mu = A + B/(T + C)$
Parameters: T : float Temperature of fluid [K] mu : float Liquid viscosity, [Pa*s]

Notes

No other source for these coefficients has been found.

References

 [R619] (1, 2) Viswanath, Dabir S., and G. Natarajan. Databook On The Viscosity Of Liquids. New York: Taylor & Francis, 1989

Examples

>>> ViswanathNatarajan3(298.15, -2.7173, -1071.18, -129.51)
0.0006129806445142112

thermo.viscosity.Letsou_Stiel(T, MW, Tc, Pc, omega)[source]

Calculates the viscosity of a liquid using an emperical model developed in [R620]. However. the fitting parameters for tabulated values in the original article are found in ChemSep.

\begin{align}\begin{aligned}\xi = \frac{2173.424 T_c^{1/6}}{\sqrt{MW} P_c^{2/3}}\\\xi^{(0)} = (1.5174 - 2.135T_r + 0.75T_r^2)\cdot 10^{-5}\\\xi^{(1)} = (4.2552 - 7.674 T_r + 3.4 T_r^2)\cdot 10^{-5}\\\mu = (\xi^{(0)} + \omega \xi^{(1)})/\xi\end{aligned}\end{align}
Parameters: T : float Temperature of fluid [K] MW : float Molwcular weight of fluid [g/mol] Tc : float Critical temperature of the fluid [K] Pc : float Critical pressure of the fluid [Pa] omega : float Acentric factor of compound mu_l : float Viscosity of liquid, [Pa*S]

Notes

The form of this equation is a polynomial fit to tabulated data. The fitting was performed by the DIPPR. This is DIPPR Procedure 8G: Method for the viscosity of pure, nonhydrocarbon liquids at high temperatures internal units are SI standard. [R620]‘s units were different. DIPPR test value for ethanol is used.

Average error 34%. Range of applicability is 0.76 < Tr < 0.98.

References

 [R620] (1, 2, 3) Letsou, Athena, and Leonard I. Stiel. “Viscosity of Saturated Nonpolar Liquids at Elevated Pressures.” AIChE Journal 19, no. 2 (1973): 409-11. doi:10.1002/aic.690190241.

Examples

>>> Letsou_Stiel(400., 46.07, 516.25, 6.383E6, 0.6371)
0.0002036150875308151

thermo.viscosity.Przedziecki_Sridhar(T, Tm, Tc, Pc, Vc, Vm, omega, MW)[source]

Calculates the viscosity of a liquid using an emperical formula developed in [R621].

\begin{align}\begin{aligned}\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+\frac{V_{m}}{0.342(T_m/T_c)+0.894}\end{aligned}\end{align}
Parameters: T : float Temperature of the fluid [K] Tm : float Melting point of fluid [K] Tc : float Critical temperature of the fluid [K] Pc : float Critical pressure of the fluid [Pa] Vc : float Critical volume of the fluid [m^3/mol] Vm : float Molar volume of the fluid at temperature [K] omega : float Acentric factor of compound MW : float Molwcular weight of fluid [g/mol] mu_l : float Viscosity of liquid, [Pa*S]

Notes

A test by Reid (1983) is used, but only mostly correct. This function is not recommended. Its use has been removed from the Liquid Viscosity function. Internal units are bar and mL/mol. TODO: Test again with data from 5th ed table.

References

 [R621] (1, 2) Przedziecki, J. W., and T. Sridhar. “Prediction of Liquid Viscosities.” AIChE Journal 31, no. 2 (February 1, 1985): 333-35. doi:10.1002/aic.690310225.

Examples

>>> Przedziecki_Sridhar(383., 178., 591.8, 41E5, 316E-6, 95E-6, .263, 92.14)
0.0002198147995603383

thermo.viscosity.viscosity_liquid_methods = ['COOLPROP', 'DIPPR_PERRY_8E', 'VDI_PPDS', 'DUTT_PRASAD', 'VISWANATH_NATARAJAN_3', 'VISWANATH_NATARAJAN_2', 'VISWANATH_NATARAJAN_2E', 'VDI_TABULAR', 'LETSOU_STIEL', 'PRZEDZIECKI_SRIDHAR']

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

thermo.viscosity.viscosity_liquid_methods_P = ['COOLPROP', 'LUCAS']

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

class thermo.viscosity.ViscosityLiquid(CASRN='', MW=None, Tm=None, Tc=None, Pc=None, Vc=None, omega=None, Psat=None, Vml=None)[source]

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

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

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

Parameters: CASRN : str, optional The CAS number of the chemical MW : float, optional Molecular weight, [g/mol] Tm : float, optional Melting point, [K] Tc : float, optional Critical temperature, [K] Pc : float, optional Critical pressure, [Pa] Vc : float, optional Critical volume, [m^3/mol] omega : float, optional Acentric factor, [-] Psat : float or callable, optional Vapor pressure at a given temperature or callable for the same, [Pa] Vml : float or callable, optional Liquid molar volume at a given temperature and pressure or callable for the same, [m^3/mol]

Notes

To iterate over all methods, use the lists stored in viscosity_liquid_methods and viscosity_liquid_methods_P for low and high pressure methods respectively.

Low pressure methods:

A simple function as expressed in [R622], with data available for 100 fluids. Temperature limits are available for all fluids. See ViswanathNatarajan3 for details.
VISWANATH_NATARAJAN_3:
A simple function as expressed in [R622], with data available for 432 fluids. Temperature limits are available for all fluids. See ViswanathNatarajan3 for details.
VN2_data:
A simple function as expressed in [R622], with data available for 135 fluids. Temperature limits are available for all fluids. See ViswanathNatarajan2 for details.
VISWANATH_NATARAJAN_2E:
A simple function as expressed in [R622], with data available for 14 fluids. Temperature limits are available for all fluids. See ViswanathNatarajan2Exponential for details.
DIPPR_PERRY_8E:
A collection of 337 coefficient sets from the DIPPR database published openly in [R625]. Provides temperature limits for all its fluids. thermo.dippr.EQ101 is used for its fluids.
LETSOU_STIEL:
CSP method, described in Letsou_Stiel.
PRZEDZIECKI_SRIDHAR:
CSP method, described in Przedziecki_Sridhar.
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 [R623]. Very slow.
VDI_TABULAR:
Tabular data in [R624] along the saturation curve; interpolation is as set by the user or the default.
VDI_PPDS:
Coefficients for a equation form developed by the PPDS, published openly in [R624]. Provides no temperature limits, but has been designed for extrapolation. Extrapolated to low temperatures it provides a smooth exponential increase. However, for some chemicals such as glycerol, extrapolated to higher temperatures viscosity is predicted to increase above a certain point.

High pressure methods:

LUCAS:
CSP method, described in Lucas. Calculates a low-pressure liquid viscosity first, using T_dependent_property.
COOLPROP:
CoolProp external library; with select fluids from its library. Range is limited to that of the equations of state it uses, as described in [5]_. Very slow, but unparalled in accuracy for pressure dependence.

References

 [R622] (1, 2, 3, 4, 5) Viswanath, Dabir S., and G. Natarajan. Databook On The Viscosity Of Liquids. New York: Taylor & Francis, 1989
 [R623] (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/
 [R624] (1, 2, 3) Gesellschaft, V. D. I., ed. VDI Heat Atlas. 2nd edition. Berlin; New York:: Springer, 2010.
 [R625] (1, 2) Green, Don, and Robert Perry. Perry’s Chemical Engineers’ Handbook, Eighth Edition. McGraw-Hill Professional, 2007.

Attributes

 TP_cached T_cached interpolation_P interpolation_T interpolation_property interpolation_property_inv method method_P

Methods

 TP_dependent_property(T, P) Method to calculate the property with sanity checking and without specifying a specific method. TP_dependent_property_derivative_P(T, P[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to pressure at constant temperature, of a given order. TP_dependent_property_derivative_T(T, P[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to temperature at constant pressure, of a given order. TP_or_T_dependent_property(T, P) T_dependent_property(T) Method to calculate the property with sanity checking and without specifying a specific method. T_dependent_property_derivative(T[, order]) Method to obtain a derivative of a property with respect to temperature, of a given order. T_dependent_property_integral(T1, T2) Method to calculate the integral of a property with respect to temperature, using a specified method. T_dependent_property_integral_over_T(T1, T2) Method to calculate the integral of a property over temperature with respect to temperature, using a specified method. __call__(T, P) Convenience method to calculate the property; calls TP_dependent_property. calculate(T, method) Method to calculate low-pressure liquid viscosity at tempearture T with a given method. calculate_P(T, P, method) Method to calculate pressure-dependent liquid viscosity at temperature T and pressure P with a given method. calculate_derivative(T, method[, order]) Method to calculate a derivative of a property with respect to temperature, of a given order using a specified method. calculate_derivative_P(P, T, method[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to pressure at constant temperature, of a given order using a specified method. calculate_derivative_T(T, P, method[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to temperature at constant pressure, of a given order using a specified method. calculate_integral(T1, T2, method) Method to calculate the integral of a property with respect to temperature, using a specified method. calculate_integral_over_T(T1, T2, method) Method to calculate the integral of a property over temperature with respect to temperature, using a specified method. extrapolate_tabular(T) interpolate(T, name) Method to perform interpolation on a given tabular data set previously added via set_tabular_data. interpolate_P(T, P, name) Method to perform interpolation on a given tabular data set previously added via set_tabular_data_P. load_all_methods() Method which picks out coefficients for the specified chemical from the various dictionaries and DataFrames storing it. plot_TP_dependent_property([Tmin, Tmax, ...]) Method to create a plot of the property vs temperature and pressure according to either a specified list of methods, or user methods (if set), or all methods. plot_T_dependent_property([Tmin, Tmax, ...]) Method to create a plot of the property vs temperature according to either a specified list of methods, or user methods (if set), or all methods. plot_isobar(P[, Tmin, Tmax, methods_P, pts, ...]) Method to create a plot of the property vs temperature at a specific pressure according to either a specified list of methods, or user methods (if set), or all methods. plot_isotherm(T[, Pmin, Pmax, methods_P, ...]) Method to create a plot of the property vs pressure at a specified temperature according to either a specified list of methods, or the user methods (if set), or all methods. select_valid_methods(T) Method to obtain a sorted list of methods which are valid at T according to test_method_validity. select_valid_methods_P(T, P) Method to obtain a sorted list methods which are valid at T according to test_method_validity. set_tabular_data(Ts, properties[, name, ...]) Method to set tabular data to be used for interpolation. set_tabular_data_P(Ts, Ps, properties[, ...]) Method to set tabular data to be used for interpolation. set_user_methods(user_methods[, forced]) Method used to select certain property methods as having a higher priority than were set by default. set_user_methods_P(user_methods_P[, forced_P]) Method to set the pressure-dependent property methods desired for consideration by the user. solve_prop(goal[, reset_method]) Method to solve for the temperature at which a property is at a specified value. test_method_validity(T, method) Method to check the validity of a method. test_method_validity_P(T, P, method) Method to check the validity of a high-pressure method. test_property_validity(prop) Method to test the validity of a calculated property.
Tmax = None

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

Tmin = None

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

all_methods = None

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

all_methods_P = None

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

calculate(T, method)[source]

Method to calculate low-pressure liquid 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 which to calculate viscosity, [K] method : str Name of the method to use mu : float Viscosity of the liquid at T and a low pressure, [Pa*S]
calculate_P(T, P, method)[source]

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 Temperature at which to calculate viscosity, [K] P : float Pressure at which to calculate viscosity, [K] method : str Name of the method to use mu : float Viscosity of the liquid at T and P, [Pa*S]
interpolation_P = None

No interpolation transformation by default.

interpolation_T = None

No interpolation transformation by default.

interpolation_property = None

No interpolation transformation by default.

interpolation_property_inv = None

No interpolation transformation by default.

load_all_methods()[source]

Method which picks out coefficients for the specified chemical from the various dictionaries and DataFrames storing it. All data is stored as attributes. This method also sets Tmin, Tmax, all_methods and obj:all_methods_P as a set of methods for which the data exists for.

Called on initialization only. See the source code for the variables at which the coefficients are stored. The coefficients can safely be altered once the class is initialized. This method can be called again to reset the parameters.

name = 'liquid viscosity'
property_max = 200000000.0

Maximum valid value of liquid viscosity. Generous limit, as the value is that of bitumen in a Pitch drop experiment.

property_min = 0

Mimimum valid value of liquid viscosity.

ranked_methods = ['COOLPROP', 'DIPPR_PERRY_8E', 'VDI_PPDS', 'DUTT_PRASAD', 'VISWANATH_NATARAJAN_3', 'VISWANATH_NATARAJAN_2', 'VISWANATH_NATARAJAN_2E', 'VDI_TABULAR', 'LETSOU_STIEL', 'PRZEDZIECKI_SRIDHAR']

Default rankings of the low-pressure methods.

ranked_methods_P = ['COOLPROP', 'LUCAS']

Default rankings of the high-pressure methods.

sorted_valid_methods = None

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

sorted_valid_methods_P = None

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

tabular_data = None

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

tabular_data_P = None

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

tabular_data_interpolators = None

tabular_data_interpolators, dict: Stored (extrapolator, spline) tuples which are interp1d instances for each set of tabular data; indexed by tuple of (name, interpolation_T, interpolation_property, interpolation_property_inv) to ensure that if an interpolation transform is altered, the old interpolator which had been created is no longer used.

tabular_data_interpolators_P = None

tabular_data_interpolators_P, dict: Stored (extrapolator, spline) tuples which are interp2d instances for each set of tabular data; indexed by tuple of (name, interpolation_T, interpolation_P, interpolation_property, interpolation_property_inv) to ensure that if an interpolation transform is altered, the old interpolator which had been created is no longer used.

tabular_extrapolation_permitted = True

Allow tabular extrapolation by default.

test_method_validity(T, method)[source]

Method to check the validity of a method. Follows the given ranges for all coefficient-based methods. For CSP methods, the models are considered valid from 0 K to the critical point. For tabular data, extrapolation outside of the range is used if tabular_extrapolation_permitted is set; if it is, the extrapolation is considered valid for all temperatures.

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

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
test_method_validity_P(T, P, method)[source]

Method to check the validity of a high-pressure method. For COOLPROP, the fluid must be both a liquid and under the maximum pressure of the fluid’s EOS. LUCAS doesn’t work on some occasions, due to something related to Tr and negative powers - but is otherwise considered correct for all circumstances.

For tabular data, extrapolation outside of the range is used if tabular_extrapolation_permitted is set; if it is, the extrapolation is considered valid for all temperatures and pressures.

Parameters: T : float Temperature at which to test the method, [K] P : float Pressure at which to test the method, [Pa] method : str Name of the method to test validity : bool Whether or not a method is valid
units = 'Pa*s'
user_methods = None

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

user_methods_P = None

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

class thermo.viscosity.ViscosityGas(CASRN='', MW=None, Tc=None, Pc=None, Zc=None, dipole=None, Vmg=None)[source]

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

For gases at atmospheric pressure, there are 4 corresponding-states estimators, two sources of coefficient-based models, one source of tabular information, and the external library CoolProp.

For gases under the fluid’s boiling point (at sub-atmospheric pressures), and high-pressure gases above the boiling point, there are zero corresponding-states estimators, and the external library CoolProp.

Parameters: CASRN : str, optional The CAS number of the chemical MW : float, optional Molecular weight, [g/mol] Tc : float, optional Critical temperature, [K] Pc : float, optional Critical pressure, [Pa] Zc : float, optional Critical compressibility, [-] dipole : float, optional Dipole moment of the fluid, [debye] Vmg : float, optional Molar volume of the fluid at a pressure and temperature, [m^3/mol]

Notes

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

Low pressure methods:

GHARAGHEIZI:
CSP method, described in Gharagheizi_gas_viscosity.
YOON_THODOS:
CSP method, described in Yoon_Thodos.
STIEL_THODOS:
CSP method, described in Stiel_Thodos.
LUCAS_GAS:
CSP method, described in lucas_gas.
DIPPR_PERRY_8E:
A collection of 345 coefficient sets from the DIPPR database published openly in [R628]. Provides temperature limits for all its fluids. thermo.dippr.EQ102 is used for its fluids.
VDI_PPDS:
Coefficients for a equation form developed by the PPDS, published openly in [R627]. Provides no temperature limits, but provides reasonable values at fairly high and very low temperatures.
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 [R626]. Very slow.
VDI_TABULAR:
Tabular data in [R627] along the saturation curve; interpolation is as set by the user or the default.

High pressure methods:

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 [R626]. Very slow, but unparalled in accuracy for pressure dependence.

References

 [R626] (1, 2, 3) Bell, Ian H., Jorrit Wronski, Sylvain Quoilin, and Vincent Lemort. “Pure and Pseudo-Pure Fluid Thermophysical Property Evaluation and the Open-Source Thermophysical Property Library CoolProp.” Industrial & Engineering Chemistry Research 53, no. 6 (February 12, 2014): 2498-2508. doi:10.1021/ie4033999. http://www.coolprop.org/
 [R627] (1, 2, 3) Gesellschaft, V. D. I., ed. VDI Heat Atlas. 2nd edition. Berlin; New York:: Springer, 2010.
 [R628] (1, 2) Green, Don, and Robert Perry. Perry’s Chemical Engineers’ Handbook, Eighth Edition. McGraw-Hill Professional, 2007.

Attributes

 TP_cached T_cached interpolation_P interpolation_T interpolation_property interpolation_property_inv method method_P

Methods

 TP_dependent_property(T, P) Method to calculate the property with sanity checking and without specifying a specific method. TP_dependent_property_derivative_P(T, P[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to pressure at constant temperature, of a given order. TP_dependent_property_derivative_T(T, P[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to temperature at constant pressure, of a given order. TP_or_T_dependent_property(T, P) T_dependent_property(T) Method to calculate the property with sanity checking and without specifying a specific method. T_dependent_property_derivative(T[, order]) Method to obtain a derivative of a property with respect to temperature, of a given order. T_dependent_property_integral(T1, T2) Method to calculate the integral of a property with respect to temperature, using a specified method. T_dependent_property_integral_over_T(T1, T2) Method to calculate the integral of a property over temperature with respect to temperature, using a specified method. __call__(T, P) Convenience method to calculate the property; calls TP_dependent_property. calculate(T, method) Method to calculate low-pressure gas viscosity at tempearture T with a given method. calculate_P(T, P, method) Method to calculate pressure-dependent gas viscosity at temperature T and pressure P with a given method. calculate_derivative(T, method[, order]) Method to calculate a derivative of a property with respect to temperature, of a given order using a specified method. calculate_derivative_P(P, T, method[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to pressure at constant temperature, of a given order using a specified method. calculate_derivative_T(T, P, method[, order]) Method to calculate a derivative of a temperature and pressure dependent property with respect to temperature at constant pressure, of a given order using a specified method. calculate_integral(T1, T2, method) Method to calculate the integral of a property with respect to temperature, using a specified method. calculate_integral_over_T(T1, T2, method) Method to calculate the integral of a property over temperature with respect to temperature, using a specified method. extrapolate_tabular(T) interpolate(T, name) Method to perform interpolation on a given tabular data set previously added via set_tabular_data. interpolate_P(T, P, name) Method to perform interpolation on a given tabular data set previously added via set_tabular_data_P. load_all_methods() Method which picks out coefficients for the specified chemical from the various dictionaries and DataFrames storing it. plot_TP_dependent_property([Tmin, Tmax, ...]) Method to create a plot of the property vs temperature and pressure according to either a specified list of methods, or user methods (if set), or all methods. plot_T_dependent_property([Tmin, Tmax, ...]) Method to create a plot of the property vs temperature according to either a specified list of methods, or user methods (if set), or all methods. plot_isobar(P[, Tmin, Tmax, methods_P, pts, ...]) Method to create a plot of the property vs temperature at a specific pressure according to either a specified list of methods, or user methods (if set), or all methods. plot_isotherm(T[, Pmin, Pmax, methods_P, ...]) Method to create a plot of the property vs pressure at a specified temperature according to either a specified list of methods, or the user methods (if set), or all methods. select_valid_methods(T) Method to obtain a sorted list of methods which are valid at T according to test_method_validity. select_valid_methods_P(T, P) Method to obtain a sorted list methods which are valid at T according to test_method_validity. set_tabular_data(Ts, properties[, name, ...]) Method to set tabular data to be used for interpolation. set_tabular_data_P(Ts, Ps, properties[, ...]) Method to set tabular data to be used for interpolation. set_user_methods(user_methods[, forced]) Method used to select certain property methods as having a higher priority than were set by default. set_user_methods_P(user_methods_P[, forced_P]) Method to set the pressure-dependent property methods desired for consideration by the user. solve_prop(goal[, reset_method]) Method to solve for the temperature at which a property is at a specified value. test_method_validity(T, method) Method to check the validity of a temperature-dependent low-pressure method. test_method_validity_P(T, P, method) Method to check the validity of a high-pressure method. test_property_validity(prop) Method to test the validity of a calculated property.
Tmax = None

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

Tmin = None

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

all_methods = None

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

all_methods_P = None

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

calculate(T, method)[source]

Method to calculate low-pressure gas viscosity at tempearture T with a given method.

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

Parameters: T : float Temperature of the gas, [K] method : str Name of the method to use mu : float Viscosity of the gas at T and a low pressure, [Pa*S]
calculate_P(T, P, method)[source]

Method to calculate pressure-dependent gas 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 Temperature at which to calculate gas viscosity, [K] P : float Pressure at which to calculate gas viscosity, [K] method : str Name of the method to use mu : float Viscosity of the gas at T and P, [Pa*]
interpolation_P = None

No interpolation transformation by default.

interpolation_T = None

No interpolation transformation by default.

interpolation_property = None

No interpolation transformation by default.

interpolation_property_inv = None

No interpolation transformation by default.

load_all_methods()[source]

Method which picks out coefficients for the specified chemical from the various dictionaries and DataFrames storing it. All data is stored as attributes. This method also sets Tmin, Tmax, all_methods and obj:all_methods_P as a set of methods for which the data exists for.

Called on initialization only. See the source code for the variables at which the coefficients are stored. The coefficients can safely be altered once the class is initialized. This method can be called again to reset the parameters.

name = 'Gas viscosity'
property_max = 0.001

Maximum valid value of gas viscosity. Might be too high, or too low.

property_min = 0

Mimimum valid value of gas viscosity; limiting condition at low pressure is 0.

ranked_methods = ['COOLPROP', 'DIPPR_PERRY_8E', 'VDI_PPDS', 'VDI_TABULAR', 'GHARAGHEIZI', 'YOON_THODOS', 'STIEL_THODOS', 'LUCAS_GAS']

Default rankings of the low-pressure methods.

ranked_methods_P = ['COOLPROP']

Default rankings of the high-pressure methods.

sorted_valid_methods = None

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

sorted_valid_methods_P = None

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

tabular_data = None

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

tabular_data_P = None

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

tabular_data_interpolators = None

tabular_data_interpolators, dict: Stored (extrapolator, spline) tuples which are interp1d instances for each set of tabular data; indexed by tuple of (name, interpolation_T, interpolation_property, interpolation_property_inv) to ensure that if an interpolation transform is altered, the old interpolator which had been created is no longer used.

tabular_data_interpolators_P = None

tabular_data_interpolators_P, dict: Stored (extrapolator, spline) tuples which are interp2d instances for each set of tabular data; indexed by tuple of (name, interpolation_T, interpolation_P, interpolation_property, interpolation_property_inv) to ensure that if an interpolation transform is altered, the old interpolator which had been created is no longer used.

tabular_extrapolation_permitted = True

Allow tabular extrapolation by default.

test_method_validity(T, method)[source]

Method to check the validity of a temperature-dependent low-pressure method. For CSP most methods, the all methods are considered valid from 0 K up to 5000 K. For method GHARAGHEIZI, the method is considered valud from 20 K to 2000 K.

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
test_method_validity_P(T, P, method)[source]

Method to check the validity of a high-pressure method. For COOLPROP, the fluid must be both a gas and under the maximum pressure of the fluid’s EOS. No other methods are implemented.

For tabular data, extrapolation outside of the range is used if tabular_extrapolation_permitted is set; if it is, the extrapolation is considered valid for all temperatures and pressures.

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

Parameters: T : float Temperature at which to test the method, [K] P : float Pressure at which to test the method, [Pa] method : str Name of the method to test validity : bool Whether or not a method is valid
units = 'Pa*s'
user_methods = None

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

user_methods_P = None

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

thermo.viscosity.Lucas(T, P, Tc, Pc, omega, P_sat, mu_l)[source]

Adjustes for pressure the viscosity of a liquid using an emperical formula developed in [R629], but as discussed in [R630] as the original source is in German.

\begin{align}\begin{aligned}\frac{\mu}{\mu_{sat}}=\frac{1+D(\Delta P_r/2.118)^A}{1+C\omega \Delta P_r}\\\Delta P_r = \frac{P-P^{sat}}{P_c}\\A=0.9991-\frac{4.674\times 10^{-4}}{1.0523T_r^{-0.03877}-1.0513}\\D = \frac{0.3257}{(1.0039-T_r^{2.573})^{0.2906}}-0.2086\\C = -0.07921+2.1616T_r-13.4040T_r^2+44.1706T_r^3-84.8291T_r^4+ 96.1209T_r^5-59.8127T_r^6+15.6719T_r^7\end{aligned}\end{align}
Parameters: T : float Temperature of fluid [K] P : float Pressure of fluid [Pa] Tc: float Critical point of fluid [K] Pc : float Critical pressure of the fluid [Pa] omega : float Acentric factor of compound P_sat : float Saturation pressure of the fluid [Pa] mu_l : float Viscosity of liquid at 1 atm or saturation, [Pa*S] mu_l_dense : float Viscosity of liquid, [Pa*s]

Notes

This equation is entirely dimensionless; all dimensions cancel. The example is from Reid (1987); all results agree. Above several thousand bar, this equation does not represent true behavior. If Psat is larger than P, the fluid may not be liquid; dPr is set to 0.

References

 [R629] (1, 2) Lucas, Klaus. “Ein Einfaches Verfahren Zur Berechnung Der Viskositat von Gasen Und Gasgemischen.” Chemie Ingenieur Technik 46, no. 4 (February 1, 1974): 157-157. doi:10.1002/cite.330460413.
 [R630] (1, 2) Reid, Robert C.; Prausnitz, John M.; Poling, Bruce E. Properties of Gases and Liquids. McGraw-Hill Companies, 1987.

Examples

>>> Lucas(300., 500E5, 572.2, 34.7E5, 0.236, 0, 0.00068) # methylcyclohexane
0.0010683738499316518

thermo.viscosity.Yoon_Thodos(T, Tc, Pc, MW)[source]

Calculates the viscosity of a gas using an emperical formula developed in [R631].

\begin{align}\begin{aligned}\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}\end{aligned}\end{align}
Parameters: T : float Temperature of the fluid [K] Tc : float Critical temperature of the fluid [K] Pc : float Critical pressure of the fluid [Pa] MW : float Molwcular weight of fluid [g/mol] mu_g : float Viscosity of gas, [Pa*S]

Notes

This equation has been tested. The equation uses SI units only internally. The constant 2173.424 is an adjustment factor for units. Average deviation within 3% for most compounds. Greatest accuracy with dipole moments close to 0. Hydrogen and helium have different coefficients, not implemented. This is DIPPR Procedure 8B: Method for the Viscosity of Pure, non hydrocarbon, nonpolar gases at low pressures

References

 [R631] (1, 2) Yoon, Poong, and George Thodos. “Viscosity of Nonpolar Gaseous Mixtures at Normal Pressures.” AIChE Journal 16, no. 2 (1970): 300-304. doi:10.1002/aic.690160225.

Examples

>>> Yoon_Thodos(300., 556.35, 4.5596E6, 153.8)
1.0194885727776819e-05

thermo.viscosity.Stiel_Thodos(T, Tc, Pc, MW)[source]

Calculates the viscosity of a gas using an emperical formula developed in [R632].

$TODO$
Parameters: T : float Temperature of the fluid [K] Tc : float Critical temperature of the fluid [K] Pc : float Critical pressure of the fluid [Pa] MW : float Molwcular weight of fluid [g/mol] mu_g : float Viscosity of gas, [Pa*S]

Notes

Untested. Claimed applicability from 0.2 to 5 atm. Developed with data from 52 nonpolar, and 53 polar gases. internal units are poise and atm. Seems to give reasonable results.

References

 [R632] (1, 2) Stiel, Leonard I., and George Thodos. “The Viscosity of Nonpolar Gases at Normal Pressures.” AIChE Journal 7, no. 4 (1961): 611-15. doi:10.1002/aic.690070416.

Examples

>>> Stiel_Thodos(300., 556.35, 4.5596E6, 153.8) #CCl4
1.0408926223608723e-05

thermo.viscosity.lucas_gas(T, Tc, Pc, Zc, MW, dipole=0, CASRN=None)[source]

Estimate the viscosity of a gas using an emperical formula developed in several sources, but as discussed in [R633] as the original sources are in German or merely personal communications with the authors of [R633].

\begin{align}\begin{aligned}\eta = \left[0.807T_r^{0.618}-0.357\exp(-0.449T_r) + 0.340\exp(-4.058 T_r) + 0.018\right]F_p^\circ F_Q^\circ /\xi\\F_p^\circ=1, 0 \le \mu_{r} < 0.022\\F_p^\circ = 1+30.55(0.292-Z_c)^{1.72}, 0.022 \le \mu_{r} < 0.075\\F_p^\circ = 1+30.55(0.292-Z_c)^{1.72}|0.96+0.1(T_r-0.7)| 0.075 < \mu_{r}\\F_Q^\circ = 1.22Q^{0.15}\left\{ 1+0.00385[(T_r-12)^2]^{1/M}\text{sign} (T_r-12)\right\}\\\mu_r = 52.46 \frac{\mu^2 P_c}{T_c^2}\\\xi=0.176\left(\frac{T_c}{MW^3 P_c^4}\right)^{1/6}\end{aligned}\end{align}
Parameters: T : float Temperature of fluid [K] Tc: float Critical point of fluid [K] Pc : float Critical pressure of the fluid [Pa] Zc : float Critical compressibility of the fluid [Pa] dipole : float Dipole moment of fluid [debye] CASRN : str, optional CAS of the fluid mu_g : float Viscosity of gas, [Pa*s]

Notes

The example is from [R633]; all results agree. Viscosity is calculated in micropoise, and converted to SI internally (1E-7). Q for He = 1.38; Q for H2 = 0.76; Q for D2 = 0.52.

References

 [R633] (1, 2, 3, 4) Reid, Robert C.; Prausnitz, John M.; Poling, Bruce E. Properties of Gases and Liquids. McGraw-Hill Companies, 1987.

Examples

>>> lucas_gas(T=550., Tc=512.6, Pc=80.9E5, Zc=0.224, MW=32.042, dipole=1.7)
1.7822676912698928e-05

thermo.viscosity.Gharagheizi_gas_viscosity(T, Tc, Pc, MW)[source]

Calculates the viscosity of a gas using an emperical formula developed in [R634].

$\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}-\frac{4.1929}{T}\right)|$
Parameters: T : float Temperature of the fluid [K] Tc : float Critical temperature of the fluid [K] Pc : float Critical pressure of the fluid [Pa] MW : float Molwcular weight of fluid [g/mol] mu_g : float Viscosity of gas, [Pa*S]

Notes

Example is first point in supporting information of article, for methane. This is the prefered function for gas viscosity. 7% average relative deviation. Deviation should never be above 30%. Developed with the DIPPR database. It is believed theoretically predicted values are included in the correlation.

References

 [R634] (1, 2) Gharagheizi, Farhad, Ali Eslamimanesh, Mehdi Sattari, Amir H. Mohammadi, and Dominique Richon. “Corresponding States Method for Determination of the Viscosity of Gases at Atmospheric Pressure.” Industrial & Engineering Chemistry Research 51, no. 7 (February 22, 2012): 3179-85. doi:10.1021/ie202591f.

Examples

>>> Gharagheizi_gas_viscosity(120., 190.564, 45.99E5, 16.04246)
5.215761625399613e-06

thermo.viscosity.viscosity_gas_methods = ['COOLPROP', 'DIPPR_PERRY_8E', 'VDI_PPDS', 'VDI_TABULAR', 'GHARAGHEIZI', 'YOON_THODOS', 'STIEL_THODOS', 'LUCAS_GAS']

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

thermo.viscosity.viscosity_gas_methods_P = ['COOLPROP']

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

thermo.viscosity.Herning_Zipperer(zs, mus, MWs)[source]

Calculates viscosity of a gas mixture according to mixing rules in [R635].

$TODO$
Parameters: zs : float Mole fractions of components mus : float Gas viscosities of all components, [Pa*S] MWs : float Molecular weights of all components, [g/mol] mug : float Viscosity of gas mixture, Pa*S]

Notes

This equation is entirely dimensionless; all dimensions cancel. The original source has not been reviewed.

References

 [R635] (1, 2) Herning, F. and Zipperer, L,: “Calculation of the Viscosity of Technical Gas Mixtures from the Viscosity of Individual Gases, german”, Gas u. Wasserfach (1936) 79, No. 49, 69.
thermo.viscosity.Wilke(ys, mus, MWs)[source]

Calculates viscosity of a gas mixture according to mixing rules in [R636].

\begin{align}\begin{aligned}\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)}}\end{aligned}\end{align}
Parameters: ys : float Mole fractions of gas components mus : float Gas viscosities of all components, [Pa*S] MWs : float Molecular weights of all components, [g/mol] mug : float Viscosity of gas mixture, Pa*S]

Notes

This equation is entirely dimensionless; all dimensions cancel. The original source has not been reviewed or found.

References

 [R636] (1, 2) TODO

Examples

>>> Wilke([0.05, 0.95], [1.34E-5, 9.5029E-6], [64.06, 46.07])
9.701614885866193e-06

thermo.viscosity.Brokaw(T, ys, mus, MWs, molecular_diameters, Stockmayers)[source]

Calculates viscosity of a gas mixture according to mixing rules in [R637].

\begin{align}\begin{aligned}\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}\\A_{ij} = m_{ij} M_{ij}^{-0.5} \left[1 + \frac{M_{ij} - M_{ij}^{0.45}} {2(1+M_{ij}) + \frac{(1 + M_{ij}^{0.45}) m_{ij}^{-0.5}}{1 + m_{ij}}} \right]\\m_{ij} = \left[ \frac{4}{(1+M_{ij}^{-1})(1+M_{ij})}\right]^{0.25}\\M_{ij} = \frac{M_i}{M_j}\\S_{ij} = \frac{1 + (T_i^* T_j^*)^{0.5} + (\delta_i \delta_j/4)} {[1+T_i^* + (\delta_i^2/4)]^{0.5}[1+T_j^*+(\delta_j^2/4)]^{0.5}}\\T^* = kT/\epsilon\end{aligned}\end{align}
Parameters: T : float Temperature of fluid, [K] ys : float Mole fractions of gas components mus : float Gas viscosities of all components, [Pa*S] MWs : float Molecular weights of all components, [g/mol] molecular_diameters : float L-J molecular diameter of all components, [angstroms] Stockmayers : float L-J Stockmayer energy parameters of all components, [] mug : float Viscosity of gas mixture, [Pa*S]

Notes

This equation is entirely dimensionless; all dimensions cancel. The original source has not been reviewed.

This is DIPPR Procedure 8D: Method for the Viscosity of Nonhydrocarbon Vapor Mixtures at Low Pressure (Polar and Nonpolar)

References

 [R637] (1, 2) Brokaw, R. S. “Predicting Transport Properties of Dilute Gases.” Industrial & Engineering Chemistry Process Design and Development 8, no. 2 (April 1, 1969): 240-53. doi:10.1021/i260030a015.
 [R638] Brokaw, R. S. Viscosity of Gas Mixtures, NASA-TN-D-4496, 1968.
 [R639] Danner, Ronald P, and Design Institute for Physical Property Data. Manual for Predicting Chemical Process Design Data. New York, N.Y, 1982.

Examples

>>> Brokaw(308.2, [0.05, 0.95], [1.34E-5, 9.5029E-6], [64.06, 46.07], [0.42, 0.19], [347, 432])
9.699085099801568e-06

thermo.viscosity.viscosity_index(nu_40, nu_100, rounding=False)[source]

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:

$L, H = interp(nu_100)$

else:

\begin{align}\begin{aligned}L = 0.8353\nu_{100}^2 + 14.67\nu_{100} - 216\\H = 0.1684\nu_{100}^2 + 11.85\nu_{100} - 97\end{aligned}\end{align}

if nu_40 > H:

$VI = \frac{L-nu_{40}}{L-H}\cdot 100$

else:

\begin{align}\begin{aligned}N = \frac{\log(H) - \log(\nu_{40})}{\log (\nu_{100})}\\ VI = \frac{10^N-1}{0.00715} + 100\end{aligned}\end{align}
Parameters: nu_40 : float Dynamic viscosity of fluid at 40°C, [m^2/s] nu_100 : float Dynamic viscosity of fluid at 100°C, [m^2/s] rounding : bool, optional Whether to round the value or not. VI: float Viscosity index [-]

Notes

VI is undefined for nu_100 under 2 mm^2/s. None is returned if this is the case. Internal units are mm^2/s. Higher values of viscosity index suggest a lesser decrease in kinematic viscosity as temperature increases.

Note that viscosity is a pressure-dependent property, and that the viscosity index is defined for a fluid at whatever pressure it is at. The viscosity index is thus also a function of pressure.

References

 [R640] ASTM D2270-10(2016) Standard Practice for Calculating Viscosity Index from Kinematic Viscosity at 40 °C and 100 °C, ASTM International, West Conshohocken, PA, 2016, http://dx.doi.org/10.1520/D2270-10R16

Examples

>>> viscosity_index(73.3E-6, 8.86E-6, rounding=True)
92

class thermo.viscosity.ViscosityLiquidMixture(CASs=[], ViscosityLiquids=[])[source]

Class for dealing with the viscosity of a liquid mixture as a function of temperature, pressure, and composition. Consists of one electrolyte-specific method, and logarithmic rules based on either mole fractions of mass fractions.

Prefered method is mixing_logarithmic with mole fractions, or Laliberte if the mixture is aqueous and has electrolytes.

Parameters: CASs : list[str], optional The CAS numbers of all species in the mixture ViscosityLiquids : list[ViscosityLiquid], optional ViscosityLiquid 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 viscosity_liquid_mixture_methods.

LALIBERTE_MU:
Electrolyte model equation with coefficients; see thermo.electrochem.Laliberte_viscosity for more details.
MIXING_LOG_MOLAR:
Logarithmic mole fraction mixing rule described in thermo.utils.mixing_logarithmic.
MIXING_LOG_MASS:
Logarithmic mole fraction mixing rule described in thermo.utils.mixing_logarithmic.

References

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

Attributes

 TP_zs_ws_cached method prop_cached

Methods

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

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

Tmin = None

Minimum temperature at which no method can calculate the liquid viscosity 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 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.

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 mu : float Viscosity of the liquid mixture, [Pa*s]
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 viscosity'
property_max = 200000000.0

Maximum valid value of liquid viscosity. Generous limit, as the value is that of bitumen in a Pitch drop experiment.

property_min = 0

Mimimum valid value of liquid viscosity.

ranked_methods = ['Laliberte', 'Logarithmic mixing, molar', 'Logarithmic mixing, mass']
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. If Laliberte is applicable, all other methods are returned as inapplicable. Otherwise, there are no 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 = 'Pa*s'
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.viscosity.ViscosityGasMixture(MWs=[], molecular_diameters=[], Stockmayers=[], CASs=[], ViscosityGases=[])[source]

Class for dealing with the viscosity of a gas mixture as a function of temperature, pressure, and composition. Consists of three gas viscosity specific mixing rules and a mole-weighted simple mixing rule.

Prefered method is Brokaw.

Parameters: MWs : list[float], optional Molecular weights of all species in the mixture, [g/mol] molecular_diameters : list[float], optional Lennard-Jones molecular diameters, [Angstrom] Stockmayers : list[float], optional Lennard-Jones depth of potential-energy minimum over k or epsilon_k, [K] CASs : list[str], optional The CAS numbers of all species in the mixture ViscosityGass : list[ViscosityGas], optional ViscosityGas 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 viscosity_liquid_mixture_methods.

Brokaw:
Mixing rule described in Brokaw.
Herning-Zipperer:
Mixing rule described in Herning_Zipperer.
Wilke:
Mixing rule described in Wilke.
SIMPLE:
Mixing rule described in thermo.utils.mixing_simple.

References

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

Attributes

 TP_zs_ws_cached method prop_cached

Methods

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

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

Tmin = None

Minimum temperature at which no method can calculate the gas viscosity 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 viscosity 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 mu : float Viscosity of gas mixture, [Pa*s]
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 viscosity'
property_max = 0.001

Maximum valid value of gas viscosity. Might be too high, or too low.

property_min = 0

Mimimum valid value of gas viscosity; limiting condition at low pressure is 0.

ranked_methods = ['Brokaw', 'Herning-Zipperer', 'Simple', 'Wilke']
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 = 'Pa*s'
user_methods = None

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