mathematical model of anaerobic processes applied to the anaerobic sequencing batch reactor
Post on 07-Jul-2018
220 Views
Preview:
TRANSCRIPT
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 1/265
MATHEMATICAL MODEL OF ANAEROBIC PROCESSESAPPLIED TO THE ANAEROBIC SEQUENCING BATCH REACTOR
by
Yale Yunsheng Zheng
A thesis submitted in conform ity w ith the requirements
for the degree o f Doctor o f Philosophy
Graduate Department o f C iv il Engineering
University o f Toronto
©Copyright by Yale Yunsheng Zheng 2003
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 2/265
1*1 National Library of Canada
Acquisitions and Bibliographic Services
395 Wellington Street Ottawa ON K1A0N4 Canada
Bibliotheque nationale du Canada
Acquisitions et services bibliographiques
395, rue Wellington Ottawa ON K1A0N4 Canada
Your Sle Votre reference
Our tile Notre reference
The author has granted a non-
exclusive licence allowing the
National Library of Canada to
reproduce, loan, distribute or sell
copies o f this thesis in microform,
paper or electronic formats.
The author retains ownership of the
copyright in this thesis. Neither the
thesis nor substantial extracts from it
may be printed or otherwise
reproduced without the author’s
permission.
L’auteur a accorde une licence non
exclusive permettant a la
Bibliotheque nationale du Canada de
reproduire, preter, distribuer ou
vendre des copies de cette these sous
la forme de microfiche/film, de
reproduction sur papier ou sur format
electronique.
L’auteur conserve la propriete du
droit d’auteur qui protege cette these.
Ni la these ni des extraits substantiels
de celleci ne doivent etre imprimes
ou autrement reproduits sans son
autorisation.
0- 612- 78316-2
Canadaroduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 3/265
Mathematical Model o f Anaerobic Processes Applied To the Anaerobic
Sequencing Batch Reactor
Doctor of Philosophy, 2003
Yale Yunsheng ZhengGraduate Department o f Civil Engineering
University of Toronto
Abstract
A mathematical model o f anaerobic processes described in this thesis contains two
integrated sub-models: a biolog ical model describing the anaerobic degradation o f complex
substrates and a gravitational settling model for solids-liquid separation in wastewater treatment
processes.
Major developments in this biolog ical model are the incorporation o f new hydrogen
product regulation functions o f glucose degradation and new hydrogen inh ibition functions o f
propionate and butyrate degradation. The new hydrogen product regulation functions are derived
from the rate equation o f ordered single-displacement enzymatic reactions having two substrates.
The new hydrogen inh ibition functions are developed from the thermodynamic basis o f
propionate and butyrate degradations. The model was applied to simulate different
configurations o f anaerobic processes operated under different conditions and provided good
agreement w ith literature data. One o f the contributions o f this model is that it provides good
predictions o f the microbial populations o f different metabolic groups, which are not w ell
predicted by other mod els in the literature.
A gravitational settling model was developed for predicting the solids concentration
profile in the zone-settling and compression regimes o f a gravity thickener. In this model, the
effective solids pressure is a function o f solids concentration and the rate o f change o f solids
ii
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 4/265
concentration. The model was applied to differen t situations o f gravity settling processes and
provided good agreement with literature data. The advances o f this model are its predictive
ab ility fo r vertical solids pro files for both zone-settling and compression regimes, and its use o f
model parameters that are independent o f operating conditions.
The integrated model was applied to evaluate anaerobic sequencing batch reactors
(AnSBRs). The simulation results indicate that, in general, the influent strength and the reactor
mixed liquid volatile suspended solids (MLVSS) concentration have a positive effect on the
maximum organic loading rate o f AnSBRs, while the fill/cy c le time ratio has a negative effect on
the maximum organic loading rate. The optimum fill volume/total volume ratio depends on
influent strength, MLVSS, and fill/cycle time ratio.
ii i
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 5/265
Acknowledgements
I would like to thank my supervisor Prof. David M. Bagley, who provided excellent
supervision, constructive criticisms, and unreserved patience with my progress. I would also like
to thank my other committee members Prof. Barry J. Adams, Prof. Elizabeth A. Edwards, and
Prof. Brent Sleep, whose guidance, assistance, and review are invaluable.
I would also like to thank John Shizas and Jerry Lalman, who were always w illin g to help
w ith this project.
Financial assistance was provided by the Natural Sciences and Engineering Research
Council o f Canada (NSERC) in the form o f post-graduate scholarships, the Ontario M inis try o f
Economic Development, Trade, and Tourism, the Ontario M inis try o f Energy, Science, and
Technology, the Centre for Research in Earth and Space Technology, an Ontario Centre o f
Excellence, and the Unive rsity o f Toronto.
Lastly, I wou ld like to thank my fam ily (my w ife, Arikun Zhao; my son, Jeffrey Zheng;
and my mother-in-law, R uijin Wu) fo r bearing with me.
iv
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 6/265
Table of Contents
Abstract ii
Acknowledgements iv
Table o f contents v
L ist o f tables ix
List o f figures x i
List o f symbols xv
L ist o f abbreviations xx i
1 Introduction 1
1.1 Anaerobic wastewater treatment 1
1.2 Mathematical modeling o f anaerobic processes 2
1.3 Objectives 5
1.4 Publications 6
2 Literature review 7
2.1 Mathematical models for anaerobic processes 7
2.2 Experimental investigations on anaerobic treatment 11
2.2.1 Performance o f differen t reactor configurations 11
2.2.2 Granulation 12
2.2.3 Effect o f low temperature 14
2.3 Gravity settling 16
3 Bio logica l model development 18
3.1 M otivation for new developments 18
3.2 Hydrogen inhibition for propionate and butyrate degradation 21
v
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 7/265
3.3 Hydrogen partial pressure product regulation 30
3.3.1 Regulation functions for glucose degradation 30
3.3.1.1 Lactic acid production 3 0
3.3.1.2 Butyric acid production and acetic acid production 34
3.3.2 Regulation functions for lactic acid degradation 36
3.4 Computation 39
3.4.1 Implem entation for CSTRs and AnSBRs 39
3.4.2 Numerical method 41
4 Model ve rifica tion 45
4.1 Model verifica tion w ith data from Bagley and Brodkorb (1999) 45
4.1.1 Description o f the experimental data 45
4.1.2 Model calibration 47
4.1.3 Model valida tion 54
4.2 Model verification w ith data from K im (2000) 58
4.2.1 Description o f the experimental data 58
4.2.2 Model simulation 59
4.3 Model verifica tion w ith data from Denac (1988) 63
5 Rate lim iting step o f anaerobic treatment 67
5.1 Rate lim itin g step o f anaerobic processes 68
5.2 M icrob ial population distribution 78
5.3 Discussion 83
5.4 Conclusions 84
6 S imulation o f the startup o f anaerobic reactors 85
vi
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 8/265
6.1 Introduction 85
6.2 Simulation o f the startup o f UASB reactors 86
6.3 Simulation o f the startup o f AnSBRs 90
6.4 Discussion 92
7 Modeling o f the gravitationa l settling process 95
7.1 Development o f the gravitationa l settling model 96
7.1.1 Governing equation for gravitational settling 96
7.1.2 Effective solids pressure, Ps 97
7.1.3 Em pirical functions for K/ and K 2 101
7.2 Batch settling 103
7.2.1 Governing equation for batch settling process 103
7.2.2 Num erical formulation 104
7.2.3 Simulation o f interface height versus time 106
7.2.4 Simulation o f dynamic concentration profiles 112
7.2.5 Sensitivity o f compression parameters 116
7.3 Steady state secondary clarifie r 117
7.3.1 Governing equation for steady state secondary clarifie r 117
7.3.2 Steady state solution 118
7.3.3 Validation o f steady state solution 121
7.4 Ve rtical solids profile in UASB reactors 127
8 Evaluating the AnSBR w ith simulation 129
8.1 Organic loading rate 129
8.2 Design and operational parameters o f AnSBRs 130
v ii
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 9/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 10/265
List of Tables
Table 3.1: Hydrogen partial pressure product regulation constants 3 7
Table 3.2: Kine tic constants used in the model 43
Table 3.3: Symbols for soluble and particulate components (Bagley and Brodkorb, 1999) 44
Table 4.1: Operating conditions (Bagley and Brodkorb, 1999) 46
Table 4.2: Predicted maximum substrate utilization rate(g CO D/L/d) 54
Table 4.3: Operating conditions (K im, 2000) 58
Table 4.4: Input biomass composition for each run 63
Table 4.5: Steady state operational and performance parameters 65
Table 4.6: Predicted microb ial population distributions 65
Table 5.1: Lim itation on ind ividua l substrate degradation 73
Table 5.2: Sensitivity analysis o f model parameters on estimated maximum SOLR 76
Table 5.3: Comparison o f anaerobic sludge activity (g substrate/g VSS/d) 80
Table 5.4: Comparison o f reactor performances 80
Table 5.5: Predicted m icrob ial population distributions 81
Table 6.1: Predicted seed sludge com position 86
Table 6.2: OLR and HR T (from Tay and Yan, 1996) 87
Table 6.3: Startup time simulation conditions and results 89
Table 6.4: Simulation conditions 90
Table 6.5: Startup time requirement 91
Table 7.1: Model parameters for various suspensions 107
Table 7.2: Operating conditions and model parameters for the experiment by George and Keinath
(1978) 122
ix
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 11/265
Table 7.3: Operating conditions and model parameters for the experiment by Pflanz (1969) 124
Table 8.1: Box-Behnken response surface design 132
Table 8.2: Factor values for flocculen t sludge 133
Table 8.3: Factor values for granulated sludge 134
Table 8.4: Simulation results o f maximum OLR for flocculent sludge 137
Table 8.5: Parameter estimates and effect test fo r flocculent sludge 138
Table 8.6: Simulation results o f maximum OLR for granulated sludge 145
Table 8.7: Parameter estimates and effect test fo r granulated sludge 146
Table 8.8: S imulation conditions 150
Table 8.9: M icrob ial population distributions 151
Table A l: Stoichiometric coefficients (v,y) for soluble components (Bagley and Brodkorb, 1999)
176
Table A2: S toichiometric coefficients ( ia ) for particulate components (Bagley and Brodkorb,
1999) 177
x
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 12/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 13/265
Figure 4.14: Volatile fatty acid concentrations vs. time for Run 4. 62
Figure 4.15: Vola tile fatty acid concentrations vs. time for Run 5. 62
Figure 4.16: Comparison between the simulated and experimental results for the accumulation o f
organic acids (Denac et al., 1988; Costello et al., 1991b). 66
Figure 5.1: Lim itation on sludge loading rate imposed by ind ividua l constituents. 74
Figure 5.2: Hydrogen partial pressure versus SOLR. 77
Figure 6.1: Comparison o f specific methanogenic activ ity during reactor startup (Data from Tay
and Yan, 1996). 88
Figure 6.2: Predicted effluent COD during startup. 89
Figure 6.3: SM A versus time for the startup o f an AnSBR. 92
Figure 7.1: Force balance over incremental volume o f suspension [Adapted from Fitch (1979)].
97
Figure 7.2: Response o f solid-water m atrix o f thickness i f under effective solids pressure, Ps.
99
Figure 7.3: Zone settling velocity for aluminum hydroxide floes [Calculated from Bhargava and
Rajagopal (1990) results]. 110
Figure 7.4: Interface height versus time for aluminum hydroxide floes. I l l
Figure 7.5: Zone settling velocity for bentonite [Calculated from Bhargava and Rajagopal (1990)
results]. I l l
Figure 7.6: Interface height versus time for bentonite. 112
Figure 7.7: Zone settling velocity for desanded fraction from a gold ore pulp (Scott, 1968).
114
Figure 7.8: Interface height versus time fo r desanded fraction from agold ore pulp. 115
x ii
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 14/265
Figure 7.9: Height-concentration profiles for desanded fraction from a gold ore pulp at different
settling times. 115
Figure 7 . 1 0 : Sensitivity analysis on and ri 2 based on the simulation in Figure 7 . 8 . 1 1 6
Figure 7 . 1 1 : Solids concentrationprofiles for a calcium carbonate suspension. 123
Figure 7 . 1 2 : Solids concentration profile for an activated sludge suspension. 1 2 4
Figure 7 . 1 3 : Solids concentration profile for a high ly loaded activated sludge suspension. 1 2 6
Figure 7 . 1 4 : Solids concentration profile for a UASB reactor. 1 28
Figure 8 . 1 : Contour plot o f maximum O L R for flocculent sludge (S jn low; t y /y low). 1 3 9
Figure 8 . 2 : Contour plot o f maximum O L R for flocculent sludge (S jn low; t j j t r medium)
1 4 0
Figure 8 . 3 : Contour plot o f maximum O L R for flocculent sludge (S jn low; t j j t r high) 1 4 0
Figure 8 . 4 : Contour plot o f maximum O L R for flocculent sludge (S jn medium; t y Jtr low)
141
Figure 8.5 : Contour plot o f maximum O L R for flocculent sludge (S jn medium; fy /f r medium)
141
Figure 8.6: Contour plot o f maximum O L R for flocculent sludge (S jn medium; t j / t r high)
1 4 2
Figure 8 . 7 : Contour plot o f maximum O L R for flocculent sludge ( S i „ high; t j j t r low) 1 4 2
Figure 8.8: Contour plot o f maximum O L R for flocculent sludge (S m high; t j j t r medium)
14 3
Figure 8 . 9 : Contour plot o f maximum O L R for flocculent sludge (S in high; t j l t r high) 14 3
xii i
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 15/265
148
149
149
xiv
produced with permission of the copyright owner. Further reproduction prohibited without permission.
Figure 8.10: Individua l VFAs versus time ( t f f tr - 0.5/22)
Figure 8.11: Individua l VFAs versus time ( t f j t r =12.5/10)
Figure 8.12: Individua l VFAs versus time ( /y j t r = 20.5/2)
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 16/265
List of Symbols
A = cross-sectional area o f the reactor (m2)
A, B = substrate concentrations (mol/L )
A, B = integration constants
Bv = volumetric organic loading rate (g CO D/L/d)
Bx= specific organic loading rate (g COD/g COD VSS/d)
b - constant
bj = decay constant o f microorganism group X, (d_1)
b, = overall decay constant (dH)
C = solids concentration (kg/m3)
Co = in itia l solids concentration (kg/m3)
Ch C2= constants
Cc = c ritica l concentration (kg/m3)
Ce= effluent solids concentration (kg/m3)
Cu = underflow solids concentration (kg/m3)
A = degradation rate (g COD/L/d)
E = enzyme
ES = enzyme substrate complex
f = fraction o f total COD that is consumed as the constituent o f interest
g = acceleration due to gravity (m/s2)
H = in itial thickness o f a thin solids m atrix (m)
j = vertical spatial step
K = equilibrium constant
xv
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 17/265
K\ = reciprocal o f the hydraulic conductivity o f a solids matrix ( ----— )m
K 2 = ability o f a solid m atrix to squeeze out liqu id under pressure ( Pa - h )
Kj = inh ibition constant
KiM 2 xp, Kimxb = hydrogen inhibition parameters (atm)
Km= ha lf velocity constant (m ol/L)
Krfh, Km.- l, K rla = product regulation constants (atm)
Kg . = half-velocity constants (mol/L)
k\ = coefficient used in the exponential interface settling velocity model (m/h)
k l, k3 = forward rate constants
leg Ii 2 = coefficien t used in the effective solids pressure model ( —g - )
m h
k2, k4 = reverse rate constants
k-RFB,K fl, kpaA, = product regulation constants
L = height o f supernatant-suspension interface (m)
Lo = in itial height o f suspension (m)
Lj = volumetric substrate loading rate (g COD/L/d)
L, = total organic loading rate (g COD/L/d)
M = modulus o f elasticity (Pa)
NAD = concentration o f NAD+ (mol/L)
NA DH = concentration o f NA DH (mo l/L)
n = time step
n 1 = coefficient used in the exponential interface settling velocity model (m /kg)
-3« 2 = coefficient used in the effective solids pressure model (m /kg)
xvi
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 18/265
P = product
P = dynamic fluid pressure (Pa)
Ps= effective solids pressure (Pa)
P,,_ = hydrogen partia l pressure (atm)
Qin = influent flow rate (L/h)
Q ou t = effluent flow rate (L/h)
rNAD= ratio o f NA DH to NA D+
rs = sum o f the biolog ica l reaction rates that produce or consume S
S = constituent concentration in the reactor
S = substrate
SA= acetic acid (g COD/m3)
SAi = sludge ac tivity (g COD/g COD VSS/d)
SB= butyric acid (g COD/m3)
Sc = readily degradable carbohydrate (g COD/m3)
SF= readily fermentable monomer; e.g., glucose (g COD/m3)
SH= dissolved hydrogen (g COD/m3)
S, = inert organic compounds (nonbiodegradable) (g COD/m3)
Sin = influent concentration (g COD/m3)
S,„ = the influent COD concentration (g COD/m3)
SL= lactic acid (g COD/m3)
SM= dissolved methane (g COD/m3)
SM A = sludge methanogenic ac tivity (L CHVgVSS/d)
SP= propionic acid (g COD/m3)
xvii
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 19/265
Ss = slow ly degradable complex organics (g COD/m3)
t = time (h)
tc= total cycle time (h)
td= decant time (h)
tr = react time (h)
ts= settle time (h)
U = bu lk (fluid and solids) flow velocity (underflow ve locity) (m/h)
Ue= bulk (fluid and solids) up-flow velocity (m/h)
U = specific substrate utilization rate (g COD/g COD VSS/d)
Uj = specific substrate utilization rate (g COD/g COD VSS/d)
u = solids velocity (m/h)
Uf = flu id ve locity (m/h)
V - solids settling veloc ity relative to the tank wall (m/h)
V= reaction rate (g COD/L/d)
Vf = fi ll volume (L)
Vm= maximum reaction rate (g COD /L/d)
Vmj = maximum substrate utilization rate (g COD/L/d)
VR= reaction volume (L)
v = solids settling velocity relative to bulk flow, positive by convention (m/h)
vo = interface settling ve locity in batch settling tests (m/h)
vs= interface settle velocity (m/h)
V, = total reactor volume (L)
XA= aceticlastic methanogenic organisms (g COD/m3)
xvii i
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 20/265
X B= butyric acid acetogenic organisms (g COD/m3)
X F= heterotroph ic-hydrolytic organisms (g COD/m3)
X H= hydrogenotrophic methanogenic organisms (g COD/m3)
X, = inert component o f lysed biomass (g COD/m3)
X L= lactic acid acidogenic organisms (g COD/m3)
X P= propion ic acid acetogenic organisms (g COD/m3)
X s = biodegradable component o f lysed biomass (g COD/m3)
X, = total solids in the system (g COD/m3)
YF = yield o f heterotrophic-hydrolytic organisms (g COD VSS/g COD)
7, = yield (g COD VSS/g COD)
Y, = overall yield (g COD VSS/g COD)
Yrhod = theoretical product yield
z = vertical coordinate, positive up (m)
T = mass-action ratio
Sj = substrate removal efficiency
s, = overall removal efficiency
r/i.sx = settling efficiency
ij, = inh ibition factor
} j u l2 = hydrogen inh ibition function factor
rjiiAc = regulation factor for acetate production from glucose degradation
t I rm = regulation factor fo r butyrate production from glucose degradation
rim;. = regulation factor fo r propionate production from glucose degradation
Tjin.-A= regulation function for acetate production from glucose degradation
xix
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 21/265
7/,,,,/j = regulation func tion for butyrate production from glucose degradation
7jRhL = regulation function for lactate production from glucose degradation
'Hrla = regulation function for acetate production from lactate degradation
rjliLP = regulation fun ction fo r propionate production from lactate degradation
0 - hydrau lic retention time (d)
6X = solids retention time (d)
•7
Pf = density o f fluid (kg/m )
p, = growth rate o f microorganism group X t (g COD/L/d)
• • 3ps= density o f solids (kg/m )
xx
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 22/265
List of Abbreviations
ABR = anaerobic baffled reactor
AD M1 = Anaerobic D igestion Model No. 1
AF = anaerobic fi lte r
AFF = anaerobic fixed film
AnSBR = anaerobic sequencing batch reactor
COD = chemical oxygen demand
EGSB = expanded granular sludge bed
EMP = Embden-Meyerhoff-Pamas pathway
FIRT = hydraulic retention time
IAW Q = International Association on Water Quality
IW A = International Water Association
MLVSS = mixed liqu id vo latile suspended solids
N AD+ = nicotinamide adenine dinucleotide
OLR = organic loading rate
SEM = scanning electron microscopy
SMA = sludge methanogenic activity
SOLR = specific organic loading rate
SRT = solids retention time
SVI = sludge volume index
UASB = up -flow anaerobic sludge blanket
VF A = volatile fa tty acid
VSS = vo latile suspended solids
xx i
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 23/265
Chapter 1 Introduction
1.1 Anaerobic wastewater treatment
Anaerobic digestion is one o f the oldest bio log ica l wastewater treatment
processes, having first been used more than a century ago (Pavlostathis and Giraldo-
Gomez, 1991). Anaerobic digestion has become the most common method o f sludge
stabilization. Because of the growing emphasis on energy conservation and recovery as
well as other environmental concerns related to land disposal o f wastewater sludges,
anaerobic digestion is expected to continue to play a major role in municipal sludge
processing and treatment o f other complex concentrated wastes (i.e., high concentration
o f biodegradable organics) such as agricultural wastes (e.g., plan t residues, animal waste)
and food-processing wastewaters (Pavlostathis and Giraldo-Gomez, 1991).
Over the past 30 years the popularity o f anaerobic wastewater treatment has
increased as public u tilities and industries have utilized its considerable benefits (Azbar et
al., 2001). Primary advantages o f anaerobic treatment include: 1) reduction o f waste
biomass disposal costs; 2) reduction o f installation space requirements; 3) conservation o f
energy, ensuring ecological and economical benefits; 4) minimization o f operational
attention requirement; 5) e lim ination o f off-gas air pollution; 6) biodegradation o f aerobic
non-biodegradables; 6) provision o f seasonal treatment; 7) reduction o f chlorinated
organic toxicity levels (Speece, 1996). Recognition o f the advantages o f anaerobic
processes, over alternative aerobic processes, has led to the development o f new
anaerobic process configurations. Common configurations o f anaerobic reactors include
1
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 24/265
2
the upflow anaerobic sludge blanket (UASB) reactor, the anaerobic baffled reactor
(ABR), and the anaerobic filte r (AF).
The anaerobic sequencing batch reactor (AnSBR) developed by Dague et al.
(1992) is one of the promising configurations fo r the anaerobic treatment o f high strength
organic wastes. The main advantages associated with AnSBRs are operational fle x ib ility ,
better effluent qua lity control, the absence of secondary settlers, no liqu id and solids
recycling, potential to select a specific microbial population, and plug flo w kinetics (Za iat
et al., 2001). The AnSBR can maintain a high concentration o f slow-growing
methanogenic bacteria in the system, through which process stability is improved (Dague
et al., 1992). Recently AnSBRs have been extensively studied (Chang et al., 1994; Dague
and Pidaparti, 1992; Ng, 1988; Suthaker et al., 1991); however, industrial application o f
this process has not been established, since several fundamental features and
technological aspects remain to be investigated (Zaiat et al., 2001). After a thorough
review o f AnSBR technology, Zaiat et al. (2001) proposed further studies on the
optimization o f operating and design parameters to make the AnSBRs feasible for
industrial applications. One goal o f this study is to determine optimal operating and
design parameters for the AnSBR, and mathematical modeling is the approach employed
to achieve this goal.
1.2 Mathematical modeling of anaerobic processes
A mathematical model is a convenient tool fo r understanding the process,
defining its solution, and optimizing the design and operation o f wastewater treatment
processes (Masse and Droste, 2000; Fernandez et al., 1993; Henze et al., 1987 and 1995).
The mathematical models allow extrapolation o f the design space to conditions beyond
eproduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 25/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 26/265
4
et al. (1999) focused on population dynamics in anaerobic reactors, it excluded the
hydrogenotrophic methanogens, the controlling organisms for anaerobic processes.
Hydrogen was assumed to be instantaneously converted to methane when produced.
The existing models may not be able to provide a reasonable prediction o f
population dynamics. For example, the predicted percentage o f propion ic acid-consuming
bacteria in the total biomass was close to zero after long-term simulation using the
Bagley and Brodkorb (1999) model. Costello et al. (1991b) did not present the
concentrations o f each bacteria group under the in itia l steady-state condition. However,
the authors reported that the concentration o f some groups o f bacteria approached zero
when the model iterated towards the steady-state conditions (initial conditions for
overload test simulation). For their simulations, an arb itrarily small influen t concentration
o f 1 mg/1 was set for each group o f bacteria.
In addition to lim its to the ir predictive capabilities, the existing models may also
experience numerical challenges. Bagley and Brodkorb (1999) used a Cash-Karp fifth -
order Runge-Kutta algorithm w ith adaptive step sizing to solve the system o f nonlinear
differential equations. A Runge-Kutta algorithm was the common algorithm used by
other investigators as w ell (Masse and Droste, 2000; Costello et al., 1991b; Kie ly et al.,
1997). The Runge-Kutta algorithm is not stable for s tif f sets o f equations. However,
because the anaerobic systems typ ica lly have s im ilar rates o f consumption and
production for key intermediates, the nonlinear differential equations used to model them
may be s ti ff (Batstone et al., 2002). An alternative algorithm to Runge-Kutta may be
required.
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 27/265
5
Solids-liquid separation is an integral component o f biolog ical wastewater
treatment processes. This solids-liquid separation is traditionally achieved by gravity
sedimentation (Ekama et al., 1997). Most anaerobic reactor configurations do not make
use o f the conventional c larifier fo r solids-liquid separation. The application o f anaerobic
models could be lim ited w ithout a sub-model for so lids-liquid separation.
1.3 Objectives
The objectives o f this thesis are to:
1. Extend the Bagley and Brodkorb (1999) AnSBR model to a general model for the
anaerobic degradation process to make this model more comparable and
compatible w ith other models.
2. Develop and incorporate into the model a hydrogen partial pressure product
regulation function and hydrogen partial pressure inhibition function that better
accounts fo r the thermodynamic constraints o f anaerobic systems.
3. Implement an improved numerical routine (better than the Cash-Karp fifth-order
Runge-Kutta algorithm) to solve the coupled first-order ordinary differential
equations fo r the model.
4. Develop a gravitationa l settling model applicable for both zone settling and
compression, which is needed for the so lid-liquid separation process.
5. V erify the model using extensive sources o f data in the literature: 1) from
laboratory AnSBRs, 2) from long-term operation o f continuous high-rate
anaerobic reactors, 3) from the dynamic response o f a continuous reactor
subjected to step changes in loading, 4) from the startup o f UASB reactors.
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 28/265
6
6. Examine the optimal design and operational parameters o f AnSBRs through
model simulation.
1.4 Publications
Several sections o f this thesis have been published in refereed journals. Sections
7.1, 7.2, and 7.3 o f Chapter 7 have been published in the Journal of Environmental
Engineering, ASCE (Zheng and Bagley, 1998; Zheng and Bagley, 1999).
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 29/265
Chapter 2 Literature Review
2.1 Mathematical models for anaerobic processes
Mosey (1983) developed the firs t complex model to explain the patterns o f
volatile acid production in the anaerobic digestion process. In this model, he defined and
incorporated the regulation and inh ibition o f the hydrolytic bacteria, and the prop ionic
and butyric acid acetogenic bacteria. Based on the fact that the uptake rates and product
distribution o f some species o f bacteria were regulated by hydrogen gas (Iannotti et al.,
1973; Kaspar and Wuhrmann, 1978), Mosey (1983) proposed that the various mixtures o f
acetic, propionic, and butyric acids in an anaerobic digester under stress are the response
o f the acid-forming bacteria to changes in the redox potential o f their growth medium
brought about by changes in the trace concentrations o f hydrogen in the digester gas. He
further proposed that the obligate hydrogen-utilising methane bacteria are the controlling
organisms for the redox potential o f the anaerobic digestion under normal circumstances.
The level o f hydrogen in the reactor is linked to the redox reactions o f the pyridine
nucleotides (characterized by the nicotinamide adenine dinucleotide redox couple NAD+-
NADH). Hydrogen in the gas phase o f the reactor determined the ratio o f oxidized to
reduced NAD within the bacteria, which in turn regulated and inhibited the metabolic
reactions within the bacteria that were coupled to the NAD+-NADH redox reaction.
Assuming that the half-reaction,
NAD+ + H + + 2e~ « • NADH (2.1)
and the h a lf reaction,
2 H + + 2 e ~ ^ H 2 (2.2)
7
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 30/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 31/265
9
For example, Costello et al. (1991a) developed a dynamic mathematical model o f the
high-rate anaerobic treatment process by incorporating advances made in the modeling
and study of the general anaerobic degradation process. A major change was the
mod ification o f the anaerobic ecosystem to include lactic acid bacteria. The proposed
metabolic pathway o f the glucose bacteria was modified to produce lactic acid rather than
propionic acid, while the lactic acid bacteria produced either acetic or propionic acid
according to the level o f hydrogen in the biogas. This was supported by the experimental
evidence o f Pipyn and Verstraete (1981) and Eng et al. (1986) who showed that lactic
acid accumulates after a sudden increase in the loading o f a readily degradable substrate
to an anaerobic reactor. Bagley and Brodkorb (1999) applied the International
Association on Water Qua lity (IAW Q) (Henze et al., 1987 and 1995) approach, which
ex plicitly allows for inclusion o f multiple populations o f microorganisms performing
different metabolic activities, to systematically develop a model describing
microbiological processes occurring in an AnSBR. The model was validated using data
obtained from operation o f a bench-scale batch reactor treating glucose as the substrate.
Formation and consumption o f intermediate products, including lactate and VFAs, are
predicted, as is system pH. Masse and Droste (2000) developed a comprehensive model
o f anaerobic digestion o f swine manure slurry in a sequencing batch reactor. This model
has sim ilarities to models developed by Mosey (1983) and Costello et al. (1991a), but the
hydrogen effect on metabolism is based on the dissolved hydrogen concentration instead
o f gaseous concentrations. Batstone et al. (2000a) extended the Costello et al. (1991a)
model by incorporating hydrolys is o f particulates and long chain fatty acid (3-oxidation.
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 32/265
10
Recently, the Anaerobic Digestion Model No. 1 (AD M1) was proposed by the
International Water Association (IW A) task group for mathematical modeling o f
anaerobic digestion processes (Batstone et al., 2002). This model includes the formation
and consumption o f carbohydrates, proteins, and fats, while most other models consider
carbohydrates only. Lactate is not considered as an intermediate in this model. This
model incorporates the free ammonia inh ibition o f aceticlastic methanogens in addition to
hydrogen and pH inhib ition .
Some models in the literature do not include the regulation and inhibition effect o f
hydrogen, such as the models developed by Skiadas et al. (2000) and Merkel et al.
(1999). In these models, the product regulation factors from glucose degradation are
constants and are independent o f hydrogen partial pressure. Unfortunately, ADM 1
(Batstone et al., 2002) is one o f these models. Skiadas et al. (2000) developed a dynamic
model for the anaerobic digestion o f glucose in the periodic anaerobic baffled reactor. In
this model the acidogenic bacteria consume glucose and produce an unknown
intermediate (fin al and/or intrace llular) product, as w ell as lactic acid. They observed a
significant COD balance deficit considering the substrate (glucose) and known products
(VFAs, lactate, and biogas) during the in itia l stage o f a batch experiment. From these
observations they argued that accumulation o f some undetermined intermediate products,
as well as accumulation of intracellular intermediate products of bacterial metabolism, is
taking place during the in itia l stage o f the batch experiments. Different groups o f
acidogenic bacteria convert lactate and an intermediate product to a m ixture o f acetate
and propionate. This model does not include the hydrogen-utilizing bacteria and does not
consider the production o f methane from hydrogen by hydrogen-utilizing bacteria. No
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 33/265
11
inhibition factors were considered. Merkel et al. (1999) developed a mathematical model
for the anaerobic digestion process with particular attention to population dynamics. In
the model the microbial populations were grouped into substrate-specific organisms.
However, hydrogenotrophs were not considered as a distinct group in this model. The
model simulation results were validated w ith experimental data obtained by a
combination o f in situ hybridization techniques and epifluorescence microscopy.
There are also many other sim plified models fo r anaerobic processes proposed in
the literature. For example, the model developed by Kiely et al. (1997) for anaerobic
digestion considers the production o f methane as occurring in two stages; that o f
hydrolysis/acidogenesis producing acetate and that o f aceticlastic methanogenesis
producing methane. The model considers the inhibition caused by ammonia in the growth
kinetics o f methanogenic bacteria.
2.2 Experimental investigations on anaerobic treatment
2.2.1 Performance of different reactor configurations
Anaerobic processes for wastewater treatment have been extensively studied.
Many experimental investigations focused on the comparisons o f the performance o f
different reactor configurations. Tay and Zhang (2000a) studied the s tab ility o f three
typical high-rate anaerobic treatment systems (anaerobic fluidized bed reactor, AF, and
UASB) subjected to various disturbances (organic loading rate shock, hydraulic loading
rate shock, bicarbonate supplement absence shock, underload shock, and toxic shock).
The three reactors showed different resistances to different shocks. The anaerobic
fluidized bed reactor showed good resistance to all the shocks, while the UASB exhibited
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 34/265
12
good performance in almost all the shocks except the toxic event. The AF seemed to
perform the worst in all the shock tests except the toxic shock. A fuzzy stability index for
the evaluation o f stability o f high-rate anaerobic systems was proposed by Tay and Zhang
(2000b). Perez et al. (1998) compared the performance o f two high rate anaerobic
treatment systems (anaerobic filte r and fluidized bed). They concluded that the anaerobic
fluid ized bed system was more effective than the anaerobic filte r system.
Yeh et al. (1997) investigated the performance o f an anaerobic rotating bio logical
contactor under differe nt flo w rates and influen t organic strengths. They showed that the
removal efficiencies increased as the hydraulic retention time (HRT) increased or the
influen t COD decreased. Show and Tay (1999) examined the influence o f support media
on biomass growth and retention on anaerobic filters. Their results indicated that media
surface texture and porosity have a sign ificant impact on anaerobic filte r performance.
Support media o f open-pored surfaces and high porosity were recommended.
2.2.2 Granulation
Granulation is an important feature for some anaerobic treatment processes. The
granule enhances solids-liquid separation and helps to retain the slow-growing anaerobic
microorganisms in the reactors. Jhung and Choi (1995) evaluated the characteristics o f
the waste in the development o f sludge granulation and the operation o f two differen t
reactors, UASB and a downflow anaerobic fixed film (AFF) reactor. The ir results
indicated that sludge granulation was influenced more by the characteristics o f the waste
used than by the reactor type itself. Microscopic observations, including scanning
electron microscopy (SEM), revealed that microbial compositions in the two reactors
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 35/265
13
were essentially identical. A complex carbohydrate waste, having a higher CO D/volatile
acids ratio, produced filamentous microbes and these appeared to promote granulation.
Thaveesri et al. (1995) examined the form ation o f anaerobic granular sludge on
wastewater from sugar-beet processing in UASB reactors by addition o f high-energy
substrates and varying the reactor liquid surface tension. Granular sludge growth only
occurred when there were sufficient high-energy substrates. A low reactor liquid surface
tension increased granular yield. O ’Flaherty et al. (1997) investigated the influence o f
feed composition and liquid upflow velocity on the microbiological and physico
chemical properties o f sludges developed in anaerobic up flow hybrid reactors. Their
results showed that high-energy substrates are not a prerequisite for granulation, although
the presence o f sugars has been found to promote granulation. Elevated up flow velocities
promoted granulation (O’Flaherty et al., 1997). Grootaerd et al. (1997) reported that
adding carrot pu lp waste product as a granular growth supplement was not successful.
Tay et al. (2000) proposed a theory for the molecular mechanism o f sludge
granulation. They suggested that the bacterial surface dehydration caused by proton
translocating activity initiates sludge granulation. The overall granulation process
included four stages: dehydration o f bacterial surfaces, embryonic granule form ation,
granule maturation, and postmaturation. Teo et al. (2000) investigated the effects o f some
factors on granular strength. Both calcium ion and surfactants were found to strengthen
the granular structure. In the physiolog ical pH range o f 5.5-11.0, the lower the pH value,
the stronger the granule. Both the metabolic inhibitors, iodoacetic acid and sodium
fluoride, and the proton translocator, carbonyl cyanide m-chlorophenyl-hydrazone,
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 36/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 37/265
15
acetogenic activity at mesophilic temperature (35°C), even after incubation for many
months at psychrophilic temperatures. Hardly any selection or enrichment for
psychrophilic bacteria had taken place, but the mesophilic bacteria initially present were
metabolizing at lower rates. Mesophilic inocula incubated at lower temperatures in batch
bioassays produced more propionate than acetate due to a greater reduction in the rate o f
the syntrophs compared to the methanogens at low temperatures.
Fernandez et al. (2000) showed that a stably performing anaerobic bioreactor
exhibited tremendous variation in the composition o f its microb ial community. W u et al.
(2001) showed that at 15°C, a cellulose-fermenting methanogenic microbial culture was
dominated by Methanosaeta and at 30°C by Methanosarcina. They found that the 15 and
30°C culture lines behaved differently, indicating that the com position o f the acetoclastic
archaeal community indeed affects the functional performance at two different
temperatures. Their study showed that functionally similar but structurally different
methanogenic archaeal communities can have a decisive effect on the reaction o f a
methanogenic system to temperature shifts. However, the composition o f the bacterial
community can also have strong effects. They speculated that the low temperatures
selected against propionate-utilizing microorganisms.
Kettunen and Rintala (1998) studied the treatment o f municipal land fill leachate
at 13-23°C using a pilot-scale UASB reactor. Their results indicated that a UASB reactor
was feasible for the on-site treatment o f municipal landfill leachate at temperatures as
low as 13°C. Mesophilic digested sewage sludge adapted well to low temperature.
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 38/265
16
2.3 Gravity settling
The International Association on Water Quality (IAW Q) presented a scientific
and technical report on secondary settling tanks (Ekama et al., 1997). This report
summarized all new, important, and significant developments in the secondary settling
tank area, including theory, modeling, and design and operation. It was recommended
that, for better secondary settling tank performance, intentiona l optimization o f the
clarification, thickening and sludge storage functions o f secondary settling tanks is
required in addition to the design o f the secondary settling tank external dimensions, such
as area, depth, and recycle flow.
Namoli and Mehrotra (1997) proposed a model to simulate the solids profile in
the sludge blanket o f the UASB reactor. According to their de finition , the UASB reactor
consists o f a sludge bed in the bottom, a sludge blanket in the m iddle, and an interna l
settler supplemented w ith a gas-solid separator on the top. This model considered the
solid diffus ion induced by gas bubbles. The model predictions were validated w ith data
from literature. They showed that the model facilitates the optimization o f reactor
dimensions and the desludging schedule.
Chancelier et al. (1997) presented a theoretical analysis on the characterization o f
the steady states o f the secondary settler and its relations w ith the lim iting flu x theory.
Their results allowed insights into the lim iting flux theory, especially when the settler is
overloaded.
Ka rl and Wells (1999) developed a numerical model o f gravitational
sedimentation and thicken ing from the governing two-phase flow equations fo r the liqu id
and solid phases. Constitutive relationships describing the physical properties o f the
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 39/265
17
sludge were required to solve the model numerically. These constitutive properties were
determined experimentally and by model calibration. The model was calibrated and
verified using vertical solids profile data from batch settling tests.
Vanderhasselt and Vanrolleghem (2000) compared two means o f obtaining the
parameters for the zone-settling velocity models: ( 1 ) the traditional approach using zone
settling velocity data obtained from a dilution experiment and ( 2 ) a direct parameter
estimation method relying on a single batch settling curve. The latter was achieved by
fitting a one-dimensional 50-layer settling model, which incorporated a zone-settling
model, to single batch settling curves. When the dynamics o f sludge blanket descent were
fast, the second method failed to derive zone-settling velocity model parameters that are
consistent w ith the first method. I t was concluded that the second approach is not ready
for practice.
Chatellier and Audic (2000) proposed a model for wastewater treatment plant
clarifier simulation. This model was based on the layer model proposed by Takacs et al.
(1991). However, the settling velocity equation was modified based on the hypothesis
that the solids flux through all layers o f the cla rifier is constant even for non-steady-state
conditions.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 40/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 41/265
19
pressure on the degradation o f propionate. When the hydrogen pa rtial pressure is higher
than the thermodynamic lim it, their model s till predicts very high propionate degradation
(> 80% o f uninh ibited degradation rate). For the models o f Bagley and Brodkorb (1999)
and AD M1 (Batstone et al., 2002), the thermodynamic lim it was under consideration
when the inhibition constant was chosen. However, their functions have a flat shape in
the normal range o f hydrogen partial pressure for the anaerobic process. These functions
predict that the degradation rates are not much different when the hydrogen partial
pressure is higher or lower than the thermodynamic lim it. Therefore these functions
cannot represent the deteriorating effect o f hydrogen partial pressure on the degradation
o f propionate. The hydrogen inhib ition function used in this study, which is derived in the
following section, is shown in Figure 3.1 for comparison.
The glucose degradation products distribute among propionate, butyrate, and
acetate. Generally, it is believed that the hydrogen partial pressure affects these
distributions. Figure 3.2 plots propionate yield versus hydrogen partial pressure predicted
by the hydrogen regulation functions used by the models in the literature. Propionate
yield is the amount o f propionate produced from 1 un it o f glucose COD degraded. I t can
be seen from Figure 3.2 that for the models o f Costello et al. (1991a), Masse and Droste
(2000), and Bagley and Brodkorb (1999), little propionate is produced when the
hydrogen partial pressure is in the normal range o f anaerobic treatment. Therefore, there
w ill be very little growth o f propionate acetogens. As a result, these models w ill predict
that very few propionate acetogens w ill be present in the anaerobic biomass. In addition,
according to Batstone et al. (2002), the regulation function developed by Costello et al.
(1991a) could not be used consistently with a variety o f experimental data sets. AD M1
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 42/265
20
(Batstone et al., 2002) uses a constant value for the propionate yield. The propionate
yield predicted by the regulation function used in this study, which is derived in the
following section, is shown in Figure 3.2 for comparison.
0.0E+00 2.0E-05 4.0E-05 6 .0E-05 8.0E-05 1.0E-04
Hydrogen Partial Pressure (atm)
Figure 3.1: Comparison o f hydrogen inhibition function used in different models.
A , Costello et al. (1991a) and Masse and Droste (2000); B, current model; C, Bagley and
Brodkorb (1999); D, Batstone et al. (2002).
thermodynamic limit
1
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 43/265
21
0.4
2
CD
g 0.2 oQ .
2Q_
0.0E+00 2.0E-05 4 .0E-05 6.0E-05 8.0E-05 1.0E-04Hydrogen Partial Pressure (atm)
Figure 3.2: Comparison o f propionate yields predicted by d ifferent models. A ,
Costello et al. (1991a) and Masse and Droste (2000); B, current model; C, Bagley and
Brodkorb (1999); D, Batstone et al. (2002).
3.2 Hydrogen inhibition for propionate and butyrate degradation
Enzyme kinetics w ill be used to approximate the situation for propionate and
butyrate degradation. The reaction scheme for a single substrate enzyme reaction can be
assumed to be (Snoeyink and Jenkins, 1980)
k \ k i
S + E o E S & P + E (3.3)k2 k4
where S is the substrate; E is the enzyme; ES is the enzyme substrate complex; P is the
product; k l and k3 are forw ard rate constants; and k2 and k4 are reverse rate constants.
The rate o f reaction should be related to the concentration o f ES complex because,
for the reaction to take place, ES must be formed. Therefore ES must be determined in
terms o f the total amount o f E-containing species and substrate concentration.
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 44/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 45/265
23
v = _ m 14
v =
- - = ( « ( * 2 + “ W ) W ] + M [ P ] + k 2 + B
■— = (MB[s]~ k2k4[p] ) ~ ^ B ------------
dt v k\[s] + k4[p] + k2 + k3
V = - ^ J k 3 [ S ] - ™ * [ P ] dt I k\
[4[,s]+ M [ p ] + * 2 ± ML J k \ l J k\
(3.12)
(3.13)
(3.14)
dt H ± « + [S] + M jp j
k\ 1 J k l L 1
(3.15)
Defining the maximum reaction rate Vmas (Snoeyink and Jenkins, 1980)
v. = »[£], (3.16)
and lumping kinetic constants (Snoeyink and Jenkins, 1980)
k l + k3K,„ =
k\ (3.17)
Equation 3.15 can then be rewritten as
V =dS _ " V 1 k3 k\ i
dt K m+ [S] + ̂ [ P ] k\
(3.18)
According to Fersht (1985), k2 » k3 most o f the time, and for the reaction to
proceed, [S'] > — — [p], therefore it can be concluded that [s] » — [/*] (because — isk3 k\ k\ k3
large). Therefore Equation 3.18 can be sim plified to
V = - ds
dt (3.19)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 46/265
24
k1 k4r Because k l » k3 , --------- |PJ may not be negligible. This is indeed the case for
propionate and butyrate degradation (Hoh and Cord-Ruwisch, 1996).
Equation 3.19 can be rewritten as
(3.20)
where
, k l k4 [p ]Vl.Hl = 1 _ T T T T T rd
k3 kl [S'](3.21)
The four rate constants in equation 3.21 combine to give the equilibr ium constant K (Hoh
and Cord-Ruwisch, 1996)
r. kl k3K = -------- (3.22)
k l k4
According to Hoh and Cord-Ruwisch (1996)
IP] U = r (3.23,
where T is the mass-action ratio (actual ratio o f [products] over [substrates]) used in the
calculation o f the overall change o f Gibbs free energy (A G ') (A G ' = RT ln(T IK)) .
Therefore, equation 3.21 can be rew ritten as
tjl M2= i - r / K (3.24)
As an example, the energy reaction equation fo r propionate degradation is
CH 3CH 2COOH + 2 H 20 - > CH3COOH + C 0 2 + 3H2 (3.25)
Then
r { c h , c o o h }{ c o 2}{ h 2?
{ c h 3c h 2 c o o h )(3.26)
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 47/265
25
and the equilibrium constant K is expressed as
(3.27)
Equations 3.24 and 3.26 are equations describing the product inh ibition effect o f
propionate degradation. Equation 3.26 indicates that all degradation products, including
acetic acid, carbon dioxide, and hydrogen, can inh ib it the degradation o f propionate.
However the variation o f hydrogen concentration has the most significant effect on T due
to the third power in the expression. Therefore the effects o f acetate and propionate are
minimal, compared to the effect o f hydrogen. Th is was theoretically examined by Hoh
and Cord-Ruwisch (1996) and experimentally examined by Mosche and Jordening
(1999). In order to s im plify the expression for the production inh ibition function,
Equation 3.24 is rewritten as (assuming that the hydrogen gas and liquid phases are in
equilibrium):
where K/jqxp is an inhibition parameter. The following expression can be derived for
K/,h2 xp from Equations 3.24, 3.26, and 3.28:
where K\\ is the Henry’s Law constant.
Equation 3.30 shows that the inhibition parameter, K^mxp, is a function o f the
equilibrium constant as well as the actual activities o f other constituents. I f needed, this
\ 1 ,H 2 XP J i f P H2 ̂ 7f[ | |2XP (3.28)
t 1i ,h 2 xp i f P H2 > -K),H2XP (3.29)
I ,H2XP
\ c h ,c o o h }{ c o 2\ (3.30)
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 48/265
26
parameter could be calculated each time there is a change. However, for many situations,
the inhibition parameter can be approximately constant, and can be calculated by
assuming typ ical concentrations o f the constituents. The inhibition parameter, Kj H2XP’
is equivalent to the thermodynamic lim it o f propionate degradation. When the hydrogen
partial pressure is at the thermodynamic lim it, there should be no propionate degradation
(i.e., rjj H2XP = 0 ). Therefore, it can be seen from Equation 3.28 that the inhibition
parameter equals the thermodynamic lim it o f propionate degradation. For example, the
thermodynamic lim it o f propionate degradation occurs at Pm o f 4.0x10- 5 atm at 22°C
(Bagley and Brodkorb, 1999), thus
•£l,H2XP = 4.0x10“ 5 atm (3.31)
Similarly, the energy reaction equation fo r butyrate degradation is written as
CH 3CH2CH2COOH + 2 H 2 0 ^ 2 CH3COOH + 2H2 (3.32)
and the corresponding hydrogen partial pressure inhibition function is written as
Vl,H2XB ~ 1r P ^1HI
\̂ -I,H2XB J i f Pm ^ ^i,h 2xb (3.33)
Vi..H2XB ~ 0 if Pm > ^I,H2XB (3.34)
where Kimxs is the inhibition parameter for butyrate degradation
The thermodynamic lim it o f butyrate degradation occurs at Pm o f 3.0x10” 4 atm at
22°C (Bagley and Brodkorb, 1999), thus
^I ,H2XB = 3. Ox 10- 4 atm (3.35)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 49/265
27
There is a discontinuity in the expressions o f rj{ H2 as given by Equations 3.28,
3.29, 3.33 and 3.34. This w ill cause a numerical problem fo r the computer simulation,
and the expressions can be smoothed as follows.
The actual hydrogen inhibition functions used for propionate in the model are
rll,H2XP = 1-
r P ^r H 2
K I,H2XP i f Pm ^ O ^X i^x p (3.36)
VlMlXP - X X T i f ^H2 > 0.97Kl ,H2XP (3.37)“H2 ~ L 2
where C; and C 2 are constants to be determined. The coefficien t 0.97 is arbitrary.
When Pm equals 0.97 K ff /2Xp, the r h H2XP calculated from Equations 3.36
and 3.37 are the same, therefore
- 1.
v
^■9^K I,H2XP
KI,H2XP = 0.087327 (3.38)
0-97K I tH 2X P- C 2
and the derivatives o f P ]j j2Xp with respect to Pm from both equations are the same,
therefore
C, r 0.97K j u2XP A
v K I,H2XP
2.8227(3.39)
K I,H2XP {o.97K1H 2X P- C 2)2 K I,H2XP
Solving Equations 3.38 and 3.39 for C/ and C 2 gives
Q =0 .00270167^ H2XP (3.40)
C2 = 0.9390626KIH 2X P (3.41)
Using the same procedure, the actual hydrogen inhibition functions used for
butyrate in the model are
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 50/265
28
V l , H 2 X B
1 ,H2XB y
/ \
i f Pm ^ 0.97A'im2xb (3-42)
0.001800418if I , H 2 X B
V l , H 2 X B ~ P h i - 0 . 9 3 9 5 3 6 0 S 2 K i h 2 x b i f Ph2 > 0.97^i;h2xb (3.43)
Equations 3.36, 3.37, 3.42 and 3.43 resolve the discontinuity problem for the
inhibition functions. Therefore, the inh ibition functions are numerically satisfactory.
Figure 3.3 plots the hydrogen inhibition function for propionate degradation and
Figure 3.4 plots the hydrogen inhibition function for butyrate degradation. When
compared to the functions used in other models (see Figure 3.2 for propionate), these new
functions are closer to the actual step function desired.
1
oo03
o 0.5
0
0 0.00005
Hydrogen Partial Pressure (atm)
0.0001
Figure 3.3: Hydrogen inhibition function for propionate degradation.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 51/265
29
v.
3o
05LL.
§ 0.5■4~>
ZZ c
0 0.0003 0.0006
Hydrogen Partial Pressure (atm)
Figure 3.4: Hydrogen inhibition function for butyrate degradation.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 52/265
30
3.3 Hydrogen partial pressure product regulation
Enzyme kinetics can serve as a model for the kinetics to be developed for product
regulation. The general rate equation for ordered enzymatic reactions having two
substrates, where A is the leading substrate, is (Lehninger, 1975):
where V is the reaction rate; V„, is the maximum reaction rate; A and B are substrate
3.3.1 Regulation functions for glucose degradation
3.3.1.1 Lactic acid production
The acidogenic organisms ferment glucose into acetic, butyric, or lactic acid
through the Embden-Meyerhoff-Parnas pathway (EMP) with pyruvic acid as intermediate
(Figure 3.5). The sum of the product regulation functions for glucose equals 1 to maintain
mass conservation, as indicated in the follow ing equation:
where tjppi is the regulation function fo r lactate production; rjRpB is the regulation
function for butyrate production; and t ]R pa is the regulation function fo r acetate
production.
For the formation o f acetyl-CoA from pyruvic acid shown in Figure 3.5 (Reaction
1), nicotinamide adenine dinucleotide (NAD+) is utilized as a coenzyme to accept
electrons from pyruvic acid and the leading substrate A can be defined as NA D+ w ith B
as pyruv ic acid. For the formation o f lactic acid from pyruvic acid (Reaction 2), NADH
V = (3.44),S m m _|_ m ^ ^
A B A B
concentrations; and K$ , , and are half-velocity constants.
rhm. + Brfb + V ri - a ~ 1(3.45)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 53/265
31
acts to deliver electrons to pyruvic acid. The leading substrate A can be defined as NADH
with B as pyruvic acid. Because the conversion from glucose to pyruvic acid is a fast
process (Mosey, 1983), B may be assumed to be in excess (B » K “ ). Then Equation
3.44 reduces to:
V =
+ i
(3.46)
Glucose
'NAD
, NA DH
2 [Pyruvic ac id]'
(2)
lNAD
B rf l
2 [Lactic acid]
NA D+ NAD H
2[Acetyl-CoA]~
'NADH 'NADH
( 4 )
^NAD
V rf r B rf a
Butyric acid
( 3 )
2 [Acetic acid]
Figure 3.5: The degradation pathway o f glucose (Mod ified from Costello et al.,
1991a). The numbers are referred to in the text.
Then, per Figure 3.5, the rate o f formation o f acetyl-CoA from pyruvic acid is
written as (subscript 1 for reaction 1; A = NA D+):
V„,V,
ml T̂NAi
ml
NAD
(3.47)
+ 1
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 54/265
32
and the rate o f formation o f lactic acid from pyruvic acid is w ritten as (subscript 2 for
reaction 2; A - NADH):
V2 =m2
K NADH
m2
(3.48)
+ 1N A D H
where N AD is the concentration o f N AD + (mol/L); and NA DH is the concentration o f
NADH (mol/L).
D ividing Equation 3.47 by Equation 3.48 gives:
r r NADH
ml +1
V\ v mi N A D H Vm2 K ™ +1
(3.49)
N A D
K NADH
m2 ■ + 1
v = K i N A D H v
V K NAD 2 m2 mX | |
N A D
(3.50)
Defining V - Vx + V2 , where V is the total removal rate o f pyruvic acid, then
V =
K NADH \
m2
1+K „ i N A D H
+ 1
V,m2 i f NAD
^ - + 1N A D
V-, (3.51)
V r fl
K NADH 'N
m2 + 1
1+ v m\ N A D H
v K nadm2 ml ^
N A D
(3.52)
According to Mosey (1983) (Equation 2.3)
N A D H
N A D= 1500P,
H 2 (3.53)
Defining N A D T = N A D + N A D H , then
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 55/265
33
NAD =1
1+ 1500P,NADT
H 2
NADH = — 5 Q Q /" 2 NADT
1+ 1500P,HI
Substituting Equations 3.54 and 3.55 into 3.52 gives
P rf l =
1+ 1500P, A-'H2-K™DH +NADT
1 + Vm 1S00P„
F„ 2 (l + 1500P„2)K,%D +NADT
For a normal anaerobic system operated w ith PH2 in the range o f 1.0x10 6
atm(Speece, 1996):
So:
1+ 1500/)^ «1
P rf l =
K™DH +NA DT
1+K , 1500PH2
V,ml + NADT
P rf l + -1 V.ml K
NADH
m2 x , Vmi NADT
v Vm2 NADT + K T 1500PH2 Vm2 NADT + K N J D,
1 + Vm] NADT
Pm,Vm2 NAD T + K Z
NAD
1 V.ml K NADH
ml
1500 F„ , 2 N AD T + K T H2 +
1 + ml NADT
Vm2 NADT + K mX NAD
Therefore
produced with permission of the copyright owner. Further reproduction prohibited without permission.
(3.54)
(3.55)
(3.56)
l.OxlO - 4
(3.57)
(3.58)
(3.59)
(3.60)
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 56/265
34
k P „ _ K RF I,r H2 n
t1r f l ~ ~ p ~ T k ~ ( }H2 "r i '-RFL
where
° , , V„, NADT {3'62)
V„2 NADT + K ™
i t / ts NADH
1 m\ _______ ml ______
1500 V 2 NADT + K%?D
K «"■=- : V NADT 1 + — ----------------------
Vm2 NADT + K ™
Equation 3.61 is the product regulation function for lactic acid production from
glucose degradation.
3.3.1.2 Butyric acid production and acetic acid production
According to Figure 3.5, the rate o f formation o f acetic acid from acetyl-CoA can
be written as (subscript 3 for reaction 3):
r3 = r„3 (3.64)
because there is no NAD+ /NADH involved and still assuming that the substrate, acetyl-
CoA in this case, is in excess.
The rate o f formation o f butyric acid from acetyl-CoA is written as (subscript 4
for reaction 4; A = NADH ):
V a = k n a d h (3.65)
^ m 4NADH
Therefore,
V3 _ vm3
+ 1
y NADH m4 j
NADH v J
(3.66)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 57/265
35
Vi =
V,m3
V,m4
K NADH mA
NADH + 1 (3.67)
Defining V = V3 +V4 , where V is the total removal rate o f acetyl-CoA, then
V = 1+K m3
r V N AD H A
v.mA
LmA
NADH + 1 VA (3.68)
Vt v 1+ "'3
V m A
K m4
NADH + 1
J J
(3.69)
Substituting Equations 3.54 and 3.55 into 3.69 gives
Av
1+ 1500P,
l + Vm3 1500PH2 H2 K™DH + NADT
V,mA NADT (3.70)
Considering 1+ 1500Pf/2 « 1 per Equation 3.57, Equation 3.70 is sim plified as
l + v m3H 2
— = -------------- — ----------------- (3.71)V -t rr is NA DH y J
1 'm3 mA
Therefore
where
PH 2 + ’1500 Vm4 NADT
1 + Vm3
PmA
V k P y 4 _ RFB H I
V ~ P H2 +K * fb
]r —
" 'RFB ~
i + F-V.mA
(3.73)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 58/265
36
NADH * Vm, Kmt
_ 1500 Vm4 NADT RFB ~
1 + K ,(3.74)
V.mA
Equation 3.72 is the regulation function for butyric acid production from acetyl-CoA.
Considering the production o f acetyl-CoA from glucose, the regulation func tion fo r
butyric acid production from glucose degradation can be written as
V rfb 1 -k P 11 m A h 2
PH2 + Km j
k P RFB H I
PH2+ k rfb
(3.75)
and the product regulation function for acetic acid production from glucose degradation is
written as
V r i - a
k p j _ R̂FL1hi
P H 2 + K r f l J \
k p\ _ 1U‘B H 2
P + K 1 H 2 T a^ r f b y
(3.76)
3.3.2 Regulation functions for lactic acid degradation
Lactic acid acidogenic organisms ferment lactic acid to either propionic acid or
acetic acid (Equations 3.77 and 3.78).
CH 3CHOHCOOH + H20 ->. CH3COOH + C 0 2 + 2 H2 (3.77)
CH 3CHOHCOOH + H 2 -> CH3CH2COOH + H20 (3.78)
Similar to the derivation for glucose degradation, the production regulation
functions for lactic acid degradation can be written as
’ H r i .p
k P RIJ3 H 2
P + K 1 H 2 T R IJ ’
k P _ 1 _ RLP1 H 2
H r l a ~ 1PH2 + K RLp
(3.79)
(3.80)
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 59/265
37
where t j r l p is the regulation function for propionate production from lactate degradation;
rjRIA is the regulation function for acetate production from lactate degradation; and kRfA
and K ria are constants.
Figure 3.6 illustrates the hydrogen partial pressure product regulation from
glucose fermentation and Figure 3.7 illustrates the hydrogen partial pressure product
regulation from lactic acid degradation. The regulation constants are summarized in
Table 3.1. The constants were developed by comparison to Bagley and Brodkorb (1999)
data.
Table 3.1: Hydrogen partial pressure product regulation constants
Parameters Description Value3
k RFL Regulation o f glucose fermentation 1 . 0
K rfl (atm) Regulation o f glucose fermentation 5.0x10- 5
Jr RFB Regulation o f glucose fermentation 0.7
K rfh (atm) Regulation o f glucose fermentation l.OxlO -4
If RLP Regulation o f lactic acid fermentation 0.45
K rlp (atm) Regulation o f lactic acid fermentation l.OxlO - 5
“ Developed from Bagley and Brodkorb (1999)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 60/265
38
0.8lactate
c o
| 0.4O)CDOd
0.2
acetate
butyrate
0 0.0001 0.0002 0.0003 0.0004
Hydrogen Partial Pressure (atm)
Figure 3.6: Hydrogen regulation o f product distribution in the degradation o f glucose to
acetate, lactate, and butyrate.
0.8
%to
Ll_
acetate0.6
co-4—'
_ro=5CDCDCd
0.4propionate
0.2
0 0.0001 0.0002 0.0003 0.0004
Hydrogen Partial Pressure (atm)
Figure 3.7: Hydrogen regulation o f product distribu tion in the degradation o f lactate to
acetate and propionate.
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 61/265
39
3.4 Computation
3.4.1 Implementation for CSTRs and AnSBRs
The overall mass balance for a completely mixed reactor is
(3.81)
where VR is the reaction volume; Qm is the influent flo w rate; Q out is the effluent flow
rate; Sm is the influent concentration; S is the constituent concentration in the reactor; and
rs is the sum o f the biolog ical reaction rates that produce or consume S. W ith the
exceptions identified in this chapter, the form for rs is taken from Bagley and Brodkorb
(1999). Equation 3.81 is valid for both soluble components and particulate components.
For continuous reactors (such as CSTRs and UASBs), VR, QIN, and Q out can
remain constant, and Qm equals Qouf, Equation 3.81 is simplified to
The AnSBR has five distinct stages: fill, react, settle, decant, and waste. VR, Q m ,
and Q ou t vary w ithin an AnSBR cycle. Equation 3.81 can be sim plified fo r the differen t
stages. For the fill stage,
(3.82)
Qour ~ 0 (3.83)
and
(3.84)
Therefore, Equation 3.81 is simplified to
(3.85)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 62/265
40
For the react stage, Q m equals 0, Q ou t equals 0, and VR remains constant,
therefore, equation 3.81 is sim plified to
For the settle stage, the m ixing is stopped and liquid -so lids separation occurs.
Assuming that m icrobial reactions continue only in the settled volume and no reaction
w ill occur in the supernatant, an effective V r can be described by the follow ing equation:
where vs is the interface settle velocity; and A is the cross-sectional area o f the reactor.
For the reactor as a whole, Q ou t equals 0 in the settle stage. For the settled
reaction volume, the settle stage is equivalent to having an outflow rate o f vsA. If the
settling efficiency is represented by t ]FSX, the effluent particulate component
concentrations (the particulate components remaining in the supernatant) can be written
as
Therefore, for particulate components X, substituting Equations 3.87 and 3.88 into
Equation 3.81 (considering Qm =0and Qom = vsA ) gives
~ d t = ~ v ^ ’1"s- 'x + r ' <3,89)
while for soluble components, Equation 3.81 is simplified as (settle efficiency equals 0)
(3.87)
(i-nfAx (3.88)
dS — = r\ (3.90)
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 63/265
41
For the decant stage, assuming that m icrob ial reactions occur only in the settled
volume, for the reaction volume, Q j N equals 0, Q ou t equals 0, and VR remains constant.
Equation 3.81 is simplified to
" T = r s ( 3 -9 1 )at
For the waste stage
Q,n = 0 (3.92)
and
=S o u r (3-93)
Therefore, Equation 3.81 is sim plified to
, —* ..— = rs (3-94)at
3.4.2 Numerical method
The model has 18 processes and 19 components (Bagley and Brodkorb, 1999),
giving rise to a set o f 19 coupled first-order ordinary d iffere ntial equations. As this is a
s tif f set o f equations, it is solved num erically using the sem i-imp licit extrapolation
method (Press et al., 1992). The stoichiometry matrices are presented in Appendix A . The
computer program was coded in ANSI C and executed on a desktop PC. The source code
is presented in Appendix B.
The general form o f a set o f N coupled first-order ordinary d ifferen tial equations
is (Press et al., 1992):
= i = (3.95)at
where the functions f on the right-hand side are known.
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 64/265
42
The computer code for the semi-implicit extrapolation method is available in
Press et al. (1992) except for two user-supplied routines. The first user-supplied routine
computes the right-hand side derivatives o f Equation 3.95 (or dy^ty/dt). This routine is
the routine derivs in Appendix B. This user-supplied routine is straightforward and the
Runge-Kutta method requires this user-supplied routine only. The second user-supplied
routine computes the Jacobian ma trix; the Jacobian matrix is the matrix o f the partial
derivatives o f the right-hand side o f Equation 3.95 w ith respect to y (d f /By ). This routine
is the routine jacobn in Appendix B.
The current model is bu ilt on the model o f Bagley and Brodkorb (1999). The
computer code was revised so that the model also works for continuous reactors. The
kinetic constants used in the model are listed in Table 3.2. The kinetic constants reported
in the literature vary significantly (Pavlostathis and Giraldo-Gomez, 1991). Except for
the kinetic constants in Table 3.2 and the hydrogen inhibition and regulation parameters
in Table 3.1, the model parameters are the same as Bagley and Brodkorb (1999). Table
3.3 is a lis t o f symbols for soluble and particulate components, which w ill be referred to
in rest o f this thesis. A ll model parameters are presented in the sample input files in
Appendix C. The computer code checks the COD balance at each computational step.
Therefore, the overall COD balance closure is ensured for model simulations.
Dissolved hydrogen concentration is more correctly used in the thermodynamic
relations governing metabolism (Masse and Droste, 2000). The hydrogen partial pressure
used in the current model is calculated assuming equilibrium from the dissolved
hydrogen concentration divided by Henry’s Law constant. Therefore, the hydrogen
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 65/265
43
partial pressure in this model represents the dissolved hydrogen concentration reported in
the un it o f atm and should not imply gas-liquid equilibrium.
Table 3.2: Kinetic constants used in the model
Reaction3 k
(gCOD/gXCOD/d)
K s
(gCOD/m3)
Y
(gXCOD/gCOD)
b
(d -1)
Sp to S a, Sb, or Sl 49.4b 2 2 .5b 0.07 0 .0 2 d
Sl to S a or Sp 34.6 d 36.5d 0.064 0 .0 2 d
S a to Sm 6 .1 ° 165.0° 0.058c o © L O o
Sp to S a 5.3C 60.0° 0.059° 0 .0 1 °
Sb to S a 5.3C 13.0° 0.067° 0.027°
Sh to Sm 24.7a 0 .0 1 2 d 0 .2 2 d 0.088b
aRefer to Table 3.3
b Pavlostathis and Giraldo-Gomez, 1991
c Lawrence and McCarty, 1969
d Costello et al., 1991b
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 66/265
44
Table 3.3: Symbols for soluble and particulate components (Bagley and Brodkorb, 1999)
Symbol Description
Sc Readily degradable carbohydrate
Ss Slowly degradable complex organic
Si Inert organic compounds (nonbiodegradable)
Sf Readily fermentable monomer; e.g., glucose
Sl Lactic acid
Sb Butyric acid
Sp Propionic acid
S a Acetic acid
Sm Dissolved methane
Sh Dissolved hydrogen
x F Heterotrophic-hydrolytic organisms
X L Lactic acid acidogenic organisms
X B Butyric acid acetogenic organisms
x P Propionic acid acetogenic organisms
X A Aceticlastic methanogenic organisms
X h Hydrogenotropic methanogenic organisms
X s Biodegradable component o f lysed biomass
X i Inert component o f lysed biomass
S, soluble component; X, particulate component; all units in g COD/m
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 67/265
Chapter 4 Model Verification
The current model is based on the model o f Bagley and Brodkorb (1999), which
has been validated (Bagley and Brodkorb, 1999). The new developments for the
hydrogen inhibition and regulation functions described in Chapter 3 are intended to
improve the model predictions o f m icrobial population. This chapter verifies the new
model w ith a wide range o f experimental data from the literature. Long-term model
simulation, including steady-state simulation, is the best way to verify the model
predictions o f microbial growth. The current model simulations o f the experimental data
o f Bagley and Brodkorb (1999) show that the current model maintains the predictive
ability on VFAs, COD, pH, and gas production.
4.1 Model verification with data from Bagley and Brodkorb (1999)
4.1.1 Description of the experimental data
The laboratory AnSBR was fabricated from clear Plexiglass® and Tygon® tubing.
The reactor had a total liq uid volume o f 13 L w ith an internal diameter o f 15 cm. The
reactor was operated with a 12.0 L total liquid volume, 6.0 liter fill volume, and 6.0 liter
settled volume. The reactor was seeded w ith anaerobic sludge from the anaerobic digester
o f the Toronto (Ontario, Canada) Main Wastewater Treatment Plant. The average volatile
suspended solids (VSS) concentration in the reactor was 7000 mg COD VSS/L. The
synthetic wastewater feed consisted o f glucose as the sole COD source, sodium
bicarbonate as alka linity , and necessary nutrients and trace metals. M ixin g was conducted
w ith liquid re-circulation and the reactor was maintained at 22°C (Bagley and Brodkorb,
1999).
45
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 68/265
46
Two different experiments were conducted in the laboratory. The operating
conditions are listed in Table 4.1. The following variables in the reactor were measured
every hour throughout the experimental run: lactic acid, acetic acid, propionic acid,
butyric acid, pH, COD, methane gas production, and total gas production.
Table 4.1: Operating conditions (Bagley and Brodkorb, 1999)
Parameter Case 1 Case 2
Influent concentration (mg CO D/L) 2 0 0 0 4000
Organic loading rate (g COD/L/d) 1 . 0 2 . 0
F ill time (hours) 0.4 0.4
React time (hours) 2 2 2 2
Settle time (hours) 1 . 0 1 . 0
Decant time (hours) 0 . 6 0 . 6
Hydraulic retention time (hours) 48 48
Because in itia l concentrations o f ind ividu al microbial groups are not readily
measured directly, they are normally quantified by fitting the model predictions to
experimental measurements on VFAs, COD, and gas production (Bagley and Brodkorb,
1999; Masse and Droste, 2000; Skiadas et al., 2000). Case 1 served as the base cond ition
for estimating the in itia l biomass concentrations, the unmeasured “ loca l” model input
parameters. The same initial biomass concentrations were then used to simulate Case 2.
Overall COD balance closure was reported for these experimental data (Brodkorb, 1998).
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 69/265
47
4.1.2 Model calibration
Initial biomass concentrations were quantified by fitting the model prediction to
the experimental data on glucose, lactate, butyrate, propionate, and acetate. The Xs was
fixed at 50 mg COD/L follow ing Bagley and Brodkorb (1999) and Xi made up the rest o f
the measured VSS o f 7000 mg COD/L. A grid search method was used (because o f its
sim plic ity) to find the best fi t between the model predictions and experimental data. The
search parameter range was from 0 to 200 mg COD/L and the coarseness o f the grid was
5 mg COD/L. The objective function for the optimization was the minimum residual sum
o f squares between the model prediction and experimental measurements on glucose,
lactate, butyrate, propionate, and acetate. Initial biomass concentrations were (in mg
COD/L): XF, 115; X L, 85; X B, 5; XP, 60; X A, 100; X H, 175; Xs, 50; X,, 6410. The
hydrogen regulation parameters were also determined in this process. The total active
biomass consists o f 7.7% o f VSS. The total active biomass predicted by Bagley and
Brodkorb (1999) w ith the same set o f experimental data was 47.9% o f VSS. Shizas
(2000) reported a value o f 17.4% active biomass for a sim ilar sludge through
experimental measurement. Because anaerobic digester sludge contains a high content o f
non-viable biomass, the total active biomass predicted by the current model is more
reasonable than that by Bagley and Brodkorb (1999).
Figure 4.1 presents the comparison between the predicted and measured COD,
glucose, and total VFA concentrations for Case 1. The model predictions match the
experimental data very well w ith r values ranging from 0.78 to 0.92. Due to the short f il l
time, glucose concentration increased rapid ly w ith a peak value o f about 900 mg COD/L.
The glucose was completely degraded w ithin approximately 4 hours. The total VFA
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 70/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 71/265
49
500
* Acetate
a Butyrate
Propionate
Lactate400
_i
Qg 300
D)E
200&5
I 100
0 84 12 16 20 24
Time (hours)
Figure 4.2: Vo latile fatty acid concentrations vs. time fo r Case 1. Lines - model
predictions; symbols - measurements o f Bagley and Brodkorb (1999).
Similar predictions were made by Bagley and Brodkorb (1999). Though the r 2
values from the current model are lower than those (range from 0.87 to 0.99) o f Bagley
and Brodkorb (1999), the current model maintains the base performance o f the model in
predicting glucose and VFAs.
The comparison between the simulated and measured pH is presented in Figure
4.3. The model prediction matches the measured data very well. The good f it is prim arily
contributed to the good prediction o f VFA concentrations in Figure 4.2, as calculation o f
pH from known acid concentrations is a relatively well understood physical-chemical
process. The initial pH increase is due to the higher alkalinity and lower dissolved carbon
dioxide in the feed. The pH decreased as VFAs accumulated in the reactor and pH
increased again as VFAs were consumed.
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 72/265
50
7.5
xCL
6.5
0 4 8 12 16 20 24Time (hours)
Figure 4.3: pH versus time fo r Case 1. Line - model prediction; symbols - measurements
o f Bagley and Brodkorb (1999).
2.0
_ i
<DE 1.0.3O>COroO 0.5
0.0
0 84 12 16 20 24
Time (hours)
Figure 4.4: Cum ulative gas production versus time fo r Case 1. Lines - model
predictions; symbols - measurements of Bagley and Brodkorb (1999).
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 73/265
51
Figure 4.4 presents the comparison between the simulated and measured
cumulative gas production for methane and carbon dioxide. The model prediction
matches the measured data well.
Hydrogen partial pressure is an important variable for the model; it regulates the
product distribution o f glucose and lactic acid degradation and inh ibits the degradation o f
propionic and butyric acids. Though hydrogen was not measured in the original work, the
model-predicted hydrogen partial pressure is presented in Figure 4.5 for better
understanding o f the model behavior. The hydrogen spikes up quickly as glucose is added
and keeps accumulating until the depletion o f glucose. As a consequence o f the high
hydrogen partial pressure during the degradation o f glucose, lactic acid was the prim ary
product o f glucose degradation (see Figure 4.2). The hydrogen partial pressure dropped
when glucose consumption was complete and remained at the lower level until lactic acid
consumption was complete. The hydrogen partial pressure reached a level o f about
2.2x10- 5 atm after the lactic acid degradation was complete. Although degradation o f
propionic acid produces hydrogen, the hydrogen production rate from propionic acid
degradation was very low because o f the low degradation rate o f propion ic acid
(compared to the rate o f lactic acid and glucose degradation; see Figures 4.1 and 4.2).
Both the current model and the model o f Bagley and Brodkorb (1999) can
simulate the experimental data o f glucose, lactate, and VFAs very w ell w ith adjustable
model input o f in itia l biomass concentrations. Both models predict the pH and gas
production rate well. The two models are similar in predicting the measured constituents.
This is as expected as the measured constituents were the objective o f model
optimization. The major difference between these two models is the model predictions on
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 74/265
52
components that were not measured, such as initial biomass and hydrogen partial
pressure.
2.0E-04
1.5E-04 -
■p1.0E-04 -
? 5.0E-05 -
0.0E+00
0 4 8 12 16 20 24
Time (hours)
Figure 4.5: Predicted hydrogen partial pressure vs. time for Case 1.
The predicted hydrogen partial pressure by Bagley and Brodkorb (1999) has the
same pattern as shown in Figure 4.5, but the current model predicts a lower hydrogen
partial pressure than their model did. For example, the hydrogen partial pressure is about
2.2x10” 5 atm for the current model when the time is greater than 9 hours (see Figure 4.5),
compared to 6 x l0 - 5 atm for their model. As propionate degradation was observed during
that period (see Figure 4.2), the hydrogen partial pressure should be lower than the
thermodynamic lim it o f propionate degradation. Therefore the current model gives a
more reasonable prediction o f hydrogen partial pressure. The initia l spike o f hydrogen
partial pressure is about 10 times less than what was predicted by Bagley and Brodkorb
(1999). This is the consequence o f the changes incorporated in the current model. No data
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 75/265
53
are available to justify which prediction is better. Both models predict that the hydrogen
partial pressure rises during the glucose-consumption phase. However, because the
hydrogen partial pressure was 1 0 times higher in the original model, when the hydrogen
partial pressure is plotted, it looks flatter during the glucose-consumption phase.
For short-term simulation, the effect o f initia l biomass concentration and the
specific substrate utilization rate can be combined as one factor and represented by the
maximum substrate utiliza tion rate.
VmA = kiX i (4-1)
where Vm/ is the maximum substrate utiliza tion rate (g COD /L/d). Maximum substrate
utiliza tion rates, instead o f concentrations o f individu al metabolic groups, were predicted
in the models o f Masse and Droste (2000) and Skiadas et al. (2000). A disadvantage o f
this is that the models can neither be used for long-term simulation nor predict the
microbial growth. Because the specific substrate utilization rates used in the current
model are different than those used by Bagley and Brodkorb (1999), comparison o f
maximum substrate utilization rates (instead o f concentrations o f ind ividual metabolic
groups) between the current model and the model by Bagley and Brodkorb (1999) shows
the difference between these two models. Table 4.2 compares the predicted maximum
substrate utilization rates between these two models. The maximum substrate utilization
rates for glucose and acetate are close for both models. The maximum substrate
utilization rate for hydrogen is higher for the current model, and this explains the lower
hydrogen partial pressure simulated in the current model. The maximum substrate
utilization rates for butyrate, propionate, and lactate are lower for the current model. The
actual substrate utiliza tion rates for glucose, lactate, propionate, and butyrate predicted by
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 76/265
54
the two models were close, as both models were fitted to the same set of data. This
indicates that the original model has lower hydrogen inhibition factors for propionate,
butyrate, and lactate under the conditions examined (the pH inhibition functions are the
same for both models). Both models agree that the low aceticlastic methanogen
concentration in the reactor is the reason for poor acetate degradation in the reactor.
However, the current model predicts that low concentration o f propionate acetogens is
the reason for poor propionate degradation, while the original model predicts that there
are sufficient propionate acetogens in the reactor, but the high hydrogen partial pressure
inhibits the degradation o f propionate. The same argument for propionate applies to
butyrate.
Table 4.2: Predicted maximum substrate utilization rate (g COD/L/d)
Model Glucose Lactate Butyrate Propionate Acetate Hydrogen
Current 5.68 2.94 0.03 0.32 0.61 4.32
Original 5.50 12.50 0.15 3.00 0.38 0.46
4.1.3 Model validation
The in itia l biomass concentrations calibrated in Case 1 were then used to simulate
Case 2 following Bagley and Brodkorb (1999). No modifications to the model parameters
were made except for the influent COD. Figure 4.6 presents the simulated and measured
COD, VFA, and glucose concentrations. Figure 4.7 presents the simulated and measured
results for ind ividua l VFAs. The simulated results generally agree w ith experimental
data, although model predictions for case 2 were sligh tly poorer than for case 1 .
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 77/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 78/265
56
1200
♦ Acetate Propionate
LactateButyrate _i
O 800 oO)E
c/) 400JQ3CO
12 16 20 240 4 8
Time (hours)
Figure 4.7: Vola tile fatty acid concentrations vs. time fo r Case 2. Lines - model
predictions; symbols - measurements o f Bagley and Brodkorb (1999).
0.0003
E03
0.0002 -
c0O)2
* f I
-o 0.0001 -
o'u 2CL
8 12 16 20 240 4
Time (hours)
Figure 4.8: Predicted hydrogen partial pressure vs. time for Case 2.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 79/265
57
7.5
xQ .
6.5
0 4 8 12 16 20 24
Time (hours)
Figure 4.9: pH versus time for Case 2. Line - model prediction; symbols - measurements
o f Bagley and Brodkorb (1999).
6.00
d 4.00 -<DE
O>
g 2.00 -
CH.
0.00
0 4 8 12 16 20 24
Time (hours)
Figure 4.10: Cumulative gas production versus time for Case 2. Lines - model
predictions; symbols - measurements o f Bagley and Brodkorb (1999).
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 80/265
58
4.2 Model verification with data from Kim (2000)
4.2.1 Description of the experimental data
The laboratory AnSBR used by Kim (2000) was the same used by Brodkorb
(1998). The reactor was operated with a 12.0 L total liquid volume, 6.0 liter fill volume,
and 6.0 lite r settled volume. The reactor was seeded with granulated anaerobic sludge
(Champlain Industries, Cornwall, ON). Average volatile suspended solids (VSS)
concentration in the reactor was 10,050 mg COD VSS/L. The synthetic wastewater feed
consisted o f lactose as sole COD source, sodium bicarbonate as alkalinity, and necessary
nutrients and trace metals. M ixing was conducted w ith gas re-circu lation and the reactor
was maintained at 22°C (K im , 2000).
Table 4.3: Operating conditions (K im , 2000)
Parameter Run 1 Run 2 Run 3 Run 4 Run 5
Organic loading rate (g COD/l/d) 2 . 1 2 . 1 2 . 1 2 . 1 2 . 1
F ill time (hours) 9 5 3 1 0 6
React time (hours) 1 5 7 1 2 16
Settle time (hours) 1.5 1.5 1.5 1.5 1.5
Decant time (hours) 0.5 0.5 0.5 0.5 0.5
Total cycle time (hours) 1 2 1 2 1 2 24 24
Hydraulic retention tim e (hours) 24 24 24 48 48
Number o f cycles 9 9 9 3 2
Five separate experimental runs were conducted to evaluate the performance o f
the AnSBR w ith respect to varying operational parameters. The operating conditions are
listed in Table 4.3. These experiments were conducted in order from Run 1 to Run 5. The
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 81/265
59
rector was starved for 1 to 2 days between runs, to allow maximum conversion o f
degradation products to biogas prior to the next run. For Runs 1, 2, and 3, samples were
taken during every other cycle. The measured variables included pH, lactose, glucose,
VFAs, and soluble COD. The hydrolysis substrate utilization rate for lactose measured by
K im (2000) was 109.8 gCOD/gXCOD/d.
4.2.2 Model simulation
Each run was multi-cycle, and a shift in microorganism populations was expected
between runs due to microbial growth and decay. Therefore biomass concentrations
predicted from the previous run were used as initial biomass concentrations for the
current run.
Initial biomass concentrations were predicted by fitting the model prediction to
the experimental data on propionate and acetate only. Data from Run 1 were used for th is
prediction. The measured lactose, glucose, lactate, and butyrate concentrations were
generally very low even during the fill stage. Therefore they were not used in the model
prediction, as a small difference between the predicted and measured values resulted in a
poor r value. Initia l biomass concentrations that provided an optimum f it to the measured
propionate and acetate data were (in mg C OD/L): X F, 115; XL, 85; X B, 5; X P, 60; X A,
100; X h, 175; Xs, 50; Xi, 6410. The most sensitive biomass concentrations for this
optimization are X h and X A.
Figure 4.11 presents the comparison between the predicted and measured
propionate and acetate for Run 1. The model predictions match the experimental data
very w ell with r 2 values o f 0.86 for propionate and 0.78 for acetate. The concentrations o f
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 82/265
60
lactose, glucose, lactate, and butyrate predicted by the model are very low ( < 1 0 mg
CO D/L), which is in agreement w ith experimental data o f K im (2000).
The predicted biomass concentrations from Run 1 were used as input for Run 2
simulations. The input biomass concentrations o f the follow ing runs were from the output
o f its preceding run. Figures 4.12, 4.13, 4.14, and 4.15 present the comparison between
the predicted and measured propionate and acetate for Runs 2 through 5. Overall the
model predictions match the experimental measurements very well. Considering the
length o f the simulation and the w ide range o f operational conditions, the model
predictions are satisfactory. The fit between the model prediction and measurement data
for Runs 2 to 5 can be improved i f the in itia l biomass concentrations are predicted by
optimization. Masse and Droste (2000) identified different initial biomass concentrations
for different tests.
400« Acetate
° Propionate
300 -
u>E 200 -
-§ 100
0 24 48 12072 96
Time (hours)
Figure 4.11: Vo latile fatty acid concentrations vs. time fo r Run 1. Lines - model
predictions; symbols - measurements o f K im (2000).
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 83/265
61
400
Acetate
Propionate
300QOO03
E 200
00oo
0303
CO
■§ 100< Z>
0 24 48 72 96120
Time (hours)
Figure 4.12: Vola tile fatty acid concentrations vs. time for Run 2. Lines - model
predictions; symbols - measurements o f Kim (2000).
600
Acetate
Propionate
oo _ J
§ 400 OO)E,
co 2 0 0JOdcn
0 24 48 72 96 120
Time (hours)
Figure 4.13: Vola tile fatty acid concentrations vs. time fo r Run 3. Lines - model
predictions; symbols - measurements o f K im (2000).
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 84/265
62
Q
OOo>E,
<t>
to
JD
CO
1000
Acetate
Propionate800
600
400
200
0
24 48
Time (hours)
72
Figure 4.14: Vola tile fatty acid concentrations vs. time for Run 4. Lines - model
predictions; symbols - measurements o f Kim (2000).
1000
Acetate
Propionate800
o
8 600 o>E
& 400cc
(/) _Q
w 200
0 24 48
Time (hours)
Figure 4.15: Vo latile fatty acid concentrations vs. time for Run 5. Lines - model
predictions; symbols - measurements o f Kim (2000).
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 85/265
63
Several factors m ight contribute to the discrepancy between the model predictions
and measurement. First, the starvation period between runs was not simulated because the
exact lengths o f each starvation period are not available. Second, sign ificant amounts o f
lactose (influe nt substrate) were detected for Run 2 only (K im , 2000), ind icating an
anomaly in performance during Run 2.
Table 4.4 presents the input biomass composition for each run. The biomass
composition for Run 1 was quantified fittin g the model prediction to the experimental
data. The input biomass o f other runs was the output o f its preceding run. These results
indicate that the shift in microorganism populations is significant for the condition
simulated.
Table 4.4: Input biomass composition fo r each run
Run No. Xs
(%)
X,
(%)
X F
(%)
x P
(%)
X L
(%)
X A
(%)
X H
(%)
1 0.7 29.2 32.0 0.07 1 2 . 1 2 . 6 3.4 19.9
2 6.3 25.0 32.1 0.14 11.3 2.4 5.6 17.1
3 8.9 2 1 . 8 32.2 0 . 2 0 1 1 . 6 2.4 7.3 15.5
4 1 0 . 2 18.3 32.4 0.32 13.2 2 . 6 8 . 6 14.3
5 10.9 16.0 32.7 0.41 13.8 2.7 9.6 13.9
4.3 Model verification with data from Denac et al. (1988)
In the previous sections, the in itia l concentrations o f ind ividual m icrobial
populations were obtained by fitting the model simulation results to experimental
measurements. Though techniques for partitioning the total biomass have been proposed
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 86/265
64
in the literature (Maillacheruvu and Parkin, 1996; Merkel et al., 1999), direct
measurement o f the microbial population d istribution is very d ifficu lt. Fortunately, i f the
reactor was operated under steady state, the concentrations for different microbial
populations can be predicted by steady-state model simulation.
The reactor was a laboratory-scale fluidized bed reactor in the study o f Denac et
al. (1988). The pH was maintained at a value o f 7.0 by the automatic addition o f sodium
hydroxide. The reactor was operating in itia lly under steady-state conditions. Steady-state
operational and performance parameters are summarized in Table 4.5. Some o f the
parameters listed in Table 4.5 are simulated results from the model. The model predicted
VSS microbial population distributions are listed in Table 4.6.
For steady-state simulation, the initial biomass concentrations were set and the
model was run long enough to reach steady state. The solids wasting rate was adjusted to
reach the desired solids retention time. Though the initial biomass concentrations have no
effect on steady-state performance, convergence improves i f they are set at higher values.
Figure 4.16 shows the sim ulation results o f step changes in the influen t substrate
concentration from 2240 mg COD/L to 7839 mg COD/L. This corresponds to an organic
loading rate (OLR) o f 31.4 g CO D/L/d. Figure 4.16 compares the simulation result and
Denac et al. (1988)’s experimental data (from Costello et al., 1991b). The model gives a
reasonable prediction o f acetic and butyric acid, but poor prediction o f prop ionic acid.
Costello et al. (1991b) have simulated Denac et al.’s (1988) experiment. Compared to the
study o f Costello et al. (1991b), where only trends o f VFA accumulation were predicted,
the current model improves the predictions o f acetate and butyrate significantly.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 87/265
65
Table 4.5: Steady state operational and performance parameters
Parameter Value
Liquid volume1 (L) 3.6
Gas volume1 (L ) 0.425
Temperature1 (°C) 35.0
Liquid residence time1 (day) 0.25
Reactor pH 1 7.0 (constant)
Influent glucose1 (mg COD/L) 2240
Organic loading rate (g/L/d) 8.96
Solids retention time1 (day) 1 1
Volatile suspended solids2 (g COD/L) 16.4
Effluent acetate2 (mg COD/L) 73.2
Effluent propionate2 (mg COD/L) 57.6
Effluent butyrate2 (mg COD/L) 5.7
Experimental conditions (Data o f Denac et al., 1988; From Costello et al., 1991b).
2 Model prediction.
Table 4.6: Predicted steady-state microbial population distributions
Xs X, X F x P X L X B X A X H
(%) (%) (%) (%) (%) (%) (%) (%)
14.6 3.4 34.3 3.1 10.9 2.3 13.3 18.1
The discrepancy between the simulated and experimental concentration o f
propionate might be attributed to the initial steady-state condition simulated, which was
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 88/265
66
not verified because data are not available. The model fi t can be improved i f the in itia l
biomass concentrations are obtained by optimization.
1500
♦ acetate ° propionate x butyrate
O)E 1000co»
2+Jcd)ocoo
500
240 48 72
Time (hours)
Figure 4.16: Comparison between the simulated and experimental results for the
accumulation o f organic acids (Denac et al., 1988; Costello et al., 1991b).
A common disadvantage among the models in the literature is that the models are
applied to dynamic situations without being validated for steady-state conditions. For
example, Costello et al. (1991b) and Batstone et al. (2000b) did not report any model
prediction for steady-state conditions. A reasonable sequence is that the model is
validated with steady-state conditions first, and then it is applied to dynamic situations,
such as shock loading and a single AnSBR cycle. The fo llow ing chapter is an effort to
validate the model w ith steady-state reactor performance data.
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 89/265
Chapter 5 Rate Limiting Step of Anaerobic Treatment
Anaerobic treatment involves multiple series and paralle l reactions converting
complex substrates to end products. These reactions proceed at different rates; some
reactions are fast, while others are slow. Identifying the rate lim iting step is important for
the design organic loading rate o f anaerobic reactors. For example, i f the rate lim iting
step is oxygen gas transfer fo r aerobic treatment, the design organic loading rate w ill
depend on the oxygen gas transfer rate. The rate lim iting step is also important fo r the
modeling o f anaerobic processes. With the rate lim iting step identified , the model can be
simplified without sacrificing its predictive ability. More attention should be paid to
modeling the rate lim iting step, thus providing better model performance.
For anaerobic digestion, when suspended solids are the main source o f COD,
hydrolysis is often the rate-lim iting step (Gossett and Besler, 1982). The suspended solids
must be hydrolyzed into simpler molecules prior to being degraded by the acetogenic
microorganisms. For high rate anaerobic treatment, when the substrate is prim arily
composed o f soluble components, many researchers proposed that aceticlastic
methanogenesis is the rate lim itin g step, due to the fact that aceticlastic methanogens are
slow growing bacteria (Andrew s and Graef, 1971; Henze and Harremoes, 1983).
However, propionate buildup had often been observed as the firs t sign o f reactor overload
(Bjonsson et al., 1997). This implies that aceticlastic methanogenesis may not be the rate
lim iting step for high rate anaerobic treatment.
Anaerobic sludge is a m ixed culture o f many metabolic groups o f bacteria. The
degradation rates are a positive function o f the amount o f active biomass o f each
ind ividua l group present in the sludge. Therefore, the rate lim iting step is strongly related
67
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 90/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 91/265
69
where b, is the decay constant o f microorganism group X, (d-1).
Equation 5.2 is applicable for the overall anaerobic degradation. Therefore the
solid retention time can also be written as
(53)
where X t is the total solids in the system (g COD/L); et is the overall removal efficiency;
Lt is the total organic loading rate (g COD/L/d); Yt is the overall yield (g COD VSS/g
COD); and bt is the overall decay constant (d_1).
Equation 5.3 is an equivalent o f the general expression o f solids retention time for
a CSTR at steady-state, which is w ritten as (Pavlostathis and Giraldo-Gomez, 1991):
6 x = ----- (5.4)UYt-bt
where U is the specific substrate utiliza tion rate and is written as
U = - ^ — (5.5)K s + S
A t steady state, substrate loading rate equals substrate u tilization rate, hence
£tLt - UXt (5.6)
Therefore, Equation 5.3 can be converted to Equation 5.4. Equation 5.3 emphasizes the
aspect that the availability o f substrate lim its the growth rate o f microorganisms. This is
important fo r the analysis o f anaerobic processes, as some metabolic groups, such as
lactate acetogens, have high substrate utilization rates but the substrate is limited.
From a mass balance on solids,
X t ^ X i (5.7)i
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 92/265
70
and
btX t = '£ b iX i (5.8)i
However,
Lt ^ (5.9)i
and
(5.10)i
The loading rates may be counted more than once because products are not being
subtracted. In other words, on a loading rate basis, in all likelihood:
H L i > L t (5.11);
For the completely mixed anaerobic system, each metabolic group in the reactor
has the same solids retention time and is the same as the overall solids retention time.
Therefore, the follow ing relationship holds
^ ^ -------- (5.12)S i L ^ - b i X i £t L t Yt —btX t
Equation 5.12 is rewritten as
^ f L - b i = ^ f L - b t (5.13) A i A t
The decay rates o f each metabolic group are very close. In consideration o f Equations 5.7
and 5.8, it is expected that bt is o f the same magnitude as b,. To s im plify the analysis, it is
assumed that bt = bt (the influence o f this assumption is minimized fo r the estimation o f
maximum SOLR, as bt is negligible when L t / X t is large), and that all substrates are
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 93/265
71
completely consumed, which means £[=1 and st = \ . Therefore equation 5.13 is
simplified to
X. = ' ' X, (5.14)l j ,
Equation 5.14 indicates that the fraction o f an individu al metabolic group is
proportional to the product o f substrate and growth yield for an anaerobic system,
because in anaerobic systems different groups o f bacteria consume different substrates.
This is not the case when d ifferen t groups o f bacteria compete for the same substrate. In
that case the fraction o f an individual group o f bacteria is proportional to the maximum
specific growth rate // (Henze and Harremoes, 1983). An example o f the latter is the
denitrification process.
Now define
L i = f i L t (5.15)
where f is the fraction o f total COD that is consumed as the constituent o f interest. For
example, f i is the fraction o f total COD that is consumed as lactate
( f i = Yrhod (1 - Yp )7/m-i X where Yp is the yield o f heterotrophic-hydrolytic organisms (g
COD VSS/g COD) and Yphod is the theoretical product yield (see Bagley and Brodkorb,
1999). For lactate production from glucose, Yrhotj = 1. X f ) * 1 because fo r fermentative
organisms, f p = 1. The biomass mass balance closes, however, because Yp accounts for
the fact that incom ing COD is transformed into both biomass and products.
A t steady state, the overall degradation rate Dt must be greater than or equal to the
overall loading rate Lt. Otherwise substrate w ill accumulate. The same is true for every
intermediate, therefore, at steady state
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 94/265
72
D; > L; (5.16)
where D, is the degradation rate (g COD/L/d).
The general form o f D, can be expressed as
Di = ViUfXt (5.17)
where iji is an inhibition factor; and U, is the specific substrate utilization rate as
expressed in Equation 5.5 (g COD/g COD VS S/d).
Combining Equations 5.16 and 5.17 gives
where Bx is the SOLR (g COD/ g COD VSS/d).
Equation 5.20 describes the lim itation imposed on the SOLR by an ind ividu al
intermediate degradation product in the multi-step anaerobic process. For the successful
operation o f the anaerobic process, the condition described by Equation 5.20 must be
maintained for every constituent.
The loading lim itatio n expression for any substrate can be readily determined
using Equation 5.20. Table 5.1 (column 2) presents the SOLR lim itation expression for
each major substrate in the anaerobic system. The pH inhibition term is not included as
ViU iXi > Lt (5.18)
And substituting Equation 5.14 into Equation 5.18 gives
(5.19)
Equation 5.19 is further s implified to
(5.20)
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 95/265
73
neutral pH could be maintained. However, the hydrogen partial pressure inhibition term
r/i cannot be neglected.
The hydrogen inhibition function for propionate degradation was derived in
Chapter 3 and is written as
V l x i x p -1 A P ^ *H2
K I , H 2 X P
(5.21)
ConsideringK p + S P
<1, the SOLR (Bx) lim itation equation for propionate can be
written as
/ \ 3 ~
< ^ k P 1 -
P 1 H I
Y, y K / H 2XP ,(5.22)
Other equations are simplified appropriately and are presented in the third column
o f Table 5.1.
Table 5.1: Lim itation on individua l substrate degradation
Substrate Lim itation Equation Sim plified Lim itation Equation
HydrogenBx <
Y H k H S H
Yt K h + S hB x <
Y H k H S H
Yt K h + S h
Propionic acid Yp kpS p
Bx-Tl Y ^ Pn,-H2xe 1 -( P 1H2
K, H2XP
Acetic acidBx <
Y a kASA
Yt K a + S a
Butyric acid Yb kBSB x v v P l , H 2 X B
r t k b + ^ bB.r 4 * <
\ 2
H 2
V I ,H2XB y
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 96/265
74
3
COif)>
0
DB
0 0.00005
Hydrogen Partial Pressure (atm)
0.0001
Figure 5.1: Lim itation on specific organic loading rate imposed by ind ividua l
constituents. Letters are described in the text.
Figure 5.1 plots the SOLR (Bx) versus hydrogen partial pressure according to the
sim plified lim itation equations in Table 5.1. Except Yt, all parameters in those equations
were reported earlier in Chapter 3. Y, is 0.18 gXCOD/gCOD (Pavlostathis and Giraldo-
Gomez, 1991). Line H is the upper lim it o f SOLR for hydrogen degradation. A t very low
substrate concentration the Monod equation becomes first order, therefore the upper lim it
o f SOLR for hydrogen consumption is a positive linear function o f the hydrogen partial
pressure; in other words the hydrogen degradation rate increases with the increase o f
hydrogen partial pressure in the reactor. Line P is the upper lim it o f SOLR fo r propionate
degradation. The upper lim it o f SOLR fo r propionate decreases w ith the increase o f
hydrogen partial pressure and is close to zero when the hydrogen partial pressure reaches
the thermodynamic lim it for propionate degradation. Line B is the upper lim it o f SOLR
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 97/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 98/265
76
determined fo r a ±10% change in each parameter. The results o f the analysis are
presented in Table 5.2.
Table 5.2: Sensitivity analysis o f model parameters on estimated maximum SOLR1
Parameter kH K h Y h Y t Y P kp K i,H2XP
Change 10% 1.04 0.89 1.04 0.89 0.98 0.98 1.04
Change -10% 0 . 8 8 1.05 0.87 1.08 0.94 0.94 0 . 8 8
The hydrogenotrophic methanogens have a very high maximum specific substrate
utilization rate compared to the hydrogen production rate in an anaerobic system.
Normally the hydrogen level can be kept very low in an anaerobic system and the
degradation o f hydrogen is kept in the first-order region o f the Monod equation. For an
anaerobic reactor operated under steady state, the hydrogen production rate equals the
hydrogen consumption rate, therefore the following relationship holds
y H k H s H
Bx = (5.23)Yt K h + S h
Figure 5.2 plots hydrogen partial pressure versus SOLR. Figure 5.2 illustrates the
operation o f an anaerobic system under steady state. The ac tivity o f hydrogen consuming
methanogens determines the hydrogen level in the reactor. When SOLR is low, the
reactor w ill be operated at a low hydrogen level. W ith the increase o f SOLR, the
hydrogen level increases along the line in Figure 5.2. In other words, the anaerobic
system responds to an increase in SOLR by increasing the hydrogen level. The hydrogen
degradation rate depends strongly on the hydrogen concentration in the reactor, w ith a
higher hydrogen concentration leading to a higher hydrogen degradation rate. When the
SOLR is lower than or equal to the critical point C shown in Figure 5.1, all other
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 99/265
77
microbial groups are able to completely consume their substrates. When the SOLR is
higher than the critical value, the elevated level o f hydrogen partial pressure inhib its the
degradation o f propionic acid. The propionate acetogens in the system w ill not be able to
completely consume the propionate produced in the system. Many researchers have
shown that build-up o f prop ionic acid is the first sign o f reactor overload (Bjonsson et al.,
1997). Therefore, propionate degradation is the rate-lim iting process for anaerobic
treatment.
0.0001
_ 0.00005 -
O)
-O
2 310
SOLR (g COD/g COD VSS/d)
Figure 5.2: Hydrogen partial pressure versus SOLR.
Figure 5.1 also predicts the responses o f an anaerobic system under differen t
levels o f overloads. When the reactor is subject to low-strength overload (the SOLR is
greater than 0.9 mg COD/ mg COD VSS/d (point C) but less than 1.9 mg COD/mg COD
VSS/d (point D)), propionic acid w ill be the primary COD in the effluent, w hile acetic
acid and butyric acid in the effluent w ill be low. When the reactor is subject to severe
overload (the SOLR is close to or greater than 1.9 mg COD/ mg COD VSS/d), the
concentrations o f all VFAs w ill be high in the effluent.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 100/265
78
The hydrogen inhibition function derived in this study (Equation 5.21) was used
in the analysis above. I f the hydrogen inhib ition function used by ADM 1 (Batstone et al.,
2002) is applied, the conclusion about the rate-lim iting step w ill be the same. However,
the estimated maximum SOLR w ill be 0.13 g COD/g COD VSS/d, assuming that other
parameters remain the same. This value is much lower than the reported value o f Fang
and Chui (1993). This also confirms that the hydrogen inhibition function used by ADM 1
is inappropriate.
5.2 Microbial population distribution
The glucose degradation products are distributed among acetate, propionate, and
butyrate. Some models (Batstone et al., 2002; Skiadas et al., 2000; Merkel et al., 1999)
use constant coefficients to model the product distribution. Other models (Mosey, 1983;
Costello et al., 1991a; Bagley and Brodkorb, 1999; Masse and Droste, 2000) suggest that
the product distribution coefficients vary w ith hydrogen partial pressure in the reactor. In
both cases the coefficient values have to be determined. Equations 5.14 and 5.15 relate
the fraction o f a metabolic group dire ctly w ith its correspondent substrate loading rate.
Therefore the production and consumption rate o f an intermediate product, such as
propionate and butyrate, can be estimated from the microb ial population distributions o f
the sludge. This provides a method to verify the product distribution coefficients
(constant or a function o f hydrogen partial pressure) used in the model. It is very d ifficu lt
to directly measure the individual metabolic groups in the mixed culture. However, the
fraction o f a metabolic group can be estimated from a sludge activ ity test, which is easy
to perform. The sludge activity can be related to the specific substrate utilization rate k as
SA, = M i (5.24) A t
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 101/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 102/265
80
Table 5.3: Comparison o f anaerobic sludge activity (g substrate/g VSS/d)
Hydrogen Propionate Acetate Glucose
Measurement1 0.40 0.13 0.91 1.99
Prediction 0.49 0.15 1.39 2 0 . 0
Shen and Guiot (1996).
Table 5.4 compares other reactor performance data between the model prediction
and measurement (Shen and Guiot, 1996). In general the model prediction agrees well
w ith the measurements. The predicted biomass washout rate is lower than the measured
value, indicating that the yield and decay values for the model which were determined
from other data (Table 3.2) may not be completely appropriate for these experiment
conditions. The amount o f alka linity added was not reported. The input a lka linity was
adjusted to maintain the simulated reactor pH the same as the reactor pH value reported.
Table 5.4: Comparison o f reactor performances
Item Measurement1 Prediction
pH 6.78 6.79
COD removal rate (%) 95.4 97.7
Biomass washout rate (g VSS/L/d) 0.52 0.23
CH4 in the biogas (%) 43.6 52.8
CO2 in the biogas (%) 49.1 44.5
Gas flow rate (L/d ) 8.49 10.28
CH4 yield (% CODin) 64.1 8 6 . 6
Shen and Guiot (1996).
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 103/265
81
Table 5.5: Predicted microbial population distributions
SRT
(d)
SOLR
(g COD/g COD VS S/d)
Xs
(%)
x ,
(%)
X F
(%)
x P
(%)
x L
(%)
X B
(%)
x A
(%)
X H
(%)
100 0.10 16.6 25.5 29.8 2.9 6.6 1.3 9.3 8.0
50 0.13 18.4 15.2 33.1 3.1 7.6 1.6 10.9 10.1
10 0.35 15.7 4.1 34.3 3.1 10.2 2.2 13.3 17.1
8 0.42 14.6 3.4 34.3 3.1 10.9 2.3 13.3 18.1
Table 5.5 shows the simulation results o f microb ial population d istribu tion under
different SOLRs and SRTs. The reactor was assumed to be a continuous reactor, and
glucose was the sole COD source for these simulations. The SOLR affects the
distribution o f m icrobial populations. The reactor with a lower SOLR w ill have lower
biomass production and wasting rates and relatively high biomass concentration.
Therefore, lower SOLRs mean a longer solids retention time at steady state. It is known
that for anaerobic digesters w ith long solids retention times, a considerable portion o f the
digester VSS content is non-viable biomass (Skiadas et al., 2000). This is in agreement
with the prediction in Table 5.5.
The microbial population distributions in Table 5.5 are also in agreement with the
kinetic data reported by Aguilar et al. (1995). They measured the kinetic data for the
degradation o f VFAs by glucose pre-grown sludge, which was from a continuous
laboratory digester operating at 18 days o f hydraulic retention time and fed fo r three
years w ith synthetic medium containing glucose (10 g/L). They reported that the
maximum substrate utilization rates (Vm = kX) by 50 mL o f sludge were 46.8 m g/L/h
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 104/265
(49.92 mg C OD/L/h) for acetic acid and 11.84 mg/L/h (17.92 mg CO D/L/h) for propionic
acid (the VSS was not reported). It can be deduced from Equation 5.24 that
This ratio is in agreement w ith the predictions shown in Table 5.5.
Sludge methanogenic activ ity (SM A) reflects the potential o f anaerobic sludges to
convert soluble substrate into methane and carbon dioxide. The substrate used for the
SM A test is usually acetate or a mixture o f VFAs (James et al., 1990). The SMA o f the
sludge can be calculated as follows i f the substrate is acetic acid:
where SMA is the sludge methanogenic activity (L CHVgVSS/d).
James et al. (1990) measured the SMAs o f the sludge from 5 UASB reactors, 3
treating medium-strength wastewaters and 2 treating low-strength wastewaters. They
reported that the SMAs were in a range o f 0.20-0.40 L CHVg VSS/day. Because the
simulations cannot be applied to those reactors. However, the SMAs calculated for the
sludges in Table 5.5 range from 0.28 to 0.40 L CHTgVSS/d respectively, which is in
agreement with the measurement o f James et al. (1990).
kAX A = 49.92 = . g(5.25)
kpXp 17.92
and
(5.26)
(5.27)
detailed operational conditions o f the reactors (James et al., 1990) are not available, d irect
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 105/265
83
5.3 Discussion
As was pointed out in Chapter 1, some models (Costello et al., 1991a; Bagley and
Brodkorb, 1999) predict very low concentrations o f propionate acetogens (XP) in the
sludge. Equation 5.14 explains this problem. Those models used a product regulation
function for glucose degradation that produces very little propionate under low hydrogen
partial pressures, which is the normal operational condition o f an anaerobic reactor.
Using the regulation equations and parameter values provided in Costello et al. (1991a)
and Costello et al. (1991b), it can be estimated that the fraction o f total COD that is
consumed as propionate (fp) is 0.00045 (neglecting growth) when the hydrogen partial
pressure is l.OxlO - 5 Pa, and is 0.032 when the hydrogen partial pressure is l.O x ltT 4 Pa. If
fp =0.00045, then X p / X t =0.00015 by Equations 5.14 and 5.15 using the yield
coefficients o f the current model.
The ADM1 (Batstone et al., 2002) uses fixed regulation parameters (independent
o f hydrogen partial pressure). The recommended stoichiometric yie ld for propionate
(fpro.su ) is 0.27. The f P w ill be sligh tly lower than 0.27 when growth is considered. I t can
be estimated that X p / X t is around 0.09 for the ADM1 model. This value is close to the
value predicted in Table 5.5.
The ha lf velocity constant o f propionate degradation is low er than that o f acetate
degradation. Under normal operating conditions (when the reactors are not overloaded),
the effluent contains more acetate than propionate. This might mislead researchers to the
conclusion that aceticlastic methanogenesis is the rate lim iting step.
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 106/265
84
5.4 Conclusions
The following conclusions are made from these simulations:
1. The rate lim itin g step for high rate anaerobic treatment is propionate degradation.
2. The maximum SOLR is estimated to be near 0.97 gCOD/ gCOD VSS/d, but it is a
function o f the specific k inetic constants, yields, and hydrogen inh ibition function
used. The maximum organic loading rate w ill depend on the amount o f active
sludge a reactor can retain.
3. The sludge microb ial population distribution is a reflection o f the amount of
intermediate product produced and consumed. Therefore it is useful for choosing
appropriate glucose degradation product distribution coefficients.
4. The model provides a good prediction o f m icrobial population distributions.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 107/265
Chapter 6 Simulations of the Startup of Anaerobic Reactors
6.1 Introduction
The startup process is very important fo r the operation o f anaerobic reactors and
has been investigated by many researchers (Morvai et al., 1992; Ghangrekar et al.,
1998;Tay and Yan, 1996). Most o f these studies were laboratory examinations, and these
studies enhance the understanding o f the startup process.
The seed sludge for startup o f anaerobic reactors is normally from an anaerobic
sludge digester because o f its a va ilab ility. The anaerobic sludge digester biomass
contains a considerable portion o f non-viable biomass (Skiadas et al., 2000), and the main
reasons for this are as follows: First, there is a large amount o f inert biosolids in the feed
to an anaerobic sludge digester. The inert biosolids m ix w ith the active biomass in the
digester and decrease the percentage o f active biomass in the sludge. Second, anaerobic
sludge digesters are operated under long solids retention times and low specific organic
loading rates.
The startup o f anaerobic reactors is a process to achieve its design organic loading
rate. From Chapter 5, it is known that the maximum organic loading rate is related to the
amount o f active biomass in the reactor. Therefore, the startup o f an anaerobic reactor is a
process o f accumulation o f active biomass. This can be done by im prov ing the quality o f
the sludge (percent o f active biomass in the sludge) and increasing the quantity o f sludge
(amount o f sludge retained in the reactor). The quantity o f sludge a reactor can retain is
strongly related to the settling characteristics o f the sludge. The seed sludge from an
anaerobic sludge digester is flocculent sludge, which has very poor settleability. More
85
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 108/265
86
sludge can be retained in the reactor only when the sludge in the reactor is granulated,
since granulated sludge has very good settling characteristics.
The SMA represents the percentage o f aceticlastic methanogens in the sludge.
Aceticlastic methanogenesis is the last step o f the series o f reactions happening in
anaerobic degradation. The growth o f aceticlastic methanogens indicates the growth o f
other groups o f bacteria as well. Therefore, the SM A could be a good indicator o f the
total active biomass in the sludge. On the other hand, sludge activity on glucose may not
be a good indicator for the total active biomass, because latter reactions may not proceed.
The improvement o f sludge quality during the startup process is simulated in this
chapter. This s imulation confirms the predictive ability for m icrobial growth o f the
current model. The granulation process is not simulated but some postulates are presented
in the discussion section.
6.2 Simulation of the startup of UASB reactors
The seed sludge composition used in the following simulations is shown in Table
6.1. This composition was predicted in Chapter 4 using the experimental data by
Brodkorb (1998).
Table 6.1: Predicted seed sludge composition
Xs (%) X, (%) X F(%) X P(%) X L (%) X B (%) X A (%) X H (%)
0.71 91.57 1.64 0 . 8 6 1 . 2 1 0.07 1.43 2.5
Tay and Yan (1996) examined microbial granulation in UASB reactors. The
synthetic wastewater they examined contained glucose, peptone, and meat extract as
carbon sources. The seed sludge was from an anaerobic sludge digester. The startup
operation was guided by maintaining a high microb ial load index o f about 0.8. The
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 109/265
87
microbial load index is defined by the ratio o f the specific organic loading rate applied to
the specific methanogenic activity measured. The reactor was operated for 6 months. The
influent CODs were 1000, 2000, 5000, and 10000 mg/L, but only the run with 1000 mg/L
influent COD was simulated in the following. The initial sludge concentration was 6.06 g
YSS/L. The sludge concentration was 6.5 g VSS/L after 30 days, 9.0 g VSS/L on day 90,
and 18 g VSS/L at the end o f the operation. The pH was 6.85. Table 6.2 lists the loading
history fo r the 6 months operation.
Table 6.2: OLR and HRT (from Tay and Yan, 1996)
Day 0-4 5-17 18-32 33-74 75-127 128-180
HRT (hour) 28 18 8 4 2 . 8 2
OLR (g COD/L/d) 0 . 8 6 1.3 3 6 8 . 6 1 2
A model s imulation was conducted for this experimental run. Figure 6.1 compares
the simulated and measured SMA during the startup o f the UASB. The model predicts
the improvement o f SM A during startup time very well. The discrepancy between the
model simulation and measurement might be attributed to the seed sludge composition
used in the simulation. Tay and Yan (1996) reported the SMA o f the ir seed sludge was
0.02 L CH4/g VSS/d. The SMA o f the seed sludge in Table 6.1 is 0.04 L CH4/g VSS/d.
Tay and Yan (1996) also examined 2000, 5000, and 10000 mg/L influent COD
with the same startup strategy. The 10000 mg/L run was interrupted because o f sludge
washout caused by an overnight fast-running pump. Both the simulation and
experimental results for 2000 and 5000 mg/L influent COD are almost the same as for
1000 mg/L influent COD (Figure 6.1), though the operating conditions were different;
therefore, they are not shown.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 110/265
88
0.8
5 n f i -■
o
— Simulation
° Experiment
0
0 30 60 90 120 150 180
Time (days)
Figure 6.1: Comparison o f specific methanogenic activ ity during reactor startup (Data
from Tay and Yan, 1996).
Ghangrekar et al. (1998) investigated the effect o f loading rate on the startup time
o f a UASB reactor. The synthetic wastewater contained sucrose as the carbon source. The
inoculum was from an anaerobic sludge digester. The reactors were operated at a constant
OLR and SOLR during operation for about 90 days. The pH in the reactor was
maintained at 6 .8 . The OLR and SOLR values were in the range 1.5 to 9.0 g COD/L/d
and 0.1 to 0.6 g COD/g VSS/d, respectively. The time o f startup was the time required fo r
each reactor to achieve steady-state COD removal e fficiency (Ghangrekar et al., 1998).
Table 6.3 summarizes the simulation conditions and results. The measured startup
times by Ghangrekar et al. (1998) are also listed in Table 6.3 for comparison. They are in
good agreement w ith simulation. Figure 6.2 plots the simulated effluent COD versus time
during startup operation.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 111/265
89
Table 6.3: Startup time simulation conditions and results
Simulation No. SI S2 S3 S4 S5
SOLR (g COD/gVSS/d) 0 . 1 0 . 2 0.26 0.3 0 . 6
OLR (g COD/l/d) 1.5 3.0 4.0 4.5 9.0
Influent COD (mg/L) 1 0 0 0 1 0 0 0 2 0 0 0 3000 3000
Hydraulic retention time (hour) 16 8 1 2 16 8
Initial sludge concentration (gVSS/L) 15 15 15 15 15
Simulated startup time1 (day) 15 2 0 23 25 55
Experimental startup time2 (day) 16, 2 0 2 1 , 2 1 19,21,22 30,50 45,45
Model prediction
M ultip le measurements by Ghangrekar et al. (1998)
2000
_iQO
OCT>E
'g 10004-»
5-t-*c0ocoO
0 10 20 30 40 50 60
Time (days)
Figure 6.2: Predicted effluen t COD during startup. From bottom to top: S I, S2, S3, S4,
S5.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 112/265
90
6.3 Simulation of the startup of AnSBRs.
A startup simulation was conducted fo r an AnSBR. The simulation conditions are
presented in Table 6.4. The seed sludge was assumed to be the anaerobic digester sludge
as shown in Table 6.1 and glucose was assumed to be the carbon source. The startup
strategy was as follows. The initial OLR was 0.5 g/L/d. When the effluent COD
concentration was below 150 mg COD/L, the OLR was increased to 1.0 g/L/d. From then
on, the OLR was increased by an increment o f 1.0 g/L/d by increasing the influent COD
when the effluent COD was below 150 mg/L. The target VSS concentration was 11,000
mg COD/L.
Table 6.4: Simulation conditions
Parameter Value
Cycle length (hours) 24
F ill time (hours) 12.5
React time (hours) 1 0
Settle time (hours) 1
Decant time (hours) 0.5
HRT (hours) 48
F ill volume (L) 6
Settle volume (L) 6
Initial VSS (mg COD/L) 7,000
Target VSS (mg COD /L) 1 1 , 0 0 0
Target organic loading rate (g COD/L/d) 5.0
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 113/265
91
Table 6.5 presents the s imulation results o f startup time requirement for the
AnSBR. It can be seen from Table 6.5 that it takes a longer time to reach the target
effluent criteria for the initial startup period. The time requirement decreases with the
follo w ing stepwise increase o f organic loading rate. For example, it took 13 days to
upload the reactor from 1 g COD/L/d to 2 g COD/L/d, w hile it took only 5 days to upload
from 4 g COD/L/d to 5 g COD/L/d.
Table 6.5: Startup time requirement
OLR (g COD/L/d) 0.5 1 . 0 2 . 0 3.0 4.0 5.0
Loading duration (days) 3 14 13 9 6 5
Figure 6.3 illustrates the improvement o f SMA over time during the startup
process. Comparing Figures 6.1 and 6.3, it can be seen that the simulation results for
SM A versus time are very close for the UASB and AnSBR even though d ifferent startup
strategies have been used. An implica tion o f this is that AnSBRs m ight have a startup
time requirement very close to UASBs. Another imp lication is that the startup o f an
anaerobic reactor can be accomplished by monitoring the effluent COD instead o f
monitoring the SMA. Measuring effluent COD is easier than measuring SMA, so the
startup process can be simplified.
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 114/265
92
0.8
§ 06 co >.O)
f 0.4 O
_i
<0.2
co
100 150500
Time (days)
Figure 6.3: SMA versus time fo r the startup o f an AnSBR.
6.4 Discussion
The SM A o f digester sludge is about one twentieth o f the SM A o f high rate
anaerobic reactor sludge (Tay and Yan, 1996). The estimated maximum SOLR for a high
rate anaerobic reactor is 0.97 g COD/ g COD VSS/d (Chapter 5). Therefore the maximum
SOLR applied to the in itia l period o f anaerobic reactor startup should be about 0.05 g
COD/g COD VSS/d, otherwise the growth o f propionate acetogens w ill be inhibited. The
optimal OLR applied to the in itia l period o f anaerobic reactor startup depends on the VSS
concentration in the reactor. As reactor startup is a matter o f accumulation o f active
biomass, the OLR applied during the startup time should be high for maximum
microorganism growth. On the other hand, overload should be avoided so that the growth
o f microorganisms is not inh ibited. This is in agreement with the startup strategy
proposed by Tay and Yan (1996).
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 115/265
93
The accumulation o f active biomass through increasing the percentage o f active
biomass in the sludge is simulated above. The tota l amount o f sludge in the reactor can be
increased significantly when the sludge is granulated. The following discussion shows
that these two processes may be related; it is postulated in the following that granulation
is a consequence o f the increase o f the percentage o f active biomass in the sludge.
Granulation is a process in which a flocculent biomass, which is a conglomerate
w ith a loose structure, forms w ell-defined pellets or granules, which are packed densely
(W irtz and Dague, 1996). MacLeod et al. (1990) reported that granules were three-
layered structures. The internal core o f the granules was composed mainly o f aceticlastic
methanogens. The middle layer consisted o f hydrogen producing acetogens and hydrogen
consuming methanogens. The exterior layer o f the granules contained acidogens and
hydrogen consuming methanogens.
The complete mechanism o f granulation is not completely understood, though
many theories fo r granulation have been proposed in the literature (Tay et al., 2000). I t is
reported that the reactor liquid surface tension, substrate composition, and hydraulic
condition (up-flow velocity o f UASB) a ffect the granulation process (Grootaerd et al.,
1997; Thaveesri et al., 1995; O’Flaherty et al., 1997). Many investigations in the
literature focus on enhancement of the granulation process. I t is reported that polymer
addition enhances the granulation process (Ong et al., 2002; W irtz and Dague, 1996).
Sludge granulation has been widely observed in high rate anaerobic reactors with
different configurations. However, sludge granulation does not happen in anaerobic
sludge digesters. The major difference between high-rate anaerobic reactor sludge and
anaerobic digester sludge is that the anaerobic digester sludge contains a high content o f
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 116/265
94
non-viable biomass. It is reasonable to postulate that anaerobic digester sludge has the
driving force to be granulated. What prevents anaerobic digester sludge from granulation
is its high content of non-viable biomass. The high content of non-viable biomass of
digester sludge is due to the inert biomass in the feed. When the sludge is fed w ith
soluble substrate and has sufficient time for growth, granulation is a natural process for
anaerobic sludge. This postulate is in agreement w ith the experimental results o f Tay and
Yan (1996). Their experimental results indicate that granulation initiated after about 30
days o f operation when the SM A is increased (Figure 6.1).
The model does not differentiate between granulated sludge and flocculent
sludge. For granulated sludge, mass transfer might have significant effect on the substrate
utilization rates (Pavlostathis and Giraldo-Gomez, 1991). The model is applicable to
granulated sludge w ith the assumption that the mass transfer is not the rate-lim iting step.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 117/265
Chapter 7 Modeling of the Gravitational Settling Process
The gravitational settling model presented in this chapter is stimulated from the
need for a batch settling model for the settle stage o f AnSBRs. This model is valuable fo r
design and operation o f secondary settlers, the most popular application o f gravitational
settling in the activated sludge treatment process. This model may also be applicable for
predicting the solids profile in UASBs, which is an important aspect o f UASB reactor
design (Narnoli and Mehrotra, 1997).
Secondary settlers are the most sensitive parts o f the activated sludge treatment
process (Chancelier et al., 1997). The design o f a secondary settler includes the
specification o f a surface area and depth (Ekama et al., 1997). The design criterion for
settler surface area and its underlying principle, i.e., the solids flux theory, have been
extensively studied in the literature (Ekama et al., 1997). In contrast, studies on
secondary settler depth requirement are lim ited. Some design rules, such as the design
rules recommended by the Institute for Water Pollution Control (IWPC (SA Branch),
1973) and the Great Lakes and Upper Mississippi R iver Board o f State Sanitary
Engineers (GLUMRB, 1968), did not even include a design criterion fo r secondary settler
depth (Ekama et al., 1997).
The Abwassertechniche Vereinigung (ATV, 1976) procedure presented the most
detailed design criterion fo r the secondary settler depth (Ekama et al., 1997). In this
procedure the depth o f the secondary settler was viewed as fou r horizontal layers o f
different depth: (1) the clear water zone, (2) the separation zone, (3) the sludge storage
(zone settling) zone, and (4) the thickening zone. In this procedure, the thickening zone
depth is calculated empirically; it is calculated from the volume fraction occupied by the
95
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 118/265
96
sludge after 30 min o f settling in the 1-litre measuring cy linder i f the in itia l test sludge
concentration is the same as the reactor sludge concentration. For a better design o f
secondary settler depth, knowledge o f the solids pro file in the zone-settling and
thickening zones is required.
The model presented in this chapter assumes ideal one-dimensional settling and
can pred ict the solids pro file in the zone-settling and thickening zones o f secondary
settlers under that condition. The work presented in this chapter can be used to improve
the design o f secondary settler depth. A more direct application o f this model is to the
settle stage o f AnSBRs. The material in Sections 7.1, 7.2, and 7.3 has been presented in
Zheng and Bagley (1998) and Zheng and Bagley (1999), and is reproduced by permission
o f the publisher, ASCE.
7.1 Development of the gravitational settling model
7.1.1 Governing equation for gravitational settling
The one-dimensional force balance over an incremental volum e o f suspension
w ith a unit area and thickness dz (Figure 7.1), with w all effect neglected, leads to (Fitch,
1979):
g ( y T dP dP̂ Du
f ^ - p ^ + Tz + ^ = c - D t+ p <
f c ^1 - —
. a Dt f (7.1)
where g is the gravitational acceleration, ps is the density o f solid particles, pr is the
density o f liqu id, C is the solids concentration, P is the dynamic fluid pressure, Ps is the
effective solids pressure, and Du/Dt and D u f / D t are the local accelaration o f the solids
and liquid, respectively. The z coordinate is defined as positive up.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 119/265
97
The local acceleration terms are significant only when there is sudden change in
velocity, which is not expected in the compression zone of a thickener. Therefore, the
local acceleration terms are removed, and Equation 7.1 is simplified to (F itch, 1979)
(7.2) p s oz oz
dP PsH dz
Figure 7.1: Force balance over incremental volume o f suspension [Adapted from Fitch
(1979)]
The dynamic fluid pressure gradient can be related to the solids settling velocity
through Darcy's law fo r flo w through porous media (Cho et al., 1993; Fitch, 1993):
dP = - = (7.3)dz
where K\ is the reciprocal o f hydrau lic conductivity and v is the settling ve locity o f the
solid particle relative to bulk fluid flow.
7.1.2 Effective solids pressure, Ps
In a solid matrix, stress is transmitted mechanically by particle contact. The
equation describing the stress-strain relationship fo r a solid matrix is:
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 120/265
98
(7.4)
where M is the modulus o f elasticity, H is the in itia l height o f the solid matrix and Ps is
the effective solids pressure.
Stress transmittance also occurs in a solid-water matrix through particle contact.
Additionally , stress can be transmitted hydrodynamically between particles approaching
each other (Dixon, 1978). The effective solids pressure for the solid-water matrix, then,
arises from a combination o f both mechanically and hydrodynamically transmitted stress
(Fitch, 1979). Under the normal conditions o f gravity settling, however, the
hydrodynamic stress contribution would be expected to exceed the mechanical stress
contribution because the volume fraction o f solids is relative ly small compared to the
total matrix volume.
This hydrodynamic stress is a function o f the approaching rate o f particles.
Furthermore, in contrast to a pure solids matrix, water in the suspension matrix is
squeezed out during compression. As the water is removed, it exerts a friction force on
the solids that opposes consolidation (Dixon, 1978). Both the hydrodynamic stress and
the water frictio n force are functions o f the rate o f compression, dH/dt. Therefore a
constitutive equation for Ps is postulated to be:
where K 2 is a constant for a given suspension.
For a un it area o f a thin suspension matrix undergoing compression (Figure 7.2), a
mass balance on the solids gives:
HC = constant (7.6)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 121/265
99
where C is the solids concentration in the suspension matrix.
Differentiating Equation 7.6 w ith respect to time gives:
d(HC) d f iC i n dC Q
dt dt dt
which allows Equation 7.5 to be rewritten in terms o f the solids concentration:
dC 1P. = K ,
dt C
(7.7)
(7.8)
H C+dC
- d H
J 2
^ ~ - d H
J 2
Figure 7.2: Response o f solid-water m atrix o f thickness //un der e ffective solids pressure,
Ps(C represents concentration)
Several models for Ps have been proposed in the literature (Bustos and Concha,
1988; Kos, 1977; Landman et al., 1988; Fitch , 1993). A common feature o f these models
used in the modeling o f thickeners is that Ps is a function o f concentration alone.
Equation 7.8 suggests that Ps is a function o f both the loca l concentration, and the rate o f
change in concentration, in accordance w ith D ixon's hypothesis (1978). A n advantage o f
Equat ion 7.8 is that i t predic ts Ps= 0 in t he zone -se t tl ing reg ime , whe re dC/dt = 0 , even
at high concentrations. Other models for Pspredict e ither dPJdz = 0 or Ps& 0 in the zone
settling regime, the latter being counterintuitive.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 122/265
100
Substituting Equations 7.3 and 7.8 into Equation 7.2 provides an expression in
terms o f solids concentration and solids settling velocity:
/d
— i p , - P , ) c - K , v + V f C ) = 0 (7-9> A
I f U is defined as the bu lk flow velocity (relative to the tank wall), and V is the solids
particle velocity relative to the tank wall, then v can be expressed as
v = V - U (7.10)
Note that v, V, and U are positive down.
To sim plify Equation 7.9, recognize that
j c _ s c + acdzdt dt dz dt
Additiona lly, the solids settling veloc ity can be written as
V = ~ — (7.12)dt
which upon substitution into Equation 7.11 gives
^ = s c _ v ? c (713)
dt dt dz
For one-dimensional settling across a unit area, the continuity equation for the
solids is
S ^ = 8j T C ) = 3 V c + v 3C (?14)
dt dz dz dz
Equation 7.13 then becomes
^ = (7.15)dt dz
Substituting Equations 7.10 and 7.15 into Equation 7.9 gives
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 123/265
101
( 8 —
— ( p , -p , ) c - K , ( V - U ) + J =0 (7.16)Ps d z
which can be rearranged to give:
+ (F _ ^ ) + - p f )c = 0 (7.17)2 & 2 dz dz lV ' Ps s 1^ ’
Equation 7.17 is the general dynamic equation governing gravity compression, as
long as the loca l acceleration term is negligible.
7.1.3 Empirical functions for Ki and K 2
The constant K\ from Equation 7.3 is the reciprocal o f hydrau lic conduc tivity o f a
solids-water matrix. I t is a function o f porosity or concentration alone and is independent
o f flow velocity. The value o f K\ for a given matrix can be determined from batch
settling tests.
The initial interface settling velocity during a batch settling test represents the
zone-settling velocity for the suspension at a given concentration. During zone-settling,
concentration gradients are absent (Cho et al., 1993; Fitch, 1993) so the momentum
equation (Equation 7.2) can be rewritten as
-^-(p , - p , ) c + ^ = o P -11*)Ps d z
where
(7.19)d z
and vo is the interface (zone) settling velocity.
The interface (zone) settling velocity can be described by the exponential model
(Vesilind, 1968)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 124/265
102
v0 = kx exp(-w,C) (7.20)
where k\ and n\ are experimentally determined constants.
Substituting Equations 7.19 and 7.20 into Equation 7.18 and solving fo r K\ gives
^ gU-P/JCexpfaC) A , — ( / . z l )
PsK
K 2 reflects the ab ility o f a solid matrix to squeeze out liqu id under pressure.
Similar to K\, K 2 is a function o f porosity or concentration alone, and is independent o f
the compression rate. The relationship o f K 2 to concentration has not been experimentally
determined. However, both dynamic hydraulic force and effective solids pressure result
from the fluid friction acting on the solids. Therefore, it is reasonable to postulate that K 2
depends on C sim ilarly to how K\ does, based on the sim ilarity between the equations
describing dynamic hydraulic force and effective solids pressure. The following
constitutive equation for K 2 is proposed:
g f c . - p ^ e x p („2C) (?22)
Psk2
where 122 and are coefficients to be determined, and their values depend on the
characteristics o f the indiv idua l solids-liquid mixture. W hile both m and depend on the
compression characteristics o f the suspension matrix, 122 reflects the relative ease o f
compression o f the same sludge at different concentrations, while k 2 reflects the relative
ease of compression o f different sludges at the same concentration. Values for ri 2 and &2
are determined by fitting the model to solids profiles. These two parameters should be
independent o f operating conditions o f secondary clarifiers.
The expression for K 2 is not exactly the same as that for K\. One o f the Cs in the
K\ expression is changed to C2. This makes intuitive sense as K 2 is expected to have a
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 125/265
103
greater concentration dependence than K\. Furthermore, C exp(ii2C) can be
mathematically estimated as Cexp(«2C) with limited error within certain C ranges by
adjusting «2.
7.2 Batch settling
7.2.1 Governing equation for batch settling process
For batch settling,there is no bulk flow, and (7.17) simplifies to
d2V dK2 dV g ( V- n^ ^ ^ ^ +— (A - Pf F = 0 -23)
oz oz oz ps
This can be restated in terms o f solids concentration and solids particle velocity
by substituting (7.21) and (7.22) into (7.23).
C / d2V — exp{n2C ) - ^ + k2 oz
2 + n2C t dC exp(«2C) —
SF_exp(2]C )f + ]= 0 (?24)
dz k] k2 dz
Note that (7.23) is completely general for batch settling. I f different expressions for K\
and Ki are used, (7.24) w ill be different.
During batch settling, the continuity equation and (7.24) apply in the domain (/2)
between the bottom o f the settling basin and the supematant-suspension interface:
n = M os:SIJ <7-25>
where L is the height o f the supematant-suspension interface measured at any time from
the column bottom.
The initial conditions are given by
Cl = Cn (7.26)l0<z</.o,/=0 0 v '
V\ = 0 (7.27)l o < z < / . , 2 =o v '
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 126/265
104
where Lo is the in itia l height o f a suspension and Co is the initial solids concentration. The
in itia l solids concentration isassumed to be un iform ly distributed between 0 and Lo.
Equation 7.27 was not usedbecause the local acceleration terms wereneglected.
A t the bottom o f the sedimentation basin, solids accumulate so one boundary
condition occuring at z = 0 is:
V\ n = 0 (7.28)lz=0,;>0 v '
A t the supematant-suspension interface, the effective solids pressure is zero:
dV K2— = 0 (7.29)
dz
providing another boundary condition at the interface height, L:
= 0 (7.30)dV_
dz z = L , l > 0
Equation 7.24 and the continuity equation are solved numerically using a
sequential finite difference approach to provide the concentration pro file in a batch settler
w ith respect to time and height.
7.2.2 Numerical formulation
The momentum balance equation (7.24) must be solved simultaneously w ith the
one-dimensional continuity equation (7.31) using a finite-difference scheme.
^ = + (7.31)dt dz dz
For the momentum balance equation, a central difference scheme is applied to the spatial-
derivative terms.
d2v = r; +l- 2 v ; +v:_
dz2 Az(7.32)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 127/265
105
dc _ c;+1- c;dz Az
d V = ^ L = K L
dz 2Az
and the concentration at Zj is approximated by
(7.33)
(7.34)
C =c n + c nW +1 + W (7.35)
where « denotes the time step; j denotes the spatial step; and Cj is the average
concentration in the region between lines zy and zr /.
Applying the finite -differen ce equations (7.32) through (7.35) to (7.24) gives the
following approximation
-expC” +C" S+i v ^ - 2 v ; + v;_t
Azl
+
C” + C" 2 + n J -
-exp n- C" +C
s~m s~m
S +1 ~ S
Az
F " - F "yJ+1 %-i
2Az(7.36)
exp
v — F f +1 = 0kx
W ith a known concentration (C) fie ld, boundary conditions and initia l conditions,
(7.36) can be solved for the settling velocity (V) field. Then the settling velocity field is
used as shown below to solve (7.31) and predict the concentration fie ld at time n+1.
For (7.31), a forward difference scheme is applied to the time-derivative term:
dc C f - C j
dt At (7.37)
A central difference scheme is used for the spatial-derivative o f concentration
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 128/265
and a backward difference scheme is used for the spatial-derivative o f the ve locity.
d v _ v ; - v ;_,
dz Az
where the velocity is approximated by
(7.39)
v" +V nV = - L ^ (7.40)
2
App lying the difference equations (7.37) through (7.40) to (7.31) gives the
following approximation
✓-*/?+1 s i n j zn , r r n s-iti rr n j y n T/ n
S ~ S _ vJ+Vj - 1 C7'+1 S -1 , vi yj - 1 (7.41) At 2 2Az j Az
which is solved fo r the concentration fields at time step n+1.
The height o f the supernatant-suspension interface is updated according to the
following equation
L"+' = Ln- AtV? (7.42)
where Z" +1 and IT are the heights o f the supernatant-suspension interface at time steps
n+1, and n, respectively, and V" is the settling velocity at the top o f the
supernatant-suspension interface at time step n.
7.2.3 Simulation of interface height versus time
The experimental measurements o f Bhargava and Rajagopal (1990) were used to
show that the model can simulate, w ith one set o f model parameters, the height variation
o f the supernatant-suspension interface w ith time. These experimental measurements
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 129/265
107
included batch settling results for various suspended materials w ith different in itia l
suspended solids concentrations.
The zone settling velocities (vo) for individual solids concentrations were
determined from the linear section o f the interface height versus time plots. The
parameters for the Vesilind equation (k\ and n\) were then determined from zone settling
velocity data. Figure 7.3 shows a plot o f the zone settling velocity (vo) versus solids
concentration (Q for one suspension (aluminum hydroxide floes) examined by Bhargava
and Rajagopal (1990). The solids concentrations ranged from 1.643 g/L to 4.381 g/L. The
k\ and n\ were determined by nonlinear regression.
Table 7.1: Model parameters for various suspensions
Type o f suspended material k\
(m/h)
n\
(m3/kg)
k2
(kg/m 4/h)
n2
(m3/kg)
Alum inum hydroxide floes 2.57a 0.98a 3.6xl05b 0.5 b
Bentonite 1.61a 0.049a 1 .8 x l 0 7b 0 . 0 1 b
Desanded gold ore pulp 0.43c 0.0072° 1 .8 x l 0 5d 0.06 d
aDetermined from zone se ttling data presented by Bhargava and Rajagopal (1990)
b Determined as described in the text using data presented by Bhargava and Rajagopal
(1990)
c Determined from those zone settling data w ith in itia l solids concentrations greater than
45.8 kg/m3 presented by Scott (1968)
d Determined as described in the text using data presented by Scott (1968)
k2 and n2 were quantified by fitting the model prediction to the experimental data
shown in Figure 7.4. Due to the complexity o f Equation 7.24, regression techniques were
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 130/265
108
not used to estimate kj and nj. Instead, ki and rii were determined by means o f
optimization. The objective function for the optimization was the minimum residual sum
o f squares between the model prediction and experimental measurements. As there were
only two factors (&> and ni) in this optimization, the response-surface methodology
(specifically, grid search method) was used. A series o f simulations was conducted and k-i
and ni were systematically varied to provide the minimum residual sum o f squares. The
k 2 and values for the aluminum hydroxide floes were 3 .6xl0 5 kg/m4/h and 0.5 m3/kg,
respectively (Table 7.1), and are constant for a given suspension regardless o f initia l
solids concentration.
The model simulation results for aluminum hydroxide floe compare well to the
experimental measurements (Figure 7.4, r 2 = 0.99 overall). The experimental
measurements show both zone settling in itia lly and compression as time proceeds. The
model predicts the interface heights for suspensions in either settling regime and
seamlessly moves from one regime to another.
This model worked very well for other suspensions tested by Bhargava and
Rajagopal (1990). For example, Figure 7.5 shows the zone settling velocity versus solids
concentration for a bentonite suspension, while Figure 7.6 shows the comparison between
the model prediction and experimental measurement o f interface height versus time for
bentonite, w ith six d ifferent in itia l suspended solids concentrations. The model
parameters used are listed in Table 7.1. As Figures 7.4 and 7.6 indicate, the model
provides very good predictions o f batch settling processes for various inorganic
suspensions under differen t in itia l solids concentrations.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 131/265
109
The in itia l linear section o f a batch settling test corresponds to zone settling. The
compression terms (the terms with K2 in Equation 7.23) used in this model disappear in
the zone settling regime where dVjdz- 0 . Therefore, the prediction accuracy o f this
model in the initial linear section in Figures 7.4 and 7.6 depends entirely on the suitability
o f the equation used for the zone settling velocity. The discrepancy between the model
prediction and experimental measurement in the initial linear section in Figure 7.4,
especially at lower in itia l solids concentrations, is due to the relatively poor f it o f the
Vesilind equation that was used to describe zone settling velocity (Figure 7.3). Because
the model describes compression settling well, it appears to work better for higher initial
solids concentrations that have quicker zone settling sections.
As indicated previously, several models have been suggested to describe the zone
settling velocity o f a suspension. While the Vesilind equation is used in this study, an
alternative zone settling expression (e.g. Islam and Karamisheva, 1998; Cho et al., 1993)
could have been used. Equation (7.21) would be re-derived for the zone settling
expression, leading to a different expression for (7.24). The compression terms remain
the same as does the solution procedure. A user o f this model should select the zone
settling expression that best fits the particular data o f interest.
The four parameters (k\, n\, k2 and n2) were determined in two steps above. A ll
fou r parameters may be determined in one step by conducting a series o f simulations and
systematically varying the four model parameters to provide the minimum residual sum
o f squares. When only one batch settling curve is available, this method could be used,
although it is not recommended for the fo llow ing reasons. First, batch settling tests are
commonly used for determ ining the zone settling velocities and so collection o f the
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 132/265
110
required data is straightforward. Second, k\ and n\ have different physical meanings than
£ 2 and «2 - Determining all four parameters with one data set may introduce correlation
between them that is not physically legitimate. Finally, this approach requires a priori
selection o f a zone settling expression. The suitability o f the selected expression would
not be independently tested.
E
&o0
50)
d)(/)<D
1
v0 = 2.57exp(-0.98C)
R2 = 0.96
0.01
52 3 40 1
Solids concentration (kg/m3)
Figure 7.3: Zone settling velocity for aluminum hydroxide floes [Calculated from
Bhargava and Rajagopal (1990) results].
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 133/265
I l l
0.4
Initial solids concentration (kg/m )
□ 4.381 o 3.490 a 2.747
x 2.640 x 2.312 o1 .6430.3E
D)
i? 0.2a)o XV
\ o x
&c
3002401801 2 0600
Time (min)
Figure 7.4: Interface height versus time fo r aluminum hydroxide floes. Symbols -
Experimental measurement (Bhargava and Rajagopal, 1990), Solid lines - Model
prediction.
E,
oo
5JD*3CDC/5
cuco
N
v0 = 1.61exp(-0.049C)
R2 =0.99
0.01806040200
Solids concentration (kg/m3)
Figure 7.5: Zone settling velocity for bentonite [Calculated from Bhargava and Rajagopal
(1990) results].
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 134/265
112
0.4
jET 0.3
£g><D
© 0.2
I1
0.1
0
0 60 120 180 240 300 360
Time (min)
Figure 7.6: Interface height versus time fo r bentonite. Symbols - Experimental
measurement (Bhargava and Rajagopal, 1990), Solid lines - Model prediction.
7.2.4 Simulation of dynamic concentration profiles
The batch settling model can also predict the vertical solids concentration profile
during the batch settling process. Laboratory measurements from Scott (1968) were used
to examine this capability. The suspension examined was the desanded fraction from a
m illed gold ore pulp, consisting mainly o f hydromuscovite w ith a fair amount o f very
fine quartz and small quantities of chlorite and pyrophyllite. The slurry was flocculated
by means o f lime. The batch settling runs fo r the suspensions categorized as intermediate
test pulp by Scott (1968) were simulated for this work. The initial concentration was 70
kg/m3, and the initial height was 1.43 m. As indicated by Scott (1968), an induction
period o f 24 min was required for the floccu lation process before the pulp developed a
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 135/265
113
constant settling rate. Therefore the starting point for model comparison was at the end of
the flocculation process, 24 minutes after the start o f the batch settling test.
Figure 7.7 shows the plot o f zone settling ve loc ity versus solids concentration for
this suspension from Scott (1968). For this suspension, when the solids concentrations
were greater than 45.8 kg/m , the zone settling velocity was described by the Vesilind
equation. The k\ and n\ values estimated from data with solids concentrations greater than
45.8 kg/m in Figure 7.7 are 0.43 m/h, and 0.0072 m /kg, respectively. Because the init ia l
concentration was 70 kg/m 3 in the batch settling test o f interest, the zone settling
veloc ities fo r solids concentrations less than 45.8 kg/m were not required.
The interface height versus time results for this test are shown in Figure 7.8. A
series o f simulations were conducted and kj and « 2 were systematically varied to provide
the minimum residual sum o f squares between the model prediction and experimental
measurements o f the interface height versus time data in Figure 7.8. The values
determined were:
kj = 1 .8 x 1 0 5 kg/m4/h, nj= 0.06 m3/kg
The model provides an extremely close fi t to the interface height versus time data with an
r 2 equal to 1 .0 0 .
Using the parameters quantified from interface settling data, the model simulated
the vertical solids concentration profile over time (Figure 7.9). The model predictions
agree reasonably well w ith the results measured by Scott (1968), w ith an r value o f 0.87.
An improved r 2 could have been achieved by using the measured results in Figure 7.9
directly to find the ki and « 2 values. However, in practice, concentration versus height
profiles at different times are rarely measured. The results presented in Figure 7.9
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 136/265
114
indicate that the model provides reasonable predictions o f the solids concentration
profiles using parameter values estimated from interface settling information which is
much easier to obtain.
The effective solids pressure expression, Equation 7.5, was proposed for
compression processes where the volume fraction o f solids are low enough that the
hydrodynamically transmitted stress exceeds the mechanically transmitted stress. When
the solids concentration is very high, the mechanically transmitted stress (by particle
contact) becomes the main mechanism o f stress transmittance, and the model’ s agreement
w ith data would be expected to decrease. This may be the case in Figure 7.9 as solids
concentrations increase to 150 kg/m .
.c
E
&oo$O)
c(1)cnCDc
Data used
v0 r 0.43exp(-0.0072C)i
! R2 = 0.98
0.01
250100 150 2000 50
Solids concentration (kg/m3)
Figure 7.7: Zone settling velocity for desanded fraction from a gold ore pulp (Scott,
1968). Experimental data w ith in itia l solids concentration greater than 45.8 kg/m3 are
used in determining the Vesilind equation parameters.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 137/265
115
— Model fit
x MeasurementE
CDO
00.5
c
150010005000
Time (min)
Figure 7.8: Interface height versus time for desanded fraction from a gold ore pulp.
Symbols - Experimental measurement (Scott, 1968), So lid lines - Model prediction.
<— Initial heightSettle Time
16 min
□ 16 min
o 56 min
a
116 min x 151 min
56 min
116 min
E£ 151 min05
'(Dx Initial
0.5 -
200100 1500 50
Solids concentration (kg/m3)
Figure 7.9: Height-concentration profiles for desanded fraction from a gold ore pulp at
different settling times. Symbols - Experimental measurement (Scott, 1968), Solid lines
- Model prediction.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 138/265
116
7.2.5 Sensitivity of compression parameters
The parameter K2 has a clear physical meaning: it represents the ease w ith which
water is removed from a solids-liquid matrix under pressure. As K 2 increases, water is
less easily removed from the matrix and the rate at which the solids concentration
increases under a given pressure declines as indicated in Equation 7.8. The relationship o f
K 2 to £ 2 and « 2 is indicated in Equation 7.21. As increases or £ 2 decreases, K 2 increases
and water is less easily removed from the so lid-liqu id m atrix.
1.5
g 1
£5?<33
o 0.5
‘t:£ c
0
0 200 400 600 800 1000
Time (min)
Figure 7.10: Sensitivity analysis on k2 and ri 2 based on the simulation in Figure 7.8. For
central line, k2 = 1 .8 x l 0 5 kg/m 4/h, n2 = 0.06 m3/kg.
The practical implications o f changes in k 2 and n2 are examined in Figure 7.10.
The predicted interface height versus time curves for the suspension examined in Figure
7.8 are plotted with values o f k 2 and n2 that have been varied by 25% from the values
presented in Table 7.1. The values for k\ and n\ were held constant at the values shown in
Table 7.1. The interface height predictions were more sensitive to n2, as expected from
Equation 7.21 (n2 occurs w ithin the exponential term). The slope o f the zone settling
n2 increases by 25%
k2 decreases by 25%
k2 increases by 25%
n2 decreases by 25%
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 139/265
117
portion o f the interface height curve was not affected because the compression terms in
the model disappear in the zone settling region.
As predicted from a consideration o f Equations 7.8 and 7.21, decreasing ki or
increasing ni reduced the ease with which water is removed from the suspension. A
suspension w ith relatively lower kj or higher yij values would undergo compression at a
lower solids concentration and achieve a decreased ultimate compressed solids
concentration. Therefore, the bentonite suspension, w ith the largest kj and lowest m w ill
compress the most readily and to the highest concentration during gravity settling while
the aluminum hydroxide floe compresses poorly (Table 7.1). In practice, suspensions
with smaller ki and larger nj values would require deeper thickeners to achieve target
underflow concentrations.
7.3 Steady state secondary clarifler
7.3.1 Govering equation of steady state secondary clarifier
In the case o f steady state gravity settling in a secondary cla rifier , the follo w ing
relationship holds for the zone below the feed point:
where Cu is the underflow solids concentration, and U is equal to bulk underflow rate
divided by the clarifier tank area.
A t steady state, both Cu and U are constant, and Equation 7.17 can be rewritten as:
(7.43)C
K 2CUU d 2C | K2CuU fdC }2 dK2 CUU dC
C 2 dz2 C3 i dz J dz C2 dz dz C 2 dz (7.44)
Substituting Equations 7.21 and 7.22 into 7.44 and simplifying gives
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 140/265
1 , r ,d2c n2 r J d C ' 2 — exp(772CJ— + — exp(n2C)iv 2 CiZ #C2 dz
+exp{n]C )Cu- C C
c„ c n
Equation 7.45 is solved in the following section.
7.3.2 Steady state solution
Equation 7.45 may be rewritten as:
-exp(n2 C)rdC^2
v dz j + — exp(«2C)
d 2C C exp(n,C) Cu-C
dz2 C U C„
and then rearranged to give:
' d c VKdz J
d C + — —= k2 exp(~n2C)
dz ,C UU c u J
Let
then
s = d -£ dz
d 2C d
dz dz
f dC}
\dz j
dS dS dC _ dS _ 1 d(s2)
dz dC dz dC 2 dC
Substituting Equations 7.48 and 7.49 into Equation 7.47 gives
n,S2 +1 d(s2)
2 dC - k2 exp(- n 2C)
f C exp(« ,C)Cb-C n
yCnU c 11 J
Equation 7.50 is rewritten as
4 ? 2) _ dC
2k2 exp(~n2C)r C exp{nxC )C u- C ^yCuU c
- l n 2S 2 u J
Note that for an equation w ith the form o f
dy
dx = f( x ) + by
0 (7.45)
(7.46)
(7.47)
(7.48)
(7.49)
(7.50)
(7.51)
(7.52)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 141/265
119
where/(x) is a function o f x and b is a constant, the solution is
y = B exp(6 x) + exp(fex) Jexp(-for)f{x)dx (7.53)
where B is an integration constant.
Equation 7.51 has the same form as Equation 7.52. I f S2 is viewed as y, then
b = - 2 n. (7.54)
and
/ ( c ) = 2k2 exp(—n2C)C exp(«,C) Cu-C
yCuU c,(7.55)
u J
Therefore the solution fo r Equation 7.51 is written as
S2 = ,4exp(-2«2C) +
exp(-2« 2C ) j| exp(2n2C')J^2/ exp (-n 2C)j
where A is an integration constant.
Equation 7.56 can be reduced to
C exp(nlC)Cu-C
Kc j i kx q T ,\dC
(7.56)
S1 = A exp(-2n2C) + 2k2 exp(- 2n2C) J
and it is further reduced to
exp(w2C)C exp(nlC)Cu-C
KC*U c.u
dC (7.57)
Olr S2 - Aexp(-2n2C) + ^ ^ exp(- 2n2 C) J[exp( « 2 C )C }fC
+ ■
2 k2
K 2 k2
KCU
exp(-2n 2C)J{exp[(«, + n2 )C]}<7C
exp(- 2n2 c ) j{ c ex p[(n, + n2 )c]}dC
(7.58)
Performing the integration term by term gives
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 142/265
120
S2= A exp(-2n2C) + exp(- 2n2C)exp(n2C )^ Y ~ ~CUU n2
lk 2 exp(-2« 2C)exp[(ft1 +« 2 )cU — -— r (7.59)v A j J l I *>2 vy J v A | J |_ \ \ 2 / J / \
k} (nl +n2)
+ ~ ~ exp (- 2«2C)exp[(«, + n2)c ]{n\ ^ \ 1
kfu \n,+n2)
Equation 7.59 can be reduced to
S2= A exp(-2n2C) + | ) exp(_ 2ki — exp[(«, - n2 )c ]kx{n ,+n2)
+ 2 . [ ( y n 1 )C - 1] exp[^ _ ^ )c ]
£,C>, +«2j
and it is fu rther reduced to
S2 = Aexp(-2n2C) + 2k"1'f f 2̂ 2 ^ e xp (-n2C)CuUn2
+ ̂ ^ X c - c J z i ] exp[(wi_ yf2)c]
+n2)
The physically meaningful solution is given by
dC
dz
\
2k-,(n-,C —i) / \ A exp(-2n2C) H —----- -— exp(- n2C)CuUni
+
(7.60)
(7.61)
(7.62)
*iC H(wi + « 2 ) 2
where ̂ 4 is an integration constant. An exp licit analytical solution o f Equation 7.62 is not
available. However, with all the parameters known, Equation 7.62 can be integrated
numerically to give the C versus z relationship.
The integration constant A has to be determined from boundary conditions. In the
case that there is a distinctive zone-settling region above the compression zone, the
follow ing method can be used to evaluate the integration constant A. The zone-settling
concentration is the critical concentration Cc for the clarifier. W ith zone settling, there is
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 143/265
121
no concentration gradient and no effective solids pressure so Px= 0 and dCjdz = 0 .
Equation 7.62 can then be rearranged for A, w ith Cc replacing C.
A - 2kj [(«, + n , X ^ - C.) +1] exp[(H| + jc j (?63)
I ii v ^ l + « 2 ) u ^ 2
For the c ritical concentration Cc, the fo llow ing relationship holds:
(klQxp(-n ,Cc) + U)Cc = C uU (7.64)
7.3.3 Validation of the steady state solution
Two sets o f experimental results from the literature were used to validate the
steady-state solution (Equation 7.62). The first results are laboratory data for the
thickening o f a calcium carbonate suspension (George and Keinath, 1978). Two
conditions are examined (Table 7.2). The underflow rate for both conditions was
provided by the authors. The underflow concentration, Cu, was provided for condition 4.
A value o f Cu for condition 3 was estimated from the solids flu x and underflow rate,
assuming, as stated by the authors, that no appreciable quantity o f solids was transmitted
above the feed point. Values for k\ and n\ (Table 7.2) were estimated from the batch
settling data provided by least-squares, non-linear regression o f Equation 7.20 using the
Levenberg-Marquardt algorithm (Press et al., 1992) written in the C language on a
personal computer. These values were then used for both conditions.
Because a distinctive zone-settling regime was formed above the compression
regime, Equation 7.63 could be used to evaluate the integration constant A. Estimates o f
the critica l concentration, Cc, from Equation 7.64 agree well w ith the actual Cc, which is
the constant concentration in the zone settling regime (Figure 7.11). The parameters ki
and ni, like k\ and n\, should be constant for the same suspension matrix, regardless o f
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 144/265
122
system operating conditions. Therefore, values for £ 2 and « 2 (Table 7.2) were estimated
from the results o f condition 3 by least-squares, non-linear regression o f Equation 7.62
(numerically integrated using the Romberg algorithm [Press et al., 1992)]) and then
applied to condition 4.
Table 7.2: Operating conditions and model parameters for the experiment by George and
Keinath (1978)
Condition Ua
(m/h)
c ua
(kg/m3)
k ,b
(m/h)
m b
(m3/kg)
k2b
(kg/m4 /h)
n2b
(m3/kg)
Ccc
(kg/m3)
3 0.61 35.73.0 0.084 2.09xl05 0.15
14.9
4 0.33 50.9 35.0
aFrom or ca culated from George and Keinath (1978)
bBest fit parameters from non-linear regression
“Calculated using Equation 7.64
There is good agreement between the measured data and the model results (Figure
7.11), w ith r 2 values o f 0.83 fo r condition 3 (which was used to determine & 2 and ni) and
0.81 fo r condition 4. The concentration profiles indicate the presence o f both zone-
settling and compression regimes. The model simulates both regimes and different
operating conditions w ith one set of parameters.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 145/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 146/265
124
Table 7.3: Operating conditions and model parameters for the experiment by Pflanz
(1969)
Condition Ua
(m/h)
Cua
(kg/m3)
k ,b
(m/h)
n ib
(m3/kg)
k2c
(kg/m4 /h)
n2c
(m3/kg)
Cca
(kg/m3)
Low load 0.38 12.9 2 . 6
Medium load 0.38 1 2 . 8 1 1 . 0 0.43 3.62xl04 0.64 2.5
High load 0.38 14.7 2.9
aFrom Pflanz (1969)
bEstimated from SVI (Pflanz, 1969) using equations from Hartel and Popel (1992)
cBest fi t parameters from non-linear regression
dCalculated using Equation 7.64
E
o-Q
E
O)<DX
1
0.8feed point
0.6
o low load
x medium load
— model fit
0.4
0.2
0
151050
Solids concentration (kg/m )
Figure 7.12: Solids concentration profile for an activated sludge suspension. Points are
from Takacs et al. (1991). Line represents the best-fit model prediction. Operating
conditions are shown in Table 7.3.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 147/265
125
The settling characteristics o f the sludge were not provided in the o riginal paper,
so non-linear regression o f Equation 7.20 could not beused todetermine k\ and n\.
However, the sludge volume index (S VI) o f thesludge wasreported as 80 mL-g_1.
Empirical equations exist in the literature for relating k\ and n\ to SVI. For example,
Hartel and Popel (1992) provide the following expressions (Equations 7.65 and 7.66)
based on extensive data. These equations are used for illustration.
k, =17.4 exp(-0.0113SVI) + 3.931 (7.65)
nx =-0 .9834 exp(-0.0058LSF/) + 1.043 (7.66)
The concentration profile below the feed point suggests only compressive settling.
There was no distinctive zone-settling regime observable in the data. Therefore, the
integration constant A cannot be evaluated using Equation 7.63 but must instead be
estimated along with £ 2 and by non-linear regression o f Equation 7.62. The low load
and medium load conditions were essentially identical with respect to concentration
profile, so the combined data from those two conditions were used to estimate A, k̂ and
ri 2 - The experimental data and the best-fit curve for the combined conditions are shown in
Figure 7.12. The r 2 value o f 0.98 is extremely high, as would be expected when fitting
three parameters to a small quantity o f measurements. The parameter estimates are
included in Table 7.3.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 148/265
126
£ 0.8
1 0.6-DE2 0.4
M—
£
■S 0.2 x
feed point
high load
model fit
10 1550
Solids concentration (kg/m3)
Figure 7.13: Solids concentration profile for a highly loaded activated sludge suspension.
Points are from Takacs et al. (1991). Line is the model prediction using the parameters
determined from Figure 7.12.
Because the high loading condition was performed with the same sludge and in
the same cla rifier, only one set o f parameters should be used. The model pred iction
versus the experimental measurements for the highly loaded condition is shown in Figure
7.13. Although the r 2 is sign ificantly low er than before (0.55), the fi t o f the model is s till
reasonable, especially considering the paucity o f data in the compressive regime used for
determining the parameter values. Other models for the same experimental data (Watts et
al., 1996; Takacs et al., 1991) developed separate sets o f parameter values fo r each
loading condition, in contrast to the model developed here which uses only one set o f
parameter values for a ll three operating conditions.
Ideal one-dimensional settling was assumed for thickeners in this study. The flo w
patterns in real thickeners may not achieve this assumption, in w hich case m ulti
dimensional models o f the flu id dynamics may be required. By inco rporating the
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 149/265
127
effective solids stress, the work developed here improves the performance o f ideal one
dimensional models. This work should also be applicable for two-dimensional model, but
its va lidity requires further examination.
7.4 Vertical solids profile in UASB reactors
For a steady state UASB, the follow ing relationship is va lid
C U V = (7.67)
C
where Ceis the effluent solids concentration and Ue is the up-flow velocity. Substituting
Equations 7.67, 7.21, and 7.22 into Equation 7.17 gives an equation similar to Equation
7.45 with Ce and Ue replacing Cu and U, respectively. The difference is that since Ue is
upward, it is negative, wh ile U is positive.
1 / n \d 2C n2 f c / cY exp{nxC )C e- C C — exp («2C )— y + -^ e x p (n2C) — + — V ------ Y 7 7 T T = 0 (7'68>
dz Vdz ) K] (Le C'eUe
Following the same procedure presented in Section 7.3.2, the solution for Equation 7.68
is
dC_
dz
^exp(-2n 2C) + 2k2(n2C 0 exp(_ n̂ CeU nl
e L 2 (7.69)
+ M ^ U z 7 H l exp[(„ , _ „ 2 )c ]
*iC e(«, +n2f
The measurement o f a UASB solids pro file by Yan and Tay (1997) is used here to
illustrate the application o f the current model for the prediction o f UASB solids pro files.
For their measurement in Day 30, the up-flow velocity was 0.08 m/h and the effluent
solids concentration was 0.1 kg/m3. Since only the volatile suspended solids were
reported; the suspended solids were calculated from VSS (assuming that SS/VSS equals
1.4). No settling data were provided in Yan and Tay (1997) for quantification o f model
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 150/265
128
parameters k i, n i, k2, and n2. For the purpose o f illustra tion, the parameters in Table 7.3
for aerobic sludge are used instead. The sludge had not granulated yet on Day 30.
The integration constant A and the solids concentration on the bottom o f the
reactor (boundary condition) were obtained by fitting the model prediction to the data.
Figure 7.14 shows the best-fit curve and the experimental data. The r value is 0.84. Yan
and Tay (1997) also provided the solids profiles on Day 90 and Day 180. These two sets
o f data are not simulated here because changes o f settling characteristics are expected due
to sludge granulation. A differen t set o f model parameters (k j, n i, k2, and n2) must be
used to model those two sets o f data. Further va lidations o f the current model are needed
for the simulation o f UASB solids profiles after granulation.
D)a>■CL-o-*—>oCOa>
0.4
0.3
0.2
measurement
model fit0.1
0
30 4010 200
Solids concentration (kg/m )
Figure 7.14: Solids concentration profile for a UASB reactor. Points are from Yan and
Tay (1997); line is the model prediction.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 151/265
Chapter 8 Evaluating the AnSBR with Simulation
This chapter investigates the e ffect o f design and operational parameters on the
performance o f AnSBRs. AnSBRs have been operated w ith a wide range o f parameter
values. For example, the total cycle time examined has varied from 2 hours (Welper et
al., 1997) to 8 weeks (Masse and Droste, 2000). Conflicting operational strategies have
also been used in these studies. For example, Schmit and Dague (1993) kept the fill stage
as short as possible, while Bagley and Brodkorb (1999) recommended a slow fill
strategy. It is the purpose o f this chapter to see how many factors interact w ith each other
and to identify the optimum design and operational parameters for AnSBRs under
different situations.
8.1 Organic loading rate
The organic load ing rate is a good indicator o f the performance o f an anaerobic
reactor. The objective o f these simulations is to maximize the organic loading rate o f
AnSBRs. For AnSBRs, the organic load ing rate is defined as
ByJ - ' W (8.1)‘ c
where Bv is volum etric organic loading rate (g COD/L/d); Sm is the influent COD
concentration (g COD/L); V/is the fill volume (L); V, is total reactor volume (L); and
tc is total cycle time (day). tc is the sum o f the fi ll time (//), react time (tr), settle time (4
),
and decant time (4 ).
The hydrau lic retention time o f an AnSBR is defined as
0 = — (8.2)
vf ! vt
129
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 152/265
130
where 0 is the hydraulic retention time (day). The organic loading rate varies w ith many
design and operational parameters o f AnSBRs.
8.2 Design and Operational parameters of AnSBRs
Many factors affect the maximum loading o f AnSBRs. The operational factors
include flow recycle, m ixing, f il l rate, pH, temperature, fil l volume, etc. The design
factors include the total volume o f the reactor, the configuration o f the reactor, m ixing
configuration, etc.
The factors selected for this analysis are MLVSS, f il l volume, fill/rea ct time ratio,
and influen t COD. Reactor MLVSS is one o f the most important factors for the design o f
AnSBRs. The analysis presented in the Chapter 5 shows that the maximum load ing an
anaerobic reactor can achieve is a positive function o f the amount o f VSS the reactor can
retain. However, for AnSBRs, higher MLVSS means a longer settle time requirement,
which may decrease the organic loading rate. F ill volume also has an impact on the
loading treatable by AnSBR. It can be seen from Equation 8.1 that a larger fill volume
increases the theoretical OLR o f AnSBRs. On the other hand, a larger fi ll volume
requires a longer settle time and react time, which may decrease the loading o f AnSBRs.
Bagley and Brodkorb (1999) showed that fill/react time ratio is an important factor for
the operation o f AnSBRs. Though in fluent COD is a constraint factor rather than a design
and operational factor, it is included to see how it interacts w ith other factors in terms o f
maximum organic loading rate.
8.3 Response surface designs
Factorial design is a very good technique fo r examining the response o f a system
to changes in factors. Factorial design reduces the number o f experiments to obtain the
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 153/265
131
desired information. Response surface designs are bu ilt for fittin g a curved surface to a
continuous factor so that the factor values for the minimum or maximum response can be
sought. One o f the commonly used response surface designs is the Box-Behnken design.
The Box-Behnken design is a quadratic design, and it requires three levels for each
factor. The Box-Behnken design for four factors requires 27 runs, wh ile a fu ll three-level
factorial design for four factors requires 81 runs. Table 8.1 presents the Box-Behnken
design table prepared using JMP® software running on a Windows-compatible personal
computer. In Table 8.1, + or 1 means high level, 0 means medium leve l, and - or -1
means low level. Runs 25, 26, and 27 have the same factor pattern (0000). For an
experimental system, triplicates provide additional information about the experimental
variation in the system. However, the same inpu t pattern w ill have same output for
current computer simulations. Therefore pattern (0000) w ill be run only once. A
quadratic regression model o f N factors can be described by the fo llow ing equation:
y = b + f lblX , + £ l f ibllX ,X , (8.3)(=1 / = ! j = i
Two sets o f simulations were carried out based on the sludge characteristics. It
was assumed that the sludge is flocculent fo r the firs t set o f simulations, and granulated
for the second set. The major difference between the granulated sludge and flocculent
sludge is that the granulated sludge has very good settling characteristics. For example,
the interface settling ve locity w ith an initia l sludge concentration o f 10 g CO D/L is 0.18
m/h for flocculent sludge and 2.56 m/h for granulated sludge, based on the settling
parameters used in the model. Therefore, the reactor can retain much higher MLVSS
w ithin a given settle time for granulated sludge.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 154/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 155/265
133
Table 8.2 lists the three level values o f each factor fo r the firs t set o f simulations
(floccu lent sludge). The high level o f f il l volume ( V f ) is ha lf o f the react volume V r,
which has been used by Bagley and Brodkorb (1999). The low level o f V f is 1/6 V r,
which has been used by Dague and Pidaparti (1992). The middle level is the average o f
the high level and low level. The high level o f MLVSS is 12 g COD/L. This value was
chosen in consideration o f the settle time requirement. Based on the settling parameters
used in the model, the reactor requires 14.7 hours to settle when the fill volume is 0.5Vr
and the MLVSS is 12 g COD/L. H igher MLVSS w ill require a very long settle time. The
low level o f MLVSS is 6 g COD /L, and the middle level is 9 g COD/L. The high level o f
fill/react ratio is 1:1 and the low level is 1:5. The middle level is the average o f high and
low.
Table 8.2: Factor values for flocculent sludge
Level MLVSS (g COD/L) Vf /Vt ! fr Sin (mg COD/L)
Low 6 1 / 6 1:5 2 , 0 0 0
Medium 9 1/3 1 : 2 6 , 0 0 0
High 1 2 1 / 2 1 :1 1 0 , 0 0 0
Table 8.3 lists the three leve l values o f each factor fo r granulated sludge. The high
level of V f is ha lf o f the react volume V r, the low level of V f is 1/6 V r, and the middle
level is the average o f the high level and low level. The middle level o f MLVSS is 40 g
COD/L. The MLVSS was 42 g COD/L (30 g VSS/L) in the laboratory experiment of
Angenent and Dague (1995), where the highest organic loading rate was achieved in the
literature. The high level o f MLVSS is 60 g COD/L, and the low level is 20 g COD /L.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 156/265
134
The high level o f fill/react ratio is 3 :1 and the low level is 1 :3 . The middle level is the
average o f high and low ( 1 : 1 ) . The values o f S jn were chosen in consideration o f loading
rate and hydraulic retention time.
Table 8.3: Factor values for granulated sludge
Level MLVSS (g COD/L)Vf / Vt tf l tr
Sin (mg COD/L)
Low 2 0 1 /6 1 :3 1 0 , 0 0 0
Medium 4 0 1 /3 1:1 2 0 ,0 0 0
High 6 0 1 /2 3 :1 3 0 ,0 0 0
8.4 Simulation conditions
For all the simulations conducted, the reactor was assumed to be a 12 L anaerobic
sequencing batch reactor receiving glucose as the sole carbon source. A ll nutrients were
assumed to be present in excess. It was assumed that an appropriate amount o f a lka lin ity
is present in the influent to maintain neutral pH (the pH is not fixed). The reactor has a
height o f 0.68 m (up to the reactor liqu id level). I t was assumed that the decant rate is 10
L/h, and therefore the decant time is a function o f fil l volume. For example, i f the decant
volume (same as fill volume) is 2 L, then the decant time (td) is 0.2 hour. The settle time
is a function o f MLVSS and fi ll volume:
tf = f{MLVSS,Vf ) (8.4)
For the flocculent sludge, the settle time is calculated using the batch settling model
developed in Chapter 7. The settle parameters used are as follows: ki=10.5 m/h, ni=0.43
L/g COD, k2=7200 kg/m4/h, and n2=0.01 L/g COD. These values are chosen based on the
experimental results o f Higgins (2001), assuming that anaerobic biosolids w ill settle
roduced with permission o f the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 157/265
135
sim ilarly to flocculated aerobic bioso lids. For granulated sludge, the interface settle
velocity is estimated from the settling velocity data o f Sung and Dague (1995) w ith k i=
8.94 m/h and ni=0.0766 L/g COD. As the compression data were not available for
granulated sludge, a constant interface settling rate was assumed throughout the settle
stage for a given MLVSS. It was assumed that the sludge in the reactor has a uniform
vertical concentration at the beginning o f the settle stage.
A ll simulations meet the same effluen t criteria o f 50 mg COD/L o f VFAs. For
each simulation run, the fill time and react time were adjusted while maintaining the
fill/react ratio to meet the effluent criteria. The total cycle time was allowed to vary
accordingly. Each simulation was run to steady state, which was defined as an effluent
COD variance w ithin 0.1 mg CO D/L after 20 consecutive cycles. The maximum organic
loading rate for the factors examined was then calculated using Equation 8.1 w ith the
appropriate total cycle time. The program maintains a preset target MLVSS automatically
by adjusting the solid wasting rate. The SRT was calculated based on the MLVSS and
wasting rate. The statistical analysis was conducted using JMP® software.
8.5 Simulation results
8.5.1 Flocculent sludge
The simulation results for maximum organic loading rate are presented in Table
8.4. For the flocculent sludge, the highest organic loading rate is 5.9 g/L/d (run 12), when
the MLVSS is high (12,000 mg COD/L), fill volume is medium (4 L), fill/react ratio is
medium (1:2), and influent COD is high (10,000 mg/L). The lowest organic loading rate
is 3.0 g/L/d (run 4), when the MLVSS is high (12,000 mg COD/L), fill volume is high ( 6
L), fill/react ratio is medium (1:2), and influent COD is medium (6,000 mg/L). The total
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 158/265
136
cycle time ranges from 2.2 hours (run 21) to 26.5 hours (run 24). The hydraulic retention
time ranges from 11.4 hours (run 5) to 65.4 hours (run 10). SRT ranges from 17.9 days
(run 17) to 54.9 days (run 4). The specific organic loading rate ranges from 0.25 (run 4)
to 0.66 (run 17) g COD/g COD/d.
Table 8.5 presents parameter estimates for the standard least squares response
surface model from JMP®. The analysis o f variance fo r this response surface model gives
an F ratio o f 11.99 and Prob >F o f 0.000058. The F ratio evaluates the effectiveness o f
the model. I f the probability associated with the F ratio is small, then the model is
considered a better statistical fit for the data than the response mean alone. Prob >F is the
observed significance probab ility o f obtaining a greater F ratio by chance alone i f the
specified model fits no better than the overall response mean. Observed significance
probabilities o f 0.05 or less are often considered evidence o f a regression effect. The
probability value o f 0.000058 indicates that the four-variable response surface model
w ith two factor interactions provides a very good f it o f simulation data.
The effects o f each term are also presented in Table 8.5 as sum o f squares. The
influent COD has a significan t effect on the maximum loading rate o f AnSBRs, wh ich is
reflected by a large sum o f squares. This observation can be explained using Equation
8.1. Lower influent COD requires a short total cycle time to reach a higher organic
loading rate, i f the fi ll volume remains the same. The fraction o f time used for settle and
decant increases with the decrease o f total cycle time. As a result, the efficiencies o f
AnSBRs decrease. This result indicates that AnSBRs are more suitable fo r high strength
wastewater in terms o f reactor loading rate. The reactor MLVSS also has a significant
effect on the maximum loading rate o f AnSBRs.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 159/265
137
Table 8.4: Simulation results of maximum OLR for flocculent sludge
Run MLVSS
(g/L)
Vf /Vt tf ! tr
(g/L)
tc
(hours)
HRT
(hours)
SRT
(days)
OLR
(g/L/d)
SOLR
(g/g/d)
1 6 1 / 6 1 / 2 6 6.9 41.4 19.8 3.5 0.58
2 6 1 / 2 1 / 2 6 19.1 38.2 2 2 . 6 3.8 0.63
3 1 2 1 / 6 1 / 2 6 4.6 27.6 25.8 5.2 0.43
4 1 2 1 / 2 1 / 2 6 23.7 47.4 54.9 3.0 0.25
5 9 1/3 1/5 2 3.8 11.4 26.4 4.2 0.47
6 9 1/3 1/5 1 0 16 48 2 1 . 1 5.0 0.56
7 9 1/3 1 /1 2 4.5 13.5 35.2 3.6 0.40
8 9 1/3 1 / 1 1 0 17.9 53.7 26.0 4.5 0.50
9 6 1/3 1 / 2 2 4.9 14.7 24.5 3.3 0.54
1 0 6 1/3 1 / 2 1 0 2 1 . 8 65.4 19.8 3.7 0.61
1 1 1 2 1/3 1 / 2 2 5.2 15.6 49.4 3.1 0.26
1 2 1 2 1/3 1 / 2 1 0 13.5 40.5 24.6 5.9 0.49
13 9 1 / 6 1/5 6 4.6 27.6 18.4 5.2 0.58
14 9 1 / 6 1 /1 6 5.8 34.8 26.9 4.1 0.46
15 9 1 / 2 1/5 6 15.1 30.2 25.2 4.8 0.53
16 9 1 / 2 1 /1 6 17.5 35 32.8 4.1 0.46
17 6 1/3 1/5 6 1 2 . 1 36.3 17.9 4.0 0 . 6 6
18 6 1/3 1 /1 6 15.5 46.5 25.8 3.1 0.52
19 1 2 1/3 1/5 6 9.0 27.0 26.5 5.3 0.44
2 0 1 2 1/3 1 /1 6 1 0 . 6 31.8 35.8 4.5 0.38
2 1 9 1/3 1 / 2 2 2 . 2 13.2 29.1 3.6 0.40
2 2 9 1 / 6 1 / 2 1 0 7.7 46.2 19.4 5.2 0.58
23 9 1 / 2 1 / 2 2 6.7 13.4 37.0 3.6 0.40
24 9 1 / 2 1 / 2 1 0 26.5 53.0 27.3 4.5 0.50
25 9 1/3 1 / 2 6 9.4 28.2 2 1 . 8 5.1 0.57
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 160/265
138
Table 8.5: Parameter estimates and effect test for flocculent sludge
Term Estimate Sum o f squares % o f Sum o f squares
Intercept 5.110 Not applicable Not applicable
MLVSS 0.489 2.871 15.7
Vf/V, -0.258 0.796 4.3
t f / t r -0.383 1.756 9.6
Sin 0.621 4.625 25.3
MLVSS * MLVSS -0.707 2.663 14.5
Vf /Vt * MLVSS -0.618 1.525 8.3
Vf /vt * Vf jv t -0.419 0.937 5.1
t f tr * MLVSS 0.018 0 . 0 0 1 0 . 0
t f / t r *Vf /Vt 0.105 0.044 0 . 2
l (r * tf l fr -0.204 0 . 2 2 2 1 . 2
Sin * MLVSS 0.613 1.501 8 . 2
Sin * Vf / Vt -0.150 0.090 0.5
Sin * t f j t r 0.030 0.004 0 . 0
Sin * Sin -0.489 1.276 7.0
Figures 8.1, 8.2, and 8.3 show the contour plots for the maximum loading rate
when the influent COD is low (2,000 mg COD/L). It can be seen that for low strength
influent, the optimum design MLVSS is around medium (9,000 mg COD/L), and the
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 161/265
139
optimum fi ll volume w ill be sligh tly lower than the medium value (4 L ). For the fill/rea ct
ratio, the maximum OLR decreases from low fill/react ratio to medium fill/react ratio but
then increases as fill/react ratio increases further. This suggests a non-linear relationship
between the maximum OLR and the fill/react ratio. Table 8.5 indicates that there is a
strong interaction between fill volume and MLVSS. Reactors with different MLVSS
levels have different optimum f il l volumes. For example, i f the reactor MLVSS is high, a
lower fi ll volume is better, while i f the reactor MLVSS is low , a higher fi ll volume is
better.
0.5 -
£4—
>
-0.5 -
1.5 -1 -0.5 0 0.5 1 1.5
MLVSS
Figure 8 .1: Contour plot o f maximum OLR fo r flocculent sludge (S jn low; t f j t r low)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 162/265
140
0.5
-0.5 -■
1.5 -1 -0.5 0 0.5 1 1.5
MLVSS
Figure 8.2: Contour plot o f maximum OLR for floccu lent sludge (Si„ low ; t f j t r
medium)
0.5
>
-0.5
1.5 -1 -0.5 0 0.5 1 1.5
MLVSS
Figure 8.3: Contour plo t o f maximum OLR fo r flocculen t sludge (Sjn low; t f j t r high)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 163/265
0.5 -
£>
-0.5 -
-1.5
1.5 -1 -0.5 0 0.5 1 1.5
MLVSS
Figure 8 .4 : Contour plot o f maximum O L R for flocculent sludge (S jn medium; tj- jt r
low)
0.5 -■
>
-0.5 -
-1.5
- 1 . 5 -1 - 0 . 5 0 0 . 5 1 1 .5
MLVSS
Figure 8 .5 : Contour plot of maximum O L R for flocculent sludge (S jn medium; t f Jtr
medium)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 164/265
142
0.5 -
£5
-0.5 -
1.5 -1 -0.5 0 0.5 1 1.5
MLVSS
Figure 8 .6 : Contour plot o f maximum OLR fo r flocculen t sludge (Sjn medium; tf j tr
high)
0.5
£>
-0.5
1.5 -1 -0.5 0 0.5 1 1.5
MLVSS
Figure 8.7: Contour plot o f maximum OLR for flocculent sludge (Sjn high; t y j t r low)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 165/265
143
0.5
£>
-0.5
1.5 -1 -0.5 0 0.5 1 1.5
MLVSS
Figure 8 .8 : Contour plot o f maximum OLR for flocculent sludge (Sin high; /y / tr
medium)
0.5 -
-0.5 -
1.5 -1 -0.5 0 0.5 1 1.5MLVSS
Figure 8.9: Contour p lot o f maximum OLR fo r flocculent sludge ( S j „ high; t f j t r high)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 166/265
144
Figures 8.4, 8.5, and 8 . 6 show the contour plots for the maximum loading rate
when the influent COD is medium (6,000 mg COD/L). It can be seen that for medium
strength influent, the optimum design MLVSS is slightly less than the high value (12,000
mg CO D/L), and the optimum fi ll volume w ill be close to the lower value (2 L). For the
fill/react ratio, the lower, the better.
Figures 8.7, 8 .8 , and 8.9 show the contour plots for the maximum loading rate
when the influent COD is high (10,000 mg COD/L). For high strength influent, high
MLVSS, low fill volume, and low fill/react ratio are the optimum conditions.
8.5.2 Granulated sludge
The simulation results for the maximum organic loading rate are presented in
Table 8 .6 . For the granulated sludge, the highest organic loading is 30.2 g/L/d (run 19),
when the MLVSS is high (60,000 mg COD/L), fill volume is medium (4 L), fill/react
ratio is low (1:3), and influent COD is medium (40,000 mg/L). The lowest organic
loading rate is 9.7 g/L/d (run 18), when the MLVSS is low (20,000 mg COD/L), fill
volume is medium (4 L), fill/react ratio is high (3:1), and influent COD is medium
(40,000 mg/L). The cycle time ranges from 4.1 hours (run 21) to 44.3 hours (run 2). The
hydraulic retention time ranges from 19.8 hours (run 5) to 130.8 hours (run 10). SRT
ranges from 16.3 days (run 17) to 33.8 days (run 20). The specific organic loading rate
ranges from 0.39 (run 11) to 0.70 (run 17) g COD/g COD/d.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 167/265
145
Table 8.6: Simulation results of maximum OLR for granulated sludge
RunMLVSS
(g/L)vf ! vt t f / t r
s»,
(g/L) (hours)
HRT
(hours)
SRT
(days)
OLR
(g/L/d)
SOLR
(g/g/d)
1 2 0 1 / 6 1 /1 40 14.7 8 8 . 2 21.3 10.9 0.54
2 2 0 1 / 2 1 /1 40 44.3 8 8 . 6 25.5 1 0 . 8 0.54
3 60 1 / 6 1 /1 40 6 . 1 36.6 27.0 26.2 0.44
4 60 1 / 2 1 /1 40 17.7 35.4 32.4 27.1 0.45
5 40 1/3 1/3 2 0 6 . 6 19.8 19.6 24.2 0.61
6 40 1/3 1/3 60 17.8 53.4 17.1 27.0 0.67
7 40 1/3 3/1 2 0 8.7 26.1 30.2 18.4 0.46
8 40 1/3 3/1 60 25 75 27.9 19.2 0.48
9 2 0 1/3 1 /1 2 0 14.6 43.8 23.7 1 1 . 0 0.55
1 0 2 0 1/3 1 / 1 60 43.6 130.8 2 2 . 0 1 1 . 0 0.55
1 1 60 1/3 1 / 1 2 0 6 . 8 20.4 33.3 23.5 0.39
1 2 60 1/3 1 /1 60 16 48 25.5 30.0 0.50
13 40 1 / 6 1/3 40 6 . 2 37.2 16.6 25.8 0.65
14 40 1 / 6 3/1 40 8.5 51 26.4 18.8 0.47
15 40 1 / 2 1/3 40 18.4 36.8 20.4 26.1 0.6516 40 1 / 2 3/1 40 26.3 52.6 32.2 18.3 0.46
17 2 0 1/3 1/3 40 2 2 . 8 68.4 16.3 14.0 0.70
18 2 0 1/3 3/1 40 33 99 27.0 9.7 0.48
19 60 1/3 1/3 40 1 0 . 6 31.8 23.7 30.2 0.50
2 0 60 1/3 3/1 40 13.1 39.3 33.8 24.4 0.41
2 1 40 1 / 6 1 / 1 2 0 4.1 24.6 24.4 19.5 0.49
2 2
401 / 6 1 /1
60 10.764.2 20.5 22.4 0.56
23 40 1 / 2 1 / 1 2 0 11.9 23.8 29.2 2 0 . 2 0.50
24 40 1 / 2 1 / 1 60 34.1 6 8 . 2 26.8 2 1 . 1 0.53
25 40 1/3 1 / 1 40 15.6 46.8 25.3 20.5 0.51
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 168/265
146
Table 8.7 presents parameter estimates for the standard least squares response
surface model. Compared to the flocculent sludge, reactors with granulated sludge have a
much higher maximum OLR. The intercept for the regression model is 20.5 for
granulated sludge, versus 5.1 for flocculent sludge. The simulation results are in
agreement w ith the analysis in Chapter 5; the amount o f active biomass in the reactor
determines the maximum OLR o f the reactor, while the amount o f sludge a reactor can
retain depends on the settling characteristics o f the sludge.
Table 8.7: Parameter estimates and effect test for granulated sludge
Term Estimate Sum o f squares % o f Sum o f squares
Intercept 20.510 Not applicable Not applicable
MLVSS 7.839 734.43 79.80
vf ! vt -0.008 0 . 0 0 1 0 . 0 0
tf ! tr -3.212 123.84 13.46
Sin 1.159 16.12 1.75
MLVSS * MLVSS -2.052 22.50 2.44
Vf /Vt * MLVSS 0.233 0 . 2 2 0 . 0 2
V f /V t * V f / V t 0.238 0.30 0.03
t f / t r * MLVSS -0.355 0.50 0.05
t f / t r *Vf /Vt -0.213 0.18 0 . 0 2
t f / t r * t f j t r 1.348 9.70 1.05
S^ * MLVSS 1.601 10.30 1 . 1 2
S i n * Vf /Vt -0.493 0.97 0 . 1 1
Sin * t f l t r -0.480 0.92 0 . 1 0
Sin * Sin 0.271 0.39 0.04
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 169/265
147
8.6 Discussion
The simulations presented above show that influent COD and MLVSS are two
major factors that affect the organic loading o f AnSBRs, which is expected. The
interesting finding is that the influent COD affects the optimal MLVSS and optimum fill
volume in terms o f maximum organic loading rate. From the analysis presented in
Chapter 5, it is known that the loading rate o f anaerobic systems is a positive function o f
reactor MLVSS concentration. Therefore the maximum organic loading rate a reactor can
achieve depends on the maximum amount o f MLVSS the reactor can retain. U nlike
continuous anaerobic reactors, AnSBRs have a distinct settle cycle; i f the settle time is
long enough, AnSBRs can retain higher VSS concentrations comparable to other reactor
configurations. However, longer settle times decrease the loading o f AnSBRs. There is a
tradeoff between the settle time and VSS concentration in the reactor and the f il l volume.
Bagley and Brodkorb (1999) predicted that a long fill cycle is beneficial for the
AnSBR system. The influent COD examined by Bagley and Brodkorb (1999) was 2000
mg/L. The simulation results are in agreement with the prediction o f Bagley and
Brodkorb (1999) w ith respect to low influent COD conditions. However, the simulations
show the maximum organic loading rate increases w ith the decrease o f fill/react ra tio for
medium and high strength influen t COD.
To further examine the effect o f fill/react ratio on the operation o f AnSBRs,
additional simulations were carried out. Figures 8.10, 8.11, and 8.12 present the
simulation results o f indiv idua l VFAs versus time under different fill/rea ct ratios while
other conditions are the same. The common conditions for these simulations are
summarized in Table 8 .8 . The effluent CODs fo r these simulations are w ith in 70 to 80
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 170/265
148
mg COD/L. Figure 8.10 shows that a short f il l time results in the accumulation o f
propionic and acetic acids right after the fill stage ends. For a medium fill time the
propionic acid accumulates while the acetic acid concentration remains low (Figure
8.11). For a long fill time both propionic acid and acetic acid concentrations are flat and
low throughout the AnSBR cycle (Figure 8.12). The operation o f AnSBRs under a long
f i ll time and short react time is close to a continuous reactor.
2500
lactate2000 -
Q
g 1500 JD)E
1000 - -
ropionate
£ 2
"go
X!1 3
CO
acetate
500
butyrate
2412 16 200 84
Time (hours)
Figure 8.10: Individua l VFAs versus time ( t j / tr = 0.5/22)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 171/265
149
800
propionate^ 600
oOO
E 400
acetate
butyrate
242012 1680 4
Time (hours)
Figure 8.11: Individu al VFAs versus time ( t f j t r = 12.5/10)
100
acetateQ
OOO)E
propionate
40
CO-Q
w 20lactate
butyrate
2416 201280 4
Time (hours)
Figure 8.12: Individua l VFA s versus time ( t f j t r = 20.5/2)
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 172/265
150
Table 8.8: Simulation conditions
Item Parameter Value
1 Cycle length (hours) 24
2 Settle time (hours) 1
3 Decant time (hours) 0.5
4 HRT (hours) 48
5 F ill volume (L) 6
6 Settle volume (L) 6
7 Settled VSS (mg CO D/L) 2 0 , 0 0 0
8 VSS (mg COD/L) 1 0 , 0 0 0
9 Influent COD (mg COD/L) 8000
1 0 Organic loading rate (g COD/L/d) 4
1 1 Specific sludge loading rate (g COD/g COD VS S/d) 0.4
1 2 Solids retention time (days) 21.4
The predicted microbial population distributions are presented in Table 8.9. The
microbial population d istribution o f a continuous reactor operated under the same loading
rate is also presented for comparison. Table 8.9 shows that a short fill time results in
higher percentages o f Xp and X l. This can be expected from the analysis presented in
Chapter 5, as a short fi l l time results in a spike o f hydrogen partial pressure. The high
hydrogen partial pressure regulates the product distribution o f glucose consumption and
produces more lactate and propionate. As a consequence, the reactor w ill accumulate
more lactate and propionate bacteria after long-term successful reactor operation. Though
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 173/265
151
short f il l t ime results in a higher production o f propion ic acid from glucose degradation,
the AnSBRs are able to degrade the propion ic acid by increasing the percentage o f
propionic acid consuming microorganisms.
However, when the reactor is in its initial startup stage or when the reactor is
overloaded, the propionic acid produced is not consumed completely, and the growth o f
propionic acid consuming microorganisms is limited.
Table 8.9: M icrob ial popu lation distributions
Fill/react Xs
(%)
x ,
(%)
X F
(%)
x P
(%)
X L
(%)
X B
(%)
X A
(%)
X H
(%)
0.5/22 12.4 2.5 25.0 10.3 2 1 . 1 1.4 11.9 15.4
12.5/10 14.8 3.1 30.6 5.1 12.5 2.5 13.9 17.5
20.5/2 14.4 3.3 32.2 4.2 1 1 . 0 2.4 14.4 18.1
CSTR 14.7 3.4 32.9 3.8 10.4 2.3 14.4 18.1
Although the simulations show low fill/react time ratios being preferred, high
fill/rea ct ratios may nevertheless be beneficial fo r the operation o f AnSBRs in several
aspects. A low fill/react time ratio increases the peak VFA concentration appearing at the
end o f the fi ll stage. This increases the alkalinity requirement in the influe nt to neutralize
the pH. Also, the high VFA concentration within the AnSBR cycle makes it susceptible
to overload. The pH drops sign ifican tly (below 6.5) at the end of the fi ll stage, and the
reactor pH buffer capacity drops significantly. Therefore, for a reactor in its startup stage
a high fill/react ratio is beneficial. A reactor operated with a high fill/react ratio w ill also
be more resilient to an inh ibitor entering the system. Another potential problem w ith the
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 174/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 175/265
Chapter 9 Summary and Conclusions
9.1 Summary
A major disadvantage o f existing anaerobic models (Costello et al., 1991a; Bagley
and Brodkorb, 1999) is their poor prediction o f microbial population. This is due to the
use o f inappropriate hydrogen partial pressure regulation and inh ibition functions, as has
clearly been shown in this thesis. Anaerobic Digestion Model No. 1 (AD M 1) (Batstone et
al., 2 0 0 2 ) also reported that the hydrogen partial pressure product regulation functions
described by Mosey (1983) and further developed by Costello et al. (1991a) could not be
used consistently with a variety o f experimental data sets. No hydrogen regulation
function is used in the AD M 1.
New hydrogen partial pressure regulation functions are derived from the rate
equation o f ordered single-displacement enzymatic reactions having two substrates
(Lehninger, 1975) and the equation describing the relationship between the oxidation
state o f the NADH/NAD+ couple and hydrogen partial pressure (Mosey, 1983). New
hydrogen partial pressure inhibition functions are developed from a thermodynamic basis
for propionate and butyrate degradations. Other models (Batstone et al., 2002; Costello et
al., 1991a; Bagley and Brodkorb, 1999; Masse and Droste, 2000) used a non-competitive
inh ibition function for hydrogen partial pressure inhib ition o f propionate and butyrate
degradation. The new inhibition functions presented in this thesis are supported by recent
development o f the inhibition mechanism o f propionate degradation by hydrogen partial
pressure (Hoh and Cord-Ruwisch, 1996).
153
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 176/265
154
The sem i-implicit extrapolation method (Press et al., 1992) was implemented in
this study to solve the coupled first-order ordinary differential equations for the model.
Although the Runge-Kutta algorithm was used in other models (Masse and Droste, 2000;
Costello et al., 1991b; Kiely et al., 1997), the formulated equation set from the model is a
s tiff set o f equations (Batstone et al., 2002), for wh ich the Runge-Kutta algorithm is
unstable and introduces integra tion error.
The model is validated by a variety o f experimental data from the literature. I t is
shown that the model gives good predictions o f COD, VFAs, pH, and CH4 and CO2
production rate for AnSBRs. The model gives a better prediction than the Costello et al.
(1991b) model o f the response o f a CSTR subjected to step changes in the substrate
loading.
Mass balance analysis was carried out on each metabolic group o f bacteria and its
correspondent substrate for anaerobic reactors operated under steady state. This analysis
revealed that propionate consuming acetogenesis, instead o f aceticlastic methanogenesis,
is the rate lim iting step for anaerobic treatment. This finding is in agreement w ith
experimental observations reported in the literature (Bjonsson et al., 1997) that
propionate buildup is the firs t sign o f reactor overload. The maximum specific loading
rate was estimated from this analysis, which could be a design criterion for anaerobic
reactors. Many anaerobic organisms, such as glucose acidogens and lactate acetogens, are
capable o f producing several products. However, the distributions among these products
are not well quantified, i.e. the product regulation functions or coefficients are not well
quantified. This analysis reveals the correlation between production rate o f intermediate
154
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 177/265
155
(.L,•) and its correspondent sludge activity (SA,). Therefore the product regulation
coefficients or functions could be determined or verified by the sludge activity data.
The sludge compositions predicted from steady state simulations agree w ell w ith
a variety o f experimental data (sludge activities, sludge methanogenic activ ity) in the
literature. This indicates that the model predicts the microb ial population very w ell; other
models are poor in predicting the m icrobial population. The s imulation o f the startup o f
an anaerobic reactor further illustrates the predictive ability on microbial population by
the current model. The simulated sludge methanogenic activ ity versus time agrees well
w ith experimental data from the literature for the startup o f an anaerobic reactor.
The solids-liquid separation process is important for anaerobic reactors, though
many configurations o f anaerobic reactors, such as AnSBR and UASB, do not have
separate solids- liquid separation devices. The volum etric organic loading rate o f
anaerobic processes is lim ited by the quantity o f active biomass that a reactor can retain,
as the maximum specific organic loading rate remains constant. The solids-liquid
separation during the settle stage o f AnSBRs is simulated using a dynam ic model
developed for the gravitational settling process (Zheng and Bagley, 1998). This settling
model was validated by literature data on vertical solids concentration profiles for both
laboratory and field-scale clarifiers operated under steady state, and was validated by
literature data on the batch settling process (Zheng and Bagley 1999). This settling model
is applied to predict the vertical solids profile o f UASB reactors.
The Box-Behnken response surface design is applied to evaluate the performances
o f AnSBRs under different design and operational parameter values. Four factors were
selected, including MLVSS, fill volume, fill/react time ratio, and influent COD. Two sets
155
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 178/265
156
o f simulations were carried out based on the sludge characteristics: floccu lent sludge and
granulated sludge. The highest OLR achieved in these simulations is 5.9 g/L/d for
flocculent sludge and 30.2 g/L/d for granulated sludge. The simulation results show that
the influent strength constrains the maximum organic loading rate that AnSBRs can
reach. Therefore it is an important factor to be considered in the design o f AnSBRs. The
reactor MLVSS is a very important factor for the maximum loading o f AnSBRs. The
optimum MLVSS concentration depends on influent strength and sludge settling
characteristics. The optimum fill volume depends on other factors such as influent COD
and reactor MLVSS. Short fill/react ratios have a positive effect on maximum organic
loading rate.
The current model is based on the model o f Bagley and Brodkorb (1999). M ajor
developments o f the current model compared to the model o f Bagley and Brodkorb
(1999) include:
• Current model works for continuous reactors as well as for AnSBRs
• Current model implements new hydrogen partial pressure product regulation
functions.
• Current model implements new hydrogen partial pressure inh ibition functions.
• Current model implements the sem i-imp licit extrapolation method to solve the
ordinary differential equations.
The new developments improve the performance o f the model, for example, through
better prediction o f m icrobial population and improved numerical s tab ility, and are
validated by extensive experimental data from the literature.
156
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 179/265
157
9.2 Conclusions
The following conclusions are made from this study:
1. Hydrogen regulation functions incorporated in the model represent the product
distribution o f glucose degradation we ll.
2. The hydrogen inh ibition functions incorporated in this model represent the inhib ition
mechanisms o f propionate and butyrate degradation.
3. Propionate degradation is the rate lim iting step for anaerobic treatment.
4. The microbial population distributions are a reflection o f the amount o f intermediates
produced and consumed fo r anaerobic processes operated under steady state.
5. The influen t strength constrains the maximum organic loading rate that AnSBRs can
reach. The reactor MLVSS is a very important factor for the maximum loading o f
AnSBRs; in general, the reactor M LVSS has a positive effect on maximum OLR. The
optimum fi ll volume o f AnSBRs depends on other factors such as influen t COD and
reactor MLVSS.
6 . Though the simulations show that a short fill/react ratio has a positive effect on
maximum OLR under the conditions simulated, short fill/rea ct ratios may not always
be best because o f potential negative effects on the stab ility o f AnSBRs, increased
operational complexity, and possible effects on sludge granule quality.
157
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 180/265
Chapter 10 Engineering Significance and Suggestions for
Future Research
10.1 Engineering significance
The materials presented in this thesis are valuable for engineers and researchers
who engage in anaerobic process research, development, modeling, design, operation,
and optimization. These materials are also valuable for engineers and researchers who
engage in gravity settling process (e.g. secondary clarifier) research, modeling, design,
and operation.
10.1.1 Operational significance
The model developed in this study can be applied to full-scale anaerobic reactors
to predict the response o f the reactor under varying input conditions, such as influe nt
COD and HRT. The model can be applied to evaluate the potential maximum OLR o f
anaerobic reactors. The results from this study can be used for the startup o f anaerobic
reactors. This study showed the startup process can be achieved by monitoring the
effluent COD instead o f specific methanogenic activity.
The results from this study can be used to optimize the operation o f existing
anaerobic reactors. For example, this study showed that high specific organic load ing rate
has a positive effect on the volumetric organic loading rate, but has a negative effect on
the stability o f the reactor. The specific organic loading rate o f existing anaerobic reactors
can be examined for optimum specific organic loading rate applied. This can be achieved
by adjusting the applied vo lumetric organic loading rate or by adjusting the VSS (SRT) in
the reactor. Also, this study shows that a short fill/react ratio for AnSBRs is good for
158
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 181/265
159
maximum volumetric organic loading rate, but increases the influent alkalinity
requirements. The fill/react ratio could be examined for its optimum value.
10.1.2 Design significance
The results from this study can be used for the design o f anaerobic reactors. For
example, this study derives the maximum specific organic loading rate a reactor can
achieve, which implies that specific organic loading rate can be a design criterion for
anaerobic reactors. The knowledge from this study can be used for the development o f
new configurations o f anaerobic reactors. For example, this study shows that the
volum etric organic loading rate can be increased i f the hydrogen partial pressure in the
reactor can be decreased through engineering methods. An example o f these methods is
adding more hydrogen utilizing methanogens to the reactor. Another example is
designing a three-stage anaerobic reactor. The first stage is for acidogenesis and produces
VFAs and hydrogen. The hydrogen is fed to the second stage to produce
hydrogenotrophic methanogens. The VFAs from the first stage and hydrogenotrophic
methanogens from the second stage are fed to the th ird stage for methanogenesis.
The gravitational settling model developed in this thesis can be used to verify the
empirical crite ria used for the design o f secondary settler depth in engineering practice.
New design criteria for the secondary settler depth can be derived from this study. Direct
applications o f the gravitational settling model include 1 ) determining the upflow
velocity o f UASBs, 2) determining the settle time requirement for AnSBRs.
10.2 Suggestions for future research
In addition to carbohydrates, proteins and lipid s are common components o f
wastewater and the hydrolysis products o f composite particulate material. The current
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 182/265
160
model considers the degradation o f carbohydrates only. Further development o f this
model should include proteins and lipids. It is recommended that advanced optimization
techniques be employed for model calibration and that a better objective function (e.g.
the percent error o f estimate used in Masse and Droste, 2000) be chosen for the
optimization.
The current model requires a large number o f parameters, inc luding kine tic and
stoichiom etric parameters. The values o f these parameters reported in the literature vary
significantly between studies. I t is recommended to determine those parameters that w ill
impact significa ntly upon the performance o f the current model using model simulation.
It is postulated in this study that AnSBRs have similar startup time requirements
to UASB reactors. It is recommended to verify this postulate experimentally.
It is postulated in th is study that the content o f active biomass in the sludge is an
important factor for sludge granulation. It was observed that granular biomass has a
higher specific activ ity than flocculent biomass (W irtz and Dague, 1996; Lettinga et al.,
1980). It is postulated in this study that sludge granulation is a consequence (not the
cause) o f improved sludge activ ity; this postulate needs further examination.
The gravity settling model developed in this study was applied to steady state
secondary clarifiers. It is recommended to apply this model to predict the dynamic
response o f secondary clarifiers under varying loading conditions.
In the empirical design for compression depth o f secondary clarifiers (ATV,
1976), the compression depth is independent o f other design and operational parameters
o f the secondary clarifiers. The experimental data o f George and Keinath (1978) clearly
indicate that the compression depth depends on the operational parameters, such as
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 183/265
161
underflow solids concentration (Figure 7.13). It is recommended that new design criteria
for compression depth be developed using the current gravity se ttling model.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 184/265
Chapter 11 References
1. Adams, B. J. (1997). CIV 1337S - Simulation in Civil Engineering Course Notes,
Un iversity o f Toronto, Toronto ON.
2. Agu ilar, A., Casas, C., and Lema, J. M. (1995). “Degradation o f vo latile fa tty
acids by differently enriched methanogenic cultures: kinetics and inhibition.”
Wat. Res., 29(2), 505-509.
3. Andrews, J. F. and Graef, S. P. (1971). “ Dynamic modeling and simulation o f the
anaerobic digestion process.” Adv. Chem. Ser. 105, Anaerobic Biological
Treatment Processes, American Chemical Society, Washington.
4. Angenent, L. T. and Dague, R. R. (1995). “ A laboratory-scale comparison o f the
UASB and ASBR processes.” 50th Purdue Ind. Waste Conf. Proc., Lewis
Publishers, Chelsea, Mich., 365-377.
5. ATV (Abwassertechniche V ereinigung) (1976). “ Erlauterungen und
Erganzungen zum Arbeitsbericht des ATV-Fachausschusses 2.5
Absetzverfarhen.” Die Bemessung der Nachklarbecken von Belebungsanlangen.
Korrespondenz Abwasser, 23(8), 231-235.
6 . Azbar, N., Ursillo , P., and Speece, R. E. (2001). “Effect o f process configuration
and substrate complexity on the performance o f anaerobic processes.” Wat. Res.,
35(3), 817-829.
7. Bagley, D. M. and Brodkorb, T. S (1999). “ Modeling microb ial kinetics in an
anaerobic sequencing batch reactor — Model development and experimental
validation.” )'Pater Envir. Res., 71(7), 1320-1332.
162
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 185/265
163
8 . Batstone, D. J., Keller, J., Angelidaki, I., Kalyuzhnyi, S. V., Pavlostathis, S. G.,
Rozzi, A., Sanders, W. T. M., Siegrist, H., and Vavilin, V.A. (2002). Anaerobic
Digestion Model No. 1. IW A Sc ientific and Technical Report No. 13.
9. Batstone, D. J., Keller, J., New ell, R. B., and Newland, M. (2000a). “Modelling
anaerobic degradation o f complex wastewater. I: model development.”
Bioresource Technology, 75, 67-74.
10. Batstone, D. J., Keller, J., New ell, R. B., and Newland, M. (2000b). “ M od elling
anaerobic degradation o f complex wastewater. II : parameter estimation and
validation using slaughterhouse effluent.” Bioresource Technology, 75, 75-85.
11. Brodkorb, T. S (1998). “ Dynamic simulation o f m icrobial kinetics in an anaerobic
sequencing batch reactor.” M.Eng. Thesis, Un iversity o f Toronto, Toronto,
Ontario, Canada.
12. Bhargava, D. S. and Rajagopal, K. (1990). “ Modelling in zone settling for
different types o f suspended materials.” Wat. Res., 24(6), 675-683.
13.Bjonsson, L., Mattiasson, B., and Henrysson, T. (1997). “ Effects o f support
material on the pattern o f volatile fatty acid accumulation at overload in anaerobic
digestion o f semi-solid waste.” Appl. Microbiol. Biotechnol., 47, 640-644.
14. Bustos, M. C. and Concha, F. (1988). “ Simulation o f batch sedimentation with
compression.” AIChE J., 34(5), 859-861.
15. Chancelier, J. P., De Lara, M . C., Joannis, C., and Pacard, F. (1997). “ New
insights in dynamic modeling o f a secondary settler — I. flu x theory and steady-
state analysis.” Wat. Res., 31(8), 1847-1856
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 186/265
164
16. Chang, D., Hur, J. M ., and Chung, T. H. (1994). “ Digestion o f municipal sludge
by anaerobic sequencing batch reactor.” Wat. Sci. Technol., 30(12), 161-170.
17. Chatellier P. and Audic, J. M. (2000). “ A new model fo r wastewater treatment
plant clarifier simulation.” Wat. Res. 34(2), 690-693
18. Cho, S. H., Colin, F., Sardin, M., and Prost, C. (1993). “ Settling ve loc ity model o f
activated sludge.” Wat. Res., 27(7), 1237-1242.
19. Costello, D. J., Greenfield, P. F., and Lee, P. L. (1991a). “ Dynamic modeling o f a
single-stage high-rate anaerobic reactor — I. Model derivation.” Wat. Res., 25(7),
847-858.
20. Costello, D. J., Greenfield, P. F., and Lee, P. L. (1991b). “ Dynamic modeling o f a
single-stage high-rate anaerobic reactor — II Model ve rifica tion.” Wat. Res.,
25(7), 859-871.
21. Dague, R. R., Habben, C. E., and Pidaparti, S. R. (1992). “ In itia l studies on the
anaerobic sequencing batch reactor.” Wat. Sci. Technol., 26(9-11), 2429-2432.
22. Dague, R. R. and Pidaparti, S. R. (1992). “ Anaerobic sequencing batch reactor
treatment o f swine wastes.” 46th Purdue Ind. Waste Conf. Proc., Lewis
Publishers, Chelsea, M ich., 751-760.
23. Denac, M ., G riffin , K., Lee, P. L., and Greenfield, P. F. (1988). “ Selection o f
controlled variables for a high rate anaerobic reactor.” Envir. Technol. Lett., 9,
1029-1040.
24. Dixon, D. C. (1978). “ Momentum-balance aspects o f free-settling theory, I II :
transient compression resistance.” Separation Sci. Tech., 13(9), 753-766
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 187/265
165
25. Ekama, G. A., Barnard, J. L., Crowther, R., Gunthert, F. W., Krebs, P.,
McCorquodale, J. A., Parker, D. S., and Wahlberg, E. J. (1997). Secondary
settling tanks: theory, modeling, design and operation. IW A Scientific and
Technical Report No. 6 .
26. Eng, S. C., Fernandes, X. A ., and Paskins, A. R. (1986). “ Biochemical effects o f
administering shock loads o f sucrose to a laboratory-scale anaerobic (UA SB )
effluent treatment plant.” Wat. Res., 20(6), 789-794.
27. Fang, H. H. P. and Chui, H. K. (1993). “ Maximum COD loading capacity in
UASB reactors at 37°C.” J. Envir. Engrg., ASCE, 119 (1), 103-119.
28. Fernandez, L., Kennedy, K. J. and Ning, Z. (1993). “ Dynamic modelling o f
substrate degradation in sequencing batch anaerobic reactors.” Wat. Sci. Tech.,
27(11), 1619-1628.
29. Fernandez, A. S., Hashshm, S. Y., Dollhopf, S. L., Raskin, L., Glagoleva, O.,
Dazzo, F. B., Hickey, R. F., Criddle, C. S., and Tiedje, J. M. (2000). “ Flexible
community structure correlates with stable community function in methanogenic
bioreactor communities perturbed by glucose.” Applied and Environmental
Microbiology, 66(9), 4058-4067.
30. Fersht, A. (1985). Enzyme Structure and Mechanism. Reading [Eng.] San
Francisco, W.H. Freeman.
31. Fitch, B. (1979). “ Sedimentation o f flocculent suspensions: state o f the art.”
AIChEJ., 25(6), 913-930.
32. Fitch, B. (1993). “ Thickening theories — an analysis.” AIChE J., 39(1), 27-36.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 188/265
166
33. George, D. B. and Keinath, T. M . (1978). “Dynamics o f continuous thicken ing.”
J. WPCF, 50(11), 2560-2572.
34. Ghangrekar, M. M ., Joshi, S. G., and Asolekar, S. R. (1998). “ Effect o f loading on
start-up, efficiency, and granulation in UASB reactor.” Proceedings of the Water
Environment Federation Technical Conference and Exhibition, Singapore.
35. GLUMRB (1968). Recommended standards for sewage works. Great Lakes-
Upper Mississipp i River Board o f State Sanitary Engineers. Health Education
Services, Inc, Albany, New York.
36. Gossett, J. M. and Belser, R. L. (1982). “ Anaerobic digestion o f waste activated
sludge.” J. Envir. Engrg., ASCE, 108(6), 1101-1120.
37. Grootaerd, H., Liessens, B., and Verstraete, W. (1997). “ Effects o f direc tly
soluble fibrous rapidly acidifying chemical oxygen demand and reactor liquid
surface tension on granulation and sludge-bed stability in upflow anaerobic
sludge-blanket reactors.” Appl. Microbiol. Biotechnol., 48, 304-310.
38. Guiot, S. R. (1991). “Modeling o f the upflow anaerobic sludge be d-filter system:
a case w ith hysteresis.” Wat. Res., 25(3), 251-262.
39. Hartel, L. and Popel, H. J. (1992). “ A dynamic secondary clarifier model
including processes o f sludge thickening.” Wat. Sci. Tech., 25(6), 267-284.
40. Henze, M., C. Grady, W. Gujer, G. Marais, and T. Matsuo (1987). Activated
sludge model No. 1. IAWPRC Scientific and Technical Report No. 1, IAWPRC,
London, UK
41. Henze, M ., W. Gujer, T. M ino, T. Matsuo, and G. Marais (1995). Activated
sludge model No. 2. International Association for Water Quality (IAW Q ) Task
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 189/265
167
Group on Mathematical Modelling for Design and Operation on Biological
Wastewater Treatment Processes, IAW Q Scientific and Technical Report No. 3,
IAWQ, London, UK
42. Henze, M. and Harremoes, P. (1983). “ Anaerobic treatment o f wastewater in
fixed film reactors — A literature review.” Wat. Sci. Tech., 15(8/9), 1-101.
43. Higgins, H. G. (2001). “ The effects o f physicochemical properties o f secondary
sludge on settling models.” M.A.Sc. Thesis, Un iversity o f Toronto, Toronto,
Ontario, Canada.
44. Hoh, C. Y. and R. Cord-Ruwisch (1996). “ A practical kinetic model that
considers endproduct inhibition in anaerobic digestion processes by including the
equilibrium constant.” Biotech, and Bioengrg., 51, 597-604.
45. Iannotti, E., Kafkew itz, D., Wolin, M. J., and Bryant, M. P. (1973). “Glucose
fermentation products o f Ruminococcus albus grown in continuous culture with
Vibrio succinogenes: changes caused by interspecies transfer o f H 2.” J. Bact., 114,
1231-1240.
46. Islam, M. A. and Karamisheva, R. D. (1998). “ In itia l settling rate/concentration
relationship in zone settling.” J. Envir. Engrg., ASCE, 124 (1), 39-42.
47. IWPC (1973). A guide to the design o f sewage purification works. Water Institute
o f Southern Africa , P.O. Box 6011, Halfway House, 1685, Gauteng, South Africa.
48. James, A ., Chernicharo, C. A. L., and Campos, C. M. M. (1990). “ The
development o f a new methodology fo r the assessment o f specific methanogenic
activity.” Wat. Res., 24(7), 813-825.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 190/265
168
49. Jhung, J. K. and Choi, E. (1995). “ A comparative study o f UASB and anaerobic
fixed film reactors w ith development o f sludge granulation.” Wat. Res., 29(1),
271-277.
50. JMP® Statistical Discovery Software. (1997). Version 3.2.2. SAS Institute, Inc.,
Cary, North Carolina.
51. Karl, J. R. and Wells, S. A. (1999). “ Numerical model o f
sedimentation/thickening with inertial effects.” J. Envir. Engrg., ASCE, 125 (9),
792-806.
52. Kaspar, H. F. and Wuhrmann, K. (1978). “ Product inh ibition in sludge digestion.”
Micro. Ecol., 4, 241-248.
53. Kettunen, R. H. and Rintala, J. A. (1997). “ The effect o f low temperature
(5-29°C ) and adaptation on the methanogenic activity o f biomass.” Appl.
Microbiol. Biotechnol., 48, 570-576.
54. Kettunen, R. H. and Rintala, J. A. (1998). “ Performance o f an on-site UASB
reactor treating leachate at low temperature.” Wat. Res., 32(3), 537-546.
55. K iely , G. Tayfur, G., Dolan, C., and Tanji. K. (1997). “ Physical and mathematical
modeling o f anaerobic digestion o f organic wastes.” Wat. Res., 31(3), 534-540.
56. Kim, N. (2000). “ Performance o f a laboratory-scale anaerobic sequencing batch
reactor treating lactose.” M.Eng. Thesis, Un iversity o f Toronto, Toronto, Ontario,
Canada.
57. Kos, P. (1977). "Fundamentals o f gravity thicken ing." AIChE J. 23(11), 99-105.
58. Landman, K. A ., White, L. R., and Buscall, R. (1988). “ The continuous-flow
gravity thickener: steady state behavior.” AIChE J. 34(2), 239-252.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 191/265
169
59. Langenhoff, A. A . and Stuckey, D. C. (2000). “ Treatment o f dilute wastewater
using an anaerobic baffled reactor: effect o f low temperature.” Wat. Res., 34(15),
3867-3875.
60. Lawrence, A. W. and McCarty, P. L. (1969) “ Kinetics o f methane fermentation in
anaerobic treatment.” J. Water Pollut. Control Fed., 41, R l.
61. Lehninger, A. L. (1975). Biochemistry. Worth Publishers, Inc., New York, N.Y.
62. Lettinga, G., Van Velsen, A. F. M., Hobma, S. W., De Zeeuw, W., and Klapwijk,
A. (1980). “ Use o f the upflow sludge blanket (U SB) reactor concept fo r b iological
wastewater treatment, especially fo r anaerobic treatment.” Biotechnol. Bioengrg.,
22, 699-734.
63. Lettinga, G., Rebac, S., Parshina, S., and Nozhevnikova, A . (1999). “ High-rate
anaerobic treatment o f wastewater at low temperatures.” Applied and
Environmental Microbiology, 65(4), 1696-1702.
64. MacLeod, F. A., G uiot, S. R., and Costerton, J. W. (1990). “ Layered structure o f
bacterial aggregates produced in an upflow anaerobic sludge bed and filte r
reactor.” Applied and Environmental Microbiology, 56(6), 1598-1607.
65. Maillacheruvu, K . Y. and Parkin, G. F. (1996). “ Kinetics o f growth, substrate
utilization and sulfide toxicity for propionate, acetate and hydrogen utilizers in
anaerobic systems.” Water Envir. Res., 68(7), 1099-1106.
6 6
. Masse, D. I. and Droste, R. L. (2000). “ Comprehensive model o f anaerobic
digestion o f swine manure slurry in a sequencing batch reactor.” Wat. Res.,
34(12), 3087-3106.
roduced with permission o f the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 192/265
170
67. Merke l, W., Manz, W., Szewzyk, U., and Krauth, K. (1999). “ Population
dynamics in anaerobic wastewater reactors: modelling and in situ
characterization.” Wat. Res., 33(10), 2392-2402.
6 8 . Morvai, L. M iha ltz, P. and Czako, L. (1992). “ The kinetic basis o f a new startup
method to ensure the rapid granu lation o f anaerobic sludge.” Wat. Sci. Tech.,
25(7), 113-122.
69. Mosche, M . and Jordening, H. (1999). “ Comparison o f different models o f
substrate and product inh ibition in anaerobic digestion.” Wat. Res., 33(11), 2545-
2554.
70. Mosey, F. E. (1983). “ Mathematical modeling o f the anaerobic digestion process:
regulatory mechanism for formation o f short-chain volatile acids from glucose.”
Wat. Sci. Technol., 15, 209-232.
71. Nam oli, S. K. and Mehrotra, I. (1997). “ Sludge blanket o f UASB reactor:
mathematical simulation.” Wat. Res., 31(4), 715-726
72. Ng, W. J. (1988). “ A sequencing batch anaerobic reactor for treating p iggery
wastewater.” Biological Wastes, 28, 39-51.
73. O’Flaherty, V ., Lens, P. N. L ., de Beer, D., and Colleran, E. (1997). “ Effect o f
feed composition and upflow velocity on aggregate characteristics in anaerobic
upflow reactors.” Appl Microbiol Biotechnol, 47, 102-107.
74. Ong, S. L., Hu, J. Y., Ng. W. J., and Lu, Z. R. (2002). “ Granulation enhancement
in anaerobic sequencing batch reactor operation.” J. Envir. Engrg., ASCE, 128
(4), 387-390.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 193/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 194/265
172
83. Shizas, I. (2000). “ Startup o f a laboratory-scale anaerobic sequencing batch
reactor treating glucose.” M.A.Sc. Thesis, Un iversity o f Toronto, Toronto,
Ontario, Canada.
84. Show, K. and Tay, J. (1999). “ Influence o f support media on biomass growth and
retention in anaerobic filters .” Wat. Res., 33(6). 1471-1481.
85. Skiadas, I. V., Gavala, H. N., and Lyberatos, G. (2000). “ Mod elling o f the
periodic anaerobic baffled reactor (PABR) based on the retaining factor concept.”
Wat. Res., 34(15), 3725-3736.
8 6 . Snoeyink, V. L. and Jenkins, D. (1980). Water chemistry. W iley, New York.
87. Speece, R. E. (1996). Anaerobic biotechnology fo r industrial wastewater. Archae
Press, Nashville, Tenn.
8 8 . Stumm, W., and Morgan, J. J. (1981). Aquatic Chemistry. 2nd Ed., W iley & Sons,
New York.
89. Sung, S. and Dague, R. R. (1995). “ Laboratory studies on the anaerobic
sequencing batch reactor.” Water Envir. Res, 67(3), 295-301.
90. Suthaker, S., Polprasert, C., and Droste, R. L. (1991). “ Sequencing batch
anaerobic reactors for treatment o f high-strength organic wastewater.” Wat. Sci.
Technol., 23, 1249-1257.
91.Takacs I., Patry G. G. and Nolasco D. (1991). “A dynamic model o f the
clarification-thickening process.” Wat. Res., 25(10), 1263-1271.
92. Tay, J. H. and Yan, Y . G (1996). “ Influence o f substrate concentration on
microbial selection and granulation during startup o f upflow anaerobic sludge
blanket reactors.” Water Envir. Res, 68(7), 1140-1150.
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 195/265
173
93. Tay, J. H. and Zhang, X. (2000a). “ Stab ility o f high-rate anaerobic systems. I:
Performance under shocks.” J. Envir. Engrg., ASCE, 126(8), 713-725.
94. Tay, J. H. and Zhang, X. (2000b). “ Stab ility o f high-rate anaerobic systems. II:
Fuzzy stability index.” J. Envir. Engrg., ASCE, 126(8), 726-731.
95. Tay, J. H., Xu, H. L., and Teo, K. C. (2000). “Molecular mechanism o f
granulation. I: H+ Translocation-dehydration theory.” J. Envir. Engrg., ASCE.
126(5), 403-410.
96. Teo, K. C., Xu , H. L ., and Tay, J. H. (2000). “ Molecular mechanism o f
granulation. II: Proton Translocating activity.” J. Envir. Engrg., ASCE, 126(5),
411-418.
97. Thaveesri, J., Liessens, B., and Verstraete, W. (1995). “ Granular sludge growth
under different reactor liquid surface tensions in lab-scale upflow anaerobic
sludge blanket reactors treating wastewater from sugar-beet processing.” Appl.
Microbiol. Biotechnol., 43, 1122-1127.
98. Vanderhasselt, A. and Vanrolleghem, P. A. (2000). “ Estimation o f sludge
sedimentation parameters from single batch settling curves.” Wat. Res., 34(2),
395-406
99. Vesilind, A. P. (1968). “ Discussion o f ‘Evaluation o f activated sludge thickening
theories,’ by R. I. Dick and B. B. Ewing.” J. Sanit. Engrg Div., ASCE, 94, 185-
191.
100. Watts, R. W., Svoronos, S. A., and Koopman, B. (1996). “ One
dimensional modeling o f secondary clarifiers using a concentration and feed
velocity-dependent dispersion coefficient.” Wat. Res., 30(9), 2112-2124.
roduced with permission o f the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 196/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 197/265
Appendix A Stoichiometry
Tables A l and A2 are stoichiometry metrices for the model (see Table 3.3 for S
and X and see Bagley and Brodkorb, 1999 for further definitions).
175
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 198/265
Table Al: Stoichiometric coefficients( ia ) for soluble components (Bagley and Brodkorb, 1999)
Process 1,SC 2,Sf 3,Ss 4,Si 5,S a 6 ,SP 7,Sl 8 ,Sb 9,S M X C / 3
o' 1 1 ,Sc0 2
1 Hydrolysis: Xs to soluble fxsc fxSF fxss fxsi2 Hydrolysis: Sc to Sf - 1 fsCF fscs fsci3 Hydrolysis : Ss to Sf fsSF - 1 fssi4 Growth: Sf to S a - 1
Y XFA
Y 1 A,FA
Y XFA
Y 1 H , FA
Y 1 XFA
Y 1 COl,FA
Y 1 XFA
5 Growth: Sf to Sl —1
Y XFL
Y,„fl
Y 1 XFL
6 Growth: Sf to Sb —1
Y 1 XFB
Y 1 B,FB
Y 1 XFB
Y 1 H,FB
Y 1 XFB
Y 1 C02,FB
Y 1 XFB
7 G rowth: Sp to S a Y 1 A,PA
Y 1 XFA
- 1
Y 1 XPA
Y H J’A
Y 1 XPA
Y 1 COl,PA
Y 1 XPA
8 Growth: Sl to S a Y 1 A,LA
Y 1 XIA
- 1
Y 1 XIA
Y 1 H,LA
Y 1 XIA
Y 1 COl,LA
Y 1 XIA
9 Growth: Sl to Sp Y 1 p ,lp
Y 1 XLP
- 1
Y 1 XLP
- y 1 HJ.P
Y 1 XLP
1 0 Growth: Sb to S a Y 1 A,BA
Y 1 XBA
- 1
Y 1 XBA
Y H ,BA
Y 1 XBA
1 1 Growth: S a to Sm - 1
Y 1 XAM
Y M,AM
Y 1 XAM
Y 1 COl,AM
Y 1 XAM
1 2 Growth: Sh to Sm Y 1 M , H M
Y 1 XHM
- 1
Y 1 XHM
- y C02,HM
Y 1 XHM
13 Cell lysis fBSC fBSF fBSS fBSI
176
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 199/265
Table A2: Stoichiometric coefficients (v,y) for particulate components (Bagley and Brodkorb, 1999)
Process 1,XS 2 , Xi 3 ,X f 4, X P 5, X L 6 , X B 7 ,X a 8 ,X h
1 Hydrolysis: Xs to soluble - 1
2 Hydrolysis: Sc to Sf
3 Hydrolysis: Ss to Sf
4 Growth: Sf to S a 1
5 Growth: Sf to Sl 1
6 Growth: Sf to Sb 1
7 Growth: Sp to S a 1
8 Growth: Sl to S a 1
9 Growth: Sl to Sp 1
1 0 Growth: Sb to SA 1
1 1 Growth: S a to Sm 1
1 2 Growth: Sh to Sm 1
13 Cell lysis: X f to Xs, Xi, Sc, Sf, Ss, and Si fBXS fBXI - 1
14 Cell lysis: Xp to Xs, X i, Sc, Sf, Ss, and Si flBXS fBXI - 1
15 Cell lysis: X l to Xs, Xi, Sc, Sf, Ss, and Si fBXS fBXI - 1
16 Cell lysis: XB to Xs, Xi, Sc, Sf, Ss, and Si fBXS fBXI - 1
17 Cell lysis: X a to Xs, Xi, Sc, Sf, Ss, and Si fBXS fBXI - 1
18 Cell lysis: X h to Xs, Xi, Sc, Sf, Ss, and Si fBXS fBXI - 1
177
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 200/265
Appendix B Source Code
The source code is divided in to the fo llow ing list o f files:
Header file : Asbr.h
File 1: phdw.c
File 2: inp.c
File 3: ode.c
File 4: stiff.c
File 5: sim.c
File 6 : der.c
File 7: jac.c
File 8 : settle.c
178
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 201/265
Header file: asbr.h
# i n c l u d e < s t d d e f . h >
# i n c l u d e < s t d l i b . h >
# i n c l u d e < s t d i o . h ># i n c l u d e < m a t h . h ># i n c lu d e < s t r i n g . h >
# d e f i n e T IN Yo de 1 . 0 e - 1 0 / / s e t s y s c a l i n ODEINT, i f y=0.0 & dy dx =0 .0# d e f in e T IN Yrh o 1 .0 e -1 0 / / o r i g i n a l l y = l e - 1 0 , a v o i d exc
ess c a l c , f o r t i n y ##def ine FREE_ARG char *#def ine YVAR 22
i n t e g r a t i o n c a l c .#def ine ZVAR 24
t o y k ee p & p r i n t e d# d e f in e P 21r a t i o n )# d e f i n e MAXKEEP 16005
t i m e s t e p a r r a y s
# d e f i n e MAXSTP 10000#def ine CONTIN 0.97
i d e f i n e KMAXX 7# d e f in e IMAXX (KMAXX+1)#de f ine SAFE1 0 .25
#def ine SAFE2 0.7#def ine REDMAX 1.0e-5#def ine REDMIN 0.7# d e f i n e T I N Y 1 . 0 e - 3 0#def ine SCALMX 0.1
/ / # c o mp o ne n ts i t o b e us e d i n
/ / # c o mp o ne n ts i t o b e s t o r e d
/ / # p r o c e s s e s j ( us ed i n i n t e g
/ / a l l o c a t e s memory f o r
# d e f i n e F MA X( a, b) ( m a x a r g l = ( a ) , m a x a r g 2 = ( b ) , ( m a x a r g l ) >(maxarg2) ? \
(maxarg l ) : (maxarg2) )/ / # d e f in e FMAX(a,b ) ( (a ) > (b) ? (a) : ( b ) ) / / n o t
used
# d e f i n e F M IN (a ,b ) ( m i n a r g l = ( a ) , m i n a r g 2 = ( b ) , ( m i n a r g l ) <( m i n a r g 2 ) ? \
( m i n a r g l ) : ( m i n a r g 2 ) )
# d e f i n e S IG N(a ,b ) ( (b ) >= 0 .0 ? f a b s (a ) - f a b s ( a ) )
179
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 202/265
#define SQR(a) ((sqarg=(a))==0.0?0.0:sqarg*sqarg)
# d e f i n e t r u e 1# d e f i n e f a l s e 0
# d e f i n e NO 5000# d e f i n e TOL L l e - 6
t yp e d e f s t r u c t
{
d o u b l e c o n e ;d o u b l e d i s s ;
} A c i d ;
t yp e d e f s t r u c t
{
d o u b l e c o n e ;d o u b l e k x ;d o u b l e k s ;d o u b l e b x ;
} M i c r o ;
/ * d e r * /v o i d d e r i v s ( d o u b l e x , d o ub le y [ ] , d ou b l e d y d x [ ] , d o ub le * *
nu, \ d o u b le k i n [ ] , d o u b le s t o [ ] , d o u b l e y i n f [ ] , \d o ub le q f ,d o u b l e q d ,d o u b le n f s x , d o u b l e n f r , d o u b l e
v r t 1 , \d o u b l e g P H 2 , d o u b l e g P C 0 2 , d o u b l e g P C H 4 , d o u b l e m i x )
r
v o i d R ATE(doub le * r ,d o u b l e y [ ] , d o u b l e * * n u ,d o u b l e k i n [ ] , d
o u b l e s t o [ ] , \d o u b l e g P H 2 , d o u b le gP C 0 2 , d o u b le gP C H 4 ,d o u bl e v r t l
, d o ub le n f r , d o u b l e m i x ) ;
v o i d RHO(double * rh o , d o u b l e y [ ] , d o u b l e k i n [ ] , d o ub le s t o [ ], \
d o u b l e C H , d o u b l e P H 2 , d o u b l e g P H 2 , d o u b l e g P C 0 2 , d o ub l e gP CH 4,dou ble v r t l , d o u b l e m i x ) ;
d o u b l e P H ( d ou b l e C N a n e t, d o u b l e K w , d o u b l e C T C 0 3, \
180
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 203/265
double KaH2C03, Acid *ac,int num) ;
/ * j a c * /v o i d ja c o b n ( d o u b l e x , d o ub le y [ ] , d o ub le d f d x [ ] , d o u b l e * *
d f d y , \
d o ub le * * n u ,d o u b le k i n [ ] , d ou b le s t o [ ] , \d o ub le q f , d o u b l e q d , d ou b le n f s x , d o u b l e n f r , d o u b l e
v r t l , d o u b l e m i x ) ;
v o i d D RATEDY(double * * d f d y , d o u b l e y [ ] , d o u b l e * * n u , \d ou b le k i n [ ] , d ou b le s t o [ ] , d ou bl e v r t l , d o u b l e n f r ,
d o ub le m i x ) ;
v o i d DRHODY(double * * d r h o d y , d o u b l e y [ ] , d o u b l e k i n [ ] , d o u b l
e s t o [ ] , \d o ub le C H ,d ou ble P H2 ,d ou bl e v r t l , d o u b l e m i x ) ;
/ * s im * /v o i d s im p r (d o u b l e y [ ] , d o u b l e d y d x [ ] , d ou b le d f d x [ ] , d ou b l e
* * d f d y , i n t n, d o u b l e x s , \d ou bl e h t o t , i n t n s te p ,d o u b l e y o u t [ ] , \d ou ble * * n u ,d o u b le k i n [ ] , d ou b l e s t o [ ] , d o u b l e y i n
f [ ] , \d o ub le q f ,d o u b l e q d ,d o u b le n f s x , d o u b l e n f r , d o u b l e
v r t 1 , \d o u b l e g P H 2 , d o u b l e g P C 0 2 , d o u b l e g P C H 4 , d o u b l e m i x ,
\v o i d ( * d e r i v s ) ( d o u b l e , d o u b l e [ ] , d o u b l e [ ] , d o u b le * *
,\d o u b l e [ ] , d o u b l e [ ] , d o u b l e [ ] , \d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , \d o u b l e , d o u b l e , d o u b l e , d o u b l e ) ) ;
v o i d l u b ks b ( d o u b le * * a , i n t n, i n t * i n d x , d o ub le b [ ] ) ;
v o i d l ud c mp (d ou b le * * a , i n t n, i n t * i n d x , d o u b l e * d ) ;
/ * s t i f f * /v o i d s t i f b s ( d o u b l e y [ ] , d o u b l e d y d x [ ] , i n t n v ,d o u b le * x x , d ou b le h t r y , d o u b l e e p s , \
d ou b le y s c a l [ ] , d ou bl e * h d i d ,d o u b l e * h n e x t , \d ou b l e * * n u ,d o u b le k i n [ ] , d ou ble s t o [ ] , d ou b l e y i n
f [ ] , \
181
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 204/265
double qf,double qd,double nfsx,double nfr,doublevrtl,\
d o u b l e g P H 2 , d o u b l e g P C 0 2 , d o u b l e g P C H 4 , d o u b l e m i x ,
\v o i d ( * d e r i v s ) ( d o u b l e , d o u b l e [ ] , d o u b l e [ ] , d o u b l e * *
, \d o u b l e [ ] , d o u b l e [ ] , d o u b l e [ ] , \d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , \d o u b l e , d o u b l e , d o u b l e , d o u b l e ) ) ;
v o i d p z e x t r ( i n t i e s t , d o u b l e x e s t , d o u b l e y e s t [ ] , d o u b le y z [
] , d o u b le d y [ ] , i n t n v ) ;
/ * o d e * /v o i d o d e in t (d o u b l e y s t a r t [ ] , d ou b le x l , d o u b l e x 2 , \
d o ub le e p s , d o u b le h i , d o u b l e h m i n , \d o ub le * * n u , d o u b le * k i n , d o u b l e * s t o , d o u b l e * y i n f ,
\d o ub le q f , d o u b l e q d ,d o u b le n f s x , d o u b l e n f r , d o u b l e
v r t 1 , \d o u b l e g P H 2 , d o u b l e g P C 0 2 , d o u b l e g P C H 4 , d o u b l e m i x ,
\v o i d ( * d e r i v s ) ( d o u b l e , d o u b l e [ ] , d o u b l e [ ] , d o u b l e * *
, \d o u b l e [ ] , d o u b l e [ ] , d o u b l e [ ] , \d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , \d o u b l e , d o u b l e , d o u b l e , d o u b l e ) ) ;
v o id n r e r r o r ( c h a r e r r o r _ t e x t [ ] ) ;
/ * i n i t * /
v o i d i n i t ( d o u b l e * *n u ,d o u b le * y i n f , d o u b l e * y i n i , d o u b l e *s
t o , \d o ub le * k i n , d o u b l e * p r o p , d o u b le * g p p ) ;
v o i d r e a d _ i n i _ f i l e ( c h a r * f i l e , d o u b l e * a c o n c , i n t n a c , d o u b l
e * g p p , i n t n g p ) ;
v o id r e a d _ f i l e (c h a r * f i l e , d o u b l e * a r , i n t n i t e m ) ;
v o i d ps e y (d o u b le * s t o ) ;
v o i d F in d _ nu ( do u b le * * n u , d o u b l e * s t o ) ;
v o id t i m f l ( d o u b l e * p r o p ) ;
182
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 205/265
void pywc(double *yt,double *gp,double *kin);
void pyre(double *yt,double *gp,double *kin);
/ * s e t t l e * /i n t s e t t ( d o u b l e * h g t , d o u b l e s d t , d o u b l e d z , d o ub l e * v , d o u b l
e * c o n c ) ;d o u b l e c o n p h ;
183
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 206/265
File 1: phdw.c
# i n c l u d e " a n s b r . h "/ * co2 1 . 9 2 , h 2 , 4 . 5 0 ch4 1 . 4 9 * /
v o i d u a s b( d ou b le * q f , d o u b l e * q d , d o u b le * n f s x , d o u b l e * n f r ,
\d o ub le * m i x , i n t * s t a g e , d o u b l e t c , d o u b l e *p r o p , d o u
b l e * q s ) ;v o i d s b r a f ( d o u b l e * t c , d o u b l e * v r t l , d o u b l e *g PH 2 , do ub le * gPC02, dou b le
*gPCH4 , \d o u bl e q f , d o u b l e q d , d o u b l e d t , d o u b l e * z) ;
v o i d e x t r a ( d o u b l e * z , d o u b l e * y , d o u b l e q f , d o u b l e q d ,d o u b l e
n f s x , d o u b l e
n f r , \d o u b l e v r t l , d o u b l e g P H 2 , d o ub l e g P C 0 2 , d ou b l e gPCH4
, d o u b l em i x ,d o u b le s t a g e , \
d o ub le d t , d o u b l e v g a s , \d ou b le * k i n , d o u b l e * y i n f , d o u b l e * g p p ) ;
v o id p r i n t t o f i l e ( i n t j , d o u b l e d t , d o u b l e * z ,d o u b l e * y , F I L E
* f o ) ;i n t h v t ( d o u b l e h o , d o u b le t h , d o u b l e d h , d o ub l e c o , d o u b le d t
, d o u b l et t , d o u b l e * h t ) ;d o ub le * s e t f q d ( i n t n um ,d ou ble d t , d o u b l e * h t ) ;
v o i d m a i n ( v o i d )
{
i n t i , j , s t a g e , n c y c l e = 0 /d o ub le y i n f[ Y V A R + 1 ] , y i n i [ YVAR+1] , y [ Y V A R + l ] ;
/ * i n f l u e n t , i n i t i a l a nd m ix Y v a r . * /d ou b l e s t o [ 5 2 ] , k i n [ 8 3 ] , p r o p [3 9 ] , * * n u , g p p [ 6 ] ;d ou ble gP H2 ,gP C02 ,g PC H4 ,q f, q d , n f s x , n f r , m i x , v r t l ;
d o u b l e g h , g o , g c ;d o ub le z [ ZVAR+1] , t c , d t ;c ha r * o u t _ f i l e = " a s b r . o u t " ; / * u t p u t f i l e , f i
n a lc o n c e n t r a t io n s . * /
d o u b le h = 0 . 1 , h m i n = 0 .0 ; / * t i m e s
t e p h i n h o u r s
* /
d ou b le e p s= 1 .0 e -4 ; / * e r r o r s e n s i t i v
i t y * /d ou bl e h t [ 8 2 ] , t e m , * q s ;
F I L E * f o ;
184
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 207/265
f o = f o p e n ( o u t _ f i l e , " w " ) ;f p r i n t f ( f o , " j , T ime, S ta g e ,
S f ,Ss ,
S I ,
Na,Salic, "
X f ,
ot ,X t o t , "
0 2 ,
S i , "
Sb,Sm, Sh, "
Xp,X I , Xb ,
PCH4,
PH2,
03,
f f ,
g e , \ n " ) ;
CH2C03,CVFA,
PC02,"
TSS, "
CODbal,
C O D t o t , "
Sa,
Sn,
Xs,
Xa,
rCH4,
Qg,pH,
logPH2,
SVFA,
/ * d y na m ic memory a l l o c a t i o n
Sc,
Sp,
Sco3,
X i ,
Xh,
rH2,
V r , "CNa,
S e f f ,
SCOD,
7
St
rC
CHC
Xe
Sta
e ) ) ;
n u = ( d o u b l e * * ) m a l l o c ( (YVAR+1) * s i z e o f ( d o u b l e * ) ) ;
f o r ( i= 0 ; i< =Y VA R; i+ +)n u [ i ] = (d ou b l e * ) m a l l o c ( ( P + l ) * s i z e o f ( d o u b l
i n i t ( n u , y i n f , y i n i , s t o , k i n , p r o p , g p p ) ;t e m =0 ;/ * fo r ( i= 1 5 ; i < = Y V A R ; i+ + ) t e m = t e m + y i n i [ i ] ;
i = h v t ( 0 . 7 2 , 0 . 3 6 , 0 . 0 1 , t e m / 1 0 0 0 / k i n [ 5 1 ] * p r o p [ 3 ] / p r o p [ 1 ] , p r op [10] , 8 , h t ) ;i f ( i = = 0 ) e x i t (1) ;p r o p [ 1 8 ] = i * p r o p [ 1 0 ] ;
q s = s e t f q d ( i , p r o p [ 1 0 ] , h t ) ; * /
185
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 208/265
q s = (d o u b le * ) m a l lo c ( 1 0 0 * s i z e o f ( d o u b l e )) ;f o r ( i = l ; i < 1 0 0 ; i + + ) q s [ i ] = p r o p [ 2 ] / p r o p [ 1 8 ];/ * t h e a bo ve t w o l i n e s comment o u t t h e s e t t l e mode
1*/gPH2=gpp [1 ] ;
g P C 0 2 =g p p [ 3 ] ;gPCH4=gpp [2 ] ;c o n p h = p r o p [ 3 5 ] ;i f ( p r o p [ 3 6 ]< 0 .5 )
{v r t l = p r o p [ 3 ] ;
}e l se i f ( p r o p [ 3 6 ]< 1 .5 )
{
v r t l = p r o p [ 2 ] + pro p [ 3 ] ;p r o p [ 2 5 ] = p ro p [ 2 5 ] * p r o p [ 3 ] / v r t l ;
}d t = p r o p [ 1 0 ] ;t c = 0 ;f o r ( i = l ; i < = 1 4 ; i + + )
{y [ i ] = y i n i [ i ] ;
}f o r ( i = 1 5 ; i< =Y V AR ; i+ + )
{
i f ( p r o p [ 3 6 ] < 0 . 5 )
{y [ i ] = y i n i [ i ] ;
}e l s e i f ( p r o p [ 3 6 ]< 1 .5 )
{y [ i ] = y i n i [ i ] * p r o p [ 3 ] /vrtl;
}
}
p r i n t f ( " I n i t s u c c e s s \ n " ) ;f o r ( j = l ; j < = 1 0 0 0 0 ; j+ + ) / * j i s
a t i m e s t e ph e r e . * /
{
uasb (&q f , &qd, Senfsx, & n f r , &m ix , & s ta g e , t c , p r
o p , q s ) ;o d e i n t ( y , 0 , d t , eps , h, h m i n , n u , k i n , s t o , y
i n f , \
q f , q d , n f s x , n f r , v r t l , g P H 2 , gPC02, gPCH4, m ix , d e r i v s ) ;e x t r a ( z , y , q f , q d , n f s x , n f r , v r t l , g P H 2 , g P C 0 2 ,
186
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 209/265
\
gPCH4, m i x ,s t a g e , d t , p r o p [ 5 ] , k i n , y i n f , g p p ) ;s b r a f ( & t c , & v r t 1 , & g h , & g o ,& g c , q f , q d , d t , z ) ;p r i n t t o f i l e ( j , d t , z , y , f o ) ;
i f ( t c - ( p r o p [ 1 2 ] + p r o p [ 1 4 ] + p ro p [ 1 8 ] + p r o p [21] ) > - 0 . 0001)
k o . o o o i :
{
i f ( z [ 2 ] > p r o p [2 5 ])
{f o r ( i = 1 5 ; i < =Y V A R ;i + + )
{i f ( p r o p [ 3 6 ] - 0 . 0 00
{
y [ i ] = y [ i ] * ( v r t l - p r o p [ 4 ] ) / v r t 1 ;
1 . O O O K O . 0 0 0 1 '
y [ i ] = y [ i ] * ( 1 - p r o p [ 4 ] / p r o p [ 3 ] ) ;
}e ls e i f ( p r o p [ 3 6 ] -
}}t c = 0 ;n c y c l e = n c y c l e + l ;p r i n t f ( " % d c y c l e e n d \ n " , n c y c l e ) ;
i f (n c y c l e > = p r o p [ 9 ] )
{p r i n t f ( "COD= % l f \ n " , z [ 1 ] )
r
b r e a k ;
}
i f ( z [ 1 ] < =p r o p [1 6 ] ) b r e a k ;
}/ * i f ( t c - ( p r o p [ 1 2 ] + p r o p [1 4 ] + p ro p [ 1 8 ] + p r o p [21
] ) > - 0 . 0 0 0 1 )
{
i f ( p r o p [ 2 3 ] < 0 . 0 0 0 1 ){
i f ( z [ 2 ] > p ro p [ 2 5 ])p r o p [ 2 3 ] = p r o p [ 4 ] / p r o p [ 2 4 ] ;
}
1 8 7
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 210/265
i f (t c - ( p r o p [ 12 ] + p r o p [ 14 ] + p r o p [ 18 ] 4 - p r o p [21 ] 4 - p r o p [23 ] ) >-0 . 00 0 1 )
{
c y c l e ) ;
n " , z [ 1] )
r o p [ 1 3 ]
t c = 0 ;
n c y c l e = n c y c l e 4 - l ;
p r i n t f ( " % d c y c l e e n d \ n " , n
i f ( n c y c l e > = p r o p [ 9 ] )
{p r i n t f ( " C O D = % l f \
b r e a k ;
}i f ( z [ 1 ] < = p r o p [ 1 6 ] ) b r e a k ;p r o p [ 1 2 ] = ( p r o p [ 1 ] - v r t l ) / p
p r o p [ 2 3 ] = 0 ;
}} * /
}f c l o s e ( f o ) ;f o r ( i= 0 ; i< = Y V A R ; i+ + ) f r e e ( n u [ i ] ) ;f r e e ( n u ) ;f o r ( i= 15 ; i<=YVAR; i - f- f)
{i f ( p r o p [ 3 6 ] < 0 . 5 )
{y [ i ] = y [ i ] ;
}e l s e i f ( p r o p [ 3 6 ] < 1 .5 )
{y [ i ] = y [ i ] / p r o p [ 3 ] * v r t l ;
}}f o = f o p e n ( " a s b r _ i n i . r s t " , " w " ) ;
f o r ( i = l ; i < = Y V A R ; i + + )f p r i n t f ( f o , " % l f \ n " , y [ i ] ) ;
f p r i n t f ( f o , "% 8 . 7 1 f \ n % 8 . 7 1 f \ n % 8 . 7 1 f \ n % 8 . 7 1 f \ n % 8 . 7 1 f \ n " , z [7
] , z [ 6 ] , z [ 8 ] , gp
p [ 4 ] , gpp [ 5 ] ) ;f c l o s e ( f o ) ;p r i n t f ( "P ro g r a m e n d \ n " ) ;
} / * -----------------------------End of M a i n - - - - - - - -- - - - - - - -- - - - - - - -- - - - - - -- - - - - - - -- - - - - - - -- - - - - - -- - - - - - - -- - - - - - - -- - - - - - - -- - - - - - -- - - - - - - -- - - - - - - -- - - - * /
1 8 8
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 211/265
v o i d u as b( d ou b le * q f , d o u b l e * q d , do u b l e * n f s x , d o u b l e * n f r ,
\d ou bl e * m i x , i n t * s t a g e ,d o u b l e t c , d o u b l e * p r o p ,d o u
b l e * q s )
{d o u b l e s v = 0 . 0 0 0 1 ;i n t t i ;
/ * f i l l s t a g e * /i f ( p r o p [ 1 2 ] - t c > s v ) / * s a f e t y v a lu e t o a v o id r
ea l numberp r o b l e m s * /
{* q f = p r o p [ 1 3 ] ;* q d = 0 ;* n f s x = p r o p [ 3 3 ] ;* n f r = p r o p [ 28 ] ;* m i x = p r o p [ 3 4 ] ;
* s t a g e = l ;
}/ * --------- REACT st a g e * /
e l se i f ( p r o p [ 1 2 ] + p ro p [ 1 4 ] - tc > s v )
{
* q f = 0 ;* q d = 0 ;* n f s x = p r o p [ 3 3 ] ;* n f r = p r o p [ 2 9 ] ;* m i x = p r o p [ 3 4 ] ;
* s t a g e = 2 ;
}
/ * --------- SETTLE s t a g e ( n o t e : r e a c t i o n o c c u r s i n s e t t l e d ph
a se o n l y ) * /e l se i f ( p r o p [ 1 2 ] + p r o p [ 1 4 ] + p r o p [ 1 8 ] - t c> s v )
{* q f = 0 ;t i = c e i l ( ( t c - ( p r o p [ 1 2 ]+ p r o p [ 1 4 ] ) ) / p r o p [ 10]
+ 0 . 5 ) ;* q d = q s [ t i ] ; / * p r o p [ 2 2 ] ; * /* n f s x = p r o p [ 3 3 ] ;
* n f r = p r o p [ 3 0 ] ;
* m i x = p r o p [ 3 4 ] ;* s t a g e = 3 ;
}/ * ----------- DRAW s t a g e ( n o t e : r e a c t i o n o c c u r s i n s e t t l e d p h as
e o n l y ) * /e l s e i f ( p r o p [ 1 2 ] + p r o p [ 1 4 ] + p ro p [ 1 8 ] + p r o p [ 2 1 ] - t c > s
189
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 212/265
V)
{
* q f = 0 ;* q d = 0 ;* n f s x = p r o p [ 3 3 ] ;
* n f r = p r o p [ 3 1 ] ;* m i x = p r o p [ 3 4 ] ;* s t a g e = 4 ;
}
/ * ----------- WASTE s ta ge (no te : r e a c t i o n o cc u rs i n s e t t l e d pha
se o n l y ) * /e l s e / * & & ( X t o t > = X w as t e ) ) t r i g g e r i n m ai n * /
{* q f = 0 ;* q d = p r o p [ 2 4 ] ;* n f s x = 0 ;* n f r = p r o p [ 3 2 ] ;* m i x = p r o p [ 3 4 ] ;* s t a g e = 5 ;
}i f ( p r o p [ 3 6 ] - s v< sv ) r e t u r n ;
* q f = p r o p [ 2 ] / p r o p [ 6 ] ;* q d = * q f ;* n f s x = p r o p [ 3 3 ] ;* n f r = p r o p [ 2 9 ] ;
* m i x = p r o p [ 3 4 ] ;/ * * s t a g e = 2 ; * /i f ( p r o p [ 3 6 ] - l - s v < s v ) r e t u r n ;
r e t u r n ;} / * ---------------------------------------End o f D e r i v s F u n c t i o n * /v o i d s b r a f ( d o u b l e * t c , d o u b l e * v r t l , d o u b l e * gP H2 ,d ou bl e *g
PC02, doub le*gPCH4, \
d o u b l e q f , d o u b l e q d , d o u b l e d t , d o u b l e * z )
{* t c = * t c + d t ;* v r t l = * v r t l + ( q f - q d ) * d t ;
* g P H 2 = z [ 7 ] ;* g P C 0 2 = z [ 8 ] ;* g PC H 4 = z [ 6 ] ;
}
v o i d e x t r a ( d o u b l e * z , d o u b l e * y , d o u b l e q f , d o u b l e q d , do u b l e
n f s x , d o u b l en f r , \
190
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 213/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 214/265
*tb/ta;/ * z [ 8 ] = t b - z [ 6 ] - z [ 7 ] ; * /
}
e l s e
{
tb=gPCH4+gPH2+gPC02;
z [6] = ( z [ 3 ] * d t * k i n [ 7 4 ] * k i n [ 7 5 ] + g P C H 4 * ( v g a s - t a ) ) / v g a s * ( g p p [5 ] - g p p [ 4 ] ) / g p p
[5 ] ;
z [ 7 ] = ( z [ 4 ] * d t * k i n [ 7 4 ] * k i n [ 7 5 ] + g P H 2 * ( v g a s - ta ) ) / v g a s * ( g p p [5] - g p p [ 4 ] ) / g p p [
5] ;
z [8] = ( z [ 5 ] * d t * k i n [7 4 ] * k i n [7 5 ] +gPC02 * ( v g a s - t a ) ) / v g a s * ( g p p [5 ] - g p p [ 4 ] ) / g p p[ 5 ] ;
/ * z [ 8 ] = t b - z [ 6 ] - z [ 7 ] ; * /
}t b = g p p [ 5 ] - g p p [ 4 ] ;
z [ 9 ] = k i n [ 7 4 ] * k i n [ 7 5 ] * ( z [ 3 ] + z [ 4 ] + z [ 5 ] ) / t b ;z [ 1 0 ] = v r t l ;
z [ 1 1 ] = - l o g l 0 ( t c h / 1 0 0 0 . 0 ) ;
t a = 0 ;f o r ( i = 0 ; i < = 3 ; i+ + )
{t b = a c [ i ] . d i s s / ( t c h + a c [ i ] . d i s s ) * a c [ i ] . co
n c ;
t a = t a + t b ;
}
z [12] = y [ 1 3 ] / k i n [ 6 4 ] - t a ;z [13] = y [ 1 2 ] / k i n [ 6 3 ] * k i n [ 7 0 ] / ( k i n [7 0 ] + t c h ) ;z [ 1 4 ] = y [ 1 2 ] / k i n [ 6 3 ] * t c h / ( k i n [ 7 0 ]+ t c h ) ;
t a = 0 ;
f o r ( i = 0 ; i < = 3 ; i + + ) t a = t a + a c [ i ] . c o n e ;z [ 1 5 ] = t a ;t a =0 ;f o r ( i = 1 7 ; i < = 2 2 ; i + + ) t a = t a + y [ i ] ;
z [ 1 6 ] = t a / k i n [ 5 2 ] + y [ 1 5 ] / k i n [53] + y [ 1 6 ] / k i n [ 5 4 ] ;i f ( y [ 1 0 ] > 0 )z [ 1 7 ] = l o g l 0 ( y [ 1 0 ] / k i n [ 6 0 ] / k i n [ 7 3 ] ) ;
e l s e
{z [ 1 7] = 0;
192
produced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 215/265
}
z [ 1 8 ]= 0 ;z [ 1 9 ]= 0 ;
i f ( s ta ge == 4)
{
ta =0 ;f o r ( i = l ; i < = 8 ; i+ + ) t a = t a + y [ i ] ;z [ 1 8 ]= t a ;
t a = 0 ;f o r ( i = 1 5 ; i < = 2 2 ; i + + ) t a = t a + y [ i ] * ( 1 - n f s x ) ;z [ 1 9 ] = t a ;
}
/ ^ i m pl em e nt l a t e r * /z [ 2 0 ] = 0 ;
z [21]=0;
t a = 0 ;f o r ( i = 5 ; i < = 8 ; i + + ) t a = t a + y [ i ] ;z [ 2 2 ] = t a ;
z [ 2 3 ] = z [ l ] + y [ 1 1 ] / 6 4 . 0 * 1 4 . 0 ;z [ 2 4 ] = s ta g e;
}
v o id p r i n t t o f i l e ( i n t j , d o u b l e d t , d o u b le * z ,d o u b l e * y , F I L E
* f o )
{ i n t i ;f p r i n t f ( f o , " % 5 d , " , j ) ;f p r i n t f ( f o , "% 6 . 2 1 f , " , j * d t ) ;f p r i n t f ( f o , " % 5 . I l f , " , z [24] ) ;f o r ( i = l ; i < = YVAR; i++ ) f p r i n t f ( f o , " % 1 2 . 7 1 f , " , y [ i ] ) ;
f o r ( i = l ; i <= Z V AR ; i+ + ) f p r i n t f ( f o , "% 1 2 . 7 1 f , " , z [ i ] ) ;f p r i n t f ( f o , " \ n " ) ;r e t u r n ;
}
i n t h v t ( d o u b l e h o , d o u b l e t h , d o u b l e d h , do u b l e c o , d o ub l e d t
, d o ub l et t , d o u b l e * h t )
{
i n t i , n u m , l a y ;d o u b l e * c o n , * v ;d o u b le h ;
193
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 216/265
n u m = c e i l ( t t / d t ) ;l a y = c e i l ( h o / d h ) ;
c on =( do ub le * ) c a l l o c ( ( l a y + 2 ) , s i z e o f ( d o u b l ev =( do ub le * ) c a l l o c ( ( l a y + 1 ) , s i z e o f ( d o u b l e ) )f o r ( i = l ; i < = l a y + l ; i + + ) c o n [ i ] = c o ;
h t [ 0 ] = ho;h=ho;f o r ( i = l ; i < = n u m ; i + + )
{i f ( s e t t ( & h , d t , d h , v , c o n ) ==0) r e t u r nh t [ i ] = h ;
i f ( h < t h ) b r ea k ;
}f r e e ( c o n ) ;f r e e ( v ) ;r e t u r n i ;
}
d ou b l e * s e t f q d ( i n t n um ,d ou bl e d t , d o u b l e * h t )
{i n t i ;d o u b l e t e r n , * q s ;t em=1 2 / 0 . 7 2 / d t ;
q s =( do ub le * ) c a l l o c ( n u m + 1 , s i z e o f ( d o u b l e ) ) ;f o r ( i = l ; i < n u m ; i + + )
{qs [ i ] = (h t [ i —1 ] - h t [ i ] ) * t em;
}q s [n u m ]= ( h t [ n u m - 1 ] - 0 . 3 6 ) * te m;r e t u r n q s ;
}
194
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 217/265
File 2: inp.c
# i n c l u d e " a n s b r . h "
v o i d i n i t ( d o u b l e * * n u , d o u b l e * y i n f , d o u b l e * y i n i , d o u b l e *st o , \
d o u b l e * k i n , d o u b l e * p r o p , d o u b l e * g p p ){
F I L E * f o ;c h a r * i n i _ f i l e = " a s b r _ i n i . i n " ; / * i n p u t f
i l e names * /c h a r * i n f _ f i l e = " a s b r _ i n f . i n " ;c h ar * s t o _ f i l e = " a s b r _ s t o . i n " ;c h ar * k i n _ f i l e = " a s b r _ k i n . i n " ;c ha r * p r c _ f i l e = " a s b r _ p r c . i n " ;
i n t i ;r e a d _ f i l e ( p r c _ f i l e , p r o p , 3 8 ) ;r e a d _ f i l e ( k i n _ f i l e , k i n , 8 2 ) ;
r e a d _ i n i _ f i l e ( i n f _ f i l e , y i n f , Y VAR ,g p p , 5 ) ;p y w c ( y i n f , g p p , k i n ) ;/ * i f ( y i n f [ 1 4] < 0. 1 ) p y w c ( y i n f , g p p , k i n ) ;f o = f o p e n ( " i n f . r s t " , " w " ) ;f o r ( i = l ; i < =Y VA R ; i ++ )
f p r i n t f ( f o , " % l f \ n " , y i n f [ i ] ) ;
f o r ( i = l ; i < = 5 ; i + + )f p r i n t f ( f o , " % 6 . 5 f \ n " , g p p [ i ] ) ;
f c l o s e ( f o ) ; * /i f ( p r o p [ 3 8 ] < 0 . 5 )
{r e a d _ i n i _ f i l e ( i n i _ f i l e , y i n i , Y V A R , g p p , 5 ) ;p y r e ( y i n i , g p p , k i n ) ;
}e l s e
{
i n i _ f i l e = " a s b r _ i n i . r s t " ;
r e a d _ i n i _ f i l e ( i n i _ f i l e , y i n i , Y V A R , g p p , 5 ) ;
}r e a d _ f i l e ( s t o _ f i l e , s t o , 5 1 ) ; / * r e a d s t o , k i n , p r c *
/p s e y ( s t o ) ;
F i n d _ n u ( n u , s t o ) ; / * c a l l f i n d nu * /
t i m f l ( p r o p ) ; / * p r oc e ss s ta ge t im e s * /r e t u r n ;
/ * - Read I n i t i a l R e ac to r and i n f l u e n t C o n c e n t r a t i o n s f r omI N I , I N f i n p u t
195
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 218/265
f i l e * /v o id r e a d _ i n i _ f i l e (c h a r * f i l e , d o u b l e * a c o n c , i n t n a c ,d o u b le * g p p , i n t
ngp){
i n t i = l , j = l ;c h a r t e m p [ 8 0 ] ;F I L E * f p ;f p = f o p e n ( f i l e , " r " ) ;i f ( fp == NULL )
{p r i n t f ( "Can n o t open %s. \ n " , f i l e ) ;
e x i t ( 1 ) ;
}w h i le ( ! f e o f ( f p ) )
{f g e t s ( t e m p , 8 0 , f p ) ;i f ( t e m p [ 0 ] ! = ' / ' &&temp[ 1 ] ! = ' / ' & &temp[ 0 ] ! = '
\0 ' ){
i f ( i < =n ac )
s s c a n f ( t e m p , " % l f " , & a c o n c [ i+ + ] ) ;e l se s s c a n f ( t e m p , " % l f " , &g
p p [ j + + ] ) ;}
i f ( j > n g p ) b re ak ;
}f c l o s e ( f p ) ;
}/ * -------------------- Read C on s t an ts f ro m i n p u t f i l e : s t o , k i n , p r c
*/
v o i d r e a d _ f i l e ( c h a r * f i l e , d o u b l e * a r , i n t n it em )
{i n t i = l ;c h a r t e m p [ 8 0 ] ;F I L E * f p ;f p = f o p e n ( f i l e , " r " ) ;i f ( fp == NULL )
{p r i n t f ( "Canno t open % s . \ n " , f i l e ) ;
e x i t ( 1 ) ;}w h i l e ( ! f e o f ( f p ) )
{f g e t s ( t e m p , 8 0 , f p ) ;i f ( t e m p [ 0] ! = ' / ' & & te mp [1] ! = ' / 1& & te m p[ 0] ! = '
196
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 219/265
\ o -
}
s s c a n f ( t e m p , " % l f " , & a r [ i + + ] )i f ( i > n i t e m ) b re ak ;
}f c l o s e ( f p ) ;
C a l c . P r o d u c t / S u b s t r a t e E ne rg y Y i e l d s/*----------
on GrowthY i e l d s
s ince Yp ,sp = YThOD* fe , where fe = 1 - f s and f s
COD u n i t s )
*/
v o i d p s e y ( d o u b l e * s t o )
{s t o [26] = s t o [ 2 6 ] * ( 1 . 0 - s t o [ 17 ]) ;
ens S f => Sa
* /s t o [27]s t o [28]
s t o [ 2 7 ] * ( 1 . 0 - s t o [ 1 7 ]s t o [ 2 8 ] * ( 1 . 0 - s t o [ 1 7 ]
7
s t o [29] = s t o [ 2 9 ] * ( 1 . 0 - s t o [18]
Sf => SI
s t o [ 3 0 ] = s t o [ 3 0 ] * ( 1 . 0 - s t o [18]s t o [31] = s t o [ 3 1 ] * ( 1 . 0 - s t o [18]
s t o [ 3 2 ] = s t o [ 3 2 ] * ( 1 . 0 - s t o [19]
Sf => Sb7
s t o [33] = s t o [ 3 3 ] * ( 1 . 0 - s t o [19]s t o [ 3 4 ] = s t o [ 3 4 ] * ( 1 . 0 - s t o [19]
s t o [ 3 5 ] = s t o [ 3 5 ] * ( 1 . 0 - s t o [20]
Sp =>
s t o [3 6 ] = s t o [ 3 6 ] * ( 1 . 0 - s t o [20]s t o [37] = s t o [ 3 7 ] * ( 1 . 0 - s t o [20]
s t o [38] = s t o [ 3 8 ] * ( 1 . 0 - s t o [21]
t a t e S I =>Sa * /s t o [3 9 ] = s t o [ 3 9 ] * ( 1 . 0 - s t o [21]s t o [4 0 ] = s t o [ 4 0 ] * ( 1 . 0 - s t o [21]
i o n a t eSa * /
s t o [ 4 1 ] = s t o [ 4 1 ] * ( 1 . 0 - s t o [ 22 ])
197
based
Yxsp (
A c i d o g
* Prop
* Lac
* n o t
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 220/265
e : S1 +Sh => Sp * /
s t o [4 2 ] = s t o [ 4 2 ] * ( 1 . 0 - s t o [ 2 2] )
s t o [43] = s t o [ 4 3 ] * ( 1 . 0 - s t o [ 2 2 ] )
s t o [4 4 ] = s t o [ 4 4 ] * ( 1 . 0 - s t o [ 2 3] )r a t e Sb => Sa
/s t o [4 5 ] = s t o [ 4 5 ] * ( 1 . 0 - s t o [ 2 3] )s t o [ 4 6 ] = s t o [ 4 6 ] * ( 1 . 0 - s t o [ 2 3 ] )
/ * B u t y
s t o [4 7 ] = s t o [ 4 7 ] * ( 1 . 0 - s t o [ 2 4] )ano gen s Sa =>
Sm 7
s t o [ 4 8 ] = s t o [ 4 8 ] * ( 1 . 0 - s t o [ 24 ])
/ * M e t h
s t o [49] = s t o [ 4 9 ] * ( 1 . 0 - s t o [ 2 5 ] ) ;ano gens Sh =>Sm/ * /
s t o [ 5 0 ] = s t o [ 5 0 ] * ( 1 . 0 - s t o [ 2 5 ] ) ;s t o [5 0 ] = s t o [ 5 0 ] + s t o [ 5 1 ] * s t o [ 25 ] ;
h+Sco2 =>X h , ( s y n t h e s i s ) * /
/ * M e t h
/ * n o t e : S
/*C02 consumed as C-sour c e * /
r e t u r n ;
}
/ * ---------------------- FIND_NU: C a l c u l a t e s nu ( s t o i c h i o m e t r i c c o e f f i c i e n t s ) -------
*/
v o i d F i n d _ n u ( d o u b l e * * n u , d o u b l e * s t o ) / * nu c ha ng ed t o GLOBAL VARIABLE
* /{
i n t i f j ; / * i i s c omponent , j i s p ro c es s */
f o r ( j = l ; j < = P ; j + + ) / * n o te : n u [ i ] [ j ] * /f o r ( i = l ; i < =Y V A R ; i + + ) n u [ i ] [ j ] = 0 .0 ;
/ ^ i n i t i a l i z e d */ n u [ 1 ] [ 1 ] = s t o [ 7 ] ;
c S u b s t r a t e
* /n u [ l ] [2 ] = - 1 . 0 ;f o r ( i = 1 3 ; i < = 1 8 ; i ++ )
/ * S c , C o m p l e x O r g a n i
1 9 8
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 221/265
n u [ l ] [ i ] = s t o [ 3 ] ; / * I mm ed i at e C e l l L y s is P ro d u c t s
* /nu
nunununu
l a t e I n e r t s
* /}n u [ 2 ] [ 1 ]
[ 2] [ i ] ^
[ 3 ] [ i ][ 4 ] [ i ][ 1 5 ] [ i ][ 1 6 ] [ i ]
s t o [ 8 ] ;
s t o [ 4 ] ;
s t o [ 5 ] ;s t o [ 6 ] ;
= s t o [ 1 ] ;= s t o [ 2 ] ;
a b l e S u b s t r a t e
* /nu 2] 2] = s t o [ 12 ] ;nu 2] 3] = s t o [ 1 5 ] ;
nu 2] 4] = - 1 . 0 / s t o [ 1 7 ] ;PH2 * /
nu 2] 5] = - 1 . 0 / s t o [ 1 8 ] ;nu 2] 6] = - 1 . 0 / s t o [ 1 9 ] ;
nu 3] 1] = s t o [ 9 ] ;
l e S o l u b l eS u b s t r a t e /
nu 3] 2] = s t o [ 1 3 ] ;nu 3] 3] = - 1 . 0 ;nu 4] 1] = s t o [ 1 0 ] ;
n e r t s * /
nu 4] 2] = s t o [ 1 4 ] ;nu 4] 3] = s t o [ 1 6 ] ;
nu 5] 4] = s t o [2 6 ] / s t o [17]
* /nu 5] 7] = s t o [ 3 5 ] / s t o [20]nu 5] 8] = s t o [ 3 8 ] / s t o [21]
nu 5] 10] = s t o [ 4 4 ] / s t o [23]nu 5] 11] = - 1 . 0 / s t o [ 24 ] ;nu 6] 7] = - 1 . 0 / s t o [ 20 ] ;
* /nu 6] 9] = s t o [ 4 1 ] / s t o [22]
nu 7] 5] = s t o [ 2 9 ] / s t o [18]
* / nu 7] 8] = - 1 . 0 / s t o [ 21] ;
r t i o n e d by PH2
* /nu 7] 9] = - 1 . 0 / s t o [ 2 2 ] ;nu 8] 6] = s t o [ 3 2 ] / s t o [19]
/ * X i , P a r t i c u
/ * S f , R e a d i l y Fe rm en t
/ * p r o p o r t i o n e d by
/ * Ss, S l o w ly D eg rad a b
/ * S i , S o l u b l e I
199
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 222/265
* /
* /
n u [ 8 ] [ 10] = - 1 . 0 / s t o [ 23 ] ;n u [ 9 ] [1 1 ] = s t o [ 4 7 ] / s t o [ 24 ] ; / * Sm, Metha ne
n u [ 9 ] [ 1 2 ] = s t o [ 4 9 ] / s t o [ 2 5 ] ;
n u [ 9 ] [ 2 0 ] = - 1 . 0 ; / *g as t r a n s f e r * /
PH2
by PH2
nu [10] [4]
nu [ 10] [5]
* /n u [ 1 0 ] [ 6 ]nu [10] [7 ]nu [ 10] [8]
* /n u [ 1 0 ] [ 9 ]
= s t o [ 2 7 ] / s t o [17]
= s t o [ 3 0 ] / s t o [ 18]
= s t o [ 3 3 ] / s t o [19]= s t o [ 3 6 ] / s t o [20]= s t o [ 3 9 ] / s t o [21]
/ * Sh, Hyd rogen *
/ * r h o p r o p o r t i o n b y
/ * r h o p r o p o r t i o n
/ * S l + Sh - > Sp * /
* /
/ * Sn, S o l u b l e N
= - s t o [ 4 2 ] / s t o [22]n u [ 1 0 ] [10 ] = s t o [ 4 5 ] / s t o [ 2 3 ] ;n u [ 1 0 ] [ 1 2 ] = - 1 . 0 / s t o [ 2 5 ] ; / * S co 2+ Sh -> Sm
n u [ 1 0] [ 2 1 ] = —1 . 0 ;n u [ 1 1 ] [ 1 ] = s t o [ l l ] ;
i t r o g e n COD
* /f o r ( i = 4 ; i < = 1 2 ; i + + ) n u [ l l ] [ i ]
/ *p r o p o r t i o n e d b y PH2 * /
n u [ 1 2 ] [4 ] = s t o [ 2 8 ] / s t o [17]
= - s t o [ 1 1 ] ;
x i d e * /n u [ 1 2 ] [ 5 ]
PH2 * / nu [ 12] [6]nu [ 12] [7]nu [ 12] [8]
PH2 * /n u [ 1 2 ] [ 9 ]
= s t o [ 3 1 ] / s t o [18]
= s t o [ 3 4 ] / s t o [19]= s t o [ 3 7 ] / s t o [20]= s t o [ 4 0 ] / s t o [21]
/ * Sco2 , Ca rbon D io
/ * r h o p r o p o r t i o n b y
/ * r h o p r o p o r t i o n b y
= s t o [ 4 3 ] / s t o [22 ] ;n u [ 1 2 ] [ 1 0 ] = s t o [ 4 6 ] / s t o [ 2 3 ] ;
n u [ 1 2 ] [11] = s t o [ 4 8 ] / s t o [ 2 4 ] ;n u [ 1 2 ] [12] = - s t o [ 5 0 ] / s t o [25]
// * g a s t r a n s f e r * /
n u [ 1 2 ] [ 1 9 ] = - 1 . 0 ;
/ * n u [ 1 3 ] [ j ] = 0 .0 ;r e n c e
N a + n e t , g C a C 0 3 / m 3 )
n u [ 1 4 ] [ j ] = 0 . 0;y ( v a r i a b l e ,
g C a C 0 3 / m 3 ) * /
/ * Sco2+Sh-> Sm *
SNa, A l k a l i n i t y ( r e f e
S a l k , A l k a l i n i t
2 00
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 223/265
/ * P a r t i c u la t e C ompo ne nt s ( gC0D/ m3) * /n u [ 1 5 ] [1] = ■- 1 . 0 ;
* /n u [ 1 7 ] [4] = 1 . 0 ;a * /
n u [ 1 7 ] [5] = 1 . 0 ;n u [ 1 7 ] [6] = 1 . 0 ;
n u [ 1 7 ] [13] = - 1 . 0 ; 0 0 \ —1 3 C
[7] = 1 . 0 ;
n u [ 1 8 ] [14] = - 1 . 0 ;n u [ 1 9 ] [8] = 1 . 0 ;
n u [ 1 9 ] [9] = 1 . 0 ;
n u [ 1 9 ] [15] = - 1 . 0 ;n u [ 2 0 ] [10] = 1 . 0 ;
n u [ 2 0 ] [16] = - 1 . 0 ;n u [ 2 1 ] [11] = 1 . 0 ;
n u [ 2 1 ] [17] = - 1 . 0 ;n u [22] [12] = 1 . 0 ;
* /n u [ 2 2 ] [18] = - 1 . 0 ;r e t u r n ;
- End
1 . 0 ; / * r h o p r o p o r t i o n e d b y PH2
* /
* /
* /
* /
* /
s * /
nogens
} / * ---------------------------------------End o f F i nd _ nu f u n c t i o n * /
/ * p r o ce s s s t a ge t i m e s * /v o i d t i m f l ( d o u b l e * pr op )
{i f ( p r o p [ 12 ]= =0 .0 ) p r o p [1 2 ] = p r o p [ 2 ] / p r o p [ 1 3 ] ; / *
f i l l t im e i ft f = 0 . 0 * /
e ls e p r o p [ 1 3 ] = p r o p [ 2 ] / p r o p [ 1 2 ] ; / * o r f i l l r a t e if t f i ss p e c i f i e d * /
i f ( p r o p [ 14 ]= =0 .0 ) p r o p [ 1 4 ] = p r o p [ 1 5 ] ; / * s e t m a x. re ac t t i me i f
t r = 0 ( S r s t o p ) * /i f ( p r o p [ 18 ]= =0 .0 ) p r o p [ 1 8 ] = p ro p [2]/ ( p r o p [ 2 0 ] * p r o p
[ 1 9 ] ) ; / * s e t t l et im e i f t s = 0 * /
e l s e p r o p [ 1 9 ] = p r o p [ 2 ] / ( p r o p [ 2 0 ] * p r o p [ 1 8 ] ) ; / * o r se t t l i n g
201
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 224/265
v e l o c i t y i f t s i s s p e c i f i e d * /
i f ( p r o p [ 2 1 ] = =0 .0 ) p r o p [ 2 1 ] = p r o p [ 2 ] / p r o p [ 2 2 ] ; / * ca l e . d r aw t i m ei f t d = 0 * /
e l s e p r o p [ 2 2 ] = p r o p [ 2 ] / p r o p [ 2 1 ] ; / * o r draw r a t e i
f t d i ss p e c i f i e d * // * i f ( t w == 0 . 0) t w = v w/ qw ;
c a l c , w a s t et i m e i f t w = 0. 0
e l s e qw = v w / t w ; o r w a s t e r a t e i f t w i ss p e c i f i e d * // * i f ( p r o p [ 23 ]= =0 .0 ) p ro p [ 2 3 ] = p r o p [ 4 ] / p r o p [ 2 4 ] ;
e l s e p r op [ 2 4 ] = p r o p [ 4 ] / p r o p [ 2 3 ] ; * /p r o p [ 4 ] = c e i l ( p r o p [ 4 ] / ( p r o p [ 1 2 ] * p r o p [ 1 0 ] ) ) * ( p r o p [1
2 ] * p r o p [ 10 ]) ;
p r o p [ 2 3 ] = f l o o r ( p r o p [ 2 3 ] / p r o p [ 1 0 ] + 0 . 5 ) * p r o p [ 1 0 ] ;p r o p [ 2 4 ] = p r o p [ 4 ] / p r o p [ 2 3 ] ;p r o p [ 2 3 ] = 0 ;p r o p [ 6 ] = p r o p [ 1 2 ] + p r o p [ 1 4 ] + p r o p [ 18] + p r o p [ 2 1 ] ;
/ * i f ( r t i m e == 0 .0 ) r t im e = t t o t * n c y c l e ; / / d e t e rm i ne ru nt im e i fr t i m e = 0 . 0e ls e n c yc le = r t i m e / t t o t ; / / o r # c y c l e s i f r t i me i s s p e c i f i e d
* /p r o p [8] = p r o p [ 6 ] * p r o p [ 9 ] ;r e t u r n ;
}/ * --------------------- C a l c u l a t e I n f l u e n t A l k a l i n i t y & pH b as ed onI n p u t s a n dVFAs — * /
v o i d p y wc ( do u bl e * y t , d o u b l e * g p , do u b l e * k i n )
{d ou bl e t c h , t a , t b ;i n t i ;
A c i d a c [ 4 ] ;
y t [ 9 ] = g p [ 2 ] * k i n [ 5 9 ] * k i n [ 7 2 ] ;y t [ 1 0 ] = g p [ 1 ] * k i n [ 6 0 ] * k i n [ 7 3 ] ;
/^assume CTC03 = CNanet* // * y t [ 1 2 ] = y t [ 1 3 ] / k i n [ 6 4 ] * k i n [ 6 3 ] ; * /
/ * t h i s i s more r e a l i s t i c * /
202
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 225/265
y t [ 1 2 ] = gp [ 3 ] * k i n [ 6 3 ] * k i n [ 7 1 ] * ( l e - 4 + k i n [ 7 0 ] ) / l e - 4 ;a c [ 0 ] . c o n c = y t [ 5 ] / k i n [ 5 5 ] ;a c [ 0 ] . d i s s = k i n [ 6 6 ] ;a c [ 1 ] . c o n c = y t [ 6 ] / k i n [ 56 ] ;a c [ l ] . d i s s = k i n [ 67 ] ;
a c [ 2 ] . c o n c = y t [ 7 ] / k i n [ 5 7 ] ;a c [ 2 ] . d i s s = k i n [ 6 8 ] ;a c [ 3 ] . c o n c = y t [ 8 ] / k i n [ 5 8 ] ;a c [ 3 ] . d i s s = k i n [ 6 9 ] ;
tch=PH (y t [13 ] / k i n [64 ] , k in [65 ] , y t [ 12 ] / k i n [ 63 ] , k i n [7 0 ] , a c , 4) ;/* p r i n t f ( "WPh=%e\n" , - l o g l O (t c h / 1 0 0 0 . 0 ) ) ; * /
t a = 0 ;
f o r ( i =0 ; i < = 3 ; i + + )
{t b = a c [ i ] . d i s s / ( t c h + a c [ i ] . d i s s ) * a c [ i ] . co
n c;t a = t a + t b ;
}y t [1 4 ] = (y t [ 1 3 ] / k i n [ 6 4 ] - t a ) * k i n [ 6 4 ] ;
}
v o i d p y r e ( d o u b l e * y t , d o u b l e * g p , d o u b le * k i n )
{d ou bl e t c h , t a , t b ;i n t i ;
A c i d a c [ 4 ] ;
y t [ 9 ] = g p [ 2 ] * k i n [ 5 9 ] * k i n [ 7 2 ] ;y t [ 1 0 ]= g p [ 1 ] * k i n [ 6 0 ] * k i n [ 7 3 ] ;
/^assume CTC03 = CNanet* /
/ * y t [ 1 2 ] = y [ 1 3 ] / k i n [ 6 4 ] * k i n [ 6 3 ] ; * /y t [ 1 2 ] = gp [ 3 ] * k i n [ 6 3 ] * k i n [ 7 1 ] * ( l e - 4 + k i n [ 7 0 ] ) / l e - 4 ;a c [ 0 ] . c o n c = y t [ 5 ] / k i n [ 5 5 ] ;a c [ 0 ] . d i s s = k i n [ 6 6 ] ;a c [ 1 ] . c o n c = y t [ 6 ] / k i n [ 56 ] ;a c [ 1 ] . d i s s = k i n [ 6 7 ] ;a c [ 2 ] . c o n c = y t [ 7 ] / k i n [ 5 7 ] ;
a c [ 2 ] . d i s s = k i n [ 6 8 ] ;a c [ 3 ] . c o n c = y t [ 8 ] / k i n [ 5 8 ] ;a c [ 3 ] . d i s s = k i n [ 6 9 ] ;
t c h = P H ( y t [ 1 3 ] / k i n [ 6 4 ] , k i n [ 6 5 ] , y t [ 1 2 ] / k i n [ 6 3 ] , k i n [7 0 ] , a c , 4 ) ;
203
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 226/265
/ * p r i n t f ( " I n i t P h = % f \ n " , - l o g l O ( tc h /1 0 0 0 . 0 ) ) ; * /t a = 0 ;f o r ( i = 0 ; i < = 3 ; i+ + )
{t b = a c [ i ] . d i s s / ( t c h + a c [ i ] . d i s s ) * a c [ i ] . co
n c ;t a = t a + t b ;
}y t [ 1 4 ] = ( y t [ 1 3 ] / k i n [ 6 4 ] - t a ) * k i n [ 6 4 ] ;
}
204
produced with permission of the copyright owner. Further reproduction p rohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 227/265
File 3: ode.c
# i n c l u d e " a n s b r . h "v o id o d e in t (d o u b l e y s t a r t [ ] , d o u b l e x l , d o u b l e x 2 , \
d o u b l e e p s , d o u b l e h i , d o u b l e h m i n , \
d ou bl e * * n u ,d o u b l e * k i n , d o u b l e * s t o , d o u b l e * y i n f ,\
d o ub le q f , d o u b l e q d , d o u b l e n f s x , d o u b l e n f r , d o u b l ev r t 1 , \
d o u b le g PH 2 , d o u b le g PC 0 2 , d o u b le g PC H 4 , d o u b le m ix ,
\
A
v o id ( * d e r i v s ) ( d o u b l e , d o u b l e [ ] , d o u b l e [ ] , d o u b l e 1
d o u b l e [ ] , d o u b l e [ ] , d o u b l e [ ] , \d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , \d o u b l e , d o u b l e , d o u b l e , d o u b l e ) )
i n t n s tp , i ;d o u b l e x , h n e x t , h d i d , h ;d o u b l e * y s c a l , * y , * d y d x ;
y s c a l = ( d o u b l e * ) m a l l o c ( ( Y V A R + 1 ) * s i z e o f ( d o u b l e ) ) ;
y = ( d o u b l e * ) m a l l o c ( (YVAR+1) * s i z e o f ( d o u b l e ) ) ;d y d x = ( d ou b l e * ) m a l l o c ( (YVAR+1) * s i z e o f ( d o u b l e ) ) ;x = x l ;h = S IG N ( h i , x 2 - x l ) ;
f o r ( i = l ; i < = Y V A R ; i + + )y [ i ] = y s t a r t [ i ] ; / * s e t s o d e in t
y [ i ] asi m p o r t ed y s t a r t [ i ] * /
f o r ( n s t p = l ; n s t p < = M A X S T P ; n s t p + + )
{( * d e r i v s ) ( x , y , d y d x , n u , k i n , s t o , y i n f , \
q f , q d , n f s x , n f r , v r t 1 , gPH2, gPC02, gPCH4, m i x ) ;
f o r ( i = l ; i <= YV AR ;i ++ )
y s c a l [ i ] = f a b s ( y [ i ] ) + f a b s ( d y d x [ i ] * h ) + T I N Y o d e ; / * T I N Y o d e = l e -3 0 , s e e * . h * /
i f ( ( x+ h - x2 ) * ( x + h - x l ) >0 . 0) h =x 2 - x ;s t i f b s (y , d yd x , YV AR ,& x , h , ep s , y s c a l , & h d i d , &
h n e x t , \
205
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 228/265
n u , k i n , s t o , y i n f , q f , q d , n f s x , n f r , v r t l , gPH2, gPC02, gPCH4, m ix ,d e r i v s ) ;
/ /( * r k q s ) ( y , d y d x , & x , h , e p s , y s c a l , & h d i d , &h n e x t , n u , p r o p , k i n , \
/ / s t o , p C H , v r t 2 , y i n f , t c , v r t 1 , t , d e r i v s ) ; / * ca l l s r kq sf u n c . * /
i f ( ( x - x 2 ) * ( x 2 - x l ) >=0 .0 ) / * i f x2 n
o t r e a c h e d ,c o n t i n u e l o o p i n g * /
{f o r ( i = l ; i < = Y V A R ; i + + )
y s t a r t [ i ] = y [ i ] ;
/ * r e t u r n s n e wy s t a r t [ i ] f r o m c a lc . y [ i ] * /
f r e e ( d y d x ) ; / * (as
ma in y [ i ] )
* /f r e e ( y ) ;f r e e ( y s c a l ) ;r e t u r n ; / * f u
n c t i o n m u s te nd t h i s wa y! * /
}i f ( f a b s ( h n e x t ) <= hmi n)
n r e r r o r ( " S te p s i z e t o o s m a l l i n o
d e i n t " ) ;h = h n e x t ;
}n r e r r o r ( " T o o many st ep s i n r o u t i n e o d e i n t " ) ;
} / * -------------------------------- End o f O d e i n t f u n c t i o n * /
v o id n r e r r o r ( c h a r e r r o r _ t e x t [ ] )
{f p r i n t f ( s t d e r r , " \ n N u m e r ic a l Rec i pe s r u n - t i m e e r r o
r . . . \ n " ) ;f p r i n t f ( s t d e r r , " % s \ n " , e r r o r _ t e x t ) ;f p r i n t f (s t d e r r n o w e x i t i n g t o s y s t e m . . . \ n " ) ;
e x i t ( 1 ) ;
} / * -------------------------------------End o f n r e r r o r f u n c t i o n * /
206
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 229/265
File 4: stiff.c
# i n c l u d e " a n s b r . h "s t a t i c d ou bl e * * d , * x ;
s t a t i c d o u bl e s q ar g ;d o u b l e m i n a r g l , m i n a r g 2 , m a x a r g l , m a x a r g 2 ;
v o id s t i f b s ( d o u b l e y [ ] , d o u b l e d y d x [ ] , i n t n v , d o u b l e *x x , d ou b l eh t r y , d o u b l e e p s , \
d ou bl e y s c a l [ ] , d ou bl e * h d i d , d o u b le * h n e x t , \d ou bl e * * n u ,d o ub l e k i n [ ] , d ou bl e s t o [ ] , d ou b l e y i n
f [ ] , \d o ub l e q f , d o u b l e q d , do u b le n f s x , d o u b l e n f r , d o u b l e
v r t l , \d o u b le g PH 2 , d o u b le g PC 0 2 , d o u b le g PC H 4 , d o u b le m ix ,
\v o i d ( * d e r i v s ) ( d o u b l e , d o u b l e [ ] , d o u b l e [ ] , d o u b l e * *
, \d o u b l e [ ] , d o u b l e [ ] , d o u b l e [ ] , \
d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , \d o u b l e , d o u b l e , d o u b l e , d o u b l e ) )
{/ / v o i d j a c ob n ( do u b le x , d o u b l e y [ ] , d o u b l e d f d x [ ] , d o ub le * * d f d y , i n tn) ;v o id s i m p r (d o u b le [ ] , d o u b l e ( ] , d o u b l e [ ] , d o u b l e * * , i n t , d ou b l
e, \ d o u b l e , i n t , d o u b l e [ ] , \d o ub l e * * , d o u b l e [ ] , d o u b l e [ ] , d o u b l e [ ] , \d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , \d o u b l e , d o u b l e , d o u b l e , d o u b l e , \v o i d ( * d e r i v s ) ( d o u b l e , d o u b l e [ ] , d o u b l e [ ] , d o u b l e * *
, \d o u b l e [ ] , d o u b l e [ ] , d o u b l e [ ] , \d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , \d o u b l e , d o u b l e , d o u b l e , d o u b l e ) ) ;
v o i d p z e x t r ( i n t i e s t , d o u b l e x e s t , d o u b l e y e s t [ ] , d ou b l ey z [ ] , d o u b l e d y [ ] , i n t nv) ;
i n t i , i q , k , k k , k m ;s t a t i c i n t f i r s t = l , k ma x , k o p t , n v o l d = - l ;s t a t i c d ou bl e e p s o l d = - l . 0 , x new;
207
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 230/265
e s t j
b l e )
b l e ) )
1 ]
d ou b le e p s l , e r r m a x , f a c t , h , r e d , s c a l e , w o r k , w r k m i n , x
d o ub le * d f d x , * * d f d y , * e r r , * y e r r , * y s a v , * y s e q ;s t a t i c d o u b l e a [ I M A X X + l ] ;s t a t i c d o u b l e a l f [ K M A X X+ 1 ] [KMAXX+1] ;
s t a t i c i n t n s e q [ I MAXX+ 1] = {0 , 2 , 6, 1 0, 14 , 2 2, 34 , 5 0, 70
i n t r e d u c t , e x i t f l a g = 0 ;d = ( d o u b l e * * ) m a l l o c ( ( n v + 1 ) * s i z e o f ( d o u b l e * ) ) ;
f o r ( i = l ; i < = n v ; i + + )d [ i ] = ( d o u b l e * ) m a l l o c ( ( KMAXX+1) * s i z e o f ( d o u
d f d x = ( d o u b l e * ) m a l l o c ( ( n v + 1 ) * s i z e o f ( d o u b l e ) ) ;
d f d y = ( d o u b l e * * )m a l l o c ( ( n v +1 ) * s i z e o f ( d o u b l e * ) ) ;f o r ( i = l ; i < = n v ; i + + )
d f d y [ i ] = ( d ou b le * ) m a l l o c ( ( n v+ 1 ) * s i z e o f ( d o u
e r r = ( d o u b l e * ) m a l l o c ( (KMAXX+1) * s i z e o f ( d o u b l e ) ) ;
x = ( d o u b l e * ) m a l l o c ( ( K M A X X + 1 )* s i ze o f (d o u b l e ) );
y e r r = ( d o u b le * ) m a l l o c ( ( n v + 1 ) * s i z e o f ( d o u b l e ) ) ;y s a v = (d o u b l e * )m a l l o c ( ( nv+ 1) * s i z e o f ( d o u b l e ) ) ;y s e q =( d ou b le * )m a l l o c ( ( n v + 1 ) * s i z e o f ( d o u b l e ) ) ;
i f ( e p s ! =e ps o ld | | n v != n v o ld )
{
* h n e x t = x n e w = - l . 0e2 9;e p s l = S A F E l * e p s ;a [ 1 ] = n s e q [ 1 ] + 1 ;f o r ( k = l ; k<=KMAXX;k++) a [ k + 1 ] = a [ k ] + n s e q [ k+
f o r ( i q = 2 ; i q< =K MA XX ;i q+ +)
{f o r ( k = l ; k < i q; k ++ )
a l f [ k ] [ iq ] = p o w ( e p s l , ( ( a [ k +1 ] - a [ i q + 1 ] ) / ( ( a [ i q + 1 ] - a [ 1 ]+ 1 . 0)* (2 * k+1) ) ) ) ;
}
e p s o l d = e p s ;n v o l d = n v ;a [ 1 ] + =nv ;f o r ( k = l ; k<=KMAXX;k++) a [ k + 1 ] = a [ k ] + n s e q [ k +
208
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 231/265
l ] ;
f o r ( k o p t = 2 ; k op t< KM AX X; ko pt ++ )i f ( a [ k o p t + 1 ] > a [ k o p t ] * a l f [ k o p t - 1 ] [
k o p t ] ) b r e a k ;
kma x= ko p t ;}h = h t r y ;f o r ( i = l ; i < = n v ; i + + ) y s a v [ i ] = y [ i ] ;
j a c o b n ( * x x , y , d f d x , d f d y , n u , k i n , s t o , q f , q d , n f s x , n f r ,v r t 1 , m i x ) ;/ / j a c o b n ( * x x , y , d f d x , d f d y , n v ) ;
i f ( * x x ! = x n e w | I h ! = ( * h n e x t ))
{f i r s t = l ;kop t=kmax;
}r e d u c t = 0 ;
f o r ( ; ; )
{f o r ( k = l ; k <=kmax; k++)
{x n e w = ( * x x ) + h ;i f ( x n e w = = ( * x x ) )
{
p r i n t f ( " x n e w = %f ,h=%e \ n
" , x n e w , h ) ;
e x i t ( 1 ) ; n r e r r o r ( " s te p s i z e u n d e r f
l o w i ns t i f b s " ) ;
}
s i m p r ( y s a v , d y d x , d f d x , d f d y , n v , * x x , h , n s e q [ k ] , yseq , \
n u , k i n , s t o , y i n f , q f , q d , n f s x , n f r , v r t 1 , g P H 2 , g P C 0 2 , g P C H 4 , m i x ,d e r i v s ) ;
x e s t =S Q R ( h / ns e q [ k ] ) ;
p z e x t r ( k , x e s t , y s e q , y , y e r r , n v ) ;i f ( k !=1)
{e r rmax=TINY;f o r ( i = l ; i <= nv ; i + + )
e r r m a x = F M A X ( e r r m a x , f a b s ( y e r r [ i ] / y s c a l [ i ] ) ) ;
209
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 232/265
1.0/(2 * km+1))
e r r m a x / = e p s ;k m = k - l ;
e r r [ k m ] = p o w ( e r r m a x / S A F E l ,
}
i f ( k ! = l && ( k > = k o p t - l | | f i r s t )){
i f ( e r r m a x < l . 0 )
{e x i t f l a g = l ;b r e a k ;
}i f ( k = = k m a x | | k = = k o p t + l )
{r ed =S AF E2 / e r r [ km]
b r e a k ;
}e l s e
i f ( k = = k o p t & & a l f [ k o p t -1 ] [ k o p t ]< e r r [ k m ]
{
}e l s e
i f ( k = = km a x & & a l f [ k m ] [ k m a x - 1 ] < e r r [k m ] )
{
r e d = l . 0 / e r r [ k m ];b r e a k ;
r e d = a l f [ k m ] [ km ax -1 ] * S A F E 2 /e r r [ km ] ;
[km] )
1 ] / e r r [ km]
b r e a k ;
}e ls e i f ( a l f [ k m ] [ k o p t ] < e r r
{
r e d = a l f [ k m ] [ k o p t -
b r e a k ;
}}
i f ( e x i t f l a g ) b r e a k ;red= FMIN( red,R EDMIN)red=FMAX(red,REDMAX)h * = r e d ;r e d u c t = l ;
210
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 233/265
}
*xx=xnew;* h d i d = h ;f i r s t = 0 ;w r k m i n = l . 0 e 3 5 ;f o r ( k k = l ; k k< =k m; kk+ +)
{f a c t = F M A X ( e r r [ k k ] , SCALMX);w o r k = f a c t * a [ k k + 1 ] ;i f ( wo rk < wr km i n)
{s c a l e = f a c t ;w rkm in = w o rk ;k o p t = k k + l ;
}}* h n e x t = h / s c a l e ;
i f ( ko pt >= k& & k o p t ! = km ax && ! r e d u c t )
{f a c t = F M A X ( s c a l e / a l f [ k o p t - 1 ] [ k o p t ] , SCALMX)
i f ( a [ k o p t + 1 ] * f a c t < = w r k m i n )
{* h n e x t = h / f a c t ;k o p t + + ;
}}f r e e ( y s e q ) ;f r e e ( y s a v ) ;
f r e e ( y e r r ) ;f r e e ( x ) ;f r e e ( e r r ) ;f r e e ( d f d x ) ;
f o r ( i = l ; i < = n v ; i + + )
{f r e e ( d f d y [ i ] ) ;f r e e ( d [ i ] ) ;
}f r e e ( d f d y ) ;f r e e ( d ) ;
v o i d p z e x t r ( i n t i e s t , d o u b l e x e s t , d o u b l e y e s t [ ] , d ou bl e yz [] , d ou bl ed y [ ] , i n t nv)
{i n t k l , j ;
211
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 234/265
d o u b l e q , f 2 , f l , d e l t a , * c ;c = ( d o u b l e * ) m a l l o c ( ( n v + 1 ) * s i z e o f ( d o u b l e ) ) ;
x [ i e s t ] = x e s t ;f o r ( j = l ; j < = n v ; j + + ) d y [ j ] = y z [ j ] = y e s t [ j ] ;i f ( i e s t = = l )
f o r ( j = l ; j < = n v ; j + + ) d [ j ] [ 1 ] = y e s t [ j ] ;e l s e
{f o r ( j = l ; j < = n v ; j + + ) c [ j ] = y e s t [ j ] ;f o r ( k l = l ; k l < i e s t ; k l + + )
{
d e l t a = 1 . 0 / ( x [ i e s t - k l ] - x e s t )f l = x e s t * d e l t a ;f 2 = x [ i e s t - k l ] * d e l t a ;
f o r ( j = l ; j < = n v ; j + + )
{
q = d [ j ] [ k l ] ;d [ j ] [ k l ] = d y [ j ] ;d e l t a = c [ j ] - q ;
d y [ j ] = f l * d e l t a ;c [ j ] = f 2 * d e l t a ;y z [ j ] + =d y [ j ] ;
i f ( y z [ j ] < = 0 ) y z [ j ] = T I N Y ;
}}f o r ( j = 1 ; j < = n v ; j ++) d [ j ] [ i e s t ] = d y [ j ]
}f r e e ( c ) ;
}
212
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 235/265
File 5: sim.c
# i n c l u d e " a n s b r . h "
v o i d s i m p r ( d o u bl e y [ ] , d ou bl e d y d x [ ] , d ou bl e d f d x [ ] , d ou b l e* * d f d y , i n t n ,d o u b l e x s , \
d ou bl e h t o t , i n t n s te p ,d o u b l e y o u t [ ] , \d ou b l e * * n u ,d o ub l e k i n [ ] , d ou bl e s t o [ ] , d ou bl e y i n
f [ ] , \d ou b l e q f , d o u b l e q d ,d o u b l e n f s x , d o u b l e n f r , d o u b l e
v r t 1, \d o u b l e g P H 2 , d o u b l e g P C 0 2 , d o u b l e g P C H 4 , d o u b l e m i x ,
\v o i d ( * d e r i v s ) ( d o u b l e , d o u b l e [ ] , d o u b l e [ ] , d o ub l e * *
,\ d o u b l e [ ] , d o u b l e [ ] , d o u b l e [ ] , \d o u b l e , d o u b l e , d o u b l e , d o u b l e , d o u b l e , \d o u b l e , d o u b l e , d o u b l e , d o u b l e ) )
{v o i d l u b k s b (d o u b l e * * a , i n t n, i n t * i n d x , d ou b l e
b [ ] ) ;v o i d l ud cm p (d o ub le * * a , i n t n, i n t * i n d x , d o u b l e * d
) ;i n t i , j , n n , * in d x ;d ou bl e d , h , x , * * a , * d e l , * y t e m p ;i n d x = ( i n t * ) m a l l o c ( ( n + 1 ) * s i z e o f ( i n t ) ) ;
a = ( d o u b l e * * ) m a l l o c ( ( n + 1) * s i z e o f ( d o u b l e * ) ) ;f o r ( i = l ; i < = n ; i + + )a [ i ] = ( d o u b l e * ) m a l l o c ( ( n + l ) * s i z e o f ( d o u b l e )
) ;d e l = ( d o u b l e * ) m a l l o c ( ( n + 1 ) * s i z e o f ( d o u b l e ) ) ;y t e m p = ( d o u b le * ) m a l l o c ( ( n + 1 ) * s i z e o f ( d o u b l e ) ) ;h = h t o t / n s t e p ;
f o r ( i = l ; i < = n ; i + + )
{f o r ( j = l ; j < =n ; j + + ) a [ i ] [ j ] = - h * d f d y [ i ] [ j ] ;a [ i ] [ i ] = a [ i ] [ i ] + 1 . 0 ;
}
l u d c m p ( a , n , i n d x , & d ) ;
f o r ( i = l ; i < = n ; i + + )y o u t [ i ] = h * ( d y d x [ i ] + h * d f d x [ i ] ) ;
213
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 236/265
l u b k s b ( a , n , i n d x , y o u t ) ;f o r ( i = l ; i < = n ; i + + )
y t e m p [ i ] = y [ i ] + ( d e l [ i ] = y o u t [ i ] ) ;x= xs+ h ;( * d e r iv s ) ( x , y t e m p , y o u t , n u , k i n , s t o , y i n f , \
q f , q d , n f s x , n f r , v r t 1 , gPH2, gPC02, gPCH4, m i x ) ;/ / ( * d e r i v s ) ( x , y t e m p , y o u t ) ;
f o r ( n n = 2 ; n n < = n s t e p ; n n + + )
{
f o r ( i = l ; i < = n ; i + + )y o u t [ i ] = h * y o u t [ i ] - d e l [ i ] ;
l u b k s b ( a , n , i n d x , y o u t ) ;f o r ( i = l ; i < = n ; i + + )
y t e mp [ i ] += ( d e l [ i ] + =2 . 0 * y o u t [ i ] ) ;x+=h;
( * d e r i v s ) ( x , y t e m p , y o u t , n u , k i n , s t o , y i n f , \q f , q d , n f s x , n f r , v r t 1 , g P H 2 , g P C 0 2 , g P C H 4 , m i x ) ;
/ / ( * d e r i v s ) ( x , y t e m p , y o u t ) ;
}f o r ( i = l ; i < = n ; i + + )
y o u t [ i ] = h * y o u t [ i ] - d e l [ i ] ;l u b k s b ( a , n , i n d x , y o u t ) ;f o r ( i = l ; i < = n ; i + + )
{y o u t [ i ] + = y t e m p [ i ] ;i f ( y o u t [ i ] < = 0 ) y o u t [ i ] = T I N Y ;
}f r e e ( y t e m p ) ;
f r e e ( d e l ) ;f o r ( i = l ; i < = n ; i + + )f r e e ( a [ i ] ) ;
f r e e ( a ) ;f r e e ( i n d x ) ;
v o i d lu dc mp (d ou b l e * * a , i n t n , i n t * i n d x , d o u b l e *d)
{i n t i , i m a x , j , k;d o u b l e b i g , d u m , s u m , t e m p ;
d o u b l e * v v ;
v v = ( d o u b l e * ) m a l l o c ( ( n + 1 ) * s i z e o f ( d o u b l e ) ) ;* d = l . 0 ;f o r ( i = l ; i < = n ; i + + )
{b i g = 0 . 0 ;f o r ( j = l ; j < = n ; j ++)
214
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 237/265
{
i f ( ( t e m p = f a b s ( a [ i ] [ j ] ) ) > b i g ) b ig =
temp;
}
i f ( b i g = = 0 . 0 ) n r e r r o r ( " S in g u l a r m a t r i x i n
r o u t i n el u d c m p " ) ;
v v [ i ] = 1 . 0 / b i g ;
}
f o r ( j = l ; j < = n ; j + + )
{
f o r ( i = l ; i < j ; i + + )
{
s u m = a [ i ] [ j ] ;f o r ( k = l ; k < i ; k + + ) s u m - = a [ i ] [ k ] * a [ k
] [ j ] ; a [ i ] [ j ] =sum;
}
b i g = 0 . 0 ;f o r ( i = j ; i < = n ; i + + )
{
s um = a[ i ] [ j ] ;f o r ( k = l ; k < j ; k++)
s u m- =a [ i ] [ k ] * a [ k ] [ j ] ;a [ i ] [ j ] =sum;i f ( ( d u m = v v [ i ] * f a b s ( s u m ) ) >=b ig )
{
b ig=dum;i m a x = i ;
}}i f ( j ! = imax)
{f o r ( k = l ; k < = n ; k + + )
{d u m = a [ i m a x ] [ k ] ;
a [ i m a x ] [ k ] = a [ j ] [ k ] ;a [ j ] [ k ]=dum;
}
* d = - ( * d ) ;v v [ im ax ] = v v [ j ] ;
}
i n d x [ j ] = imax ;i f ( a [ j ] [ j ] — 0 .0 ) a [ j ] [ j ] =T INY;i f ( j ! = n )
215
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 238/265
}
v o i d
{
b [ j ]
d u m = l . 0 / ( a [ j ] [ j ] ) ;f o r ( i = j + 1 ; i< = n ; i + + ) a [ i ] [ j ] * = d u m
}
}
f r e e ( v v ) ;
l ub k sb ( do u b l e * * a , i n t n , i n t * i n d x , d o u b l e b [ ] )
i n t i , i i = 0 , i p , j ;doub le sum;f o r ( i = l ; i < = n ; i + + )
{i p = i n d x [ i ] ;
s u m = b [ i p ] ;b [ i p ] = b [ i ] ;
i f ( i i ) f o r ( j = i i ; j < = i —1 ; j+ + ) s u m - = a [ i ] [ j ]
e l s e i f ( su m ) i i = i ;b [ i ] = s u m ;
}f o r ( i = n ; i > = l ; i - - )
{sum=b[ i ] ;f o r ( j = i + l ; j < = n ; j ++) s u m -= a [ i ] [ j ] * b [ j ] ;b [ i ] = s u m / a [ i ] [ i ] ;
}
216
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 239/265
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 240/265
a c [ 0 ] . c o n c= y [ 5 ] / k i n [ 55 ] ;a c [ 0 ] . d i s s = k i n [ 6 6 ] ;a c [ 1 ] . c o n c = y [ 6 ] / k i n [ 5 6 ] ;
a c [ 1 ] . d i s s = k i n [ 6 7 ] ;a c [ 2 ] . c o n c= y [ 7 ] / k i n [ 57 ] ;
a c [ 2 ] . d i s s = k i n [ 6 8 ] ;a c [ 3 ] . c o n c= y [ 8 ] / k i n [ 58 ] ;a c [ 3 ] . d i s s = k i n [ 6 9 ] ;c h= PH (y [ 1 3 ] / k i n [ 64 ] , k i n [ 6 5 ] , y [ 1 2 ] / k i n [ 6 3 ] , k i n [70]
f 3.C / 4 ) /hh = y [ 1 0 ] / k i n [ 6 0 ] / k i n [ 7 3 ] ;
R H O ( r ho , y , k i n , s t o , c h , h h , g P H 2 , g PC02, gPCH4, v r t 1,m ix ) ;
f o r ( i = l ; i <= YV AR ;i ++ )
{ r [ i ] =0 .0 ;r a t e = 0 . 0 ;f o r ( j = l ; j < = P ; j + + ){ ra te
/ * n f r i sr e a c t i o n e f f i c i e n c y * /
r [ i ]
}}f r e e ( r h o ) ;
f r e e ( a c ) ;r e t u r n ;
} / * ---------------------------------------End o f F i n d _ r f u n c t i o n * /v o i d RHO( doubl e * r h o , d o u b l e y [ ] , d o u b l e k i n [ ] , d o ub l e s t o [ ]
,\d o u b le C H , d o u b le PH 2 , d o u b le g PH 2 , d o u b le g PC 0 2 , d o u
b l eg PC H4 ,d ou bl e v r t l , d o u b l e m ix )
{
i n t j ;
d o u b l en r H 2 X f 1 , n r H 2 X f a , n r H 2 X f b , n r H 2 X l a , n r H 2 X l p , n i H 2 X f , n i H 2 X l , n i H2Xp, \
n i H 2 X b , n i p H X f , n i p H X a , n i p H X h , t x , t a , t b ;
n r H 2 X f 1 = k i n [ 7 8 ] * PH2/ ( k i n [ 4 8 ] +PH2) ;
n r H2X fa = ( k i n [ 4 8 ] + ( 1 - k i n [ 7 8 ] ) * PH2) / ( k i n [ 4 8 ] +PH2)
218
= n u [ i ] [ j ] * r h o [ j ] * n f r ;
= r [ i ] + r a t e ;
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 241/265
* ( k i n [49] + ( 1 - k i n [ 7 9 ] ) * PH 2) / ( k i n [ 4 9 ] +PH2) ;n rH 2 Xf b = ( k i n [ 4 8 ] + ( 1 - k i n [ 7 8 ] ) * PH2) / ( k i n [ 4 8 ] +PH2)
*
k i n [7 9 ] * P H 2 / ( k i n [ 4 9 ] +PH2) ;
n rH 2X l a = ( k i n [ 5 0 ] + ( 1 - k i n [ 8 0 ] ) *PH2) / ( k i n [ 5 0 ] +PH2)f
n rH 2X l p = k i n [ 8 0 ] * P H 2 / ( k i n [ 5 0 ] +PH2) ;
n iH 2 X f = k i n [ 8 1 ] * k i n [ 4 4 ] / ( k i n [ 4 4 ] +PH2) ;
n iH 2 X l = k i n [ 8 2 ] * k i n [4 6 ] / ( k i n [ 4 6 ] +PH2 ) ;
t x = P H 2 / k i n [ 4 5 ] ;
i f ( t x C C O N T I N )
{n iH2 Xp = l - p o w ( t x , 3 ) ;
}e l s e
{
t a = ( l -CONTIN*CONTIN*CONTIN) * ( l -CONTIN*CONTIN*CONTIN) /CONT
I N / C ON TI N / 3 ;t b =4 * C ON TI N / 3 - l / 3 / C ON TI N / C ON TI N ;n i H 2 X p = t a / ( t x - t b ) ;
}t x = P H 2 / k i n [ 4 7 ] ;i f ( tx CC ON TIN )
{n i H2Xb = l - p o w ( t x , 2 ) ;
}e l s e
{t a = ( l - C O N T I N * C O N T I N ) * ( l - CO NT I N* CO NT IN ) / CO
N T I N / 2 ;t b = 3 * C O N T I N / 2 - l / C ON TI N/ 2;n i H 2 X b = t a / ( t x - t b ) ;
}
n ip H Xf = ( k i n [ 3 5 ] / ( k i n [35 ] + C H) ) * ( C H / ( k i n [ 37 ] +C H ) )
* ( ( k i n [35 ] + k i n [ 3 6 ] ) / k i n [ 3 5 ] ) *( ( k i n [37] +
k i n [ 3 6 ] ) / k i n [ 3 6 ] ) ;n ip HXa = ( k i n [ 3 8 ] / ( k i n [38] + CH) ) * ( C H / ( k i n [4 0] +
2 1 9
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 242/265
CH) )* ( ( k i n [38] +
k i n [39] ) / k i n [ 3 8 ] ) * ( ( k i n [ 40] + k i n [ 3 9 ] ) / k i n [ 39 ] ) ;n ipHXh = ( k i n [ 4 1 ] / ( k i n [41] + C H) ) * ( C H / ( k i n [ 43 ] +
CH) )
* ( ( k i n [41] +k i n [ 4 2 ] ) / k i n [ 4 1 ] ) * ( ( k in [ 4 3 ] + k i n [ 4 2 ] ) / k i n [ 42 ] ) ;
r h o [ 1] = k i n [1] * ( y [ 1 5 ] / y [ 1 7 ] ) / ( k i n [ 2 ] +y [ 1 5 ] / y [17] ) *
y [ 1 7 ] ;r h o [ 2 ] = k i n [3] * y [ 1 ] / ( k i n [ 4 ] + y [ 1 ] ) * y [ 1 7 ] ;
r h o [ 3 ] = k i n [ 5 ] * y [ 3 ] / ( k i n [ 6 ] + y [ 3 ] ) * y [ 1 7 ] ;
r h o [ 4 ] = n r H 2 X f a * k i n [ 7 ] * s t o [ 1 7 ] * y [ 2 ] / ( k i n [ 8 ] + y [ 2 ] ) *
y [ 17 ] ;r h o [ 4 ] = r h o [ 4 ] * n i p H X f * n i H 2 X f ; / * x f ph2 i n h i b i t i
o n a d d e d * /r h o [ 5 ] = n r H 2 X f l * k i n [ 1 0 ] * s t o [ 1 8 ] * y [ 2 ] / ( k i n [ 1 1 ] + y [ 2]
) * y [ 1 7 ] ;r h o [ 5 ] = r h o [ 5 ] * n i p H X f * n i H 2 X f ; / * x f ph2 i n h i b i t i
o n a d d e d * /r h o [ 6 ] = n r H 2 X fb * k i n [ 1 3 ] * s t o [ 1 9 ] * y [ 2 ] / ( k i n [ 1 4 ] + y [2]
) * y [ 1 7 ] ;r h o [ 6 ] = r h o [ 6 ] * n ip H X f * n iH 2 X f ; / * x f ph2 i n h i b i t i o
n a d d e d * /r h o [ 7 ] = k i n [ 1 6 ] * s t o [ 2 0 ] * y [ 6 ] / ( k i n [ 1 7 ] + y [ 6 ] ) * y [ 18] ;
r h o [ 7 ] = r h o [ 7 ] * n i H 2 X p * n i p H X f ;r h o [ 8 ] = n r H 2 X l a * k in [ 1 9 ] * s t o [ 2 1 ] * y [ 7 ] / ( k i n [ 2 0 ]+ y [ 7]
) * y [ 1 9 ] ;r h o [ 8 ] = r h o [ 8 ] * n i H 2 X l * n i p H X f ;r h o [ 9 ] = n r H 2 X l p * k in [ 2 2 ] * s t o [ 2 2 ] * y [ 7 ] / ( k i n [ 2 3 ] + y [7]
) * y [ 19] ;r h o [ 9 ] = r h o [ 9 ] * n i H 2 X l * n i p H X f ;r h o [ 1 0 ]= k i n [ 2 5 ] * s t o [ 2 3 ] * y [ 8 ] / ( k i n [2 6 ] + y [ 8 ] ) * y [20]
t r h o [ 1 0 ] = r h o [ 1 0 ] * n i H 2 X b * n i p H X f ;r h o [ 1 1 ] = k i n [ 2 8 ] * s t o [ 2 4 ] * y [ 5 ] / ( k i n [ 2 9 ] + y [ 5 ] ) * y [ 2 1 ]
f
r h o [ 1 1 ] = r h o [ 1 1 ] * n i p H X a ;
r h o [ 1 2 ] = k i n [ 3 1 ] * s t o [ 2 5 ] * y [ 1 0 ] / ( k i n [ 3 2 ] + y [ 1 0 ] ) * y [ 2
2 ];
r h o [ 1 2 ] = r h o [ 1 2 ] * n i p H X h ;r h o [ 1 3 ] = ( n r H 2 X f a * k i n [9 ] + n r H 2 X f l * k i n [12 ] +n r H 2 X f b * k i n [ 1 5 ] ) * y [17] ;
r h o [ 1 4 ] = k i n [ 1 8 ] * y [ 1 8 ] ;r h o [ 1 5 ] = ( n r H 2 X l a * k i n [21] + n r H 2 X l p * k i n [ 2 4 ] ) * y [19 ]
220
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 243/265
r h o [ 1 6 ] = k i n [ 2 7 ] * y [ 20 ] ;
r h o [ 1 7 ] = k i n [ 3 0 ] * y [ 2 1 ] ;r h o [ 1 8 ] = k i n [ 3 3 ]* y [ 2 2 ] ;
/ * n e w y a l e * /
r ho [ 1 9 ] = m i x * k i n [ 3 4 ] * ( CH /( CH +k in [7 0 ] ) * y [ 1 2 ] / k i n[63] -g P C 0 2 * k i n [ 7 1 ] ) * k i n [ 6 3 ] ;
r h o [ 2 0 ] = m i x * k i n [ 7 7 ] * ( y [ 9 ] / k i n [59] - g PC H4 *k i n[72 ] ) * k i n [ 5 9 ] ;
r h o [ 2 1 ] = m i x * k i n [7 6 ] * ( y [ 1 0 ] / k i n [ 6 0 ] - g P H 2 * k in [7 3 ] ) *
k i n [60] ;f o r ( j = l ; j < = P ; j + + )
r h o [ j ] = r h o [ j ] / 2 4 .0 ;r e t u r n ;
} / * ---------------------------- End o f F i n d _ rh o f u n c t i o n * /
/ * e n d o f z h l s t d f . c f i l e * /
d o u b l e P H ( d o u b l e C N a n e t , d o u b l e K w , d o u b l e C TC 03 , \d o u b l e KaH2C03, A c i d * a c , i n t num)
{i n t i , m , k ;d o u b l e e r r m a x l = 0 . 0 , e r r m a x 2 = 0 . 0 , e p sg = l e - 3 , T C H ,
T C a l k ;
d o u b l e c y , t e m p a ;d o u b l e C a l k o l d , C H o l d , t e m p b , t e m p c ;i f ( c o n p h > 3 & & c o n p h < 1 0 )
{
r e t u r n p ow ( 1 0 . 0 , 3 - c o n p h ) ;
}T C H = l e - 4 ;
C a l k o l d = C N a n e t ;f o r ( i = l ; i < = 1 0 ; i + + ) / * l o o p w i l l s to p a f t e r max.
10 i t e r a t i o n so r b e f o r e * /
{t e m p a =0 ;f o r ( k =0 ; k <= n u m - l ; k + + )
{ cy = a c [ k ] . d i s s / (T C H + a c [ k ] . d i s s ) *
a c [ k ] . c one ;/ * d i s s o c . c o n c . ( mo l/ m3 ) o f VFAs * /
t empa=tempa+cy ;
}
221
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 244/265
T C a l k = C N a n e t - t e m p a ;
e r r m a x 2 = 0 . 0 ;
C H ol d = TCH; / * s t a r t g uess pH =7.0
* /
f o r ( m= l; m<= 10 ;m+ +) / * l o o p w i l l s t o p a f t er m a x . 1 0
i t e r a t i o n s o r b e fo r e * /
{
t e m p a =0 ;f o r ( k =0; k <= n u m - 1 ; k ++ )
{
c y = T C H / ( T C H + a c [ k ] . d i s s )
* a c [ k ] . c one;/ * d i s s o c . c o n c . ( mo l /m 3) o f VFAs * /
t em pa =t em pa +a c[ k ] . d i s s * c y
r
}
/ * s o lv e q u a d r a t i c e q u a t i o n f o r C
H * /tempb = TCalk ;
tempc = -(Kw + KaH2C03*TCH/(KaH2C
03+TCH)*CTC03
+ t e m p a ) ;TC H = - t e m p b / 2 . 0 + s q r t ( p o w ( t e m p b
,2 .0 ) -
4 . 0 * t e m p c ) / 2 . 0 ;e r r m a x 2 = f a b s ( T C H / C H o l d - 1 . 0 ) ;
i f ( ( e r rm a x 2 /e p s g ) <= 1 .0) b re a k ;
/ * e p s g = l e - 3n o r m a l l y s a m e a s r q k s * /
CHold = TCH;} / * e n d pH c a l c , l o o p * /e r rm a x l = f a b s ( T C a l k / C a l k o l d - 1 . 0 ) ;i f ( ( e r r m a x l / e p s g ) < = 1 .0) b re a k ; / *e p s g = l e
-3 norm.paramete r same as rqks * /
C a l k o l d = T C a l k ;} / * e n d A i k . c a l c , l o o p * /
r e t u r n T C H ;}
222
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 245/265
File 7: jac.c (user-supplied routine jacobn)
# i n c l u d e " a n s b r . h "v o i d ja c o b n ( d o u b l e x , d o u b l e y [ ] , d o ub l e d f d x [ ] , d o ub l e * *
d f d y , \d ou b l e * * n u ,d o u b l e k i n [ ] , d ou bl e s t o [ ] , \
d o ub l e q f , d o u b l e q d ,d o u b l e n f s x , d o u b l e n f r , d o u b l ev r t 1 , d ou bl e
mix)
{
i n t i ;D RA TE DY (d fd y, y, nu , k i n , s t o , v r t 1 , n f r , m i x ) ;
f o r ( i = l ; i < = 1 4 ; i + + )
{d f d x [ i ] = 0 ;d f d y [ i ] [ i ] = d f d y [ i ] [ i ] - q f / ( v r t l t ( q
f - q d ) * ( x - 0 ) ) ;
}
f o r ( i = 1 5 ; i < = Y V A R ; i + + )
{d f d x [ i ] = 0 ;d f d y [ i ] [ i ] =
d f d y [ i ] [ i ] + ( q d * n f s x - q f ) / ( v r t l + ( q f - q d ) * ( x - 0 ) ) ;
}r e t u r n ;
v o i d DRATEDY( doubl e * * d f d y , d o u b l e y [ ] , d o u b l e * * n u , \d ou b le k i n [ ] , d ou b le s t o [ ] , d ou b l e v r t l , d o u b l e n f r ,
d o u b l e m i x )
{i n t i , j , k ;d o u b l e * * d r o d y ;d o u b l e c h , h h ;
A c i d * a c ;a c = ( A c i d * ) m a l l o c ( 4 * s i z e o f ( A c i d ) ) ;
a c [ 0 ] . c on c= y [ 5 ] / k i n [ 5 5 ] ;
a c [ 0 ] . d i s s = k i n [ 6 6 ] ;a c [ 1 ] . c on c= y [ 6 ] / k i n [ 5 6 ] ;a c [ l ] . d i s s = k i n [ 6 7 ] ;a c [ 2 ] . c on c= y [ 7 ] / k i n [ 5 7 ] ;a c [ 2 ] . d i s s = k i n [ 6 8 ] ;a c [ 3 ] . c on c= y [ 8 ] / k i n [ 58 ] ;
223
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 246/265
ac[3].diss=kin[69];ch=PH(y [13]/kin[64],kin[65],y[12]/kin[63],kin[70]
,ac,4) ;hh = y [ 1 0 ] / k i n [ 6 0 ] / k i n [ 7 3 ] ;
d r o d y = ( d o u b l e * * ) m a l l o c ( ( P + l ) * s i z e o f ( d o u b l e * ) ) ;f o r ( i = l ; i < = P ; i + + )
d r o d y [ i ] = ( d o u b l e * ) c a l l o c ( (YVAR+1) , s i z e o f (d o u b l e ) ) ;
DRHODY( dr od y, y, k i n , s t o , c h, h h , v r t l , m i x ) ;f o r ( i = l ; i < = Y V A R ; i + + )
{
f o r ( j = l ; j < = Y V A R ; j + + )
{
d f d y [ i ] [ j ] = 0 ;f o r ( k = l ; k < = P ; k + + )
{
d f d y [ i ] [ j ] = d f d y [ i ] [ j ] + n u [ i ] [ k ] * d r o d y [ k ] [ j ] * n f r ;
}}
}f r e e ( a c ) ;f o r ( i = l ; i < = P ; i + + ) f r e e ( d r o d y [ i ] ) ;f r e e ( d r o d y ) ;r e t u r n ;
}
v o i d DRHODY(double * * d r h o d y , d o u b l e y [ ] , d o u b l e k i n [ ] , d o u b l
e s t o [ ] , \d o u b le C H ,d o ub le P H 2 ,d ou b le v r t l , d o u b l e m ix )
{
i n t i = l , j = l ;d o u b l e
n r H 2 X f 1 , n r H 2 X f a , n r H 2 X f b , n r H 2 X l a , n r H 2 X l p , n i H 2 X f , n i H 2 X l , n i H
2Xp, \n i H 2 X b , n i p H X f , n i p H X a , n i p H X h ;
d o u b l ed r f l , d r f a , d r f b , d r l a , d r i p , d i f , d i l , d i p , d i b , t e m p , t e m p i , t e m p 2
, t x , t a , t b ;
n r H 2 X f l = k i n [ 7 8 ] * P H 2 / ( k i n [ 4 8 ] + PH2) ;
d r f l = k i n [ 7 8 ] * k i n [ 4 8 ] / ( k i n [4 8 ] +PH2) / ( k i n [4 8 ] +PH2) / k i n [ 6 0 ] /
k i n [ 7 3 ] ;
224
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 247/265
nrH2Xfa = (kin[48]+(1-kin[78])*PH2)/(kin[48]+PH2)*
( k i n [4 9 ] + ( l - k i n [ 7 9 ] ) * P H 2 ) / ( k i n [ 4 9 ] +PH2) ;t e m p = ( k i n [ 4 8 ] + PH2)* ( k i n [ 4 8 ] +PH2) * ( k i n [ 4 9 ] +PH2) * (k
i n [4 9 ] + PH 2) ;t e m p l = ( 1 - k i n [7 8 ] ) * ( k i n [ 4 9 ] + ( l - k i n [ 7 9 ] ) *PH2) +
( 1 - k i n [7 9 ] ) * ( k i n [ 4 8 ] + ( 1 - k i n [ 7 8 ] ) * P H2 );t e m p l = t e m p l * t e m p ;
t e m p 2 = ( k i n [ 4 9 ] + k i n [ 4 8 ] + 2 * P H 2 ) *( k i n [ 4 8 ] + ( l - k i n [ 7 8 ] ) * P H 2 ) * ( k i n [ 4 9 ] + ( 1 - k i n [ 7 9 ] ) *P H 2 ) ;
d r f a = ( t em p l - te m p 2) / t e m p / k i n [ 6 0 ] / k i n [73] ;
n rH 2X fb = ( k i n [ 4 8 ] + ( 1 - k i n [ 7 8 ] ) * PH2) / ( k i n [ 4 8 ] +PH2)*
k i n [7 9 ] * P H 2 / ( k i n [ 4 9 ] +PH2) ;
t e m p l = ( 1 - k i n [ 7 8 ] ) * k i n [7 9 ] * P H2 + k in [7 9 ] * ( k i n [ 4 8 ] + ( 1 - k i n [78]) * P H 2 ) ;
t e m p l = t e m p l * t e m p ;t e m p 2 = ( k i n [ 4 9 ] + k i n [ 4 8 ] + 2 * P H 2 ) *
( k i n [ 4 8 ] + ( 1 - k i n [ 7 8 ] ) * P H 2 ) * k i n [7 9 ] * PH2;d r f b = (t em p l- te m p2 ) / t e m p / k i n [ 6 0 ] / k i n [ 7 3 ] ;
n r H2 X la = ( k i n [ 5 0 ] + ( 1 - k i n [ 8 0 ] ) *PH2) / ( k i n [ 5 0 ] +PH2)
d r l a = ( ( 1 - k i n [ 8 0 ] ) * ( k i n [ 5 0 ] + P H 2 ) - ( k i n [ 5 0 ] + ( 1 - k i n [ 8 0 ] ) * P H 2 )
) / ( k i n [ 5 0 ] +PH2) / ( k i n [ 5 0 ] + P H 2 ) / k i n [ 6 0 ] / k i n [7 3 ] ;
n rH 2X lp = k i n [ 8 0 ] * P H 2 / ( k i n [ 5 0 ] + PH2 );
d r l p = k i n [ 8 0 ] * k i n [ 5 0 ] / ( k i n [ 5 0 ] +PH2) / ( k i n [ 5 0 ] +PH2) / k i n [ 6 0 ] /
k i n [ 7 3 ] ;
n i H 2 X f = k i n [ 8 1 ] * k i n [ 4 4 ] / ( k i n [ 4 4 ] +PH2) ;
d i f = - k i n [ 8 1 ] * k i n [ 4 4 ] / ( k i n [ 4 4 ] +PH2) / ( k i n [ 4 4 ] +PH2) / k i n [ 6 0 ] /k i n [ 7 3 ] ;
n iH 2X l = k i n [ 8 2 ] * k i n [ 4 6 ] / ( k i n [ 4 6 ]+PH2 ) ;
d i l = - k i n [ 8 2 ] * k i n [ 4 6 ] / ( k i n [ 4 6 ] +PH2) / ( k i n [ 4 6 ]+PH2) / k i n [ 6 0 ] /
k i n [ 7 3 ] ;
225
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 248/265
t x = P H 2 / k i n [ 4 5 ] ;i f ( tx CCONT IN)
{
n iH2Xp = l - p o w ( t x , 3 ) ;d i p = - 3 * p o w ( t x , 2 ) / k i n [ 4 5 ] / k i n [ 6 0 ] / k i n [7 3 ] ;
}e l s e
{
t a = ( l -CONTIN*CONTIN*CONTIN)* ( l -CONTIN*CONTIN*CONTIN) /CONT
IN/CONTIN/3 ;tb=4 *C ON TI N/ 3- 1 / 3 / CONTIN/CONTIN;n i H 2 X p = t a / ( t x - t b ) ;d i p = - t a / ( t x - t b ) / ( t x - t b ) / k i n [ 4 5 ] / k i n [ 6 0 ] / k
i n [ 7 3 ] ;
}
t x = P H 2 / k i n [ 4 7 ] ;i f ( tx CCONT IN)
{
n i H2Xb = l - p o w ( t x , 2 ) ;
d i b = - 2 * t x / k i n [ 4 7 ] / k i n [ 6 0 ] / k i n [ 7 3 ] ;
}
e l s e
{
t a = ( l -C O NT I N *C O NT I N ) * ( l -CO N TI N *C ON TI N ) / CO
N T I N / 2 ;t b = 3 * C O N T I N / 2 - l / C O N T I N / 2 ;
d i b = - t a / ( t x - t b ) / ( t x - t b ) / k i n [4 5 ] / k i n [ 6 0 ] / ki n [ 73 ] ;
}
n ip HX f = ( k i n [ 3 5 ] / ( k i n [35] + CH) ) * ( CH /( k i n [37 ] +
CH) )* ( ( k i n [35] + k i n [ 3 6 ] ) / k i n [ 3 5 ] ) *
( ( k i n [ 37] +k i n [ 3 6 ] ) / k i n [ 3 6 ] ) ;
n i pHXa = ( k i n [ 3 8 ] / ( k i n [ 38] + C H) ) * ( C H /( k i n [40 ] +
CH) )* ( ( k i n [38] +
k i n [ 3 9 ] ) / k i n [ 3 8 ] ) * ( ( k i n [40] + k i n [ 3 9 ] ) / k i n [ 3 9 ] ) ;n i pHXh = ( k i n [ 4 1 ] / ( k i n [ 41] + C H) ) * ( C H / ( k i n [ 43] +
CH) )* ( ( k i n [41] +
k i n [42] ) / k i n [ 4 1 ] ) * ( ( k i n [ 43] + k i n [ 4 2 ] ) / k i n [ 4 2 ] ) ;
226
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 249/265
/ / d r h o d y [ 1 ] = k i n [ 1 ] * ( y [ 1 5 ] / y [ 1 7 ] ) / ( k i n [ 2 ] + y [ 1 5 ] / y [17
] ) * y [ 1 7 ] ;d r h o d y [ 1 ] [ 1 5 ] = ( k i n [ 1 ] * k i n [ 2 ] ) / p o w (k i n [ 2 ] + y [ 1 5 ] / y [
1 7 ] f 2 ) ;
d r h o d y [1] [ 1 7 ] = k i n [ l ] * y [ 1 5 ] * y [ 1 5 ] / p o w ( y [ 1 7 ] * k i n [2]
+ y [ 1 5 ] , 2 ) ;/ / d r h o d y [ 2 ] = k i n [ 3 ] * y [ 1 ] / ( k i n [ 4 ] + y [ 1 ] ) * y [ 1 7 ] ;
d r h o d y [ 2 ] [ l ] = k i n [ 3 ] * y [ 1 7 ] * k i n [ 4 ] / ( k i n [ 4 ] + y [ 1 ] ) / ( ki n [ 4 ] + y [ 1 ] ) ;
d r h o d y [ 2 ] [ 1 7 ] = k i n [ 3 ] * y [ l ] / ( k i n [ 4 ] + y [ l ] ) ;/ / d r h o d y [ 3 ] = k i n [ 5 ] * y [ 3 ] / ( k i n [ 6 ] + y [ 3 ] ) * y [ 1 7 ] ;
d r h o d y [ 3 ] [ 3 ] = k i n [ 5 ] * y [ 1 7 ] * k i n [ 6 ] / ( k i n [ 6 ] + y [ 3 ] ) / ( ki n [ 6] +y [ 3] ) ;
d r h o d y [ 3 ] [ 1 7 ] = k i n [ 5 ] * y [ 3 ] / ( k i n [ 6 ] + y [ 3 ] ) /
/ /d r h o d y [ 4 ] = n r H 2 X f a * k i n [ 7 ] * s t o [ 1 7 ] * y [ 2 ] / ( k i n [ 8 ] + y [ 2 ] ) * y [17]
* n i p H X f * n i H 2 X f
d r h o d y [ 4 ] [ 2 ] = n r H 2 X f a * k i n [ 7 ] * s t o [ 1 7 ] * y [ 1 7 ] * k i n [ 8 ] / p o w ( k i n [8 ] + y [ 2 ] , 2 ) * n i pH X f * n i H 2 X f ;
d r h o d y [ 4 ] [ 1 0 ] = k i n [ 7 ] * s t o [ 1 7 ] * y [ 2 ] / ( k i n [ 8 ] + y [ 2 ] ) * y [ 1 7 ] * n i pH X f * ( d r f a * n i H 2X f + n r H 2 X f a * d i f ) ;
d r h o d y [ 4 ] [ 1 7 ] = n r H 2 X f a * k i n [ 7 ] * s t o [ 1 7 ] * y [ 2 ] / ( k i n [ 8 ] + y [ 2 ] ) * n
i p H X f * n i H 2 X f * ni H 2 X f ;
/ /d r h o d y [ 5 ] = n r H 2 X f l * n i p H X f * k i n [1 0 ] * s t o [ 1 8 ] * y [ 2 ] / ( k i n [ 1 1 ]+ y [2 ] ) * y [ 1 7 ] *n i H2
X f ;
d r h o d y [ 5 ] [ 2 ] = n r H 2 X f l * n i p H X f * k i n [ 1 0 ] * s t o [ 1 8 ] * y [ 1 7 ] * k i n [ 1 1 ]/ p o w (k i n [ 1 1 ] +y[ 2 ] , 2 ) * n i H 2 X f ;
d r h o d y [ 5] [ 1 0 ] = n i p H X f * k i n [ 1 0 ] * s t o [ 1 8 ] * y [ 2 ] / ( k i n [11] + y [ 2] ) *
y [ 1 7 ] * ( d r f l * n iH 2 X f + n r H 2 X f l * d i l ) ;
d r h o d y [ 5 ] [ 1 7 ] = n r H 2 X f l * n i p H X f * k i n [ 1 0 ] * s t o [ 1 8 ] * y [ 2 ] / (k i n [11
] + y [ 2 ] ) * n i H 2 X f
227
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 250/265
//
d r h o d y [ 6 ] = n r H 2 X f b * n i p H X f * k i n [ 1 3 ] * s t o [ 1 9 ] * y [ 2 ] / ( k i n [ 1 4 ]+ y [2 ] ) * y [ 1 7 ] *n i H 2X f ;
d r h o d y [ 6 ] [ 2 ] = n r H 2 X f b * n i p H X f * k i n [ 1 3 ] * s t o [ 1 9 ] * y [ 1 7 ] * k i n [14]/ p o w (k i n [ 1 4 ] +y
[ 2 ] , 2 ) * n i H 2 X f ;
d r h o d y [ 6 ] [ 1 0 ] = n i p H X f * k i n [ 1 3 ] * s t o [ 1 9 ] * y [ 2 ] / ( k i n [ 1 4 ] + y [ 2 ] ) *y [ 1 7 ] * ( d r f b * n i
H 2 X f + n r H 2 X f b * d i l ) ;
d r h o d y [ 6 ] [ 1 7 ] = n r H 2 X f b * n ip H X f * k in [ 1 3 ] * s t o [ 1 9 ] * y [ 2 ] / ( k i n [14
] + y [ 2 ] ) * n i H 2 X f
r
//
d r h o d y [ 7 ] = k i n [ 1 6 ] * s t o [ 2 0 ] * y [ 6 ] / ( k i n [ 1 7 ] + y [ 6 ] ) * y [ 1 8 ] * n i H 2 X
p * n i p H X f ;
d r h o d y [ 7 ] [ 6 ] = k i n [ 1 6 ] * s t o [ 2 0 ] * y [ 1 8 ] * k i n [ 1 7 ] / p o w (k i n [ 1 7 ] + y [6 ] , 2 ) * n i H 2 X p * ni p H X f ;
d r h o d y [7 ] [ 1 0 ] = k i n [ 1 6 ] * s t o [ 2 0 ] * y [ 6 ] / ( k i n [ 1 7 ] + y [ 6 ] ) * y [18 ] *ni p H X f * d i p ;
d r h o d y [ 7 ] [ 1 8 ] = k i n [ 1 6 ] * s t o [ 2 0 ] * y [ 6 ] / ( k i n [ 1 7 ] + y [ 6 ] ) * n i H 2 X p *
n i p H X f ;/ /d r h o d y [ 8 ] = n r H 2 X l a * n i H 2 X l * n i p H X f * k i n [ 1 9 ] * s t o [ 2 1 ] * y [ 7 ] / ( k i n[ 2 0 ] + y [ 7 ] ) * y [ l
9] ;d r h o d y [ 8 ] [ 7 ] = n r H 2 X l a * n i H 2 X l * n i p H X f * k i n [ 1 9 ] * s t o [ 2 1
] * y [ 1 9 ] * \k i n [ 2 0 ] / p o w ( k i n [ 2 0 ] + y [ 7 ] ,
2 ) ;
d r h o d y [ 8 ] [ 1 0 ] = n i p H X f * k i n [ 1 9 ] * s t o [ 2 1 ] * y [ 7 ] / ( k i n [ 2 0 ] + y [ 7 ] ) *
y [ 1 9 ] * \
( n r H 2 X l a * d i l + n i H 2X l * d r l a ) ;
d r h o d y [8 ] [ 1 9 ] = n rH 2 X l a * n i H 2 X l * n i p H X f * k in [ 1 9 ] * s t o [ 2 1 ] * y [ 7 ] /( k i n [ 2 0 ] + y [ 7 ] )
228
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 251/265
/ /d r h o d y [ 9 ] = n r H 2 X l p * n i H 2 X l * n ip H X f * k in [ 2 2 ] * s t o [22] * y [ 7 ] / ( k in[ 2 3 ] + y[ 7 ] ) * y [ l9] ;
d r h o d y [ 9 ] [ 7 ] = n r H 2 X l p * n i H 2 X l * n ip H X f * k in [ 2 2 ] * s t o [2 2
] * y [ 1 9 ] * \k i n [ 2 3 ] / p o w ( k i n [ 2 3 ] + y [ 7 ] ,
2 ) ;
d r h o d y [ 9 ] [ 1 0 ] = n i p H X f * k i n [ 2 2 ] * s t o [ 2 2 ] * y [ 7 ] / ( k i n [ 2 3 ] + y [ 7 ] ) *y [ 1 9 ] * \
( n r H 2 X l p * d i l + n i H 2X l * d r l p ) ;
d r h o d y [ 9 ] [ 1 9 ] = n r H 2 X l p * n i H 2 X l * n i p H X f * k i n [ 2 2 ] * s t o [ 2 2 ] * y [ 7 ] /( k i n [ 2 3 ] + y [ 7] )
r
/ /
d r h o d y [ 1 0 ] = n i H 2 X b * n i p H X f * k i n [ 2 5 ] * s t o [ 2 3 ] * y [ 8 ] / ( k i n [ 2 6 ] + y [8] ) * y [ 2 0 ] ;
d r h o d y [ 1 0 ] [ 8 ] = n i H 2 X b * n i p H X f * k i n [ 2 5 ] * s t o [ 2 3 ] * k i n [ 2 6 ] * y [20]/ p o w (k i n [ 2 6 ] +y[ 8 ] , 2 ) ;
d r h o d y [ 1 0 ] [ 1 0 ] =
n i p H X f * k i n [ 2 5 ] * s t o [ 2 3 ] * y [ 8 ] / ( k i n [2 6 ] + y [ 8 ] ) * y [ 2 0 ] * d ib ;
d r h o d y [ 1 0 ] [ 2 0 ] = n iH 2 X b * n i p H X f * k i n [ 2 5 ] * s t o [ 2 3 ] * y [ 8 ] / ( k i n [2 6
] + y [ 8 ] ) ;/ / d r h o d y [1 1 ] = n ip H X a * k i n [2 8 ] * s t o [ 2 4 ] * y [ 5 ] / ( k i n [ 2 9 ] +y[ 5 ] ) * y [ 2 1 ] ;
d r h o d y [ 1 1 ] [ 5 ] = n i p H X a * k i n [ 2 8 ] * s t o [ 2 4 ] * k i n [ 2 9 ] * y [ 2 1 ] / p o w ( k in [ 2 9 ] + y [ 5 ] , 2) ;
d r h o d y [ 1 1 ] [ 2 1 ] = n ip H X a * k i n [2 8 ] * s t o [ 2 4 ] * y [ 5 ] / ( k i n [29 ] + y [ 5 ] ) ;
/ / d r h o d y [1 2 ] = n ip H X h * k i n [3 1 ] * s t o [ 2 5 ] * y [ 1 0 ] / ( k i n [ 3 2] +
y [ 1 0 ] ) * y [ 2 2 ] ;
d r h o d y [ 1 2 ] [ 1 0 ] = n ip H X h * k in [ 3 1 ] * s t o [ 2 5 ] * k i n [ 3 2 ] * y [ 2 2 ] / p o w (k
i n [ 3 2 ] + y [ 1 0 ] ,2) ;
d r h o d y [ 1 2 ] [ 2 2 ] = n i p H X h * k i n [ 3 1 ] * s t o [ 2 5 ] * y [ 1 0 ] / ( k i n [3 2 ] + y [ 1 0 ] ) ;/ / d r h o d y [ 1 3 ] = ( n r H 2 X f a * k i n [9] + n r H 2 X f l * k i n [12 ] +n r H 2 X f b * k i n [ 1 5 ] ) * y [ 1 7 ] ;
229
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 252/265
d r h o d y [ 1 3 ] [ 1 0 ] = ( d r f a * k i n [ 9 ] + d r f l * k i n [ 1 2 ] + d r f b * k i n
[ 1 5 ] ) * y [ 1 7 ] ;d r h o d y [ 1 3 ] [ 1 7 ] = n r H 2 X f a * k i n [9] + n r H 2 X f l * k i n [12 ] +
n r H 2 X f b * k i n [ 1 5 ] ;
/ / d r h o d y [ 1 4d r h o d y [ 1 4
/ / d r h o d y [ 1 519] f
d r h o d y [ 1 5d r h o d y [ 1 5
/ / d r h o d y [ 1 6
d r h o d y [ 1 6
/ / d r h o d y [ 1 7d r h o d y [ 1 7
/ / d r h o d y [ 1 8d r h o d y [ 1 8
d r h o d y [ 1 9* / k i n [63] * /
d r h o d y [ 2 0d r h o d y [ 2 1f o r ( j = 1;
] = k i n [ 3 3 ] * y [ 2 2 ] ;
* /*/
{f o r ( i = l ; i <= YV AR ;i ++ )
{d r h o d y [ j ] [ i ] = d r h o d y [ j ] [ i ] / 2 4 .0 ;
}
}
r e t u r n ;
230
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 253/265
File 8: settle.c (batch settling model)
# i n c l u d e < s t d i o . h ># i n c l u d e < s t d l i b . h >
# i n c l u de < s t r i n g . h ># i n c l u d e < m a t h . h ># d e f i n e SWAP(a,b) { t e m p = ( a ) ; ( a ) = ( b ) ; ( b ) = t e m p ; }
#def ine NR_END 1#def ine FREE_ARG char*# d e f i n e NMSP 360 / * n u m b e r o f s t e p s i n d t * /
/ * now u i n m /s C in kg /m3 * /
c o n s t d o u b l e g = 9 . 8 1 ;c o n s t d o u b l e k l = 1 . 6 2 3 e - 3 ; / * m /s e c * /c o n s t d o u b l e n l = 0 . 5 0 8 ;c o n s t d o u b l e k2 = 2 0 0 0 . 0 ; / * 3 . 6 4e 4 P a . h
* /c o n s t d o u b l e n 2 = 0 . 6 ;c o n s t d o u b l e p h o s = 1 0 5 0 . 0 ; / * k g/ m
3 * /c o n s t d o u b l e p h o l = 1 0 0 0 . 0 ;char *emsg ;
i n t c r m at (d o u b l e * a , d ou b l e * b , d o u b le * c ,d o u b l e * r i t e r , u n s
i g n e d i n tn u m l a y e r , d o u b l e d z , \
d o ub l e d t , d o u b l e * v , d o u b l e * co nc )
r i n t c f i e l d ( u n s i g n e d i n t n u m la y e r , d ou b l e * v , d o u b l e * v n , d ou
b l e* c o n c , d o u b l e d t , d o u b l e d z ) ;i n t c o m pe q u( u ns ig n ed i n t n u m l a y e r , d o u b le d z , d o u b l e d t , d o u
b l e* c o nc , do u b le * v ) ;i n t t r i d a g ( d o u b l e * a , d o u b l e * b , d o u b le * c ,d o u b l e * r , d o u b l e
* u , \u n si gn ed i n t n ) ;
i n t s e t t ( d o u b l e * h g t , d o u b l e s d t , d o u b l e d z , do u b l e * v , d o u b l
e *conc){
i n t i , l a y , n um step ;d o u b l e d t = 1 . 0 ;n u m s t e p = f l o o r ( s d t * 3 6 0 0 / d t ) ;
f o r ( i = l ; i <= n u m s t e p ; i+ + )
231
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 254/265
{l a y = f l o o r ( * h g t / d z ) ;i f ( c o m p e q u ( l a y , d z , d t , c o n e , v ) ==0) r e t u r n 0;* h g t = * h g t - v [ l a y ] * d t ;
}
r e t u r n 1 ;}
/ * c r e a te s o l u t i o n m a t r i x a [ ] , b [ ] , c [ ] * /
i n t c r m at (d o u b le * a , d o u b le *b , d o u b le * c , d o u b l e * r i t e r , u n s
i g n e d i n tn u m l a y e r , d o u b l e d z , \d o ub l e d t , d o u b l e * v , d o u b l e * co nc )
{u n si gn e d i n t i ;d o u b l e c t , t p l , t p 2 ;c t = ( c o n e [ 1 ] + c o n c [ 2 ] ) / 2 . 0 ;
i f ( p h o s - c t = = 0 )
{s t r c p y (e m s g , "E r r o r 1 i n c r m a t " ) ;
r e t u r n 0 ;
}t p l = p h o l / g / ( p h o s - p h o l ) / c t * ( p h o s / ( p h o s - c t ) ) * ( p h o s /
( p h o s - c t ) ) ;t p 2 = ( p h o s + p h o l * ( p h o s + c t ) / ( p h o s - c t ) ) / ( p h o s - p h o l ) ;b [ 1] = 1 / ( d t * g ) + 2. 0 * c t / k 2 ,lre xp ( n 2 * c t ) / d z / d z + e x p ( n l * c
t ) / k l ;c [ 1 ] = - c t / k 2 * e x p ( n 2 * c t ) / d z / d z \
- ( ( 2 . 0 + n 2 * c t ) / k 2 * e x p ( n 2 * c t ) * ( co n e [ 2 ] - c o n e [ 1 ] ) / d z + t p 2 * v [ 1]
/ g ) / 2 . 0 / d z ;
r i t e r [ 1 ] = v [ 1 ] / ( d t * g ) + 1 .0 + t p l * v [ 1 ] * v [1] * ( c o ne [ 2 ] - c
o n e [ 1 ] ) / d z ;
f o r ( i = 2 ; i c n u m l a y e r ; i + + )
{c t = ( c o n e [ i ] + c o n c [ i + 1 ] ) / 2 . 0 ;i f ( p h o s - c t = = 0 )
{s t r c p y (e m s g , "E r r o r 1 i n c r m a t " ) ;
r e t u r n 0 ;}
t p l = p h o l / g / ( p h o s - p h o l ) / c t * ( p h o s / ( p h o s - c t ) ) * ( p h o s / (p h o s - c t
) ) ;t p 2 = ( p h o s + p h o l * ( p h o s + c t ) / ( p h o s - c t ) ) / ( phos
232
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 255/265
- p h o l ) ;
a [ i ] = - c t / k 2 * e x p ( n 2 * c t ) / d z / d z
\
+ ( ( 2 . 0 + n 2 * c t ) / k 2 * e x p ( n 2 * c t ) * ( c o n e [ i + 1 ] - c o n e [ i ] ) / dz \
+ t p 2 * v [ i ] / g ) / 2 . 0 / d z ;
b [ i ] = 1 . 0 / ( d t * g ) + 2 . 0 * c t / k 2 * e x p ( n 2 * c t ) / d z / d z + e x p ( n l * c t ) / k l ;c [ i ] = - c t / k 2 * e x p ( n 2 * c t ) / d z / d z
\
- ( ( 2 . 0 + n 2 * c t ) / k 2 * e x p ( n 2 * c t ) * ( c o n e [ i + 1 ] - c o n e [ i ] ) / d z + t p 2 * v [i ] / g ) / 2 . 0 / d z ;
r i t e r [ i ] = v [ i ] / ( d t * g ) + l . 0 + t p l * v [ i ] * v [ i ] * ( c o n e [ i + 1 ] - c o n e [ i ]
) /d z ;
}i = n u m l a y e r ;c t = c o n c [ i ] ;a [ i ] = - 2 . 0 * c t / k 2 * e x p ( n 2 * c t ) / d z / d z ;
b [ i ] = 1 . 0 / g / d t + e x p ( n l * c t ) / k l + 2 . 0 * c t / k 2 * e x p ( n 2 * c t ) /d z / d z ;
r i t e r [ i ] = v [ i ] / ( d t * g ) +1 . 0 ;r e t u r n 1 ;
}
i n t c f i e l d ( u n s i g n e d i n t n u m la y e r , d ou b l e * v , d o u b l e * vn , d ou
b l e* c o n c , d o u b l e d t , d o u b l e d z )
{u n si gn ed i n t i ;d o u b l e * c n e w ;cn ew =( do ub le * ) m a l l o c ( ( n u m l a y e r + 1 ) * s i z e o f( d o u b l e )
) ;c n e w [ 1 ] = c on c [ 1 ] + ( v [ 1 ] + v n [ 1 ] ) * ( co ne [ 1 ] + c o n c[ 2 ] ) / 4 .
0 / d z * d t ;
f o r ( i = 2 ; K n u m l a y e r ; i ++ )
{
c n e w [ i ] = c o n c [ i ] + ( v [ i ] + v n [ i ] ) * ( c o n e [ i ] + c o n c [ i + 1 ] ) / 4 . 0 / d z * d
t \
- ( v [ i —1 ] + v n [ i - 1 ] ) * ( co ne [ i —1 ] + c o n c [ i ] ) / 4 . 0 / d z * d t ;
}
233
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 256/265
i = n u m l a y e r ;c ne w[ i ] = c o n c [ i ] + (v [ i ] + v n [ i ] ) * ( c o ne [ i ] + c o n c [ i + 1 ] ) /
4 . 0 / d z * d t \
- ( v [ i —1 ] + v n [ i —1 ] ) * ( co n e [ i —1 ] + c o n c [ i ] ) / 4 . 0 / d z * d t ;
f o r ( i = l ; i < = n u m l a y e r ; i + + )
{
i f ( c n e w [ i ] < 0 )
{s t r c p y (e m s g , " E r r o r 1 i n c f i e l d " ) ;r e t u r n 0 ;
}
c o n e [ i ] = cn e w [ i ] ;
}
f r e e ( c n e w ) ;r e t u r n 1 ;
}
i n t c o m pe q u( un si g ne d i n t n u m l a y e r , d o u bl e d z , d o u b l e d t , d o u
b l e* c o n c , d o u b l e * v )
{
u ns ig n ed i n t i ;d o u b l e * a , * b , * c , * r i t e r , * u ;
r i t e r = ( d o u b l e * ) m a l l o c ( ( n um la ye r+ 1) * s i z e o f ( d o u b l
e) ) ;a = ( do u b l e * ) m a l l o c ( ( nu ml ay er +1 ) * s i z e o f ( d o u b l e ) ) ;b = (d o ub le *) m a l l o c ( ( n u m l a y e r + 1 ) * s i z e o f ( d o u b l e ) ) ;
c = (d o ub l e * ) m a l l o c ( ( n u m l a y e r + 1 ) * s i z e o f ( d o u b l e ) ) ;u =( do u b l e * ) m a l l o c ( ( n u m l a y e r + 1 ) * s i z e o f ( d o u b l e ) ) ;i f ( c r m a t ( a , b , c , r i t e r , n u m l a y e r , d z , d t , v , c o n e ) ==0) r
e t u r n 0 ;i f ( t r i d a g ( a , b , c , r i t e r , u , n u m l a y e r ) ==0) r e t u r n 0;i f ( c f i e l d ( n u m l a y e r , v , u , c o n e , d t , d z )==0) r e t u r n 0;f o r ( i = l ; i < = n u m l a y e r ; i + + )
{i f ( u [ i ] < 0 )
{s t r c p y ( e m s g , " E r r o r 1 i n c omp eq u" )
r r e t u r n 0 ;
}v [ i ] = u [ i ] ;
}
f r e e ( a ) ;
234
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 257/265
f r e e ( b ) ;f r e e ( c ) ;f r e e ( u ) ;f r e e ( r i t e r ) ;r e t u r n 1 ;
}
i n t t r i d a g ( d o u b l e * a , d o u b l e * b ,d o u b le * c , d o u b le * r , d o u b l e
* u , \u n s i gn e d i n t n)
{u ns ig n ed i n t j ;d o u b l e b e t , * g a m ;gam = ( d o u b l e * )m a l l o c ( ( n+ 1) * s i z e o f ( d o u b l e ) ) ;i f ( b [ 1 ]= = 0 . 0 )
{ s t r c p y ( e m s g , " E r r o r 1 i n t r i d a g " ) ;
r e t u r n 0 ;
}b e t = b [ 1 ] ;u [ 1 ] = r [ 1 ] / b e t ;
f o r ( j = 2 ; j < = n ; j + + )
{gam[ j ] = c [ j - 1 ] / b e t ;b e t= b [ j ] - a [ j ] * ga m [ j ] ;i f ( b e t = = 0 . 0 )
{
s t r c p y ( e m s g , " E r r o r 2 i n t r i d a g " ) ;r e t u r n 0 ;
}
u ( j ] = ( r [ j ] - a [ j ] * u [ j - l ] ) / b e t ;
}f o r ( j = ( n - 1 ) ; j > = 1 ; j — )
u [ j ] - = ga m [ j + 1 ] * u [ j + 1 ] ;f r e e ( g a m ) ;
r e t u r n 1 ;
235
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 258/265
Appendix C Sample Input Files
Sample input files are listed as follows:
File 1: asbr inf.in
File 2: asbr_ini.in
File 3: asbr__prc.in
File 4: asbr_kin.in
File 5: asbr sto.in
236
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 259/265
File 1: asbr inf.in (influent condition)
0 . 0 Sc y i n f [ 1 ]1000 .0 Sf y i n f [ 2]0 . 0 Ss y i n f [ 3]0 . 0 S i y i n f [4]
0 .0 Sa y i n f [5]0 . 0 Sp y i n f [6]0 .0 SI y i n f [7]0 .0 Sb y i n f [ 8]0 . 0 Sm y i n f [ 9]
0 .0 Sh y i n f [ 10]30. 0 Sn y i n f [ 11]0 .0 Sco3 y i n f [ 12]3400 .0 SNaNET y i n f [ 13]0 .0 S a l k y i n f [14]0 .0 Xs y i n f [15]
0 .0 X i y i n f [16]0 .0 X f y i n f [17]0 .0 Xp y i n f [ 18]0 .0 X I y i n f [ 19]0 .0 Xb y i n f [ 20]
0 .0 Xa y i n f [21]0 .0 Xh y i n f [22]
l e - 1 0 PH2 y i n f [ 23]0 .55 PCH4 y i n f [ 24]0 .3 PC02 y i n f [25]0 .027 PH20 y i n f [ 26]
1 .0 PATM y i n f [ 27]
237
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 260/265
File 2: asbr ini.in (initial reactor condition)
0 .0 Sc y [1]0 .0 Sf y [2]0 .0 Ss y [3]0 .0 S i y [4]0 .0 Sa y [5]0 .0 Sp y [ 6 ]0 .0 SI y [7 ]
0 .0 Sb y [ 8 ]0 .0 Sm y [ 9 ]0 .0 Sh y [10]0 .0 Sn y [ i i ]0 .0 Sco3 y [12]3000 .0 SNaNET y [13]0 .0 S a l k y [14]1 00 .0 Xs y [15]12800 .0 X i y [16]
2 3 0 . 0 X f y [17]120. 0 Xp y [18]170. 0 X I y [19]10. 0 Xb y [20]2 0 0 . 0 Xa y [21]350 .0 Xh y [22]0 .00000001 PH2 y [23]
0 .52 PCH4 y [24]
0 .44 PC02 y [25]
0 .027 PH20 y [26]1 .0 PATM y [27]
238
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 261/265
File 3: asbr_prc.in (process values)
12 v t o t p r o p [ l ]6 v f p r o p [ 2]
6 v s p r o p [ 3]0 . 5 v w p r o p [ 4 ]2 . 0 v g a s p r o p [ 5]
5 0. 0 t t o t p r o p [ 6 ]1 . 0 qg p r o p [ 7]0 .0 r t i m e p r o p [ 8]40 n c y c l e p r o p [ 9]0 .1 d t p r o p [ 10]1 .0 d t k e e p p r o p [ 11]1 2. 5 t f p r o p [ 1 2 ]1 .0 q f p r o p [ 1 3 ]20 t r p r o p [ 1 4 ]4 8 . 0 t r m a x p r o p [ 15 ]150 S r s t o p p r o p [ 16 ]
2 1 . 0 S rc omp p r o p [ 1 7]1 t s p r o p [ 1 8 ]6 . 0 vO p r o p [ 1 9]1 . 76 7 1 a r e a p r o p [ 2 0 ]0 .5 t d p r o p [ 2 1 ]2 . 0 q d p r o p [ 2 2 ]
0 . 1 t w p r o p [ 2 3 ]1 . 0 q w p r o p [ 2 4 ]
500000 Xwas te p r op [2 5 ]
7 500 00 X t a r g e t p r o p [ 2 6 ]1 .0 n f r p r o p [ 2 7 ]
1 .0 n f r f p r o p [ 2 8 ]1 .0 n f r r p r o p [ 2 9 ]0 .1 n f r s p r o p [ 3 0 ]0 .1 n f r d p r o p [ 31 ]0 .1 n f r w p r o p [ 3 2 ]0 . 9 n f s x p r o p [ 33]10 m i x p r o p [ 3 4 ]0 pH p r o p [ 3 5 ] 4 - 1 1 / 0 ; f i x / v a r y0 s b r p r o p [ 3 6] 0 / l ; A SB R / U A S B0 s e t t l e p r o p [ 37] 0 / 1 ; f i x / m o d e l
0 n o t c o n t i n u e p r o p [ 38 ] 0 / l ; . i n / . r s t
239
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 262/265
File 4: asbr kin.in (kinetic constants)
0 . 1 0 khxs k i n [1 .0 Kxs k i n [
2 . 0 khsc k i n [100. 0 Ksc k i n [1 . 5 khss k i n [1 000 .0 Kss k i n [
49 .4 k x f a k i n [24. 6 K s f a k i n [0 .02 b x f a k i n [49.4 mu xf 1 k i n [24. 6 K s f 1 k i n [0 . 0 2 b x f 1 k i n [49 .4 mux fb k i n [24. 6 K s f b k i n [
0 .02 b x f b k i n [5 .3 muxpa k i n [60. 0 Kspa k i n [
0 .01 bxpa k i n [34. 6 mux l a k i n [3 6 . 5 K s l a k i n [0 . 0 2 b x l a k i n [34. 6 m u x l p k i n [
3 6 . 5 K s l p k i n [0 .02 b x l p k i n [
5 .3 muxba k i n [13. 0 Ksba k i n [0 .027 bxba k i n [6 .1 muxam k i n [
1 5 0 . 0 Ksam k i n [0 .0 3 6 bxam k i n [24 .7 muxhm k i n [0 .0 12 Kshm k i n [0 .088 bxhm k i n [
1 .0 KlaC02 k i n [1 . 0 e - 2 K i l p H X f k i n [1 . 0 e - 4 K i n p H X f k i n [1 . 0 e - 6 K i h p H X f k i n [
3 . Oe- 4 K i l p H X a k i n [1 . 0 e - 4 KinpHXa k i n [
3 . Oe- 5 KihpHXa k i n [1 . 0 e - 3 K i l p H X h k i n [1 . Oe- 4 KinpHXh k i n [1 . Oe- 5 KihpHXh k i n [
240
1 ]2]
3]4]5]6 ]
7]8 ]9]1011
12
1314
151617
181920
2122
232425262728
293031
323334
353637
383940414243
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 263/265
1000 K i H 2X f k i n [44]4 . Oe-5 KiH2Xp k i n [45]3 . Oe-4 K i H2 X l k i n [4 6]3 . Oe-4 KiH2Xb k i n [47]
5. Oe-5 K r H 2 X f l k i n [48]
I — 1 O( D 1 Kr H 2X f2 k i n [49]1. Oe-5 KrH2Xl k i n [50]1 .416 i v s s k i n [51]1. I l l i t s s b m k i n [52]
1. I l l i t s s x s k i n [53]0. 900 i t s s x i k i n [54]64 .0 i m o l a k i n [55]
112 .0 i m o l p k i n [56]
96.0 i m o l l k i n [57]160. 0 i r r tolb k i n [58]
64 . 0 imo lm k i n [59]
16 .0 i m o l h 2 k i n [60]
61. 0 i m o l h c o 3 k i n [61]
62.0 i m o l h 2 c o 3 k i n [62]
44 .0 i m o l c o 2 k i n [63]
50. 0 i m o l a l k k i n [64]0 . 6 8 1 e - l l Kw k i n [65]1 . 7 53e-2 Kaa k i n [66]1 . 338e-2 Kap k i n [67]
1 . 3 5 7 e - l K a l k in [ 68]
1 . 542e-2 Kab k i n [69]4 . 1 60e-4 KaH2C03 k i n [70]
36 .7647 KhC02 k i n [71]
1 .42 21 KhCH4 k i n [ 72 ]0 .8035 KhH2 k i n [73]
8 . 2 0 6 e - 5 Rgas k i n [ 74 ]
295 Temp k i n [75]23 .5 KlaH2 k in [7 6]
7 .8 KlaCH4 k i n [77]
1 .0 k r H 2 X f 1 k i n [78]
0 .7 k r H 2 X f 2 k i n [79]
0 .45 k r H 2 X l k i n [80]1 .0 k i H 2 X f k i n [81]
1 .0 k i H 2 X l k i n [82]
241
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 264/265
File 5: asbr sto.in (stoichiometric)
0. 63 f b x s s t o [0 .07 f b x i s t o [0 . 10 f b s c s t o [
0 . 01 f b s f s t o [0 . 10 f b s s s t o [
0 . 09 f b s i s t o [0 . 40 f x s c s t o [
0 . 10 f x s f s t o [
0 .50 f x ss s t o [0 . 0 0 f x s i s t o [0 .0875 f x s n s t o [1 .00 fscf s t o [0 .00 fscs s t o [
0 . 00 f s c i s t o [
1 .00 f s s f s t o [0 . 00 f s s i s t o [
0 .07 Y x f a s t o [
0 . 0 6 Y x f l s t o [0 . 0 6 Y x f b s t o [
0 . 0 5 9 Yxpa s t o [0 .064 Y x l a s t o [
0 .064 Y x l p s t o [0 .067 Yxba s t o [0 .058 Yxam s t o [
0 .22 Yxhm s t o [
0 .667 Ya fa s t o [
0 . 333 Y h f a s t o [0 .4 58 Y c o 2 f a s t o [
1 .000 Y l f l s t o [0 . 000 Y h f 1 s t o [0 . 00 0 Y c o 2 f 1 s t o [0 .833 Yb fb s t o [0 .167 Y h f b s t o [
0. 458 Y c o 2 f b s t o [0 .571 Yapa s t o [
0 . 4 2 9 Yhpa s t o [
0. 393 Yco2pa s t o [0. 667 Y a l a s t o [0 . 33 3 Y h l a s t o [0 .458 Yco21a s t o [1. 167 Y p l p s t o [
0 . 16 7 Y h l p s t o [
0 .000 Yco21p s t o [
242
1 ]2 ]
3]
4]5]
6 ]
7]8 ]9]10
11
12
1314
151617
1819
20
21
22
2324
25
2627
28
29303132333435
3637
383940414243
roduced with permission of the copyright owner. Further reproduction prohibited without permission.
8/18/2019 Mathematical Model of Anaerobic Processes Applied to the Anaerobic Sequencing Batch Reactor
http://slidepdf.com/reader/full/mathematical-model-of-anaerobic-processes-applied-to-the-anaerobic-sequencing 265/265
0 . 800 Yaba s t o [ 44 ]
0 .200 Yhba s t o [ 45 ]
0 .000 Yco2ba s t o [46]
1 .000 Ymam s t o [47]
0 6875 Yco2am s t o [48]
top related