Single Inlet - Double Outlet Helper Methods
The build_sido method is intended to be used to rapidly construct a standard set of material balance equations for zero-order type models with a single inlet and two outlets.
Usage
from idaes.core import declare_process_block_class
from watertap.core import build_sido, ZeroOrderBaseData
@declare_process_block_class("NanofiltrationZO")
class NanofiltrationZOData(ZeroOrderBaseData):
CONFIG = ZeroOrderBaseData.CONFIG()
def build(self):
super().build()
self._tech_type = "nanofiltration"
build_sido(self)
Model Structure
The build_sido method constructs a simple representation of unit operation with a single inlet (named inlet) and two outlets (named treated and byproduct). A StateBlock is constructed for the inlet and each outlet with a Port associated with each of these.
Variables
The build_sido method creates the following variables in addition to those created by the StateBlocks.
Variable |
Name |
Indices |
Notes |
---|---|---|---|
\(r_{t}\) |
recovery_frac_mass_H2O |
time |
Fraction of mass flow of water in inlet that goes to treated stream. |
\(f_{t,j}\) |
removal_frac_mass_solute |
time, solutes |
Fraction of mass flow of each solute that goes to byproduct stream. |
Constraints
The build_sido method writes the following constraints which relate the inlet state to those in the treated and byproduct streams. First, a mass recovery equation for water is written to relate the flowrate at the treated outlet to that at the inlet:
water_recovery_equation(t):
where \(M_{t,H2O}\) is mass flowrate of water at time \(t\).
Next, a mass balance for water is written to relate the flowrate in the byproduct stream to that in the inlet and treated streams.
flow_balance(t):
Removal constraints are then written for each solute to relate the solute concentration in the byproduct stream to that in the inlet stream.
solute_removal_equation(t, j):
A mass balance constraint is then written for each solute.
solute_treated_equation(t, j):
Module Documentation
Helper method for constructing material balances for zero-order type models with one inlet and two outlets.
- Three StateBlocks are added with corresponding Ports:
properties_inlet
properties_treated
properties_byproduct
- Two additional variables are added:
recovery_vol (indexed by time)
removal_frac_mass_solute (indexed by time and solute)
- Four additional constraints are added to represent the material balances
water_recovery_equation (indexed by time)
flow_balance (indexed by time)
solute_removal_equation (indexed by time and solute)
solute_treated_equation (indexed by time and solute)
This method also sets private attributes on the unit model with references to the appropriate initialization and scaling methods to use and to return the inlet volumetric flow rate.