Functions Module¶
pyEQL functions that take Solution objects as inputs or return Solution objects
copyright: | 2013-2015 by Ryan S. Kingsbury |
---|---|
license: | LGPL, see LICENSE for more details. |
-
pyEQL.functions.
donnan_eql
(solution, fixed_charge)¶ Return a solution object in equilibrium with fixed_charge
Parameters: Solution : Solution object
The external solution to be brought into equilibrium with the fixed charges
fixed_charge : str quantity
String representing the concentration of fixed charges, including sign. May be specified in mol/L or mol/kg units. e.g. ‘1 mol/kg’
Returns: Solution
A solution that has established Donnan equilibrium with the external (input) Solution
See also
get_salt
Notes
The general equation representing the equilibrium between an external electrolyte solution and an ion-exchange medium containing fixed charges is:[1]
\[{a_- \over \bar a_-}^{1 \over z_-} {\bar a_+ \over a_+}^{1 \over z_+} = exp({\Delta \pi \bar V \over {RT z_+ \nu_+}})\]Where subscripts + and - indicate the cation and anion, respectively, the overbar indicates the membrane phase, a represents activity, z represents charge, nu represents the stoichiometric coefficient, V represents the partial molar volume of the salt, and delta pi is the difference in osmotic pressure between the membrane and the solution phase.
In addition, electroneutrality must prevail within the membrane phase:
\[\bar C_+ z_+ + \bar X + \bar C_- z_- = 0\]Where C represents concentration and X is the fixed charge concentration in the membrane or ion exchange phase.
This function solves these two equations simultaneously to arrive at the concentrations of the cation and anion in the membrane phase. It returns a solution equal to the input solution except that the concentrations of the predominant cation and anion have been adjusted according to this equilibrium.
NOTE that this treatment is only capable of equilibrating a single salt. This salt is identified by the get_salt() method.
References
[1] Strathmann, Heiner, ed. //Membrane Science and Technology// vol. 9, 2004. Chapter 2, p. 51. http://dx.doi.org/10.1016/S0927-5193(04)80033-0 Examples
TODO
-
pyEQL.functions.
entropy_mix
(Solution1, Solution2)¶ Return the ideal mixing entropy associated with mixing two solutions
Parameters: Solution1, Solution2 : Solution objects
The two solutions to be mixed.
Returns: float
The ideal mixing entropy associated with complete mixing of the Solutions, in Joules.
Notes
The ideal entropy of mixing is calculated as follows:[2]
\[\Delta_{mix} S = \sum_i (n_c + n_d) R T \ln x_b - \sum_i n_c R T \ln x_c - \sum_i n_d R T \ln x_d\]Where n is the number of moles of substance, T is the temperature in kelvin, and subscripts b, c, and refer to the concentrated, dilute, and blended Solutions, respectively.
Note that dissociated ions must be counted as separate components, so a simple salt dissolved in water is a three component solution (cation, anion, and water).
References
[2] Koga, Yoshikata, 2007. //Solution Thermodynamics and its Application to Aqueous Solutions: A differential approach.// Elsevier, 2007, pp. 23-37.
-
pyEQL.functions.
gibbs_mix
(Solution1, Solution2)¶ Return the Gibbs energy change associated with mixing two solutions
Parameters: Solution1, Solution2 : Solution objects
The two solutions to be mixed.
Returns: float
The change in Gibbs eneryg associated with complete mixing of the Solutions, in Joules.
Notes
The Gibbs energy of mixing is calculated as follows: [3]
\[\Delta_{mix} G = \sum_i (n_c + n_d) R T \ln a_b - \sum_i n_c R T \ln a_c - \sum_i n_d R T \ln a_d\]Where n is the number of moles of substance, T is the temperature in kelvin, and subscripts b, c, and refer to the concentrated, dilute, and blended Solutions, respectively.
Note that dissociated ions must be counted as separate components, so a simple salt dissolved in water is a three component solution (cation, anion, and water).
References
[3] Koga, Yoshikata, 2007. //Solution Thermodynamics and its Application to Aqueous Solutions: A differential approach.// Elsevier, 2007, pp. 23-37.
-
pyEQL.functions.
mix
(Solution1, Solution2)¶ Mix two solutions together
Returns a new Solution object that results from the mixing of Solution1 and Solution2