Product¶
- class flexops.unit_models.product.Product(*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.
- inlet_names
Role names of the product’s inlets; inlet i is built as port f’inlet_{name}’. Must be unique and non-empty. Each inlet’s intensive states arrive from its own arc and are left independent: a Product aggregates flow and does not blend.
- resource_name
The delivered resource’s name (e.g. ‘potable_water’), the key it aggregates under in the plant’s total_product. 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_product.
- max_demand
Units-carrying upper limit on the delivery, a scalar or (on the period basis) a length-T series (e.g. a disposal permit). Its dimension follows demand_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_demand
Units-carrying lower limit on the delivery, a scalar or (on the period basis) a length-T series (e.g. a contracted demand that must be met). Its dimension follows demand_basis: a rate per period, or a quantity over the horizon. Builds a mutable Param and its Constraint.
- demand_basis
Whether min_demand/max_demand 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 delivery_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 delivered, in the costing currency basis: positive is a cost (brine disposal), negative is revenue (potable water sold). 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:
(Product) New instance
Variables
Name |
Index |
Units |
Role |
Description |
|---|---|---|---|---|
flow_vol_phase |
time |
m**3/h |
input |
Volumetric flowrate by time and phase |
Constraints
Name |
Description |
|---|---|
eq_delivery |
Metering: the delivery equals the sum of the inlet flows. |
Degrees of Freedom
Name |
Units |
Description |
|---|---|---|
flow_vol_phase |
m**3/h |
Volumetric flowrate by time and phase |