Skip to content

Commit

Permalink
Updated the HDA example exercise and solution (#62)
Browse files Browse the repository at this point in the history
* Updated the HDA example exercise and solution

* Update initialization to new API

* Try including autoscaling

* updating files

* updating for tests

* updating files

* trying to debug the values

* commiting this version to save it

* updating notebook

* updating all notebooks

* fixing typos

* trying to fix for linux tests

* updating other errors

* updating other examples

* adding default initializer in reactions prop

* resolving reaction prop failure

* resolving costing test

* tests pass locally

* trying to resolve the CI error

* trying to resolve test

* resolving hda_with_distillation error

* updating other files

* removing unnecessary files

* updating initialization except block

* resolving test failure

* applying black and adding InitializationError in except block

* rerunning HDA flowsheet

---------

Co-authored-by: JavalVyas2000 <[email protected]>
Co-authored-by: Brandon Paul <[email protected]>
  • Loading branch information
3 people authored Aug 29, 2024
1 parent fdf703b commit 8f46f82
Show file tree
Hide file tree
Showing 15 changed files with 11,199 additions and 10,402 deletions.
1,433 changes: 759 additions & 674 deletions idaes_examples/mod/hda/hda_ideal_VLE.py

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion idaes_examples/mod/tut/visualizer_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@

from idaes.models.unit_models.pressure_changer import ThermodynamicAssumption
from idaes.core.util.model_statistics import degrees_of_freedom
from idaes.core.solvers import get_solver
from idaes.core.util.exceptions import InitializationError

try:
import idaes_ui
Expand Down Expand Up @@ -289,7 +291,13 @@ def initialize_model(m: ConcreteModel) -> ConcreteModel:
seq.set_guesses_for(m.fs.H101.inlet, tear_guesses)

def initialize_unit(unit):
unit.initialize(outlvl=idaeslog.DEBUG)
try:
initializer = unit.default_initializer()
initializer.initialize(unit, output_level=idaeslog.INFO)
except InitializationError:
solver=get_solver()
solver.solve(unit)


seq.run(m, initialize_unit)
return m
Expand Down
1,311 changes: 1,282 additions & 29 deletions idaes_examples/notebooks/docs/flowsheets/hda_flowsheet_with_distillation.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 8f46f82

Please sign in to comment.