Skip to content

Commit

Permalink
Merge branch 'main' into add_gray_box_do_counting
Browse files Browse the repository at this point in the history
  • Loading branch information
avdudchenko authored Dec 5, 2024
2 parents 1bf6ff2 + 327d8f3 commit b7bf7e0
Show file tree
Hide file tree
Showing 22 changed files with 1,325 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ jobs:
install-target: ${{ matrix.pip-install-target }}
- name: Remove dependencies installable with pip but not with conda
# NOTE some dependencies that are installed by default with pip are not available through conda
# so they're not installed if IDAES is installed with `conda -c conda-forge -c IDAES-PSE idaes-pse`
# so they're not installed if IDAES is installed with `conda -c conda-forge idaes-pse`
# to ensure this scenario is handled properly, since we don't have (yet) the conda-build process integrated with the CI,
# we manually remove the "pip-but-not-conda" dependencies after installing with pip
# as an approximation of the enviroment that we'd get from `conda install`
Expand Down
4 changes: 2 additions & 2 deletions docs/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ def main() -> int:
"-t",
"--timeout",
dest="timeout",
help="Timeout (in seconds) for sphinx-build (default=180)",
default=180,
help="Timeout (in seconds) for sphinx-build (default=360)",
default=360,
type=int,
)
prs.add_argument(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Unit Models
skeleton_unit
statejunction
stoichiometric_reactor
stream_scaler
translator
turbine
valve
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Stream Scaler Block
===================

Stream Scaler Blocks are used to adjust size of streams to represent, for example, a stream being split across several identical units, which are then all modeled as a single IDAES unit

Degrees of Freedom
------------------

Stream Scaler blocks have one degree of freedom (beyond the state variables in the ``StateBlock`` properties), a ``Var`` called ``multiplier``. It is the factor by which extensive state variables (defined as those having "flow" in their name) are scaled, with ``output_var = multiplier * input_var``.

Model Structure
---------------

Stream Scaler Blocks consists of a single ``StateBlock`` (named properties), each with an inlet and outlet port.

Additional Constraints
----------------------

Stream Scaler Blocks write no additional constraints* (besides those naturally occurring in ``StateBlocks``).

Variables
---------

Stream Scaler blocks add no additional Variables.

.. module:: idaes.models.unit_models.stream_scaler


Initialization
--------------

.. autoclass:: StreamScalerInitializer
:members: initialization_routine

StreamScaler Class
------------------

.. autoclass:: StreamScaler
:members:

StreamScalerData Class
----------------------

.. autoclass:: StreamScalerData
:members:

2 changes: 2 additions & 0 deletions docs/reference_guides/model_libraries/models_extra/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ Additional IDAES Model Libraries

phe
temperature_swing_adsorption/fixed_bed_tsa0d
membrane_model/1d_membrane

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
One-dimensional membrane class for CO2 gas separation
================================================================

This is a one-dimensional model for gas separation in CO₂ capture applications.
The model will be discretized in the flow direction, and it supports two flow patterns:
counter-current flow and co-current flow. The model was customized for gas-phase separation
in CO₂ capture with a single-layer design. If a multi-layer design is needed, multiple units
can be connected for this application. The two sides of the membrane are called the feed side
and sweep side. The sweep stream inlet is optional. The driving force across the membrane is the
partial pressure difference in this gas separation application. Additionally, the energy balance
assumes that temperature remains constant on each side of the membrane.

Variables
---------

Model Inputs - symbol:

* Membrane length - :math:`L`
* Membrane Area - :math:`A`
* Permeance - :math:`per`
* Feed flowrate - :math:`F_fr`
* Feed compositions - :math:`x`
* Feed pressure - :math:`P`
* Feed temperature - :math:`T`


Model Outputs :

* Permeate compositions
* Permeate flowrate

Degrees of Freedom
------------------

The DOF should be 0 for square problem simulations.




Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ We recommend using Conda to manage your environment & modules.
conda activate my-idaes-env

# Install IDAES Conda package
conda install --yes -c IDAES-PSE -c conda-forge idaes-pse
conda install --yes -c conda-forge idaes-pse

.. note:: The command above will install the most recent stable (release) version of IDAES.
To install other versions of IDAES, including pre-release versions,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Set up & activate Conda new environment with IDAES-PSE
conda create --yes --name my-idaes-env -c conda-forge -c IDAES-PSE python=3.10 idaes-pse
conda create --yes --name my-idaes-env -c conda-forge python=3.10 idaes-pse
conda activate my-idaes-env

# Install IDAES Extensions
Expand Down
1 change: 1 addition & 0 deletions idaes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"xubuntu1804": "ubuntu1804",
"xubuntu2004": "ubuntu2004",
"xubuntu2204": "ubuntu2204",
"pop22": "ubuntu2204",
}
# Machine map
binary_arch_map = {
Expand Down
4 changes: 2 additions & 2 deletions idaes/core/surrogate/tests/test_onnx_surrogate.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


def load_onnx_model_data(
name="net_st_net_5000_STM_100_s_2000000_60_5_tanh_1e-06_4096_tr_15481_Calcite_ST",
name="net_Calcite_ST",
):
onnx_folder_name = os.path.join(this_file_dir(), "data", "onnx_models")
onnx_model = onnx.load(os.path.join(onnx_folder_name, "{}.onnx".format(name)))
Expand Down Expand Up @@ -138,7 +138,7 @@ def test_onnx_surrogate_load_and_save_from_file():

onnx_surrogate = ONNXSurrogate.load_onnx_model(
onnx_model_location=os.path.join(this_file_dir(), "data", "onnx_models"),
model_name="net_st_net_5000_STM_100_s_2000000_60_5_tanh_1e-06_4096_tr_15481_Calcite_ST",
model_name="net_Calcite_ST",
)
with TempfileManager.new_context() as tf:
dname = tf.mkdtemp()
Expand Down
1 change: 1 addition & 0 deletions idaes/models/unit_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
)
from .shell_and_tube_1d import ShellAndTube1D, ShellAndTubeInitializer
from .skeleton_model import SkeletonUnitModel, SkeletonUnitModelData
from .stream_scaler import StreamScaler, StreamScalerData
from .statejunction import StateJunction, StateJunctionInitializer
from .stoichiometric_reactor import StoichiometricReactor
from .translator import Translator
Expand Down
Loading

0 comments on commit b7bf7e0

Please sign in to comment.