watertap.unit_models package

Subpackages

Submodules

watertap.unit_models.aeration_tank module

Inherits from a modified CSTR model with injection terms. This model assumes oxygen will be injected.

class watertap.unit_models.aeration_tank.AerationTank(*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 = useDefault. Valid values: { useDefault - get flag from parent (default = False), True - set as a dynamic model, False - set as a steady-state model.}

    has_holdup

    Indicates whether holdup terms should be constructed or not. Must be True if dynamic = True, default - False. Valid values: { useDefault - get flag from parent (default = False), True - construct holdup terms, False - do not construct holdup terms}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_heat_transfer

    Indicates whether terms for heat transfer should be constructed, default - False. Valid values: { True - include heat transfer terms, False - exclude heat transfer terms.}

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    has_equilibrium_reactions

    Indicates whether terms for equilibrium controlled reactions should be constructed, default - True. Valid values: { True - include equilibrium reaction terms, False - exclude equilibrium reaction terms.}

    has_phase_equilibrium

    Indicates whether terms for phase equilibrium should be constructed, default = False. Valid values: { True - include phase equilibrium terms False - exclude phase equilibrium terms.}

    has_heat_of_reaction

    Indicates whether terms for heat of reaction terms should be constructed, default - False. Valid values: { True - include heat of reaction terms, False - exclude heat of reaction terms.}

    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.}

    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.}

    electricity_consumption

    Indicates whether electricity consumption is fixed by the user or excluded default - ElectricityConsumption.none. Valid values: { ElectricityConsumption.none - no electricity consumption within the unit, ElectricityConsumption.fixed - calculate electricity consumption based on assumed electricity intensity in kWh/m3, ElectricityConsumption.aeration_calculation - calculate electricity consumption based on aeration energy}

    has_aeration

    Indicates whether terms for aeration terms should be expected, default - False. Valid values: { True - include aeration terms, False - exclude aeration terms.}

  • 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:

(AerationTank) New instance

class watertap.unit_models.aeration_tank.AerationTankData(component)[source]

Bases: CSTR_InjectionData

CSTR Unit Model with Injection Class

watertap.unit_models.anaerobic_digester module

Modified CSTR model which includes vapor and liquid phase outlets.

This is copied from the standard IDAES CSTR with the addition of mass transfer terms and extra port for second phase.

Assumptions:
  • Steady-state only

  • Liquid phase property package has a single phase named Liq

  • Vapor phase property package has a single phase named Vap

  • Liquid and vapor phase properties need not have the same component lists

Model formulated from:

Rosen, C. and Jeppsson, U., 2006. Aspects on ADM1 Implementation within the BSM2 Framework. Department of Industrial Electrical Engineering and Automation, Lund University, Lund, Sweden, pp.1-35.

class watertap.unit_models.anaerobic_digester.AD(*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 = useDefault. Valid values: { useDefault - get flag from parent (default = False), True - set as a dynamic model, False - set as a steady-state model.}

    has_holdup

    Indicates whether holdup terms should be constructed or not. Must be True if dynamic = True, default - False. Valid values: { useDefault - get flag from parent (default = False), True - construct holdup terms, False - do not construct holdup terms}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_heat_transfer

    Indicates whether terms for heat transfer should be constructed, default - False. Valid values: { True - include heat transfer terms, False - exclude heat transfer terms.}

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    has_equilibrium_reactions

    Indicates whether terms for equilibrium controlled reactions should be constructed, default - True. Valid values: { True - include equilibrium reaction terms, False - exclude equilibrium reaction terms.}

    has_phase_equilibrium

    Indicates whether terms for phase equilibrium should be constructed, default = False. Valid values: { True - include phase equilibrium terms False - exclude phase equilibrium terms.}

    has_heat_of_reaction

    Indicates whether terms for heat of reaction terms should be constructed, default - False. Valid values: { True - include heat of reaction terms, False - exclude heat of reaction terms.}

    liquid_property_package

    Property parameter object used to define property calculations for the liquid phase, default - useDefault. Valid values: { useDefault - use default package from parent model or flowsheet, PropertyParameterObject - a PropertyParameterBlock object.}

    liquid_property_package_args

    A ConfigBlock with arguments to be passed to liquid phase property block(s) and used when constructing these, default - None. Valid values: { see property package for documentation.}

    vapor_property_package

    Property parameter object used to define property calculations for the vapor phase, default - useDefault. Valid values: { useDefault - use default package from parent model or flowsheet, PropertyParameterObject - a PropertyParameterBlock object.}

    vapor_property_package_args

    A ConfigBlock with arguments to be passed to vapor phase property block(s) and used when constructing these, 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:

(AD) New instance

class watertap.unit_models.anaerobic_digester.ADData(component)[source]

Bases: UnitModelBlockData

AD Unit Model Class

build()[source]

Begin building model (pre-DAE transformation). :param None:

Returns:

None

initialize_build(liquid_state_args=None, vapor_state_args=None, outlvl=0, solver=None, optarg=None)[source]

Initialization routine for anaerobic digester unit model.

Keyword Arguments:
  • liquid_state_args – a dict of arguments to be passed to the liquid property packages to provide an initial state for initialization (see documentation of the specific property package) (default = none).

  • vapor_state_args – a dict of arguments to be passed to the vapor 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 IDAES solver)

Returns:

None

watertap.unit_models.boron_removal module

class watertap.unit_models.boron_removal.BoronRemoval(*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.

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    is_isothermal

    Assume isothermal conditions for control volume(s); energy_balance_type must be EnergyBalanceType.none, default - True.

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.none. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    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.}

    chemical_mapping_data

    Dictionary of chemical species names from the property package and how they map to specific species needed for solving a simple boron speciation problem in an equilibrium reactor. This dictionary must have the following format [Required]:

    {'boron_name': 'name_of_species_representing_boron', #[is required]
    'borate_name': 'name_of_species_representing_borate', #[is required]
    'proton_name': 'name_of_species_representing_protons',  #[is optional]
    'hydroxide_name': 'name_of_species_representing_hydroxides', #[is optional]
    'caustic_additive':
        {
            'additive_name': 'name_of_the_actual_chemical', #[is optional]
            'cation_name': 'name_of_cation_species_in_additive', #[is required]
            'mw_additive': (value, units), #[is required]
            'moles_cation_per_additive': value, #[is required]
        },
    }
    

  • 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:

(BoronRemoval) New instance

class watertap.unit_models.boron_removal.BoronRemovalData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

0D Boron Removal model for after 1st Stage of RO

This model is an approximate equilibrium reactor wherein it is assumed that…

  1. All reactions and activities are assumed ideal

(2) Only major reactions are water dissociation and boron dissociation

  1. Only 1 caustic chemical is being added to raise pH

(4) The caustic additive will always completely dissociate into a cation and some amount hydroxide anions (e.g., NaOH –> Na+ + OH-, Ca(OH2) –> Ca2+ + 2 OH-, etc)

(5) Any other ions remaining in solution do not significantly change with pH changes, but do help act as buffers to changes in pH (i.e., will absorb/contribute protons proportional to their charge).

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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for pressure changer initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

watertap.unit_models.clarifier module

Clarifier unit model for BSM2 and plant-wide wastewater treatment modeling. This unit inherits from the IDAES separator unit.

