idaes.models.unit_models.mscontactor
The Multi-Stream Contactor is a general purpose model for unit operations involving mass and energy transfer between multiple immiscible streams, such as membrane filtration systems and solvent extraction processes. The Multi-Stream Contactor provides a general framework for writing the necessary material, energy and momentum balances for each stream and includes terms for inter-stream transfer phenomena. The model also supports modeling these systems as a series of finite elements (either representing a series of well-mixed stages or a one-dimensional variation using a 1st order finite difference approximation). Finally, the model also supports the presence of side feeds/draws for each stream.
When adding a multi-stream contactor to a flowsheet, users can define the options they wish to use for the unit and each stream as shown below. A list of all available configuration options is shown later in the class documentation.
import pyomo.environ as pyo # Pyomo environment from idaes.core import FlowsheetBlock, FlowDirection from idaes.models.unit_models import MSContactor from idaes.models.properties import iapws95
# Create an empty flowsheet and steam property parameter block. model = pyo.ConcreteModel() model.fs = FlowsheetBlock(dynamic=False) model.fs.properties = iapws95.Iapws95ParameterBlock()
# Add a multi-stream contactor model to the flowsheet. model.fs.contactor = MSContactor( number_of_finite_elements=2, streams={ "stream1": { "property_package": model.fs.properties }, "stream2": { "property_package": model.fs.properties, "flow_direction": FlowDirection.backward, }, }, )
As a general purpose model, the degrees of freedom of the multi-stream contactor models depend on the options chosen by the user. The potential degrees of freedom are:
- states for feed blocks for each stream,
- material transfer terms (finite elements × interacting streams × common components),
- energy transfer terms if included (finite elements × interacting streams)
- pressure change terms if included (finite elements × streams with pressure change)
Due to the custom nature of multi-stream contactors, this model does not make use of control volumes. Instead, a set of StateBlocks (named using the name given in the streams
configuration dictionary) are created for each stream indexed by time and the set of finite elements, with an additional StateBlock for the feed state (named using the stream name appended with _inlet_state
) indexed only by time (unless has_feed
is set to False
for that stream). For streams with side streams (feed or draw), an additional set of indexed StateBlocks (named using the stream name appended with _side_stream_state
) is created for the side states which are indexed by time and the set of side states for that stream.
If reactions are required for a given stream, a set of indexed ReactionBlocks (named using the stream name appended with _reactions
) are created indexed by time and the set of finite elements.
All other variables and constraints are written at the unit model level.
The multi-stream contactor creates the following variables. Here t
indicates the time domain and x
indicates finite element.
Variable | Name | Description | Notes |
---|---|---|---|
Mt, x, s1, s2, j | material_transfer_term | Material transfer term for component j between stream s1 and s2 at x and t |
|
Et, x, s1, s2 | energy_transfer_term | Energy transfer term between stream s1 and s2 at x and t |
Only if energy balances included |
Qt, x, s | stream + "_heat" | External heat transfer into stream s at x and t |
|
ΔPt, x, s |
|
|
|
Grate, t, x, s, p, j | stream + "_rate_reaction_generation" | Generation of component j in phase p due to rate reactions in stream s at x t |
Only if rate reactions present for stream |
Gequil, t, x, s, p, j | stream + "_equilibrium_reaction_generation" | Generation of component j in phase p due to equilibrium reactions in stream s at x and t |
Only if equilibrium reactions present for stream |
Ginher, t, x, s, p, j | stream + "_inherent_reaction_generation" | Generation of component j in phase p due to inherent reactions in stream s at x and t |
Only if inherent reactions present for stream |
Xrate, t, x, s, r | stream + "_rate_reaction_extent" | Extent of rate reaction r in stream s at x and t |
Only if rate reactions present for stream |
Xequil, t, x, s, r | stream + "_equilibrium_reaction_extent" | Extent of equilibrium reaction r in stream s at x and t |
Only if equilibrium reactions present for stream |
Xinher, t, x, s, r | stream + "_inherent_reaction_extent" | Extent of inherent reaction r in stream s at x and t |
Only if inherent reactions present for stream |
In all cases, the multi-stage contactor model writes a set of material balances for each stream in the model. For component j
in stream s
the following constraint, named stream + "_material_balance"
, is written for all finite elements x
:
0 = ∑pFt, x−,s, p, j − ∑pFt, x, s, p, j + [∑pFside, t, x, s, p, j] + ∑oMt, x, s, o, j + [∑pGrate, t, x, s, p, j+∑pGequil, t, x, s, p, j+∑pGinher, t, x, s, p, j]
where F
is the material flow term, x-
represents the the previous finite element (x-1
in the case of co-current flow and x+1
in the case of counter-current flow), F_side
is the material flow term for a side stream (if present) and o
represents all other streams in the model (for cases where s
is the second index (i.e., M{t,x,o,s,j}) the term is multiplied by -1). The reaction generation terms are only included if the appropriate reaction type is supported by the reaction or property package for the stream.
For systems including rate reactions, the following constraint, names stream + "_rate_reaction_constraint"
, is written to relate the generation of component j
in phase p
to the extent of each rate reaction as shown below where αr, p, j is the stoichiometric coefficient for component j
in phase p
for reaction r
.
Grate, t, x, s, p, j = ∑rαrater, p, j × Xrate, t, x, s, r
Equivalent constraints are written for equilibrium and inherent reactions as necessary.
For streams including energy balances (has_energy_balance = True
) the following constraint (named stream + "_energy_balance"
) is written at each finite element:
0 = ∑pHt, x−,s, p − ∑pHt, x, s, p + [∑pHside, t, x, s, p] + ∑oEt, x, s, o + [Qt, x, s] + [∑rateΔHrxn, r × Xrate, t, x, s, r + ∑equilΔHrxn, r × Xequil, t, x, s, r + ∑inherΔHrxn, r × Xinher, t, x, s, r]
where H
represent enthalpy flow terms and ΔHrxn represents heat of reaction. The heat of reaction terms are only included if a reaction package is provided for the stream AND the configuration option has_heat_of_reaction = True
is set for the stream.
For streams including pressure balances (has_pressure_balance = True
) the following constraint (named stream + "_pressure_balance"
) is written at each finite element:
0 = Pt, x−,s − Pt, x, s + [ΔPt, x, s]
where P
represents pressure. For streams with side streams, the following pressure equality constraint (names stream + "_side_stream_pressure_balance"
) is also written:
Pt, x, s = Pside, t, x, s
MSContactorInitializer
MSContactor
Argument | Type | Default | Description |
---|---|---|---|
property_package | PropertyParameter Block | None | Property package associated with stream |
property_package_args | dict | None | Configuration arguments for State Blocks |
reaction_package | Reaction Parameter Block | None | Reaction package associated with stream |
reaction_package_args | dict | None | Configuration arguments for Reaction Blocks |
flow_direction | FlowDirection Enum | forward | Direction of flow for stream |
has_feed | bool | True | Whether stream has a feed Port and inlet state, or if all flow is provided via mass transfer. |
has_rate_reactions | bool | False | Whether rate-based reactions occur in stream. |
has_equilibrium_reactions | bool | False | Whether equilibrium-based reactions occur in stream. |
has_energy_balance | bool | True | Whether to include energy balance for stream. |
has_heat_transfer | bool | False | Whether to include external heat transfer terms in energy balance for stream. |
has_heat_of_reaction | bool | False | Whether heat of reaction terms should be included in energy balance for stream. |
has_pressure_balance | bool | True | Whether to include pressure balance for stream. |
has_pressure_change | bool | False | Whether to include ΔP terms in pressure balance for stream. |
side_streams | list | None | Finite elements at which a side stream should be included. |