HoldupStatic

Introduction

The HoldupStatic block is used for specific cases of holdups where only a single Property Block is required for the control volume. This is primarily intended for dead zones with no through-flow of material or energy (only heat and mass transfer terms). HoldupStatic blocks are distinguished by only having a single Property Block associated with them (Holdup0D on the other hand has separate inlet and outlet property blocks), and the balance equations written by HoldupStatic do not include flow terms.

Using HoldupStatic for Ideal Mixers and Splitters

HoldupStatic can be used in special cases for units with through-flow where there are multiple inlets and/or outlets - such as in the core IDAES Mixer and Splitter models. In these cases, an mixer and/or splitter unit is also part of the Holdup Block (due to the multiple inlets or outlets) which already contain Property Blocks for the separate inlet/outlet streams as well as material, energy and momentum balances for mixing/splitting the material. Rather than create unnecessary duplicates of these, HoldupStatic is used with no balance equations to create a container for the mixer/splitter and a Property Block for the mixed material which is sufficient for modeling an ideal mixer or splitter unit.

HoldupStatic Equations

HoldupStatic contains support for a number of different forms of the material, energy and momentum balances, as well as options for controlling which terms will appear in these equations. The different options available are outlined below along with the equations written with each choice. In all cases, the extensive flow terms are provided by the associated Property Block.

Material Balance Types

HoldupStatic provides support for three different types of material balance.

  • component_phase - material balances are written for each component in each phase (e.g. separate balances for liquid water and steam). Property packages may include information to indicate that certain species do not appear in all phases, and material balances will not be written in these cases (if include_holdup is True holdup terms will still appear for these species, however these will be set to 0). The equations written by the Holdup block for phase-component balances have the form:
\[\frac{\partial M_{t, p, j}}{\partial t} = N_{kinetic, t, p, j} + N_{equilibrium, t, p, j} + N_{pe, t, p, j} + N_{transfer, t, p, j}\]

where \(M_{t, p, j}\) is the holdup of component \(j\) in phase \(p\) within the control volume and time \(t\), \(N_{kinetic, t, p, j}\), \(N_{equilibrium, t, p, j}\) and \(N_{pe, t, p, j}\) are the generation of species \(j\) in phase \(p\) by kinetic, chemical equilibrium and phase equilibrium controlled reactions respectively, and \(N_{transfer, t, p, j}\) is a term to allow for other forms of mass transfer within or across the system boundary.

  • component_total - material balances will be written for each component across all phases (e.g. one balance for both liquid water and steam). Phase equilibrium terms are not included in this form of the material balance. This form can be useful for steady-state systems with phase-equilibrium. However users should be careful using this form of the material balance, especially for dynamic systems, as there are often additional degrees of freedom that need to be specified. The equations written by the Holdup block for total component balances have the form:
\[\sum_p{\frac{\partial M_{t, p, j}}{\partial t}} = \sum_p{N_{kinetic, t, p, j}} + \sum_p{N_{equilibrium, t, p, j}} + \sum_p{N_{transfer, t, p, j}}\]
  • element_total - material balances are written for each element in the system (e.g. one material balance for hydrogen and one for oxygen). Only flow and mass transfer terms are included in this form of the material balance. This form of the material balance can be useful for certain reactive systems, and is necessary for performing Gibbs energy minimization. The equations written by the Holdup block for total element balances have the form:
\[\sum_p{\frac{\partial M_{t, p, e}}{\partial t}} = \sum_p{N_{transfer, t, p, e}}\]

where \(M_{t, p, e}\) is the holdup of element \(e\) in phase \(p\) within the control volume at time \(t\) and \(N_{transfer, t, p, e}\) is a term to allow for other forms of mass transfer within or across the system boundary.

  • none - no material balances are written.

Energy Balance Types

HoldupStatic currently supports only one form of energy balance.

  • enthalpy_total - one enthalpy balance is written for the entire holdup, summing contributions from all phases. The form of the total enthalpy balance written by the holdup block is:
\[s \times \sum_p{\frac{\partial E_{t, p}}{\partial t}} = s \times Q_t + s \times W_t\]

where \(E_p\) is the holdup of enthalpy in phase \(p\) at time \(t\), \(Q_t\) is the heat transferred into the system, \(W_t\) is the work transfer into the system and \(s\) is a scaling factor.

  • none - no energy balances are written.

Momentum Balance Types

As HoldupStatic consists of a single isolated, well-mixed control volume there is no momentum transfer into or out of the volume. As such, there is no need to write a momentum balance for a HoldupStatic block. However, HoldupStatic still maintains the momentum_balance_type construction argument, which can be passed on to associated mixer and splitter blocks.

Supporting Equations

HoldupStatic also creates a number of supporting Variables and Constraints as required by the balance equations, which are summarized below.

Phase Fraction

