Suspended Growth Bioreactor#

QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems

This module is developed by:

Joy Zhang <joycheung1994@gmail.com>

This module is under the University of Illinois/NCSA Open Source License. Please refer to https://github.com/QSD-Group/QSDsan/blob/main/LICENSE.txt for license details.

class qsdsan.sanunits._suspended_growth_bioreactor.BatchExperiment(ID='', ins: Sequence[Stream] | None = None, outs: Sequence[Stream] | None = (), thermo=None, init_with='WasteStream', model=None, isdynamic=True, exogenous_vars=(), **kwargs)#
F_BM: dict[str, float]#

All bare-module factors for each purchase cost. Defaults to values in the class attribute _F_BM_default.

F_D: dict[str, float]#

All design factors for each purchase cost item in baseline_purchase_costs.

F_M: dict[str, float]#

All material factors for each purchase cost item in baseline_purchase_costs.

F_P: dict[str, float]#

All pressure factors for each purchase cost item in baseline_purchase_costs.

baseline_purchase_costs: dict[str, float]#

All baseline purchase costs without accounting for design, pressure, and material factors.

design_results: dict[str, object]#

All design requirements excluding utility requirements and detailed auxiliary unit requirements.

equipment_lifetime: int | dict[str, int]#

Lifetime of equipment. Defaults to values in the class attribute _default_equipment_lifetime. Use an integer to specify the lifetime for all items in the unit purchase costs. Use a dictionary to specify the lifetime of each purchase cost item.

heat_utilities: tuple[HeatUtility, ...]#

All heat utilities associated to unit. Cooling and heating requirements are stored here (including auxiliary requirements).

installed_costs: dict[str, float]#

All installed costs accounting for bare module, design, pressure, and material factors. Items here are automatically updated at the end of unit simulation.

line: str = 'Batch experiment'#

class-attribute Name denoting the type of Unit class. Defaults to the class name of the first child class

property model#

[CompiledProcesses or NoneType] Suspended growth model.

parallel: dict[str, int]#

Name-number pairs of baseline purchase costs and auxiliary unit operations in parallel. Use ‘self’ to refer to the main unit. Capital and heat and power utilities in parallel will become proportional to this value.

power_utility: PowerUtility#

Electric utility associated to unit (including auxiliary requirements).

prioritize: bool#

Whether to prioritize unit operation specification within recycle loop (if any).

purchase_costs: dict[str, float]#

Itemized purchase costs (including auxiliary units) accounting for design, pressure, and material factors (i.e., F_D, F_P, F_M). Items here are automatically updated at the end of unit simulation.

responses: set[bst.GenericResponse]#

Unit design decisions that must be solved to satisfy specifications. While adding responses is optional, simulations benefit from responses by being able to predict better guesses.

run_after_specifications: bool#

Whether to run mass and energy balance after calling specification functions

set_init_conc(**kwargs)#

set the initial concentrations of the BatchExperiment.

property state#

The state of the BatchExperiment, i.e., component concentrations.

class qsdsan.sanunits._suspended_growth_bioreactor.CSTR(ID='', ins: Sequence[Stream] | None = None, outs: Sequence[Stream] | None = (), split=None, thermo=None, init_with='WasteStream', V_max=1000, aeration=2.0, DO_ID='S_O2', suspended_growth_model=None, isdynamic=True, exogenous_vars=(), **kwargs)#

A single continuous stirred tank reactor.

Parameters:
  • ID (str) – ID for the reactor.

  • ins (WasteStream) – Influents to the reactor. Can be an array of up to 3 WasteStream objects by default, typically wastewater to be treated, recycled effluent, recycled activated sludge.

  • outs (WasteStream) – Treated effluent.

  • split (iterable of float) – Volumetric splits of effluent flows if there are more than one effluent. The default is None.

  • V_max (float) – Designed volume, in [m^3]. The default is 1000.

  • aeration (float or Process, optional) – Aeration setting. Either specify a targeted dissolved oxygen concentration in [mg O2/L] or provide a Process object to represent aeration, or None for no aeration. The default is 2.0.

  • DO_ID (str, optional) – The Component ID for dissolved oxygen, only relevant when the reactor is aerated. The default is ‘S_O2’.

  • suspended_growth_model (Processes, optional) – The suspended growth biokinetic model. The default is None.

  • exogenous_var (iterable[ExogenousDynamicVariable], optional) – Any exogenous dynamic variables that affect the process mass balance, e.g., temperature, sunlight irradiance. Must be independent of state variables of the suspended_growth_model (if has one).

