Skip to content

Commit

Permalink
Merge pull request watertap-org#4 from lxhowl/issue929
Browse files Browse the repository at this point in the history
Fix linux test failures
  • Loading branch information
bknueven authored Aug 3, 2023
2 parents 9160ef1 + b8d1d89 commit 1a74626
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@
# End reaction_config definition

# Get default solver for testing
solver = get_solver()
solver = get_solver(options={"tol": 1e-11})


def build_ideal_naocl_prop(model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,24 @@ def test_ideal_naocl_chlorination():
def test_ideal_naocl_chlorination_full_block():
model = run_chlorination_block_example(fix_free_chlorine=True)
assert model.fs.ideal_naocl_mixer_unit.dosing_rate.value == pytest.approx(
0.9504457542440085e-6, rel=1e-3
1.7296113311683092e-09, rel=1e-3
)
assert model.fs.ideal_naocl_mixer_unit.outlet.flow_mol[0].value == pytest.approx(
25.000025535888078, rel=1e-3
)
assert model.fs.ideal_naocl_mixer_unit.outlet.mole_frac_comp[
0, "OCl_-"
].value == pytest.approx(5.107172398859054e-07, rel=1e-3)
].value == pytest.approx(1.6123004572288052e-07, rel=1e-3)

assert model.fs.ideal_naocl_chlorination_unit.free_chlorine.value == pytest.approx(
2, rel=1e-3
)
assert model.fs.ideal_naocl_chlorination_unit.outlet.mole_frac_comp[
0, "OCl_-"
].value == pytest.approx(4.508812116261189e-07, rel=1e-3)
].value == pytest.approx(5.0027242332010015e-08, rel=1e-3)
assert model.fs.ideal_naocl_chlorination_unit.outlet.mole_frac_comp[
0, "H_+"
].value == pytest.approx(6.089333576685783e-11, rel=1e-3)
].value == pytest.approx(1.49011416785194e-10, rel=1e-3)


@pytest.mark.component
Expand Down
2 changes: 1 addition & 1 deletion watertap/examples/flowsheets/nf_dspmde/nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def set_NF_feed_scaling(blk):
scale = calc_scale(blk.feed.properties[0].flow_mol_phase_comp[index].value)
print(f"{index} flow_mol_phase_comp scaling factor = {10**(scale+_add)}")
blk.properties.set_default_scaling(
"flow_mol_phase_comp", 10 ** (scale + 0), index=index
"flow_mol_phase_comp", 10 ** (scale + _add), index=index
)


Expand Down
2 changes: 1 addition & 1 deletion watertap/examples/flowsheets/nf_dspmde/nf_with_bypass.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def fix_init_vars(m):
# apply defaults for normal NF init
nf.fix_init_vars(m)
# fix initial guess for splitter
m.fs.by_pass_splitter.split_fraction[0, "bypass"].fix(0.5)
m.fs.by_pass_splitter.split_fraction[0, "bypass"].fix(0.9)
m.fs.by_pass_splitter.split_fraction[0, "bypass"].setlb(0)
m.fs.by_pass_splitter.split_fraction[0, "bypass"].setub(None)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
from pyomo.environ import value
from watertap.examples.flowsheets.nf_dspmde.nf_with_bypass import main


@pytest.mark.skipif(
sys.platform.startswith("win"),
reason="Known issue on Windows, see watertap-org/watertap#1072",
)
@pytest.mark.requires_idaes_solver
@pytest.mark.component
def test_main():
Expand Down

0 comments on commit 1a74626

Please sign in to comment.