pyEQL 1.1.3__py3-none-any.whl → 1.1.5__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 +2 -6
- {pyEQL-1.1.3.dist-info → pyEQL-1.1.5.dist-info}/METADATA +1 -1
- {pyEQL-1.1.3.dist-info → pyEQL-1.1.5.dist-info}/RECORD +8 -8
- {pyEQL-1.1.3.dist-info → pyEQL-1.1.5.dist-info}/WHEEL +1 -1
- {pyEQL-1.1.3.dist-info → pyEQL-1.1.5.dist-info}/AUTHORS.md +0 -0
- {pyEQL-1.1.3.dist-info → pyEQL-1.1.5.dist-info}/COPYING +0 -0
- {pyEQL-1.1.3.dist-info → pyEQL-1.1.5.dist-info}/LICENSE.txt +0 -0
- {pyEQL-1.1.3.dist-info → pyEQL-1.1.5.dist-info}/top_level.txt +0 -0
pyEQL/solution.py
CHANGED
|
@@ -2306,11 +2306,8 @@ class Solution(MSONable):
|
|
|
2306
2306
|
start_imbalance = C_hplus - K_W / C_hplus
|
|
2307
2307
|
new_imbalance = start_imbalance - cb
|
|
2308
2308
|
# calculate the new concentration of H+ that will balance the charge
|
|
2309
|
-
# solve H^2 - new_imbalance H - K_W = 0, so a=1, b=-new_imbalance, c=-K_W
|
|
2310
|
-
#
|
|
2311
|
-
if new_imbalance**2 - 4 * 1 * K_W < 0:
|
|
2312
|
-
self.logger.error("Cannot balance charge by adjusting pH. The imbalance is too large.")
|
|
2313
|
-
return
|
|
2309
|
+
# solve H^2 - new_imbalance H - K_W = 0, so a=1, b=-new_imbalance, c=-K_W. Note that this is guaranteed to have real roots as
|
|
2310
|
+
# b^2-4ac > 0
|
|
2314
2311
|
new_hplus = max(
|
|
2315
2312
|
[
|
|
2316
2313
|
(new_imbalance + np.sqrt(new_imbalance**2 + 4 * 1 * K_W)) / 2,
|
|
@@ -2319,7 +2316,6 @@ class Solution(MSONable):
|
|
|
2319
2316
|
)
|
|
2320
2317
|
self.set_amount("H+", f"{new_hplus} mol/L")
|
|
2321
2318
|
self.set_amount("OH-", f"{K_W/new_hplus} mol/L")
|
|
2322
|
-
assert np.isclose(self.charge_balance, 0, atol=atol), f"{self.charge_balance}"
|
|
2323
2319
|
return
|
|
2324
2320
|
|
|
2325
2321
|
z = self.get_property(self._cb_species, "charge")
|
|
@@ -5,7 +5,7 @@ pyEQL/equilibrium.py,sha256=YCtoAJSgn1WC9NJnc3H4FTJdKQvogsvCuj7HqlKMtww,8307
|
|
|
5
5
|
pyEQL/functions.py,sha256=nc-Hc61MmW-ELBR1PByJvQnELxM7PZexMHbU_O5-Bnw,10584
|
|
6
6
|
pyEQL/salt_ion_match.py,sha256=0nCZXmeo67VqcyYWQpPx-81hjSvnsg8HFB3fIyfjW_k,4070
|
|
7
7
|
pyEQL/solute.py,sha256=no00Rc3tRfHmyht4wm2UXA1KZhKC45tWMO5QEkZY6yg,5140
|
|
8
|
-
pyEQL/solution.py,sha256=
|
|
8
|
+
pyEQL/solution.py,sha256=0eaPmI3bm_ipGyXtZCcQQ5kuA8Bv_0DBYZeZZ3eWXYk,115758
|
|
9
9
|
pyEQL/utils.py,sha256=DWLtNm71qw5j4-jqBp5v3LssEjWgJnVvI6a_H60c5ic,6670
|
|
10
10
|
pyEQL/database/geothermal.dat,sha256=kksnfcBtWdOTpNn4CLXU1Mz16cwas2WuVKpuMU8CaVI,234230
|
|
11
11
|
pyEQL/database/llnl.dat,sha256=jN-a0kfUFbQlYMn2shTVRg1JX_ZhLa-tJ0lLw2YSpLU,751462
|
|
@@ -17,10 +17,10 @@ pyEQL/presets/rainwater.yaml,sha256=S0WHZNDfCJyjSSFxNFdkypjn2s3P0jJGCiYIxvi1ibA,
|
|
|
17
17
|
pyEQL/presets/seawater.yaml,sha256=oryc1CkhRz20RpWE6uiGiT93HoZnqlB0s-0PmBWr3-U,843
|
|
18
18
|
pyEQL/presets/urine.yaml,sha256=0Njtc-H1fFRo7UhquHdiSTT4z-8VZJ1utDCk02qk28M,679
|
|
19
19
|
pyEQL/presets/wastewater.yaml,sha256=jTTFBpmKxczaEtkCZb0xUULIPZt7wfC8eAJ6rthGnmw,502
|
|
20
|
-
pyEQL-1.1.
|
|
21
|
-
pyEQL-1.1.
|
|
22
|
-
pyEQL-1.1.
|
|
23
|
-
pyEQL-1.1.
|
|
24
|
-
pyEQL-1.1.
|
|
25
|
-
pyEQL-1.1.
|
|
26
|
-
pyEQL-1.1.
|
|
20
|
+
pyEQL-1.1.5.dist-info/AUTHORS.md,sha256=K9ZLhKFwZ2zLlFXwN62VuUYCpr5T6n4mOUCUHlytTUs,415
|
|
21
|
+
pyEQL-1.1.5.dist-info/COPYING,sha256=Ww2oUywfFTn242v9ksCgQdIVSpcMXJiKKePn0GFm25E,7649
|
|
22
|
+
pyEQL-1.1.5.dist-info/LICENSE.txt,sha256=2Zf1F7RzbpeposgIxUydpurqNCMoMgDi2gAB65_GjwQ,969
|
|
23
|
+
pyEQL-1.1.5.dist-info/METADATA,sha256=TXDkdGyqFqh4LJfyOFtcqlbRnNh87kySnIPAKzUE1k8,6096
|
|
24
|
+
pyEQL-1.1.5.dist-info/WHEEL,sha256=Rp8gFpivVLXx-k3U95ozHnQw8yDcPxmhOpn_Gx8d5nc,91
|
|
25
|
+
pyEQL-1.1.5.dist-info/top_level.txt,sha256=QMOaZjCAm_lS4Njsjh4L0B5aWnJFGQMYKhuH88CG1co,6
|
|
26
|
+
pyEQL-1.1.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|