watertap.unit_models.translators package
Submodules
watertap.unit_models.translators.translator_adm1_asm1 module
Translator block representing the ADM1/ASM1 interface.
- Assumptions:
Steady-state only
Model formulated from:
Copp J. and Jeppsson, U., Rosen, C., 2006. Towards an ASM1 - ADM1 State Variable Interface for Plant-Wide Wastewater Treatment Modeling. Proceedings of the Water Environment Federation, 2003, pp 498-510.
- class watertap.unit_models.translators.translator_adm1_asm1.ADM1ASM1Scaler(**kwargs)[source]
Bases:
CustomScalerBaseDefault modular scaler for the ADM1-ASM1 translator block. This Scaler relies on the associated property and reaction packages, either through user provided options (submodel_scalers argument) or by default Scalers assigned to the packages.
- zero_tolerance
Value at which a variable will be considered equal to zero for scaling.
- max_variable_scaling_factor
Maximum value for variable scaling factors.
- min_variable_scaling_factor
Minimum value for variable scaling factors.
- max_constraint_scaling_factor
Maximum value for constraint scaling factors.
- min_constraint_scaling_factor
Minimum value for constraint scaling factors.
- max_expression_scaling_hint
Maximum value for expression scaling hints.
- min_expression_scaling_hint
Minimum value for constraint scaling hints.
- overwrite
Whether to overwrite existing scaling factors.
- constraint_scaling_routine(model, overwrite: bool = False, submodel_scalers: dict | None = None)[source]
Routine to apply scaling factors to constraints in model. Submodel Scalers are called for the property and reaction blocks. All other constraints are scaled using the inverse maximum scheme. :param model: model to be scaled :param overwrite: whether to overwrite existing scaling factors :param submodel_scalers: dict of Scalers to use for sub-models, keyed by submodel local name
- Returns:
None
- variable_scaling_routine(model, overwrite: bool = False, submodel_scalers: dict | None = None)[source]
Routine to apply scaling factors to variables in model. :param model: model to be scaled :param overwrite: whether to overwrite existing scaling factors :param submodel_scalers: dict of Scalers to use for sub-models, keyed by submodel local name
- Returns:
None
- class watertap.unit_models.translators.translator_adm1_asm1.TranslatorDataADM1ASM1(component)[source]
Bases:
TranslatorDataTranslator block representing the ADM1/ASM1 interface
- default_scaler
alias of
ADM1ASM1Scaler
- initialize_build(state_args_in=None, state_args_out=None, outlvl=0, solver=None, optarg=None)[source]
This method calls the initialization method of the state blocks.
- Keyword Arguments:
state_args_in – a dict of arguments to be passed to the inlet property package (to provide an initial state for initialization (see documentation of the specific property package) (default = None).
state_args_out – a dict of arguments to be passed to the outlet property package (to provide an initial state for initialization (see documentation of the specific property package) (default = None).
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 solver)
- Returns:
None
- class watertap.unit_models.translators.translator_adm1_asm1.Translator_ADM1_ASM1(*args, **kwds)
Bases:
ProcessBlock- Parameters:
rule (function) – A rule function or None. Default rule calls build().
concrete (bool) – If True, make this a toplevel model. Default - False.
ctype (class) –
Pyomo ctype of the block. Default - pyomo.environ.Block
Config args
- dynamic
Translator blocks are always steady-state.
- has_holdup
Translator blocks do not contain holdup.
- outlet_state_defined
Indicates whether unit model will fully define outlet state. If False, the outlet property package will enforce constraints such as sum of mole fractions and phase equilibrium. default - True. Valid values: { True - outlet state will be fully defined, False - outlet property package should enforce summation and equilibrium constraints.}
- has_phase_equilibrium
Indicates whether outlet property package should enforce phase equilibrium constraints. default - False. Valid values: { True - outlet property package should calculate phase equilibrium, False - outlet property package should notcalculate phase equilibrium.}
- inlet_property_package
Property parameter object used to define property calculations for the incoming stream, default - None. Valid values: { PhysicalParameterObject - a PhysicalParameterBlock object.}
- inlet_property_package_args
A ConfigBlock with arguments to be passed to the property block associated with the incoming stream, default - None. Valid values: { see property package for documentation.}
- outlet_property_package
Property parameter object used to define property calculations for the outgoing stream, default - None. Valid values: { PhysicalParameterObject - a PhysicalParameterBlock object.}
- outlet_property_package_args
A ConfigBlock with arguments to be passed to the property block associated with the outgoing stream, default - None. Valid values: { see property package for documentation.}
- reaction_package
Reaction parameter object used to define reaction calculations, default - None. Valid values: { None - no reaction package, ReactionParameterBlock - a ReactionParameterBlock object.}
- reaction_package_args
A ConfigBlock with arguments to be passed to a reaction block(s) and used when constructing these, default - None. Valid values: { see reaction package for documentation.}
initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries with config arguments as keys.
idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to override the default behavior of matching the BlockData index exactly to the index in initialize.
- Returns:
(Translator_ADM1_ASM1) New instance
watertap.unit_models.translators.translator_adm1_asm2d module
Translator block representing the ADM1/ASM2d interface. This is copied from the Generic template for a translator block.
- Assumptions:
Steady-state only
Model formulated from:
Flores-Alsina, X., Solon, K., Mbamba, C.K., Tait, S., Gernaey, K.V., Jeppsson, U. and Batstone, D.J., 2016. Modelling phosphorus (P), sulfur (S) and iron (Fe) interactions for dynamic simulations of anaerobic digestion processes. Water Research, 95, pp.370-382.
- class watertap.unit_models.translators.translator_adm1_asm2d.ADM1ASM2dScaler(**kwargs)[source]
Bases:
CustomScalerBaseDefault modular scaler for ADM1-ASM2d translator block. This Scaler relies on the associated property and reaction packages, either through user provided options (submodel_scalers argument) or by default Scalers assigned to the packages.
- zero_tolerance
Value at which a variable will be considered equal to zero for scaling.
- max_variable_scaling_factor
Maximum value for variable scaling factors.
- min_variable_scaling_factor
Minimum value for variable scaling factors.
- max_constraint_scaling_factor
Maximum value for constraint scaling factors.
- min_constraint_scaling_factor
Minimum value for constraint scaling factors.
- max_expression_scaling_hint
Maximum value for expression scaling hints.
- min_expression_scaling_hint
Minimum value for constraint scaling hints.
- overwrite
Whether to overwrite existing scaling factors.
- constraint_scaling_routine(model, overwrite: bool = False, submodel_scalers: dict | None = None)[source]
Routine to apply scaling factors to constraints in model. Submodel Scalers are called for the property and reaction blocks. All other constraints are scaled using the inverse maximum scheme. :param model: model to be scaled :param overwrite: whether to overwrite existing scaling factors :param submodel_scalers: dict of Scalers to use for sub-models, keyed by submodel local name
- Returns:
None
- variable_scaling_routine(model, overwrite: bool = False, submodel_scalers: dict | None = None)[source]
Routine to apply scaling factors to variables in model. :param model: model to be scaled :param overwrite: whether to overwrite existing scaling factors :param submodel_scalers: dict of Scalers to use for sub-models, keyed by submodel local name
- Returns:
None
- class watertap.unit_models.translators.translator_adm1_asm2d.TranslatorDataADM1ASM2D(component)[source]
Bases:
TranslatorDataTranslator block representing the ADM1/ASM2D interface
- default_scaler
alias of
ADM1ASM2dScaler
- initialize_build(state_args_in=None, state_args_out=None, outlvl=0, solver=None, optarg=None)[source]
This method calls the initialization method of the state blocks.
- Keyword Arguments:
state_args_in – a dict of arguments to be passed to the inlet property package (to provide an initial state for initialization (see documentation of the specific property package) (default = None).
state_args_out – a dict of arguments to be passed to the outlet property package (to provide an initial state for initialization (see documentation of the specific property package) (default = None).
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 solver)
- Returns:
None
- class watertap.unit_models.translators.translator_adm1_asm2d.Translator_ADM1_ASM2D(*args, **kwds)
Bases:
ProcessBlock- Parameters:
rule (function) – A rule function or None. Default rule calls build().
concrete (bool) – If True, make this a toplevel model. Default - False.
ctype (class) –
Pyomo ctype of the block. Default - pyomo.environ.Block
Config args
- dynamic
Translator blocks are always steady-state.
- has_holdup
Translator blocks do not contain holdup.
- outlet_state_defined
Indicates whether unit model will fully define outlet state. If False, the outlet property package will enforce constraints such as sum of mole fractions and phase equilibrium. default - True. Valid values: { True - outlet state will be fully defined, False - outlet property package should enforce summation and equilibrium constraints.}
- has_phase_equilibrium
Indicates whether outlet property package should enforce phase equilibrium constraints. default - False. Valid values: { True - outlet property package should calculate phase equilibrium, False - outlet property package should notcalculate phase equilibrium.}
- inlet_property_package
Property parameter object used to define property calculations for the incoming stream, default - None. Valid values: { PhysicalParameterObject - a PhysicalParameterBlock object.}
- inlet_property_package_args
A ConfigBlock with arguments to be passed to the property block associated with the incoming stream, default - None. Valid values: { see property package for documentation.}
- outlet_property_package
Property parameter object used to define property calculations for the outgoing stream, default - None. Valid values: { PhysicalParameterObject - a PhysicalParameterBlock object.}
- outlet_property_package_args
A ConfigBlock with arguments to be passed to the property block associated with the outgoing stream, default - None. Valid values: { see property package for documentation.}
- inlet_reaction_package
Reaction parameter object used to define reaction calculations, default - None. Valid values: { None - no reaction package, ReactionParameterBlock - a ReactionParameterBlock object.}
- inlet_reaction_package_args
A ConfigBlock with arguments to be passed to a reaction block(s) and used when constructing these, default - None. Valid values: { see reaction package for documentation.}
- outlet_reaction_package
Reaction parameter object used to define reaction calculations, default - None. Valid values: { None - no reaction package, ReactionParameterBlock - a ReactionParameterBlock object.}
- outlet_reaction_package_args
A ConfigBlock with arguments to be passed to a reaction block(s) and used when constructing these, default - None. Valid values: { see reaction package for documentation.}
initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries with config arguments as keys.
idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to override the default behavior of matching the BlockData index exactly to the index in initialize.
- Returns:
(Translator_ADM1_ASM2D) New instance
watertap.unit_models.translators.translator_asm1_adm1 module
Translator block representing the ASM1/ADM1 interface.
- Assumptions:
Steady-state only
Model formulated from:
Copp J. and Jeppsson, U., Rosen, C., 2006. Towards an ASM1 - ADM1 State Variable Interface for Plant-Wide Wastewater Treatment Modeling. Proceedings of the Water Environment Federation, 2003, pp 498-510.
- class watertap.unit_models.translators.translator_asm1_adm1.ASM1ADM1Scaler(**kwargs)[source]
Bases:
CustomScalerBaseDefault modular scaler for the ASM1-ADM1 translator block. This Scaler relies on the associated property and reaction packages, either through user provided options (submodel_scalers argument) or by default Scalers assigned to the packages.
- zero_tolerance
Value at which a variable will be considered equal to zero for scaling.
- max_variable_scaling_factor
Maximum value for variable scaling factors.
- min_variable_scaling_factor
Minimum value for variable scaling factors.
- max_constraint_scaling_factor
Maximum value for constraint scaling factors.
- min_constraint_scaling_factor
Minimum value for constraint scaling factors.
- max_expression_scaling_hint
Maximum value for expression scaling hints.
- min_expression_scaling_hint
Minimum value for constraint scaling hints.
- overwrite
Whether to overwrite existing scaling factors.
- constraint_scaling_routine(model, overwrite: bool = False, submodel_scalers: dict | None = None)[source]
Routine to apply scaling factors to constraints in model. Submodel Scalers are called for the property and reaction blocks. All other constraints are scaled using the inverse maximum scheme. :param model: model to be scaled :param overwrite: whether to overwrite existing scaling factors :param submodel_scalers: dict of Scalers to use for sub-models, keyed by submodel local name
- Returns:
None
- variable_scaling_routine(model, overwrite: bool = False, submodel_scalers: dict | None = None)[source]
Routine to apply scaling factors to variables in model. :param model: model to be scaled :param overwrite: whether to overwrite existing scaling factors :param submodel_scalers: dict of Scalers to use for sub-models, keyed by submodel local name
- Returns:
None
- class watertap.unit_models.translators.translator_asm1_adm1.TranslatorDataASM1ADM1(component)[source]
Bases:
TranslatorDataTranslator block representing the ASM1/ADM1 interface
- default_scaler
alias of
ASM1ADM1Scaler
- initialize_build(state_args_in=None, state_args_out=None, outlvl=0, solver=None, optarg=None)[source]
This method calls the initialization method of the state blocks.
- Keyword Arguments:
state_args_in – a dict of arguments to be passed to the inlet property package (to provide an initial state for initialization (see documentation of the specific property package) (default = None).
state_args_out – a dict of arguments to be passed to the outlet property package (to provide an initial state for initialization (see documentation of the specific property package) (default = None).
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 solver)
- Returns:
None
- class watertap.unit_models.translators.translator_asm1_adm1.Translator_ASM1_ADM1(*args, **kwds)
Bases:
ProcessBlock- Parameters:
rule (function) – A rule function or None. Default rule calls build().
concrete (bool) – If True, make this a toplevel model. Default - False.
ctype (class) –
Pyomo ctype of the block. Default - pyomo.environ.Block
Config args
- dynamic
Translator blocks are always steady-state.
- has_holdup
Translator blocks do not contain holdup.
- outlet_state_defined
Indicates whether unit model will fully define outlet state. If False, the outlet property package will enforce constraints such as sum of mole fractions and phase equilibrium. default - True. Valid values: { True - outlet state will be fully defined, False - outlet property package should enforce summation and equilibrium constraints.}
- has_phase_equilibrium
Indicates whether outlet property package should enforce phase equilibrium constraints. default - False. Valid values: { True - outlet property package should calculate phase equilibrium, False - outlet property package should notcalculate phase equilibrium.}
- inlet_property_package
Property parameter object used to define property calculations for the incoming stream, default - None. Valid values: { PhysicalParameterObject - a PhysicalParameterBlock object.}
- inlet_property_package_args
A ConfigBlock with arguments to be passed to the property block associated with the incoming stream, default - None. Valid values: { see property package for documentation.}
- outlet_property_package
Property parameter object used to define property calculations for the outgoing stream, default - None. Valid values: { PhysicalParameterObject - a PhysicalParameterBlock object.}
- outlet_property_package_args
A ConfigBlock with arguments to be passed to the property block associated with the outgoing stream, default - None. Valid values: { see property package for documentation.}
- reaction_package
Reaction parameter object used to define reaction calculations, default - None. Valid values: { None - no reaction package, ReactionParameterBlock - a ReactionParameterBlock object.}
- reaction_package_args
A ConfigBlock with arguments to be passed to a reaction block(s) and used when constructing these, default - None. Valid values: { see reaction package for documentation.}
initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries with config arguments as keys.
idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to override the default behavior of matching the BlockData index exactly to the index in initialize.
- Returns:
(Translator_ASM1_ADM1) New instance
watertap.unit_models.translators.translator_asm2d_adm1 module
Translator block representing the ASM2d/ADM1 interface.
- Assumptions:
Steady-state only
Model formulated from:
Flores-Alsina, X., Solon, K., Mbamba, C.K., Tait, S., Gernaey, K.V., Jeppsson, U. and Batstone, D.J., 2016. Modelling phosphorus (P), sulfur (S) and iron (Fe) interactions for dynamic simulations of anaerobic digestion processes. Water Research, 95, pp.370-382. https://github.com/wwtmodels/Plant-Wide-Models
- class watertap.unit_models.translators.translator_asm2d_adm1.ASM2dADM1Scaler(**kwargs)[source]
Bases:
CustomScalerBaseDefault modular scaler for ASM2d-ADM1 translator block. This Scaler relies on the associated property and reaction packages, either through user provided options (submodel_scalers argument) or by default Scalers assigned to the packages.
- zero_tolerance
Value at which a variable will be considered equal to zero for scaling.
- max_variable_scaling_factor
Maximum value for variable scaling factors.
- min_variable_scaling_factor
Minimum value for variable scaling factors.
- max_constraint_scaling_factor
Maximum value for constraint scaling factors.
- min_constraint_scaling_factor
Minimum value for constraint scaling factors.
- max_expression_scaling_hint
Maximum value for expression scaling hints.
- min_expression_scaling_hint
Minimum value for constraint scaling hints.
- overwrite
Whether to overwrite existing scaling factors.
- constraint_scaling_routine(model, overwrite: bool = False, submodel_scalers: dict | None = None)[source]
Routine to apply scaling factors to constraints in model. Submodel Scalers are called for the property and reaction blocks. All other constraints are scaled using the inverse maximum scheme. :param model: model to be scaled :param overwrite: whether to overwrite existing scaling factors :param submodel_scalers: dict of Scalers to use for sub-models, keyed by submodel local name
- Returns:
None
- variable_scaling_routine(model, overwrite: bool = False, submodel_scalers: dict | None = None)[source]
Routine to apply scaling factors to variables in model. :param model: model to be scaled :param overwrite: whether to overwrite existing scaling factors :param submodel_scalers: dict of Scalers to use for sub-models, keyed by submodel local name
- Returns:
None
- class watertap.unit_models.translators.translator_asm2d_adm1.TranslatorDataASM2dADM1(component)[source]
Bases:
TranslatorDataTranslator block representing the ASM2d/ADM1 interface
- default_scaler
alias of
ASM2dADM1Scaler
- initialize_build(state_args_in=None, state_args_out=None, outlvl=0, solver=None, optarg=None)[source]
This method calls the initialization method of the state blocks.
- Keyword Arguments:
state_args_in – a dict of arguments to be passed to the inlet property package (to provide an initial state for initialization (see documentation of the specific property package) (default = None).
state_args_out – a dict of arguments to be passed to the outlet property package (to provide an initial state for initialization (see documentation of the specific property package) (default = None).
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 solver)
- Returns:
None
- class watertap.unit_models.translators.translator_asm2d_adm1.Translator_ASM2d_ADM1(*args, **kwds)
Bases:
ProcessBlock- Parameters:
rule (function) – A rule function or None. Default rule calls build().
concrete (bool) – If True, make this a toplevel model. Default - False.
ctype (class) –
Pyomo ctype of the block. Default - pyomo.environ.Block
Config args
- dynamic
Translator blocks are always steady-state.
- has_holdup
Translator blocks do not contain holdup.
- outlet_state_defined
Indicates whether unit model will fully define outlet state. If False, the outlet property package will enforce constraints such as sum of mole fractions and phase equilibrium. default - True. Valid values: { True - outlet state will be fully defined, False - outlet property package should enforce summation and equilibrium constraints.}
- has_phase_equilibrium
Indicates whether outlet property package should enforce phase equilibrium constraints. default - False. Valid values: { True - outlet property package should calculate phase equilibrium, False - outlet property package should notcalculate phase equilibrium.}
- inlet_property_package
Property parameter object used to define property calculations for the incoming stream, default - None. Valid values: { PhysicalParameterObject - a PhysicalParameterBlock object.}
- inlet_property_package_args
A ConfigBlock with arguments to be passed to the property block associated with the incoming stream, default - None. Valid values: { see property package for documentation.}
- outlet_property_package
Property parameter object used to define property calculations for the outgoing stream, default - None. Valid values: { PhysicalParameterObject - a PhysicalParameterBlock object.}
- outlet_property_package_args
A ConfigBlock with arguments to be passed to the property block associated with the outgoing stream, default - None. Valid values: { see property package for documentation.}
- bio_P
Switching function for handling the transformation of phosphorus biomass, default - True. Valid values: { False - the BioP variables are kinetically described within the ADM, True - the BioP variables are supposed to be transformed in the interface
- inlet_reaction_package
Reaction parameter object used to define reaction calculations, default - None. Valid values: { None - no reaction package, ReactionParameterBlock - a ReactionParameterBlock object.}
- inlet_reaction_package_args
A ConfigBlock with arguments to be passed to a reaction block(s) and used when constructing these, default - None. Valid values: { see reaction package for documentation.}
- outlet_reaction_package
Reaction parameter object used to define reaction calculations, default - None. Valid values: { None - no reaction package, ReactionParameterBlock - a ReactionParameterBlock object.}
- outlet_reaction_package_args
A ConfigBlock with arguments to be passed to a reaction block(s) and used when constructing these, default - None. Valid values: { see reaction package for documentation.}
initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries with config arguments as keys.
idx_map (function) – Function to take the index of a BlockData element and return the index in the initialize dict from which to read arguments. This can be provided to override the default behavior of matching the BlockData index exactly to the index in initialize.
- Returns:
(Translator_ASM2d_ADM1) New instance