pyEQL 0.12.2__py2.py3-none-any.whl → 0.14.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ Individual functions for activity coefficients are defined here so that they
8
8
  can be used independently of a pyEQL solution object. Normally, these functions
9
9
  are called from within the get_activity_coefficient method of the Solution class.
10
10
 
11
- :copyright: 2013-2023 by Ryan S. Kingsbury
11
+ :copyright: 2013-2024 by Ryan S. Kingsbury
12
12
  :license: LGPL, see LICENSE for more details.
13
13
 
14
14
  """
@@ -22,7 +22,7 @@ from pyEQL.utils import create_water_substance
22
22
 
23
23
 
24
24
  def _debye_parameter_B(temperature: str = "25 degC") -> Quantity:
25
- """
25
+ r"""
26
26
  Return the constant B used in the extended Debye-Huckel equation.
27
27
 
28
28
  Args:
@@ -37,7 +37,9 @@ def _debye_parameter_B(temperature: str = "25 degC") -> Quantity:
37
37
  Notes:
38
38
  The parameter B is equal to:
39
39
 
40
- .. math:: B = ( \\frac{{2 N_A \\rho_w e^2}{\\epsilon_o \\epsilon_r k T}) ^ {1 \\over 2}
40
+ .. math::
41
+
42
+ B = \bigg( \frac{2 N_A \rho_w e^2}{\epsilon_o \epsilon_r k T} \bigg) ^ {\frac{1}{2}}
41
43
 
42
44
  References:
43
45
  Bockris and Reddy. /Modern Electrochemistry/, vol 1. Plenum/Rosetta, 1977, p.210.
@@ -66,7 +68,7 @@ def _debye_parameter_B(temperature: str = "25 degC") -> Quantity:
66
68
 
67
69
 
68
70
  def _debye_parameter_activity(temperature: str = "25 degC") -> "Quantity":
69
- """
71
+ r"""
70
72
  Return the constant A for use in the Debye-Huckel limiting law (base e).
71
73
 
72
74
  Args:
@@ -82,7 +84,8 @@ def _debye_parameter_activity(temperature: str = "25 degC") -> "Quantity":
82
84
  The parameter A is equal to:
83
85
 
84
86
  .. math::
85
- A^{\\gamma} = {e^3 ( 2 \\pi N_A {\\rho})^{0.5} \\over (4 \\pi \\epsilon_o \\epsilon_r k T)^{1.5}}
87
+
88
+ A^{\gamma} = \frac{e^3 \big( 2 \pi N_A \rho \big)^{0.5}}{(4 \pi \epsilon_o \epsilon_r k T)^{1.5}}
86
89
 
87
90
  Note that this equation returns the parameter value that can be used to calculate
88
91
  the natural logarithm of the activity coefficient. For base 10, divide the
@@ -97,7 +100,7 @@ def _debye_parameter_activity(temperature: str = "25 degC") -> "Quantity":
97
100
  https://en.wikipedia.org/wiki/Debye%E2%80%93H%C3%BCckel_equation
98
101
 
99
102
  See Also:
100
- :py:func:`_debye_parameter_osmotic`
103
+ :func:`_debye_parameter_osmotic`
101
104
 
102
105
  """
103
106
  T = ureg.Quantity(temperature)
@@ -112,88 +115,78 @@ def _debye_parameter_activity(temperature: str = "25 degC") -> "Quantity":
112
115
  / (4 * math.pi * ureg.epsilon_0 * water_substance.epsilon * ureg.boltzmann_constant * T) ** 1.5
113
116
  )
114
117
 
115
- logger.info(f"Computed Debye-Huckel Limiting Law Constant A^{{\\gamma}} = {debyeparam} at {temperature}")
118
+ logger.info(rf"Computed Debye-Huckel Limiting Law Constant A^{{\gamma}} = {debyeparam} at {temperature}")
116
119
  return debyeparam.to("kg ** 0.5 / mol ** 0.5")
117
120
 
118
121
 
119
122
  def _debye_parameter_osmotic(temperature="25 degC"):
120
- """
123
+ r"""
121
124
  Return the constant A_phi for use in calculating the osmotic coefficient according to Debye-Huckel theory.
122
125
 
123
- Parameters
124
- ----------
125
- temperature : str Quantity, optional
126
- String representing the temperature of the solution. Defaults to '25 degC' if not specified.
126
+ Args:
127
+ temperature: String representing the temperature of the solution. Defaults to '25 degC' if not specified.
127
128
 
128
- Notes
129
- -----
130
- Not to be confused with the Debye-Huckel constant used for activity coefficients in the limiting law.
131
- Takes the value 0.392 at 25 C.
132
- This constant is calculated according to: [kim]_ [arch]_
129
+ Notes:
130
+ Not to be confused with the Debye-Huckel constant used for activity coefficients in the limiting law.
131
+ Takes the value 0.392 at 25 C.
132
+ This constant is calculated according to: [kim]_ [arch]_
133
133
 
134
- .. math:: A^{\\phi} = {1 \\over 3} A^{\\gamma}
134
+ .. math:: A^{\phi} = {1 \over 3} A^{\gamma}
135
135
 
136
- References
137
- ----------
138
- .. [kim] Kim, Hee-Talk and Frederick, William Jr, 1988. "Evaluation of Pitzer Ion Interaction Parameters of Aqueous Electrolytes at 25 C. 1. Single Salt Parameters,"
139
- *J. Chemical Engineering Data* 33, pp.177-184.
136
+ References:
137
+ .. [kim] Kim, Hee-Talk and Frederick, William Jr, 1988. "Evaluation of Pitzer Ion Interaction Parameters of Aqueous Electrolytes at 25 C. 1. Single Salt Parameters,"
138
+ *J. Chemical Engineering Data* 33, pp.177-184.
140
139
 
141
- .. [arch] Archer, Donald G. and Wang, Peiming. "The Dielectric Constant of Water \
142
- and Debye-Huckel Limiting Law Slopes." /J. Phys. Chem. Ref. Data/ 19(2), 1990.
140
+ .. [arch] Archer, Donald G. and Wang, Peiming. "The Dielectric Constant of Water \
141
+ and Debye-Huckel Limiting Law Slopes." /J. Phys. Chem. Ref. Data/ 19(2), 1990.
143
142
 
144
143
  Examples:
145
- --------
146
- >>> _debye_parameter_osmotic() #doctest: +ELLIPSIS
147
- 0.3916...
144
+ >>> _debye_parameter_osmotic() #doctest: +ELLIPSIS
145
+ 0.3916...
148
146
 
149
147
  See Also:
150
- :py:func:`_debye_parameter_activity`
148
+ :func:`_debye_parameter_activity`
151
149
 
