proteuslib.unit_models package

Submodules

proteuslib.unit_models.nanofiltration_0D module

class proteuslib.unit_models.nanofiltration_0D.NanoFiltration0D(*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

  • default (dict) –

    Default ProcessBlockData config

    Keys
    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 described under the “default” argument above.

  • 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 overide the default behavior of matching the BlockData index exactly to the index in initialize.

Returns

(NanoFiltration0D) New instance

class proteuslib.unit_models.nanofiltration_0D.NanoFiltrationData(component)[source]

Bases: UnitModelBlockData

Standard NF 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(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

proteuslib.unit_models.pressure_exchanger module

class proteuslib.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

  • default (dict) –

    Default ProcessBlockData config

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

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

    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 described under the “default” argument above.

  • 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 overide the default behavior of matching the BlockData index exactly to the index in initialize.

Returns

(PressureExchanger) New instance

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

Bases: 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(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

proteuslib.unit_models.pump_isothermal module

class proteuslib.unit_models.pump_isothermal.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

  • default (dict) –

    Default ProcessBlockData config

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

    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.

  • initialize (dict) – ProcessBlockData config for individual elements. Keys are BlockData indexes and values are dictionaries described under the “default” argument above.

  • 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 overide the default behavior of matching the BlockData index exactly to the index in initialize.

Returns

(Pump) New instance

class proteuslib.unit_models.pump_isothermal.PumpIsothermalData(component)[source]

Bases: PumpData

Standard Isothermal Pump Unit Model Class

build()[source]
Parameters

None

Returns

None

proteuslib.unit_models.reverse_osmosis_0D module

class proteuslib.unit_models.reverse_osmosis_0D.ConcentrationPolarizationType(value)[source]

Bases: Enum

An enumeration.

class proteuslib.unit_models.reverse_osmosis_0D.MassTransferCoefficient(value)[source]

Bases: Enum

An enumeration.

class proteuslib.unit_models.reverse_osmosis_0D.PressureChangeType(value)[source]

Bases: Enum

An enumeration.

class proteuslib.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

  • default (dict) –

    Default ProcessBlockData config

    Keys
    dynamic

    Indicates whether this model will be dynamic or not. default = False. RO units do not support dynamic behavior.

    has_holdup

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

    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

    concentration_polarization_type

    Options to account for concentration polarization.

    default - ConcentrationPolarizationType.none

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

    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

    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 described under the “default” argument above.

  • 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 overide the default behavior of matching the BlockData index exactly to the index in initialize.

Returns

(ReverseOsmosis0D) New instance

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

Bases: UnitModelBlockData

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

build()[source]

Build the RO model.

initialize(initialize_guess=None, state_args=None, outlvl=0, solver=None, optarg=None, fail_on_warning=False, ignore_dof=False)[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)

  • 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

proteuslib.unit_models.reverse_osmosis_1D module

class proteuslib.unit_models.reverse_osmosis_1D.ConcentrationPolarizationType(value)[source]

Bases: Enum

An enumeration.

class proteuslib.unit_models.reverse_osmosis_1D.MassTransferCoefficient(value)[source]

Bases: Enum

An enumeration.

class proteuslib.unit_models.reverse_osmosis_1D.PressureChangeType(value)[source]

Bases: Enum

An enumeration.

class proteuslib.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

  • default (dict) –

    Default ProcessBlockData config

    Keys
    dynamic

    Indicates whether this model will be dynamic or not. default = False. RO units do not yet support dynamic behavior.

    has_holdup

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

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

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

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

    Configuration Options

    Description

    PressureChangeType.fixed

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

    PressureChangeType.calculated

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

    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

    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=20)

    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 described under the “default” argument above.

  • 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 overide the default behavior of matching the BlockData index exactly to the index in initialize.

Returns

(ReverseOsmosis1D) New instance

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

Bases: UnitModelBlockData

Standard 1D Reverse Osmosis Unit Model Class.

build()[source]

Build 1D RO model (pre-DAE transformation).

Parameters

None

Returns

None

initialize(feed_side_args=None, permeate_side_args=None, permeate_block_args=None, outlvl=0, solver=None, optarg=None, fail_on_warning=False, ignore_dof=False)[source]

Initialization routine for 1D-RO unit.

Keyword Arguments
  • feed_side_args – a dict of arguments to be passed to the property package(s) of the feed_side to provide an initial state for initialization (see documentation of the specific property package)

  • permeate_side_args – a dict of arguments to be passed to the property package(s) of the permeate_side to provide an initial state for initialization (see documentation of the specific property package)

  • permeate_block_args – a dict of arguments to be passed to the property package(s) of the final permeate StateBlock to provide an initial state for initialization (see documentation of the specific property package)

  • outlvl – sets output level of initialization routine

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

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

  • 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

Module contents