Zero Order Unit Model Base Class
The zero-order unit model base class is intended to form the basis for a library of generic zero-order type (fixed performance) unit models. It defines a standard API for these types of unit operations and a set of common helper methods for building and working with these.
Usage
Ther ZeroOrderBaseData class contains no variables or constraints of its own - rather it is intended to be used as the starting point for construction of zero-order type models for specific unit operations.
The code below shows an outline of how the ZeroOrderBaseData class is intended to be used to develop custom zero-order type models.
from idaes.core import declare_process_block_class
from watertap.core import ZeroOrderBaseData
@declare_process_block_class("MyZOUnit")
class MyZOUnitData(ZeroOrderBaseData):
CONFIG = ZeroOrderBaseData.CONFIG()
def build(self):
super().build()
self._tech_type = "my_technology"
# Add necessary StateBlocks, Ports, Variables and Constraints
# A library of methods for common model form is available,
# or users can custom code their own components
Property Package Requirements
The ZeroOrderBase 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:
A single phase named Liq.
A single Solvent species named H2O (package must define a solvent_set with length one that contains “H2O”).
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).
The property package must define flow_vol, conc_mass_comp, pressure and temperature as properties.
Class Documentation
- class watertap.core.zero_order_base.ZeroOrderBaseData(component)[source]
Standard base class for zero order unit models.
This class contains the basic consistency checks and common methods for zero order type models.
- 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
- calculate_scaling_factors()[source]
Placeholder scaling routine, should be overloaded by derived classes
- initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]
Placeholder initialization routine, raises NotImplementedError
- load_parameters_from_database(use_default_removal=False)[source]
Method to load parameters for from database.
- Parameters
- (use_default_removal) – default removal fraction if no specific value defined in database
- Returns
None
- set_param_from_data(parameter, data, index=None, use_default_removal=False)[source]
General method for setting parameter values from a dict of data returned from a database.
- Parameters
database (data - dict of parameter values from) –
database –
- (use_default_removal) –
- – default removal fraction if no specific value defined in database
- Returns
None
- Raises
KeyError if values cannot be found for parameter in data dict –
- set_recovery_and_removal(data, use_default_removal=False)[source]
Common utility method for setting values of recovery and removal fractions.
- Parameters
variables (data - dict of parameter values to use when fixing) –
- (use_default_removal) – default removal fraction if no specific value defined in database
- Returns
None