Cantera 2.6.0
DebyeHuckel.h
Go to the documentation of this file.
1/**
2 * @file DebyeHuckel.h
3 * Headers for the DebyeHuckel ThermoPhase object, which models dilute
4 * electrolyte solutions
5 * (see \ref thermoprops and \link Cantera::DebyeHuckel DebyeHuckel \endlink) .
6 *
7 * Class DebyeHuckel represents a dilute liquid electrolyte phase which
8 * obeys the Debye Huckel formulation for nonideality.
9 */
10
11// This file is part of Cantera. See License.txt in the top-level directory or
12// at https://cantera.org/license.txt for license and copyright information.
13
14#ifndef CT_DEBYEHUCKEL_H
15#define CT_DEBYEHUCKEL_H
16
17#include "MolalityVPSSTP.h"
18#include "cantera/base/Array.h"
19
20namespace Cantera
21{
22
23/*!
24 * @name Formats for the Activity Coefficients
25 *
26 * These are possible formats for the molality-based activity coefficients.
27 */
28//! @{
29#define DHFORM_DILUTE_LIMIT 0
30#define DHFORM_BDOT_AK 1
31#define DHFORM_BDOT_ACOMMON 2
32#define DHFORM_BETAIJ 3
33#define DHFORM_PITZER_BETAIJ 4
34//! @}
35/*!
36 * @name Acceptable ways to calculate the value of A_Debye
37 */
38//! @{
39#define A_DEBYE_CONST 0
40#define A_DEBYE_WATER 1
41//! @}
42
43class WaterProps;
44class PDSS_Water;
45
46/**
47 * @ingroup thermoprops
48 *
49 * Class DebyeHuckel represents a dilute liquid electrolyte phase which obeys
50 * the Debye Huckel formulation for nonideality.
51 *
52 * The concentrations of the ionic species are assumed to obey the
53 * electroneutrality condition.
54 *
55 * ## Specification of Species Standard State Properties
56 *
57 * The standard states are on the unit molality basis. Therefore, in the
58 * documentation below, the normal \f$ o \f$ superscript is replaced with the
59 * \f$ \triangle \f$ symbol. The reference state symbol is now
60 * \f$ \triangle, ref \f$.
61 *
62 * It is assumed that the reference state thermodynamics may be obtained by a
63 * pointer to a populated species thermodynamic property manager class (see
64 * ThermoPhase::m_spthermo). How to relate pressure changes to the reference
65 * state thermodynamics is resolved at this level.
66 *
67 * For an incompressible, stoichiometric substance, the molar internal energy is
68 * independent of pressure. Since the thermodynamic properties are specified by
69 * giving the standard-state enthalpy, the term \f$ P_0 \hat v\f$ is subtracted
70 * from the specified molar enthalpy to compute the molar internal energy. The
71 * entropy is assumed to be independent of the pressure.
72 *
73 * The enthalpy function is given by the following relation.
74 *
75 * \f[
76 * h^\triangle_k(T,P) = h^{\triangle,ref}_k(T)
77 * + \tilde v \left( P - P_{ref} \right)
78 * \f]
79 *
80 * For an incompressible, stoichiometric substance, the molar internal energy is
81 * independent of pressure. Since the thermodynamic properties are specified by
82 * giving the standard-state enthalpy, the term \f$ P_{ref} \tilde v\f$ is
83 * subtracted from the specified reference molar enthalpy to compute the molar
84 * internal energy.
85 *
86 * \f[
87 * u^\triangle_k(T,P) = h^{\triangle,ref}_k(T) - P_{ref} \tilde v
88 * \f]
89 *
90 * The standard state heat capacity and entropy are independent of pressure. The
91 * standard state Gibbs free energy is obtained from the enthalpy and entropy
92 * functions.
93 *
94 * The current model assumes that an incompressible molar volume for all
95 * solutes. The molar volume for the water solvent, however, is obtained from a
96 * pure water equation of state, waterSS. Therefore, the water standard state
97 * varies with both T and P. It is an error to request standard state water
98 * properties at a T and P where the water phase is not a stable phase, that is,
99 * beyond its spinodal curve.
100 *
101 * ## Specification of Solution Thermodynamic Properties
102 *
103 * Chemical potentials of the solutes, \f$ \mu_k \f$, and the solvent, \f$ \mu_o
104 * \f$, which are based on the molality form, have the following general format:
105 *
106 * \f[
107 * \mu_k = \mu^{\triangle}_k(T,P) + R T ln(\gamma_k^{\triangle} \frac{m_k}{m^\triangle})
108 * \f]
109 * \f[
110 * \mu_o = \mu^o_o(T,P) + RT ln(a_o)
111 * \f]
112 *
113 * where \f$ \gamma_k^{\triangle} \f$ is the molality based activity coefficient
114 * for species \f$k\f$.
115 *
116 * Individual activity coefficients of ions can not be independently measured.
117 * Instead, only binary pairs forming electroneutral solutions can be measured.
118 *
119 * ### Ionic Strength
120 *
121 * Most of the parameterizations within the model use the ionic strength as a
122 * key variable. The ionic strength, \f$ I\f$ is defined as follows
123 *
124 * \f[
125 * I = \frac{1}{2} \sum_k{m_k z_k^2}
126 * \f]
127 *
128 * \f$ m_k \f$ is the molality of the kth species. \f$ z_k \f$ is the charge of
129 * the kth species. Note, the ionic strength is a defined units quantity. The
130 * molality has defined units of gmol kg-1, and therefore the ionic strength has
131 * units of sqrt( gmol kg-1).
132 *
133 * In some instances, from some authors, a different formulation is used for the
134 * ionic strength in the equations below. The different formulation is due to
135 * the possibility of the existence of weak acids and how association wrt to the
136 * weak acid equilibrium relation affects the calculation of the activity
137 * coefficients via the assumed value of the ionic strength.
138 *
139 * If we are to assume that the association reaction doesn't have an effect on
140 * the ionic strength, then we will want to consider the associated weak acid as
141 * in effect being fully dissociated, when we calculate an effective value for
142 * the ionic strength. We will call this calculated value, the stoichiometric
143 * ionic strength, \f$ I_s \f$, putting a subscript s to denote it from the more
144 * straightforward calculation of \f$ I \f$.
145 *
146 * \f[
147 * I_s = \frac{1}{2} \sum_k{m_k^s z_k^2}
148 * \f]
149 *
150 * Here, \f$ m_k^s \f$ is the value of the molalities calculated assuming that
151 * all weak acid-base pairs are in their fully dissociated states. This
152 * calculation may be simplified by considering that the weakly associated acid
153 * may be made up of two charged species, k1 and k2, each with their own
154 * charges, obeying the following relationship:
155 *
156 * \f[
157 * z_k = z_{k1} + z_{k2}
158 * \f]
159 * Then, we may only need to specify one charge value, say, \f$ z_{k1}\f$, the
160 * cation charge number, in order to get both numbers, since we have already
161 * specified \f$ z_k \f$ in the definition of original species. Then, the
162 * stoichiometric ionic strength may be calculated via the following formula.
163 *
164 * \f[
165 * I_s = \frac{1}{2} \left(\sum_{k,ions}{m_k z_k^2}+
166 * \sum_{k,weak_assoc}(m_k z_{k1}^2 + m_k z_{k2}^2) \right)
167 * \f]
168 *
169 * The specification of which species are weakly associated acids is made in the
170 * input file via the `stoichIsMods` XML block, where the charge for k1 is also
171 * specified. An example is given below:
172 *
173 * *Note: The XML input format is deprecated and will be removed in %Cantera 3.0*
174 *
175 * @code
176 * <stoichIsMods>
177 * NaCl(aq):-1.0
178 * </stoichIsMods>
179 * @endcode
180 *
181 * Because we need the concept of a weakly associated acid in order to calculate
182 * \f$ I_s \f$ we need to catalog all species in the phase. This is done using
183 * the following categories:
184 *
185 * - `cEST_solvent` Solvent species (neutral)
186 * - `cEST_chargedSpecies` Charged species (charged)
187 * - `cEST_weakAcidAssociated` Species which can break apart into charged species.
188 * It may or may not be charged. These may or
189 * may not be be included in the
190 * species solution vector.
191 * - `cEST_strongAcidAssociated` Species which always breaks apart into charged species.
192 * It may or may not be charged. Normally, these aren't included
193 * in the speciation vector.
194 * - `cEST_polarNeutral` Polar neutral species
195 * - `cEST_nonpolarNeutral` Non polar neutral species
196 *
197 * Polar and non-polar neutral species are differentiated, because some
198 * additions to the activity coefficient expressions distinguish between these
199 * two types of solutes. This is the so-called salt-out effect.
200 *
201 * The type of species is specified in the `electrolyteSpeciesType` XML block.
202 * Note, this is not considered a part of the specification of the standard
203 * state for the species, at this time. Therefore, this information is put under
204 * the `activityCoefficient` XML block. An example is given below
205 *
206 * *Note: The XML input format is deprecated and will be removed in %Cantera 3.0*
207 *
208 * @code
209 * <electrolyteSpeciesType>
210 * H2L(L):solvent
211 * H+:chargedSpecies
212 * NaOH(aq):weakAcidAssociated
213 * NaCl(aq):strongAcidAssociated
214 * NH3(aq):polarNeutral
215 * O2(aq):nonpolarNeutral
216 * </electrolyteSpeciesType>
217 * @endcode
218 *
219 * Much of the species electrolyte type information is inferred from other
220 * information in the input file. For example, as species which is charged is
221 * given the "chargedSpecies" default category. A neutral solute species is put
222 * into the "nonpolarNeutral" category by default.
223 *
224 * The specification of solute activity coefficients depends on the model
225 * assumed for the Debye-Huckel term. The model is set by the internal parameter
226 * #m_formDH. We will now describe each category in its own section.
227 *
228 * ### Debye-Huckel Dilute Limit
229 *
230 * DHFORM_DILUTE_LIMIT = 0
231 *
232 * This form assumes a dilute limit to DH, and is mainly for informational purposes:
233 * \f[
234 * \ln(\gamma_k^\triangle) = - z_k^2 A_{Debye} \sqrt{I}
235 * \f]
236 * where \f$ I\f$ is the ionic strength
237 * \f[
238 * I = \frac{1}{2} \sum_k{m_k z_k^2}
239 * \f]
240 *
241 * The activity for the solvent water,\f$ a_o \f$, is not independent and must
242 * be determined from the Gibbs-Duhem relation.
243 *
244 * \f[
245 * \ln(a_o) = \frac{X_o - 1.0}{X_o} + \frac{ 2 A_{Debye} \tilde{M}_o}{3} (I)^{3/2}
246 * \f]
247 *
248 * ### Bdot Formulation
249 *
250 * DHFORM_BDOT_AK = 1
251 *
252 * This form assumes Bethke's format for the Debye Huckel activity coefficient:
253 *
254 * \f[
255 * \ln(\gamma_k^\triangle) = -z_k^2 \frac{A_{Debye} \sqrt{I}}{ 1 + B_{Debye} a_k \sqrt{I}}
256 * + \log(10) B^{dot}_k I
257 * \f]
258 *
259 * Note, this particular form where \f$ a_k \f$ can differ in multielectrolyte
260 * solutions has problems with respect to a Gibbs-Duhem analysis. However, we
261 * include it here because there is a lot of data fit to it.
262 *
263 * The activity for the solvent water,\f$ a_o \f$, is not independent and must
264 * be determined from the Gibbs-Duhem relation. Here, we use:
265 *
266 * \f[
267 * \ln(a_o) = \frac{X_o - 1.0}{X_o}
268 * + \frac{ 2 A_{Debye} \tilde{M}_o}{3} (I)^{1/2}
269 * \left[ \sum_k{\frac{1}{2} m_k z_k^2 \sigma( B_{Debye} a_k \sqrt{I} ) } \right]
270 * - \frac{\log(10)}{2} \tilde{M}_o I \sum_k{ B^{dot}_k m_k}
271 * \f]
272 * where
273 * \f[
274 * \sigma (y) = \frac{3}{y^3} \left[ (1+y) - 2 \ln(1 + y) - \frac{1}{1+y} \right]
275 * \f]
276 *
277 * Additionally, Helgeson's formulation for the water activity is offered as an
278 * alternative.
279 *
280 * ### Bdot Formulation with Uniform Size Parameter in the Denominator
281 *
282 * DHFORM_BDOT_AUNIFORM = 2
283 *
284 * This form assumes Bethke's format for the Debye-Huckel activity coefficient
285 *
286 * \f[
287 * \ln(\gamma_k^\triangle) = -z_k^2 \frac{A_{Debye} \sqrt{I}}{ 1 + B_{Debye} a \sqrt{I}}
288 * + \log(10) B^{dot}_k I
289 * \f]
290 *
291 * The value of a is determined at the beginning of the calculation, and not changed.
292 *
293 * \f[
294 * \ln(a_o) = \frac{X_o - 1.0}{X_o}
295 * + \frac{ 2 A_{Debye} \tilde{M}_o}{3} (I)^{3/2} \sigma( B_{Debye} a \sqrt{I} )
296 * - \frac{\log(10)}{2} \tilde{M}_o I \sum_k{ B^{dot}_k m_k}
297 * \f]
298 *
299 * ### Beta_IJ formulation
300 *
301 * DHFORM_BETAIJ = 3
302 *
303 * This form assumes a linear expansion in a virial coefficient form. It is used
304 * extensively in the book by Newmann, "Electrochemistry Systems", and is the
305 * beginning of more complex treatments for stronger electrolytes, fom Pitzer
306 * and from Harvey, Moller, and Weire.
307 *
308 * \f[
309 * \ln(\gamma_k^\triangle) = -z_k^2 \frac{A_{Debye} \sqrt{I}}{ 1 + B_{Debye} a \sqrt{I}}
310 * + 2 \sum_j \beta_{j,k} m_j
311 * \f]
312 *
313 * In the current treatment the binary interaction coefficients, \f$
314 * \beta_{j,k}\f$, are independent of temperature and pressure.
315 *
316 * \f[
317 * \ln(a_o) = \frac{X_o - 1.0}{X_o}
318 * + \frac{ 2 A_{Debye} \tilde{M}_o}{3} (I)^{3/2} \sigma( B_{Debye} a \sqrt{I} )
319 * - \tilde{M}_o \sum_j \sum_k \beta_{j,k} m_j m_k
320 * \f]
321 *
322 * In this formulation the ionic radius, \f$ a \f$, is a constant. This must be
323 * supplied to the model, in an <DFN> ionicRadius </DFN> XML block.
324 *
325 * The \f$ \beta_{j,k} \f$ parameters are binary interaction parameters. They
326 * are supplied to the object in an `DHBetaMatrix` XML block. There are in
327 * principle \f$ N (N-1) /2 \f$ different, symmetric interaction parameters,
328 * where \f$ N \f$ are the number of solute species in the mechanism. An example
329 * is given below.
330 *
331 * An example `activityCoefficients` XML block for this formulation is supplied
332 * below
333 *
334 * *Note: The XML input format is deprecated and will be removed in %Cantera 3.0*
335 *
336 * @code
337 * <activityCoefficients model="Beta_ij">
338 * <!-- A_Debye units = sqrt(kg/gmol) -->
339 * <A_Debye> 1.172576 </A_Debye>
340 * <!-- B_Debye units = sqrt(kg/gmol)/m -->
341 * <B_Debye> 3.28640E9 </B_Debye>
342 * <ionicRadius default="3.042843" units="Angstroms">
343 * </ionicRadius>
344 * <DHBetaMatrix>
345 * H+:Cl-:0.27
346 * Na+:Cl-:0.15
347 * Na+:OH-:0.06
348 * </DHBetaMatrix>
349 * <stoichIsMods>
350 * NaCl(aq):-1.0
351 * </stoichIsMods>
352 * <electrolyteSpeciesType>
353 * H+:chargedSpecies
354 * NaCl(aq):weakAcidAssociated
355 * </electrolyteSpeciesType>
356 * </activityCoefficients>
357 * @endcode
358 *
359 * ### Pitzer Beta_IJ formulation
360 *
361 * DHFORM_PITZER_BETAIJ = 4
362 *
363 * This form assumes an activity coefficient formulation consistent with a
364 * truncated form of Pitzer's formulation. Pitzer's formulation is equivalent to
365 * the formulations above in the dilute limit, where rigorous theory may be
366 * applied.
367 *
368 * \f[
369 * \ln(\gamma_k^\triangle) = -z_k^2 \frac{A_{Debye}}{3} \frac{\sqrt{I}}{ 1 + B_{Debye} a \sqrt{I}}
370 * -2 z_k^2 \frac{A_{Debye}}{3} \frac{\ln(1 + B_{Debye} a \sqrt{I})}{ B_{Debye} a}
371 * + 2 \sum_j \beta_{j,k} m_j
372 * \f]
373 * \f[
374 * \ln(a_o) = \frac{X_o - 1.0}{X_o}
375 * + \frac{ 2 A_{Debye} \tilde{M}_o}{3} \frac{(I)^{3/2} }{1 + B_{Debye} a \sqrt{I} }
376 * - \tilde{M}_o \sum_j \sum_k \beta_{j,k} m_j m_k
377 * \f]
378 *
379 * ### Specification of the Debye Huckel Constants
380 *
381 * In the equations above, the formulas for \f$ A_{Debye} \f$ and \f$
382 * B_{Debye} \f$ are needed. The DebyeHuckel object uses two methods for
383 * specifying these quantities. The default method is to assume that \f$
384 * A_{Debye} \f$ is a constant, given in the initialization process, and stored
385 * in the member double, m_A_Debye. Optionally, a full water treatment may be
386 * employed that makes \f$ A_{Debye} \f$ a full function of *T* and *P*.
387 *
388 * \f[
389 * A_{Debye} = \frac{F e B_{Debye}}{8 \pi \epsilon R T} {\left( C_o \tilde{M}_o \right)}^{1/2}
390 * \f]
391 * where
392 * \f[
393 * B_{Debye} = \frac{F} {{(\frac{\epsilon R T}{2})}^{1/2}}
394 * \f]
395 * Therefore:
396 * \f[
397 * A_{Debye} = \frac{1}{8 \pi}
398 * {\left(\frac{2 N_a \rho_o}{1000}\right)}^{1/2}
399 * {\left(\frac{N_a e^2}{\epsilon R T }\right)}^{3/2}
400 * \f]
401 * where
402 * - \f$ N_a \f$ is Avogadro's number
403 * - \f$ \rho_w \f$ is the density of water
404 * - \f$ e \f$ is the electronic charge
405 * - \f$ \epsilon = K \epsilon_o \f$ is the permittivity of water
406 * - \f$ K \f$ is the dielectric constant of water
407 * - \f$ \epsilon_o \f$ is the permittivity of free space
408 * - \f$ \rho_o \f$ is the density of the solvent in its standard state.
409 *
410 * Nominal value at 298 K and 1 atm = 1.172576 (kg/gmol)^(1/2) based on:
411 * - \f$ \epsilon / \epsilon_0 \f$ = 78.54 (water at 25C)
412 * - T = 298.15 K
413 * - B_Debye = 3.28640E9 (kg/gmol)^(1/2) / m
414 *
415 * An example of a fixed value implementation is given below.
416 *
417 * *Note: The XML input format is deprecated and will be removed in %Cantera 3.0*
418 *
419 * @code
420 * <activityCoefficients model="Beta_ij">
421 * <!-- A_Debye units = sqrt(kg/gmol) -->
422 * <A_Debye> 1.172576 </A_Debye>
423 * <!-- B_Debye units = sqrt(kg/gmol)/m -->
424 * <B_Debye> 3.28640E9 </B_Debye>
425 * </activityCoefficients>
426 * @endcode
427 *
428 * An example of a variable value implementation is given below.
429 * @code
430 * <activityCoefficients model="Beta_ij">
431 * <A_Debye model="water" />
432 * <!-- B_Debye units = sqrt(kg/gmol)/m -->
433 * <B_Debye> 3.28640E9 </B_Debye>
434 * </activityCoefficients>
435 * @endcode
436 *
437 * Currently, \f$ B_{Debye} \f$ is a constant in the model, specified either by
438 * a default water value, or through the input file. This may have to be looked
439 * at, in the future.
440 *
441 * ## %Application within Kinetics Managers
442 *
443 * For the time being, we have set the standard concentration for all species in
444 * this phase equal to the default concentration of the solvent at 298 K and 1
445 * atm. This means that the kinetics operator essentially works on an activities
446 * basis, with units specified as if it were on a concentration basis.
447 *
448 * For example, a bulk-phase binary reaction between liquid species j and k,
449 * producing a new liquid species l would have the following equation for its
450 * rate of progress variable, \f$ R^1 \f$, which has units of kmol m-3 s-1.
451 *
452 * \f[
453 * R^1 = k^1 C_j^a C_k^a = k^1 (C_o a_j) (C_o a_k)
454 * \f]
455 * where
456 * \f[
457 * C_j^a = C_o a_j \quad and \quad C_k^a = C_o a_k
458 * \f]
459 *
460 * \f$ C_j^a \f$ is the activity concentration of species j, and
461 * \f$ C_k^a \f$ is the activity concentration of species k. \f$ C_o \f$
462 * is the concentration of water at 298 K and 1 atm. \f$ a_j \f$ is the activity
463 * of species j at the current temperature and pressure and concentration of the
464 * liquid phase. \f$k^1 \f$ has units of m3 kmol-1 s-1.
465 *
466 * The reverse rate constant can then be obtained from the law of microscopic
467 * reversibility and the equilibrium expression for the system.
468 *
469 * \f[
470 * \frac{a_j a_k}{ a_l} = K^{o,1} = \exp(\frac{\mu^o_l - \mu^o_j - \mu^o_k}{R T} )
471 * \f]
472 *
473 * \f$ K^{o,1} \f$ is the dimensionless form of the equilibrium constant.
474 *
475 * \f[
476 * R^{-1} = k^{-1} C_l^a = k^{-1} (C_o a_l)
477 * \f]
478 * where
479 * \f[
480 * k^{-1} = k^1 K^{o,1} C_o
481 * \f]
482 *
483 * \f$k^{-1} \f$ has units of s-1.
484 *
485 * Note, this treatment may be modified in the future, as events dictate.
486 *
487 * ## XML Example
488 *
489 * *Note: The XML input format is deprecated and will be removed in %Cantera 3.0*
490 *
491 * The phase model name for this is called StoichSubstance. It must be supplied
492 * as the model attribute of the thermo XML element entry. Within the phase XML
493 * block, the density of the phase must be specified. An example of an XML file
494 * this phase is given below.
495 *
496 * @code
497 * <phase id="NaCl_electrolyte" dim="3">
498 * <speciesArray datasrc="#species_waterSolution">
499 * H2O(L) Na+ Cl- H+ OH- NaCl(aq) NaOH(aq)
500 * </speciesArray>
501 * <state>
502 * <temperature units="K"> 300 </temperature>
503 * <pressure units="Pa">101325.0</pressure>
504 * <soluteMolalities>
505 * Na+:3.0
506 * Cl-:3.0
507 * H+:1.0499E-8
508 * OH-:1.3765E-6
509 * NaCl(aq):0.98492
510 * NaOH(aq):3.8836E-6
511 * </soluteMolalities>
512 * </state>
513 * <!-- thermo model identifies the inherited class
514 * from ThermoPhase that will handle the thermodynamics.
515 * -->
516 * <thermo model="DebyeHuckel">
517 * <standardConc model="solvent_volume" />
518 * <activityCoefficients model="Beta_ij">
519 * <!-- A_Debye units = sqrt(kg/gmol) -->
520 * <A_Debye> 1.172576 </A_Debye>
521 * <!-- B_Debye units = sqrt(kg/gmol)/m -->
522 * <B_Debye> 3.28640E9 </B_Debye>
523 * <ionicRadius default="3.042843" units="Angstroms">
524 * </ionicRadius>
525 * <DHBetaMatrix>
526 * H+:Cl-:0.27
527 * Na+:Cl-:0.15
528 * Na+:OH-:0.06
529 * </DHBetaMatrix>
530 * <stoichIsMods>
531 * NaCl(aq):-1.0
532 * </stoichIsMods>
533 * <electrolyteSpeciesType>
534 * H+:chargedSpecies
535 * NaCl(aq):weakAcidAssociated
536 * </electrolyteSpeciesType>
537 * </activityCoefficients>
538 * <solvent> H2O(L) </solvent>
539 * </thermo>
540 * <elementArray datasrc="elements.xml"> O H Na Cl </elementArray>
541 * </phase>
542 * @endcode
543 */
545{
546public:
547 virtual ~DebyeHuckel();
548
549 //! Full constructor for creating the phase.
550 /*!
551 * @param inputFile File name containing the definition of the phase.
552 * If blank, an empty phase will be created.
553 * @param id id attribute containing the name of the phase.
554 */
555 explicit DebyeHuckel(const std::string& inputFile="",
556 const std::string& id="");
557
558 //! Full constructor for creating the phase.
559 /*!
560 * @param phaseRef XML phase node containing the description of the phase
561 * @param id id attribute containing the name of the phase.
562 *
563 * @deprecated The XML input format is deprecated and will be removed in
564 * Cantera 3.0.
565 */
566 DebyeHuckel(XML_Node& phaseRef, const std::string& id = "");
567
568 //! @name Utilities
569 //! @{
570
571 virtual std::string type() const {
572 return "DebyeHuckel";
573 }
574
575 //! @}
576 //! @name Molar Thermodynamic Properties of the Solution
577 //! @{
578
579 virtual doublereal enthalpy_mole() const;
580
581 /// Molar entropy. Units: J/kmol/K.
582 /**
583 * For an ideal, constant partial molar volume solution mixture with
584 * pure species phases which exhibit zero volume expansivity:
585 * \f[
586 * \hat s(T, P, X_k) = \sum_k X_k \hat s^0_k(T)
587 * - \hat R \sum_k X_k log(X_k)
588 * \f]
589 * The reference-state pure-species entropies
590 * \f$ \hat s^0_k(T,p_{ref}) \f$ are computed by the
591 * species thermodynamic
592 * property manager. The pure species entropies are independent of
593 * temperature since the volume expansivities are equal to zero.
594 * @see MultiSpeciesThermo
595 */
596 virtual doublereal entropy_mole() const;
597
598 virtual doublereal gibbs_mole() const;
599 virtual doublereal cp_mole() const;
600
601 //! @}
602 /** @name Mechanical Equation of State Properties
603 * In this equation of state implementation, the density is a function only
604 * of the mole fractions. Therefore, it can't be an independent variable.
605 * Instead, the pressure is used as the independent variable. Functions
606 * which try to set the thermodynamic state by calling setDensity() will
607 * cause an exception to be thrown.
608 * @{
609 */
610
611protected:
612 virtual void calcDensity();
613
614public:
615 /**
616 * @}
617 * @name Activities, Standard States, and Activity Concentrations
618 *
619 * The activity \f$a_k\f$ of a species in solution is related to the
620 * chemical potential by \f[ \mu_k = \mu_k^0(T) + \hat R T \log a_k. \f] The
621 * quantity \f$\mu_k^0(T,P)\f$ is the chemical potential at unit activity,
622 * which depends only on temperature and the pressure. Activity is assumed
623 * to be molality-based here.
624 * @{
625 */
626
627 virtual void getActivityConcentrations(doublereal* c) const;
628
629 //! Return the standard concentration for the kth species
630 /*!
631 * The standard concentration \f$ C^0_k \f$ used to normalize the activity
632 * (that is, generalized) concentration in kinetics calculations.
633 *
634 * For the time being, we will use the concentration of pure solvent for the
635 * the standard concentration of all species. This has the effect of making
636 * reaction rates based on the molality of species proportional to the
637 * molality of the species.
638 *
639 * @param k Optional parameter indicating the species. The default is to
640 * assume this refers to species 0.
641 * @return the standard Concentration in units of m^3/kmol
642 */
643 virtual doublereal standardConcentration(size_t k=0) const;
644
645 //! Get the array of non-dimensional activities at the current solution
646 //! temperature, pressure, and solution concentration.
647 /*!
648 * (note solvent activity coefficient is on molar scale).
649 *
650 * @param ac Output vector of activities. Length: m_kk.
651 */
652 virtual void getActivities(doublereal* ac) const;
653
654 //! Get the array of non-dimensional molality-based activity coefficients at
655 //! the current solution temperature, pressure, and solution concentration.
656 /*!
657 * note solvent is on molar scale. The solvent molar based activity
658 * coefficient is returned.
659 *
660 * Note, most of the work is done in an internal private routine
661 *
662 * @param acMolality Vector of Molality-based activity coefficients
663 * Length: m_kk
664 */
665 virtual void getMolalityActivityCoefficients(doublereal* acMolality) const;
666
667 //! @}
668 //! @name Partial Molar Properties of the Solution
669 //! @{
670
671 //! Get the species chemical potentials. Units: J/kmol.
672 /*!
673 *
674 * This function returns a vector of chemical potentials of the species in
675 * solution.
676 *
677 * \f[
678 * \mu_k = \mu^{\triangle}_k(T,P) + R T ln(\gamma_k^{\triangle} m_k)
679 * \f]
680 *
681 * @param mu Output vector of species chemical
682 * potentials. Length: m_kk. Units: J/kmol
683 */
684 virtual void getChemPotentials(doublereal* mu) const;
685
686 //! Returns an array of partial molar enthalpies for the species
687 //! in the mixture. Units (J/kmol)
688 /*!
689 * For this phase, the partial molar enthalpies are equal to the
690 * standard state enthalpies modified by the derivative of the
691 * molality-based activity coefficient wrt temperature
692 *
693 * \f[
694 * \bar h_k(T,P) = h^{\triangle}_k(T,P) - R T^2 \frac{d \ln(\gamma_k^\triangle)}{dT}
695 * \f]
696 * The solvent partial molar enthalpy is equal to
697 * \f[
698 * \bar h_o(T,P) = h^{o}_o(T,P) - R T^2 \frac{d \ln(a_o}{dT}
699 * \f]
700 *
701 * The temperature dependence of the activity coefficients currently
702 * only occurs through the temperature dependence of the Debye constant.
703 *
704 * @param hbar Output vector of species partial molar enthalpies.
705 * Length: m_kk. units are J/kmol.
706 */
707 virtual void getPartialMolarEnthalpies(doublereal* hbar) const;
708
709 //! Returns an array of partial molar entropies of the species in the
710 //! solution. Units: J/kmol/K.
711 /**
712 * Maxwell's equations provide an insight in how to calculate this
713 * (p.215 Smith and Van Ness)
714 * \f[
715 * \frac{d\mu_i}{dT} = -\bar{s}_i
716 * \f]
717 *
718 * For this phase, the partial molar entropies are equal to the SS species
719 * entropies plus the ideal solution contribution:
720 * \f[
721 * \bar s_k(T,P) = \hat s^0_k(T) - R log(M0 * molality[k])
722 * \f]
723 * \f[
724 * \bar s_{solvent}(T,P) = \hat s^0_{solvent}(T)
725 * - R ((xmolSolvent - 1.0) / xmolSolvent)
726 * \f]
727 *
728 * The reference-state pure-species entropies,\f$ \hat s^0_k(T) \f$, at the
729 * reference pressure, \f$ P_{ref} \f$, are computed by the species
730 * thermodynamic property manager. They are polynomial functions of
731 * temperature.
732 * @see MultiSpeciesThermo
733 *
734 * @param sbar Output vector of species partial molar entropies.
735 * Length = m_kk. units are J/kmol/K.
736 */
737 virtual void getPartialMolarEntropies(doublereal* sbar) const;
738
739 virtual void getPartialMolarCp(doublereal* cpbar) const;
740
741 //! Return an array of partial molar volumes for the species in the mixture.
742 //! Units: m^3/kmol.
743 /*!
744 * For this solution, the partial molar volumes are normally equal to the
745 * constant species molar volumes, except when the activity coefficients
746 * depend on pressure.
747 *
748 * The general relation is
749 *
750 * vbar_i = d(chemPot_i)/dP at const T, n
751 * = V0_i + d(Gex)/dP)_T,M
752 * = V0_i + RT d(lnActCoeffi)dP _T,M
753 *
754 * @param vbar Output vector of species partial molar volumes.
755 * Length = m_kk. units are m^3/kmol.
756 */
757 virtual void getPartialMolarVolumes(doublereal* vbar) const;
758
759 //! @}
760
761 /*
762 * -------------- Utilities -------------------------------
763 */
764
765 virtual bool addSpecies(shared_ptr<Species> spec);
766 virtual void initThermo();
767 virtual void getParameters(AnyMap& phaseNode) const;
768 virtual void getSpeciesParameters(const std::string& name,
769 AnyMap& speciesNode) const;
770 virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
771
772 //! Return the Debye Huckel constant as a function of temperature
773 //! and pressure (Units = sqrt(kg/gmol))
774 /*!
775 * The default is to assume that it is constant, given in the
776 * initialization process, and stored in the member double, m_A_Debye.
777 * Optionally, a full water treatment may be employed that makes
778 * \f$ A_{Debye} \f$ a full function of T and P.
779 *
780 * \f[
781 * A_{Debye} = \frac{F e B_{Debye}}{8 \pi \epsilon R T} {\left( C_o \tilde{M}_o \right)}^{1/2}
782 * \f]
783 * where
784 * \f[
785 * B_{Debye} = \frac{F} {{(\frac{\epsilon R T}{2})}^{1/2}}
786 * \f]
787 * Therefore:
788 * \f[
789 * A_{Debye} = \frac{1}{8 \pi}
790 * {\left(\frac{2 N_a \rho_o}{1000}\right)}^{1/2}
791 * {\left(\frac{N_a e^2}{\epsilon R T }\right)}^{3/2}
792 * \f]
793 *
794 * where
795 * - Units = sqrt(kg/gmol)
796 * - \f$ N_a \f$ is Avogadro's number
797 * - \f$ \rho_w \f$ is the density of water
798 * - \f$ e \f$ is the electronic charge
799 * - \f$ \epsilon = K \epsilon_o \f$ is the permittivity of water
800 * - \f$ K \f$ is the dielectric constant of water,
801 * - \f$ \epsilon_o \f$ is the permittivity of free space.
802 * - \f$ \rho_o \f$ is the density of the solvent in its standard state.
803 *
804 * Nominal value at 298 K and 1 atm = 1.172576 (kg/gmol)^(1/2)
805 * based on:
806 * - \f$ \epsilon / \epsilon_0 \f$ = 78.54 (water at 25C)
807 * - T = 298.15 K
808 * - B_Debye = 3.28640E9 (kg/gmol)^(1/2)/m
809 *
810 * @param temperature Temperature in kelvin. Defaults to -1, in which
811 * case the temperature of the phase is assumed.
812 * @param pressure Pressure (Pa). Defaults to -1, in which
813 * case the pressure of the phase is assumed.
814 */
815 virtual double A_Debye_TP(double temperature = -1.0,
816 double pressure = -1.0) const;
817
818 //! Value of the derivative of the Debye Huckel constant with
819 //! respect to temperature.
820 /*!
821 * This is a function of temperature and pressure. See A_Debye_TP() for
822 * a definition of \f$ A_{Debye} \f$.
823 *
824 * Units = sqrt(kg/gmol) K-1
825 *
826 * @param temperature Temperature in kelvin. Defaults to -1, in which
827 * case the temperature of the phase is assumed.
828 * @param pressure Pressure (Pa). Defaults to -1, in which
829 * case the pressure of the phase is assumed.
830 */
831 virtual double dA_DebyedT_TP(double temperature = -1.0,
832 double pressure = -1.0) const;
833
834 //! Value of the 2nd derivative of the Debye Huckel constant with
835 //! respect to temperature as a function of temperature and pressure.
836 /*!
837 * This is a function of temperature and pressure. See A_Debye_TP() for
838 * a definition of \f$ A_{Debye} \f$.
839 *
840 * Units = sqrt(kg/gmol) K-2
841 *
842 * @param temperature Temperature in kelvin. Defaults to -1, in which
843 * case the temperature of the phase is assumed.
844 * @param pressure Pressure (Pa). Defaults to -1, in which
845 * case the pressure of the phase is assumed.
846 */
847 virtual double d2A_DebyedT2_TP(double temperature = -1.0,
848 double pressure = -1.0) const;
849
850 //! Value of the derivative of the Debye Huckel constant with
851 //! respect to pressure, as a function of temperature and pressure.
852 /*!
853 * This is a function of temperature and pressure. See A_Debye_TP() for
854 * a definition of \f$ A_{Debye} \f$.
855 *
856 * Units = sqrt(kg/gmol) Pa-1
857 *
858 * @param temperature Temperature in kelvin. Defaults to -1, in which
859 * case the temperature of the phase is assumed.
860 * @param pressure Pressure (Pa). Defaults to -1, in which
861 * case the pressure of the phase is assumed.
862 */
863 virtual double dA_DebyedP_TP(double temperature = -1.0,
864 double pressure = -1.0) const;
865
866 //! Reports the ionic radius of the kth species
867 /*!
868 * @param k species index.
869 */
870 double AionicRadius(int k = 0) const;
871
872 //! Set the DebyeHuckel parameterization form. Must be one of
873 //! 'dilute-limit', 'B-dot-with-variable-a', 'B-dot-with-common-a',
874 //! 'beta_ij', or 'Pitzer-with-beta_ij'.
875 void setDebyeHuckelModel(const std::string& form);
876
877 //! Returns the form of the Debye-Huckel parameterization used
878 int formDH() const {
879 return m_formDH;
880 }
881
882 //! Set the A_Debye parameter. If a negative value is provided, enables
883 //! calculation of A_Debye using the detailed water equation of state.
884 void setA_Debye(double A);
885
886 void setB_Debye(double B) { m_B_Debye = B; }
887 void setB_dot(double bdot);
888 void setMaxIonicStrength(double Imax) { m_maxIionicStrength = Imax; }
889 void useHelgesonFixedForm(bool mode=true) { m_useHelgesonFixedForm = mode; }
890
891 //! Set the default ionic radius [m] for each species
892 void setDefaultIonicRadius(double value);
893
894 //! Set the value for the beta interaction between species sp1 and sp2.
895 void setBeta(const std::string& sp1, const std::string& sp2, double value);
896
897 //! Returns a reference to M_Beta_ij
899 return m_Beta_ij;
900 }
901
902private:
903 //! Static function that implements the non-polar species salt-out
904 //! modifications.
905 /*!
906 * Returns the calculated activity coefficients.
907 *
908 * @param IionicMolality Value of the ionic molality (sqrt(gmol/kg))
909 */
910 static double _nonpolarActCoeff(double IionicMolality);
911
912 //! Formula for the osmotic coefficient that occurs in the GWB.
913 /*!
914 * It is originally from Helgeson for a variable NaCl brine. It's to be
915 * used with extreme caution.
916 */
917 double _osmoticCoeffHelgesonFixedForm() const;
918
919 //! Formula for the log of the water activity that occurs in the GWB.
920 /*!
921 * It is originally from Helgeson for a variable NaCl brine. It's to be
922 * used with extreme caution.
923 */
925
926protected:
927 //! form of the Debye-Huckel parameterization used in the model.
928 /*!
929 * The options are described at the top of this document,
930 * and in the general documentation.
931 * The list is repeated here:
932 *
933 * DHFORM_DILUTE_LIMIT = 0 (default)
934 * DHFORM_BDOT_AK = 1
935 * DHFORM_BDOT_AUNIFORM = 2
936 * DHFORM_BETAIJ = 3
937 * DHFORM_PITZER_BETAIJ = 4
938 */
940
941 //! Vector containing the electrolyte species type
942 /*!
943 * The possible types are:
944 * - solvent
945 * - Charged Species
946 * - weakAcidAssociated
947 * - strongAcidAssociated
948 * - polarNeutral
949 * - nonpolarNeutral
950 * .
951 */
953
954 //! a_k = Size of the ionic species in the DH formulation. units = meters
956
957 //! Default ionic radius for species where it is not specified
959
960 //! Current value of the ionic strength on the molality scale
961 mutable double m_IionicMolality;
962
963 //! Maximum value of the ionic strength allowed in the calculation of the
964 //! activity coefficients.
966
967public:
968 //! If true, then the fixed for of Helgeson's activity for water is used
969 //! instead of the rigorous form obtained from Gibbs-Duhem relation. This
970 //! should be used with caution, and is really only included as a validation
971 //! exercise.
973protected:
974 //! Stoichiometric ionic strength on the molality scale
976
977public:
978 /**
979 * Form of the constant outside the Debye-Huckel term
980 * called A. It's normally a function of temperature
981 * and pressure. However, it can be set from the
982 * input file in order to aid in numerical comparisons.
983 * Acceptable forms:
984 *
985 * A_DEBYE_CONST 0
986 * A_DEBYE_WATER 1
987 *
988 * The A_DEBYE_WATER form may be used for water solvents
989 * with needs to cover varying temperatures and pressures.
990 * Note, the dielectric constant of water is a relatively
991 * strong function of T, and its variability must be
992 * accounted for,
993 */
995
996protected:
997 //! Current value of the Debye Constant, A_Debye
998 /**
999 * A_Debye -> this expression appears on the top of the ln actCoeff term in
1000 * the general Debye-Huckel expression It depends on temperature
1001 * and pressure.
1002 *
1003 * A_Debye = (F e B_Debye) / (8 Pi epsilon R T)
1004 *
1005 * Units = sqrt(kg/gmol)
1006 *
1007 * Nominal value(298K, atm) = 1.172576 sqrt(kg/gmol)
1008 * based on:
1009 * epsilon/epsilon_0 = 78.54
1010 * (water at 25C)
1011 * T = 298.15 K
1012 * B_Debye = 3.28640E9 sqrt(kg/gmol)/m
1013 *
1014 * note in Pitzer's nomenclature, A_phi = A_Debye/3.0
1015 */
1016 mutable double m_A_Debye;
1017
1018 //! Current value of the constant that appears in the denominator
1019 /**
1020 * B_Debye -> this expression appears on the bottom of the ln actCoeff term
1021 * in the general Debye-Huckel expression It depends on
1022 * temperature
1023 *
1024 * B_Bebye = F / sqrt( epsilon R T / 2 )
1025 *
1026 * Units = sqrt(kg/gmol) / m
1027 *
1028 * Nominal value = 3.28640E9 sqrt(kg/gmol) / m
1029 * based on:
1030 * epsilon/epsilon_0 = 78.54
1031 * (water at 25C)
1032 * T = 298.15 K
1033 */
1035
1036 //! Array of B_Dot values
1037 /**
1038 * This expression is an extension of the Debye-Huckel expression used
1039 * in some formulations to extend DH to higher molalities. B_dot is
1040 * specific to the major ionic pair.
1041 */
1043
1044 //! Pointer to the Water standard state object
1045 /*!
1046 * derived from the equation of state for water.
1047 */
1049
1050 //! Storage for the density of water's standard state
1051 /*!
1052 * Density depends on temperature and pressure.
1053 */
1055
1056 //! Pointer to the water property calculator
1057 std::unique_ptr<WaterProps> m_waterProps;
1058
1059 //! vector of size m_kk, used as a temporary holding area.
1061
1062 /**
1063 * Stoichiometric species charge -> This is for calculations
1064 * of the ionic strength which ignore ion-ion pairing into
1065 * neutral molecules. The Stoichiometric species charge is the
1066 * charge of one of the ion that would occur if the species broke
1067 * into two charged ion pairs.
1068 * NaCl -> m_speciesCharge_Stoich = -1;
1069 * HSO4- -> H+ + SO42- = -2
1070 * -> The other charge is calculated.
1071 * For species that aren't ion pairs, it's equal to the
1072 * m_speciesCharge[] value.
1073 */
1075
1076 /**
1077 * Array of 2D data used in the DHFORM_BETAIJ formulation
1078 * Beta_ij.value(i,j) is the coefficient of the jth species
1079 * for the specification of the chemical potential of the ith
1080 * species.
1081 */
1083
1084 //! Logarithm of the activity coefficients on the molality scale.
1085 /*!
1086 * mutable because we change this if the composition or temperature or
1087 * pressure changes.
1088 */
1090
1091 //! Derivative of log act coeff wrt T
1093
1094 //! 2nd Derivative of log act coeff wrt T
1096
1097 //! Derivative of log act coeff wrt P
1099
1100private:
1101 //! Calculate the log activity coefficients
1102 /*!
1103 * This function updates the internally stored natural logarithm of the
1104 * molality activity coefficients. This is the main routine for
1105 * implementing the activity coefficient formulation.
1106 */
1107 void s_update_lnMolalityActCoeff() const;
1108
1109 //! Calculation of temperature derivative of activity coefficient
1110 /*!
1111 * Using internally stored values, this function calculates the temperature
1112 * derivative of the logarithm of the activity coefficient for all species
1113 * in the mechanism.
1114 *
1115 * We assume that the activity coefficients are current in this routine. The
1116 * solvent activity coefficient is on the molality scale. Its derivative is
1117 * too.
1118 */
1120
1121 //! Calculate the temperature 2nd derivative of the activity coefficient
1122 /*!
1123 * Using internally stored values, this function calculates the temperature
1124 * 2nd derivative of the logarithm of the activity coefficient for all
1125 * species in the mechanism.
1126 *
1127 * We assume that the activity coefficients are current in this routine.
1128 * Solvent activity coefficient is on the molality scale. Its derivatives
1129 * are too.
1130 */
1132
1133 //! Calculate the pressure derivative of the activity coefficient
1134 /*!
1135 * Using internally stored values, this function calculates the pressure
1136 * derivative of the logarithm of the activity coefficient for all species
1137 * in the mechanism.
1138 *
1139 * We assume that the activity coefficients, molalities, and A_Debye are
1140 * current. Solvent activity coefficient is on the molality scale. Its
1141 * derivatives are too.
1142 */
1144};
1145
1146}
1147
1148#endif
Header file for class Cantera::Array2D.
Header for intermediate ThermoPhase object for phases which employ molality based activity coefficien...
A map of string keys to values whose type can vary at runtime.
Definition: AnyMap.h:399
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Definition: Array.h:30
Class DebyeHuckel represents a dilute liquid electrolyte phase which obeys the Debye Huckel formulati...
Definition: DebyeHuckel.h:545
Array2D m_Beta_ij
Array of 2D data used in the DHFORM_BETAIJ formulation Beta_ij.value(i,j) is the coefficient of the j...
Definition: DebyeHuckel.h:1082
Array2D & get_Beta_ij()
Returns a reference to M_Beta_ij.
Definition: DebyeHuckel.h:898
int m_formDH
form of the Debye-Huckel parameterization used in the model.
Definition: DebyeHuckel.h:939
virtual bool addSpecies(shared_ptr< Species > spec)
double m_A_Debye
Current value of the Debye Constant, A_Debye.
Definition: DebyeHuckel.h:1016
virtual double d2A_DebyedT2_TP(double temperature=-1.0, double pressure=-1.0) const
Value of the 2nd derivative of the Debye Huckel constant with respect to temperature as a function of...
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
vector_fp m_d2lnActCoeffMolaldT2
2nd Derivative of log act coeff wrt T
Definition: DebyeHuckel.h:1095
double m_IionicMolality
Current value of the ionic strength on the molality scale.
Definition: DebyeHuckel.h:961
double _osmoticCoeffHelgesonFixedForm() const
Formula for the osmotic coefficient that occurs in the GWB.
double m_densWaterSS
Storage for the density of water's standard state.
Definition: DebyeHuckel.h:1054
void s_update_d2lnMolalityActCoeff_dT2() const
Calculate the temperature 2nd derivative of the activity coefficient.
vector_fp m_speciesCharge_Stoich
Stoichiometric species charge -> This is for calculations of the ionic strength which ignore ion-ion ...
Definition: DebyeHuckel.h:1074
int m_form_A_Debye
Form of the constant outside the Debye-Huckel term called A.
Definition: DebyeHuckel.h:994
bool m_useHelgesonFixedForm
If true, then the fixed for of Helgeson's activity for water is used instead of the rigorous form obt...
Definition: DebyeHuckel.h:972
static double _nonpolarActCoeff(double IionicMolality)
Static function that implements the non-polar species salt-out modifications.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
Definition: DebyeHuckel.cpp:93
virtual void getMolalityActivityCoefficients(doublereal *acMolality) const
Get the array of non-dimensional molality-based activity coefficients at the current solution tempera...
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
int formDH() const
Returns the form of the Debye-Huckel parameterization used.
Definition: DebyeHuckel.h:878
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
double m_B_Debye
Current value of the constant that appears in the denominator.
Definition: DebyeHuckel.h:1034
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
Definition: DebyeHuckel.cpp:75
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
double AionicRadius(int k=0) const
Reports the ionic radius of the kth species.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
void s_update_dlnMolalityActCoeff_dT() const
Calculation of temperature derivative of activity coefficient.
void s_update_lnMolalityActCoeff() const
Calculate the log activity coefficients.
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
void setBeta(const std::string &sp1, const std::string &sp2, double value)
Set the value for the beta interaction between species sp1 and sp2.
vector_fp m_dlnActCoeffMolaldP
Derivative of log act coeff wrt P.
Definition: DebyeHuckel.h:1098
void setDebyeHuckelModel(const std::string &form)
Set the DebyeHuckel parameterization form.
void setA_Debye(double A)
Set the A_Debye parameter.
vector_fp m_dlnActCoeffMolaldT
Derivative of log act coeff wrt T.
Definition: DebyeHuckel.h:1092
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
Definition: DebyeHuckel.cpp:81
vector_int m_electrolyteSpeciesType
Vector containing the electrolyte species type.
Definition: DebyeHuckel.h:952
virtual void initThermo()
double m_Aionic_default
Default ionic radius for species where it is not specified.
Definition: DebyeHuckel.h:958
vector_fp m_B_Dot
Array of B_Dot values.
Definition: DebyeHuckel.h:1042
virtual std::string type() const
String indicating the thermodynamic model implemented.
Definition: DebyeHuckel.h:571
double m_maxIionicStrength
Maximum value of the ionic strength allowed in the calculation of the activity coefficients.
Definition: DebyeHuckel.h:965
virtual doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
Definition: DebyeHuckel.cpp:87
DebyeHuckel(const std::string &inputFile="", const std::string &id="")
Full constructor for creating the phase.
Definition: DebyeHuckel.cpp:36
double _lnactivityWaterHelgesonFixedForm() const
Formula for the log of the water activity that occurs in the GWB.
vector_fp m_Aionic
a_k = Size of the ionic species in the DH formulation. units = meters
Definition: DebyeHuckel.h:955
virtual double dA_DebyedT_TP(double temperature=-1.0, double pressure=-1.0) const
Value of the derivative of the Debye Huckel constant with respect to temperature.
virtual void getSpeciesParameters(const std::string &name, AnyMap &speciesNode) const
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
void setDefaultIonicRadius(double value)
Set the default ionic radius [m] for each species.
void s_update_dlnMolalityActCoeff_dP() const
Calculate the pressure derivative of the activity coefficient.
PDSS_Water * m_waterSS
Pointer to the Water standard state object.
Definition: DebyeHuckel.h:1048
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
double m_IionicMolalityStoich
Stoichiometric ionic strength on the molality scale.
Definition: DebyeHuckel.h:975
std::unique_ptr< WaterProps > m_waterProps
Pointer to the water property calculator.
Definition: DebyeHuckel.h:1057
virtual void getActivities(doublereal *ac) const
Get the array of non-dimensional activities at the current solution temperature, pressure,...
vector_fp m_tmpV
vector of size m_kk, used as a temporary holding area.
Definition: DebyeHuckel.h:1060
vector_fp m_lnActCoeffMolal
Logarithm of the activity coefficients on the molality scale.
Definition: DebyeHuckel.h:1089
virtual double A_Debye_TP(double temperature=-1.0, double pressure=-1.0) const
Return the Debye Huckel constant as a function of temperature and pressure (Units = sqrt(kg/gmol))
virtual double dA_DebyedP_TP(double temperature=-1.0, double pressure=-1.0) const
Value of the derivative of the Debye Huckel constant with respect to pressure, as a function of tempe...
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
Class for the liquid water pressure dependent standard state.
Definition: PDSS_Water.h:50
std::string name() const
Return the name of the phase.
Definition: Phase.cpp:70
doublereal temperature() const
Temperature (K).
Definition: Phase.h:654
virtual doublereal pressure() const
Returns the current pressure of the phase.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:103
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
std::vector< int > vector_int
Vector of ints.
Definition: ct_defs.h:186
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:184