Digestor

class flexops.unit_models.wastewater.digestor.Digestor(*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_packages

    Mapping of inlet name to its property package. Each key becomes one inlet port named f’inlet_{key}’; every value must be a single-phase property package.

    biogas_fraction

    Fraction of total inlet volume converted to biogas (dimensionless, a fixed, regressable Var once built, in (0, 1)).

    has_sludge_outlet

    Whether the digester exposes a treated-sludge outlet. When False, only the biogas outlet is built and the mass balance reduces to biogas_volume == biogas_fraction * total_inlet.

    biogas_property_package

    Property package for the biogas outlet. Defaults to a plain SimpleGasFlow() when None.

    sludge_property_package

    Property package for the treated-sludge outlet. Defaults to a plain SimpleAqueousFlow() when None. Required when has_sludge_outlet is True.

    operating_temperature

    Reactor operating temperature (K). Defaults to 15.55 C (288.706 K), the standard condition for SCFM measurement. Fixed at construction and passed through to the biogas outlet.

    operating_pressure

    Reactor operating pressure (Pa). Defaults to 1 bar (101325 Pa), the standard condition for SCFM measurement. Fixed at construction and passed through to the biogas outlet.

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

(Digestor) New instance

Variables

Name

Index

Units

Role

Description

flow_vol_phase

time

m**3/h

input

Volumetric flowrate by time and phase

biogas_volume

time

m**3/h

output

Biogas volumetric flow rate.

reactor_temperature

time

K

output

Digestor reactor operating temperature (K).

reactor_pressure

time

Pa

output

Digestor reactor operating pressure (Pa).

Constraints

Name

Description

sludge_mass_eq

Mass balance: sludge mass flow equals total inlet mass flow minus biogas mass flow.

reactor_pressure_eq

reactor_temperature_eq

sludge_pressure_eq

sludge_temperature_eq

biogas_relation

Biogas volume equals biogas_fraction times the sum of inlet volumetric flows.

eq_flow_mass_phase

Degrees of Freedom

Name

Units

Description

flow_vol_phase

m**3/h

Volumetric flowrate by time and phase