152
150
  """
153
151
  output = 1 / 3 * _debye_parameter_activity(temperature)
154
- logger.info(f"Computed Debye-Huckel Limiting slope for osmotic coefficient A^{{\\phi}} = {output} at {temperature}")
152
+ logger.info(f"Computed Debye-Huckel Limiting slope for osmotic coefficient A^phi = {output} at {temperature}")
155
153
  return output.to("kg ** 0.5 /mol ** 0.5")
156
154
 
157
155
 
158
156
  def _debye_parameter_volume(temperature="25 degC"):
159
- """
157
+ r"""
160
158
  Return the constant A_V, the Debye-Huckel limiting slope for apparent
161
159
  molar volume.
162
160
 
163
- Parameters
164
- ----------
165
- temperature : str Quantity, optional
166
- String representing the temperature of the solution. Defaults to '25 degC' if not specified.
161
+ Args:
162
+ temperature: String representing the temperature of the solution. Defaults to '25 degC' if not specified.
167
163
 
168
- Notes
169
- -----
170
- Takes the value 1.8305 cm ** 3 * kg ** 0.5 / mol ** 1.5 at 25 C.
171
- This constant is calculated according to: [1]_
164
+ Notes:
165
+ Takes the value 1.8305 cm ** 3 * kg ** 0.5 / mol ** 1.5 at 25 C.
166
+ This constant is calculated according to: [1]_
172
167
 
173
- .. math:: A_V = -2 A_{\\phi} R T [ {3 \\over \\epsilon} {{\\partial \\epsilon \\over \\partial p} \
174
- } - {{1 \\over \\rho}{\\partial \\rho \\over \\partial p} }]
168
+ .. math:: A_V = -2 A_{\phi} R T \big[ \frac{3}{\epsilon} \frac{\partial \epsilon}{\partial p} \
169
+ - \frac{1}{\rho}\frac{\partial \rho}{\partial p} \big]
175
170
 
176
- NOTE: at this time, the term in brackets (containing the partial derivatives) is approximate.
177
- These approximations give the correct value of the slope at 25 degC and
178
- produce estimates with less than 10% error between 0 and 60 degC.
171
+ Notes: at this time, the term in brackets (containing the partial derivatives) is approximate.
172
+ These approximations give the correct value of the slope at 25 degC and
173
+ produce estimates with less than 10% error between 0 and 60 degC.
179
174
 
180
- The derivative of epsilon with respect to pressure is assumed constant (for atmospheric pressure)
181
- at -0.01275 1/MPa. Note that the negative sign does not make sense in light
182
- of real data, but is required to give the correct result.
175
+ The derivative of epsilon with respect to pressure is assumed constant (for atmospheric pressure)
176
+ at -0.01275 1/MPa. Note that the negative sign does not make sense in light
177
+ of real data, but is required to give the correct result.
183
178
 
184
- The second term is equivalent to the inverse of the bulk modulus of water, which
185
- is taken to be 2.2 GPa. [2]_
179
+ The second term is equivalent to the inverse of the bulk modulus of water, which
180
+ is taken to be 2.2 GPa. [2]_
186
181
 
187
- References
188
- ----------
189
- .. [1] Archer, Donald G. and Wang, Peiming. "The Dielectric Constant of Water \
190
- and Debye-Huckel Limiting Law Slopes." /J. Phys. Chem. Ref. Data/ 19(2), 1990.
182
+ References:
183
+ .. [1] Archer, Donald G. and Wang, Peiming. "The Dielectric Constant of Water and Debye-Huckel Limiting
184
+ Law Slopes." J. Phys. Chem. Ref. Data/ 19(2), 1990.
191
185
 
192
- .. [2] http://hyperphysics.phy-astr.gsu.edu/hbase/permot3.html
186
+ .. [2] http://hyperphysics.phy-astr.gsu.edu/hbase/permot3.html
193
187
 
194
188
  See Also:
195
- --------
196
- _debye_parameter_osmotic
189
+ :func:`_debye_parameter_osmotic`
197
190
 
198
191
  """
199
192
  T = ureg.Quantity(temperature)
@@ -218,136 +211,109 @@ def _debye_parameter_volume(temperature="25 degC"):
218
211
  return result.to("cm ** 3 * kg ** 0.5 / mol ** 1.5")
219
212
 
220
213
 
221
- def get_activity_coefficient_debyehuckel(ionic_strength, formal_charge=1, temperature="25 degC"):
222
- """
214
+ def get_activity_coefficient_debyehuckel(ionic_strength, z=1, temperature="25 degC"):
215
+ r"""
223
216
  Return the activity coefficient of solute in the parent solution according to the Debye-Huckel limiting law.
224
217
 
225
- Parameters
226
- ----------
227
- formal_charge : int, optional
228
- The charge on the solute, including sign. Defaults to +1 if not specified.
229
- ionic_strength : Quantity
230
- The ionic strength of the parent solution, mol/kg
231
- temperature : str Quantity, optional
232
- String representing the temperature of the solution. Defaults to '25 degC' if not specified.
233
-
234
- Returns
235
- -------
236
- Quantity
237
- The mean molal (mol/kg) scale ionic activity coefficient of solute, dimensionless.
218
+ Args:
219
+ z (int, optional): The charge on the solute, including sign. Defaults to +1 if not specified.
220
+ ionic_strength (Quantity): The ionic strength of the parent solution, mol/kg.
221
+ temperature (str, Quantity, optional): String representing the temperature of the solution. Defaults to '25 degC' if not specified.
238
222
 
239
- See Also:
240
- --------
241
- _debye_parameter_activity
223
+ Returns:
224
+ Quantity: The mean molal (mol/kg) scale ionic activity coefficient of solute, dimensionless.
242
225
 
243
- Notes
244
- -----
245
- Activity coefficient is calculated according to:
226
+ Notes:
227
+ Activity coefficient is calculated according to:
246
228
 
247
- .. math:: \\ln \\gamma = A^{\\gamma} z_i^2 \\sqrt I
229
+ .. math:: \ln \gamma = A^{\gamma} z_i^2 \sqrt I
248
230
 
249
- Valid only for I < 0.005
231
+ Valid only for I < 0.005
250
232
 
251
- References
252
- ----------
253
- Stumm, Werner and Morgan, James J. Aquatic Chemistry, 3rd ed,
254
- pp 103. Wiley Interscience, 1996.
233
+ See Also:
234
+ :func:`_debye_parameter_activity`
235
+ :func:`get_activity_coefficient_davies`
236
+ :func:`get_activity_coefficient_guntelberg`
255
237
 
238
+ References:
239
+ Stumm, Werner and Morgan, James J. Aquatic Chemistry, 3rd ed,
240
+ pp 103. Wiley Interscience, 1996.
256
241
  """
257
242
  # check if this method is valid for the given ionic strength
258
243
  if not ionic_strength.magnitude <= 0.005:
259
244
  logger.warning("Ionic strength exceeds valid range of the Debye-Huckel limiting law")
260
245
 
261
- log_f = -_debye_parameter_activity(temperature) * formal_charge**2 * ionic_strength**0.5
246
+ log_f = -_debye_parameter_activity(temperature) * z**2 * ionic_strength**0.5
262
247
 
263
248
  return math.exp(log_f) * ureg.Quantity(1, "dimensionless")
264
249
 
265
250
 
266
- def get_activity_coefficient_guntelberg(ionic_strength, formal_charge=1, temperature="25 degC"):
267
- """
251
+ def get_activity_coefficient_guntelberg(ionic_strength, z=1, temperature="25 degC"):
252
+ r"""
268
253
  Return the activity coefficient of solute in the parent solution according to the Guntelberg approximation.
269
254
 
270
- Parameters
271
- ----------
272
- formal_charge : int, optional
273
- The charge on the solute, including sign. Defaults to +1 if not specified.
274
- ionic_strength : Quantity
275
- The ionic strength of the parent solution, mol/kg
276
- temperature : str Quantity, optional
277
- String representing the temperature of the solution. Defaults to '25 degC' if not specified.
278
-
279
- Returns
280
- -------
281
- Quantity
282
- The mean molal (mol/kg) scale ionic activity coefficient of solute, dimensionless.
255
+ Args:
256
+ z (int, optional): The charge on the solute, including sign. Defaults to +1 if not specified.
257
+ ionic_strength (Quantity): The ionic strength of the parent solution, mol/kg.
258
+ temperature (str, Quantity, optional): String representing the temperature of the solution. Defaults to '25 degC' if not specified.
283
259
 
284
- See Also:
285
- --------
286
- _debye_parameter_activity
260
+ Returns:
261
+ Quantity: The mean molal (mol/kg) scale ionic activity coefficient of solute, dimensionless.
287
262
 
288
- Notes
289
- ------
290
- Activity coefficient is calculated according to:
263
+ Notes:
264
+ Activity coefficient is calculated according to:
291
265
 
292
- .. math:: \\ln \\gamma = A^{\\gamma} z_i^2 {\\sqrt I \\over (1 + \\sqrt I)}
266
+ .. math:: \ln \gamma = A^{\gamma} z_i^2 {\sqrt I \over (1 + \sqrt I)}
293
267
 
294
- Valid for I < 0.1
268
+ Valid for I < 0.1
295
269
 
296
- References
297
- ----------
298
- Stumm, Werner and Morgan, James J. Aquatic Chemistry, 3rd ed,
299
- pp 103. Wiley Interscience, 1996.
270
+ See Also:
271
+ :func:`_debye_parameter_activity`
272
+ :func:`get_activity_coefficient_davies`
273
+ :func:`get_activity_coefficient_debyehuckel`
300
274
 
275
+ References:
276
+ Stumm, Werner and Morgan, James J. Aquatic Chemistry, 3rd ed,
277
+ pp 103. Wiley Interscience, 1996.
301
278
  """
