Electrochemistry (thermo.electrochem)¶
This module contains models for:
Pure substance electrical conductivity lookups
Correlations for aqueous electrolyte heat capacity, density, and viscosity
Aqueous electrolyte conductivity
Water equilibrium constants
Balancing experimental ion analysis results so as to meet the electroneutrality condition
For reporting bugs, adding feature requests, or submitting pull requests, please use the GitHub issue tracker.
Aqueous Electrolyte Density¶
- thermo.electrochem.Laliberte_density(T, ws, CASRNs)[source]¶
Calculate the density of an aqueous electrolyte mixture using the form proposed by [1]. Parameters are loaded by the function as needed. Units are Kelvin and Pa*s.
$\rho_m = \left(\frac{w_w}{\rho_w} + \sum_i \frac{w_i}{\rho_{app_i}}\right)^{-1}$- Parameters
- Returns
- rho
float
Solution density, [kg/m^3]
- rho
Notes
Temperature range check is not used here.
References
- 1
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> Laliberte_density(273.15, [0.0037838838], ['7647-14-5']) 1002.62501201
- thermo.electrochem.Laliberte_density_mix(T, ws, c0s, c1s, c2s, c3s, c4s)[source]¶
Calculate the density of an aqueous electrolyte mixture using the form proposed by [1]. All parameters must be provided to the function. Units are Kelvin and Pa*s.
$\rho_m = \left(\frac{w_w}{\rho_w} + \sum_i \frac{w_i}{\rho_{app_i}}\right)^{-1}$- Parameters
- Returns
- rho
float
Solution density, [kg/m^3]
- rho
References
- 1
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> Laliberte_density_mix(T=278.15, ws=[0.00581, 0.002], c0s=[-0.00324112223655149, 0.967814929691928], c1s=[0.0636354335906616, 5.540434135986], c2s=[1.01371399467365, 1.10374669742622], c3s=[0.0145951015210159, 0.0123340782160061], c4s=[3317.34854426537, 2589.61875022366]) 1005.6947727219
- thermo.electrochem.Laliberte_density_i(T, w_w, c0, c1, c2, c3, c4)[source]¶
Calculate the density of a solute using the form proposed by Laliberte [1]. Parameters are needed, and a temperature, and water fraction. Units are Kelvin and Pa*s.
$\rho_{app,i} = \frac{(c_0[1-w_w]+c_1)\exp(10^{-6}[t+c_4]^2)} {(1-w_w) + c_2 + c_3 t}$- Parameters
- Returns
- rho_i
float
Solute partial density, [kg/m^3]
- rho_i
Notes
Temperature range check is not used here.
References
- 1
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> params = [-0.00324112223655149, 0.0636354335906616, 1.01371399467365, 0.0145951015210159, 3317.34854426537] >>> Laliberte_density_i(273.15+0, 1-0.0037838838, *params) 3761.8917585
- thermo.electrochem.Laliberte_density_w(T)[source]¶
Calculate the density of water using the form proposed by [1]. No parameters are needed, just a temperature. Units are Kelvin and kg/m^3.
$\rho_w = \frac{\left\{\left([(-2.8054253\times 10^{-10}\cdot t + 1.0556302\times 10^{-7})t - 4.6170461\times 10^{-5}]t -0.0079870401\right)t + 16.945176 \right\}t + 999.83952} {1 + 0.01687985\cdot t}$Notes
Original source not cited No temperature range is used.
References
- 1
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> Laliberte_density_w(298.15) 997.0448954179155 >>> Laliberte_density_w(273.15 + 50) 988.0362916114763
Aqueous Electrolyte Heat Capacity¶
- thermo.electrochem.Laliberte_heat_capacity(T, ws, CASRNs)[source]¶
Calculate the heat capacity of an aqueous electrolyte mixture using the form proposed by [1]. Parameters are loaded by the function as needed.
$Cp_m = w_w Cp_w + \sum w_i Cp_i$- Parameters
- Returns
- Cp
float
Solution heat capacity, [J/kg/K]
- Cp
Notes
A temperature range check is not included in this function. Units are Kelvin and J/kg/K.
References
- 1
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> Laliberte_heat_capacity(273.15+1.5, [0.00398447], ['7647-14-5']) 4186.575407596064
- thermo.electrochem.Laliberte_heat_capacity_mix(T, ws, a1s, a2s, a3s, a4s, a5s, a6s)[source]¶
Calculate the heat capacity of an aqueous electrolyte mixture using the form proposed by [1]. All parameters must be provided to this function.
$Cp_m = w_w Cp_w + \sum w_i Cp_i$- Parameters
- Returns
- Cp
float
Solution heat capacity, [J/kg/K]
- Cp
Notes
A temperature range check is not included in this function. Units are Kelvin and J/kg/K.
References
- 1
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> Laliberte_heat_capacity_mix(T=278.15, ws=[0.00581, 0.002], a1s=[-0.0693559668993322, -0.103713247177424], a2s=[-0.0782134167486952, -0.0647453826944371], a3s=[3.84798479408635, 2.92191453087969], a4s=[-11.2762109247072, -5.48799065938436], a5s=[8.73187698542672, 2.41768600041476], a6s=[1.81245930472755, 1.32062411084408]) 4154.788562680796
- thermo.electrochem.Laliberte_heat_capacity_i(T, w_w, a1, a2, a3, a4, a5, a6)[source]¶
Calculate the heat capacity of a solute using the form proposed by [1] Parameters are needed, and a temperature, and water fraction.
$Cp_i = a_1 e^\alpha + a_5(1-w_w)^{a_6}$$\alpha = a_2 t + a_3 \exp(0.01t) + a_4(1-w_w)$- Parameters
- Returns
- Cp_i
float
Solute partial heat capacity, [J/kg/K]
- Cp_i
Notes
Units are Kelvin and J/kg/K. Temperature range check is not used here.
References
- 1
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> params = [-0.0693559668993322, -0.0782134167486952, 3.84798479408635, -11.2762109247072, 8.73187698542672, 1.81245930472755] >>> Laliberte_heat_capacity_i(1.5+273.15, 1-0.00398447, *params) -2930.73539458
- thermo.electrochem.Laliberte_heat_capacity_w(T)[source]¶
Calculate the heat capacity of pure water in a fast but similar way as in [1]. [1] suggested the following interpolatative scheme, using points calculated from IAPWS-97 at a pressure of 0.1 MPa up to 95 °C and then at saturation pressure. The maximum temperature of [1] is 140 °C.
$Cp_w = Cp_1 + (Cp_2-Cp_1) \left( \frac{t-t_1}{t_2-t_1}\right) + \frac{(Cp_3 - 2Cp_2 + Cp_1)}{2}\left( \frac{t-t_1}{t_2-t_1}\right) \left( \frac{t-t_1}{t_2-t_1}-1\right)$In this implementation, the heat capacity of water is calculated from a chebyshev approximation of the scheme of [1] up to ~92 °C and then the heat capacity comes directly from IAPWS-95 at higher temperatures, also at the saturation pressure. There is no discontinuity between the methods.
Notes
Units are Kelvin and J/kg/K.
References
- 1(1,2,3,4)
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> Laliberte_heat_capacity_w(273.15+3.56) 4208.878727051538
Aqueous Electrolyte Viscosity¶
- thermo.electrochem.Laliberte_viscosity(T, ws, CASRNs)[source]¶
Calculate the viscosity of an aqueous mixture using the form proposed by [1]. Parameters are loaded by the function as needed. Units are Kelvin and Pa*s.
$\mu_m = \mu_w^{w_w} \Pi\mu_i^{w_i}$- Parameters
- Returns
- mu
float
Viscosity of aqueous mixture, [Pa*s]
- mu
Notes
Temperature range check is not used here. Check is performed using NaCl at 5 degC from the first value in [1]’s spreadsheet.
References
- 1(1,2)
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> Laliberte_viscosity(273.15+5, [0.005810], ['7647-14-5']) 0.0015285828581961414
- thermo.electrochem.Laliberte_viscosity_mix(T, ws, v1s, v2s, v3s, v4s, v5s, v6s)[source]¶
Calculate the viscosity of an aqueous mixture using the form proposed by [1]. All parameters must be provided in this implementation.
$\mu_m = \mu_w^{w_w} \Pi\mu_i^{w_i}$- Parameters
- T
float
Temperature of fluid, [K]
- ws
array
Weight fractions of fluid components other than water, [-]
- v1s
list
[float
] Fit parameter, [-]
- v2s
list
[float
] Fit parameter, [-]
- v3s
list
[float
] Fit parameter, [-]
- v4s
list
[float
] Fit parameter, [1/degC]
- v5s
list
[float
] Fit parameter, [-]
- v6s
list
[float
] Fit parameter, [-]
- T
- Returns
- mu
float
Viscosity of aqueous mixture, [Pa*s]
- mu
References
- 1
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> Laliberte_viscosity_mix(T=278.15, ws=[0.00581, 0.002], v1s=[16.221788633396, 69.5769240055845], v2s=[1.32293086770011, 4.17047793905946], v3s=[1.48485985010431, 3.57817553622189], v4s=[0.00746912559657377, 0.0116677996754397], v5s=[30.7802007540575, 13897.6652650556], v6s=[2.05826852322558, 20.8027689840251]) 0.0015377348091189648
- thermo.electrochem.Laliberte_viscosity_i(T, w_w, v1, v2, v3, v4, v5, v6)[source]¶
Calculate the viscosity of a solute using the form proposed by [1] Parameters are needed, and a temperature. Units are Kelvin and Pa*s.
$\mu_i = \frac{\exp\left( \frac{v_1(1-w_w)^{v_2}+v_3}{v_4 t +1}\right)} {v_5(1-w_w)^{v_6}+1}$- Parameters
- Returns
- mu_i
float
Solute partial viscosity, [Pa*s]
- mu_i
Notes
Temperature range check is outside of this function. Check is performed using NaCl at 5 degC from the first value in [1]’s spreadsheet.
References
- 1(1,2)
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> params = [16.221788633396, 1.32293086770011, 1.48485985010431, 0.00746912559657377, 30.7802007540575, 2.05826852322558] >>> Laliberte_viscosity_i(273.15+5, 1-0.005810, *params) 0.004254025533308794
- thermo.electrochem.Laliberte_viscosity_w(T)[source]¶
Calculate the viscosity of a water using the form proposed by [1]. No parameters are needed, just a temperature. Units are Kelvin and Pa*s. t is temperature in degrees Celcius.
$\mu_w = \frac{t + 246}{(0.05594t+5.2842)t + 137.37}$Notes
Original source or pure water viscosity is not cited. No temperature range is given for this equation.
References
- 1
Laliberte, Marc. “A Model for Calculating the Heat Capacity of Aqueous Solutions, with Updated Density and Viscosity Data.” Journal of Chemical & Engineering Data 54, no. 6 (June 11, 2009): 1725-60. doi:10.1021/je8008123
Examples
>>> Laliberte_viscosity_w(298) 0.000893226448703328
Aqueous Electrolyte Thermal Conductivity¶
- thermo.electrochem.thermal_conductivity_Magomedov(T, P, ws, CASRNs, k_w)[source]¶
Calculate the thermal conductivity of an aqueous mixture of electrolytes using the form proposed by Magomedov [1]. Parameters are loaded by the function as needed. Function will fail if an electrolyte is not in the database.
$\lambda = \lambda_w\left[ 1 - \sum_{i=1}^n A_i (w_i + 2\times10^{-4} w_i^3)\right] - 2\times10^{-8} PT\sum_{i=1}^n w_i$- Parameters
- Returns
- kl
float
Liquid thermal condiuctivity, [W/m/K]
- kl
Notes
Range from 273 K to 473 K, P from 0.1 MPa to 100 MPa. C from 0 to 25 mass%. Internal untis are MPa for pressure and weight percent.
An example is sought for this function. It is not possible to reproduce the author’s values consistently.
References
- 1
Magomedov, U. B. “The Thermal Conductivity of Binary and Multicomponent Aqueous Solutions of Inorganic Substances at High Parameters of State.” High Temperature 39, no. 2 (March 1, 2001): 221-26. doi:10.1023/A:1017518731726.
Examples
>>> thermal_conductivity_Magomedov(293., 1E6, [.25], ['7758-94-3'], k_w=0.59827) 0.548654049375
- thermo.electrochem.Magomedov_mix(T, P, ws, Ais, k_w)[source]¶
Calculate the thermal conductivity of an aqueous mixture of electrolytes using the correlation proposed by Magomedov [1]. All coefficients and the thermal conductivity of pure water must be provided.
$\lambda = \lambda_w\left[ 1 - \sum_{i=1}^n A_i (w_i + 2\times10^{-4} w_i^3)\right] - 2\times10^{-8} PT\sum_{i=1}^n w_i$- Parameters
- Returns
- kl
float
Liquid thermal condiuctivity, [W/m/K]
- kl
Notes
Range from 273 K to 473 K, P from 0.1 MPa to 100 MPa. C from 0 to 25 mass%. Internal untis are MPa for pressure and weight percent.
References
- 1
Magomedov, U. B. “The Thermal Conductivity of Binary and Multicomponent Aqueous Solutions of Inorganic Substances at High Parameters of State.” High Temperature 39, no. 2 (March 1, 2001): 221-26. doi:10.1023/A:1017518731726.
Examples
>>> Magomedov_mix(293., 1E6, [.25], [0.00294], k_w=0.59827) 0.548654049375
Aqueous Electrolyte Electrical Conductivity¶
- thermo.electrochem.dilute_ionic_conductivity(ionic_conductivities, zs, rhom)[source]¶
This function handles the calculation of the electrical conductivity of a dilute electrolytic aqueous solution. Requires the mole fractions of each ion, the molar density of the whole mixture, and ionic conductivity coefficients for each ion.
$\lambda = \sum_i \lambda_i^\circ z_i \rho_m$- Parameters
- Returns
- kappa
float
Electrical conductivity of the fluid, [S/m]
- kappa
Notes
The ionic conductivity coefficients should not be equivalent coefficients; for example, 0.0053 m^2*S/mol is the equivalent conductivity coefficient of Mg+2, but this method expects twice its value - 0.0106. Both are reported commonly in literature.
Water can be included in this caclulation by specifying a coefficient of 0. The conductivity of any electrolyte eclipses its own conductivity by many orders of magnitude. Any other solvents present will affect the conductivity extensively and there are few good methods to predict this effect.
References
- 1
Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
Examples
Complex mixture of electrolytes [‘Cl-’, ‘HCO3-’, ‘SO4-2’, ‘Na+’, ‘K+’, ‘Ca+2’, ‘Mg+2’]:
>>> ionic_conductivities = [0.00764, 0.00445, 0.016, 0.00501, 0.00735, 0.0119, 0.01061] >>> zs = [0.03104, 0.00039, 0.00022, 0.02413, 0.0009, 0.0024, 0.00103] >>> dilute_ionic_conductivity(ionic_conductivities=ionic_conductivities, zs=zs, rhom=53865.9) 22.05246783663
- thermo.electrochem.conductivity_McCleskey(T, M, lambda_coeffs, A_coeffs, B, multiplier, rho=1000.0)[source]¶
This function handles the calculation of the electrical conductivity of an electrolytic aqueous solution with one electrolyte in solution. It handles temperature dependency and concentrated solutions. Requires the temperature of the solution; its molality, and four sets of coefficients lambda_coeffs, A_coeffs, B, and multiplier.
$\Lambda = \frac{\kappa}{C} \Lambda = \Lambda^0(t) - A(t) \frac{m^{1/2}}{1+Bm^{1/2}} \Lambda^\circ(t) = c_1 t^2 + c_2 t + c_3 A(t) = d_1 t^2 + d_2 t + d_3$In the above equations, t is temperature in degrees Celcius; m is molality in mol/kg, and C is the concentration of the elctrolytes in mol/m^3, calculated as the product of density and molality.
- Parameters
- T
float
Temperature of the solution, [K]
- M
float
Molality of the solution with respect to one electrolyte (mol solute / kg solvent), [mol/kg]
- lambda_coeffs
list
[float
] List of coefficients for the polynomial used to calculate lambda; length-3 coefficients provided in [1], [-]
- A_coeffs
list
[float
] List of coefficients for the polynomial used to calculate A; length-3 coefficients provided in [1], [-]
- B
float
Empirical constant for an electrolyte, [-]
- multiplier
float
The multiplier to obtain the absolute conductivity from the equivalent conductivity; ex 2 for CaCl2, [-]
- rho
float
,optional
The mass density of the aqueous mixture, [kg/m^3]
- T
- Returns
- kappa
float
Electrical conductivity of the solution at the specified molality and temperature [S/m]
- kappa
Notes
Coefficients provided in [1] result in conductivity being calculated in units of mS/cm; they are converted to S/m before returned.
References
- 1(1,2,3)
McCleskey, R. Blaine. “Electrical Conductivity of Electrolytes Found In Natural Waters from (5 to 90) °C.” Journal of Chemical & Engineering Data 56, no. 2 (February 10, 2011): 317-27. doi:10.1021/je101012n.
Examples
A 0.5 wt% solution of CaCl2, conductivity calculated in mS/cm
>>> conductivity_McCleskey(T=293.15, M=0.045053, A_coeffs=[.03918, 3.905, ... 137.7], lambda_coeffs=[0.01124, 2.224, 72.36], B=3.8, multiplier=2) 0.8482584585108555
- thermo.electrochem.ionic_strength(mis, zis)[source]¶
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 sum to be much less than 1.
$I = \frac{1}{2} \sum M_i z_i^2 I = \frac{1}{2} \sum x_i z_i^2$- Parameters
- Returns
- I
float
ionic strength, [?]
- I
References
- 1
Chen, Chau-Chyun, H. I. Britt, J. F. Boston, and L. B. Evans. “Local Composition Model for Excess Gibbs Energy of Electrolyte Systems. Part I: Single Solvent, Single Completely Dissociated Electrolyte Systems.” AIChE Journal 28, no. 4 (July 1, 1982): 588-96. doi:10.1002/aic.690280410
- 2
Gmehling, Jurgen. Chemical Thermodynamics: For Process Simulation. Weinheim, Germany: Wiley-VCH, 2012.
Examples
>>> ionic_strength([0.1393, 0.1393], [1, -1]) 0.1393
Pure Liquid Electrical Conductivity¶
- thermo.electrochem.conductivity(CASRN, method=None)[source]¶
This function handles the retrieval of a chemical’s conductivity. 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.
Function has data for approximately 100 chemicals.
- Parameters
- CASRN
str
CASRN [-]
- CASRN
- Returns
- Other Parameters
- method
str
,optional
A string for the method name to use, as defined by constants in conductivity_methods
- method
Notes
Only one source is available in this function. It is:
‘LANGE_COND’ which is from Lange’s Handbook, Table 8.34 Electrical Conductivity of Various Pure Liquids’, a compillation of data in [1]. The individual datapoints in this source are not cited at all.
References
- 1
Speight, James. Lange’s Handbook of Chemistry. 16 edition. McGraw-Hill Professional, 2005.
Examples
>>> conductivity('7732-18-5') (4e-06, 291.15)
- thermo.electrochem.conductivity_methods(CASRN)[source]¶
Return all methods available to obtain electrical conductivity for the specified chemical.
- Parameters
- CASRN
str
CASRN, [-]
- CASRN
- Returns
See also
- thermo.electrochem.conductivity_all_methods = ['LANGE_COND']¶
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
Water Dissociation Equilibrium¶
- thermo.electrochem.Kweq_Arcis_Tremaine_Bandura_Lvov(T, rho_w)[source]¶
Calculates equilibrium constant for OH- and H+ in water, according to [1].
$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) - \frac{Q}{Q+1} \rho (\beta_0 + \beta_1 T^{-1} + \beta_2 \rho) \right] -\log_{10} K_w^G + 2 \log_{10} \frac{18.015268}{1000}$- Parameters
- Returns
- Kweq
float
Ionization constant of water, [-]
- Kweq
Notes
Formulation is in terms of density in g/cm^3; density is converted internally.
n = 6; alpha0 = -0.864671; alpha1 = 8659.19; alpha2 = -22786.2; beta0 = 0.642044; beta1 = -56.8534; beta2 = -0.375754
References
- 1
Arcis, Hugues, Jane P. Ferguson, Jenny S. Cox, and Peter R. Tremaine. “The Ionization Constant of Water at Elevated Temperatures and Pressures: New Data from Direct Conductivity Measurements and Revised Formulations from T = 273 K to 674 K and p = 0.1 MPa to 31 MPa.” Journal of Physical and Chemical Reference Data 49, no. 3 (July 23, 2020): 033103. https://doi.org/10.1063/1.5127662.
Examples
>>> -1*log10(Kweq_Arcis_Tremaine_Bandura_Lvov(600, 700)) 11.138236348
- thermo.electrochem.Kweq_IAPWS(T, rho_w)[source]¶
Calculates equilibrium constant for OH- and H+ in water, according to [1]. This is the most recent formulation available.
$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) - \frac{Q}{Q+1} \rho (\beta_0 + \beta_1 T^{-1} + \beta_2 \rho) \right] -\log_{10} K_w^G + 2 \log_{10} \frac{18.015268}{1000}$- Parameters
- Returns
- Kweq
float
Ionization constant of water, [-]
- Kweq
Notes
Formulation is in terms of density in g/cm^3; density is converted internally.
n = 6; alpha0 = -0.864671; alpha1 = 8659.19; alpha2 = -22786.2; beta0 = 0.642044; beta1 = -56.8534; beta2 = -0.375754
References
- 1
Bandura, Andrei V., and Serguei N. Lvov. “The Ionization Constant of Water over Wide Ranges of Temperature and Density.” Journal of Physical and Chemical Reference Data 35, no. 1 (March 1, 2006): 15-30. doi:10.1063/1.1928231
Examples
Example from IAPWS check:
>>> -1*log10(Kweq_IAPWS(600, 700)) 11.203153057603775
- thermo.electrochem.Kweq_IAPWS_gas(T)[source]¶
Calculates equilibrium constant for OH- and H+ in water vapor, according to [1]. This is the most recent formulation available.
$-log_{10} K_w^G = \gamma_0 + \gamma_1 T^{-1} + \gamma_2 T^{-2} + \gamma_3 T^{-3}$Notes
gamma0 = 6.141500E-1; gamma1 = 4.825133E4; gamma2 = -6.770793E4; gamma3 = 1.010210E7
References
- 1
Bandura, Andrei V., and Serguei N. Lvov. “The Ionization Constant of Water over Wide Ranges of Temperature and Density.” Journal of Physical and Chemical Reference Data 35, no. 1 (March 1, 2006): 15-30. doi:10.1063/1.1928231
Examples
>>> Kweq_IAPWS_gas(800) 1.4379721554798815e-61
- thermo.electrochem.Kweq_1981(T, rho_w)[source]¶
Calculates equilibrium constant for OH- and H+ in water, according to [1]. Second most recent formulation.
$\log_{10} K_w= A + B/T + C/T^2 + D/T^3 + (E+F/T+G/T^2)\log_{10} \rho_w$- Parameters
- Returns
- Kweq
float
Ionization constant of water, [-]
- Kweq
Notes
Density is internally converted to units of g/cm^3.
A = -4.098; B = -3245.2; C = 2.2362E5; D = -3.984E7; E = 13.957; F = -1262.3; G = 8.5641E5
References
- 1
Marshall, William L., and E. U. Franck. “Ion Product of Water Substance, 0-1000 degree C, 1010,000 Bars New International Formulation and Its Background.” Journal of Physical and Chemical Reference Data 10, no. 2 (April 1, 1981): 295-304. doi:10.1063/1.555643.
Examples
>>> -1*log10(Kweq_1981(600, 700)) 11.274522047
Balancing Ions¶
- thermo.electrochem.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)[source]¶
Performs an ion balance to adjust measured experimental ion compositions to electroneutrality. Can accept either the actual mole fractions of the ions, or their concentrations in units of [mg/L] as well for convinience.
The default method will locate the most prevalent ion in the type of ion not in excess - and increase it until the two ion types balance.
- Parameters
- anions
list
(ChemicalMetadata
) List of all negatively charged ions measured as being in the solution; ChemicalMetadata instances or simply objects with the attributes MW and charge, [-]
- cations
list
(ChemicalMetadata
) List of all positively charged ions measured as being in the solution; ChemicalMetadata instances or simply objects with the attributes MW and charge, [-]
- anion_zs
list
,optional
Mole fractions of each anion as measured in the aqueous solution, [-]
- cation_zs
list
,optional
Mole fractions of each cation as measured in the aqueous solution, [-]
- anion_concs
list
,optional
Concentrations of each anion in the aqueous solution in the units often reported (for convinience only) [mg/L]
- cation_concs
list
,optional
Concentrations of each cation in the aqueous solution in the units often reported (for convinience only) [mg/L]
- rho_w
float
,optional
Density of the aqueous solutionr at the temperature and pressure the anion and cation concentrations were measured (if specified), [kg/m^3]
- method
str
,optional
The method to use to balance the ionimbalance; one of ‘dominant’, ‘decrease dominant’, ‘increase dominant’, ‘proportional insufficient ions increase’, ‘proportional excess ions decrease’, ‘proportional cation adjustment’, ‘proportional anion adjustment’, ‘Na or Cl increase’, ‘Na or Cl decrease’, ‘adjust’, ‘increase’, ‘decrease’, ‘makeup’].
- selected_ion
ChemicalMetadata
,optional
Some methods adjust only one user-specified ion; this is that input. For the case of the ‘makeup’ method, this is a tuple of (anion, cation) ChemicalMetadata instances and only the ion type not in excess will be used.
- anions
- Returns
- anions
list
[ChemicalMetadata
] List of all negatively charged ions measured as being in the solution; ChemicalMetadata instances after potentially adding in an ion which was not present but specified by the user, [-]
- cations
list
[ChemicalMetadata
] List of all positively charged ions measured as being in the solution; ChemicalMetadata instances after potentially adding in an ion which was not present but specified by the user, [-]
- anion_zs
list
[float
], Mole fractions of each anion in the aqueous solution after the charge balance, [-]
- cation_zs
list
[float
] Mole fractions of each cation in the aqueous solution after the charge balance, [-]
- z_water
float
[float
] Mole fraction of the water in the solution, [-]
- anions
Notes
The methods perform the charge balance as follows:
‘dominant’ : The ion with the largest mole fraction in solution has its concentration adjusted up or down as necessary to balance the solution.
‘decrease dominant’ : The ion with the largest mole fraction in the type of ion with excess charge has its own mole fraction decreased to balance the solution.
‘increase dominant’ : The ion with the largest mole fraction in the type of ion with insufficient charge has its own mole fraction decreased to balance the solution.
‘proportional insufficient ions increase’ : The ion charge type which is present insufficiently has each of the ions mole fractions increased proportionally until the solution is balanced.
‘proportional excess ions decrease’ : The ion charge type which is present in excess has each of the ions mole fractions decreased proportionally until the solution is balanced.
‘proportional cation adjustment’ : All cations have their mole fractions increased or decreased proportionally as necessary to balance the solution.
‘proportional anion adjustment’ : All anions have their mole fractions increased or decreased proportionally as necessary to balance the solution.
‘Na or Cl increase’ : Either Na+ or Cl- is added to the solution until the solution is balanced; the species will be added if they were not present initially as well.
‘Na or Cl decrease’ : Either Na+ or Cl- is removed from the solution until the solution is balanced; the species will be added if they were not present initially as well.
‘adjust’ : An ion specified with the parameter selected_ion has its mole fraction increased or decreased as necessary to balance the solution. An exception is raised if the specified ion alone cannot balance the solution.
‘increase’ : An ion specified with the parameter selected_ion has its mole fraction increased as necessary to balance the solution. An exception is raised if the specified ion alone cannot balance the solution.
‘decrease’ : An ion specified with the parameter selected_ion has its mole fraction decreased as necessary to balance the solution. An exception is raised if the specified ion alone cannot balance the solution.
‘makeup’ : Two ions ase specified as a tuple with the parameter selected_ion. Whichever ion type is present in the solution insufficiently is added; i.e. if the ions were Mg+2 and Cl-, and there was too much negative charge in the solution, Mg+2 would be added until the solution was balanced.
Examples
>>> anions_n = ['Cl-', 'HCO3-', 'SO4-2'] >>> cations_n = ['Na+', 'K+', 'Ca+2', 'Mg+2'] >>> cations = [identifiers.pubchem_db.search_name(i) for i in cations_n] >>> anions = [identifiers.pubchem_db.search_name(i) for i in anions_n] >>> an_res, cat_res, an_zs, cat_zs, z_water = balance_ions(anions, cations, ... anion_zs=[0.02557, 0.00039, 0.00026], cation_zs=[0.0233, 0.00075, ... 0.00262, 0.00119], method='proportional excess ions decrease') >>> an_zs [0.02557, 0.00039, 0.00026] >>> cat_zs [0.01948165456267761, 0.0006270918850647299, 0.0021906409851594564, 0.0009949857909693717] >>> z_water 0.9504856267761288
Fit Coefficients and Data¶
All of these coefficients are lazy-loaded, so they must be accessed as an attribute of this module.
In [1]: from thermo.electrochem import Magomedovk_thermal_cond, cond_data_McCleskey, CRC_aqueous_thermodynamics, electrolyte_dissociation_reactions, Laliberte_data
In [2]: Magomedovk_thermal_cond
Out[2]:
Formula Chemical Ai
CASRN
497-19-8 Na2CO3 Sodium carbonate -0.00050
584-08-7 K2CO3 Potassium carbonate 0.00160
7447-39-4 CuCl2 Cuprous chloride 0.00360
7488-54-2 Rb2SO4 Rubidium sulfate 0.00134
7601-89-0 NaClO4 Sodium perchlorate 0.00250
7646-79-9 CoCl2 Cobaltous chloride 0.00320
7664-93-9 H2SO4 Acid sulfate 0.00305
7699-45-8 ZnBr2 Zinc bromide 0.00410
7718-54-9 NiCl2 Nickelous chloride 0.00330
7758-94-3 FeCl2 Ferrous chloride 0.00294
7761-88-8 AgNO3 Silver nitrate 0.00190
7775-09-9 NaClO3 Sodium chlorate 0.00240
7778-50-9 K2Cr2O7 Potassium dichromate 0.00188
7786-81-4 NiSO4 Nickelous sulfate 0.00140
7789-00-6 K2CrO4 Potassium chromate 0.00130
7789-23-3 KF Potassium fluoride 0.00180
7789-38-0 NaBrO3 Sodium bromate 0.00170
7789-39-1 RbBr Rubidium bromide 0.00305
7789-42-6 CdBr2 Cadmium bromide 0.00274
7789-46-0 FeBr2 Ferrous bromide 0.00375
7790-29-6 RbI Rubidium iodide 0.00322
7790-80-9 CdI2 Cadmium iodide 0.00302
7791-11-9 RbCl Rubidium chloride 0.00238
10042-76-9 Sr(NO3)2 Strontium nitrate 0.00153
10043-01-3 Al2(SO4)3 Aluminum sulfate 0.00335
10099-74-8 Pb(NO3)2 Lead nitrate 0.00138
10102-68-8 CaI2 Calcium iodide 0.00340
10139-47-6 ZnI2 Zinc iodide 0.00410
10325-94-7 Cd(NO3)2 Cadmium nitrate 0.00155
10377-51-2 LiI Lithium iodide 0.00435
10377-58-9 MgI2 Magnesium iodide 0.00417
10476-81-0 SrBr2 Strontium bromide 0.00290
10476-85-4 SrCl2 Strontium chloride 0.00170
10476-86-5 SrI2 Strontium iodide 0.00311
12027-06-4 NH4I Ammonium iodide 0.00480
13126-12-0 RbNO3 Rubidium nitrate 0.00214
13462-88-9 NiBr2 Nickelous bromide 0.00396
13462-90-3 NiI2 Nickelous iodide 0.00393
15238-00-3 CoI2 Cobaltous iodide 0.00384
In [3]: cond_data_McCleskey
Out[3]:
formula c1 c2 ... d3 B multiplier
CASRN ...
7447-40-7 KCl 0.009385 2.533 ... 44.11 1.70 1
7647-14-5 NaCl 0.008967 2.196 ... 44.55 1.30 1
7647-01-0 HCl -0.006766 6.614 ... 48.53 0.01 1
7447-41-8 LiCl 0.008784 1.996 ... 42.79 1.00 1
7647-17-8 CsCl 0.010080 2.479 ... 41.29 1.40 1
12125-02-9 NH4Cl 0.006575 2.684 ... 30.00 0.70 1
10043-52-4 CaCl2 0.011240 2.224 ... 137.70 3.80 2
7786-30-3 MgCl2 0.009534 2.247 ... 129.80 3.10 2
10361-37-2 BaCl2 0.010380 2.346 ... 111.80 2.40 2
10476-85-4 SrCl2 0.009597 2.279 ... 60.18 0.80 2
7664-93-9 H2SO4 -0.019850 7.421 ... 1869.00 11.50 2
7757-82-6 Na2SO4 0.009501 2.317 ... 135.50 2.20 2
7778-80-5 K2SO4 0.008819 2.872 ... 247.10 5.30 2
10294-54-9 Cs2SO4 0.012730 2.457 ... 187.40 3.30 2
7778-18-9 CaSO4 0.011920 2.564 ... 644.40 9.60 2
7646-93-7 KHSO4 -0.003092 9.759 ... 1776.00 8.20 1
298-14-6 KHCO3 0.007807 2.040 ... 38.58 0.90 1
584-08-7 K2CO3 0.011450 2.726 ... 81.12 2.10 2
144-55-8 NaHCO3 0.012600 1.543 ... 52.94 1.10 1
497-19-8 Na2CO3 0.022960 5.211 ... 455.80 4.80 2
1310-73-2 NaOH 0.006936 3.872 ... 56.76 0.20 1
7681-49-4 NaF 0.007346 2.032 ... 69.99 2.30 1
7789-23-3 KF 0.007451 2.294 ... 39.40 0.90 1
7758-02-3 KBr 0.007076 2.612 ... 29.49 0.60 1
7757-79-1 KNO3 0.009117 2.309 ... 49.12 0.70 1
7779-88-6 Zn(NO3)2 0.015260 4.519 ... 302.90 4.00 2
[26 rows x 9 columns]
In [4]: CRC_aqueous_thermodynamics
Out[4]:
Formula Name ... S(aq) Cp(aq)
CAS ...
57-12-5 CN- Cyanide ion ... 94.1 NaN
71-47-6 CHOO- Formate ion ... 92.0 -87.9
71-50-1 CH3COO- Acetate ion ... 86.6 -6.3
71-52-3 HCO3- Bicarbonate ion ... 91.2 NaN
302-04-5 SCN- Thiocyanate ion ... 144.3 -40.2
... ... ... ... ... ...
117412-24-5 BeO2-2 Beryllium dioxide ion ... -159.0 NaN
127622-32-6 Y(OH)+2 Yttrium hydroxide ion ... NaN NaN
129466-35-9 Te(OH)3+ Tellurium(IV) trihydroxide ion ... 111.7 NaN
186449-38-7 InOH+2 Indium hydroxide ion ... -88.0 NaN
2099995000-00-0 Y2(OH)2+4 Yttrium dihydroxide ion ... NaN NaN
[173 rows x 7 columns]
In [5]: electrolyte_dissociation_reactions
Out[5]:
Electrolyte name Electrolyte CAS ... Cation charge Cation count
0 Diammonium Hydrogen phosphate 7783-28-0 ... 1 2
1 Ammonium Sulfate 7783-20-2 ... 1 2
2 ammonium sulfite 10196-04-0 ... 1 2
3 Ammonium phosphate 10361-65-6 ... 1 3
4 Ammonium siliconhexafluoride 16919-19-0 ... 1 2
.. ... ... ... ... ...
259 Zinc selenite 13597-46-1 ... 2 1
260 Zinc selenate 13597-54-1 ... 2 1
261 Zinc Nitrate 7779-88-6 ... 2 1
262 Zinc Chloride 7646-85-7 ... 2 1
263 Zinc Sulfate 7733-02-0 ... 2 1
[264 rows x 11 columns]
In [6]: Laliberte_data
Out[6]:
Name Formula ... Max w.2 No of points in corr.2
CASRN ...
7783-20-2 Ammonium Sulfate (NH4)2SO4 ... NaN NaN
10043-01-3 Aluminum Sulfate Al2(SO4)3 ... NaN NaN
7446-70-0 Aluminum Chloride AlCl3 ... NaN NaN
10022-31-8 Barium Nitrate Ba(NO3)2 ... 0.047274 96.0
10361-37-2 Barium Chloride BaCl2 ... 0.248237 16.0
... ... ... ... ... ...
57-50-1 Sucrose Sucrose ... NaN NaN
13825-74-6 Titanyl Sulfate TiOSO4 ... NaN NaN
7779-88-6 Zinc Nitrate Zn(NO3)2 ... 0.077132 144.0
7646-85-7 Zinc Chloride ZnCl2 ... NaN NaN
7733-02-0 Zinc Sulfate ZnSO4 ... NaN NaN
[109 rows x 32 columns]