chempy.properties package

This package implements various parameterisations of properties from the litterature with relevance in chemistry.

Submodules

chempy.properties.debye_huckel_radii module

chempy.properties.debye_huckel_radii.get_radii(key, units=None)[source]

Get Debye-Hückel radii for various ions

For aqueous systems

Parameters
key: str

e.g. ‘Fe+3’, ‘SCN-‘

units: object (optional)

nm is accessed.

Returns
radius in nanometers

chempy.properties.gas_sol_electrolytes_schumpe_1993 module

This module implements an expression for estimating how gas solubility in water is affected by dissolved non-reactive salts, the expression and parameters are from Schumpe (1993).

chempy.properties.gas_sol_electrolytes_schumpe_1993.lg_solubility_ratio(electrolytes, gas, units=None, warn=True)[source]

Returns the log10 value of the solubilty ratio

Implements equation 16, p 156. from Schumpe (1993)

Parameters
electrolytesdict

Mapping substance key (one in p_ion_rM) to concentration.

gasstr

Substance key for the gas (one in p_gas_rM).

unitsobject (optional)

object with attribute: molar

warnbool (default: True)

Emit UserWarning when ‘F-‘ among electrolytes.

chempy.properties.sulfuric_acid_density_myhre_1998 module

This module implements the denisty parameterisation of aqueous sulfuric acid of Myhre et al. from 1998.

chempy.properties.sulfuric_acid_density_myhre_1998.density_from_concentration(conc, T=None, molar_mass=None, rho_cb=<function sulfuric_acid_density at 0x7f8f50731158>, units=None, atol=None, maxiter=10, warn=False, **kwargs)[source]

Calculates the density of a solution from its concentration

Given a function which calculates the density of a solution from the mass fraction of the solute, this function calculates (iteratively) the density of said solution for a given concentration.

Parameters
concfloat (optionally with units)

Concentration (mol / m³).

Tfloat (optionally with units)

Passed to rho_cb.

molar_massfloat (optionally with units)

Molar mass of solute.

rho_cbcallback

Callback with signature f(w, T, units=None) -> rho (default: sulfuric_acid_density()).

unitsobject (optional)

Object with attributes: meter, kilogram, mol.

atolfloat (optionally with units)

Convergence criterion for fixed-point iteration (default: 1e-3 kg/m³).

maxiterint

Maximum number of iterations (when exceeded a NoConvergence excpetion is raised).

**kwargs:

Keyword arguments passed onto rho_cb.

Returns
Density of sulfuric acid (float of kg/m³ if T is float and units is None)
Raises
chempy.util.NoConvergence:

When maxiter is exceeded

Examples

>>> print('%d' % density_from_concentration(400, 293))
1021
chempy.properties.sulfuric_acid_density_myhre_1998.sulfuric_acid_density(w, T=None, T0=None, units=None, warn=True)[source]

Density of sulfuric acid (kg/m³) as function of temperature (K) and mass fraction acid (w).

Parameters
w: float

Acid mass fraction (0.1 <= w <= 0.9)

T: float

Temperature (in Kelvin) (273 <= T <= 323) (default: 298.15)

T0: float

Value of T for 0 degree Celsius (default: 273.15)

units: object (optional)

object with attributes: kelvin, meter, kilogram

warn: bool (default: True)

Emit UserWarning when outside T or w range.

Returns
Density of sulfuric acid (float of kg/m³ if T is float and units is None)

References

Cathrine E. L. Myhre , Claus J. Nielsen ,* and Ole W. Saastad

“Density and Surface Tension of Aqueous H2SO4 at Low Temperature” J. Chem. Eng. Data, 1998, 43 (4), pp 617–622 http://pubs.acs.org/doi/abs/10.1021/je980013g DOI: 10.1021/je980013g

Examples

>>> print('%d' % sulfuric_acid_density(.5, 293))
1396

chempy.properties.water_density_tanaka_2001 module

chempy.properties.water_density_tanaka_2001.water_density(T=None, T0=None, units=None, a=None, just_return_a=False, warn=True)[source]