302
279
  # check if this method is valid for the given ionic strength
303
280
  if not ionic_strength.magnitude <= 0.1:
304
281
  logger.warning("Ionic strength exceeds valid range of the Guntelberg approximation")
305
282
 
306
283
  log_f = (
307
- -_debye_parameter_activity(temperature)
308
- * formal_charge**2
309
- * ionic_strength**0.5
310
- / (1 + ionic_strength.magnitude**0.5)
284
+ -_debye_parameter_activity(temperature) * z**2 * ionic_strength**0.5 / (1 + ionic_strength.magnitude**0.5)
311
285
  )
312
286
 
313
287
  return math.exp(log_f) * ureg.Quantity(1, "dimensionless")
314
288
 
315
289
 
316
- def get_activity_coefficient_davies(ionic_strength, formal_charge=1, temperature="25 degC"):
317
- """
290
+ def get_activity_coefficient_davies(ionic_strength, z=1, temperature="25 degC"):
291
+ r"""
318
292
  Return the activity coefficient of solute in the parent solution according to the Davies equation.
319
293
 
320
- Parameters
321
- ----------
322
- formal_charge : int, optional
323
- The charge on the solute, including sign. Defaults to +1 if not specified.
324
- ionic_strength : Quantity
325
- The ionic strength of the parent solution, mol/kg
326
- temperature : str Quantity, optional
327
- String representing the temperature of the solution. Defaults to '25 degC' if not specified.
328
-
329
- Returns
330
- -------
331
- Quantity
332
- The mean molal (mol/kg) scale ionic activity coefficient of solute, dimensionless.
294
+ Args:
295
+ ionic_strength (Quantity): The ionic strength of the parent solution, mol/kg.
296
+ z (int, optional): The charge on the solute, including sign. Defaults to +1 if not specified.
297
+ temperature (str, Quantity, optional): String representing the temperature of the solution. Defaults to '25 degC' if not specified.
333
298
 
334
- See Also:
335
- --------
336
- _debye_parameter_activity
299
+ Returns:
300
+ Quantity: The mean molal (mol/kg) scale ionic activity coefficient of solute, dimensionless.
337
301
 
338
- Notes
339
- -----
340
- Activity coefficient is calculated according to:
302
+ Notes:
303
+ Activity coefficient is calculated according to:
341
304
 
342
- .. math:: \\ln \\gamma = A^{\\gamma} z_i^2 ({\\sqrt I \\over (1 + \\sqrt I)} + 0.2 I)
305
+ .. math:: \ln \gamma = A^{\gamma} z_i^2 ({\sqrt I \over (1 + \sqrt I)} + 0.2 I)
343
306
 
344
- Valid for 0.1 < I < 0.5
307
+ Valid for 0.1 < I < 0.5
345
308
 
346
- References
347
- ----------
348
- Stumm, Werner and Morgan, James J. Aquatic Chemistry, 3rd ed,
349
- pp 103. Wiley Interscience, 1996.
309
+ See Also:
310
+ :func:`_debye_parameter_activity`
311
+ :func:`get_activity_coefficient_debyehuckel`
312
+ :func:`get_activity_coefficient_guntelberg`
350
313
 
314
+ References:
315
+ Stumm, Werner and Morgan, James J. Aquatic Chemistry, 3rd ed,
316
+ pp 103. Wiley Interscience, 1996.
351
317
  """
352
318
  # check if this method is valid for the given ionic strength
353
319
  if not ionic_strength.magnitude <= 0.5 and ionic_strength.magnitude >= 0.1:
@@ -356,7 +322,7 @@ def get_activity_coefficient_davies(ionic_strength, formal_charge=1, temperature
356
322
  # the units in this empirical equation don't work out, so we must use magnitudes
357
323
  log_f = (
358
324
  -_debye_parameter_activity(temperature).magnitude
359
- * formal_charge**2
325
+ * z**2
360
326
  * (ionic_strength.magnitude**0.5 / (1 + ionic_strength.magnitude**0.5) - 0.2 * ionic_strength.magnitude)
361
327
  )
362
328
 
@@ -382,87 +348,69 @@ def get_activity_coefficient_pitzer(
382
348
  """
383
349
  Return the activity coefficient of solute in the parent solution according to the Pitzer model.
384
350
 
385
- Parameters
386
- ----------
387
- ionic_strength: Quantity
388
- The ionic strength of the parent solution, mol/kg
389
- molality: Quantity
390
- The molal concentration of the parent salt, mol/kg
391
- alpha1, alpha2: number
392
- Coefficients for the Pitzer model. This function assigns the coefficients
393
- proper units of kg ** 0.5 / mol ** 0.5 after they are entered.
394
- beta0, beta1, beta2, C_phi: number
395
- Coefficients for the Pitzer model. These ion-interaction parameters are
396
- specific to each salt system.
397
- z_cation, z_anion: int
398
- The formal charge on the cation and anion, respectively
399
- nu_cation, nu_anion: int
400
- The stoichiometric coefficient of the cation and anion in the salt
401
- temperature: str Quantity
402
- String representing the temperature of the solution. Defaults to '25 degC' if not specified.
403
- b: number, optional
404
- Coefficient. Usually set equal to 1.2 and
405
- considered independent of temperature and pressure. If provided, this
406
- coefficient is assigned proper units of kg ** 0.5 / mol ** 0.5 after
407
- entry.
408
-
409
- Returns
410
- -------
411
- Quantity
412
- The mean molal (mol/kg) scale ionic activity coefficient of solute, dimensionless
351
+ Args:
352
+ ionic_strength: The ionic strength of the parent solution, mol/kg
353
+ molality: The molal concentration of the parent salt, mol/kg
354
+ alpha1, alpha2: Coefficients for the Pitzer model. This function assigns the coefficients
355
+ proper units of kg ** 0.5 / mol ** 0.5 after they are entered.
356
+ beta0, beta1, beta2, C_phi: Coefficients for the Pitzer model. These ion-interaction parameters are
357
+ specific to each salt system.
358
+ z_cation, z_anion: The charge on the cation and anion, respectively
359
+ nu_cation, nu_anion: The stoichiometric coefficient of the cation and anion in the salt
360
+ temperature: String representing the temperature of the solution. Defaults to '25 degC' if not specified.
361
+ b: Coefficient. Usually set equal to 1.2 and considered independent of temperature and pressure.
362
+ If provided, this coefficient is assigned proper units of kg ** 0.5 / mol ** 0.5 after entry.
363
+
364
+ Returns:
365
+ Quantity
366
+ The mean molal (mol/kg) scale ionic activity coefficient of solute, dimensionless
413
367
 
