watertap.examples.custom_model_demo package

Submodules

watertap.examples.custom_model_demo.demo_simple_filter module

watertap.examples.custom_model_demo.demo_simple_prop_pack module

watertap.examples.custom_model_demo.simple_filter module

class watertap.examples.custom_model_demo.simple_filter.Filtration(*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

    Indicates whether this model will be dynamic or not, default = False. The filtration unit does not support dynamic behavior, thus this must be False.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. The filtration unit does not have defined volume, thus this must be False.

    property_package

    Property parameter object used to define property calculations, default - useDefault. Valid values: { useDefault - use default package from parent model or flowsheet, PhysicalParameterObject - a PhysicalParameterBlock object.}

    property_package_args

    A ConfigBlock with arguments to be passed to a property block(s) and used when constructing these, default - None. Valid values: { see property 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

(Filtration) New instance

class watertap.examples.custom_model_demo.simple_filter.FiltrationData(component)[source]

Bases: UnitModelBlockData

Zero order filtration model

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

watertap.examples.custom_model_demo.simple_prop_pack module

Simple property package for TSS and NaCl

class watertap.examples.custom_model_demo.simple_prop_pack.PropParameterBlock(*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
    default_arguments

    Default arguments to use with Property Package

  • 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

(PropParameterBlock) New instance

class watertap.examples.custom_model_demo.simple_prop_pack.PropParameterData(component)[source]

Bases: PhysicalParameterBlock

build()[source]

Callable method for Block construction.

classmethod define_metadata(obj)[source]

Define properties supported and units.

class watertap.examples.custom_model_demo.simple_prop_pack.PropStateBlock(*args, **kwds)

Bases: _PropStateBlock

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
    parameters

    A reference to an instance of the Property Parameter Block associated with this property package.

    defined_state

    Flag indicating whether the state should be considered fully defined, and thus whether constraints such as sum of mass/mole fractions should be included, default - False. Valid values: { True - state variables will be fully defined, False - state variables will not be fully defined.}

    has_phase_equilibrium

    Flag indicating whether phase equilibrium constraints should be constructed in this state block, default - True. Valid values: { True - StateBlock should calculate phase equilibrium, False - StateBlock should not calculate phase equilibrium.}

  • 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

(PropStateBlock) New instance

class watertap.examples.custom_model_demo.simple_prop_pack.PropStateBlockData(*args, **kwargs)[source]

Bases: StateBlockData

build()[source]

Callable method for Block construction.

define_state_vars()[source]

Define state vars.

get_enthalpy_flow_terms(p)[source]

Create enthalpy flow terms.

get_material_flow_basis()[source]

Method which returns an Enum indicating the basis of the material flow term.

get_material_flow_terms(p, j)[source]

Create material flow terms for control volume.

Module contents