For systems with more than one phase present (determined automatically from the phase list provided by the property package), HoldupStatic creates a phase fraction variable for each phase, and enforces the following constraint at all points in time \(t\):

\[\sum_p{\phi_{t, p}} = 1\]

When only one phase is present, \(\phi\) is automatically substituted with 1 in all equations.

Holdup Calculations

HoldupStatic also calculates the holdup terms for the material and energy balances (unless include_holdup is False), and automatically writes Constraints for these based on information provided by the property package. The form of the holdup constraint for component balances is:

\[M_{t, p, j} = V_t \times \phi_{t, p} \times \rho_{t, p, j}\]

where \(M_{t, p, j}\) is the holdup of species \(j\) in phase \(p\) at time \(t\), \(V_t\) is the volume of the control volume at time \(t\) (this supports control volumes of varying volume), \(\phi_{t, p}\) is the phase fraction of phase \(p\) at time \(t\) and \(\rho_{t, p, j}\) is the material density of component \(j\) in phase \(p\) at time \(t\) (provided by the Property Block). For phase-component pairs which do not exist (as indicated by the Property Block), the following Constraint is written instead (this is required to close the degrees of freedom):

\[M_{t, p, j} = 0\]

For holdup blocks using element balances, an elemental holdup is required instead, which is calculated as follows:

\[M_{t, p, e} = V_t \times \phi_{t, p} \times \rho_{t, p, j} \times e_{j, e}\]

where \(e_{j, e}\) is the number of moles of element \(e\) per mole of component \(j\).

For the holdup term in the energy balances, the following Constraints are written:

\[E_{t, p} = V_t \times \phi_{t, p} \times \rho e_{t, p}\]

where \(E_{t, p}\) is the energy holdup in phase \(p\) at time \(t\) and \(\rho e_{t, p}\) is the volumetric energy density in phase \(p\) (provided by the Property Block).

Stoichiometric Constraints

HoldupStatic also automatically generates stoichiometric Constraints to ensure conservation of mass (and elements) between products and reactants in all types of reactions (including phase equilibrium). For kinetic and chemical equilibrium reactions, an extent of reaction terms is generated for each reaction, and Constraint is written to relate these to the generation terms in the balance equations. The form of these equations is:

\[N_{t, p, j} = \sum_r{\nu_{r, p, j} \times X_{t, r}}\]

where \(N_{t, p, j}\) is the generation of species \(j\) in phase \(p\) at time \(t\), \(\nu_{r, p, j}\) is the stoichiometric coefficient for the generation of species \(j\) in phase \(p\) by reaction \(r\) and \(X_{t, r}\) is the extent of reaction \(r\) at time \(t\).

For phase equilibrium reactions, the stoichiometric constraints can be simplified as it is known that the equilibrium is 1:1 between the same species in two different phases. In this case, rather than write separate generation terms for each phase-component pair, a generation term is written for each phase equilibrium reaction that occurs, and the term substituted directly into the material balance (with a \(\pm 1\) factor to determine which phase is ‘product’ phase and which the ‘reactant’ phase).

Element Flow Terms

Element balances require an additional set of equations for relating component based flows to their element equivalents. When element balances are chosen for a holdup block, the following additional Constraints are written:

\[F_{t, p, e} = F_{t, p, j} \times e_{j, e}\]

where \(e_{j, e}\) is the number of moles of element \(e\) per mole of component \(j\).

Construction Options

Options available in HoldupStatic for specifying which terms should appear within the balance equations. Most terms in the balance equations have an associated construction argument, which are described below:

  • dynamic - controls whether accumulation terms will be included in the balance equations, and the necessary constraints for relating these to the holdup terms. If set to True, accumulation terms will be constructed and included in the model. The number of accumulation terms created depends on the number of time points, phases and components present in the model.
  • include_holdup - controls whether terms and constraints for the holdup of material and energy should be constructed (momentum holdup is not yet supported). If set to True, material and energy holdup terms are created, along with constraints linking these to the volume of the holdup and the material and energy densities. If dynamic = True, include_holdup must also be True (this is automatically checked by the framework, and a warning raised if set incorrectly). If dynamic = False, then include_holdup may be set to True or False as desired by the user, depending on whether the holdup terms are required in the flowsheet.
  • has_rate_reactions - controls whether generation terms should be constructed for rate controlled reactions. If this is True, generation terms are created for each phase and component pair and included in the material balance equations. Additionally, an extent of reaction term is created for each reaction identified in the associated property package, and linked to the generation term via stoichiometric constraints. The Unit model or user is then expected to provide a set of Constraints relating the extent of reaction terms to the performance of the given unit operation.
  • has_equilibrium_reactions - controls whether generation terms should be constructed for equilibrium controlled reactions (excluding phase equilibrium). If this is True, generation terms are created for each phase-component pair, and included in the material balance equations. Additionally, stoichiometric constraints are written relating the different generation term. The property package is expected to provide a set of equilibrium constraints which enforce the equilibrium conditions.
  • has_phase_equilibrium - controls whether generation terms should be constructed for phase equilibrium reactions. If this is True, generation terms are created for each phase-component pair, and included in the material balance equations. The property package is expected to provide a set of equilibrium constraints which enforce the equilibrium conditions.
  • has_mass_transfer - controls whether mass transfer terms should be constructed in the material balance equations. If True, the generic mass transfer terms will be included, and the UnitModel or user will need to provide constraints for these terms.
  • has_heat_transfer - controls whether the heat transfer term should be included in the energy balance equation. If True, the \(Q\) term is constructed and the UnitModel or user will need to provide a constraint for this term.
  • has_work_transfer - controls whether the work transfer term should be included in the energy balance equation. If True, the \(W\) term is constructed and the UnitModel or user will need to provide a constraint for this term.
  • has_pressure_change - unused.