Density of water (kg/m3) as function of temperature (K) according to VSMOW model between 0 and 40 degree Celsius. Fitted using Thiesen’s equation.

Parameters
Tfloat

Temperature (in Kelvin) (default: 298.15).

T0float

Value of T for 0 degree Celsius (default: 273.15).

unitsobject (optional)

Object with attributes: Kelvin, meter, kilogram.

aarray_like (optional)

5 parameters to the equation.

just_return_abool (optional, default: False)

Do not compute rho, just return the parameters a.

warnbool (default: True)

Emit UserWarning when outside temperature range.

Returns
Density of water (float of kg/m3 if T is float and units is None)

References

TANAKA M., GIRARD G., DAVIS R., PEUTO A. and BIGNELL N.,

“Recommanded table for the density of water between 0 °C and 40 °C based on recent experimental reports”, Metrologia, 2001, 38, 301-309. http://iopscience.iop.org/article/10.1088/0026-1394/38/4/3 doi:10.1088/0026-1394/38/4/3

Examples

>>> print('%.2f' % water_density(277.13))
999.97

chempy.properties.water_diffusivity_holz_2000 module

chempy.properties.water_diffusivity_holz_2000.water_self_diffusion_coefficient(T=None, units=None, warn=True, err_mult=None)[source]

Temperature-dependent self-diffusion coefficient of water.

Parameters
Tfloat

Temperature (default: in Kelvin)

unitsobject (optional)

object with attributes: Kelvin, meter, kilogram

warnbool (default: True)

Emit UserWarning when outside temperature range.

err_multlength 2 array_like (default: None)

Perturb paramaters D0 and TS with err_mult[0]*dD0 and err_mult[1]*dTS respectively, where dD0 and dTS are the reported uncertainties in the fitted paramters. Useful for estimating error in diffusion coefficient.

References

Temperature-dependent self-diffusion coefficients of water and six selected

molecular liquids for calibration in accurate 1H NMR PFG measurements Manfred Holz, Stefan R. Heila, Antonio Saccob; Phys. Chem. Chem. Phys., 2000,2, 4740-4742 http://pubs.rsc.org/en/Content/ArticleLanding/2000/CP/b005319h DOI: 10.1039/B005319H

chempy.properties.water_permittivity_bradley_pitzer_1979 module

chempy.properties.water_permittivity_bradley_pitzer_1979.water_permittivity(T=None, P=None, units=None, U=None, just_return_U=False, warn=True, backend=None)[source]

Relative permittivity of water as function of temperature (K) and pressure (bar).

Parameters
Tfloat

Temperature (default: 298.15 Kelvin)

Pfloat

Pressure (default: 1 bar)

unitsobject (optional)

object with attributes: Kelvin, bar

Uarray_like (optional)

9 parameters to the equation.

just_return_Ubool (optional, default: False)

Do not compute relative permittivity, just return the parameters U.

warnbool (default: True)

Emit UserWarning when outside temperature/pressure range.

backendmodule (default: None)

modules which contains “exp”, default: numpy, math

Returns
Relative permittivity of water (dielectric constant)

References

Bradley, D.J.; Pitzer, K.S. `Thermodynamics of electrolytes. 12. Dielectric

properties of water and Debye–Hueckel parameters to 350/sup 0/C and 1 kbar`, J. Phys. Chem.; Journal Volume 83 (12) (1979), pp. 1599-1603, http://pubs.acs.org/doi/abs/10.1021/j100475a009 DOI: 10.1021/j100475a009

chempy.properties.water_viscosity_korson_1969 module

chempy.properties.water_viscosity_korson_1969.water_viscosity(T=None, eta20=None, units=None, warn=True)[source]

Viscosity of water (cP) as function of temperature (K)

Parameters
Tfloat

Temperature (in Kelvin) (default: 298.15 K)

eta20float

Viscosity of water at 20 degree Celsius.

unitsobject (optional)

object with attributes: kelvin & centipoise

warnbool

Emit UserWarning when outside temperature range.

Returns
Water viscosity at temperature T.