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 Initializer
is the default for all unit models in IDAES unless the unit model overloads this with a different option.
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.
- constraint_tolerance
Tolerance for checking constraint convergence
- output_level
Set output level for logging messages
- solver
Solver to use for initialization
- solver_options
Dict of options to pass to solver
- writer_config
Dict of writer_config arguments to pass to solver
- default_submodel_initializer
Default Initializer object to use for sub-models. Only used if no Initializer defined in submodel_initializers.
- always_estimate_states
Whether initialization routine should estimate values for state variables that already have values. Note that if set to True, this will overwrite any initial guesses provided.
- initialize(model, initial_guesses=None, json_file=None, output_level=None, exclude_unused_vars=False)#
Execute full initialization routine.
- Parameters:
model (Block) – Pyomo model to be initialized.
initial_guesses (dict) – dict of initial guesses to load.
json_file (str) – file name of json file to load initial guesses from as str.
output_level – (optional) output level to use during initialization run (overrides global setting).
exclude_unused_vars (bool) – whether to ignore unused variables when doing post-initialization checks.
Note - can only provide one of initial_guesses or json_file.