Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f32ebbb
Flash Unite and HDA Flowsheet Tutorial Revisions to reflect changes t…
tannerpolley Jun 12, 2025
3604a41
Flash Unite and HDA Flowsheet Tutorial Revisions to reflect changes t…
tannerpolley Jun 13, 2025
6359e81
Updated version numbers for GitHub Actions to version 4
tannerpolley Jun 13, 2025
f819b5e
Updated version numbers for GitHub Actions to version 4 and other iss…
tannerpolley Jun 16, 2025
6675345
Updated version numbers for GitHub Actions to version 4 and other iss…
tannerpolley Jun 16, 2025
4e40e56
Updated version numbers for GitHub Actions to version 4 and other iss…
tannerpolley Jun 16, 2025
0051c10
Updated version numbers for GitHub Actions to version 4 and other iss…
tannerpolley Jun 16, 2025
e352c2d
Updated version numbers for GitHub Actions to version 4 and other iss…
tannerpolley Jun 17, 2025
f8f3af4
Updated version numbers for GitHub Actions to version 4 and other iss…
tannerpolley Jun 18, 2025
b3f5eb1
Revised both Tutorials based on feedback and ensured they both work a…
tannerpolley Jun 24, 2025
3094a8b
Fixed spelling and ran Black
tannerpolley Jun 26, 2025
14cdccb
Fixing pytesting for earlier versions
tannerpolley Jun 26, 2025
5ced5b0
Update core.yml
ksbeattie Aug 21, 2025
f165fa2
Created config files to implement modular properties framework and in…
tannerpolley Aug 25, 2025
d361197
Merge remote-tracking branch 'origin/Tutorial-Update' into Tutorial-U…
tannerpolley Aug 25, 2025
c82abda
Update depreciated github artifact actions v3 to current v4 (#149)
sufikaur Sep 13, 2025
d7d6f23
tiny fix (#147)
dallan-keylogic Sep 15, 2025
4028e8a
September Typos update
mrmundt Oct 1, 2025
adebd0c
Add diff to job, fix black formatting
mrmundt Oct 1, 2025
64fd034
Add in a weekly scheduled job to make sure no spurious failures are i…
mrmundt Oct 2, 2025
acbcc57
Merge pull request #151 from IDAES/sep-typos
blnicho Oct 2, 2025
c642150
2.10.dev0
Oct 3, 2025
0b4c00b
Improve welcome to IDAES background material (#146)
adowling2 Oct 9, 2025
5d9930c
fixes flexbox settings for HDA flowsheet (#152)
dangunter Oct 30, 2025
3e34582
Fix SOC dynamics failure (#150)
dallan-keylogic Oct 30, 2025
213ede1
revert installation from branch (#156)
dallan-keylogic Oct 31, 2025
9a487fc
Update notebooks to take final solve into account (#157)
dallan-keylogic Nov 19, 2025
bcc7883
Revert installation to IDAES main (#158)
dallan-keylogic Nov 19, 2025
25ec437
Revised HDA Flowsheet to use the new State Definition FpTPxpc and add…
tannerpolley Dec 3, 2025
91d17a4
Flash Unite and HDA Flowsheet Tutorial Revisions to reflect changes t…
tannerpolley Jun 12, 2025
c6d8895
Flash Unite and HDA Flowsheet Tutorial Revisions to reflect changes t…
tannerpolley Jun 13, 2025
aff2240
Updated version numbers for GitHub Actions to version 4
tannerpolley Jun 13, 2025
2552c8f
Revised both Tutorials based on feedback and ensured they both work a…
tannerpolley Jun 24, 2025
b41541f
Fixed spelling and ran Black
tannerpolley Jun 26, 2025
d593b3e
Fixing pytesting for earlier versions
tannerpolley Jun 26, 2025
2df2238
Created config files to implement modular properties framework and in…
tannerpolley Aug 25, 2025
58eec85
Revised HDA Flowsheet to use the new State Definition FpTPxpc and add…
tannerpolley Dec 3, 2025
085b4eb
Merge branch 'Tutorial-Update' of https://github.com/tannerpolley/exa…
tannerpolley Dec 9, 2025
fc5e1c5
Revised and fixed the HDA tutorial to work with updated FpTPxpc state…
tannerpolley Jan 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
schedule:
# run Sundays at 3:00 am UTC (10 pm ET/7 pm PT)
- cron: '0 3 * * 0'
repository_dispatch:
# to run this, send a POST API call at repos/IDAES/idaes-pse/dispatches with the specified event_type
# e.g. `gh repos/IDAES/idaes-pse/dispatches -F event_type=ci_run_tests`
Expand Down Expand Up @@ -59,14 +62,14 @@ jobs:
pip install --progress-bar off black[jupyter]==24.3.0
- name: Run Black to verify that the committed code is formatted
run: |
black --check .
black --check --diff .

spell-check:
name: Check Spelling
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Run Spell Checker
uses: crate-ci/typos@master

Expand All @@ -88,11 +91,11 @@ jobs:
- win64
include:
- os: linux
runner-image: ubuntu-20.04
runner-image: ubuntu-22.04
- os: win64
runner-image: windows-2022
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Conda environment
uses: conda-incubator/[email protected]
with:
Expand All @@ -112,7 +115,7 @@ jobs:
pytest -v idaes_examples --ignore=idaes_examples/notebooks/docs/surrogates/sco2/alamo/
- name: Upload pytest-xdist worker logs
if: success() || failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pytest_worker_logs
name: pytest_worker_logs--${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }}-${{ runner.os }}-py${{ matrix.python-version }}
path: "tests_*.log"
2 changes: 1 addition & 1 deletion README-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Clone the repository from GitHub, set up your Python environment as you usually
pip install -r requirements-dev.txt
```

Note: if you have IDAES installed in your current environment, it will uninstall it and install the latest version from the main branch on Github. You can run `pip uninstall idaes` and reinstall it from your local repository if you need to test examples against a local branch of IDAES.
Note: if you have IDAES installed in your current environment, it will uninstall it and install the latest version from the main branch on Github. You can run `pip uninstall idaes-pse` and reinstall it from your local repository if you need to test examples against a local branch of IDAES.

The configuration of the installation is stored in `pyproject.toml`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"To start, we inidcate that the choice to place an atom is fixed so that each canvas site is required to have an atom. This simplifies the problem significantly and results in a model that will seek to find the optimal labeling of metals on the nanocluster. "
"To start, we indicate that the choice to place an atom is fixed so that each canvas site is required to have an atom. This simplifies the problem significantly and results in a model that will seek to find the optimal labeling of metals on the nanocluster. "
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion idaes_examples/archive/matopt/surface_design_src.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
"source": [
"First, we introduce two rules to fix special sites in the design. \n",
"We fix the bottom two layers of atoms to exist, creating underlying bulk layers above which we will introduce nanostruced defets.\n",
"We also fix an arbitrary atom in the top layer, breaking symmetry of the design space and resulting in easier to solve opitmization problems without actually restricting the designs that can be possibly represented. "
"We also fix an arbitrary atom in the top layer, breaking symmetry of the design space and resulting in easier to solve optimization problems without actually restricting the designs that can be possibly represented. "
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion idaes_examples/archive/power_gen/sofc/sofc.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ def scale_flowsheet(m):
m.fs.flash.control_volume.properties_out[0].mole_frac_comp, 1e1
)

# hide missing scaling factor wornings
# hide missing scaling factor warnings
scaling_log = idaeslog.getLogger("idaes.core.util.scaling", level=idaeslog.ERROR)

iscale.calculate_scaling_factors(m)
Expand Down
200 changes: 200 additions & 0 deletions idaes_examples/mod/hda/hda_flowsheet_extras.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
import numpy as np
from idaes.core.util.model_statistics import degrees_of_freedom
from idaes.core.solvers import get_solver
import idaes.logger as idaeslog

def FpcTP_to_FpTPxpc(flow_mol_phase_comp):

flow_mol_phase = {
"Vap": 0,
"Liq": 0,
}
mole_frac_phase_comp = {}

for (p, c) in flow_mol_phase_comp.keys():
flow_mol_phase[p] += flow_mol_phase_comp[(p, c)]
for (p, c) in flow_mol_phase_comp.keys():
if flow_mol_phase[p] == 0.0:
mole_frac_phase_comp[p, c] = 0.0
else:
mole_frac_phase_comp[p, c] = flow_mol_phase_comp[(p, c)] / flow_mol_phase[p]

return flow_mol_phase, mole_frac_phase_comp


def fix_inlet_states(m):

eps = 1e-5
flow_mol_phase_comp_101 = {
("Vap", "benzene"): eps,
("Vap", "toluene"): eps,
("Vap", "hydrogen"): eps,
("Vap", "methane"): eps,
("Liq", "benzene"): eps,
("Liq", "toluene"): 0.30,
}

flow_mol_phase_101, mole_frac_phase_comp_101 = FpcTP_to_FpTPxpc(flow_mol_phase_comp_101)

m.fs.I101.flow_mol_phase[0, "Vap"].fix(flow_mol_phase_101["Vap"])
m.fs.I101.flow_mol_phase[0, "Liq"].fix(flow_mol_phase_101["Liq"])
m.fs.I101.mole_frac_phase_comp[0, "Vap", "benzene"].fix(mole_frac_phase_comp_101["Vap", "benzene"])
m.fs.I101.mole_frac_phase_comp[0, "Vap", "toluene"].fix(mole_frac_phase_comp_101["Vap", "toluene"])
m.fs.I101.mole_frac_phase_comp[0, "Vap", "hydrogen"].fix(mole_frac_phase_comp_101["Vap", "hydrogen"])
m.fs.I101.mole_frac_phase_comp[0, "Vap", "methane"].fix(mole_frac_phase_comp_101["Vap", "methane"])
m.fs.I101.mole_frac_phase_comp[0, "Liq", "benzene"].fix(mole_frac_phase_comp_101["Liq", "benzene"])
m.fs.I101.mole_frac_phase_comp[0, "Liq", "toluene"].fix(mole_frac_phase_comp_101["Liq", "toluene"])
m.fs.I101.temperature.fix(303.2)
m.fs.I101.pressure.fix(350000)

flow_mol_phase_comp_102 = {
("Vap", "benzene"): eps,
("Vap", "toluene"): eps,
("Vap", "hydrogen"): .30,
("Vap", "methane"): .02,
("Liq", "benzene"): eps,
("Liq", "toluene"): eps,
}

flow_mol_phase_102, mole_frac_phase_comp_102 = FpcTP_to_FpTPxpc(flow_mol_phase_comp_102)

m.fs.I102.flow_mol_phase[0, "Vap"].fix(flow_mol_phase_102["Vap"])
m.fs.I102.flow_mol_phase[0, "Liq"].fix(flow_mol_phase_102["Liq"])
m.fs.I102.mole_frac_phase_comp[0, "Vap", "benzene"].fix(mole_frac_phase_comp_102["Vap", "benzene"])
m.fs.I102.mole_frac_phase_comp[0, "Vap", "toluene"].fix(mole_frac_phase_comp_102["Vap", "toluene"])
m.fs.I102.mole_frac_phase_comp[0, "Vap", "hydrogen"].fix(mole_frac_phase_comp_102["Vap", "hydrogen"])
m.fs.I102.mole_frac_phase_comp[0, "Vap", "methane"].fix(mole_frac_phase_comp_102["Vap", "methane"])
m.fs.I102.mole_frac_phase_comp[0, "Liq", "benzene"].fix(mole_frac_phase_comp_102["Liq", "benzene"])
m.fs.I102.mole_frac_phase_comp[0, "Liq", "toluene"].fix(mole_frac_phase_comp_102["Liq", "toluene"])
m.fs.I102.temperature.fix(303.2)
m.fs.I102.pressure.fix(350000)

tear_guesses = {
"flow_mol_phase": {
(0, "Liq"): flow_mol_phase_101["Liq"],
(0, "Vap"): flow_mol_phase_102["Vap"],
},
"mole_frac_phase_comp": {
(0, "Liq", "benzene"): mole_frac_phase_comp_101["Liq", "benzene"],
(0, "Liq", "toluene"): mole_frac_phase_comp_101["Liq", "toluene"],
(0, "Vap", "benzene"): mole_frac_phase_comp_102["Vap", "benzene"],
(0, "Vap", "toluene"): mole_frac_phase_comp_102["Vap", "toluene"],
(0, "Vap", "methane"): mole_frac_phase_comp_102["Vap", "hydrogen"],
(0, "Vap", "hydrogen"): mole_frac_phase_comp_102["Vap", "methane"],
},
"temperature": {0: 303},
"pressure": {0: 350000},
}

return tear_guesses


def initialize_unit(unit):
from idaes.core.util.exceptions import InitializationError
import idaes.logger as idaeslog

optarg = {
"nlp_scaling_method": "user-scaling",
"OF_ma57_automatic_scaling": "yes",
"max_iter": 1000,
"tol": 1e-8,
}

try:
initializer = unit.default_initializer(solver_options=optarg)
initializer.initialize(unit, output_level=idaeslog.INFO_LOW)
except InitializationError:
solver = get_solver(solver_options=optarg)
solver.solve(unit)


def manual_propagation(m, tear_guesses):
from idaes.core.util.initialization import propagate_state

print(f"The DOF is {degrees_of_freedom(m)} initially")
m.fs.s03_expanded.deactivate()
print(f"The DOF is {degrees_of_freedom(m)} after deactivating the tear stream")

for k, v in tear_guesses.items():
for k1, v1 in v.items():
getattr(m.fs.s03.destination, k)[k1].fix(v1)

DOF_initial = degrees_of_freedom(m)

print(f"The DOF is {degrees_of_freedom(m)} after setting the tear stream")

optarg = {
"nlp_scaling_method": "user-scaling",
"OF_ma57_automatic_scaling": "yes",
"max_iter": 300,
# "tol": 1e-10,
}

solver = get_solver(solver_options=optarg)

initialize_unit(m.fs.H101) # Initialize Heater
propagate_state(m.fs.s04) # Establish connection between Heater and Reactor
initialize_unit(m.fs.R101) # Initialize Reactor
propagate_state(m.fs.s05) # Establish connection between Reactor and First Flash Unit
initialize_unit(m.fs.F101) # Initialize First Flash Unit
propagate_state(m.fs.s06) # Establish connection between First Flash Unit and Splitter
propagate_state(m.fs.s07) # Establish connection between First Flash Unit and Second Flash Unit
initialize_unit(m.fs.S101) # Initialize Splitter
propagate_state(m.fs.s08) # Establish connection between Splitter and Compressor
initialize_unit(m.fs.C101) # Initialize Compressor
propagate_state(m.fs.s09) # Establish connection between Compressor and Mixer
initialize_unit(m.fs.I101) # Initialize Toluene Inlet
propagate_state(m.fs.s01) # Establish connection between Toluene Inlet and Mixer
initialize_unit(m.fs.I102) # Initialize Hydrogen Inlet
propagate_state(m.fs.s02) # Establish connection between Hydrogen Inlet and Mixer
initialize_unit(m.fs.M101) # Initialize Mixer
propagate_state(m.fs.s03) # Establish connection between Mixer and Heater
solver.solve(m.fs.F102)
propagate_state(m.fs.s10) # Establish connection between Second Flash Unit and Benzene Product
propagate_state(m.fs.s11) # Establish connection between Second Flash Unit and Toluene Product
propagate_state(m.fs.s12) # Establish connection between Splitter and Purge Product

optarg = {
"nlp_scaling_method": "user-scaling",
"OF_ma57_automatic_scaling": "yes",
"max_iter": 300,
"tol": 1e-8,
}
solver = get_solver("ipopt_v2", options=optarg)
solver.solve(m, tee=False)

for k, v in tear_guesses.items():
for k1, v1 in v.items():
getattr(m.fs.H101.inlet, k)[k1].unfix()

m.fs.s03_expanded.activate()
print(
f"The DOF is {degrees_of_freedom(m)} after unfixing the values and reactivating the tear stream"
)


def automatic_propagation(m, tear_guesses):

from pyomo.network import SequentialDecomposition

seq = SequentialDecomposition()
seq.options.select_tear_method = "heuristic"
seq.options.tear_method = "Wegstein"
seq.options.iterLim = 5

# Using the SD tool
G = seq.create_graph(m)
heuristic_tear_set = seq.tear_set_arcs(G, method="heuristic")
order = seq.calculation_order(G)

# Pass the tear_guess to the SD tool
seq.set_guesses_for(heuristic_tear_set[0].destination, tear_guesses)

print(f'Tear Stream starts at: {heuristic_tear_set[0].destination.name}')

for o in order:
print(o[0].name)

seq.run(m, initialize_unit)


4 changes: 2 additions & 2 deletions idaes_examples/mod/hda/hda_ideal_VLE.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# at the URL "https://github.com/IDAES/idaes-pse".
##############################################################################
"""
Example ideal parameter block for the VLE calucations for a
Example ideal parameter block for the VLE calculations for a
Benzene-Toluene-o-Xylene system.
"""

Expand Down Expand Up @@ -550,7 +550,7 @@ def fix_initialization_states(blk):

# Also need to deactivate sum of mole fraction constraint
for k in blk.values():
if not k.config.defined_state:
if not k.config.defined_state and k.config.has_phase_equilibrium:
k.equilibrium_constraint.deactivate()


Expand Down
Loading
Loading