Feed

class flexops.unit_models.feed.Feed(*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}

    property_package

    Property (parameter) block carrying flow between units; None for units that need no fluid properties.

    flexops_config

    Optional already-validated UnitConfig for this unit (never a raw dict).

    unit_commitment

    Per-unit unit-commitment sub-config.

    external_dispatch

    Optional external (DERMS) dispatch source consumed by set_external_dispatch.

    relaxation

    Discrete-structure relaxation policy.

    allow_pass_through

    Whether add_bypass_constraints() builds inlet-to-outlet pass-through equalities for this unit’s non-excluded state variables. SISOBlock (and its subclasses Pump/Tank) override the base default to True so the flow-topology units are well-posed out of the box; the base OpsBlock default stays False.

    costing_package

    Optional FlexCosting block this unit associates with: register_power forwards the unit’s power draw to it. None for standalone units; the forwarding is strictly conditional.

    outlet_names

    Role names of the feed’s outlets; outlet i is built as port f’outlet_{name}’. Must be unique and non-empty. The first name is the reference outlet, whose non-flow states are the boundary conditions every other outlet is held at.

    resource_name

    The withdrawn resource’s name (e.g. ‘raw_water’), the key it aggregates under in the plant’s total_feed. Defaults to the block’s own Pyomo name; set it explicitly to override that — to merge two blocks under one key, or when the block name is not the name wanted in total_feed.

    max_withdrawal

    Units-carrying upper limit on the withdrawal, a scalar or (on the period basis) a length-T series (e.g. a permitted abstraction rate, or a monthly permit volume). Its dimension follows withdrawal_basis: a rate per period, or a quantity over the horizon. Builds a mutable Param and its Constraint; rewrite the Param to move the bound.

    min_withdrawal

    Units-carrying lower limit on the withdrawal, a scalar or (on the period basis) a length-T series (e.g. a take-or- pay minimum). Its dimension follows withdrawal_basis: a rate per period, or a quantity over the horizon. Builds a mutable Param and its Constraint.

    withdrawal_basis

    Whether min_withdrawal/max_withdrawal bind in every period (‘period’, the default – the limits are rates such as m**3/hr) or on the horizon total (‘horizon’ – the limits are quantities such as m**3, bounding the scalar withdrawal_total and leaving the optimizer to shape the profile that reaches it). A limit whose units contradict the basis is rejected. On its own, with no limit configured, this builds nothing.

    price

    Flat price per unit withdrawn, in the costing currency basis; positive is a cost. Requires costing_package, and is billed as a scalar operating cost (price * sum_t flow[t] * dt).

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

(Feed) New instance

Variables

Name

Index

Units

Role

Description

flow_vol_phase

time

m**3/h

output

Volumetric flowrate by time and phase

Constraints

Name

Description

eq_withdrawal

Metering: the withdrawal equals the sum of the outlet flows.

Degrees of Freedom

None.