Viscosity (thermo.viscosity)¶
This module contains implementations of TPDependentProperty
representing liquid and vapor viscosity. A variety of estimation
and data methods are available as included in the chemicals library.
Additionally liquid and vapor mixture viscosity predictor objects
are implemented subclassing MixtureProperty.
For reporting bugs, adding feature requests, or submitting pull requests, please use the GitHub issue tracker.
Pure Liquid Viscosity¶
- class thermo.viscosity.ViscosityLiquid(CASRN='', MW=None, Tm=None, Tc=None, Pc=None, Vc=None, omega=None, Psat=None, Vml=None, extrapolation='Arrhenius', extrapolation_min=1e-05, **kwargs)[source]¶
Bases:
TPDependentPropertyClass 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, one group contribution method, 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
floatorcallable,optional Vapor pressure at a given temperature or callable for the same, [Pa]
- Vml
floatorcallable,optional Liquid molar volume at a given temperature and pressure or callable for the same, [m^3/mol]
- load_databool,
optional If False, do not load property coefficients from data sources in files [-]
- extrapolation
strorNone None to not extrapolate; see
TDependentPropertyfor a full list of all options, [-]- method
strorNone,optional If specified, use this method by default and do not use the ranked sorting; an exception is raised if this is not a valid method for the provided inputs, [-]
- CASRN
- Attributes:
Methods
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.
test_method_validity(T, method)Method to test the validity of a specified method for a given temperature.
test_method_validity_P(T, P, method)Method to check the validity of a high-pressure method.
See also
Notes
To iterate over all methods, use the lists stored in
viscosity_liquid_methodsandviscosity_liquid_methods_Pfor low and high pressure methods respectively.Low pressure methods:
- DUTT_PRASAD:
A simple function as expressed in [1], with data available for 100 fluids. Temperature limits are available for all fluids. See
chemicals.viscosity.Viswanath_Natarajan_3for details.- VISWANATH_NATARAJAN_3:
A simple function as expressed in [1], with data available for 432 fluids. Temperature limits are available for all fluids. See
chemicals.viscosity.Viswanath_Natarajan_3for details.- VISWANATH_NATARAJAN_2:
A simple function as expressed in [1], with data available for 135 fluids. Temperature limits are available for all fluids. See
chemicals.viscosity.Viswanath_Natarajan_2for details.- VISWANATH_NATARAJAN_2E:
A simple function as expressed in [1], with data available for 14 fluids. Temperature limits are available for all fluids. See
chemicals.viscosity.Viswanath_Natarajan_2_exponentialfor details.- DIPPR_PERRY_8E:
A collection of 337 coefficient sets from the DIPPR database published openly in [4]. Provides temperature limits for all its fluids.
EQ101is used for its fluids.- LETSOU_STIEL:
CSP method, described in
chemicals.viscosity.Letsou_Stiel.- PRZEDZIECKI_SRIDHAR:
CSP method, described in
chemicals.viscosity.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 [2]. Very slow.
- VDI_TABULAR:
Tabular data in [3] 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 [3]. 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.
- JOBACK:
An estimation method for organic substances in [5]; this also requires molecular weight as an input.
- REFPROP_FIT:
A series of higher-order polynomial fits to the calculated results from the equations implemented in REFPROP.
High pressure methods:
- LUCAS:
CSP method, described in
chemicals.viscosity.Lucas. Calculates a low-pressure liquid viscosity as its input.- 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 [2]. Very slow, but unparalled in accuracy for pressure dependence.
A minimum viscosity value of 1e-5 Pa*s is set according to [4]. This is also just above the lowest experimental values of viscosity of helium, 9.4e-6 Pa*s. This excludes the behavior of superfluids, and also systems where the mean free path between moleules approaches the geometry of the system and then the viscosity is geometry-dependent.
References
[1] (1,2,3,4)Viswanath, Dabir S., and G. Natarajan. Databook On The Viscosity Of Liquids. New York: Taylor & Francis, 1989
[2] (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/
[3] (1,2)Gesellschaft, V. D. I., ed. VDI Heat Atlas. 2nd edition. Berlin; New York:: Springer, 2010.
[4] (1,2)Green, Don, and Robert Perry. Perry’s Chemical Engineers’ Handbook, Eighth Edition. McGraw-Hill Professional, 2007.
[5]Joback, K.G., and R.C. Reid. “Estimation of Pure-Component Properties from Group-Contributions.” Chemical Engineering Communications 57, no. 1-6 (July 1, 1987): 233-43. doi:10.1080/00986448708960487.
[6]Trachenko, K., and V. V. Brazhkin. “Minimal Quantum Viscosity from Fundamental Physical Constants.” Science Advances, April 2020. https://doi.org/10.1126/sciadv.aba3747.
- property Tmax¶
Maximum temperature (K) at which the current method can calculate the property.
- property Tmin¶
Minimum temperature (K) at which the current method can calculate the property.
- 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_propertyfor that.
- 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_propertyfor that.
- 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.0¶
Mimimum valid value of liquid viscosity.
- ranked_methods = ['REFPROP_FIT', 'COOLPROP', 'DIPPR_PERRY_8E', 'VDI_PPDS', 'DUTT_PRASAD', 'VISWANATH_NATARAJAN_3', 'VISWANATH_NATARAJAN_2', 'VISWANATH_NATARAJAN_2E', 'VDI_TABULAR', 'LETSOU_STIEL', 'JOBACK', 'PRZEDZIECKI_SRIDHAR']¶
Default rankings of the low-pressure methods.
- ranked_methods_P = ['COOLPROP', 'LUCAS', 'NEGLECT_P']¶
Default rankings of the high-pressure methods.
- test_method_validity(T, method)¶
Method to test the validity of a specified method for a given temperature. Demo function for testing only; must be implemented according to the methods available for each individual method. Include the interpolation check here.
- 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_permittedis set; if it is, the extrapolation is considered valid for all temperatures and pressures.
- units = 'Pa*s'¶
- thermo.viscosity.viscosity_liquid_methods = ['REFPROP_FIT', 'COOLPROP', 'DIPPR_PERRY_8E', 'VDI_PPDS', 'DUTT_PRASAD', 'VISWANATH_NATARAJAN_3', 'VISWANATH_NATARAJAN_2', 'VISWANATH_NATARAJAN_2E', 'VDI_TABULAR', 'LETSOU_STIEL', 'JOBACK', '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', 'NEGLECT_P']¶
Holds all high-pressure methods available for the ViscosityLiquid class, for use in iterating over them.
Pure Gas Viscosity¶
- class thermo.viscosity.ViscosityGas(CASRN='', MW=None, Tc=None, Pc=None, Zc=None, dipole=None, Vmg=None, extrapolation='linear', extrapolation_min=1e-05, **kwargs)[source]¶
Bases:
TPDependentPropertyClass 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]
- load_databool,
optional If False, do not load property coefficients from data sources in files [-]
- extrapolation
strorNone None to not extrapolate; see
TDependentPropertyfor a full list of all options, [-]- method
strorNone,optional If specified, use this method by default and do not use the ranked sorting; an exception is raised if this is not a valid method for the provided inputs, [-]
- CASRN
- Attributes:
Methods
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.
test_method_validity(T, method)Method to test the validity of a specified method for a given temperature.
test_method_validity_P(T, P, method)Method to check the validity of a high-pressure method.
See also
chemicals.viscosity.Gharagheizi_gas_viscositychemicals.viscosity.Yoon_Thodoschemicals.viscosity.Stiel_Thodoschemicals.viscosity.Lucas_gas
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_methodsandviscosity_gas_methods_Pfor low and high pressure methods respectively.Low pressure methods:
- GHARAGHEIZI:
CSP method, described in
chemicals.viscosity.Gharagheizi_gas_viscosity.- YOON_THODOS:
CSP method, described in
chemicals.viscosity.Yoon_Thodos.- STIEL_THODOS:
CSP method, described in
chemicals.viscosity.Stiel_Thodos.- LUCAS_GAS:
CSP method, described in
chemicals.viscosity.Lucas_gas.- DIPPR_PERRY_8E:
A collection of 345 coefficient sets from the DIPPR database published openly in [3]. Provides temperature limits for all its fluids.
chemicals.dippr.EQ102is used for its fluids.- VDI_PPDS:
Coefficients for a equation form developed by the PPDS, published openly in [2]. 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 [1]. Very slow.
- VDI_TABULAR:
Tabular data in [2] along the saturation curve; interpolation is as set by the user or the default.
- REFPROP_FIT:
A series of higher-order polynomial fits to the calculated results from the equations implemented in REFPROP.
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 [1]. Very slow, but unparalled in accuracy for pressure dependence.
A minimum viscosity value of 1e-5 Pa*s is set according to [4]. This is also just above the lowest experimental values of viscosity of helium, 9.4e-6 Pa*s.
References
[1] (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/
[2] (1,2)Gesellschaft, V. D. I., ed. VDI Heat Atlas. 2nd edition. Berlin; New York:: Springer, 2010.
[3]Green, Don, and Robert Perry. Perry’s Chemical Engineers’ Handbook, Eighth Edition. McGraw-Hill Professional, 2007.
[4]Trachenko, K., and V. V. Brazhkin. “Minimal Quantum Viscosity from Fundamental Physical Constants.” Science Advances, April 2020. https://doi.org/10.1126/sciadv.aba3747.
- property Tmax¶
Maximum temperature (K) at which the current method can calculate the property.
- property Tmin¶
Minimum temperature (K) at which the current method can calculate the property.
- 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_propertyfor that.
- 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_propertyfor that.
- name = 'Gas viscosity'¶
- property_max = 0.001¶
Maximum valid value of gas viscosity. Might be too high, or too low.
- property_min = 0.0¶
Mimimum valid value of gas viscosity; limiting condition at low pressure is 0.
- ranked_methods = ['REFPROP_FIT', '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 = ['NEGLECT_P', 'COOLPROP']¶
Default rankings of the high-pressure methods.
- test_method_validity(T, method)¶
Method to test the validity of a specified method for a given temperature. Demo function for testing only; must be implemented according to the methods available for each individual method. Include the interpolation check here.
- 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_permittedis 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.
- units = 'Pa*s'¶
- thermo.viscosity.viscosity_gas_methods = ['REFPROP_FIT', '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 = ['NEGLECT_P', 'COOLPROP']¶
Holds all high-pressure methods available for the ViscosityGas class, for use in iterating over them.
Mixture Liquid Viscosity¶
- class thermo.viscosity.ViscosityLiquidMixture(CASs=[], ViscosityLiquids=[], MWs=[], load_data=True, **kwargs)[source]¶
Bases:
MixturePropertyClass 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_logarithmicwith 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, [-]
- MWs
list[float],optional Molecular weights of all species in the mixture, [g/mol]
- correct_pressure_purebool,
optional Whether to try to use the better pressure-corrected pure component models or to use only the T-only dependent pure species models, [-]
- load_databool,
optional If False, do not load property coefficients from data sources in files [-]
- CASs
Methods
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.
test_method_validity(T, P, zs, ws, method)Method to test the validity of a specified method for the given conditions.
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_viscosityfor more details.- MIXING_LOG_MOLAR:
Logarithmic mole fraction mixing rule described in
chemicals.utils.mixing_logarithmic.- MIXING_LOG_MASS:
Logarithmic mole fraction mixing rule described in
chemicals.utils.mixing_logarithmic.- LINEAR:
Linear mole fraction mixing rule described in
mixing_simple.
References
[1]Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
- Tmax¶
Maximum temperature at which no method can calculate the property above.
- Tmin¶
Minimum temperature at which no method can calculate the property under.
- 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_propertyfor that.- Parameters:
- Returns:
- mu
float Viscosity of the liquid mixture, [Pa*s]
- mu
- 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', 'LINEAR']¶
- 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:
- Returns:
- validitybool
Whether or not a specifid method is valid
- units = 'Pa*s'¶
- thermo.viscosity.viscosity_liquid_mixture_methods = ['Laliberte', 'Logarithmic mixing, molar', 'Logarithmic mixing, mass', 'LINEAR']¶
Holds all mixing rules available for the
ViscosityLiquidMixtureclass, for use in iterating over them.
Mixture Gas Viscosity¶
- class thermo.viscosity.ViscosityGasMixture(MWs=[], molecular_diameters=[], Stockmayers=[], CASs=[], ViscosityGases=[], **kwargs)[source]¶
Bases:
MixturePropertyClass 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, [-]
- ViscosityGases
list[ViscosityGas],optional ViscosityGas objects created for all species in the mixture, [-]
- correct_pressure_purebool,
optional Whether to try to use the better pressure-corrected pure component models or to use only the T-only dependent pure species models, [-]
- MWs
Methods
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.
test_method_validity(T, P, zs, ws, method)Method to test the validity of a specified method for the given conditions.
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.- LINEAR:
Mixing rule described in
mixing_simple.
References
[1]Poling, Bruce E. The Properties of Gases and Liquids. 5th edition. New York: McGraw-Hill Professional, 2000.
- Tmax¶
Maximum temperature at which no method can calculate the property above.
- Tmin¶
Minimum temperature at which no method can calculate the property under.
- 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_propertyfor that.- Parameters:
- Returns:
- mu
float Viscosity of gas mixture, [Pa*s]
- mu
- 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', 'LINEAR', 'WILKE']¶
- test_method_validity(T, P, zs, ws, method)[source]¶
Method to test the validity of a specified method for the given conditions.
- Parameters:
- Returns:
- validitybool
Whether or not a specifid method is valid
- units = 'Pa*s'¶
- thermo.viscosity.viscosity_gas_mixture_methods = ['BROKAW', 'HERNING_ZIPPERER', 'WILKE', 'LINEAR']¶
Holds all mixing rules available for the
ViscosityGasMixtureclass, for use in iterating over them.