414
368
  Examples:
415
- --------
416
- >>> get_activity_coefficient_pitzer(0.5*ureg.Quantity('mol/kg'),0.5*ureg.Quantity('mol/kg'),1,0.5,-.0181191983,-.4625822071,.4682,.000246063,1,-1,1,1,b=1.2)
417
- 0.61915...
369
+ >>> get_activity_coefficient_pitzer(0.5*ureg.Quantity('mol/kg'),0.5*ureg.Quantity('mol/kg'),1,0.5,-.0181191983,-.4625822071,.4682,.000246063,1,-1,1,1,b=1.2)
370
+ 0.61915...
418
371
 
419
- >>> get_activity_coefficient_pitzer(5.6153*ureg.Quantity('mol/kg'),5.6153*ureg.Quantity('mol/kg'),3,0.5,0.0369993,0.354664,0.0997513,-0.00171868,1,-1,1,1,b=1.2)
420
- 0.76331...
372
+ >>> get_activity_coefficient_pitzer(5.6153*ureg.Quantity('mol/kg'),5.6153*ureg.Quantity('mol/kg'),3,0.5,0.0369993,0.354664,0.0997513,-0.00171868,1,-1,1,1,b=1.2)
373
+ 0.76331...
421
374
 
422
- NOTE: the examples below are for comparison with experimental and modeling data presented in
423
- the May et al reference below.
375
+ Notes: the examples below are for comparison with experimental and modeling data presented in
376
+ the May et al reference below.
424
377
 
425
- 10 mol/kg ammonium nitrate. Estimated result (from graph) = 0.2725
378
+ 10 mol/kg ammonium nitrate. Estimated result (from graph) = 0.2725
426
379
 