property DO_ID#

[str] The Component ID for dissolved oxygen used in the suspended growth model and the aeration model.

F_BM: dict[str, float]#

All bare-module factors for each purchase cost. Defaults to values in the class attribute _F_BM_default.

F_D: dict[str, float]#

All design factors for each purchase cost item in baseline_purchase_costs.

F_M: dict[str, float]#

All material factors for each purchase cost item in baseline_purchase_costs.

F_P: dict[str, float]#

All pressure factors for each purchase cost item in baseline_purchase_costs.

property V_max#

[float] The designed maximum liquid volume, not accounting for increased volume due to aeration, in m^3.

property aeration#

[Process or float or NoneType] Aeration model.

baseline_purchase_costs: dict[str, float]#

All baseline purchase costs without accounting for design, pressure, and material factors.

design_results: dict[str, object]#

All design requirements excluding utility requirements and detailed auxiliary unit requirements.

equipment_lifetime: int | dict[str, int]#

Lifetime of equipment. Defaults to values in the class attribute _default_equipment_lifetime. Use an integer to specify the lifetime for all items in the unit purchase costs. Use a dictionary to specify the lifetime of each purchase cost item.

heat_utilities: tuple[HeatUtility, ...]#

All heat utilities associated to unit. Cooling and heating requirements are stored here (including auxiliary requirements).

installed_costs: dict[str, float]#

All installed costs accounting for bare module, design, pressure, and material factors. Items here are automatically updated at the end of unit simulation.

line: str = 'CSTR'#

class-attribute Name denoting the type of Unit class. Defaults to the class name of the first child class

parallel: dict[str, int]#

Name-number pairs of baseline purchase costs and auxiliary unit operations in parallel. Use ‘self’ to refer to the main unit. Capital and heat and power utilities in parallel will become proportional to this value.

power_utility: PowerUtility#

Electric utility associated to unit (including auxiliary requirements).

prioritize: bool#

Whether to prioritize unit operation specification within recycle loop (if any).

purchase_costs: dict[str, float]#

Itemized purchase costs (including auxiliary units) accounting for design, pressure, and material factors (i.e., F_D, F_P, F_M). Items here are automatically updated at the end of unit simulation.

responses: set[bst.GenericResponse]#

Unit design decisions that must be solved to satisfy specifications. While adding responses is optional, simulations benefit from responses by being able to predict better guesses.

run_after_specifications: bool#

Whether to run mass and energy balance after calling specification functions

set_init_conc(**kwargs)#

set the initial concentrations [mg/L] of the CSTR.

property split#

[numpy.1darray or NoneType] The volumetric split of outs.

property state#

The state of the CSTR, including component concentrations [mg/L] and flow rate [m^3/d].

property suspended_growth_model#

[CompiledProcesses or NoneType] Suspended growth model.

class qsdsan.sanunits._suspended_growth_bioreactor.SBR(ID='', ins: Sequence[Stream] | None = None, outs: Sequence[Stream] | None = (), thermo=None, init_with='WasteStream', surface_area=1500, height=4, operation_cycle=(0.5, 1.5, 2.0, 0, 1.0, 0.5, 0.1), aeration=(None, None, None, 2.0), DO_ID='S_O2', suspended_growth_model=None, N_layer=10, pumped_flow=None, underflow=None, X_threshold=3000, v_max=474, v_max_practical=250, rh=0.000576, rp=0.00286, fns=0.00228, cache_state=True, **kwargs)#

Sequential batch reactors operated in parallel. The number of reactors is determined by operation cycle and influent flowrate. [1]

