pyEQL 1.3.0__py3-none-any.whl → 1.3.2__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.
pyEQL/solution.py CHANGED
@@ -651,7 +651,7 @@ class Solution(MSONable):
651
651
  a0 = a1 = b0 = b1 = 0
652
652
 
653
653
  # retrieve the parameters for the delta G equations
654
- params = self.get_property(salt.formula, "model_parameters.viscosity_eyring")
654
+ params = None if salt is None else self.get_property(salt.formula, "model_parameters.viscosity_eyring")
655
655
  if params is not None:
656
656
  a0 = ureg.Quantity(params["a0"]["value"]).magnitude
657
657
  a1 = ureg.Quantity(params["a1"]["value"]).magnitude
@@ -662,11 +662,16 @@ class Solution(MSONable):
662
662
  temperature = self.temperature.to("degC").magnitude
663
663
  G_123 = a0 + a1 * (temperature) ** 0.75
664
664
  G_23 = b0 + b1 * (temperature) ** 0.5
665
+
666
+ # calculate the cation mole fraction
667
+ # x_cat = self.get_amount(cation, "fraction")
668
+ x_cat = self.get_amount(salt.cation, "fraction").magnitude
665
669
  else:
666
670
  # TODO - fall back to the Jones-Dole model! There are currently no eyring parameters in the database!
667
671
  # proceed with the coefficients equal to zero and log a warning
668
- self.logger.warning(f"Viscosity coefficients for {salt.formula} not found. Viscosity will be approximate.")
672
+ self.logger.warning(f"Appropriate viscosity coefficients werenot found. Viscosity will be approximate.")
669
673
  G_123 = G_23 = 0
674
+ x_cat = 0
670
675
 
671
676
  # get the kinematic viscosity of water, returned by IAPWS in m2/s
672
677
  nu_w = self.water_substance.nu
@@ -678,10 +683,6 @@ class Solution(MSONable):
678
683
  # get the MW of water
679
684
  MW_w = self.get_property(self.solvent, "molecular_weight").magnitude
680
685
 
681
- # calculate the cation mole fraction
682
- # x_cat = self.get_amount(cation, "fraction")
683
- x_cat = self.get_amount(salt.cation, "fraction").magnitude
684
-
685
686
  # calculate the kinematic viscosity
686
687
  nu = np.log(nu_w * MW_w / MW) + 15 * x_cat**2 + x_cat**3 * G_123 + 3 * x_cat * G_23 * (1 - 0.05 * x_cat)
687
688
 
@@ -1571,7 +1572,11 @@ class Solution(MSONable):
1571
1572
  # # use only the predominant species for each element
1572
1573
  components = {}
1573
1574
  for el, lst in self.get_components_by_element().items():
1574
- components[lst[0]] = self.get_total_amount(el, "mol").magnitude
1575
+ component = lst[0]
1576
+ ion = Ion.from_formula(component)
1577
+ el_no_oxi_state = el.split("(")[0]
1578
+ nu_el = ion.get_el_amt_dict()[el_no_oxi_state]
1579
+ components[component] = self.get_total_amount(el, "mol").magnitude / nu_el
1575
1580
  # add H+ and OH-, which would otherwise be excluded
1576
1581
  for k in ["H[+1]", "OH[-1]"]:
1577
1582
  if self.components.get(k):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyEQL
3
- Version: 1.3.0
3
+ Version: 1.3.2
4
4
  Summary: A python interface for solution chemistry
5
5
  Author-email: Ryan Kingsbury <kingsbury@princeton.edu>
6
6
  License-Expression: LGPL-3.0-or-later
@@ -6,7 +6,7 @@ pyEQL/functions.py,sha256=xevJri40Boi_k6JMgzL-HY3ExztbI2uto0soS9OV5ko,11451
6
6
  pyEQL/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  pyEQL/salt_ion_match.py,sha256=r60dsgBjfhzUCM2BvUIQTF6C37XTpuM5JI2F1t3Dc5A,4074
8
8
  pyEQL/solute.py,sha256=no00Rc3tRfHmyht4wm2UXA1KZhKC45tWMO5QEkZY6yg,5140
9
- pyEQL/solution.py,sha256=qP9w_bXRm3sjFksMPo4XqAcJH2FufmmlrIir7hUpnkM,112869
9
+ pyEQL/solution.py,sha256=y_u-rAbHHvwhh6resQleZFkFGgwU5Euy7hswOUSXX-A,113136
10
10
  pyEQL/utils.py,sha256=dMkLhFFgvL2zUgGvEZ-gtJ8ZtVO7JB2JtEnFM839ELU,7380
11
11
  pyEQL/database/geothermal.dat,sha256=kksnfcBtWdOTpNn4CLXU1Mz16cwas2WuVKpuMU8CaVI,234230
12
12
  pyEQL/database/llnl.dat,sha256=jN-a0kfUFbQlYMn2shTVRg1JX_ZhLa-tJ0lLw2YSpLU,751462
@@ -18,9 +18,9 @@ pyEQL/presets/rainwater.yaml,sha256=QG3aol2Z5HwLj-s6frN7hYNQr01qw_HR2h5f4BdAvVc,
18
18
  pyEQL/presets/seawater.yaml,sha256=Kts0vAmXSPvPzy_PJpx0RR2uSt40izxp-687Qi02oro,843
19
19
  pyEQL/presets/urine.yaml,sha256=Zpcr2Dp7xZrlLqzYk4UcMyWXlNrd2AFUexWpb8k9FEg,679
20
20
  pyEQL/presets/wastewater.yaml,sha256=zJcpp9Ye4hIw6iInsdV5bgjTNuJ8oAUVimsUgZXlG-w,502
21
- pyeql-1.3.0.dist-info/licenses/AUTHORS.md,sha256=vm40bLDv3LLqNiY0QrMfs7j8eBFg6x-5OPcu5cH4G3o,633
22
- pyeql-1.3.0.dist-info/licenses/LICENSE.txt,sha256=2Zf1F7RzbpeposgIxUydpurqNCMoMgDi2gAB65_GjwQ,969
23
- pyeql-1.3.0.dist-info/METADATA,sha256=JlfgJBpRaUHufqtTY4Tgjd8LEQwED7nuX7vzjTJs4To,6108
24
- pyeql-1.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
- pyeql-1.3.0.dist-info/top_level.txt,sha256=QMOaZjCAm_lS4Njsjh4L0B5aWnJFGQMYKhuH88CG1co,6
26
- pyeql-1.3.0.dist-info/RECORD,,
21
+ pyeql-1.3.2.dist-info/licenses/AUTHORS.md,sha256=vm40bLDv3LLqNiY0QrMfs7j8eBFg6x-5OPcu5cH4G3o,633
22
+ pyeql-1.3.2.dist-info/licenses/LICENSE.txt,sha256=2Zf1F7RzbpeposgIxUydpurqNCMoMgDi2gAB65_GjwQ,969
23
+ pyeql-1.3.2.dist-info/METADATA,sha256=rod9vN7mMTcoDJF77NHcNVZGuNPZNHqeBajStoKGFjQ,6108
24
+ pyeql-1.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ pyeql-1.3.2.dist-info/top_level.txt,sha256=QMOaZjCAm_lS4Njsjh4L0B5aWnJFGQMYKhuH88CG1co,6
26
+ pyeql-1.3.2.dist-info/RECORD,,
File without changes