HoldupStatic Variables

The following is a table of all variables that may be constructed by a HoldupStatic block (depending on options chosen), along with the names used to identify these quantities within actual code (indices are shown in the same order they appear in the code).

Variable Name
\(V_t\) volume
\(M_{t, p, j}\) material_holdup
\(\frac{\partial M_{t, p, j}}{\partial t}\) material_accumulation
\(M_{t, p, e}\) element_holdup
\(\frac{\partial M_{t, p, e}}{\partial t}\) element_accumulation
\(E_{t, p}\) energy_holdup
\(\frac{\partial E_{t, p}}{\partial t}\) energy_accumulation
\(\phi_{t, p}\) phase_fraction
\(N_{kinetic, t, p ,j}\) rate_reaction_generation
\(N_{equilibrium, t, p ,j}\) equilibrium_reaction_generation
\(N_{pe, t, r}\) phase_equilibrium_generation
\(N_{transfer, t, p, j}\) mass_transfer_term
\(N_{transfer, t, p, e}\) elemental_mass_transfer
\(Q_t\) heat
\(W_t\) work
\(X_{kinetic, t, r}\) rate_reaction_extent
\(X_{equilibrium, t, r}\) equilibrium_reaction_extent

Additionally, one scaling factor is generated for the energy balances, named scaling_factor_energy.

Initialization

HoldupStatic has an initialization method which can be called as part of initializing an associated UnitModel. The initialization method takes a set of state arguments which is passed on to the associated property package, mixers and splitters. As initialization of UnitModels often require the inlet state of the unit to be held at a fixed state whilst initializing the unit, the holdup initialization routine can be instructed to hold the inlet state at a fixed state until instructed to unfix it (an associated release_state method exists for this purpose). The procedure followed by the initialization routine is as follows:

  1. If an inlet mixer is present, the initialization routine of the mixer is called.

2. The Property Block is initialized (properties). 4. If an outlet splitter is present, the initialization routine of the splitter is called. 5. If not instructed to hold the inlet state fixed, the release_state method is called, otherwise a dictionary of information on what state variables were fixed is returned to be used when calling release_state.

The associated release_state method takes the dictionary of flags returned above, and uses this to unfix any variables fixed during initialization.

HoldupStaticData Class

class idaes.core.holdup.HoldupStaticData(component)[source]

Static Holdup Class

This class is designed to be used for unit operations zero volume or holdups with no through flow (such as dead zones). This type of holdup has only a single PropertyBlock index by time (Holdup0D has two).

build()[source]

Build method for HoldupStatic blocks. This method calls submethods to setup the necessary property blocks, distributed variables, material, energy and momentum balances based on the arguments provided by the user.

Parameters:None
Returns:None
initialize(state_args=None, outlvl=0, optarg=None, solver='ipopt', hold_state=True)[source]

Initialisation routine for holdup (default solver ipopt)

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 initialisation routine

    • 0 = no output (default)
    • 1 = return solver state for each step in routine
    • 2 = include solver output infomation (tee=True)
  • optarg – solver options dictionary object (default=None)
  • solver – str indicating whcih solver to use during initialization (default = ‘ipopt’)
  • hold_state
    flag indicating whether the initialization routine
    should unfix any state variables fixed during initialization (default=True). - True - states varaibles are not unfixed, and
    a dict of returned containing flags for which states were fixed during initialization.
    • False - state variables are unfixed after
      initialization by calling the relase_state method
Returns:

If hold_states is True, returns a dict containing flags for which states were fixed during initialization.

model_check()[source]

This method exectues the model_check methods on the associated property blocks (if they exist). This method is generally called by a unit model as part of the unit’s model_check method.

Parameters:None
Returns:None
release_state(flags, outlvl=0)[source]

Method to relase state variables fixed during initialisation.

Keyword Arguments:
 
  • flags – dict containing information of which state variables were fixed during initialization, and should now be unfixed. This dict is returned by initialize if hold_state = True.
  • outlvl – sets output level of of logging
Returns:

None