Skip to content

Commit

Permalink
setting custom options to stabilize flowsheet_softening_two_stage
Browse files Browse the repository at this point in the history
  • Loading branch information
bknueven committed Nov 22, 2023
1 parent 72afaff commit a03385c
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from pyomo.environ import ConcreteModel, TransformationFactory

from idaes.core import FlowsheetBlock
from idaes.core.solvers import get_solver
from idaes.core.util.scaling import calculate_scaling_factors

from watertap.examples.flowsheets.full_treatment_train.util import (
Expand Down Expand Up @@ -75,7 +76,10 @@ def set_up_optimization(m, system_recovery=0.50, **kwargs):


def optimize(m, check_termination=True):
return solve_block(m, tee=False, fail_flag=check_termination)
s = get_solver()
s.options["bound_relax_factor"] = 1e-20
s.options["bound_push"] = 1e-20
return solve_block(m, solver=s, tee=True, fail_flag=check_termination)


def solve_flowsheet(**desal_kwargs):
Expand All @@ -95,7 +99,9 @@ def solve_flowsheet(**desal_kwargs):
initialize(m, **desal_kwargs)

check_dof(m)
solve_block(m, tee=False, fail_flag=True)
s = get_solver()
s.options["bound_relax_factor"] = 1e-20
solve_block(m, solver=s, tee=True, fail_flag=True)

# report
print("===================================" "\n Simulation ")
Expand Down

0 comments on commit a03385c

Please sign in to comment.