Zero Order Unit Model Base Class

The zero-order unit model base class is intended to form the basis for a library of generic single inlet-two outlet (SITO) unit models using recovery and removal fractions to partition the incoming flow between the two outlets. This base class is not intended to be used by itself and requires the user to define a derived class before it can be used in a flowsheet.

Usage

# Import IDAES Core components
from idaes.core import declare_process_block_class

# Import base class
from watertap.core.zero_order_sito import SITOBaseData

# Create derived class with decorator
@declare_process_block_class("DerivedModel")
class DerivedModelData(SITOBaseData):

  def build(self):

    # Create attributes to indicate whether pressure change terms should be created
    # This must happen before calling super().build()
    self._has_deltaP_treated = True
    self._has_deltaP_byproduct = True

    # Call super().build()
    super().build()

Model Structure

The SITO base class 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.

Property Package Requirements

The SITO base class makes a number of assumptions about the structure of the associated property package, and contains a number of checks to ensure the property package meets these requirements. The requirements for the property package are:

  1. A single phase named Liq.

  2. A single Solvent species named H2O (package must define a solvent_set with length that contains “H2O”).

  3. All other species are defined as Solutes (package must define a solute_set and the component_list must be the union of solvent_set and solute_set).

  4. The property package must define flow_vol, conc_mass_comp, pressure and temperature as properties.

The SITO base class is formulated in such a way that if flow_vol, conc_mass_comp, pressure and temperature are the state variables used by the property package, then the resulting unit model will be linear if the removal and recovery fractions are fixed (or bilinear if they are not). The ideal water property package has been designed specifically to be used with models deriving from the SITO base class and meets all of the above requirements.

Variables

The SITO base class create the following variables in addition to those created by the StateBlocks.

Variable

Name

Indices

Notes

\(r_{t}\)

recovery_vol

time

Fraction of volumetric flow in inlet that goes to treated

\(f_{t,j}\)

removal_mass_solute

time, solutes

Fraction of mass flow of each solute that goes to byproduct stream

\(\Delta P_{treated,t}\)

deltaP_treated

time

Pressure difference between inlet and treated stream. Optional.

\(\Delta P_{byproduct,t}\)

deltaP_byproduct

time

Pressure difference between inlet and byproduct stream. Optional.

The \(\Delta P_{treated,t}\) and \(\Delta P_{byproduct,t}\) terms are optional and are only created if the self._has_deltaP_treated and self._has_deltaP_byproduct attributes are True respectively.

Constraints

The SITO base class writes the following constraints which relate the inlet state to those in the treated and byproduct streams. As mentioned previously, these constraints are formulated such that they will be linear if flow_vol, conc_mass_comp, pressure and temperature are the state variables used by the property package and the recovery and removal fractions are fixed.

First, a volumetric flow recovery equation is written to relate the flowrate at the treated to that at the inlet:

water_recovery_equation(t):

\[r_t \times Q_{inlet,t} = Q_{treated,t}\]

where \(Q_t\) is volumetric flowrate at time \(t\).

Next, a volumetric flow balance is written to relate the flowrate in the byproduct stream to that in the inlet and treated.

flow_balance(t):

\[Q_{inlet,t} = Q_{treated,t} + Q_{byproduct,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):

\[f_{t, j} \times C_{inlet,t, j} = (1-r_t) \times C_{byproduct,t,j}\]

where \(C_{t,j}\) is mass concentration of solute \(j\) at time \(t\).

A similar constraint is then written for each solute to relate the solute concentration in the treated stream to that in the inlet stream.

solute_treated_equation(t, j):

\[(1-f_{t, j}) \times C_{inlet,t, j} = r_t \times C_{treated,t,j}\]

Pressure balances are then written for each steam, including the \(\Delta P\) terms if present.

treated_pressure_constraint(t):

\[P_{inlet,t} = P_{treated,t} [+ \Delta P_{treated,t}]\]

byproduct_pressure_constraint(t):

\[P_{inlet,t} = P_{byproduct,t} [+ \Delta P_{byproduct,t}]\]

where \(P_t\) is the pressure at time \(t\).

Finally, temperature equality constraints are written to equate the temperature in the treated and byproduct streams to that in the inlet.

treated_temperature_equality(t):

\[T_{inlet,t} = T_{treated,t}\]

byproduct_temperature_equality(t):

\[T_{inlet,t} = T_{byproduct,t}\]

where \(T_t\) is the temperature at time \(t\).

Class Documentation

class watertap.core.zero_order_sito.SITOBaseData(component)[source]

Standard base class for single inlet-two outlet unit models.

This class is intended to be used for creating derived model classes and cannot be instantiated by itself. When creating derived classes, developers must set the ‘_has_deltaP_treated` and _has_deltaP_byproduct attributes on the model before calling super().build(). These attributes determine whether the deltaP terms for the treated and byproduct streams are added to the model and included in the pressure constraints.

build()[source]

General build method for UnitModelBlockData. This method calls a number of sub-methods which automate the construction of expected attributes of unit models.

Inheriting models should call super().build.

Parameters

None

Returns

None

initialize(state_args=None, outlvl=0, solver=None, optarg=None)[source]

Initialization routine for single inlet-two outlet unit models.

Keyword Arguments
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None, use default solver options)

  • solver – str indicating which solver to use during initialization (default = None, use default IDAES solver)

Returns

None