CET 96 DOI: 10.3303/CET2296073 Paper Received: 26 November 2021; Revised: 26 June 2022; Accepted: 6 July 2022 Please cite this article as: Liu Y., Jiang Y., Bortone I., 2022, A Scheme for Anaerobic Digestion Modelling and ADM1 Model Calibration, Chemical Engineering Transactions, 96, 433-438 DOI:10.3303/CET2296073 CHEMICAL ENGINEERING TRANSACTIONS VOL. 96, 2022 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: David Bogle, Flavio Manenti, Piero Salatino Copyright © 2022, AIDIC Servizi S.r.l. ISBN 978-88-95608-95-2; ISSN 2283-9216 A Scheme for Anaerobic Digestion Modelling and ADM1 Model Calibration Yanxin Liu, Ying Jiang, Immacolata Bortone* School of Water, Energy and Environment, Cranfield University, College Road, MK43 0AL, Cranfield, Bedford, UK imma.bortone@cranfield.ac.uk Anaerobic digestion (AD) is a technology that produces biogas, also known as renewable natural gas, from organic waste materials under the activity of anaerobic microorganisms. In recent years, an increasing attention on energy produced from renewable resources has led to the need and development of tools helping with improving the process performance and design of AD, such as the Anaerobic Digestion Model No.1 (ADM1). ADM1 is a process-based model that can predict the biogas yield and identify potential prohibitions in the AD process from the properties of the feedstock and inoculum. Initial values of state variables and model parameters need to be calibrated when applying ADM1 to a particular feedstock. In this study, an ADM1 model using differential algebraic equations (DAE) system, called DAE ADM1, was developed. Specifically, the influence of the initial values of AD process state variables on the calibration of model stoichiometric and kinetic parameters were investigated, by comparing them with literature data, by highlighting their high impact on the model setup. 1. Introduction Anaerobic Digestion (AD) is a process in which microorganisms degrade organic matter in the absence of air and produce biogas and digestate. The feedstocks for AD process can be sewage sludge, organic fraction municipal solid waste, manure etc., and the biogas produced is an important renewable energy. AD process offers environmental and economic benefits (Sahoo and Mani, 2019). AD process modelling plays an important role on AD plants design and operation optimisation (Fedailaine et al., 2015). Simulation results, in fact, allow a preliminary assessment of the process stability and biogas generation potential, with the possibility to easily analyse different co-digestion scenarios and operation conditions (Donoso-Bravo et al., 2011). The Anaerobic Digestion Model No.1 (ADM1) was developed by the International Water Association (IWA) AD Modelling Task Group (Batstone et al., 2002) to produce a generic model and common platform for dynamic simulations of AD processes. ADM1 is generally used for continuous stirred-tank reactors (CSTR), and includes 19 biochemical processes (describing reactions of disintegration, hydrolysis, acidogenesis, acetogenesis and methanogenesis, plus three gas-liquid transfer processes and six acid-base kinetic processes). These processes describe conversions between 36 state variables (Table 1). On the basis of the study of Batstone et al. (2002), Rosen and Jeppsson (2006) successively developed the IWA benchmark simulation model 2 (BSM2) framework to link ADM1 with the activated sludge model (ASM), forming a plant-wide model for wastewater treatment plants. BSM2 has become a benchmark for studies using ADM1 because of the detailed description of the AD acid- base processes, together with the recommended values for model stoichiometric and kinetic parameters. Numerous parameters are needed for ADM1 simulations, including input values of state variables related to the feedstock characteristics, initial values of state variables dependent on the inoculum characteristics and more than 100 model stoichiometric and kinetic parameters. These parameters need to be calibrated by experimental observations so that the model can describe and predict well the behaviour of an AD system treating a specific feedstock (Thamsiriroj and Murphy, 2011). However, long-term and regular tests of the digestate characteristics are usually lacking in the industrial AD systems, as they often require specific and high accuracy equipment (Yan et al., 2021). This has impeded the application of ADM1 model in industry. 433 ADM1 input values can be roughly estimated by COD fractioning method from the particulate Chemical Oxygen Demand (COD) and soluble COD of the feedstock (Catenacci et al., 2021). For the determination of the stoichiometric and kinetic parameters when applying ADM1 to a specific feedstock, most parameters remain at the values provided in BSM2, and only about 10 sensitive parameters that have a large influence on model outputs will be calibrated. They can be decided through a sensitivity analysis (Nguyen, 2014; Thamsiriroj and Murphy, 2011). The calibration of these sensitive parameters to fit experimental data can be achieved either by heuristic manual adjustment (Nguyen, 2014) or by parameter optimisation algorithms (Baldé et al., 2020). In general, ADM1 studies listed the obtained values of sensitive stoichiometric and kinetic parameters from calibration, but most studies did not demonstrate how the initial values of state variables were determined and the specific values used, making published ADM1 modelling results hard to be replicated. Being ADM1 based on an ordinary differential equation (ODE) system, initial values of its state variables are crucial for the simulation outputs. The initial values, in fact, set how the ODE system iterations start, and they also affect the state variables increments at each time step. Additionally, the initial values of some state variables, such as the concentrations of the degrading bacteria, of hydrogen and methane dissolved in the liquid phase, are not easy to measure, and this is the main reason why they require to be calibrated together with stoichiometric and kinetic parameters by experimental data. However, when calibrating the model for multiple iterations by using the long- term running CSTR AD data, it can happen that the influence of possible inaccurate initial values becomes negligible (Arianna et al., 2021). In this case, the generic initial values, such as steady-state outputs from BSM2, can be used when calibrating the model for the first iteration. When data for model calibration are limited, initial values of stoichiometric and kinetic parameters become therefore important to achieve an effective AD processes prediction and a good system performance. This paper investigates the effect of initial values on the calibration of the representative model parameters which can accurately predict the performance of the AD systems for a specific feedstock, especially when limited AD plant data are available for model calibration. Specifically, an ADM1 composed of differential algebraic equations (DAEs) was developed, called DAE ADM1, and verified via using BSM2 steady-state outputs. The influence of initial values was illustrated by reproducing the model calibration and validation stages results from a literature study (Nguyen, 2014). 2. Method 2.1 Anaerobic Digestion model structure Standard ADM1 model simulates the AD process in CSTR reactors without recycling of digestate, by assuming that the bulk volume in the digester remains constant over time and inflow equals outflow (Batstone et al., 2002). The equation used in the DAE ADM1 code, describing the change of concentrations of soluble and particulate state variables with time, is shown in Eq(1). dS(X)i,in dt = q*S(X)i,in Vliq − q*S(X)i,liq Vliq + ∑ ρjνi,j j=1-19 (1) where ρj is the kinetic rate for process j; νi,j is the stoichiometric coefficient for the state variable i in the reaction process j; q is the inflow and outflow, S(X)i,in and S(X)i,liq are the concentrations of the soluble or particulate state variable i in the inflow and in the reactor, respectively, and Vliq is the liquid phase volume in the reactor. The ODEs for the acid-base kinetic processes for VFAs, inorganic carbon (IC) and inorganic nitrogen (IN) are implemented as suggested by Rosen and Jeppsson (2006). The term ∑ ρjνi,jj=1-19 is added to the free form VFA, IC and IN, while the ODE describes the converting from the free form VFA, IC or IN to the base form VFA, bicarbonate or ammonia is described in Eq(2) (taking valerate as an example). dSVa- dt = −κA B⁄ Va ∙ (SVa- ∙ SH+ − Ka,Va ∙ (SVa − SVa- )) (2) where κA B⁄ Va is the acid-base kinetic constant of valerate and Ka,Va is the acid dissociation constant of valerate. By assuming that the amount of gas components (Sgas) in the inflow (Table 1) was negligible, the ODEs describing the production of methane (CH4) and carbon dioxide (CO2) are shown in Eq(3) and Eq(4) (written as function of hydrogen, H2). dSgas,H2 dt = − qgas∙Sgas,H2 Vgas + ρT,H2 ∙ Vliq Vgas (3) ρT,H2 = κLaH2 ∙ (SH2 − 16KH,H2 ∙ pgas, H2 ) (4) 434 https://ieeexplore.ieee.org/author/37088645444 where Sgas,H2 is the concentration of H2 in the gas phase, while SH2 is the concentration of H2 in the liquid phase. Vgas is the volume of gas phase. κLaH2 is the overall gas-liquid mass transfer coefficient of hydrogen. κLaH2 is the Henry’s Law constant for H2. pgas, H2 is the partial pressure for hydrogen in the gas. As discussed by Rosen and Jeppsson (2006), the ADM1 system can be ‘stiff’ because of the various time step variations of the different state variables reaction rates, which can vary from days for the biochemical processes to milliseconds for the pH. Implicit Matlab solvers can be adopted to stably solve stiff ODE systems without increasing the number of time steps to reduce the temporal discrepancies. However, the ability of these stiff solvers can be deteriorated when dealing with dynamic inputs (Rosen and Jeppson, 2006). Thus, a way to solve this problem, is to use the BSM2 suggestion to represent the two fast states, hydrogen ion (H+) and H2, by algebraic equations (DAEs) (i.e., Eqs(5) and (6)) and solve the DAE system by using explicit solvers, as considered in this study for the DAE ADM1 development. However, DAE ADM1 was coded by using Symbolic Math Toolbox and solved by ‘ode15i’ in Matlab – a variable step solver based on backward differentiation formulas (Shampine, 2002) and not in Simulink as for the BSM2 (Rosen and Jeppson, 2006). SH+ + Scat+ + SNH4+ − SHCO3- − Sac- 64 − Spro- 112 − Sbu- 160 − Sva- 208 − SOH- − San- = 0 (5) q*SH2,in Vliq − q*SH2,liq Vliq + ∑ ρjνi,j j=1-19 = 0 (6) Table 1: Dynamic state variables in the ADM1 model. Soluble Particulate No. Namee Unit Description No. Name Unit Description 1 Ssu kg COD/m3 monosaccharides 22 Xc kg COD/m3 particulate composites 2 Saa kg COD/m3 amino acid 23 Xch kg COD/m3 carbohydrates 3 Sfa kg COD/m3 long chain fatty acid 24 Xpr kg COD/m3 proteins 4 Sva kg COD/m3 total valerate 25 Xli kg COD/m3 lipids 5 Sbu kg COD/m3 total butyrate 26 Xsu kg COD/m3 sugar degraders 6 Spro kg COD/m3 total propionate 27 Xaa kg COD/m3 amino acid degraders 7 Sac kg COD/m3 total acetate 28 Xfa kg COD/m3 LCFA degraders 8 SH2 kg COD/m 3 hydrogen in liquid phrase 29 Xc4 kg COD/m3 valerate and butyrate degraders 9 SCH4 kg COD/m 3 methane in liquid phrase 30 Xpro kg COD/m3 propionate degraders 10 SIC kg COD/m3 inorganic carbon 31 Xac kg COD/m3 acetate degraders 11 SIN kmole N/m3 inorganic nitrogen 32 XH2 kg COD/m 3 hydrogen degrader 12 SI kg COD/m3 soluble inert 33 XI kg COD/m3 particulate inert 13 Scat+ kmole/m3 cation 14 San- kmole/m3 anion 15 Sva- kg COD/m3 base form valerate 16 Sbu- kg COD/m3 base form butyrate 17 Spro- kg COD/m3 base form propionate 18 Sac- kg COD/m3 base form acetate Gas 19 SHCO3- kmole C/m 3 bicarbonate 34 Sgas,H2 kg COD/m 3 hydrogen 20 SNH3 kmole N/m 3 ammonia in liquid phase 35 Sgas,CH4 kg COD/m 3 methane 21 SH+ kmole H+/m3 hydrogen ion 36 Sgas,CO2 kmole C/m3 carbon dioxide 2.2 Initial values influence identification To verify the DAE ADM1 established in this study, the specific input data provided in BSM2 were considered (Table 2). Successively, the influence of initial values on stoichiometric and kinetic parameters calibration were investigated. Specifically, the initial values and model parameters calibrated by Nguyen (2014) to predict the AD performance of the model validation stage were used and results were compared with his study (Figure 1). Finally, this study also compared the model calibration stage results of Nguyen’s (2014) (Table 3). As the initial values of this stage were not reported by the author, steady-state outputs from BSM2 were considered as initial values, which assumed that sewage sludge was used as inoculum material for the digester, with relative stable characteristics. The model parameters were kept at the calibrated value reported by the author (Nguyen, 2014). 435 3. Results 3.1 DAE ADM1 model verification Table 2 and 3 show DAE ADM1 results and comparisons with literature studies for calibration. Table 2: Steady-state simulation results of DAE ADM1 model against BSM2’s ODE ADM1 model. Soluble Particulate No. Name BSM2 DAE ADM1 APE (%) No. Name BSM2 DAE ADM1 APE (%) 1 Ssu 0.0120 0.0120 0.00 22 Xc 0.3087 0.3087 0.01 2 Saa 0.0053 0.0053 0.00 23 Xch 0.0279 0.0279 0.00 3 Sfa 0.0986 0.0986 0.00 24 Xpr 0.1026 0.1026 0.00 4 Sva 0.0116 0.0116 0.00 25 Xli 0.0295 0.0295 0.00 5 Sbu 0.0133 0.0133 0.00 26 Xsu 0.4202 0.4202 0.00 6 Spro 0.0158 0.0158 0.00 27 Xaa 1.1792 1.1792 0.00 7 Sac 0.1976 0.1812 -8.30 28 Xfa 0.2430 0.2430 0.00 8 SH2 0.0000 0.0000 0.00 29 Xc4 0.4319 0.4319 0.00 9 SCH4 0.0551 0.0533 -3.18 30 Xpro 0.1373 0.1373 0.00 10 SIC 0.1527 0.1538 0.71 31 Xac 0.7606 0.7612 0.08 11 SIN 0.1302 0.1302 -0.00 32 XH2 0.3170 0.3170 0.00 12 SI 0.3287 0.3287 0.01 33 XI 25.6174 25.6174 0.00 13 Scat+ 0.0400 0.0400 0.00 14 San- 0.0200 0.0200 0.00 15 Sva- 0.0116 0.0116 0.07 16 Sbu- 0.0132 0.0132 -0.01 17 Spro- 0.0157 0.0157 -0.02 18 Sac- 0.1972 0.1809 -8.31 Gas 19 SHCO3- 0.1428 0.1432 0.33 34 Sgas,H2 0.0000 0.0000 -0.68 20 SNH3 0.0041 0.0039 -5.45 35 Sgas,CH4 1.6256 1.5667 -3.62 21 SH+ 0.0000 0.0000 5.94 36 Sgas,CO2 0.014 0.0150 6.27 Table 3: Simulation results of DAE ADM1 model, compared with the model calibration stage in Nguyen’s (2014). Soluble Particulate No. Name Nguyen DAE ADM1 APE(%) (%) No. Name Nguyen DAE ADM1 APE(%) 1 Ssu 0.0049 0.0253 416.04 22 Xc / 55.7374 / 2 Saa 0.0022 0.0022 0.82 23 Xch 0.2290 55.7374 24239.50 3 Sfa 0.0357 0.0356 0.19 24 Xpr 0.0132 1.3307 9981.05 4 Sva 0.0018 0.0008 56.04 25 Xli 0.0018 0.1532 8411.12 5 Sbu 0.0060 0.0024 60.66 26 Xsu 8.0364 1.1788 85.33 6 Spro 0.0061 0.0061 0.74 27 Xaa 0.3662 0.3690 0.75 7 Sac 0.0285 0.0569 99.64 28 Xfa 0.0343 0.0296 13.66 8 SH2 0.0000 0.0000 99.00 29 Xc4 0.6878 1.4381 109.08 9 SCH4 0.0477 0.0467 2.15 30 Xpro 0.8091 0.6501 19.65 10 SIC 0.1950 0.0494 74.67 31 Xac 2.5956 0.625 75.93 11 SIN 0.0800 0.0925 15.61 32 XH2 1.477 1.180 20.11 12 SI 44.910 39.846 11.28 33 XI 17.575 16.479 6.24 13 Scat+ 0.0247 0.0250 1.22 14 San- 0.0659 0.0781 18.50 15 Sva- 0.0018 0.0008 56.34 16 Sbu- 0.0060 0.0023 61.03 17 Spro- 0.0061 0.0060 1.81 18 Sac- 0.0285 0.0564 98.01 Gas 19 SHCO3- 0.4785 0.0384 91.97 34 Sgas,H2 0.0000 0.0000 7.29 20 SNH3 0.0650 0.0008 98.76 35 Sgas,CH4 1.2507 1.3176 5.35 21 SH+ 3.1623*10 -8 1.4356*10- 7 353.97 36 Sgas,CO2 0.0178 0.0163 8.52 436 Specifically, DAE ADM1 results were compared respectively with BSM2 (Rosen and Jeppsson, 2006) and Nguyen (2014) outcome and the absolute percentage errors (APEs) of the steady-state outputs were evaluated. In Table 2, the highest APEs (>1%) are related to the simulated concentrations of Sac, Sac- , SNH3 (SNH3 = SIN − SNH4+ ), SH+ , SCH4 , Sgas,CH4 and Sgas,CO2 . Except for SCH4 , Sgas,CH4 and Sgas,CO2 , they are all state variables in the algebraic equation for solving SH+ concentration Eq(5). Since the DAE system is only an approximation of ODE system, this could be the source of the discrepancies of the APEs, as by influencing the following biogas production process, it can thus cause errors in the calculation of the gas concentrations of Sgas,CH4 and Sgas,CO2. BSM2 study reported that the largest absolute error of steady-state simulation results between their DAE and ODE ADM1 models was only 10-5 (Rosen and Jeppsson, 2006). Another cause of DAE ADM1 errors could also be related to the implicit solver used in Matlab, which solves the non-linear equations by Newton’s method (MathWorks, 2022). 3.2 Influence of initial values on DAE ADM1 model calibration Results obtained by comparing DAE ADM1 with results of the model validation stage in Nguyen’s (2014) are shown in Figure 1, respectively for pH (a), Total Ammonia Nitrogen (TAN) (b) and Acetic Acid (c). As shown, DAE ADM1 results, which are represented with a blue line, mostly match Nguyen (2014) simulation results, by considering the author’s initial values and model parameters. Therefore, the stoichiometric and kinetic parameters calibrated by Nguyen (2014) can be considered representative for predicting the AD performance of his specific steady feedstock. Figure 1. Comparison of the simulation results for pH, TAN and acetic acid of the model validation stage in Nguyen’s (2014) study between his model and DAE ADM1. As reported, the influence of the initial values on the calibration of model parameters was investigated by also reproducing the model calibration stage results in Nguyen’s (2014) (Table 3). This further comparison aimed at verifying whether the same steady state simulation results could be obtained by using the generic initial values from BSM2 and the set of calibrated model parameters used above, or this set of representative model 437 parameters cannot be derived when calibrating the ADM1 using generic initial values. The steady-state outputs of Nguyen (2014) and DAE ADM1 are shown in Table 3, where half of the state variables differ by more than 50%, which prove the influence of generic initial values on the model performance. This could be attributed by Nguyen (2014) probably deriving the representative model parameters by iterative model calibrations and using long-term experimental data (which could make the influence of inaccurate initial values negligible, as previously explained in section 1), however this was not specified by the author. These results confirmed that if ADM1 is calibrated by using short-term experimental data as implemented in some studies (Baldé et al., 2020), it is crucial to provide a relatively accurate set of initial values, otherwise, the calibrated model is very unlikely to generate effective results for the model validation stage. 4. Conclusions A DAE system ADM1 model was developed in this study, called DAE ADM1. Specifically, this model determined the concentrations of hydrogen ions (H+) and hydrogen (H2) from anaerobic digestion processes by solving the main related equations via a DAE system. DAE ADM1 was verified by comparing its steady state outputs with results obtained from BSM2 framework and by comparison with literature studies. This study analysed the influence of the initial values of AD state variables on the calibration of the model stoichiometric and kinetic parameters. Results confirmed that the accuracy of the AD process initial values can be critical for an accurate prediction of the system performance. This study also highlighted the need of future work to develop an approach for ADM1 initial values and parameters calibration, when experimental observations are limited, as this is very common in industrial AD operations. Acknowledgments The authors gratefully acknowledge the financial assistance of the Royal Academy of Engineering with the Transforming Systems through Partnership program as well as the collaboration with the Middle East Technical University, Ankara. References Baldé Y. M., Diop S., Tebbani S., Kanté C., 2020. Modeling of a Continuous Anaerobic Digestion of Wastes, 24th International Conference on System Theory, Control and Computing (ICSTCC), 596-601 Batstone D. J., Keller J., Angelidaki I., Kalyuzhnyi S. V., Pavlostathis S. G., Rozzi A., Sanders W.T.M., Siegrist H., Vavilin V. A., 2002. The IWA anaerobic digestion model no 1 (ADM1). Water Science and technology, 45(10), 65-73. Catenacci A., Grana M., Malpei F., & Ficara E., 2021. Optimizing ADM1 calibration and input characterization for effective co-digestion modelling. Water, 13(21), 3100. Donoso-Bravo A., Pérez-Elvira S. I., Fdz-Polanco F., 2010. Application of simplified models for anaerobic biodegradability tests. Evaluation of pre-treatment processes. Chemical Engineering Journal, 160(2), 607- 614. Fedailaine M., Moussi K., Khitous M., Abada S., Saber M., Tirichine N., 2015. Modeling of the anaerobic digestion of organic waste for biogas production. Procedia Computer Science, 52, 730-737. MathWorks, 2022. ode15s. Solve stiff differential equations and DAEs - variable order method. Available at: https://uk.mathworks.com/help/matlab/ref/ode15s.html (Accessed: 23 March 2022). Nguyen H. H., 2014, Modelling of food waste digestion using ADM1 integrated with Aspen Plus (Doctoral dissertation, University of Southampton). Rosén C., Jeppsson U., 2006. Aspects on ADM1 Implementation within the BSM2 Framework. Department of Industrial Electrical Engineering and Automation, Lund University, Lund, Sweden, 1-35. Sahoo K., Mani S., 2019. Economic and environmental impacts of an integrated-state anaerobic digestion system to produce compressed natural gas from organic wastes and energy crops. Renewable and sustainable energy reviews, 115, 109354. Shampine L. F., 2002. Solving 0 = F(t, y(t), y′(t)) in MATLAB, Journal of Numerical Mathematics, Vol.10, No.4, 2002, pp. 291-310. Thamsiriroj T., Murphy J. D., 2011. Modelling mono-digestion of grass silage in a 2-stage CSTR anaerobic digester using ADM1. Bioresource Technology, 102(2), 948-959. Zaher U., Buffiere P., Steyer J. P., Chen S., 2009. A procedure to estimate proximate analysis of mixed organic wastes. Water Environment Research, 81(4), 407-415. Yan P., Gai M., Wang Y., Gao X., 2021. Review of Soft Sensors in Anaerobic Digestion Process. Processes, 9(8), 1434. 438 https://ieeexplore.ieee.org/author/37088645444 192liu.pdf A Scheme for Anaerobic Digestion Modelling and ADM1 Model Calibration