aquakin.sludge_metrics#

aquakin.sludge_metrics(plant, solution, params=None, *, reactor_units=None, influent_name=None, effluent_port=None, waste_port=None, substrate='BOD')[source]#

Achieved SRT / HRT / F:M from a solved activated-sludge plant.

Closes the design loop: SRT is an emergent property of the wastage flow, so rather than guessing Qw this reports the sludge age the model actually produced. Time-averaged over the solution window.

Parameters:
  • plant (Plant) – The solved plant (e.g. from aquakin.plant.bsm.build_bsm1()).

  • solution (PlantSolution) – A solution from plant.solve. For a representative steady SRT, solve to (near) steady state and save a few late points.

  • params (jnp.ndarray, optional) – Plant parameters used for the run (defaults to the plant defaults).

  • reactor_units (list of str, optional) – Aeration reactors to count. Defaults to the auto-detected ASM CSTRs.

  • influent_name (str, optional) – Which external influent is the main feed (for HRT / F:M). Defaults to the sole influent, or the one named "feed".

  • effluent_port (str, optional) – "unit.port" of the final effluent and the wastage stream. Auto- detected for BSM1/BSM2 when omitted.

  • waste_port (str, optional) – "unit.port" of the final effluent and the wastage stream. Auto- detected for BSM1/BSM2 when omitted.

  • substrate (str, optional) – Substrate measure for the F:M load – "BOD" (default) or "COD".

Returns:

SRT, HRT, F:M and the intermediate inventories / loads.

Return type:

SludgeMetrics

Examples

>>> m = aquakin.plant.design.sludge_metrics(plant, solution)
>>> print(m.summary())