Skip to content

Commit 4443f03

Browse files
committed
Uncommented section for testing phase equilibrium initializer object and removed print statements from electrolyte test
1 parent 138a434 commit 4443f03

File tree

2 files changed

+24
-28
lines changed

2 files changed

+24
-28
lines changed

idaes/models/properties/modular_properties/state_definitions/tests/test_FpTPxpc.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,27 +1533,27 @@ def test_phase_equilibrium_initializer_object():
15331533

15341534
# Check that degrees of freedom are still the same
15351535
assert degrees_of_freedom(model) == 8 - 4
1536-
#
1537-
# m = model.fs.state[0]
1538-
#
1539-
# m.display()
1540-
# #
1541-
# # for v in m.component_data_objects(Var, active=True):
1542-
# # print(f"{v.name}: value={v.value}, lb={v.lb}, ub={v.ub}")
1543-
# #
1544-
# # print()
1545-
# #
1546-
# # for c in m.component_data_objects(Constraint, active=True):
1547-
# # print(c.name, c.expr)
1548-
#
1549-
# # As the phase equilibrium constraints were not solved, we expect these to have a large residual
1550-
# large_res = large_residuals_set(model.fs.state[0])
1551-
# print(large_res)
1552-
# assert len(large_res) == 4
1553-
# for i in large_res:
1554-
# assert i.name in [
1555-
# "fs.state[0.0].phase_fraction_constraint[Liq]",
1556-
# "fs.state[0.0].phase_fraction_constraint[Vap]",
1557-
# "fs.state[0.0].equilibrium_constraint[Vap,Liq,H2O]",
1558-
# "fs.state[0.0].equilibrium_constraint[Vap,Liq,CO2]",
1559-
# ]
1536+
1537+
m = model.fs.state[0]
1538+
1539+
m.display()
1540+
1541+
for v in m.component_data_objects(Var, active=True):
1542+
print(f"{v.name}: value={v.value}, lb={v.lb}, ub={v.ub}")
1543+
1544+
print()
1545+
1546+
for c in m.component_data_objects(Constraint, active=True):
1547+
print(c.name, c.expr)
1548+
1549+
# As the phase equilibrium constraints were not solved, we expect these to have a large residual
1550+
large_res = large_residuals_set(model.fs.state[0])
1551+
print(large_res)
1552+
assert len(large_res) == 4
1553+
for i in large_res:
1554+
assert i.name in [
1555+
"fs.state[0.0].phase_fraction_constraint[Liq]",
1556+
"fs.state[0.0].phase_fraction_constraint[Vap]",
1557+
"fs.state[0.0].equilibrium_constraint[Vap,Liq,H2O]",
1558+
"fs.state[0.0].equilibrium_constraint[Vap,Liq,CO2]",
1559+
]

idaes/models/properties/modular_properties/state_definitions/tests/test_FpTPxpc_electrolyte.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,6 @@ def test_solve_for_true_species(self, frame):
348348

349349
# Check apparent species flowrates
350350
for j in m.fs.state[1].mole_frac_comp:
351-
print()
352-
print(j)
353-
print(value(m.fs.state[1].flow_mol_phase_comp_apparent["Liq", j]))
354-
print(value(m.fs.state[1].flow_mol), value(m.fs.state[1].mole_frac_comp[j]))
355351
assert value(
356352
m.fs.state[1].flow_mol_phase_comp_apparent["Liq", j]
357353
) == pytest.approx(

0 commit comments

Comments
 (0)