Anaerobic Digester

Introduction

Anaerobic biological processes have been used in food and beverage production for centuries. However, modern advances pertaining to anaerobic conversions have introduced various forms of high-rate treatment processes that have proven to be particularly useful in wastewater treatment plants. High organic loading rates and low sludge production gives anaerobic processes a significant advantage over other biological unit operations, and, more importantly, the positive net energy production from the produced biogas can help replace fossil fuel sources, lowering greenhouse gas emissions. While a wide variety of anaerobic digestion models have been developed over the years, their widespread use has been made impossible by the models’ very specific natures. This generic anaerobic digestion model seeks to overcome this restriction by limiting itself to only the major biological processes and excluding many of the more niche relationships in this version of the model. Likewise, while this implementation may not be as accurate as models tailored to their specific applications, its simplicity makes it applicable for a wide variety of anaerobic processes, providing a common basis by which future model development and validation studies can be compared.

In this implementation of the model, the user MUST provide two property packages - one for the liquid phase and another for the vapor phase. The reaction parameter block should utilize the property package specified for the liquid phase. This anaerobic digester model is based on the standard IDAES CSTR with the addition of mass transfer terms and an extra port for the vapor outlet. The model relies on the following key assumptions:

  • supports steady-state only

  • liquid phase property package has a single phase named Liq

  • vapor phase property package has a single phase named Vap

  • liquid and vapor phase properties need not have the same component lists

../../_images/anaerobic_digester.png

Figure 1. Schematic representation of an anaerobic digester

Degrees of Freedom

Aside from the inlet feed state variables (i.e. temperature, pressure, component flowrates), the ADM1 model has at least 5 degrees of freedom that should be fixed for the unit to be fully specified.

Typically, the following variables are fixed, in addition to state variables at the inlet:
  • cation concentration

  • anion concentration

  • liquid volume

  • vapor volume

  • liquid outlet temperature

Control Volumes

This model has two separate 0D control volumes for the liquid and vapor phases.

  • Liquid

  • Vapor

Ports

This model provides three ports:

  • inlet

  • liquid_outlet

  • vapor_outlet

Sets

Description

Symbol

Indices

Time

\(t\)

[0]

Inlet/outlet

\(x\)

[‘in’, ‘out’]

Phases

\(p\)

[‘Liq’, ‘Vap’]

Components

\(j\)

[‘H2O’, ‘S_su’, ‘S_aa’, ‘S_fa’, ‘S_va’, ‘S_bu’, ‘S_pro’, ‘S_ac’, ‘S_h2’, ‘S_ch4’, ‘S_IC’, ‘S_IN’, ‘S_I’, ‘X_c’, ‘X_ch’, ‘X_pr’, ‘X_li’, ‘X_su’, ‘X_aa’, ‘X_fa’, ‘X_c4’, ‘X_pro’, ‘X_ac’, ‘X_h2’, ‘X_I’, ‘S_cat’, ‘S_an’, ‘S_co2’]

Ion

\(j\)

[‘S_cat’, ‘S_an’] *

Notes

* Ion” is a subset of “Component” and uses the same symbol j.

Variables

Description

Symbol

Variable Name

Index

Units

Liquid phase mass transfer term

\(J\)

liquid_phase.mass_transfer_term_j

[t]

\(\text{kg/s}\)

Liquid volume

\(V_{ad, liq}\)

volume_liquid

[t]

\(\text{m}^3\)

Vapor volume

\(V_{ad, vap}\)

volume_vapor

[t]

\(\text{m}^3\)

Total volume

\(V_{ad}\)

volume_AD

[t]

\(\text{m}^3\)

CO2 Henry’s law coefficient

\(K_{H, CO_{2}}\)

KH_co2

None

\(\text{kmol}\text{m}^{-3}\text{bar}^{-1}\)

CH4 Henry’s law coefficient

\(K_{H, CH_{4}}\)

KH_ch4

None

\(\text{kmol}\text{m}^{-3}\text{bar}^{-1}\)

H2 Henry’s law coefficient

\(K_{H, H_{2}}\)

KH_h2

None

\(\text{kmol}\text{m}^{-3}\text{bar}^{-1}\)

Gas-liquid transfer coefficient

\(K_{L}a\)

K_La

None

\(\text{day}^{-1}\)

Friction parameter

\(k_{p}\)

k_p

None

\(\text{m}^{3}\text{bar}^{-1}\text{day}^{-1}\)

Equations and Relationships

Description

Equation

Outlet vapor phase pressure

\(P_{vap, out} = P_{wat, sat} + Σ_{j} P_{j, sat}\)

Mass transfer rate of H2 gas

\(\rho_{T, H_{2}} = k_{L}a (S_{liq, H_{2}} - 16K_{H, H_{2}}) P_{vap, S_{H_{2}}} V_{ad, liq}\)

Mass transfer rate of CH4 gas

\(\rho_{T, CH_{4}} = k_{L}a (S_{liq, CH_{4}} - 64K_{H, CH_{4}}) P_{vap, S_{CH_{4}}} V_{ad, liq}\)

Mass transfer rate of CO2 gas

\(\rho_{T, IC} = k_{L}a (S_{liq, CO_{2}} - K_{H, CO_{2}}) P_{vap, S_{CO_{2}}} V_{ad, liq}\)

Vapor Flow

\(Q_{vap, out} = k_{p} (P_{vap} - 101325) (\frac{P_{vap}}{101325})\)

