Skip to content

Commit

Permalink
Merge branch 'IDAES:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan88888888 authored Aug 1, 2023
2 parents 35fc724 + 3c95188 commit 3ddcbbe
Show file tree
Hide file tree
Showing 61 changed files with 1,085 additions and 388 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ suh = "suh"
ther = "ther"
# KNO3
KNO = "KNO"
# Equil == equilibrium
equil = "equil"
# Ignore astroid package
astroid = "astroid"
# delt == delta
delt = "delt"
# TEMPORARY - Remove after example update
upadate = "upadate"
upadate = "upadate"
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,21 @@ You can check the version installed with the command:
idaes --version
```

Now install the examples and the pre-build extensions (binary solvers):
Now install the pre-built extensions (binary solvers):

```bash
idaes get-examples
idaes get-extensions
```

This will install the examples into an `examples` subdirectory which can be opened using a [Jypter](https://jupyter.org) Notebook:
The IDAES examples can be installed by running:

```bash
jupyter notebook examples/notebook_index.ipynb
pip install idaes-examples
```
From there you can explore the examples and tutorials.

For more information on how to use Jupyter Lab, use the built-in *Help* menu and the extensive documentation on the [Jupyter website](https://jupyter.org).
For more information, refer to the [IDAES/examples](https://github.com/IDAES/examples) repository, as well as the online static version of the examples available at <https://idaes-examples.readthedocs.org>.

Finally, refer to the [complete idaes-pse documentation](https://idaes-pse.readthedocs.io/en/stable) for detailed [installation instructions](https://idaes-pse.readthedocs.io/en/stable/tutorials/getting_started/index.html), examples, guides, and reference.
Finally, refer to the [complete idaes-pse documentation](https://idaes-pse.readthedocs.io/en/latest) for detailed [installation instructions](https://idaes-pse.readthedocs.io/en/latest/tutorials/getting_started/index.html), examples, guides, and reference.

## System requirements

Expand Down
2 changes: 1 addition & 1 deletion data/resourcedb.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Bubble and Dew Point Methods
Ideal Assumptions (``IdealBubbleDew``)
--------------------------------------

In the case where ideal behavior can be assumed, i.e. ideal gas assumption and Raoult's Law holds, the bubble and dew points can be calculated directly from the saturation pressure using the following equations.
In the case where ideal behavior can be assumed, i.e., ideal gas assumption and Raoult's Law holds, the bubble and dew points can be calculated directly from the saturation pressure using the following equations. Note that these equations assume that only two phases are present, and thus this approach is not easily extended to cases where additional phases are present (a ConfigurationError will be raised if this is detected). For systems with more than two phases, the LogBubbleDew approach should be used instead.

Ideal Bubble Pressure
^^^^^^^^^^^^^^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Equilibrium Reaction Forms
Power Law (power_law_equil)
---------------------------

The method uses a power law form using the concentration form provided to calculate the reaction rate.
The method uses a power law form using the concentration form provided to calculate the reaction equilibrium.

.. math:: k_{eq} = \prod_{(p, j)}{x_{(p,j)}^{O_{(p,j)}}}

Expand All @@ -18,14 +18,14 @@ The method uses a power law form using the concentration form provided to calcu

":math:`O`", "reaction_order", "phase, component", "Reaction order"

Providing a `reaction_order` dict is optional. If one is not provided, it will be assumed that this is an elementary reaction and that the reaction order is equal to the stoichiometric coefficient for all component in non-solid phases (the contribution of solid phases is assumed to be constant and included in the equilibrium constant, thus an order of zero is assumed).
Providing a `reaction_order` dict is optional. If one is not provided, it will be assumed that this is an elementary reaction and that the reaction order is equal to the stoichiometric coefficient for all components in non-solid phases (the contribution of solid phases is assumed to be constant and included in the equilibrium constant, thus an order of zero is assumed).

Log Power Law (log_power_law_equil)
-----------------------------------

The method uses a log form of a power law using the concentration form provided to calculate the reaction rate.
The method uses a log form of a power law using the concentration form provided to calculate the reaction equilibrium.

.. math:: log(k_{eq}) = \sum_{(p, j)}{O_{(p,j)}*log(x_{(p,j))}
.. math:: log(k_{eq}) = \sum_{(p, j)}{O_{(p,j)}*log(x_{(p,j)})}

**Parameters**

Expand All @@ -34,4 +34,77 @@ The method uses a log form of a power law using the concentration form provided

":math:`O`", "reaction_order", "phase, component", "Reaction order"

Providing a `reaction_order` dict is optional. If one is not provided, it will be assumed that this is an elementary reaction and that the reaction order is equal to the stoichiometric coefficient for all components in non-solid phases (the contribution of solid phases is assumed to be constant and included in the equilibrium constant, thus an order of zero is assumed).

Solubility Product (solubility_product)
---------------------------------------

The method uses a complementarity formulation for solid precipitation using solubility product form.

For precipitation at equilibrium,

.. math:: Q = k_{sp} - \prod_{(liq, j)}{x_{(liq,j)}^{O_{(liq,j)}}}

* :math:`Q = 0` only holds if solids (S) are present in the system, :math:`S \geq 0`.
* :math:`Q \geq 0` if the system is subsaturated and no solids (S) are present, :math:`S = 0`.

:math:`S` represents the solid presentation and is normalized and scaled as:

.. math:: S = C*\frac{s}{s+N}

where :math:`s` is assumed to be the sum of the flowrates of any solids formed in the reaction.

Only one of :math:`Q` and :math:`S` can be greater than zero at any time, which can be written in the form of a complementarity constraint as:

.. math:: Q - max(0, Q-S) == 0

The :math:`\max()` function is provided as an IDAES utility which provides a smooth max expression with mutable smoothing parameter, :math:`\epsilon`.

**Parameters**

.. csv-table::
:header: "Symbol", "Parameter Name", "Indices", "Default", "Description"

":math:`O`", "reaction_order", "liq, component", "\-", "Reaction order"
":math:`C`", "s_scale", "\-", "10", "Scaling factor for the solid term"
":math:`N`", "s_norm", "\-", "1e-4 (`k_eq_ref` if provided)", "Normalization parameter for the solid term"
":math:`\epsilon`", "eps", "\-", "1e-4", "Smoothing factor"

Providing a `reaction_order` dict is optional. If one is not provided, it will be assumed that this is an elementary reaction and that the reaction order is equal to the stoichiometric coefficient for all components in non-solid phases (the contribution of solid phases is assumed to be constant and included in the equilibrium constant, thus an order of zero is assumed).

Log Solubility Product (log_solubility_product)
-----------------------------------------------

The method uses a complementarity formulation for solid precipitation using a log form of solubility product.

For precipitation at equilibrium,

.. math:: Q = log(k_{sp}) - \sum_{(liq, j)}{O_{(liq,j)}*log(x_{(liq,j)})}

* :math:`Q = 0` only holds if solids (S) are present in the system, :math:`S \geq 0`.
* :math:`Q \geq 0` if the system is subsaturated and no solids (S) are present, :math:`S = 0`.

:math:`S` represents the solid presentation and is normalized and scaled as:

.. math:: S = C\frac{s}{s+N}

where :math:`s` is assumed to be the sum of the flowrates of any solids formed in the reaction.

Only one of :math:`Q` and :math:`S` can be greater than zero at any time, which can be written in the form of a complementarity constraint as:

.. math:: Q - max(0, Q-S) == 0

The :math:`\max()` function is provided as an IDAES utility which provides a smooth max expression with mutable smoothing parameter, :math:`\epsilon`.

**Parameters**

.. csv-table::
:header: "Symbol", "Parameter Name", "Indices", "Default", "Description"

":math:`O`", "reaction_order", "liq, component", "\-", "Reaction order"
":math:`C`", "s_scale", "\-", "1", "Scaling factor for the solid term"
":math:`N`", "s_norm", "\-", "1e-4 (`k_eq_ref` if provided)", "Normalization parameter for the solid term"
":math:`\epsilon`", "eps", "\-", "1e-4", "Smoothing factor"

Providing a `reaction_order` dict is optional. If one is not provided, it will be assumed that this is an elementary reaction and that the reaction order is equal to the stoichiometric coefficient for all component in non-solid phases (the contribution of solid phases is assumed to be constant and included in the equilibrium constant, thus an order of zero is assumed).

This file was deleted.

Loading

0 comments on commit 3ddcbbe

Please sign in to comment.