Tank¶
- class flexops.unit_models.storage.tank.Tank(*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.
- min_volume
Minimum tank volume, a lower bound on volume[t] (and on capacity).
- max_volume
Maximum POSSIBLE tank volume – fixed by prior investment in an existing tank or by space constraints on a potential build. The upper bound on capacity (the chosen volume) and the default value of the fixable capacity design variable.
- initial_volume
Tank volume at the start of the horizon, before step 0’s flows (volume[0] is the level after step 0): the value of the initial_volume Var, fixed by default and a rolling- horizon initial-state hook. Defaults to half of the default max_volume, so a tank built with no sizing at all starts half full; give it explicitly whenever max_volume is.
- fix_initial_state
Fix the initial_volume Var and register it as rolling- horizon initial state; False leaves it free, so the solve chooses the starting volume.
- cyclic
Require the final volume to be at least the starting volume, initial_volume.
- level_min
Minimum fractional fill (level = volume/capacity), in [0, 1]. Prevents the tank from draining all the way down.
- level_max
Maximum fractional fill (level = volume/capacity), in [0, 1]. Prevents the tank from overfilling.
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:
(Tank) New instance
Variables
Name |
Index |
Units |
Role |
Description |
|---|---|---|---|---|
flow_vol_phase |
time |
m**3/h |
input |
Volumetric flowrate by time and phase |
flow_vol_phase |
time |
m**3/h |
input |
Volumetric flowrate by time and phase |
volume |
time |
m**3 |
output |
Tank holdup volume. |
Constraints
Name |
Description |
|---|---|
holdup |
Holdup difference equation (backward): volume[t] = volume[t-1] + dt*(in[t] - out[t]), with volume[-1] the starting volume, so step 0’s flows are in the balance. Uses pyunits.convert on the whole right-hand side rather than assuming the flow basis’s units, so it stays correct regardless of the property package’s flow units (m^3/hr, m^3/s, …). |
capacity_limit |
Tank volume never exceeds capacity. |
initial_volume_lower_limit |
initial_volume >= level_min * capacity. |
initial_volume_upper_limit |
initial_volume <= level_max * capacity. |
level_definition |
Defines level as volume relative to the chosen capacity: volume[t] == level[t] * capacity. Linear (LP) when capacity is fixed (operations mode); bilinear (NLP) when capacity is free (design mode / multi-period sizing) – a deliberate tradeoff. |
Degrees of Freedom
Name |
Units |
Description |
|---|---|---|
flow_vol_phase |
m**3/h |
Volumetric flowrate by time and phase |
flow_vol_phase |
m**3/h |
Volumetric flowrate by time and phase |