Parameters:
  • ID (str) – ID for the reactors. The default is ‘’.

  • ins (WasteStream) – Influent to the reactor. Expected number of influent is 1.

  • outs (WasteStream) – Treated effluent and wasted sludge.

  • surface_area (float, optional) – Surface area of the reactor bottom, in [m^2]. The reactor is assumed to be cylinder. The default is 1500.

  • height (float, optional) – Height of the reactor, in [m]. The default is 4.

  • operation_cycle (iterable of float, optional) – Operation cycle of the SBR, time for each stage specified in [h]. There are 7 stages: 1 - fill, 2 - fill, 3 - mix, 4 - mix, 5 - settle, 6 - decant, 7 - desludge. The first 4 stages are modeled as a biological reactor. The 5th stage is modeled as a 1D N-layer settler. The last 2 stages are assumed inactive. The default is (0.5, 1.5, 2.0, 0, 1.0, 0.5, 0.1).

  • aeration (iterable of float and/or Process, optional) – Aeration settings for the first 4 stages of the operation cycle. Either specify a targeted dissolved oxygen concentration in [mg O2/L] or provide a Process object to represent aeration, or None for no aeration. The default is (None, None, None, 2.0).

  • DO_ID (str, optional) – The Component ID for dissolved oxygen, only relevant when the reactor is aerated. The default is ‘S_O2’.

  • suspended_growth_model (Processes, optional) – The suspended growth biokinetic model. The default is None.

  • N_layer (int, optional) – The number of layers to model settling. The default is 10.

  • pumped_flow (float, optional) – Designed effluent flowrate, in [m^3/d]. The default is None.

  • underflow (float, optional) – Designed wasted activated sludge flowrate, in [m^3/d]. The default is None.

  • X_threshold (float, optional) – Threshold suspended solid concentration, in [g/m^3]. The default is 3000.

  • v_max (float, optional) – Maximum theoretical (i.e. Vesilind) settling velocity, in [m/d]. The default is 474.

  • v_max_practical (float, optional) – Maximum practical settling velocity, in [m/d]. The default is 250.

  • rh (float, optional) – Hindered zone settling parameter in the double-exponential settling velocity function, in [m^3/g]. The default is 5.76e-4.

  • rp (float, optional) – Flocculant zone settling parameter in the double-exponential settling velocity function, in [m^3/g]. The default is 2.86e-3.

  • fns (float, optional) – Non-settleable fraction of the suspended solids, dimensionless. Must be within [0, 1]. The default is 2.28e-3.

  • cache_state (bool, optional) – Whether to store volume and composition of retained sludge in the tank from most recent run. The default is True.

References

F_BM: dict[str, float]#

All bare-module factors for each purchase cost. Defaults to values in the class attribute _F_BM_default.

F_D: dict[str, float]#

All design factors for each purchase cost item in baseline_purchase_costs.

F_M: dict[str, float]#

All material factors for each purchase cost item in baseline_purchase_costs.

F_P: dict[str, float]#

All pressure factors for each purchase cost item in baseline_purchase_costs.

baseline_purchase_costs: dict[str, float]#

All baseline purchase costs without accounting for design, pressure, and material factors.

design_results: dict[str, object]#

All design requirements excluding utility requirements and detailed auxiliary unit requirements.

equipment_lifetime: int | dict[str, int]#

Lifetime of equipment. Defaults to values in the class attribute _default_equipment_lifetime. Use an integer to specify the lifetime for all items in the unit purchase costs. Use a dictionary to specify the lifetime of each purchase cost item.

heat_utilities: tuple[HeatUtility, ...]#

All heat utilities associated to unit. Cooling and heating requirements are stored here (including auxiliary requirements).

installed_costs: dict[str, float]#

All installed costs accounting for bare module, design, pressure, and material factors. Items here are automatically updated at the end of unit simulation.

line: str = 'SBR'#

class-attribute Name denoting the type of Unit class. Defaults to the class name of the first child class

parallel: dict[str, int]#

Name-number pairs of baseline purchase costs and auxiliary unit operations in parallel. Use ‘self’ to refer to the main unit. Capital and heat and power utilities in parallel will become proportional to this value.

power_utility: PowerUtility#

Electric utility associated to unit (including auxiliary requirements).

prioritize: bool#

Whether to prioritize unit operation specification within recycle loop (if any).

purchase_costs: dict[str, float]#

Itemized purchase costs (including auxiliary units) accounting for design, pressure, and material factors (i.e., F_D, F_P, F_M). Items here are automatically updated at the end of unit simulation.

responses: set[bst.GenericResponse]#

Unit design decisions that must be solved to satisfy specifications. While adding responses is optional, simulations benefit from responses by being able to predict better guesses.

run_after_specifications: bool#

Whether to run mass and energy balance after calling specification functions

Example#

import qsdsan.processes as pc, qsdsan.sanunits as su
from qsdsan import System
cmps = pc.create_asm1_cmps()
asm1 = pc.ASM1()
BE = su.BatchExperiment('E1', model=asm1)
BE.set_init_conc(S_S=5, X_S=100, X_BH=500, X_BA=100, X_P=100, S_O=8,
                 S_NO=20, S_NH=2, S_ND=1, X_ND=1, S_ALK=7*12)
sys = System('sys', path=(BE,))
sys.set_dynamic_tracker(BE)
sys.simulate(t_span=(0, 3))
BE.scope.plot_time_series(('X_BH', 'X_BA', 'X_S'))
../../_images/batch_experiment.png