427
- >>> get_activity_coefficient_pitzer(10*ureg.Quantity('mol/kg'),10*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
428
- 0.22595 ...
380
+ >>> get_activity_coefficient_pitzer(10*ureg.Quantity('mol/kg'),10*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
381
+ 0.22595 ...
429
382
 
430
- 5 mol/kg ammonium nitrate. Estimated result (from graph) = 0.3011
383
+ 5 mol/kg ammonium nitrate. Estimated result (from graph) = 0.3011
431
384
 
432
- >>> get_activity_coefficient_pitzer(5*ureg.Quantity('mol/kg'),5*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
433
- 0.30249 ...
385
+ >>> get_activity_coefficient_pitzer(5*ureg.Quantity('mol/kg'),5*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
386
+ 0.30249 ...
434
387
 
435
- 18 mol/kg ammonium nitrate. Estimated result (from graph) = 0.1653
388
+ 18 mol/kg ammonium nitrate. Estimated result (from graph) = 0.1653
436
389
 
437
- >>> get_activity_coefficient_pitzer(18*ureg.Quantity('mol/kg'),18*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
438
- 0.16241 ...
390
+ >>> get_activity_coefficient_pitzer(18*ureg.Quantity('mol/kg'),18*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
391
+ 0.16241 ...
439
392
 
440
- References
441
- ----------
442
- Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly
443
- Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
444
- /Journal of Chemical& Engineering Data (57), p. 1637-1647.
393
+ References:
394
+ Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly
395
+ Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
396
+ /Journal of Chemical& Engineering Data (57), p. 1637-1647.
445
397
 
446
- Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
447
- Journal of Chemical and Engineering Data, (2), 177-184.
398
+ Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
399
+ Journal of Chemical and Engineering Data, (2), 177-184.
448
400
 
449
- May, P. M., Rowland, D., Hefter, G., & Königsberger, E. (2011).
450
- A Generic and Updatable Pitzer Characterization of Aqueous Binary Electrolyte Solutions at 1 bar and 25 °C.
451
- Journal of Chemical & Engineering Data, 56(12), 5066-5077. doi:10.1021/je2009329
401
+ May, P. M., Rowland, D., Hefter, G., & Königsberger, E. (2011).
402
+ A Generic and Updatable Pitzer Characterization of Aqueous Binary Electrolyte Solutions at 1 bar and 25 °C.
403
+ Journal of Chemical & Engineering Data, 56(12), 5066-5077. doi:10.1021/je2009329
452
404
 
453
- Beyer, R., & Steiger, M. (2010). Vapor Pressure Measurements of NaHCOO + H 2 O and KHCOO + H 2 O from 278 to 308 K
454
- and Representation with an Ion Interaction (Pitzer) Model.
455
- Journal of Chemical & Engineering Data, 55(2), 830-838. doi:10.1021/je900487a
405
+ Beyer, R., & Steiger, M. (2010). Vapor Pressure Measurements of NaHCOO + H 2 O and KHCOO + H 2 O from 278 to 308 K
406
+ and Representation with an Ion Interaction (Pitzer) Model.
407
+ Journal of Chemical & Engineering Data, 55(2), 830-838. doi:10.1021/je900487a
456
408
 
457
409
  See Also:
458
- --------
459
- _debye_parameter_activity
460
- _pitzer_B_MX
461
- _pitzer_B_gamma
462
- _pitzer_B_phi
463
- _pitzer_log_gamma
464
-
465
-
410
+ :func:`_debye_parameter_activity`
411
+ :func:`_pitzer_B_MX`
412
+ :func:`_pitzer_B_phi`
413
+ :func:`_pitzer_log_gamma`
466
414
  """
467
415
  # assign proper units to alpha1, alpha2, and b
468
416
  alpha1 = ureg.Quantity(alpha1, "kg ** 0.5 / mol ** 0.5")
@@ -511,88 +459,63 @@ def get_apparent_volume_pitzer(
511
459
  """
512
460
  Return the apparent molar volume of solute in the parent solution according to the Pitzer model.
513
461
 
514
- Parameters
515
- ----------
516
- ionic_strength: Quantity
517
- The ionic strength of the parent solution, mol/kg
518
- molality: Quantity
519
- The molal concentration of the parent salt, mol/kg
520
- alpha1, alpha2: number
521
- Coefficients for the Pitzer model. This function assigns the coefficients
522
- proper units of kg ** 0.5 / mol ** 0.5 after they are entered.
523
- beta0, beta1, beta2, C_phi: number
524
- Pitzer coefficients for the apparent molar volume.
525
- These ion-interaction parameters are specific to each salt system.
526
- V_o: number
527
- The V^o Pitzer coefficient for the apparent molar volume.
528
- z_cation, z_anion: int
529
- The formal charge on the cation and anion, respectively
530
- nu_cation, nu_anion: int
531
- The stoichiometric coefficient of the cation and anion in the salt
532
- temperature: str Quantity
533
- String representing the temperature of the solution. Defaults to '25 degC' if not specified.
534
- b: number, optional
535
- Coefficient. Usually set equal to 1.2 and
536
- considered independent of temperature and pressure. If provided, this
537
- coefficient is assigned proper units of kg ** 0.5 / mol ** 0.5 after
538
- entry.
539
-
540
- Returns
541
- -------
542
- Quantity
543
- The apparent molar volume of the solute, cm ** 3 / mol
462
+ Args:
463
+ ionic_strength (Quantity): The ionic strength of the parent solution, mol/kg.
464
+ molality (Quantity): The molal concentration of the parent salt, mol/kg.
465
+ alpha1, alpha2 (number): Coefficients for the Pitzer model. This function assigns the coefficients proper units of kg ** 0.5 / mol ** 0.5 after they are entered.
466
+ beta0, beta1, beta2, C_phi (number): Pitzer coefficients for the apparent molar volume. These ion-interaction parameters are specific to each salt system.
467
+ V_o (number): The V^o Pitzer coefficient for the apparent molar volume.
468
+ z_cation, z_anion (int): The formal charge on the cation and anion, respectively.
469
+ nu_cation, nu_anion (int): The stoichiometric coefficient of the cation and anion in the salt.
470
+ temperature (str, Quantity): String representing the temperature of the solution. Defaults to '25 degC' if not specified.
471
+ b (number, optional): Coefficient. Usually set equal to 1.2 and considered independent of temperature and pressure. If provided, this coefficient is assigned proper units of kg ** 0.5 / mol ** 0.5 after entry.
544
472
 
545
- Examples:
546
- --------
547
- NOTE: the example below is for comparison with experimental and modeling data presented in
548
- the Krumgalz et al reference below.
473
+ Returns:
474
+ Quantity: The apparent molar volume of the solute, cm ** 3 / mol.
549
475
 
550
- 0.25 mol/kg CuSO4. Expected result (from graph) = 0.5 cm ** 3 / mol
476
+ Examples:
477
+ Notes: the example below is for comparison with experimental and modeling data presented in the Krumgalz et al reference below.
551
478
 
552
- >>> get_apparent_volume_pitzer(1.0*ureg.Quantity('mol/kg'),0.25*ureg.Quantity('mol/kg'),1.4,12,0.001499,-0.008124,0.2203,-0.0002589,-6,2,-2,1,1,b=1.2)
553
- 0.404...
479
+ 0.25 mol/kg CuSO4. Expected result (from graph) = 0.5 cm ** 3 / mol
554
480
 
555
- 1.0 mol/kg CuSO4. Expected result (from graph) = 4 cm ** 3 / mol
481
+ >>> get_apparent_volume_pitzer(1.0*ureg.Quantity('mol/kg'),0.25*ureg.Quantity('mol/kg'),1.4,12,0.001499,-0.008124,0.2203,-0.0002589,-6,2,-2,1,1,b=1.2)
482
+ 0.404...
556
483
 
557
- >>> get_apparent_volume_pitzer(4.0*ureg.Quantity('mol/kg'),1.0*ureg.Quantity('mol/kg'),1.4,12,0.001499,-0.008124,0.2203,-0.0002589,-6,2,-2,1,1,b=1.2)
558
- 4.424...
484
+ 1.0 mol/kg CuSO4. Expected result (from graph) = 4 cm ** 3 / mol
559
485
 
560
- 10.0 mol/kg ammonium nitrate. Expected result (from graph) = 50.3 cm ** 3 / mol
486
+ >>> get_apparent_volume_pitzer(4.0*ureg.Quantity('mol/kg'),1.0*ureg.Quantity('mol/kg'),1.4,12,0.001499,-0.008124,0.2203,-0.0002589,-6,2,-2,1,1,b=1.2)
487
+ 4.424...
561
488
 
562
- >>> get_apparent_volume_pitzer(10.0*ureg.Quantity('mol/kg'),10.0*ureg.Quantity('mol/kg'),2,0,0.000001742,0.0002926,0,0.000000424,46.9,1,-1,1,1,b=1.2)
563
- 50.286...
489
+ 10.0 mol/kg ammonium nitrate. Expected result (from graph) = 50.3 cm ** 3 / mol
564
490
 
565
- 20.0 mol/kg ammonium nitrate. Expected result (from graph) = 51.2 cm ** 3 / mol
491
+ >>> get_apparent_volume_pitzer(10.0*ureg.Quantity('mol/kg'),10.0*ureg.Quantity('mol/kg'),2,0,0.000001742,0.0002926,0,0.000000424,46.9,1,-1,1,1,b=1.2)
492
+ 50.286...
566
493
 
567
- >>> get_apparent_volume_pitzer(20.0*ureg.Quantity('mol/kg'),20.0*ureg.Quantity('mol/kg'),2,0,0.000001742,0.0002926,0,0.000000424,46.9,1,-1,1,1,b=1.2)
568
- 51.145...
494
+ 20.0 mol/kg ammonium nitrate. Expected result (from graph) = 51.2 cm ** 3 / mol
569
495
 
570
- NOTE: the examples below are for comparison with experimental and modeling data presented in
571
- the Krumgalz et al reference below.
496
+ >>> get_apparent_volume_pitzer(20.0*ureg.Quantity('mol/kg'),20.0*ureg.Quantity('mol/kg'),2,0,0.000001742,0.0002926,0,0.000000424,46.9,1,-1,1,1,b=1.2)
497
+ 51.145...
572
498
 
573
- 0.8 mol/kg NaF. Expected result = 0.03
499
+ Notes: the examples below are for comparison with experimental and modeling data presented in the Krumgalz et al reference below.
574
500
 
575
- >>> get_apparent_volume_pitzer(0.8*ureg.Quantity('mol/kg'),0.8*ureg.Quantity('mol/kg'),2,0,0.000024693,0.00003169,0,-0.000004068,-2.426,1,-1,1,1,b=1.2)
576
- 0.22595 ...
501
+ 0.8 mol/kg NaF. Expected result = 0.03
577
502
 
503
+ >>> get_apparent_volume_pitzer(0.8*ureg.Quantity('mol/kg'),0.8*ureg.Quantity('mol/kg'),2,0,0.000024693,0.00003169,0,-0.000004068,-2.426,1,-1,1,1,b=1.2)
504
+ 0.22595 ...
578
505
 
579
- References
580
- ----------
581
- May, P. M., Rowland, D., Hefter, G., & Königsberger, E. (2011).
582
- A Generic and Updatable Pitzer Characterization of Aqueous Binary Electrolyte Solutions at 1 bar and 25 °C.
583
- Journal of Chemical & Engineering Data, 56(12), 5066-5077. doi:10.1021/je2009329
506
+ References:
507
+ May, P. M., Rowland, D., Hefter, G., & Königsberger, E. (2011).
508
+ A Generic and Updatable Pitzer Characterization of Aqueous Binary Electrolyte Solutions at 1 bar and 25 °C.
509
+ Journal of Chemical & Engineering Data, 56(12), 5066-5077. doi:10.1021/je2009329
584
510
 
585
- Krumgalz, Boris S., Pogorelsky, Rita (1996).
586
- Volumetric Properties of Single Aqueous Electrolytes from Zero to Saturation Concentration at 298.15 K
587
- Represented by Pitzer's Ion-Interaction Equations.
588
- Journal of Physical Chemical Reference Data, 25(2), 663-689.
511
+ Krumgalz, Boris S., Pogorelsky, Rita (1996).
512
+ Volumetric Properties of Single Aqueous Electrolytes from Zero to Saturation Concentration at 298.15 K
513
+ Represented by Pitzer's Ion-Interaction Equations.
514
+ Journal of Physical Chemical Reference Data, 25(2), 663-689.
589
515
 
590
516
  See Also:
591
- --------
592
- _debye_parameter_volume
593
- _pitzer_B_MX
594
-
595
-
517
+ :func:`_debye_parameter_volume`
518
+ :func:`_pitzer_B_MX`
596
519
  """
597
520
  # TODO - find a cleaner way to make sure coefficients are assigned the proper units
598
521
  # if they aren't, the calculation gives very wrong results
@@ -626,20 +549,18 @@ def get_apparent_volume_pitzer(
626
549
 
627
550
 
628
551
  def _pitzer_f1(x):
629
- """
552
+ r"""
630
553
  The function of ionic strength used to calculate \beta_MX in the Pitzer ion interaction model.
631
554
 
632
- .. math:: f(x) = 2 [ 1- (1+x) \\exp(-x)] / x ^ 2
555
+ .. math:: f(x) = 2 [ 1- (1+x) \exp(-x)] / x ^ 2
633
556
 
634
- References
635
- ----------
636
- Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly
637
- Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
638
- /Journal of Chemical& Engineering Data (57), p. 1637-1647.
639
-
640
- Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
641
- Journal of Chemical and Engineering Data, (2), 177-184.
557
+ References:
558
+ Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly
559
+ Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
560
+ /Journal of Chemical& Engineering Data (57), p. 1637-1647.
642
561
 
562
+ Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
563
+ Journal of Chemical and Engineering Data, (2), 177-184.
643
564
  """
644
565
  # return 0 if the input is 0
645
566
  if x == 0:
@@ -648,20 +569,18 @@ def _pitzer_f1(x):
648
569
 
649
570
 
650
571
  def _pitzer_f2(x):
651
- """
652
- The function of ionic strength used to calculate \\beta_\\gamma in the Pitzer ion interaction model.
653
-
654
- .. math:: f(x) = -{2 \\over x ^ 2} [ 1 - ({1+x+ x^2 \\over 2}) \\exp(-x)]
572
+ r"""
573
+ The function of ionic strength used to calculate \beta_\gamma in the Pitzer ion interaction model.
655
574
 
656
- References
657
- ----------
658
- Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly
659
- Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
660
- /Journal of Chemical& Engineering Data (57), p. 1637-1647.
575
+ .. math:: f(x) = -\frac{2}{x ^ 2} [ 1 - (\frac{1+x+ x^2}{2}) \exp(-x)]
661
576
 
662
- Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
663
- Journal of Chemical and Engineering Data, (2), 177-184.
577
+ References:
578
+ Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly
579
+ Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
580
+ /Journal of Chemical& Engineering Data (57), p. 1637-1647.
664
581
 
582
+ Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
583
+ Journal of Chemical and Engineering Data, (2), 177-184.
665
584
  """
666
585
  # return 0 if the input is 0
667
586
  if x == 0:
@@ -670,38 +589,30 @@ def _pitzer_f2(x):
670
589
 
671
590
 
672
591
  def _pitzer_B_MX(ionic_strength, alpha1, alpha2, beta0, beta1, beta2):
673
- """
592
+ r"""
674
593
  Return the B_MX coefficient for the Pitzer ion interaction model.
675
594
 
676
- .. math:: B_MX = \\beta_0 + \\beta_1 f1(\\alpha_1 I ^ {0.5}) + \\beta_2 f2(\\alpha_2 I ^ {0.5})
595
+ .. math:: B_MX = \beta_0 + \beta_1 f1(\alpha_1 I ^ {0.5}) + \beta_2 f2(\alpha_2 I ^ {0.5})
677
596
 
678
- Parameters
679
- ----------
680
- ionic_strength: number
681
- The ionic strength of the parent solution, mol/kg
682
- alpha1, alpha2: number
683
- Coefficients for the Pitzer model, kg ** 0.5 / mol ** 0.5
684
- beta0, beta1, beta2: number
685
- Coefficients for the Pitzer model. These ion-interaction parameters are
686
- specific to each salt system.
597
+ Args:
598
+ ionic_strength: The ionic strength of the parent solution, mol/kg
599
+ alpha1, alpha2: Coefficients for the Pitzer model, kg ** 0.5 / mol ** 0.5
600
+ beta0, beta1, beta2: Coefficients for the Pitzer model. These ion-interaction parameters are
601
+ specific to each salt system.
687
602
 
688
- Returns
689
- -------
690
- float
691
- The B_MX parameter for the Pitzer ion interaction model.
603
+ Returns:
604
+ The B_MX parameter for the Pitzer ion interaction model.
692
605
 
693
- References
694
- ----------
695
- Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly
696
- Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
697
- /Journal of Chemical& Engineering Data (57), p. 1637-1647.
606
+ References:
607
+ Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly
608
+ Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
609
+ /Journal of Chemical& Engineering Data (57), p. 1637-1647.
698
610
 
699
- Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
700
- Journal of Chemical and Engineering Data, (2), 177-184.
611
+ Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
612
+ Journal of Chemical and Engineering Data, (2), 177-184.
701
613
 
702
614
  See Also:
703
- --------
704
- _pitzer_f1
615
+ :func:`_pitzer_f1`
705
616
 
706
617
  """
707
618
  coeff = (
@@ -750,43 +661,37 @@ def _pitzer_B_MX(ionic_strength, alpha1, alpha2, beta0, beta1, beta2):
750
661
 
751
662
 
752
663
  def _pitzer_B_phi(ionic_strength, alpha1, alpha2, beta0, beta1, beta2):
753
- """
754
- Return the B^\\Phi coefficient for the Pitzer ion interaction model.
664
+ r"""
665
+ Returns the B^\Phi coefficient for the Pitzer ion interaction model.
755
666
 
756
- .. math:: B^\\Phi = \\beta_0 + \\beta1 \\exp(-\\alpha_1 I ^{0.5}) + \\beta_2 \\exp(-\\alpha_2 I ^ {0.5})
667
+ This function calculates the B^\Phi coefficient using the formula:
757
668
 
758
- or
669
+ .. math:: B^\Phi = \beta_0 + \beta1 \exp(-\alpha_1 I ^{0.5}) + \beta_2 \exp(-\alpha_2 I ^ {0.5})
759
670
 
760
- .. math:: B^\\Phi = B^\\gamma - B_{MX}
671
+ or
761
672
 
762
- Parameters
763
- ----------
764
- ionic_strength: number
765
- The ionic strength of the parent solution, mol/kg
766
- alpha1, alpha2: number
767
- Coefficients for the Pitzer model, kg ** 0.5 / mol ** 0.5
768
- beta0, beta1, beta2: number
769
- Coefficients for the Pitzer model. These ion-interaction parameters are
770
- specific to each salt system.
673
+ .. math:: B^\Phi = B^\gamma - B_{MX}
771
674
 
772
- Returns
773
- -------
774
- float
775
- The B^Phi parameter for the Pitzer ion interaction model.
675
+ Args:
676
+ ionic_strength: The ionic strength of the parent solution, mol/kg.
677
+ alpha1, alpha2: Coefficients for the Pitzer model, kg ** 0.5 / mol ** 0.5.
678
+ beta0, beta1, beta2: Coefficients for the Pitzer model. These ion-interaction parameters are
679
+ specific to each salt system.
776
680
 
777
- References
778
- ----------
779
- Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly
780
- Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
781
- /Journal of Chemical& Engineering Data (57), p. 1637-1647.
681
+ Returns:
682
+ float: The B^Phi parameter for the Pitzer ion interaction model.
782
683
 
783
- Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
784
- Journal of Chemical and Engineering Data, (2), 177-184.
684
+ References:
685
+ Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly
686
+ Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
687
+ /Journal of Chemical& Engineering Data (57), p. 1637-1647.
785
688
 
786
- Beyer, R., & Steiger, M. (2010). Vapor Pressure Measurements of NaHCOO + H 2 O and KHCOO + H 2 O from 278 to 308 K
787
- and Representation with an Ion Interaction (Pitzer) Model.
788
- Journal of Chemical & Engineering Data, 55(2), 830-838. doi:10.1021/je900487a
689
+ Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
690
+ Journal of Chemical and Engineering Data, (2), 177-184.
789
691
 
692
+ Beyer, R., & Steiger, M. (2010). Vapor Pressure Measurements of NaHCOO + H 2 O and KHCOO + H 2 O from 278 to 308 K
693
+ and Representation with an Ion Interaction (Pitzer) Model.
694
+ Journal of Chemical & Engineering Data, 55(2), 830-838. doi:10.1021/je900487a
790
695
  """
791
696
  return beta0 + beta1 * math.exp(-alpha1 * ionic_strength**0.5) + beta2 * math.exp(-alpha2 * ionic_strength**0.5)
792
697
 
@@ -837,45 +742,32 @@ def _pitzer_log_gamma(
837
742
  temperature="25 degC",
838
743
  b=ureg.Quantity(1.2, "kg**0.5/mol**0.5"),
839
744
  ):
840
- """
841
- Return the natural logarithm of the binary activity coefficient calculated by the Pitzer
745
+ r"""
746
+ Returns the natural logarithm of the binary activity coefficient calculated by the Pitzer
842
747
  ion interaction model.
843
748
 
844
- .. math:: \\ln \\gamma_{MX} = -{|z_+ z_-| A^{Phi} ( I ^ {0.5} \\over (1 + b I ^ {0.5})} + {2 \\over b }\\ln (1 + b I ^ {0.5}) )+\
845
- + {m (2 \\nu_+ \\nu_-) \\over (\\nu_+ + \\nu_-)} (B_{MX} + B_{MX}^\\Phi) + {m^2(3 (\\nu_+ \\nu_-)^{1.5} \\over (\\nu_+ + \\nu_-))} C_{MX}^\\Phi
846
-
847
-
848
- Parameters
849
- ----------
850
- ionic_strength: Quantity
851
- The ionic strength of the parent solution, mol/kg
852
- molality: Quantity
853
- The concentration of the salt, mol/kg
854
- B_MX,B_phi,C_phi: Quantity
855
- Calculated parameters for the Pitzer ion interaction model.
856
- z_cation, z_anion: int
857
- The formal charge on the cation and anion, respectively
858
- nu_cation, nu_anion: int
859
- The stoichiometric coefficient of the cation and anion in the salt
860
- temperature: str Quantity
861
- String representing the temperature of the solution. Defaults to '25 degC' if not specified.
862
- b: number, optional
863
- Coefficient. Usually set equal to 1.2 kg ** 0.5 / mol ** 0.5 and considered independent of temperature and pressure
864
-
865
- Returns
866
- -------
867
- float
868
- The natural logarithm of the binary activity coefficient calculated by the Pitzer ion interaction model.
869
-
870
- References
871
- ----------
872
- Kim, H., & Jr, W. F. (1988).
873
- Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
874
- Journal of Chemical and Engineering Data, (2), 177-184.
875
-
876
- May, P. M., Rowland, D., Hefter, G., & Königsberger, E. (2011).
877
- A Generic and Updatable Pitzer Characterization of Aqueous Binary Electrolyte Solutions at 1 bar and 25 °C.
878
- Journal of Chemical & Engineering Data, 56(12), 5066-5077. doi:10.1021/je2009329
749
+ .. math::
750
+
751
+ \ln \gamma_{MX} = -|z_+ z_-| A^{Phi} ( \frac{I ^ {0.5}}{(1 + b I ^ {0.5})} + \frac{2}{b} \ln{(1 + b I ^ {0.5})} )+ \frac{m (2 \nu_+ \nu_-)}{(\nu_+ + \nu_-)} (B_{MX} + B_{MX}^\Phi) + \frac{m^2(3 (\nu_+ \nu_-)^{1.5}}{(\nu_+ + \nu_-))} C_{MX}^\Phi
752
+
753
+ Args:
754
+ ionic_strength (Quantity): The ionic strength of the parent solution, mol/kg.
755
+ molality (Quantity): The concentration of the salt, mol/kg.
756
+ B_MX, B_phi, C_phi (Quantity): Calculated parameters for the Pitzer ion interaction model.
757
+ z_cation, z_anion (int): The formal charge on the cation and anion, respectively.
758
+ nu_cation, nu_anion (int): The stoichiometric coefficient of the cation and anion in the salt.
759
+ temperature (str, Quantity): String representing the temperature of the solution. Defaults to '25 degC' if not specified.
760
+ b (number, optional): Coefficient. Usually set equal to 1.2 kg ** 0.5 / mol ** 0.5 and considered independent of temperature and pressure.
761
+
762
+ Returns:
763
+ float: The natural logarithm of the binary activity coefficient calculated by the Pitzer ion interaction model.
764
+
765
+ References:
766
+ Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
767
+ Journal of Chemical and Engineering Data, (2), 177-184.
768
+
769
+ May, P. M., Rowland, D., Hefter, G., & Königsberger, E. (2011). A Generic and Updatable Pitzer Characterization of Aqueous Binary Electrolyte Solutions at 1 bar and 25 °C.
770
+ Journal of Chemical & Engineering Data, 56(12), 5066-5077. doi:10.1021/je2009329
879
771
  """
880
772
  first_term = (
881
773
  -1
@@ -905,93 +797,68 @@ def get_osmotic_coefficient_pitzer(
905
797
  temperature="25 degC",
906
798
  b=1.2,
907
799
  ):
908
- """Return the osmotic coefficient of water in an electrolyte solution according to the Pitzer model.
909
-
910
- Parameters
911
- ----------
912
- ionic_strength: Quantity
913
- The ionic strength of the parent solution, mol/kg
914
- molality: Quantity
915
- The molal concentration of the parent salt, mol/kg
916
- alpha1, alpha2: number
917
- Coefficients for the Pitzer model. This function assigns the coefficients
918
- proper units of kg ** 0.5 / mol ** 0.5 after they are entered.
919
- beta0, beta1, beta2, C_phi
920
- Coefficients for the Pitzer model. These ion-interaction parameters are
921
- specific to each salt system.
922
- z_cation, z_anion: int
923
- The formal charge on the cation and anion, respectively
924
- nu_cation, nu_anion: int
925
- The stoichiometric coefficient of the cation and anion in the salt
926
- temperature: str Quantity
927
- String representing the temperature of the solution. Defaults to '25 degC' if not specified.
928
- b: number, optional
929
- Coefficient. Usually set equal to 1.2 and
930
- considered independent of temperature and pressure. If provided, this
931
- coefficient is assigned proper units of kg ** 0.5 / mol ** 0.5 after
932
- entry.
933
-
934
- Returns
935
- -------
936
- Quantity
937
- The osmotic coefficient of water, dimensionless
800
+ """
801
+ Return the osmotic coefficient of water in an electrolyte solution according to the Pitzer model.
938
802
 
939
- Examples:
940
- --------
941
- Experimental value according to Beyer and Stieger reference is 1.3550
803
+ Args:
804
+ ionic_strength (Quantity): The ionic strength of the parent solution, mol/kg.
805
+ molality (Quantity): The molal concentration of the parent salt, mol/kg.
806
+ alpha1, alpha2 (number): Coefficients for the Pitzer model. This function assigns the coefficients proper units of kg ** 0.5 / mol ** 0.5 after they are entered.
807
+ beta0, beta1, beta2, C_phi: Coefficients for the Pitzer model. These ion-interaction parameters are specific to each salt system.
808
+ z_cation, z_anion (int): The formal charge on the cation and anion, respectively.
809
+ nu_cation, nu_anion (int): The stoichiometric coefficient of the cation and anion in the salt.
810
+ temperature (str, Quantity): String representing the temperature of the solution. Defaults to '25 degC' if not specified.
811
+ b (number, optional): Coefficient. Usually set equal to 1.2 and considered independent of temperature and pressure. If provided, this coefficient is assigned proper units of kg ** 0.5 / mol ** 0.5 after entry.
942
812
 
943
- >>> get_osmotic_coefficient_pitzer(10.175*ureg.Quantity('mol/kg'),10.175*ureg.Quantity('mol/kg'),1,0.5,-.0181191983,-.4625822071,.4682,.000246063,1,-1,1,1,b=1.2)
944
- 1.3552 ...
813
+ Returns:
814
+ Quantity: The osmotic coefficient of water, dimensionless.
945
815
 
946
- Experimental value according to Beyer and Stieger reference is 1.084
816
+ Examples:
817
+ Experimental value according to Beyer and Stieger reference is 1.3550
947
818
 
948
- >>> get_osmotic_coefficient_pitzer(5.6153*ureg.Quantity('mol/kg'),5.6153*ureg.Quantity('mol/kg'),3,0.5,0.0369993,0.354664,0.0997513,-0.00171868,1,-1,1,1,b=1.2)
949
- 1.0850 ...
819
+ >>> get_osmotic_coefficient_pitzer(10.175*ureg.Quantity('mol/kg'),10.175*ureg.Quantity('mol/kg'),1,0.5,-.0181191983,-.4625822071,.4682,.000246063,1,-1,1,1,b=1.2)
820
+ 1.3552 ...
950
821
 
951
- NOTE: the examples below are for comparison with experimental and modeling data presented in
952
- the May et al reference below.
822
+ Experimental value according to Beyer and Stieger reference is 1.084
953
823
 
954
- 10 mol/kg ammonium nitrate. Estimated result (from graph) = 0.62
824
+ >>> get_osmotic_coefficient_pitzer(5.6153*ureg.Quantity('mol/kg'),5.6153*ureg.Quantity('mol/kg'),3,0.5,0.0369993,0.354664,0.0997513,-0.00171868,1,-1,1,1,b=1.2)
825
+ 1.0850 ...
955
826
 
956
- >>> get_osmotic_coefficient_pitzer(10*ureg.Quantity('mol/kg'),10*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
957
- 0.6143 ...
827
+ Notes: the examples below are for comparison with experimental and modeling data presented in the May et al reference below.
958
828
 
959
- 5 mol/kg ammonium nitrate. Estimated result (from graph) = 0.7
829
+ 10 mol/kg ammonium nitrate. Estimated result (from graph) = 0.62
960
830
 
961
- >>> get_osmotic_coefficient_pitzer(5*ureg.Quantity('mol/kg'),5*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
962
- 0.6925 ...
831
+ >>> get_osmotic_coefficient_pitzer(10*ureg.Quantity('mol/kg'),10*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
832
+ 0.6143 ...
963
833
 
964
- 18 mol/kg ammonium nitrate. Estimated result (from graph) = 0.555
834
+ 5 mol/kg ammonium nitrate. Estimated result (from graph) = 0.7
965
835
 
966
- >>> get_osmotic_coefficient_pitzer(18*ureg.Quantity('mol/kg'),18*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
967
- 0.5556 ...
836
+ >>> get_osmotic_coefficient_pitzer(5*ureg.Quantity('mol/kg'),5*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
837
+ 0.6925 ...
968
838
 
969
- References
970
- ----------
971
- Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly
972
- Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
973
- /Journal of Chemical& Engineering Data (57), p. 1637-1647.
839
+ 18 mol/kg ammonium nitrate. Estimated result (from graph) = 0.555
974
840
 
975
- Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
976
- Journal of Chemical and Engineering Data, (2), 177-184.
841
+ >>> get_osmotic_coefficient_pitzer(18*ureg.Quantity('mol/kg'),18*ureg.Quantity('mol/kg'),2,0,-0.01709,0.09198,0,0.000419,1,-1,1,1,b=1.2)
842
+ 0.5556 ...
977
843
 
978
- May, P. M., Rowland, D., Hefter, G., & Königsberger, E. (2011).
979
- A Generic and Updatable Pitzer Characterization of Aqueous Binary Electrolyte Solutions at 1 bar and 25 °C.
980
- Journal of Chemical & Engineering Data, 56(12), 5066-5077. doi:10.1021/je2009329
844
+ References:
845
+ Scharge, T., Munoz, A.G., and Moog, H.C. (2012). Activity Coefficients of Fission Products in Highly Salinary Solutions of Na+, K+, Mg2+, Ca2+, Cl-, and SO42- : Cs+.
846
+ /Journal of Chemical& Engineering Data (57), p. 1637-1647.
981
847
 
982
- Beyer, R., & Steiger, M. (2010). Vapor Pressure Measurements of NaHCOO + H 2 O and KHCOO + H 2 O from 278 to 308 K
983
- and Representation with an Ion Interaction (Pitzer) Model.
984
- Journal of Chemical & Engineering Data, 55(2), 830-838. doi:10.1021/je900487a
848
+ Kim, H., & Jr, W. F. (1988). Evaluation of Pitzer ion interaction parameters of aqueous electrolytes at 25 degree C. 1. Single salt parameters.
849
+ Journal of Chemical and Engineering Data, (2), 177-184.
985
850
 
986
- See Also:
987
- --------
988
- _debye_parameter_activity
989
- _pitzer_B_MX
990
- _pitzer_B_gamma
991
- _pitzer_B_phi
992
- _pitzer_log_gamma
851
+ May, P. M., Rowland, D., Hefter, G., & Königsberger, E. (2011). A Generic and Updatable Pitzer Characterization of Aqueous Binary Electrolyte Solutions at 1 bar and 25 °C.
852
+ Journal of Chemical & Engineering Data, 56(12), 5066-5077. doi:10.1021/je2009329
993
853
 
854
+ Beyer, R., & Steiger, M. (2010). Vapor Pressure Measurements of NaHCOO + H 2 O and KHCOO + H 2 O from 278 to 308 K and Representation with an Ion Interaction (Pitzer) Model.
855
+ Journal of Chemical & Engineering Data, 55(2), 830-838. doi:10.1021/je900487a
994
856
 
857
+ See Also:
858
+ :func:`_debye_parameter_activity`
859
+ :func:`_pitzer_B_MX`
860
+ :func:`_pitzer_B_phi`
861
+ :func:`_pitzer_log_gamma`
995
862
  """
996
863
  # assign proper units to alpha1, alpha2, and b
997
864
  alpha1 = ureg.Quantity(alpha1, "kg ** 0.5 / mol ** 0.5")