class watertap.unit_models.clarifier.Clarifier(*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. Product blocks are always steady- state.

    has_holdup

    Product blocks do not contain holdup, 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, PropertyParameterObject - a PropertyParameterBlock 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.}

    outlet_list

    A list containing names of outlets, default - None. Valid values: { None - use num_outlets argument, list - a list of names to use for outlets.}

    num_outlets

    Argument indicating number (int) of outlets to construct, not used if outlet_list arg is provided, default - None. Valid values: { None - use outlet_list arg instead, or default to 2 if neither argument provided, int - number of outlets to create (will be named with sequential integers from 1 to num_outlets).}

    split_basis

    Argument indicating basis to use for splitting mixed stream, default - SplittingType.totalFlow. Valid values: { SplittingType.totalFlow - split based on total flow (split fraction indexed only by time and outlet), SplittingType.phaseFlow - split based on phase flows (split fraction indexed by time, outlet and phase), SplittingType.componentFlow - split based on component flows (split fraction indexed by time, outlet and components), SplittingType.phaseComponentFlow - split based on phase-component flows ( split fraction indexed by both time, outlet, phase and components).}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - pressure in all outlets is equal, MomentumBalanceType.pressurePhase - not yet supported, MomentumBalanceType.momentumTotal - not yet supported, MomentumBalanceType.momentumPhase - not yet supported.}

    has_phase_equilibrium

    Argument indicating whether phase equilibrium should be calculated for the resulting mixed stream, default - False. Valid values: { True - calculate phase equilibrium in mixed stream, False - do not calculate equilibrium in mixed stream.}

    energy_split_basis

    Argument indicating basis to use for splitting energy this is not used for when ideal_separation == True. default - EnergySplittingType.equal_temperature. Valid values: { EnergySplittingType.none - no energy balance constraints, EnergySplittingType.equal_temperature - outlet temperatures equal inlet, EnergySplittingType.equal_molar_enthalpy - outlet molar enthalpies equal inlet, EnergySplittingType.enthalpy_split - apply split fractions to enthalpy flows. Does not work with component or phase-component splitting.}

    ideal_separation

    Argument indicating whether ideal splitting should be used. Ideal splitting assumes perfect spearation of material, and attempts to avoid duplication of StateBlocks by directly partitioning outlet flows to ports, default - False. Valid values: { True - use ideal splitting methods. Cannot be combined with has_phase_equilibrium = True, False - use explicit splitting equations with split fractions.}

    ideal_split_map

    Dictionary containing information on how extensive variables should be partitioned when using ideal splitting (ideal_separation = True). default - None. Valid values: { dict with keys of indexing set members and values indicating which outlet this combination of keys should be partitioned to. E.g. {(“Vap”, “H2”): “outlet_1”}}

    mixed_state_block

    An existing state block to use as the source stream from the Separator block, default - None. Valid values: { None - create a new StateBlock for the mixed stream, StateBlock - a StateBock to use as the source for the mixed stream.}

    construct_ports

    Argument indicating whether model should construct Port objects linked the mixed state and all outlet states, default - True. Valid values: { True - construct Ports for all states, False - do not construct Ports.

  • 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:

(Clarifier) New instance

class watertap.unit_models.clarifier.ClarifierData(component)[source]

Bases: SeparatorData

Thickener unit model for BSM2

build()[source]

Begin building model. :param None:

Returns:

None

watertap.unit_models.coag_floc_model module

class watertap.unit_models.coag_floc_model.CoagulationFlocculation(*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.

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    is_isothermal

    Assume isothermal conditions for control volume(s); energy_balance_type must be EnergyBalanceType.none, default - True.

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.none. EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    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.}

    chemical_additives

    A dict of chemical additives used in coagulation process along with their molecular weights, the moles of salt produced per mole of chemical added, and the molecular weights of the salt produced by the chemical additive with the format of:

    {'chem_name_1':
        {'parameter_data':
            {
            'mw_additive': (value, units),
            'moles_salt_per_mole_additive': value,
            'mw_salt': (value, units)
            }
        },
    'chem_name_2':
        {'parameter_data':
            {
            'mw_additive': (value, units),
            'moles_salt_per_mole_additive': value,
            'mw_salt': (value, units)
            }
        },
    }
    

  • 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:

(CoagulationFlocculation) New instance

class watertap.unit_models.coag_floc_model.CoagulationFlocculationData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

Zero order Coagulation-Flocculation model based on Jar Tests

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

compute_inlet_tss_mass_concentration(t)[source]

Function to generate an expression that would represent the mass concentration of TSS at the inlet port of the unit. Inlet ports are generally established upstream, but this will be useful for establishing the inlet TSS when an upstream TSS is unknown. This level of inlet TSS is based off of measurements made of Turbidity during the Jar Test.

Keyword Arguments:
  • self – this unit model object

  • t – time index on the flowsheet

Returns: Expression

Recover the numeric value by using ‘value(Expression)’

compute_inlet_tss_mass_flow(t)[source]

Function to generate an expression that would represent the mass flow rate of TSS at the inlet port of the unit. Inlet ports are generally established upstream, but this will be useful for establishing the inlet TSS when an upstream TSS is unknown. This level of inlet TSS is based off of measurements made of Turbidity during the Jar Test.

Keyword Arguments:
  • self – this unit model object

  • t – time index on the flowsheet

Returns: Expression

Recover the numeric value by using ‘value(Expression)’

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for pressure changer initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

watertap.unit_models.crystallizer module

class watertap.unit_models.crystallizer.Crystallization(*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:

(Crystallization) New instance

class watertap.unit_models.crystallizer.CrystallizationData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

Zero order crystallization 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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for pressure changer initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

watertap.unit_models.cstr module

CSTR unit model for BSM2 and plant-wide wastewater treatment modeling. This unit inherits from the IDAES CSTR unit.

class watertap.unit_models.cstr.CSTR(*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 = useDefault. Valid values: { useDefault - get flag from parent (default = False), True - set as a dynamic model, False - set as a steady-state model.}

    has_holdup

    Indicates whether holdup terms should be constructed or not. Must be True if dynamic = True, default - False. Valid values: { useDefault - get flag from parent (default = False), True - construct holdup terms, False - do not construct holdup terms}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_heat_transfer

    Indicates whether terms for heat transfer should be constructed, default - False. Valid values: { True - include heat transfer terms, False - exclude heat transfer terms.}

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    has_equilibrium_reactions

    Indicates whether terms for equilibrium controlled reactions should be constructed, default - True. Valid values: { True - include equilibrium reaction terms, False - exclude equilibrium reaction terms.}

    has_phase_equilibrium

    Indicates whether terms for phase equilibrium should be constructed, default = False. Valid values: { True - include phase equilibrium terms False - exclude phase equilibrium terms.}

    has_heat_of_reaction

    Indicates whether terms for heat of reaction terms should be constructed, default - False. Valid values: { True - include heat of reaction terms, False - exclude heat of reaction terms.}

    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.}

    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:

(CSTR) New instance

class watertap.unit_models.cstr.CSTRData(component)[source]

Bases: CSTRData

CSTR unit block for BSM2

build()[source]

Begin building model. :param None:

Returns:

None

watertap.unit_models.cstr_injection module

Modified CSTR model which includes terms for injection of species/reactants.

This is copied from the standard IDAES CSTR with the addition of mass transfer terms. NOTE: This is likely a temporary model until a more detailed model is available.

class watertap.unit_models.cstr_injection.CSTR_Injection(*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 = useDefault. Valid values: { useDefault - get flag from parent (default = False), True - set as a dynamic model, False - set as a steady-state model.}

    has_holdup

    Indicates whether holdup terms should be constructed or not. Must be True if dynamic = True, default - False. Valid values: { useDefault - get flag from parent (default = False), True - construct holdup terms, False - do not construct holdup terms}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_heat_transfer

    Indicates whether terms for heat transfer should be constructed, default - False. Valid values: { True - include heat transfer terms, False - exclude heat transfer terms.}

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    has_equilibrium_reactions

    Indicates whether terms for equilibrium controlled reactions should be constructed, default - True. Valid values: { True - include equilibrium reaction terms, False - exclude equilibrium reaction terms.}

    has_phase_equilibrium

    Indicates whether terms for phase equilibrium should be constructed, default = False. Valid values: { True - include phase equilibrium terms False - exclude phase equilibrium terms.}

    has_heat_of_reaction

    Indicates whether terms for heat of reaction terms should be constructed, default - False. Valid values: { True - include heat of reaction terms, False - exclude heat of reaction terms.}

    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.}

    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.}

    electricity_consumption

    Indicates whether electricity consumption is fixed by the user or excluded default - ElectricityConsumption.none. Valid values: { ElectricityConsumption.none - no electricity consumption within the unit, ElectricityConsumption.fixed - calculate electricity consumption based on assumed electricity intensity in kWh/m3, ElectricityConsumption.aeration_calculation - calculate electricity consumption based on aeration energy}

    has_aeration

    Indicates whether terms for aeration terms should be expected, default - False. Valid values: { True - include aeration terms, False - exclude aeration terms.}

  • 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:

(CSTR_Injection) New instance

class watertap.unit_models.cstr_injection.CSTR_InjectionData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

CSTR Unit Model with Injection Class

build()[source]

Begin building model (pre-DAE transformation). :param None:

Returns:

None

class watertap.unit_models.cstr_injection.ElectricityConsumption(value)[source]

Bases: Enum

none: no electricity consumption fixed: assume electricity intensity calculated: calculate based on aeration energy equation from BSM2 documentation

watertap.unit_models.dewatering module

Dewatering unit model for BSM2 and plant-wide wastewater treatment modeling. This unit inherits from the IDAES separator unit.

Model based on

J. Alex, L. Benedetti, J.B. Copp, K.V. Gernaey, U. Jeppsson, I. Nopens, M.N. Pons, C. Rosen, J.P. Steyer and P. A. Vanrolleghem Benchmark Simulation Model no. 2 (BSM2)

Modifications made to TSS formulation based on ASM type.

class watertap.unit_models.dewatering.ActivatedSludgeModelType(value)[source]

Bases: Enum

ASM1: ASM1 model ASM2D: ASM2D model modified_ASM2D: modified ASM2D model for ADM1 compatibility

class watertap.unit_models.dewatering.DewateringData(component)[source]

Bases: SeparatorData

Dewatering unit block for BSM2

build()[source]

Begin building model. :param None:

Returns:

None

class watertap.unit_models.dewatering.DewateringUnit(*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. Product blocks are always steady- state.

    has_holdup

    Product blocks do not contain holdup, 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, PropertyParameterObject - a PropertyParameterBlock 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.}

    outlet_list

    A list containing names of outlets, default - None. Valid values: { None - use num_outlets argument, list - a list of names to use for outlets.}

    num_outlets

    Argument indicating number (int) of outlets to construct, not used if outlet_list arg is provided, default - None. Valid values: { None - use outlet_list arg instead, or default to 2 if neither argument provided, int - number of outlets to create (will be named with sequential integers from 1 to num_outlets).}

    split_basis

    Argument indicating basis to use for splitting mixed stream, default - SplittingType.totalFlow. Valid values: { SplittingType.totalFlow - split based on total flow (split fraction indexed only by time and outlet), SplittingType.phaseFlow - split based on phase flows (split fraction indexed by time, outlet and phase), SplittingType.componentFlow - split based on component flows (split fraction indexed by time, outlet and components), SplittingType.phaseComponentFlow - split based on phase-component flows ( split fraction indexed by both time, outlet, phase and components).}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - pressure in all outlets is equal, MomentumBalanceType.pressurePhase - not yet supported, MomentumBalanceType.momentumTotal - not yet supported, MomentumBalanceType.momentumPhase - not yet supported.}

    has_phase_equilibrium

    Argument indicating whether phase equilibrium should be calculated for the resulting mixed stream, default - False. Valid values: { True - calculate phase equilibrium in mixed stream, False - do not calculate equilibrium in mixed stream.}

    energy_split_basis

    Argument indicating basis to use for splitting energy this is not used for when ideal_separation == True. default - EnergySplittingType.equal_temperature. Valid values: { EnergySplittingType.none - no energy balance constraints, EnergySplittingType.equal_temperature - outlet temperatures equal inlet, EnergySplittingType.equal_molar_enthalpy - outlet molar enthalpies equal inlet, EnergySplittingType.enthalpy_split - apply split fractions to enthalpy flows. Does not work with component or phase-component splitting.}

    ideal_separation

    Argument indicating whether ideal splitting should be used. Ideal splitting assumes perfect spearation of material, and attempts to avoid duplication of StateBlocks by directly partitioning outlet flows to ports, default - False. Valid values: { True - use ideal splitting methods. Cannot be combined with has_phase_equilibrium = True, False - use explicit splitting equations with split fractions.}

    ideal_split_map

    Dictionary containing information on how extensive variables should be partitioned when using ideal splitting (ideal_separation = True). default - None. Valid values: { dict with keys of indexing set members and values indicating which outlet this combination of keys should be partitioned to. E.g. {(“Vap”, “H2”): “outlet_1”}}

    mixed_state_block

    An existing state block to use as the source stream from the Separator block, default - None. Valid values: { None - create a new StateBlock for the mixed stream, StateBlock - a StateBock to use as the source for the mixed stream.}

    construct_ports

    Argument indicating whether model should construct Port objects linked the mixed state and all outlet states, default - True. Valid values: { True - construct Ports for all states, False - do not construct Ports.

    activated_sludge_model

    Options to account for version of activated sludge model property package.

    default - ActivatedSludgeModelType.ASM1

    Configuration Options

    Description

    ActivatedSludgeModelType.ASM1

    ASM1 model

    ActivatedSludgeModelType.ASM2D

    ASM2D model

    ActivatedSludgeModelType.modified_ASM2D

    modified ASM2D model for ADM1 compatibility

  • 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:

(DewateringUnit) New instance

watertap.unit_models.electroNP_ZO module

class watertap.unit_models.electroNP_ZO.ElectroNPZO(*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. Product blocks are always steady- state.

    has_holdup

    Product blocks do not contain holdup, 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, PropertyParameterObject - a PropertyParameterBlock 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.}

    outlet_list

    A list containing names of outlets, default - None. Valid values: { None - use num_outlets argument, list - a list of names to use for outlets.}

    num_outlets

    Argument indicating number (int) of outlets to construct, not used if outlet_list arg is provided, default - None. Valid values: { None - use outlet_list arg instead, or default to 2 if neither argument provided, int - number of outlets to create (will be named with sequential integers from 1 to num_outlets).}

    split_basis

    Argument indicating basis to use for splitting mixed stream, default - SplittingType.totalFlow. Valid values: { SplittingType.totalFlow - split based on total flow (split fraction indexed only by time and outlet), SplittingType.phaseFlow - split based on phase flows (split fraction indexed by time, outlet and phase), SplittingType.componentFlow - split based on component flows (split fraction indexed by time, outlet and components), SplittingType.phaseComponentFlow - split based on phase-component flows ( split fraction indexed by both time, outlet, phase and components).}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - pressure in all outlets is equal, MomentumBalanceType.pressurePhase - not yet supported, MomentumBalanceType.momentumTotal - not yet supported, MomentumBalanceType.momentumPhase - not yet supported.}

    has_phase_equilibrium

    Argument indicating whether phase equilibrium should be calculated for the resulting mixed stream, default - False. Valid values: { True - calculate phase equilibrium in mixed stream, False - do not calculate equilibrium in mixed stream.}

    energy_split_basis

    Argument indicating basis to use for splitting energy this is not used for when ideal_separation == True. default - EnergySplittingType.equal_temperature. Valid values: { EnergySplittingType.none - no energy balance constraints, EnergySplittingType.equal_temperature - outlet temperatures equal inlet, EnergySplittingType.equal_molar_enthalpy - outlet molar enthalpies equal inlet, EnergySplittingType.enthalpy_split - apply split fractions to enthalpy flows. Does not work with component or phase-component splitting.}

    ideal_separation

    Argument indicating whether ideal splitting should be used. Ideal splitting assumes perfect spearation of material, and attempts to avoid duplication of StateBlocks by directly partitioning outlet flows to ports, default - False. Valid values: { True - use ideal splitting methods. Cannot be combined with has_phase_equilibrium = True, False - use explicit splitting equations with split fractions.}

    ideal_split_map

    Dictionary containing information on how extensive variables should be partitioned when using ideal splitting (ideal_separation = True). default - None. Valid values: { dict with keys of indexing set members and values indicating which outlet this combination of keys should be partitioned to. E.g. {(“Vap”, “H2”): “outlet_1”}}

    mixed_state_block

    An existing state block to use as the source stream from the Separator block, default - None. Valid values: { None - create a new StateBlock for the mixed stream, StateBlock - a StateBock to use as the source for the mixed stream.}

    construct_ports

    Argument indicating whether model should construct Port objects linked the mixed state and all outlet states, default - True. Valid values: { True - construct Ports for all states, False - do not construct Ports.

  • 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:

(ElectroNPZO) New instance

class watertap.unit_models.electroNP_ZO.ElectroNPZOdata(component)[source]

Bases: SeparatorData

Zero order electrochemical nutrient removal (ElectroNP) model based on specified removal efficiencies for nitrogen and phosphorus.

build()[source]

General build method for SeparatorData. 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.unit_models.electrodialysis_0D module

class watertap.unit_models.electrodialysis_0D.ElectricalOperationMode(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.electrodialysis_0D.Electrodialysis0D(*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.

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    pressure_drop_method

    default - PressureDropMethod.none

    Configuration Options

    Description

    PressureDropMethod.none

    The frictional pressure drop is neglected.

    PressureDropMethod.experimental

    The pressure drop is calculated by an experimental data as pressure drop per unit lenght.

    PressureDropMethod.Darcy_Weisbach

    The pressure drop is calculated by the Darcy-Weisbach equation.

    friction_factor_method

    default - FrictionFactorMethod.fixed

    Configuration Options

    Description

    FrictionFactorMethod.fixed

    Friction factor is fixed by users

    FrictionFactorMethod.Gurreri

    Friction factor evaluated based on Gurreri’s work

    FrictionFactorMethod.Kuroda

    Friction factor evaluated based on Kuroda’s work

    hydraulic_diameter_method

    default - HydraulicDiameterMethod.conventional

    Configuration Options

    Description

    HydraulicDiameterMethod.fixed

    Hydraulic diameter is fixed by users

    HydraulicDiameterMethod.conventional

    Conventional method for a rectangular channel with spacer porosity considered

    HydraulicDiameterMethod.spacer_specific_area_known

    A method for spacer-filled channel requiring the spacer specific area data

    operation_mode

    The electrical operation mode. To be selected between Constant Current and Constant Voltage

    limiting_current_density_method

    default - LimitingCurrentDensityMethod.InitialValue

    Configuration Options

    Description

    LimitingCurrentDensityMethod.InitialValue

    Limiting current is calculated from a single initial value of the feed solution tested by the user.

    LimitingCurrentDensityMethod.Empirical

    Limiting current density is caculated from the empirical equation: TODO

    LimitingCurrentDensityMethod.Theoretical

    Limiting current density is calculated from a theoretical equation: TODO

    limiting_current_density_data

    Limiting current density data input

    has_nonohmic_potential_membrane

    Configuration for whether to model the nonohmic potential across ion exchange membranes

    has_Nernst_diffusion_layer

    Configuration for whether to simulate the concentration- polarized diffusion layers

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    is_isothermal

    Assume isothermal conditions for control volume(s); energy_balance_type must be EnergyBalanceType.none, default - True.

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.none. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    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:

(Electrodialysis0D) New instance

class watertap.unit_models.electrodialysis_0D.Electrodialysis0DData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

0D Electrodialysis 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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for pressure changer initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

class watertap.unit_models.electrodialysis_0D.FrictionFactorMethod(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.electrodialysis_0D.HydraulicDiameterMethod(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.electrodialysis_0D.LimitingCurrentDensityMethod(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.electrodialysis_0D.PressureDropMethod(value)[source]

Bases: Enum

An enumeration.

watertap.unit_models.electrodialysis_1D module

class watertap.unit_models.electrodialysis_1D.ElectricalOperationMode(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.electrodialysis_1D.Electrodialysis1D(*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.

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    pressure_drop_method

    default - PressureDropMethod.none

    Configuration Options

    Description

    PressureDropMethod.none

    The frictional pressure drop is neglected.

    PressureDropMethod.experimental

    The pressure drop is calculated by an experimental data as pressure drop per unit lenght.

    PressureDropMethod.Darcy_Weisbach

    The pressure drop is calculated by the Darcy-Weisbach equation.

    friction_factor_method

    default - FrictionFactorMethod.fixed

    Configuration Options

    Description

    FrictionFactorMethod.fixed

    Friction factor is fixed by users

    FrictionFactorMethod.Gurreri

    Friction factor evaluated based on Gurreri’s work

    FrictionFactorMethod.Kuroda

    Friction factor evaluated based on Kuroda’s work

    hydraulic_diameter_method

    default - HydraulicDiameterMethod.conventional

    Configuration Options

    Description

    HydraulicDiameterMethod.fixed

    Hydraulic diameter is fixed by users

    HydraulicDiameterMethod.conventional

    Conventional method for a rectangular channel with spacer porosity considered

    HydraulicDiameterMethod.spacer_specific_area_known

    A method for spacer-filled channel requiring the spacer specific area data

    operation_mode

    The electrical operation mode. To be selected between Constant Current and Constant Voltage

    limiting_current_density_method

    default - LimitingCurrentDensityMethod.InitialValue

    Configuration Options

    Description

    LimitingCurrentDensityMethod.InitialValue

    Limiting current is calculated from a single initial value of the feed solution tested by the user.

    LimitingCurrentDensityMethod.Empirical

    Limiting current density is calculated from the empirical equation.

    LimitingCurrentDensityMethod.Theoretical

    Limiting current density is calculated from a theoretical equation.

    limiting_current_density_data

    Limiting current density data input

    has_nonohmic_potential_membrane

    Configuration for whether to model the nonohmic potential across ion exchange membranes

    has_Nernst_diffusion_layer

    Configuration for whether to simulate the concentration- polarized diffusion layers

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    is_isothermal

    Assume isothermal conditions for control volume(s); energy_balance_type must be EnergyBalanceType.none, default - True.

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.none. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    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.}

    transformation_method

    Discretization method to use for DAE transformation. See Pyomo documentation for supported transformations.

    transformation_scheme

    Discretization scheme to use when transforming domain. See Pyomo documentation for supported schemes.

    finite_elements

    Number of finite elements to use when discretizing length domain (default=10)

    collocation_points

    Number of collocation points to use per finite element when discretizing length domain (default=2)

  • 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:

(Electrodialysis1D) New instance

class watertap.unit_models.electrodialysis_1D.Electrodialysis1DData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

1D Electrodialysis 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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None, fail_on_warning=False, ignore_dof=False)[source]

General wrapper for electrodialysis_1D initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

  • fail_on_warning – boolean argument to fail or only produce warning upon unsuccessful solve (default=False)

  • ignore_dof – boolean argument to ignore when DOF != 0 (default=False)

Returns: None

class watertap.unit_models.electrodialysis_1D.FrictionFactorMethod(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.electrodialysis_1D.HydraulicDiameterMethod(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.electrodialysis_1D.LimitingCurrentDensityMethod(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.electrodialysis_1D.PressureDropMethod(value)[source]

Bases: Enum

An enumeration.

watertap.unit_models.electrolyzer module

class watertap.unit_models.electrolyzer.Electrolyzer(*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 electrolyzer 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 electrolyzer 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.}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    is_isothermal

    Assume isothermal conditions for control volume(s); energy_balance_type must be EnergyBalanceType.none, default - True.

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.none. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

  • 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:

(Electrolyzer) New instance

class watertap.unit_models.electrolyzer.ElectrolyzerData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

Faradaic conversion electrolyzer model developed specifically for chlor alkali electrolysis using a membrane electrolyzer this model development is ongoing

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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

watertap.unit_models.gac module

class watertap.unit_models.gac.FilmTransferCoefficientType(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.gac.GAC(*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.}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    is_isothermal

    Assume isothermal conditions for control volume(s); energy_balance_type must be EnergyBalanceType.none, default - True.

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.none. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    film_transfer_coefficient_type

    Indicates whether the liquid phase film transfer rate will be calculated or fixed by the user default - FilmTransferCoefficientType.fixed. Valid values: { FilmTransferCoefficientType.fixed - user specifies film transfer rate, FilmTransferCoefficientType.calculated - calculates film transfer rate based on the Gnielinshi correlation}

    surface_diffusion_coefficient_type

    Indicates whether the surface diffusion coefficient will be calculated or fixed by the user default - SurfaceDiffusionCoefficientType.fixed. Valid values: { SurfaceDiffusionCoefficientType.fixed - user specifies surface diffusion coefficient, SurfaceDiffusionCoefficientType.calculated - calculates surface diffusion coefficient by the Crittenden correlation}

    target_species

    Indicate which component in the property package’s component list is the target species for adsorption by the GAC system, currently the model supports a single species default - None. Valid values: { if the property package solute set only contains one item (two component, one solute and one solvent/water), the model will accept the single solute as the target species, for multi-solute systems a string of the component id must be provided.}

    finite_elements_ss_approximation

    Number of finite elements to use when discretizing operational time (default=5)

  • 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:

(GAC) New instance

class watertap.unit_models.gac.GACData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

Empirical Constant-Pattern-Homogeneous-Surface-Diffusion Model (CPHSDM) for Granular Activated Carbon - currently only available to model with the multicomp_aq_sol_prop_pack

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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

class watertap.unit_models.gac.SurfaceDiffusionCoefficientType(value)[source]

Bases: Enum

An enumeration.

watertap.unit_models.generic_desalter module

class watertap.unit_models.generic_desalter.GenericDesalter(*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. NF units do not support dynamic behavior.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. NF units do not have defined volume, thus this must be False.

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    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.}

    tracked_solids_list

    A list of solids that will should be tracked in the waste of desalter unit, if None, then model will not include calculation of water content in solids or solids concentration

  • 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:

(GenericDesalter) New instance

class watertap.unit_models.generic_desalter.GenericDesalterData(component)[source]

Bases: UnitModelBlockData

GenericDesalter - users must provide water recovery

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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

watertap.unit_models.generic_separation module

class watertap.unit_models.generic_separation.GenericSeparation(*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. NF units do not support dynamic behavior.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. NF units do not have defined volume, thus this must be False.

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    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:

(GenericSeparation) New instance

class watertap.unit_models.generic_separation.GenericSeparationData(component)[source]

Bases: UnitModelBlockData

GenericDesalter - users must provide water recovery

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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

watertap.unit_models.ion_exchange_0D module

class watertap.unit_models.ion_exchange_0D.IonExchange0D(*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.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - 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.}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.none. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    target_ion

    Designates targeted species for removal

    regenerant

    Chemical used for regeneration of fixed bed

    hazardous_waste

    Designates if resin and residuals contain hazardous material

    isotherm

    Designates the isotherm type to use for equilibrium calculations

  • 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:

(IonExchange0D) New instance

class watertap.unit_models.ion_exchange_0D.IonExchangeODData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

Zero order ion exchange 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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

class watertap.unit_models.ion_exchange_0D.IonExchangeType(value)[source]

Bases: StrEnum

An enumeration.

class watertap.unit_models.ion_exchange_0D.IsothermType(value)[source]

Bases: StrEnum

An enumeration.

class watertap.unit_models.ion_exchange_0D.RegenerantChem(value)[source]

Bases: StrEnum

An enumeration.

watertap.unit_models.nanofiltration_DSPMDE_0D module

class watertap.unit_models.nanofiltration_DSPMDE_0D.ConcentrationPolarizationType(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.nanofiltration_DSPMDE_0D.MassTransferCoefficient(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.nanofiltration_DSPMDE_0D.NanofiltrationDSPMDE0D(*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. NF units do not support dynamic behavior.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. NF units do not have defined volume, thus this must be False.

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    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.}

    mass_transfer_coefficient

    Options to account for mass transfer coefficient.

    default - MassTransferCoefficient.fixed

    Configuration Options

    Description

    MassTransferCoefficient.none

    Simplifying assumption to ignore mass transfer coefficient

    MassTransferCoefficient.fixed

    Specify an estimated value for the mass transfer coefficient in the feed channel

    MassTransferCoefficient.spiral_wound

    Allow model to perform calculation of mass transfer coefficient based on spiral wound module correlation

    concentration_polarization_type

    Options to account for concentration polarization.

    default - ConcentrationPolarizationType.calculated

    Configuration Options

    Description

    ConcentrationPolarizationType.none

    Simplifying assumption to ignore concentration polarization

    ConcentrationPolarizationType.calculated

    Allow model to perform calculation of membrane-interface concentration

  • 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:

(NanofiltrationDSPMDE0D) New instance

class watertap.unit_models.nanofiltration_DSPMDE_0D.NanofiltrationData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

Nanofiltration model based on Donnan Steric Pore Model with Dielectric Exclusion (DSPM-DE).

Assumptions
  • Membrane electric potential at membrane interface is taken as reference (i.e., equal to 0)

References

Geraldes and Alves, 2008 (https://doi.org/10.1016/j.memsci.2008.04.054) Roy et al., 2015 (http://dx.doi.org/10.1016/j.memsci.2015.06.030) Labban et al., 2017 (http://dx.doi.org/10.1016/j.memsci.2016.08.062)

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

initialize_build(initialize_guess=None, state_args=None, outlvl=0, solver=None, optarg=None, fail_on_warning=False, ignore_dof=False, automate_rescale=False)[source]

General wrapper for pressure changer initialization routines

Keyword Arguments:
  • initialize_guess – a dict of guesses for …. #TODO: revise as appropriate solvent_recovery, solute_recovery, and cp_modulus. These guesses offset the initial values for the retentate, permeate, and membrane interface state blocks from the inlet feed (default = {‘deltaP’: -1e4, ‘solvent_recovery’: 0.5, ‘solute_recovery’: 0.01, ‘cp_modulus’: 1.1})

  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

  • fail_on_warning – boolean argument to fail or only produce warning upon unsuccessful solve (default=False)

  • ignore_dof – boolean argument to ignore when DOF != 0 (default=False)

  • automate_rescale – boolean argument to automatically rescale poorly scaled vars

Returns:

None

watertap.unit_models.nanofiltration_ZO module

class watertap.unit_models.nanofiltration_ZO.NanofiltrationData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

Zero order nanofiltration model based on specified water flux and ion rejection. Default data from Table 9 in Labban et al. (2017) https://doi.org/10.1016/j.memsci.2016.08.062

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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for pressure changer initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

class watertap.unit_models.nanofiltration_ZO.NanofiltrationZO(*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. NF units do not support dynamic behavior.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. NF units do not have defined volume, thus this must be False.

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    is_isothermal

    Assume isothermal conditions for control volume(s); energy_balance_type must be EnergyBalanceType.none, default - True.

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.none. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    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:

(NanofiltrationZO) New instance

watertap.unit_models.osmotically_assisted_reverse_osmosis_0D module

class watertap.unit_models.osmotically_assisted_reverse_osmosis_0D.OsmoticallyAssistedReverseOsmosis0D(*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. Membrane units do not yet support dynamic behavior.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. Membrane units do 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 ConfigDict with arguments to be passed to a property block(s) and used when constructing these. default - None. Valid values: { see property package for documentation.}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed. default - useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    concentration_polarization_type

    Options to account for concentration polarization.

    default - ConcentrationPolarizationType.calculated

    Configuration Options

    Description

    ConcentrationPolarizationType.none

    Simplifying assumption to ignore concentration polarization

    ConcentrationPolarizationType.fixed

    Specify an estimated value for the concentration polarization modulus

    ConcentrationPolarizationType.calculated

    Allow model to perform calculation of membrane-interface concentration

    mass_transfer_coefficient

    Options to account for mass transfer coefficient.

    default - MassTransferCoefficient.calculated

    Configuration Options

    Description

    MassTransferCoefficient.none

    Mass transfer coefficient not used in calculations

    MassTransferCoefficient.fixed

    Specify an estimated value for the mass transfer coefficient in the feed channel

    MassTransferCoefficient.calculated

    Allow model to perform calculation of mass transfer coefficient

    transport_model

    Options to account for mass transfer model.

    default - TransportModel.SD

    TransportModel.SD”, “Solution-diffusion model for describing water and salt transport for most membrane types” “TransportModel.SKK”, “Speigler-Kedem-Katchalsky model for describing water and salt transport”

    module_type

    Options to account for geometry differences between flat sheet and spiral wound membranes.

    default - ModuleType.flat_sheet

    ModuleType.flat_sheet”, “Module type option for flat-sheet membrane modules” “ModuleType.spiral_wound”, “Module type option for spiral-wound membrane modules, this option accounts for how membranes in spiral-wound modules are folded which reduces the channel width by half”

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    pressure_change_type Indicates what type of pressure change calculation will be made. To use any of the pressure_change_type options to account for pressure drop, the configuration keyword has_pressure_change must also be set to True. Also, if a value is specified for pressure change, it should be negative to represent pressure drop.

    default - PressureChangeType.fixed_per_stage

    Configuration Options

    Description

    PressureChangeType.fixed_per_stage

    Specify an estimated value for pressure drop across the membrane feed channel

    PressureChangeType.fixed_per_unit_length

    Specify an estimated value for pressure drop per unit length across the membrane feed channel

    PressureChangeType.calculated

    Allow model to perform calculation of pressure drop across the membrane feed channel

    friction_factor

    Options to account for friction factor correlations.

    default - FrictionFactor.default_by_module_type

    Configuration Options

    Description

    FrictionFactor.default_by_module_type

    Friction factor correlation that is specific to the supported membrane modules type

    has_full_reporting

    Level of reporting results. default - False. Valid values: { False - include minimal reporting of results, True - report additional properties of interest that aren’t constructed by the unit model by default. Also, report averaged expression values

  • 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:

(OsmoticallyAssistedReverseOsmosis0D) New instance

class watertap.unit_models.osmotically_assisted_reverse_osmosis_0D.OsmoticallyAssistedReverseOsmosisData(component)[source]

Bases: OsmoticallyAssistedReverseOsmosisBaseData

Standard OARO Unit Model Class: - zero dimensional model - steady state only - single liquid phase only

watertap.unit_models.osmotically_assisted_reverse_osmosis_1D module

class watertap.unit_models.osmotically_assisted_reverse_osmosis_1D.OsmoticallyAssistedReverseOsmosis1D(*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. Membrane units do not yet support dynamic behavior.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. Membrane units do 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 ConfigDict with arguments to be passed to a property block(s) and used when constructing these. default - None. Valid values: { see property package for documentation.}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed. default - useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    concentration_polarization_type

    Options to account for concentration polarization.

    default - ConcentrationPolarizationType.calculated

    Configuration Options

    Description

    ConcentrationPolarizationType.none

    Simplifying assumption to ignore concentration polarization

    ConcentrationPolarizationType.fixed

    Specify an estimated value for the concentration polarization modulus

    ConcentrationPolarizationType.calculated

    Allow model to perform calculation of membrane-interface concentration

    mass_transfer_coefficient

    Options to account for mass transfer coefficient.

    default - MassTransferCoefficient.calculated

    Configuration Options

    Description

    MassTransferCoefficient.none

    Mass transfer coefficient not used in calculations

    MassTransferCoefficient.fixed

    Specify an estimated value for the mass transfer coefficient in the feed channel

    MassTransferCoefficient.calculated

    Allow model to perform calculation of mass transfer coefficient

    transport_model

    Options to account for mass transfer model.

    default - TransportModel.SD

    TransportModel.SD”, “Solution-diffusion model for describing water and salt transport for most membrane types” “TransportModel.SKK”, “Speigler-Kedem-Katchalsky model for describing water and salt transport”

    module_type

    Options to account for geometry differences between flat sheet and spiral wound membranes.

    default - ModuleType.flat_sheet

    ModuleType.flat_sheet”, “Module type option for flat-sheet membrane modules” “ModuleType.spiral_wound”, “Module type option for spiral-wound membrane modules, this option accounts for how membranes in spiral-wound modules are folded which reduces the channel width by half”

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    pressure_change_type Indicates what type of pressure change calculation will be made. To use any of the pressure_change_type options to account for pressure drop, the configuration keyword has_pressure_change must also be set to True. Also, if a value is specified for pressure change, it should be negative to represent pressure drop.

    default - PressureChangeType.fixed_per_stage

    Configuration Options

    Description

    PressureChangeType.fixed_per_stage

    Specify an estimated value for pressure drop across the membrane feed channel

    PressureChangeType.fixed_per_unit_length

    Specify an estimated value for pressure drop per unit length across the membrane feed channel

    PressureChangeType.calculated

    Allow model to perform calculation of pressure drop across the membrane feed channel

    friction_factor

    Options to account for friction factor correlations.

    default - FrictionFactor.default_by_module_type

    Configuration Options

    Description

    FrictionFactor.default_by_module_type

    Friction factor correlation that is specific to the supported membrane modules type

    area_definition

    Argument defining whether area variable should be spatially variant or not. default - DistributedVars.uniform. Valid values: { DistributedVars.uniform - area does not vary across spatial domain, DistributedVars.variant - area can vary over the domain and is indexed by time and space.}

    transformation_method

    Discretization method to use for DAE transformation. See Pyomo documentation for supported transformations.

    transformation_scheme

    Discretization scheme to use when transforming domain. See Pyomo documentation for supported schemes.

    finite_elements

    Number of finite elements to use when discretizing length domain (default=10)

    collocation_points

    Number of collocation points to use per finite element when discretizing length domain (default=5)

    has_full_reporting

    Level of reporting results. default - False. Valid values: { False - include minimal reporting of results, True - report additional properties of interest that aren’t constructed by the unit model by default. Also, report averaged expression values

  • 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:

(OsmoticallyAssistedReverseOsmosis1D) New instance

class watertap.unit_models.osmotically_assisted_reverse_osmosis_1D.OsmoticallyAssistedReverseOsmosis1DData(component)[source]

Bases: OsmoticallyAssistedReverseOsmosisBaseData

Standard 1D OARO Unit Model Class: - one dimensional model - steady state only - single liquid phase only

watertap.unit_models.osmotically_assisted_reverse_osmosis_base module

class watertap.unit_models.osmotically_assisted_reverse_osmosis_base.OsmoticallyAssistedReverseOsmosisBaseData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

Osmotically Assisted Reverse Osmosis base class

build()[source]

Common variables and constraints for an OARO unit model

initialize_build(initialize_guess=None, state_args_feed=None, state_args_permeate=None, outlvl=0, solver=None, optarg=None, raise_on_isothermal_violation=True)[source]

General wrapper for RO initialization routines

Keyword Arguments:
  • initialize_guess – a dict of guesses for solvent_recovery, solute_recovery, and cp_modulus. These guesses offset the initial values for the retentate, permeate, and membrane interface state blocks from the inlet feed (default = {‘deltaP’: -1e4, ‘solvent_recovery’: 0.5, ‘solute_recovery’: 0.01, ‘cp_modulus’: 1.1})

  • state_args_feed – a dict of arguments to be passed to the property package(s) to provide an initial state for the inlet feed side state block (see documentation of the specific property package) (default = None).

  • state_args_permeate – a dict of arguments to be passed to the property package(s) to provide an initial state for the inlet permeate side state block (see documentation of the specific property package) (default = None).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – solver object or string indicating which solver to use during initialization, if None provided the default solver will be used (default = None)

Returns:

None

watertap.unit_models.pressure_changer module

class watertap.unit_models.pressure_changer.EnergyRecoveryDevice(*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 = useDefault. Valid values: { useDefault - get flag from parent (default = False), True - set as a dynamic model, False - set as a steady-state model.}

    has_holdup

    Indicates whether holdup terms should be constructed or not. Must be True if dynamic = True, default - False. Valid values: { useDefault - get flag from parent (default = False), True - construct holdup terms, False - do not construct holdup terms}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_phase_equilibrium

    Indicates whether terms for phase equilibrium should be constructed, default = False. Valid values: { True - include phase equilibrium terms False - exclude phase equilibrium terms.}

    compressor

    Indicates whether this unit should be considered a compressor (True (default), pressure increase) or an expander (False, pressure decrease).

    thermodynamic_assumption

    Flag to set the thermodynamic assumption to use for the unit. - ThermodynamicAssumption.isothermal (default) - ThermodynamicAssumption.isentropic - ThermodynamicAssumption.pump - ThermodynamicAssumption.adiabatic

    property_package

    Property parameter object used to define property calculations, default - useDefault. Valid values: { useDefault - use default package from parent model or flowsheet, PropertyParameterObject - a PropertyParameterBlock 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.}

    support_isentropic_performance_curves

    Include a block for performance curves, configure via isentropic_performance_curves.

    isentropic_performance_curves

    Configuration dictionary for the performance curve block.

    isentropic_performance_curves
    build_callback

    Optional callback to add performance curve constraints

    build_head_expressions

    If true add expressions for ‘head’ and ‘head_isentropic’. These expressions can be used in performance curve constraints.

    variable_efficiency

    Indicates the relationship used to define pump efficiency VariableEfficiency.none - uses default pump efficiency at BEP VariableEfficiency.flow - uses an efficiency correlation scaled to the BEP flow rate VariableEfficiency.flow_head - uses an efficiency correlation scaled to the BEP flow rate and head

  • 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:

(EnergyRecoveryDevice) New instance

class watertap.unit_models.pressure_changer.EnergyRecoveryDeviceData(component)[source]

Bases: PumpIsothermalData

Turbine-type isothermal energy recovery device

class watertap.unit_models.pressure_changer.Pump(*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 = useDefault. Valid values: { useDefault - get flag from parent (default = False), True - set as a dynamic model, False - set as a steady-state model.}

    has_holdup

    Indicates whether holdup terms should be constructed or not. Must be True if dynamic = True, default - False. Valid values: { useDefault - get flag from parent (default = False), True - construct holdup terms, False - do not construct holdup terms}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_phase_equilibrium

    Indicates whether terms for phase equilibrium should be constructed, default = False. Valid values: { True - include phase equilibrium terms False - exclude phase equilibrium terms.}

    compressor

    Indicates whether this unit should be considered a compressor (True (default), pressure increase) or an expander (False, pressure decrease).

    thermodynamic_assumption

    Flag to set the thermodynamic assumption to use for the unit. - ThermodynamicAssumption.isothermal (default) - ThermodynamicAssumption.isentropic - ThermodynamicAssumption.pump - ThermodynamicAssumption.adiabatic

    property_package

    Property parameter object used to define property calculations, default - useDefault. Valid values: { useDefault - use default package from parent model or flowsheet, PropertyParameterObject - a PropertyParameterBlock 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.}

    support_isentropic_performance_curves

    Include a block for performance curves, configure via isentropic_performance_curves.

    isentropic_performance_curves

    Configuration dictionary for the performance curve block.

    isentropic_performance_curves
    build_callback

    Optional callback to add performance curve constraints

    build_head_expressions

    If true add expressions for ‘head’ and ‘head_isentropic’. These expressions can be used in performance curve constraints.

    variable_efficiency

    Indicates the relationship used to define pump efficiency VariableEfficiency.none - uses default pump efficiency at BEP VariableEfficiency.flow - uses an efficiency correlation scaled to the BEP flow rate VariableEfficiency.flow_head - uses an efficiency correlation scaled to the BEP flow rate and head

  • 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:

(Pump) New instance

class watertap.unit_models.pressure_changer.PumpIsothermalData(component)[source]

Bases: InitializationMixin, PumpData

Standard Isothermal Pump Unit Model Class

build()[source]
Parameters:

None

Returns:

None

class watertap.unit_models.pressure_changer.VariableEfficiency(value)[source]

Bases: Enum

An enumeration.

watertap.unit_models.pressure_exchanger module

class watertap.unit_models.pressure_exchanger.PressureExchangeType(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.pressure_exchanger.PressureExchanger(*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. Pressure exchangers do not support dynamic behavior.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. Pressure exchangers do not have defined volume, thus this must be False.

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    is_isothermal

    Assume isothermal conditions for control volume(s); energy_balance_type must be EnergyBalanceType.none, default - True.

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.none. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    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.}

    has_leakage

    Indicates whether pressure exchanger has leakage. default - False.

    has_mixing

    Indicates whether pressure exchanger has mixing. default - False.

    pressure_exchange_calculation

    Indicates what type of pressure exchange calculation method should be used. default - PressureExchangeType.efficiency. Valid values: { PressureExchangeType.efficiency - calculates momentum transfer by pressure exchanger efficiency, PressureExchangeType.high_pressure_difference - calculates momentum transfer by high pressure difference}

  • 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:

(PressureExchanger) New instance

class watertap.unit_models.pressure_exchanger.PressureExchangerData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

Standard Pressure Exchanger Unit Model Class: - steady state only

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

initialize_build(state_args=None, routine=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for pressure exchanger initialization routine

Keyword Arguments:
  • routine – str stating which initialization routine to execute * None - currently no specialized routine for Pressure exchanger unit

  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine (default=idaeslog.NOTSET)

  • optarg – solver options dictionary object, if None provided an empty dictionary will be used (default=None)

  • solver – solver object or string indicating which solver to use during initialization, if None provided the default solver will be used (default = None)

Returns: None

watertap.unit_models.reverse_osmosis_0D module

class watertap.unit_models.reverse_osmosis_0D.ReverseOsmosis0D(*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. Membrane units do not yet support dynamic behavior.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. Membrane units do 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 ConfigDict with arguments to be passed to a property block(s) and used when constructing these. default - None. Valid values: { see property package for documentation.}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed. default - useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    concentration_polarization_type

    Options to account for concentration polarization.

    default - ConcentrationPolarizationType.calculated

    Configuration Options

    Description

    ConcentrationPolarizationType.none

    Simplifying assumption to ignore concentration polarization

    ConcentrationPolarizationType.fixed

    Specify an estimated value for the concentration polarization modulus

    ConcentrationPolarizationType.calculated

    Allow model to perform calculation of membrane-interface concentration

    mass_transfer_coefficient

    Options to account for mass transfer coefficient.

    default - MassTransferCoefficient.calculated

    Configuration Options

    Description

    MassTransferCoefficient.none

    Mass transfer coefficient not used in calculations

    MassTransferCoefficient.fixed

    Specify an estimated value for the mass transfer coefficient in the feed channel

    MassTransferCoefficient.calculated

    Allow model to perform calculation of mass transfer coefficient

    transport_model

    Options to account for mass transfer model.

    default - TransportModel.SD

    TransportModel.SD”, “Solution-diffusion model for describing water and salt transport for most membrane types” “TransportModel.SKK”, “Speigler-Kedem-Katchalsky model for describing water and salt transport”

    module_type

    Options to account for geometry differences between flat sheet and spiral wound membranes.

    default - ModuleType.flat_sheet

    ModuleType.flat_sheet”, “Module type option for flat-sheet membrane modules” “ModuleType.spiral_wound”, “Module type option for spiral-wound membrane modules, this option accounts for how membranes in spiral-wound modules are folded which reduces the channel width by half”

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    pressure_change_type Indicates what type of pressure change calculation will be made. To use any of the pressure_change_type options to account for pressure drop, the configuration keyword has_pressure_change must also be set to True. Also, if a value is specified for pressure change, it should be negative to represent pressure drop.

    default - PressureChangeType.fixed_per_stage

    Configuration Options

    Description

    PressureChangeType.fixed_per_stage

    Specify an estimated value for pressure drop across the membrane feed channel

    PressureChangeType.fixed_per_unit_length

    Specify an estimated value for pressure drop per unit length across the membrane feed channel

    PressureChangeType.calculated

    Allow model to perform calculation of pressure drop across the membrane feed channel

    friction_factor

    Options to account for friction factor correlations.

    default - FrictionFactor.default_by_module_type

    Configuration Options

    Description

    FrictionFactor.default_by_module_type

    Friction factor correlation that is specific to the supported membrane modules type

    has_full_reporting

    Level of reporting results. default - False. Valid values: { False - include minimal reporting of results, True - report additional properties of interest that aren’t constructed by the unit model by default. Also, report averaged expression values

  • 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:

(ReverseOsmosis0D) New instance

class watertap.unit_models.reverse_osmosis_0D.ReverseOsmosisData(component)[source]

Bases: ReverseOsmosisBaseData

Standard RO Unit Model Class: - zero dimensional model - steady state only - single liquid phase only

watertap.unit_models.reverse_osmosis_1D module

class watertap.unit_models.reverse_osmosis_1D.ReverseOsmosis1D(*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. Membrane units do not yet support dynamic behavior.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. Membrane units do 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 ConfigDict with arguments to be passed to a property block(s) and used when constructing these. default - None. Valid values: { see property package for documentation.}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed. default - useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    concentration_polarization_type

    Options to account for concentration polarization.

    default - ConcentrationPolarizationType.calculated

    Configuration Options

    Description

    ConcentrationPolarizationType.none

    Simplifying assumption to ignore concentration polarization

    ConcentrationPolarizationType.fixed

    Specify an estimated value for the concentration polarization modulus

    ConcentrationPolarizationType.calculated

    Allow model to perform calculation of membrane-interface concentration

    mass_transfer_coefficient

    Options to account for mass transfer coefficient.

    default - MassTransferCoefficient.calculated

    Configuration Options

    Description

    MassTransferCoefficient.none

    Mass transfer coefficient not used in calculations

    MassTransferCoefficient.fixed

    Specify an estimated value for the mass transfer coefficient in the feed channel

    MassTransferCoefficient.calculated

    Allow model to perform calculation of mass transfer coefficient

    transport_model

    Options to account for mass transfer model.

    default - TransportModel.SD

    TransportModel.SD”, “Solution-diffusion model for describing water and salt transport for most membrane types” “TransportModel.SKK”, “Speigler-Kedem-Katchalsky model for describing water and salt transport”

    module_type

    Options to account for geometry differences between flat sheet and spiral wound membranes.

    default - ModuleType.flat_sheet

    ModuleType.flat_sheet”, “Module type option for flat-sheet membrane modules” “ModuleType.spiral_wound”, “Module type option for spiral-wound membrane modules, this option accounts for how membranes in spiral-wound modules are folded which reduces the channel width by half”

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    pressure_change_type Indicates what type of pressure change calculation will be made. To use any of the pressure_change_type options to account for pressure drop, the configuration keyword has_pressure_change must also be set to True. Also, if a value is specified for pressure change, it should be negative to represent pressure drop.

    default - PressureChangeType.fixed_per_stage

    Configuration Options

    Description

    PressureChangeType.fixed_per_stage

    Specify an estimated value for pressure drop across the membrane feed channel

    PressureChangeType.fixed_per_unit_length

    Specify an estimated value for pressure drop per unit length across the membrane feed channel

    PressureChangeType.calculated

    Allow model to perform calculation of pressure drop across the membrane feed channel

    friction_factor

    Options to account for friction factor correlations.

    default - FrictionFactor.default_by_module_type

    Configuration Options

    Description

    FrictionFactor.default_by_module_type

    Friction factor correlation that is specific to the supported membrane modules type

    area_definition

    Argument defining whether area variable should be spatially variant or not. default - DistributedVars.uniform. Valid values: { DistributedVars.uniform - area does not vary across spatial domain, DistributedVars.variant - area can vary over the domain and is indexed by time and space.}

    transformation_method

    Discretization method to use for DAE transformation. See Pyomo documentation for supported transformations.

    transformation_scheme

    Discretization scheme to use when transforming domain. See Pyomo documentation for supported schemes.

    finite_elements

    Number of finite elements to use when discretizing length domain (default=10)

    collocation_points

    Number of collocation points to use per finite element when discretizing length domain (default=5)

    has_full_reporting

    Level of reporting results. default - False. Valid values: { False - include minimal reporting of results, True - report additional properties of interest that aren’t constructed by the unit model by default. Also, report averaged expression values

  • 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:

(ReverseOsmosis1D) New instance

class watertap.unit_models.reverse_osmosis_1D.ReverseOsmosis1DData(component)[source]

Bases: ReverseOsmosisBaseData

Standard 1D Reverse Osmosis Unit Model Class.

watertap.unit_models.reverse_osmosis_base module

class watertap.unit_models.reverse_osmosis_base.ReverseOsmosisBaseData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

Reverse Osmosis base class

build()[source]

Common variables and constraints for an RO unit model

initialize_build(initialize_guess=None, state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for RO initialization routines

Keyword Arguments:
  • initialize_guess – a dict of guesses for solvent_recovery, solute_recovery, and cp_modulus. These guesses offset the initial values for the retentate, permeate, and membrane interface state blocks from the inlet feed (default = {‘deltaP’: -1e4, ‘solvent_recovery’: 0.5, ‘solute_recovery’: 0.01, ‘cp_modulus’: 1.1})

  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for the inlet feed side state block (see documentation of the specific property package) (default = None).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – solver object or string indicating which solver to use during initialization, if None provided the default solver will be used (default = None)

Returns:

None

watertap.unit_models.steam_heater_0D module

class watertap.unit_models.steam_heater_0D.Mode(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.steam_heater_0D.SteamHeater0D(*args, **kwds)

Bases: ProcessBlock

Feedwater Heater Condensing Section The feedwater heater condensing section model is a normal 0D heat exchanger model with an added constraint to calculate the steam flow such that the outlet of shell is a saturated liquid.

Args:

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 = useDefault. Valid values: { useDefault - get flag from parent (default = False), True - set as a dynamic model, False - set as a steady-state model.}

has_holdup

Indicates whether holdup terms should be constructed or not. Must be True if dynamic = True, default - False. Valid values: { useDefault - get flag from parent (default = False), True - construct holdup terms, False - do not construct holdup terms}

hot_side_name

Hot side name, sets control volume and inlet and outlet names

cold_side_name

Cold side name, sets control volume and inlet and outlet names

hot_side

A config block used to construct the hot side control volume. This config can be given by the hot side name instead of hot_side.

hot_side
material_balance_type

Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

energy_balance_type

Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

momentum_balance_type

Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

has_phase_equilibrium

Indicates whether terms for phase equilibrium should be constructed, default = False. Valid values: { True - include phase equilibrium terms False - exclude phase equilibrium terms.}

has_pressure_change

Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

property_package

Property parameter object used to define property calculations, default - useDefault. Valid values: { useDefault - use default package from parent model or flowsheet, PropertyParameterObject - a PropertyParameterBlock 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.}

cold_side

A config block used to construct the cold side control volume. This config can be given by the cold side name instead of cold_side.

cold_side
material_balance_type

Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

energy_balance_type

Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

momentum_balance_type

Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

has_phase_equilibrium

Indicates whether terms for phase equilibrium should be constructed, default = False. Valid values: { True - include phase equilibrium terms False - exclude phase equilibrium terms.}

has_pressure_change

Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

property_package

Property parameter object used to define property calculations, default - useDefault. Valid values: { useDefault - use default package from parent model or flowsheet, PropertyParameterObject - a PropertyParameterBlock 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.}

delta_temperature_callback

Callback for for temperature difference calculations

flow_pattern

Heat exchanger flow pattern, default - HeatExchangerFlowPattern.countercurrent. Valid values: { HeatExchangerFlowPattern.countercurrent - countercurrent flow, HeatExchangerFlowPattern.cocurrent - cocurrent flow, HeatExchangerFlowPattern.crossflow - cross flow, factor times countercurrent temperature difference.}

mode

Mode of operation: heater or condenser

estimate_cooling_water

Estimate cooling water flow rate for condenser mode

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:

(SteamHeater0D) New instance

class watertap.unit_models.steam_heater_0D.SteamHeater0DData(component)[source]

Bases: HeatExchangerData

build()[source]

Building model

Parameters:

None

Returns:

None

initialize_build(*args, **kwargs)[source]

Initialization routine for both heater and condenser modes. For condenser mode with cooling water estimation, the initialization is performed based on a specified design temperature rise on the cold side.

watertap.unit_models.stoichiometric_reactor module

class watertap.unit_models.stoichiometric_reactor.StoichiometricReactor(*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. NF units do not support dynamic behavior.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. NF units do not have defined volume, thus this must be False.

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    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.}

    reagent
    A dict of reagents used in the StoichiometricReactor process

    including their molecular weights, and dissolution stoichiometric coefficients for the components defined in the property package in the following format:

    {
    "reagent_name_1":
    {
    "mw": (value, units),
    "density_reagent": (value, units),
    "dissolution_stoichiometric":
    {
    "component_name_1": stoichiometric_coeff,
    "component_name_2": stoichiometric_coeff,
    }
    },
    "reagent_name_2":
    {
    "mw": (value, units),
    "density_reagent": (value, units),
    "dissolution_stoichiometric":
    {
    "component_name_1": stoichiometric_coeff,
    "component_name_2": stoichiometric_coeff,
    }
    },
    }
    
    precipitate

    A dict of precipitates formed in the StoichiometricReactor process including their molecular weights, and precipitation stoichiometric coefficients for the components defined in the property package in the following format:

    {
    "precipitate_name_1":
    {
    "mw": (value, units),
    "precipitation_stoichiometric":
    {
    "component_name_1": stoichiometric_coeff,
    "component_name_2": stoichiometric_coeff,
    }
    },
    "precipitate_name_2":
    {
    "mw": (value, units),
    "precipitation_stoichiometric":
    {
    "component_name_1": stoichiometric_coeff,
    "component_name_2": stoichiometric_coeff,
    }
    },
    }
    

  • 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:

(StoichiometricReactor) New instance

class watertap.unit_models.stoichiometric_reactor.StoichiometricReactorData(component)[source]

Bases: UnitModelBlockData

StoichiometricReactor - users must provide equations for the solids formed

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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for pressure changer initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

watertap.unit_models.thickener module

Thickener unit model for BSM2 and plant-wide wastewater treatment modeling. This unit inherits from the IDAES separator unit.

Model based on

J. Alex, L. Benedetti, J.B. Copp, K.V. Gernaey, U. Jeppsson, I. Nopens, M.N. Pons, C. Rosen, J.P. Steyer and P. A. Vanrolleghem Benchmark Simulation Model no. 2 (BSM2)

Modifications made to TSS formulation based on ASM type.

class watertap.unit_models.thickener.ActivatedSludgeModelType(value)[source]

Bases: Enum

ASM1: ASM1 model ASM2D: ASM2D model modified_ASM2D: modified ASM2D model for ADM1 compatibility

class watertap.unit_models.thickener.Thickener(*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. Product blocks are always steady- state.

    has_holdup

    Product blocks do not contain holdup, 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, PropertyParameterObject - a PropertyParameterBlock 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.}

    outlet_list

    A list containing names of outlets, default - None. Valid values: { None - use num_outlets argument, list - a list of names to use for outlets.}

    num_outlets

    Argument indicating number (int) of outlets to construct, not used if outlet_list arg is provided, default - None. Valid values: { None - use outlet_list arg instead, or default to 2 if neither argument provided, int - number of outlets to create (will be named with sequential integers from 1 to num_outlets).}

    split_basis

    Argument indicating basis to use for splitting mixed stream, default - SplittingType.totalFlow. Valid values: { SplittingType.totalFlow - split based on total flow (split fraction indexed only by time and outlet), SplittingType.phaseFlow - split based on phase flows (split fraction indexed by time, outlet and phase), SplittingType.componentFlow - split based on component flows (split fraction indexed by time, outlet and components), SplittingType.phaseComponentFlow - split based on phase-component flows ( split fraction indexed by both time, outlet, phase and components).}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - pressure in all outlets is equal, MomentumBalanceType.pressurePhase - not yet supported, MomentumBalanceType.momentumTotal - not yet supported, MomentumBalanceType.momentumPhase - not yet supported.}

    has_phase_equilibrium

    Argument indicating whether phase equilibrium should be calculated for the resulting mixed stream, default - False. Valid values: { True - calculate phase equilibrium in mixed stream, False - do not calculate equilibrium in mixed stream.}

    energy_split_basis

    Argument indicating basis to use for splitting energy this is not used for when ideal_separation == True. default - EnergySplittingType.equal_temperature. Valid values: { EnergySplittingType.none - no energy balance constraints, EnergySplittingType.equal_temperature - outlet temperatures equal inlet, EnergySplittingType.equal_molar_enthalpy - outlet molar enthalpies equal inlet, EnergySplittingType.enthalpy_split - apply split fractions to enthalpy flows. Does not work with component or phase-component splitting.}

    ideal_separation

    Argument indicating whether ideal splitting should be used. Ideal splitting assumes perfect spearation of material, and attempts to avoid duplication of StateBlocks by directly partitioning outlet flows to ports, default - False. Valid values: { True - use ideal splitting methods. Cannot be combined with has_phase_equilibrium = True, False - use explicit splitting equations with split fractions.}

    ideal_split_map

    Dictionary containing information on how extensive variables should be partitioned when using ideal splitting (ideal_separation = True). default - None. Valid values: { dict with keys of indexing set members and values indicating which outlet this combination of keys should be partitioned to. E.g. {(“Vap”, “H2”): “outlet_1”}}

    mixed_state_block

    An existing state block to use as the source stream from the Separator block, default - None. Valid values: { None - create a new StateBlock for the mixed stream, StateBlock - a StateBock to use as the source for the mixed stream.}

    construct_ports

    Argument indicating whether model should construct Port objects linked the mixed state and all outlet states, default - True. Valid values: { True - construct Ports for all states, False - do not construct Ports.

    activated_sludge_model

    Options to account for version of activated sludge model property package.

    default - ActivatedSludgeModelType.ASM1

    Configuration Options

    Description

    ActivatedSludgeModelType.ASM1

    ASM1 model

    ActivatedSludgeModelType.ASM2D

    ASM2D model

    ActivatedSludgeModelType.modified_ASM2D

    modified ASM2D model for ADM1 compatibility

  • 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:

(Thickener) New instance

class watertap.unit_models.thickener.ThickenerData(component)[source]

Bases: SeparatorData

Thickener unit model for BSM2

build()[source]

Begin building model. :param None:

Returns:

None

watertap.unit_models.uv_aop module

class watertap.unit_models.uv_aop.UVDoseType(value)[source]

Bases: Enum

An enumeration.

class watertap.unit_models.uv_aop.Ultraviolet0D(*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. UV units do not support dynamic behavior.

    has_holdup

    Indicates whether holdup terms should be constructed or not. default - False. UV units do not have defined volume, thus this must be False.

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    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.}

    uv_dose_type

    Indicates whether the uv dose will be calculated or fixed by the user default - UVDoseType.fixed. Valid values: { UVDoseType.fixed - user specifies uv dose, UVDoseType.calculated - calculates uv dose based on the lamp power and UV transmittance}

    has_aop

    Indicates whether terms for AOP should be constructed, default - False. Valid values: { True - include AOP terms, False - exclude AOP terms.}

    target_species

    Indicate which component in the property package’s component list is the target species for disinfection by the UV system, currently the model supports a single species default - None. Valid values: { if the property package solute set only contains one item (two component, one solute, one solvent/water), the model will accept the single solute as the target species, for multi- solute systems a string of the component id must be provided.}

  • 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:

(Ultraviolet0D) New instance

class watertap.unit_models.uv_aop.Ultraviolet0DData(component)[source]

Bases: InitializationMixin, UnitModelBlockData

Standard UV Unit Model Class: - zero dimensional model - steady state only - single liquid phase only

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

initialize_build(state_args=None, outlvl=0, solver=None, optarg=None)[source]

General wrapper for pressure changer initialization routines

Keyword Arguments:
  • state_args – a dict of arguments to be passed to the property package(s) to provide an initial state for initialization (see documentation of the specific property package) (default = {}).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None)

  • solver – str indicating which solver to use during initialization (default = None)

Returns: None

Module contents