Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebBell committed Nov 12, 2023
1 parent 0e27831 commit 174b5fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tests/test_equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,10 @@ def test_equilibrium_ternary_air_PR():
assert_close(res.gas.humidity_ratio(), 0.009998742813826613)
assert_close(res.bulk.humidity_ratio(), 0.009998742813826613)

assert_close1d(res.zs_no_water(), [0.20999959359505813, 0.7900004064049418, 0.0])
assert_close1d(res.bulk.zs_no_water(), [0.20999959359505813, 0.7900004064049418, 0.0])
assert_close2d([i.zs_no_water() for i in res.phases], [[0.20999959359505813, 0.7900004064049418, 0.0]])

def test_Phase_to_EquilibriumState():
constants = ChemicalConstantsPackage(atomss=[{'O': 2}, {'N': 2}, {'H': 2, 'O': 1}], CASs=['7782-44-7', '7727-37-9', '7732-18-5'], Gfgs=[0.0, 0.0, -228554.325], Hfgs=[0.0, 0.0, -241822.0], MWs=[31.9988, 28.0134, 18.01528], names=['oxygen', 'nitrogen', 'water'], omegas=[0.021, 0.04, 0.344], Pcs=[5042945.25, 3394387.5, 22048320.0], Sfgs=[0.0, 0.0, -44.499999999999964], Tbs=[90.188, 77.355, 373.124], Tcs=[154.58, 126.2, 647.14], Tms=[54.36, 63.15, 273.15], Vcs=[7.34e-05, 8.95e-05, 5.6e-05])

Expand Down
7 changes: 5 additions & 2 deletions thermo/equilibrium.py
Original file line number Diff line number Diff line change
Expand Up @@ -2360,7 +2360,9 @@ def zs_no_water(self, phase=None):
zs[i] *= m
else:
zs *= m
return m

zs[water_index] = 0.0
return zs

def ws_no_water(self, phase=None):
r'''Method to calculate and return the mass fractions of all species
Expand Down Expand Up @@ -2390,7 +2392,8 @@ def ws_no_water(self, phase=None):
ws[i] *= m
else:
ws *= m
return m
ws[water_index] = 0.0
return ws

def phis(self, phase=None):
if phase is not None:
Expand Down

0 comments on commit 174b5fb

Please sign in to comment.