Single Control Volume Initializer¶
The Single Control Volume Initializer is a hierarchical Initializer
suitable for any unit model that involves a single control volume (either 0- or 1-dimensional control volume).
This routine applies a hierarchical approach to initialize the StateBlock(s) within the model followed by calling a solver to converge the full model. The following steps are used to initialize the model:
Determine if the control volume is 0- or 1-dimensional.
For 0-D control volumes, initialize the inlet
StateBlock
using the appropriateInitializer
followed by the outletStateBlock
. The outletStateBlock
may be initialized using anInitializer
or by copying the state of the inletStateBlock
.For 1-D control volumes, initialize the indexed
StateBlock
using the appropriateInitializer
.
If present, initialize the
ReactionBlock
using the appropriateInitializer
.Call user-specified solver to converge the full model.
This Initializer
also supports plug-ins to the main model (sub-models which are attached to the main model after construction, such as costing calculations). If plug-ins are present, they are initialized according to the default sequence which is as follows:
After fixing the degrees of freedom by before initializing the main model, iterate through
model.initialization_order
and callSubmodelInitializer.plugin_prepare
for all plug-ins found.Iterate through
model.initialization_order
again and either call the main model initialization routine or SubmodelInitializer.plugin_initialize` as appropriate.Call user specified solver to converge the full model with all plug-ins.
iterate through
model.initialization_order
in reverse and either callSubmodelInitializer.plugin_finalize
for all plug-ins.
Users can specify Initializers
for each sub-model (StateBlocks
and plug-ins); if users do not specify an Initializer
for a sub-model then the routine will default to either i) the default Initializer
specified when the main model Initializer
was instantiated or ii) the default Initializer
for the sub-model (specified in submodel.default_initializer
).
SingleControlVolumeUnitInitializer Class¶
- class idaes.core.initialization.general_hierarchical.SingleControlVolumeUnitInitializer(**kwargs)[source]¶
This is a general purpose Initializer object for unit models which have a single Control Volume named ‘control_volume’.
For details of the initialization routine, please see the documentation.
- Keyword Arguments
constraint_tolerance – Tolerance for checking constraint convergence
output_level – Set output level for logging messages
default_submodel_initializer – Default Initializer object to use for sub-models. Only used if no Initializer defined in submodel_initializers.
solver – Solver to use for initialization
solver_options – Dict of options to pass to solver
- initialize(model, initial_guesses=None, json_file=None)¶
Execute full initialization routine.
- Parameters
Note - can only provide one of initial_guesses or json_file.
- precheck(model)¶
Check for satisfied degrees of freedom before running initialization.
- Parameters
model (Block) – Pyomo Block to fix states on.
- Returns
None
- Raises
InitializationError if Degrees of Freedom do not equal 0. –