Total Volume

\(V_{ad} = V_{ad, liq} + V_{ad, vap}\)

Performance equation

\(ξ_{t, r} = V_{ad, liq}R\)

Classes

class watertap.unit_models.anaerobic_digester.AD(*args, **kwds)
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}

    material_balance_type

    Indicates what type of mass balance should be constructed, default - MaterialBalanceType.useDefault. Valid values: { MaterialBalanceType.useDefault - refer to property package for default balance type **MaterialBalanceType.none - exclude material balances, MaterialBalanceType.componentPhase - use phase component balances, MaterialBalanceType.componentTotal - use total component balances, MaterialBalanceType.elementTotal - use total element balances, MaterialBalanceType.total - use total material balance.}

    energy_balance_type

    Indicates what type of energy balance should be constructed, default - EnergyBalanceType.useDefault. Valid values: { EnergyBalanceType.useDefault - refer to property package for default balance type **EnergyBalanceType.none - exclude energy balances, EnergyBalanceType.enthalpyTotal - single enthalpy balance for material, EnergyBalanceType.enthalpyPhase - enthalpy balances for each phase, EnergyBalanceType.energyTotal - single energy balance for material, EnergyBalanceType.energyPhase - energy balances for each phase.}

    momentum_balance_type

    Indicates what type of momentum balance should be constructed, default - MomentumBalanceType.pressureTotal. Valid values: { MomentumBalanceType.none - exclude momentum balances, MomentumBalanceType.pressureTotal - single pressure balance for material, MomentumBalanceType.pressurePhase - pressure balances for each phase, MomentumBalanceType.momentumTotal - single momentum balance for material, MomentumBalanceType.momentumPhase - momentum balances for each phase.}

    has_heat_transfer

    Indicates whether terms for heat transfer should be constructed, default - False. Valid values: { True - include heat transfer terms, False - exclude heat transfer terms.}

    has_pressure_change

    Indicates whether terms for pressure change should be constructed, default - False. Valid values: { True - include pressure change terms, False - exclude pressure change terms.}

    has_equilibrium_reactions

    Indicates whether terms for equilibrium controlled reactions should be constructed, default - True. Valid values: { True - include equilibrium reaction terms, False - exclude equilibrium reaction terms.}

    has_phase_equilibrium

    Indicates whether terms for phase equilibrium should be constructed, default = False. Valid values: { True - include phase equilibrium terms False - exclude phase equilibrium terms.}

    has_heat_of_reaction

    Indicates whether terms for heat of reaction terms should be constructed, default - False. Valid values: { True - include heat of reaction terms, False - exclude heat of reaction terms.}

    liquid_property_package

    Property parameter object used to define property calculations for the liquid phase, default - useDefault. Valid values: { useDefault - use default package from parent model or flowsheet, PropertyParameterObject - a PropertyParameterBlock object.}

    liquid_property_package_args

    A ConfigBlock with arguments to be passed to liquid phase property block(s) and used when constructing these, default - None. Valid values: { see property package for documentation.}

    vapor_property_package

    Property parameter object used to define property calculations for the vapor phase, default - useDefault. Valid values: { useDefault - use default package from parent model or flowsheet, PropertyParameterObject - a PropertyParameterBlock object.}

    vapor_property_package_args

    A ConfigBlock with arguments to be passed to vapor phase property block(s) and used when constructing these, default - None. Valid values: { see property package for documentation.}

    reaction_package

    Reaction parameter object used to define reaction calculations, default - None. Valid values: { None - no reaction package, ReactionParameterBlock - a ReactionParameterBlock object.}

    reaction_package_args

    A ConfigBlock with arguments to be passed to a reaction block(s) and used when constructing these, default - None. Valid values: { see reaction package for documentation.}

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

(AD) New instance

class watertap.unit_models.anaerobic_digester.ADData(component)[source]

AD Unit Model Class

build()[source]

Begin building model (pre-DAE transformation). :param None:

Returns:

None

initialize_build(liquid_state_args=None, vapor_state_args=None, outlvl=0, solver=None, optarg=None)[source]

Initialization routine for anaerobic digester unit model.

Keyword Arguments:
  • liquid_state_args – a dict of arguments to be passed to the liquid property packages to provide an initial state for initialization (see documentation of the specific property package) (default = none).

  • vapor_state_args – a dict of arguments to be passed to the vapor property package to provide an initial state for initialization (see documentation of the specific property package) (default = none).

  • outlvl – sets output level of initialization routine

  • optarg – solver options dictionary object (default=None, use default solver options)

  • solver – str indicating which solver to use during initialization (default = None, use default IDAES solver)

Returns:

None

References

[1] Batstone, D.J., Keller, J., Angelidaki, I., Kalyuzhnyi, S.V., Pavlostathis, S.G., Rozzi, A., Sanders, W.T.M., Siegrist, H.A. and Vavilin, V.A., 2002. The IWA anaerobic digestion model no 1 (ADM1). Water Science and Technology, 45(10), pp.65-73. https://iwaponline.com/wst/article-abstract/45/10/65/6034

[2] Rosen, C. and Jeppsson, U., 2006. Aspects on ADM1 Implementation within the BSM2 Framework. Department of Industrial Electrical Engineering and Automation, Lund University, Lund, Sweden, pp.1-35. https://www.iea.lth.se/WWTmodels_download/TR_ADM1.pdf