+ All Categories
Home > Documents > Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical...

Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical...

Date post: 29-Mar-2020
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
71
Mathematical modeling of heterogeneous biological wastewater processes Jordi Pascual i Ferrer
Transcript
Page 1: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Mathematical modeling of heterogeneous biologicalwastewater processes

Jordi Pascual i Ferrer

Page 2: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

ii

Page 3: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Chapter 1

Motivation

These days, wastewater treatment is a usual practice. Drainage and stormwater col-lection started in ancient times, so did the collection of the wastewater. Numerousexamples of collection can be found through the history. Since the 20th century b.C.,when the Hindus started using them, to the present time, many civilizations haveused them (the ancient Egypt, the Greeks, the Romans, etc) [14] . But it was notuntil the late 1800s and early 1900s when its treatment, as it is known today, beganto be made. On this treatment, played an important role the germ theory developedby Koch and Pasteur in the latter half of the nineteenth century [2].

There are different ways on doing a wastewater treatment, but all of them havethe aim of returning water after its use to the environment without the pollutantswhich can damage it and our health. Those are traditionally classified as primary,secondary and tertiary treatment. The first one refers to physical processes whichtake place in order to separate the solids suspended in water. The secondary treat-ment, which can be made by biological or chemical processes, removes most of theorganic matter. And the last treatment is used to remove other constituents thatare not significantly reduced on the previous ones.

The numerical modeling of the subsurface flow constructed wetlands is the mo-tivation of this master thesis. They are part of the named “natural systems” forwastewater treatment. They consist on lagoons or channels, which are planted withhumid zone plants. In those wetlands water is treated simultaneously by physical,chemical and biological processes [13]. Due to the combination of these processes,that are common on the “natural systems”, water quality is similar to or even betterthan that coming out from a tertiary treatment [2].

Page 4: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

2Mathematical modeling of

heterogeneous biological wastewater processes

1.1 How did all begin

At Seccio d’Enginyeria Sanitaria i Ambiental (Sanitary and Environmental Engineer-ing Section) which belongs to the Departament d’Enginyeria Hidraulica, Marıtima iAmbiental (DEHMA, Hydraulic, Marine and Environmental Engineering) at UPC,one of their research topics is related to the natural wastewater treatment systemsto treat urban wastewater.

Their present work is based on the study of the design parameters from sub-surface flow constructed wetlands so that secondary and tertiary treatment can bethere correctly achieved. Due to this research line, they work on a pilot plant whichhas eight different wetlands (about 500 m2 altogether) where secondary treatment ismade to the wastewater which comes from an urbanization (about 150 inhabitants)located on Les Franqueses del Valles (Barcelona).

There, studies are based on the influence of the wetlands shape, its grain size dis-tribution as also trying to find out the main routes of the organic matter degradation.

Concerning to those main routes, on the superior part of those wetlands, aerobicprocesses take place, while on the inferior part, anaerobic processes are the onesin action. One of the problems when trying to understand the wetlands operationis knowing whether aerobic or anaerobic conditions are given at each point of thewetlands. It is not a simple question, though oxygen not only enters the wetlandssolved in water and through the free surface, but also through the plants existingon those wetlands.

But different aspects of the processes given on those wetlands are still a blackbox [13]. Although a biological model of wastewater processes is already developed,and some mathematical modeling of it has been achieved, those math models arenot valid for its use on these subsurface flow wetlands.

In order to clarify some of these aspects, the Section contacted with the Labora-tori de Calcul Numeric (LaCaN, Numerical Computation Laboratory) at the Depar-tament de Matematica Aplicada III (MAIII, Department on Applied MathematicsIII) also at UPC. From their collaboration is expected that a new mathematicalmodel is implemented so that unsolved questions related to subsurface flow wet-lands can be responded.

Page 5: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Motivation 3

1.2 Outline of the master thesis

This master thesis is an initial approach to those mathematical models, trying tofind out which ways shall be taken to reach a satisfactory answer to all those ques-tions.

Firstly, a brief review of the biochemical processes and its modeling will bemade, highlighting models presented by the International Water Association. Alsothe physical procedure used normally on modeling those processes, as also someother aspects refereing to its physics, will be outlined.

Next the mathematical model shall be presented, starting with an overview ofthe continuum mechanics concepts that may lead to a mathematical formulation ofthe physical processes. Special attention on the boundary conditions will be made.At the end of chapter 3 the complete mathematical expression that should be solvedwill be presented.

Once the problem statement is clear, a numerical solver shall be developed forits resolution. As it is an unsteady problem, both spatial and time discretizationshall be made. The method employed on these procedures will be explained, as alsosome stabilization techniques that may be used in order to obtain a better solution.

On chapter 5 the model will be validated, it means observing and analyzing ifthe whole process has been done correctly. Also there, with first results on hand, astudy of the adequate stabilization parameter will be presented.

Although the model may be still not so accurate to obtain realistic results, someof the obtained by the process will be shown.

Last but not least, conclusions shall be presented, as also the future work whichshould be made to obtain a better model will be outlined.

Page 6: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

4Mathematical modeling of

heterogeneous biological wastewater processes

Page 7: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Chapter 2

State of the art

The present chapter tries to make an approach to the formulation of processes whichtake place on the subsurface flow wastewater treatment wetlands. This refers notonly to the biochemical processes but also to some physical aspects.

Firstly, main biochemical processes will be presented as a brief introduction onthese topics, which may lead to get in touch with those concepts that shall be mod-eled. Then, one of its different models, known as Activated Sludge Model No. 1, willbe explained. It may be remarked that this model is one of the basic tools of thismaster thesis.

Also a brief vision on the traditional procedure used to model the hydraulicswhich govern those wetlands shall be presented, with the common simplificationsthat are normally made.

Finally, as wastewater flows through a porous medium, some aspects of adsorp-tion and its mathematical formulation shall be explained to know its effects on theresolution.

2.1 Biological wastewater treatment

Biological wastewater treatment is a set of processes that use the enzymatic andmetabolic action of microorganisms present in wastewater to clean it. In contrapo-sition to the only-chemical processes -where it is necessary to use large quantities ofreagent, good systems for dosage and qualified staff- the biological processes haveenough inertia to assume the concentration modifications of water or other situa-tions appeared during the process by themselves.

Page 8: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

6Mathematical modeling of

heterogeneous biological wastewater processes

Next, some of the main reactions given in a biological treatment are going to bepresented. Those are carbon oxidation, nitrification, denitrification and phosphorusremoval.

2.1.1 Carbon oxidation

Under carbon oxidation, it is understood the reactions that reduce the organic ma-terial. This degradation is done by microorganisms and can take place under aerobicand anaerobic 1 conditions.

Under aerobic conditions, the reaction is ruled by the equation [13]:

C6H12O6 + 6O2 ⇒ 6CO2 + 6H2O (2.1)

Otherwise, when anaerobic conditions are given, the carbon oxidation becomes amultistage process. Firstly, the complex molecules are transformed into acetic acid,lactic acid, ethanol and gases like carbon dioxide and hydrogen as the equationsshow [13]:

C6H12O6 ⇒ 3CH3COOH + H2 (2.2)

C6H12O6 ⇒ 2CH3CHOHCOOH (2.3)

C6H12O6 ⇒ 2CO2 + 2CH3CH2OH (2.4)

On the second phase, the resultant molecules from these processes are also trans-formed depending on the substrate given. There are three different possibilities:methanogenesis, sulphate reduction and denitrification.

Methanogenesis

4H2 + CO2 ⇒ CH4 + 2H2O (2.5)

CH3COOH + 4H2 ⇒ 2CH4 + 2H2O (2.6)

Sulphate reduction

2CH3CHOHCOOH + H2SO4 ⇒ 2CH3COOH + 2CO2 + 2H2O + H2S (2.7)

CH3CHOHCOOH + H2SO4 ⇒ 2CO2 + 2H2O + H2S (2.8)

1anaerobic conditions does it mean that neither oxygen nor nitrate are present, in contrast toanoxic conditions where only absence of oxygen takes place

Page 9: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

State of the art 7

Denitrification

C6H12O6 + 4NO−3 ⇒ 6H2O + 6CO2 + 2N2 + 4e− (2.9)

It must be taken under consideration that the most efficient process is givenunder aerobic conditions [13].

2.1.2 Nitrification

Nitrification is a two-step biological conversion of ammonia to nitrite and then tonitrate under aerobic conditions [9]. Two different groups of bacteria are needed forthis process: Nitrosomonas and Nitrobacter.

The stoichiometric equations that define those processes are

NH+4 + 1.5O2 ⇒ NO−

2 + 2H+ + H2O (2.10)

which expresses the oxidation of ammonium to nitrite done by Nitrosomonas and

NO−2 + 0.5O2 ⇒ NO−

3 (2.11)

that expresses the oxidation of nitrite to nitrate by Nitrobacter.

The overall equation of the nitrification process is then

NH+4 + 2O2 ⇒ NO−

3 + 2H+ + H2O (2.12)

2.1.3 Denitrification

On the other hand, denitrification takes place under anoxic conditions and is theprocess that reduces nitrate and nitrite into nitrogen gas. This reactions are devel-oped by a wide range of heterotrophic bacterial species. [9]

This can be accomplished with different carbon sources like methanol, ethanol,acetic acid, food processing organic waste materials or organics present in wastew-ater.

If methanol is used, the stoichiometric equation is:

6NO3 + 5CH3OH + H2CO3 ⇒ 3N2 + 8H2O + 6HCO−3 (2.13)

Page 10: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

8Mathematical modeling of

heterogeneous biological wastewater processes

2.1.4 Phosphorus removal

Otherwise, phosphorus removal through biological processes needs the alternation ofaerobic and anaerobic stages to favor biophosphorus or phosphorate-accumulatingorganisms (PAOs), which are the heterotrophic organisms responsible for the bio-logical phosphorus removal.

In the anaerobic stage, biophosphorus convert readily available organics mate-rial to energy-rich carbon polymers called polyhydroxyalkanoates without growing.But is in the aerobic stage where the PAOs can oxidize those polymers and use theenergy and the carbons for their growth and maintenance requirements.[9]

2.2 Biochemical modeling

Modeling and simulation of wastewater treatment plants has been found importantas these treatments are day by day more in use. Nowadays, there are different modelsof the biological treatment systems, normally developed not only for the treatmentplant design and operation but also for the research applied on understanding theseprocesses.

But the best known mechanistic model are the ones developed by the Interna-tional Water Association (IWA) [9]. A mechanistic model quantifies the biologicalprocesses using the actual or believed physical, chemical and microbiological expres-sions -in contrast of an empirical model, based upon a mathematical function thatreasonably represents data from the system-.

These models considers both kinetics and the stoichiometry of reactions. Theytry to represent the biochemical reactions within the activated sludge system andhow they act on its different compounds. But modeling biological processes forcesto make many simplifying assumptions.

On the one hand, there are the different simplifications that appear on consider-ing the microbial population of the wastewater, which comprises different individualorganisms of multiple species, and its behavior as a unique specie whose behavior isan average of the whole.

On the other hand, there are still some aspects of the non-linear dynamics andproperties of the biological processes that need to be understood [6]. Those pro-cesses are not as the traditional mechanical and electrical systems, which equations

Page 11: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

State of the art 9

are directly taken from physical laws.

Moreover, models do not express all the processes given because of the largenumber of reactions that take place on them. Models might be made by those pro-cesses which are the most important but trying to keep the most simple expressionthat can allow a simple solution.

2.2.1 IWA models

In 1982 a Task Group on Mathematical Modeling for Design and Operation of Ac-tivated Sludge Processes was created in the bossom of the then called InternationalAssociation on Water Pollution Research Control (IAWPRC). This Task Group hadthe aim of developing a model that could represent the reactions given on the acti-vated sludge processes. Since then, four different models have been released.

The first one, named Activated Sludge Model No. 1 (ASM1) was achieved on1987. It introduced the matrix notation, where both, kinetics and stoichiometry arerepresented. There, carbon oxidation, nitrification and denitrification are modeled.

But on mid-nineties the principles of the phosphorus removal on wastewater wasbeing understood. For this reason on 1995 it was released a new model, the Acti-vated Sludge Model No. 2 (ASM2), which also incorporated this phenomena.

It was a few years later, as denitrifying phosphorus-accumulating organisms(PAOs) were needed and their processes understood, that the ASM2 was extendedin the ASM2d, where those were included (1999).

But because of the complexity that those models had taken, on 2000 a new mod-eling platform was developed in order to create a tool for the next generation ofactivated sludge models. It was the Activated Sludge Model No. 3.

As complexity grows through all these different models, this master thesis isgoing to work around the first model, the ASM1. Employing this model may let,not only find out how might the equations be solved, but also observe how do theywork. The posterior ampliation to the other IWA models should not bring muchproblems.

2.2.2 Activated Sludge Model No. 1

As it is said before, the ASM1 models the carbon oxidation, nitrification and deni-trification. The model is expressed through a matrix where both, kinetics and stoi-

Page 12: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

10Mathematical modeling of

heterogeneous biological wastewater processes

chiometry are represented. After taking a glance on the matrix (fig. 2.1), its elementsand composition are explained.

Figure 2.1: Activated Sludge Model No.1 matrix. Source: IWA

On top of the matrix, the symbols for the different components that take place onthese processes can be found. It should be distinguished between those componentsrepresented by an X and those by an S. The first ones are those that are particulatewhile the others are soluble. Otherwise, on the bottom of the matrix, it can be readthe name of the component as also units employed.

On the leftmost column, the fundamental processes are written, while their rateexpressions can be read on the rightmost. Those are eight processes: growth ofbiomass, separated on aerobic growth of heterotrophs, anoxic growth of heterotrophsand aerobic growth of autotrophs; decay of biomass, also separated on the decay ofheterotrophs and autotrophs; ammonification of organic nitrogen and hydrolysis of

Page 13: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

State of the art 11

particulate organics entrapped in the biofloc. The rate equations are denoted ρj,where j expresses the number of the process.

Otherwise, within the matrix there are the stoichiometric coefficients, which ex-press the mass relationships between the components on each process. Those coef-ficients are denoted as νi,j, where i expresses the component which is involved onthe process, while j, as before, expresses which process is taken under consideration.On this matrix, the sign convention used is positive for production and negative forconsumption (notice that oxygen is expressed as negative oxygen demand).

Once the elements on the matrix are presented, lets explore a bit more the rateexpressions ρj. These expressions refer to the kinetics of the process. The modelon the kinetics employs the switching functions concept. A switching function isa function that allows turning on or off mathematically a process. This is reallyimportant on those processes that depend on the existence of the electron acceptor.The switch functions used are of the kind

f(S) =S

K + S(2.14)

where S is the concentration of the component which switches on or off the process,while K is the half-saturation coefficient. A lower value of K implies a more rapidchange of the slope. On figure 2.2 the function f(S) is presented.

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

S

Figure 2.2: Representation of a switching function

Page 14: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

12Mathematical modeling of

heterogeneous biological wastewater processes

This function, known also as Monod equation, can be rewritten as

f(S) =

(1

K + S

)· S = α(S) · S (2.15)

where α(S) represents the velocity of reaction (production or destruction) of S. Onfigure 2.3 this velocity is represented.

0 0.2 0.4 0.6 0.8 10

0.01

0.02

0.03

0.04

0.05

0.06

0.07

0.08

0.09

0.1

S

Figure 2.3: Representation of the velocity of reaction α

It may be seen that velocity of reaction has a maximum on S = 0. About zeroconcentration of S implies maximum production of S. Otherwise, it tends to zerowhen S goes to infinite, so for higher values of concentration, littler velocity of pro-duction.

So the ways on reading this matrix are two: following the rows all the processesare being expressed, and attending to the columns it can be seen the evolution ofthe components. Our main interest is this second lecture. And an interesting pointof the matrix is the easiness on representing this. It can be seen that the conversionrates of each component may be written as

ri =∑

j

νi,jρj (2.16)

So, as explained before, the conversion rate of a component appearing on thematrix is the sum of every stoichiometric coefficient multiplied by the process rateto which it belongs. This way of expressing the different process is an easy and clear

Page 15: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

State of the art 13

way to represent the reaction processes given.

Otherwise, it must be remarked that the oxygen equation may have, in additionto the conversion rate ri, a term refereing to the oxygen transfer from gaseous airto solved oxygen. The change on the oxygen concentration may be presented by [7]

KLa · (SO,sat − SO) (2.17)

where KLa is known as Oxygen Transfer Rate (OTR). It can be described by thefunction

KLa = k1 ·(1− ek2·Qair

)(2.18)

where k1 and k2 are parameters which should be estimated [16]. As oxygen will bepresent in some parts of the domain of the problem, models will be solved in bothconditions: allowing entrance of oxygen (so considering this term on oxygen’s equa-tion) and not allowing its entrance (without adding this term on the matrix model).

For the implementation of the numerical solution (which is going to be explainedon next chapter), it has been thought to start with a reduced model before using thewhole formulation of the ASM1. This was planned to facilitate the initial work, sothat it would be easier to implement and to prove if this had been done satisfactorily.

It has also been considered important to introduce a model with the oxygen as acomponent because, as it has been already explained, are the problems associated tooxygen the initial motivation of this work. Also, because oxygen presence in wateris fundamental to define which processes take place.

So it was decided to use a six equation model which represents an aerobic mediawhere only COD removal and nitrification are given [1]. This involves four differentprocess, which are the aerobic growth of heterotrophs, expressed as process j = 1on the ASM1 matrix (see 2.2.2); the aerobic growth of autotrophs, which is processj = 3; the decay of heterotrophs, process j = 4; and the decay of autotrophs, de-noted as j = 5. Otherwise, the components involved are the readily biodegradablesubstrate (SS), active heterotrophic biomass (XB,H), active autotrophic biomass(XB,A), oxygen (SO), nitrate and nitrite nitrogen (SNO) and NH+

4 + NH3 nitrogen(SNH). These components are i = 2, 5, 6, 8, 9 and 10 respectively on the ASM1 no-tation.

Page 16: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

14Mathematical modeling of

heterogeneous biological wastewater processes

2.3 Mass balances

Commonly, there are two patterns of flow considered in wastewater treatment: com-plete mixed and plug flow. If the hydraulic regime is complete mixed, it means thatuniform conditions in terms of concentration of the components are given in thewhole volume of water. Otherwise, the plug flow conditions represents the need ofconsidering an elemental volume because each one has different characteristics.

Plug flow Complete mixed

Figure 2.4: Schemes of both hydraulic regime: plug flow and complete mixed

Traditionally, mass balances have been used on the study of the componentsconcentration in water. A mass balance can be represented as

IN −OUT + GENERATION = ACCUMULATION (2.19)

where IN - OUT represents the net transport which is given through the volume,while GENERATION expresses the production or destruction given within it andACCUMULATION is the amount left over.[5]

Wastewater treatment wetlands are normally constructed as a large basin wherethe direction of the flow is in one direction and the concentration of its componentschanges along it, so it has not an homogeneous composition.

It is a common practice on the study of these wetlands to divide the domainrepresenting the wetland into different volumes, where water flows through all ofthem and each one is considered as a complete mixed basin.

But due to the characteristics explained above, it seems more realistic to studyits hydraulics as a plug flow problem. Then, if area and volumetric flow are assumed

Page 17: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

State of the art 15

as constant, and flow is considered to be only along one direction, the mass balancewill be

QC −Q

(C +

∂C

∂xdx

)+ rdV =

∂C

∂tdV (2.20)

where Q is the volumetric flow rate, C is the concentration of the constituent, dVis the differential volume element and r is the reaction rate.

Dividing the above equation for dV and assuming dV as Adx

−Q

A

∂C

∂x+ r =

∂C

∂t(2.21)

So the behavior of the process can be expressed as a first order hyperbolic PDE.Effect of diffusion may be included through second derivative with respect to x.Then it will be written as

−Q

A

∂C

∂x+ ν

∂2C

∂x2+ r =

∂C

∂t(2.22)

2.4 Adsorption

Adsorption is a process that occurs when a gas or a liquid solute accumulates on thesurface of a solid forming an atomic or molecular film. In the interior of the solid, allthe atomic bonds are filled, while on the surface, these experiment a discontinuity.For those incomplete bonds it is energetically favorable to react with other atomsor molecules found on the surrounding medium.

When adsorption is considered, the problem may change. Lets see its effects onthe mass balance done before (equation 2.21)

φ∂C

∂t+ (1− φ)

∂S

∂t= −Q

A

∂C

∂x+ r(c) (2.23)

where, while C is the concentration of solute, S is the concentration adsorbed, andφ is the medium’s porosity.

Two cases of adsorption can be given, one called equilibrium, which occurs whenchemical reactions are fast, and the other one named kinetic, that occurs when they

Page 18: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

16Mathematical modeling of

heterogeneous biological wastewater processes

are slow. In the first case, adsorption is considered as a function of the concentrationin the fluid,

S = a(c)

while when kinetic adsorption is given, it is considered that it satisfies

S

dt= k(a(c)− S)

where k is a rate parameter.

From now on, only the equilibrium case is going to be considered. Differentassumptions can be made to consider the function a, which receives the name ofadsorption isotherm.2 One of them is the Langmuir isotherm (I. Langmiur, 1916),which is described as

a(C) = NKC

1 + KCK > 0 (2.24)

where N is the saturation concentration of the adsorbed solute and K is an empir-ical constant related to the energy.

When adsorption is achieved but on little quantities, the expression 2.24 can besimplified so that adsorption can be represented as linear (Henry’s law)

a(C) = NKC (2.25)

Under hypothesis of equation 2.25, equation 2.23 may be rewritten as

[φ + (1− φ)NK]∂C

∂t= −Q

A

∂C

∂x+ r(c) (2.26)

while K does not depend neither on time nor on concentration.

If H = φ + (1− φ)NK is defined, it can be seen that

H∂C

∂t= −Q

A

∂C

∂x+ r(c) (2.27)

so, when adsorption is considered, the equation 2.21 is modified only by a term , H,multiplying the variation of concentration along the time. While it is a linear mod-ification, which means not important modifications on the procedure of solving theproblem, from now on, the adsorption problem has been neglected on implementingthe solution.

2It is called adsorption isotherm because the adsorption is studied considering constant tem-perature conditions.

Page 19: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Chapter 3

Mathematical model

As it was exposed on section 2.3, the traditional way on studying the biochemicalmodels on wastewater treatment is through mass balances, and there a particularand simplified case was developed.

In this chapter, a more general point of view on mass balances is going to bedeveloped, so that the equation that reigns the transport of particles studied can befound. Then, the reaction model will be mathematically presented. Moreover, theboundary conditions of the problem are going to be defined.

Along this chapter, all the aspects to reach the complete problem statement willbe defined, so that it can be presented at the end of it.

3.1 Continuum mechanical formulation

The goal of this work is implementing the wastewater treatment model from thecontinuum, considering wastewater as a continuous matter. Under this concept it isunderstood a infinite set of particles which is going to be studied macroscopically,without considering the possible discontinuities given at the microscopical level.That means that the mathematical description of this medium and its propertiescan be described by continuous functions [15].

At each point of this continuous matter there is supposed to be a unique valueof the velocity, pressure, density and other so-called field variables. The continuousmatter is then required to obey the conservation laws of mass, momentum and en-ergy, which give rise to a set of differential equations governing the field variables.

Page 20: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

18Mathematical modeling of

heterogeneous biological wastewater processes

Lets see some aspects that may help on defining the mathematical model.1

3.1.1 Eulerian and Lagrangian coordinates

As the continuum approach has been chosen, it should be then considered whichreference frame may be used for the development of the formulation. There arebasically two coordinate systems that might be employed, eulerian and lagrangiancoordinates.

On eulerian coordinates, also known as spatial coordinates, attention is focusedon the matter which passes through a control volume that is fixed in space. Sothe matter inside the control volume at any instant in time will consist in differentparticles than the given at any other instant of time. In this case the independentvariables are the spatial coordinates x, y and z and time t.

Otherwise, in lagrangian or material approach, attention is fixed on a particularmass of the matter as it moves. Now a particle will be followed while it moves andchanges the shape through the continuous matter. In this reference frame, indepen-dent variables are the coordinates x0, y0 and z0 which the specific particle passedthrough at the instant of time t0 [3]. So the independent variables are x0, y0 and z0

as also t.2

On the resolution of the problem, an eulerian coordinate system has been em-ployed, so the mesh used on the finite element discretization will remain constanton space and along time.

3.1.2 Material derivative

Let φ be any field variable. From the eulerian point of view, φ may be considered as afunction of x, y, z and t. But if the lagrangian approach is made, the specific particleobserved during a period of time δt, is going to change its position an amount of δx,δy and δz while its value of φ will change δφ. During the δt the change of φ will be

δφ =∂φ

∂tδt +

∂φ

∂xδx +

∂φ

∂yδy +

∂φ

∂zδz (3.1)

Equating this change in the lagrangian framework and dividing throughout δt

1More information about the constitutive laws and other aspects of continuum mechanics maybe found, between others, in [3] and [15].

2Note that some bibliography represent the independent variables on the lagrangian referenceframe as X, Y , Z and t.

Page 21: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Mathematical model 19

givesδφ

δt=

∂φ

∂t+

δx

δt

∂φ

∂x+

δy

δt

∂φ

∂y+

δx

δt

∂φ

∂z(3.2)

The left-hand side of the expression represents the total change of φ as observedin the lagrangian framework during δt. In the limit, reducing δt to zero, the left-hand side represents the time derivative of φ, while the ratios δx/δt, δy/δt and δz/δtexpress the velocity, u, in each component. So it can be written as

Dt=

∂φ

∂t+ (u · ∇) φ (3.3)

which is known as the material derivative. It might be remarked that the term(u · ∇) φ is known as the convective derivative.

3.1.3 Reynolds transport theorem

Let A being a property of the matter treated in the continuum, and φ(x, t) thequantity of this property per mass unit. Then, ρφ(x, t) is the quantity per volumeunit.

Consider then an arbitrary material volume within the continuum which in theinstant t occupies a volume Vt ≡ V . The quantity of A given in this material volumeVt at instant t will be:

Q(t) =

Vt≡V

ρφdV (3.4)

Then, the variation of this property A in the material volume Vt, that in tcoincides with the volume V , will be given by the material derivation

d

dt

Vt≡V

ρφdV =

V

∂(ρφ)

∂tdV +

V

∇ · (ρφu)dV (3.5)

Using the Reynolds Lema 3 on the left side of the equation and the divergencetheorem4on the right one, it can be seen that

V

ρdφ

dtdV =

V

∂(ρφ)

∂tdV +

∂V

ρφu · ndS (3.6)

where n is a unitary vector normal to the volume surface. It may be rewritten as

∂t

V

(ρφ)dV =

V

ρdφ

dtdV −

∂V

ρφu · ndS (3.7)

3The Reynolds Lema may be expressed as ddt

∫Vt≡V

ρφdV =∫

Vρdφ

dt dV4The divergence theorem can be announced as

∫V∇ · ΦdV =

∫∂V

Φ · ndS

Page 22: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

20Mathematical modeling of

heterogeneous biological wastewater processes

The left-hand side of the expression can be seen as the variation of the quantityof property A in the control volume per time unit, while on the right-hand side, thefirst term expresses the variation of the quantity of A due to the internal variationand the second term expresses the variation given due to the convective flux of Athrough the surface ∂V .

The equation 3.7 is commonly known as the Reynolds transport theorem. It canalso be expressed on the local form as

∂(ρφ)

∂t= ρ

dt−∇ · (ρφu) ∀x ∈ V (3.8)

As it was said, ρφ(x, t) is the quantity per volume unit, that is the concentrationof A. While working on an incompressible medium (and in this case, it is so), ρ maybe considered constant. Otherwise, under this conditions, it might be consideredthat

∇ · u = 0 (3.9)

So changing ρφ(x, t) for concentration (let it be c), and considering incompress-ible flow hypothesis, the equation will rest as

∂c

∂t=

dc

dt− u · ∇c (3.10)

3.1.4 Diffusion

Diffusion is a transport procedure caused by the Brownian movement. The Brown-ian movement is caused by the crash of the molecules of the fluid with the particlesstudied.

To represent this phenomena there are the Fick’s laws (Adolf Fick, 1885). Inthis case, second Fick’s law ought to be used, it describes diffusion on the three-dimensional case as

∂c

∂t= ∇ · (ν∇c) (3.11)

It may be remarked, that ν is a symmetric positive defined matrix, but when themedium may be considered as isotropous, then ν is a scalar.

3.1.5 Convection-diffusion-reaction

As diffusion processes are involved on particles fluid transport, it is necessary toadd this term at the Reynolds transport theorem. So, from equations 3.10 and 3.11,

Page 23: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Mathematical model 21

transport of particles on a fluid media can be written as

∂c

∂t= ∇ · (ν∇c)− u · ∇c +

dc

dt(3.12)

where on the right-hand side of the equation, the first term involves transport bythe diffusion process, the second term expresses the convective contribution on thetransport and the last term involves the reaction (or as it was said before, the pro-duction of a specie within the control volume).

As it was presented on section 2.2.2, the reaction presented here as dc/dt is, infact, the observed conversion rate defined by the ASM1.

To characterize the relative importance between convection and diffusion thereis the Peclet number. It can be defined as

Pe =uh

2ν(3.13)

which expresses the ratio of convective to diffusive transport. As seen before, u ex-presses convective velocity, while ν is the diffusion coefficient. And h expresses thelength of transport.

3.2 Reaction model

As it was exposed on 2.2.2, the ASM1 model lets express the conversion rate of acomponent as the sum of each stoichiometric coefficient, related to that component,multiplied by the process rate to which it belongs.

∂c

∂t= ∇ · (ν∇c)− u · ∇c +

∑j

νi,jρj (3.14)

where, as also was said before, j represents each process that has been describedon the Activated Sludge Model No.1, while i denotes each compound involved onthose processes.

3.3 Boundary conditions

To solve a differential equation, it is necessary to know the boundary conditions thatdefine the problem. The most common types of boundary conditions are Dirichlet,

Page 24: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

22Mathematical modeling of

heterogeneous biological wastewater processes

Neumann and Robin’s ones.

Let Ω be the domain of the problem. In order to define boundary conditionsalong ∂Ω it is necessary to equal the flux on both sides of a boundary. It can beconsidered that out of the domain, there will be only convective flux, while on theinside, convection and diffusion will take part on the transport process (reactionterm may be neglected while defining the boundary conditions). So, if u− is thevelocity and c− is the concentration on the outside of the boundary, and u+ and c+

are the velocity and the concentration on the inside, the expression of the equationwill be,

c−u− · n = c+u+ · n− n · ν∇c (3.15)

that it may be rewritten as

n · ν∇c =(c−u− − c+u+

) · n (3.16)

This is the most general form on writing a boundary condition on a convection-diffusion problem, which corresponds to the Robin boundary conditions type.

On entrance boundary, it may be supposed that velocity on both sides of theboundary is the same (u− = u+ = u). Then equation 3.16 is expressed as

n · ν∇c =(c− − c+

)u · n (3.17)

Lets consider that diffusion is much more little than convection in the inside ofthe domain, then

0 =(c− − c+

)u · n (3.18)

so thatc− = c+ (3.19)

This hypothesi can be made while diffusion coefficient, ν, is really small. Al-though the value of n · ∇c is not known a priori, its importance on the entranceboundary condition has not such an influence [17] [18]. It can be seen that the con-dition along the entrance boundary, is a Dirichlet condition.

On both lateral boundaries transport velocity is parallel to the boundary, so thatthe scalar product u · n will be equal zero. That leads to

n · ν∇c = 0 (3.20)

Otherwise, the exit boundary has on both sides the same concentration as alsothe same velocity,

c−u− = c+u+ (3.21)

Page 25: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Mathematical model 23

which entails that expression 3.16 can be rewritten as

n · k∇u = 0 (3.22)

It may be seen that both, lateral and exit boundaries, can be written as Neu-mann conditions. Those conditions normally represent a impermeable boundary, buton convection-diffusion problems they have another meaning, while they can defineexit or lateral boundaries.

It is important to remark that oxygen should enter through a lateral boundary,but as it has been explained on section 2.2.2, oxygen will be considered with anexpression added on its equation. Although it seems that this would not reproducea realistic entrance of oxygen, it has the advantage that on subsurface flow wetlandsoxygen does not only enter through a boundary, but also through the plants livingin there. So that there is also oxygen entering from insider points of the domain.

3.4 Problem statement

After going through the sections of this chapter, the whole definition of the problemmay be presented.

Let Ω = [0, 1]x[0, 1] be the spatial domain associated to the problem, while thetime domain is ]0, 2[. Then, the system of equations may be presented as

∂c

∂t= ∇ · (ν∇c)− u · ∇c + r(c) in Ω x ]0, T [ (3.23)

As it was explained before, the reaction term, r(c) has two different forms. Thefirst one involves six components from the whole formulation of the ASM1, so thesystem will have six equations. The unknowns of the system may be then SS, XB,H ,XB,A, SO, SNO and SNH (see section 2.2.2) so the reaction term may be presentedas

8∑j=1

νi,jρj i=2,5,6,8,9 and 10. (3.24)

The other formulation used as reaction term involves the whole ASM1 model. Sothirteen equations may be given and the unknowns are all the components expressedon the first array of the ASM1 matrix. Then, the reaction term can be written as

8∑j=1

νi,jρj i = 1, ..., 13. (3.25)

Page 26: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

24Mathematical modeling of

heterogeneous biological wastewater processes

Attending to the spatial domain defined, boundary conditions may now be writ-ten as

c(x, t) = cext on x = 0

cn(x, t) = 0 on x = 1 ∪ y = 0 ∪ y = 1 (3.26)

where x = 0 represents the entrance boundary, while y = 0 and y = 1 designate thelateral ones and x = 1 is the exit boundary.

When the problem is solved on one dimension, as the domain of the problem isΩ = [0, 1], boundary conditions may be rewritten as

c(x, t) = cext on x = 0

cx(x, t) = 0 on x = 1 (3.27)

Last but not least, initial condition may be also presented. It can be expressedas

c(x, 0) = c0(x) on Ω

Page 27: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Chapter 4

Numerical solver

In order to solve this unsteady convection-diffusion-reaction problem, it is going tobe used a double discretization scheme involving linear C0 finite elements in thespatial discretization and a multistage step method which involves only first deriva-tives in the time discretization.

The finite element methods is nowadays a basic tool on the work related to civilengineering. The strongpoints of this methods are the consistent treatment of thedifferential boundary conditions, the easy modeling of complex continuum mechan-ical problems and domains as also the options given to be programmed in a flexibleformat[4].

A multistage step method is a integration method where every time-step, is sub-divided into different stages in order to find the value reached after the time-step.The most traditional multistage methods are the Runge-Kutta methods and thePade approximations.

At the end of this chapter, stabilization techniques for the spatial discretizationare going to be presented in order to avoid the problems associated to the convectionterm.

4.1 Spatial discretization

For the spatial discretization the Galerkin formulation of the method of weightedresiduals is going to be used. When it is applied to problems governed by self-adjointelliptic or parabolic differential equations, this method leads to symmetric stiffnessmatrices.

Page 28: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

26Mathematical modeling of

heterogeneous biological wastewater processes

But on flow problems this advantage is not presented while the convection op-erator is not symmetric. This may lead to oscillations on the solution, but this willbe studied on section 4.3.

Lets see how is the Galerkin procedure implemented on the problem. Althoughit is a system of equations, its development will be made on an equation withoutthe lose of veracity. All the processes explained on this section and the later onesmay be then extended to all the equations of the problem.

Rewriting equation ??

c + u · ∇c−∇ · (ν∇c) = r(c) (4.1)

and using the differential operator

L = u · ∇ −∇ · (ν∇) (4.2)

the problem can be rewritten as

c + Lc = r(c) (4.3)

Let V be the space of weighting functions which satisfy the homogeneous bound-ary conditions on ΓD.

V = w(x) ∈ H1(Ω) | w(x) = 0 for x ∈ ΓD

It can be noticed that these w functions are not time-dependant.

The solution c of the system lies in L(0, T ;H1(Ω)). And the time dependency ofthe approximate solution c can be translated to the trial space St, which does varyon time,

St := c | c(·, t) ∈ H1(Ω), t ∈ [0, T ] and c(x, t) = cD for x ∈ ΓD

So the weak form of the initial boundary value problem is defined as

(w, c) + (w,Lc) = (w, r(c)) (4.4)

where

(w,Lc) =

Ω

(w (u · ∇c)−∇w · (ν∇c)) dΩ, (4.5)

(w, r(c)) =

Ω

wr(c)dΩ (4.6)

Page 29: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Numerical solver 27

The spatial discretization of the problem on attendance to the Galerkin formu-lation consists on defining two dimensional spaces Sh

t and V h, subsets of St andV ,

V h := w ∈ H1(Ω) | w|Ωe ∈ P1(Ωe) ∀e and w = 0 on ΓD (4.7)

Sht := c | c(·, t) ∈ H1(Ω), c(·, t)|Ωe ∈ P1(Ωe)t ∈ [0, T ] ∀e and c = cD on ΓD

(4.8)where P1 is the finite element interpolating space formed by polynomials of order1. The semi-discrete Galerkin formulation is obtained by restricting the weak formto these finite dimensional spaces. So for any t ∈ [0, T ] find ch ∈ Sh

t such that for allwh ∈ V h,

(wh, ch) + (wh,Lch) = (wh, r(ch)) (4.9)

The approximation ch can be written as

ch(x, t) =∑

A∈η\ηD

NA(x)cA(t) +∑

A∈ηD

NA(x)cD(xA, t),

where η is the set of global node numbers in the finite element mesh and ηD ⊂ ηthe subset of nodes belonging to the Dirichlet portion of the boundary. The testfunctions are defined as wh ∈ V h = spanA∈η\ηD

NA.

It shall be noticed that on ch(x, t), the shape functions NA(x) do not depend ontime, but time dependence is accounted by the nodal values of the unknown.

The assembly process delivers finally the semi-discrete system

Mc + (C − K)c = f (4.10)

where M , C and K are the consistent mass matrix, the convection matrix and thediffusion matrix respectively. These matrices are obtained by topological assemblyof element contributions

M = AeM e M eab =

∫Ωe NaNbdΩ

C = AeCe Ceab =

∫Ωe Na(u · ∇Nb)dΩ

K = AeKe Keab =

∫Ωe ∇Na · (ν∇Nb)dΩ

where A is the assembly operator, 1 ≤ a, b ≤ nen and nen is the number of elementnodes.

Page 30: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

28Mathematical modeling of

heterogeneous biological wastewater processes

Otherwise, the vector f is built up also with the help of the assembly operator:

f = Aef e f ea =

∫Ωe Nar(c))dΩ

It may be noticed that equation 4.10 can be rewritten as

c =(M−1 (C−K)

)c + M−1f = B · c + f(c) (4.11)

Remark 4.1.1

At each time-step, equation 4.11 must be solved. It may be noticed that on thisequation, the only time-dependant term is the vector f -it depends on time dueto the reaction term, which depends on the existing concentration at each point ofGauss, and this concentration changes along the time-, while B does not change intime.

While f must be build up at each time step, matrices M , C and K should becalculated out of the time integration process, in order to reach an implementationthat may be executed with less waste of time.

Remark 4.1.2

As it has been seen before, the reaction term depends on the concentration, sodue to the discretization it can be expressed as

r(c(x, t)) = r(∑

cA(t)NA(x))'

∑r(cA(t))NA(x)

Then, while building up f , it can be seen that

f ea =

Ωe

Nar(c)dΩ =∑

r(cA(t))

Ωe

NaNAdΩ =∑

r(cA) ·M eaA

So that now f are the reaction values evaluated on the nodes multiplied by themass matrix M . This has been used on the one-dimension examples. Then equation4.11 may be written as

c =(M−1 (C−K)

)c + M−1Mr(c) = B · c + r(c) (4.12)

4.2 Time discretization

Unsteady convection-diffusion-reaction problems are not easy to be solved by a high-order time-stepping method because of the second-order diffusion operator given in

Page 31: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Numerical solver 29

the equation. When C0 finite elements are implemented, the time-stepping schemashould only involve first order derivatives[4]. This leads, between others, to theRunge-Kutta methods.

Runge-Kutta methods are multistage methods that only use the solution cn attime tn to compute the solution cn+1 at time tn+1. This can be made by calculat-ing intermediate values of the time derivative of the unknown c within the interval∆t = tn+1 − tn.

Equation 4.11 shall be rewritten as

c = F(t, c) (4.13)

Then, time integration shall be applied in order to solve this ordinary differentialequation. So integrating respect t on both sides of the equation,

∫ tn+1

tn

∂c

∂tdt =

∫ tn+1

tnF(t, c(t))dt (4.14)

While the left-hand side of the equation may be represented as

cn+1 − cn =

∫ tn+1

tnF(t, c(t))dt (4.15)

the right-hand side shall be integrated using a numerical quadrature, where theintegration points are expressed as ξi, while the weights are denoted as ∆tbi. Then

cn+1 − cn = ∆t

ntg∑i=1

biF(ξi, c(ξi)) + E(∆t). (4.16)

While to find out c(ξi) it can be seen

c(ξi)− cn =

∫ ξi

tn

∂c

∂tdt =

∫ ξi

tnF(t, c(t))dt (4.17)

so it shall be used a numerical quadrature again, on the same integration points butwith different weights, which may help to integer between [ti, ξi]. This leads to

c(ξi)− ci = ∆t

ntg∑j=1

ai,jF(ξj, c(ξi)) + Ei(∆t). (4.18)

Page 32: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

30Mathematical modeling of

heterogeneous biological wastewater processes

Despising the errors E(∆t) and Ei(∆t) on both equations 4.16 and 4.18, changingthe variable ξi = tn + ci∆t and using the notation li = F(ξi, c(ξi)), the ntg-stageRunge-Kutta method can be expressed as

cn+1 = cn + ∆t

ntg∑i=1

bili, (4.19)

where li is defined as

li = F(tn + ci∆t, cn + ∆t

ntg∑j=1

ai,jlj), i = 1, 2, ..., ntg. (4.20)

The coefficients ai,j, bi and ci expressed on the former equations must verify theconsistency conditions

ci =

ntg∑j=1

ai,j and

ntg∑i=1

bi = 1

and they are normally displayed on a table called the Butcher array, which is builtup as

Table 4.1: Generic Butcher array used on Runge-Kutta methods.

c1 a1,1 a1,2 . . . a1,ntg

c2 a2,1 a2,2 . . . a2,ntg...

......

. . ....

cntg antg,1 antg,2 . . . antg,ntgb1 b2 . . . bntg

When ai,j = 0 ∀j ≥ i, a explicit Runge-Kutta method is presented, otherwise itwould be implicit.

A way on improving the resolution of the ODE is using an algorithm with a stepsize control, which means that on each step, the length of it, ∆t, may be differentdepending on the easiness of the function that may be integrated.

One of this methods is the known as Runge-Kutta-Fehlberg 4-5 (E. Fehlberg,1969). It defines the step-size that shall be used at each step on comparing thesolution given by a forth-order Runge-Kutta method with the one found with a

Page 33: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Numerical solver 31

fifth-order one. And its development was planned on trying to reduce as much aspossible the truncation error that may present while the integration step-size de-pends strongly on the magnitude of these errors[10].

It can also be presented on a Butcher array, but as it can be seen next, ithas some changes in the structure due to the representation of two Runge-Kuttamethods with different order.

Table 4.2: Butcher array for the Runge-Kutta-Fehlberg 4-5.

14

14

38

332

932

1213

19322197

−72002197

72962197

1 439216

−8 3680513

−8454104

12

−827

2 −35442565

18594104

−1140

25216

0 14082565

21974101

−15

0

16135

0 665612825

2856156430

−950

255

1360

0 −1284275

−21974275

150

255

The sixth array is composed by the coefficients bi used to solve the ODE by afourth order method, while the coefficients in the seventh array are used for the fifthorder method. Finally, the eighth array is used to calculate the error committed(note that the values are those values of the seventh array minus the ones on thesixth).

So the error committed by the use of a ∆t, E∆t, may be found as

E∆t ' ∆t

[1

360k1 − 128

4275k3 − 2197

75240k4 +

1

50k5 +

2

55k6

]

From the expression above, the step size can be found, when a tolerance is given.Limiting the error to that tolerance and solving the part in brackets, the ∆t isdefined and the Runge-Kutta method of fourth order can be solved.

Page 34: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

32Mathematical modeling of

heterogeneous biological wastewater processes

4.3 Stabilization

The convective term may bring instabilities on the space-discretization. In orderto stabilize this term in a consistent manner, ensuring that the solution of thedifferential equation is also a solution of the weak form, there are different techniques.The most commonly used are:

- The Streamline Upwind Petrov-Galerkin method (SUPG),

- Galerkin/Least-squares (GLS),

- Subgrid scale method (SGS), and

- Least-squares.

The three first ones have a similar structure. It consists on adding an extra termover the element interiors to the Galerkin weak form, which could be seen as adiffusion addition which ensures consistency. This term is a function of the residualof the equation. The residual of the equation 4.3 is

R(c) = c + Lc− r(c) (4.21)

The general form of these stabilization techniques is

(w, c) + (w,Lc) +nel∑e=1

(P(w), τR(c))Ωe = (w, r) (4.22)

where P(w) is a certain operator applied to the test function, τ is the stabilizationparameter and R(c) is the residual of the differential equation (equation 4.21). Itmay be noticed that R(c) is computed only for each element interior Ωe

Those three stabilization techniques differ ones from the others by the definitionof the operator P(w). After taking a glance over all of them, it shall be seen that,because of the use of C0 elements on the Galerkin discretization, the three techniquesapply the same operator P(w).

Lets start the Streamline Upwind Petrov-Galerkin stabilization method, whichmay be characterized by

P(w) = u · ∇w, (4.23)

The restriction imposed on the weak form to the usual finite dimensional sub-spaces, defines the discrete problem that must be solved, ch ∈ Sh has to be foundsuch that

(wh, ch) + (wh,Lch) +

+∑

e

∫Ωe

(u · ∇wh

[ch + u · ∇ch −∇ · (ν∇ch

)− r]dΩ = (wh, r) (4.24)

Page 35: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Numerical solver 33

Otherwise, stabilization may be also achieved using the Galerkin/Least-squarestechnique as it is shown next. On the use of GLS, the operator is defined as

P(w) = L(w) = u · ∇w −∇ · (ν∇w) (4.25)

For an unsteady-convection-reaction problem, the weak form restricted to thestandard finite dimensional subspaces may be written as

(wh, ch) + (wh,Lch) +

+∑

e

∫Ωe

[u · ∇wh −∇ · (ν∇wh

)]τ

[ch + u · ∇ch −∇ · (ν∇ch

)− r]dΩ =

= (wh, r) (4.26)

Another stabilization technique is the subgrid scale method (SGS), first intro-duced by T.J.R. Hughes (1995). Here the P(w) is quite similar than the one seen onGLS, but instead of using the operator L it shall be used its adjoint. That means

P(w) = L(w) = u · ∇w +∇ · (ν∇w) (4.27)

Then, restricting the weak form to the standard dimensional subspaces the prob-lem can be expressed as

(wh, ch) + (wh,Lch) +

+∑

e

∫Ωe

[u · ∇wh +∇ · (ν∇wh

)]τ

[ch + u · ∇ch −∇ · (ν∇ch

)− r]dΩ =

= (wh, r) (4.28)

But, as it has been previously announced, some changes may occur on the defi-nition of those operators due to the use of linear elements. The expression for P(w)may be simplified on GLS and SGS methods while the second-order derivatives onlinear elements are zero in the element interiors. So the operator P(w) becomes

P(w) = u · ∇w (4.29)

and the weak form restricted to the usual dimensional subspaces may be presentedas

(wh, ch) + (wh,Lch) +

+∑

e

∫Ωe

[u · ∇wh

[ch + u · ∇ch − r

]dΩ = (wh, r) (4.30)

So, as it can be seen, the three methods are the same on the resolution of theproblem with the C0 elements that have been chosen for the Galerkin formulation.

Another method used for the stabilization is the least − squares (LS) method.The use of Galerkin finite element method is not a good procedure for a spatial

Page 36: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

34Mathematical modeling of

heterogeneous biological wastewater processes

discretization on convection dominated problems [12]. The LS procedure does notadd a stabilization term on the weak form, but uses another discretization procedure.

It is remarkable that the classical procedure of the least squares formulation forconvection-diffusion problems requires a work in H2, unless a mixed LS formulationis used, while the minimization of the square of the residual of the governing equa-tion that uses LS includes second spatial derivative.

But there are multiple examples of those mixed LS formulation which lead tothe use of H1 [4], [11] . Those mixed LS applied on transport problems generate asymmetric positive system, in contrast to the Galerkin method where the system isnon-symmetric. The LS equation can be written as

(L(w),R(cn+1))

= 0 (4.31)

where R(c) is, as defined before, the residual of the equation 4.3. As it can be no-ticed on equation 4.31, on c time discretization has already been applied. That isbecause on the use of a LS procedure, firstly the time discretization must be done,and later the spatial one can be applied.

Traditionally the mixed LS have been used with the known as Pade approxima-tions for the time discretization. These methods are a multistage factorization ofthe Pade approximation to the exponential function and can be expressed in theincremental form as

cn+β1 = cn

cn+βi = cn + βi4tcn+βi−1

t , i = 2, ..., ntg + 1 (4.32)

where βi can also be expressed by a Butcher array.

But the whole implementation using Pade time-discretization and the later leastsquares spatial-discretization is laborious enough to decide to implement the Galerkindiscretization with the Runge-Kutta-Fehlberg method introducing a parameter toreach stabilization.

Page 37: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Chapter 5

Validation

Once the numerical solver is implemented, it is necessary to validate it. Althoughthe mathematical model is not such a realistic model, the tendency of the solutionmay allow to see if the steps done before were correct or not.

Firstly, the parameters chosen for the resolution will be presented. Those referto some aspects of the solver as also of the mathematical model.

Then, the model will be validated in one dimension. This means playing a bitwith the formulation, restricting some components so that the difference on the re-sults may help on establishing its goodness. Once this has been made, it is necessaryto verify also the two dimensions one.

For those models where diffusion is added in order to obtain a stabilized solution,a little study of the stabilization parameter and its order of magnitude will be alsopresented.

5.1 Parameters

Before solving the problem, there are some parameters on the equation which shouldbe specified. There are two types of parameters, the ones needed exclusively for theimplementation and the others which define the mathematical model.

Those which refer to the numerical solver are the number of elements on the meshand the tolerance admitted on the solution. The mesh defined to solve the problemis formed by 20 elements on the one dimensional case, while on the two dimensionalone, the domain Ω is defined by 20x20 elements. In reference to tolerance admitted,

Page 38: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

36Mathematical modeling of

heterogeneous biological wastewater processes

it has been chosen a tolerance of 0.5x10−4.

When looking to the mathematical model, the parameters that must be definedare the ones refereing to the constants on transport equation, those which appearon the ASM1 formulation, as also the initial and boundary conditions values.

Constants which appear on the ASM1 may be presented on two different groups:the ones refereing to stoichiometric processes and the others related to the kinetics.On table 5.1 the first ones, which are given on the coefficients presented within thematrix, can be seen.

Table 5.1: Stoichiometric parameters appeared on the ASM1. Source:J. Bolmstedtand G. Olsson, 2002.Parameter Value Units Definition

YH 0.67 g cell COD formed/(gCOD oxidized)

yield of growth rate for het-erotrophic biomass

YA 0.24 g cell COD formed/(gCOD oxidized)

yield of growth rate for au-totrophic biomass

fp 0.08 fraction of biomass yielding par-ticulate products

iXB 0.086 g N/g COD inbiomass

mass N/mass COD in biomass

iXP 0.06 g N/g COD in endoge-nous mass

mass N/mass COD in productsbiomass

The stoichiometric parameters, which refer to the ones presented on the processrates, are expressed on table 5.2.

Values presented on both tables are realistic values that might be used on awastewater treatment plant formed by different reactors when its operation is madeunder constant temperature of 20C [1]. Although this has nothing to do with theinitial motivation of the problem, its orders of magnitude seem to be similar to thereal ones, and this may help on detecting possible troubles which could appear onthe real problem.

Then, on convection-diffusion equation, as diffusion coefficient, ν, the valueν = 10−4 has been employed (as it has been previously said, diffusion coefficientis an scalar when isotropy conditions are considered, as it is in this case). Otherwiseconvection velocity has been defined as u = (1, 0), so that flux is only in one direc-

Page 39: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Validation 37

Table 5.2: Kinetic parameters appeared on the ASM1. Source:J. Bolmstedt and G.Olsson, 2002.Parameter Value Units Definition

µH 6. h−1 maximum specific growth rate forheterotrophic biomass

KS 20. g of COD/m3 saturation coefficient for het-erotrophic biomass

KO,H 0.2 g of 02/m3 oxygen saturation coefficient for

heterotrophic biomassKNO 0.5 g NO3 −N/m3 nitrate hsc for denitrifying het-

erotrophsbH 0.62 h−1 decay rate for heterotrophic

biomassµA 0.8 h−1 maximum specific growth rate for

heterotrophic biomassKNH 1. g of N3 −N/m3 ammonium saturation coefficient

for autotrophic biomassKO,A 0.4 g of 02/m

3 oxygen saturation coefficient forautotrophic biomass

bA 0.2 h−1 decay rate for autotrophicbiomass

ηg 0.8 correction factor for anoxicgrowth of heterotrophs

ka 0.08 m3 / g COD day ammonification ratekh 3. g slowly biodeg.COD

/ g cell COD daymax. specific hydrolysis rate

KX 0.03 g slowly biodeg.COD/ g cell COD

hsc for hydrolysis of slowlybiodeg. substrate

ηh 0.4 correction factor for anoxic hy-drolysis

Page 40: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

38Mathematical modeling of

heterogeneous biological wastewater processes

tion.

When refereing to the Dirichlet boundary condition, the value that has beenchose is cext = 1 for all the different unknowns. Otherwise, as initial condition value,c0, two different values have been chosen on the implementation. Those are c0 = 0and c0 = 1, and they will be specified on each case when results are shown.

5.2 Validation of the system resolution in one di-

mension

After defining parameters, the system of equations may be solved. In this section,results taken by the model will be analyzed to validate its goodness. Equations havebeen solved in one dimension, without using any stabilization technique and its re-sults have been found out with initial condition c0 = 1.

The procedure employed in order to evaluate the model will consist on compar-ing the results given in different situations of components presence. Assuming thatthe main difference can be given by the presence of oxygen, the different casus willbe seen on both conditions, when entrance of oxygen is given through the wholedomain and when this entrance is not allowed. As it has been previously explainedon section 2.2.2, entrance of oxygen means adding the term on equation 2.17 on thereaction term in oxygen’s equation (SO).

So, over this two different situations, the presence or absence of other influentcomponents will be forced in order to observe how results vary.

5.2.1 Validation of the six equations modeling

Lets start by the analysis of the six equations model. As a reminder, this modelanalyzes six components (SS, XB,H , XB,A, SO, SNO and SNH) which take part onfour different processes (aerobic growth of heterotrophs (ρ1), aerobic growth of au-totrophs (ρ3), decay of heterotrophs (ρ4) and decay of autotrophs (ρ6)).

On the six equations model the component which will be restricted is the NH+4

and NH3 nitrogen, (SNH). This has been made so because, when other componentsare restricted, not such big differences can be observed.

Page 41: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Validation 39

No oxygen’s entrance Oxygen’s entrance

0 0.5 10

0.5

1

1.5

xnodo

Xbh

0 0.5 10

0.5

1

1.5

xnodo

Xba

0 0.5 10

0.5

1

1.5

xnodo

Ss

0 0.5 10

0.5

1

1.5

xnodo

So

0 0.5 10

0.5

1

1.5

xnodo

Snh

0 0.5 10

0.5

1

1.5

2

xnodo

Sno

0 0.5 10

0.5

1

1.5

xnodo

Xbh

0 0.5 10

0.5

1

1.5

xnodo

Xba

0 0.5 10

0.5

1

1.5

xnodo

Ss

0 0.5 10

5

10

xnodo

So

0 0.5 10

0.5

1

1.5

xnodo

Snh

0 0.5 10

0.5

1

1.5

2

xnodo

Sno

Figure 5.1: Evolution of concentration on the six equation model without and withoxygen entrance

Page 42: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

40Mathematical modeling of

heterogeneous biological wastewater processes

First of all, lets observe results with and without entrance of oxygen maintainingother components not limited (they may be seen on figure 5.1). There concentrationalong the domain Ω = [0, 1] is presented when solution reaches the steady state.This may be seen as the concentration of each component along the subsurface flowwetland when their stationary flow is achieved.

The main differences between both situations are given by SNO and SNH . Whenpresence of oxygen is assured, production of SNO is given while in its absence (onthe second half of the domain on the No oxygen′s entrance’s graphics), there isneither production nor destruction. That occurs so because the process rate on itsreaction term goes to zero when absence of SO is given. A similar situation is givenon SNH destruction, as when SO is not present on the medium, its decreasing isstopped, this time because both processes rates, ρ1 and ρ3, become zero.

From the biological point of view, as denitrification processes are not consideredon this model (only aerobic processes are taken under consideration), destructionof NH+

4 can not occur without oxygen presence, as it may be seen on nitrificationequilibrium on section 2.1.2. Therefore nitrate and nitrite can neither be produced.

On the other results, similar behavior may be observed, but its effects are notthat spectacular as on the ones above commented.

Results produced when NH+4 and NH3 nitrogen reaction term is forced to be

zero can be seen on figure 5.2. In this case, when there is not an additional entranceof oxygen, results observed are quite the same as on figure 5.1. But bigger differencesappear when oxygen enters through the whole domain.

As it may be seen, production of SNO increases more than the one seen on figure5.1 while SNH is only transported through the domain. This occurs because its pro-cess rate depends on SNH , and now its presence on the domain does not decrease.Also XB,A increases more in this case, and the reason is also the no-decreasing ofSNH .

It can be also appreciated that oxygen presence in water is not that high aswhen SNH is not restricted. Here, when Oxygen Transmission Rate 1 is stabilized,SO almost stops growing because the aerobic growth of heterotrophs rate, whichreduces SO presence, is bigger than before due to its dependance on SNH .

Also this results have a certain biological sense. When the concentration of NH+4

1see section 2.2.2.

Page 43: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Validation 41

No oxygen’s entrance Oxygen’s entrance

0 0.5 10

0.5

1

1.5

xnodo

Xbh

0 0.5 10

0.5

1

1.5

xnodo

Xba

0 0.5 10

0.5

1

1.5

xnodo

Ss

0 0.5 10

0.5

1

1.5

xnodo

So

0 0.5 10

0.5

1

1.5

xnodo

Snh

0 0.5 10

1

2

3

xnodo

Sno

0 0.5 10

0.5

1

1.5

xnodo

Xbh

0 0.5 10

0.5

1

1.5

xnodo

Xba

0 0.5 10

0.5

1

1.5

xnodo

Ss

0 0.5 10

5

10

xnodo

So

0 0.5 10

0.5

1

1.5

xnodo

Snh

0 0.5 10

1

2

3

xnodo

Sno

Figure 5.2: Evolution of concentration on the six equation model without and withoxygen entrance when SNH = 0

Page 44: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

42Mathematical modeling of

heterogeneous biological wastewater processes

and NH3 nitrogen is maintained constant, then nitrification will not stop and soproduction of nitrate and nitrite nitrogen should be higher (equilibrium seen on ex-pressions 2.10 and 2.12). On the oxygen case, process is similar to this one, becauseas nitrification takes place, waste of oxygen is given by the process.

5.2.2 Validation of the ASM1 modeling

Now the changes on the whole ASM1 will be studied. Although it does not representall the processes given on wastewater treatments, this model is quite more completeas the other one. So from the biological point of view, results may have much moresense.

Following the procedure made on last section, lets start looking at results givenwhen oxygen’s entrance is given through the whole domain, as also when it is not.

The main difference given between the six equations model (figure 5.1) and thewhole ASM1 (figure 5.3), is that here, SS is produced instead of destructed. Thatoccurs because hydrolysis of entrapped organics rate (ρ7) is bigger than both ofheterotrophs growth (ρ1 and ρ1). As it may be seen, it continues growing also whenoxygen is not present, but with littler velocity due to that one term of this ρ7 rateis proportional to SO while the other one is not.

When analyzing both solutions, letting entrance of oxygen and not, main differ-ences are presented on SNO, SNH , SS, XS, SND and XND concentrations. Differenceson the first two components are the same as on the six equation model and theyhave been already described on last subsection. On XS and XND, its destructionis widely increased when oxygen is presented mainly because of its hydrolysis ofentrapped organics rates. On the other hand, SS and SND production is increased.

From the biological point of view, the littler destruction of XS is because underanoxic conditions (when nitrate is the only terminal electron acceptor) conversionof slowly biodegradable material into readily biodegradable one is lower. Betweenparticulate organic nitrogen and soluble organic one, conversion follows the samepatron.

Under anaerobic conditions (neither oxygen nor nitrate are given), those conver-sion rates should stop. On figure 5.4, SNO has been forced to be zero in the wholedomain, so that anaerobic conditions are partially presented. As it may be seen,when oxygen is already given, both SS and SND increase their concentration, whilewhen anaerobic conditions are given, SS remains constant while SND concentra-

Page 45: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Validation 43

No oxygen’s entrance

0 0.5 10

0.5

1

1.5

xnodo

Xbh

0 0.5 10

0.5

1

1.5

xnodo

Xba

0 0.5 10

0.5

1

1.5

2

2.5

xnodo

Ss

0 0.5 10

0.5

1

1.5

xnodo

So

0 0.5 10

0.5

1

1.5

xnodo

Snh

0 0.5 10

0.5

1

1.5

2

2.5

xnodoS

no

0 0.5 1

0

0.5

1

1.5

xnodo

Xs

0 0.5 10

0.5

1

1.5

xnodo

Xp

0 0.5 10

0.5

1

1.5

2

2.5

xnodo

Snd

0 0.5 10

0.5

1

1.5

xnodo

Xnd

0 0.5 10

0.5

1

1.5

xnodo

Sal

k

0 0.5 10

0.5

1

1.5

xnodo

Si

0 0.5 10

0.5

1

1.5

xnodo

Xi

Oxygen’s entrance

0 0.5 10

0.5

1

1.5

xnodo

Xbh

0 0.5 10

0.5

1

1.5

xnodo

Xba

0 0.5 10

0.5

1

1.5

2

2.5

xnodo

Ss

0 0.5 10

2

4

6

8

10

xnodo

So

0 0.5 10

0.5

1

1.5

xnodo

Snh

0 0.5 10

0.5

1

1.5

2

2.5

xnodo

Sno

0 0.5 1

0

0.5

1

1.5

xnodo

Xs

0 0.5 10

0.5

1

1.5

xnodo

Xp

0 0.5 10

0.5

1

1.5

2

2.5

xnodo

Snd

0 0.5 10

0.5

1

1.5

xnodo

Xnd

0 0.5 10

0.5

1

1.5

xnodo

Sal

k

0 0.5 10

0.5

1

1.5

xnodo

Si

0 0.5 10

0.5

1

1.5

xnodo

Xi

Figure 5.3: Evolution of concentration on the complete ASM1 equation model withoxygen entrance

Page 46: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

44Mathematical modeling of

heterogeneous biological wastewater processes

0 0.5 10

0.5

1

1.5

xnodo

Xbh

0 0.5 10

0.5

1

1.5

xnodo

Xba

0 0.5 10

0.5

1

1.5

2

2.5

xnodo

Ss

0 0.5 10

0.5

1

1.5

xnodo

So

0 0.5 10

0.5

1

1.5

xnodo

Snh

0 0.5 10

0.5

1

1.5

2

2.5

xnodo

Sno

0 0.5 1

0

0.5

1

1.5

xnodo

Xs

0 0.5 10

0.5

1

1.5

xnodo

Xp

0 0.5 10

0.5

1

1.5

2

2.5

xnodo

Snd

0 0.5 1

0

0.5

1

1.5

xnodo

Xnd

0 0.5 10

0.5

1

1.5

xnodo

Sal

k0 0.5 1

0

0.5

1

1.5

xnodo

Si

0 0.5 10

0.5

1

1.5

xnodo

Xi

Figure 5.4: Evolution of concentration on the complete ASM1 equation model withneither oxygen entrance nor nitrite presence

Page 47: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Validation 45

tion even decreases (due to ammonification). And XS, when anaerobic conditionsare given, is increased while its conversion into readily biodegradable material isstopped but decay of autotrophs and heterotrophs is not.

After observing solutions on those different situations, both on the six equationsmodel and on the whole ASM1 formulation, it may be assumed that the numericalmodeling has been properly implemented.

5.3 Verification of the two dimensional model

As the one dimensional case has already been proved, now is the turn of the twodimensional model to be verified. It’s not necessary to validate it as it has been doneon the one dimensional case, but just observing if results are similar to those ones.

No oxygen’s entrance Oxygen’s entrance

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

Xbh

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

So

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

Snh

0 0.2 0.4 0.6 0.8 10

0.5

1

1.5

2

2.5

0 0.5 10

0.5

1

1.5

Xbh

0 0.5 10

0.5

1

1.5

Xba

0 0.5 10

0.5

1

1.5

Ss

0 0.5 10

5

10

So

0 0.5 10

0.5

1

1.5

Snh

0 0.5 10

1

2

Sno

Figure 5.5: Evolution of concentration on the six equation model without and withoxygen entrance on two dimensions

On figures 5.5 and 5.6 solutions have been presented showing only x-axe andconcentration, so that it is easier to compare results from both models. Results havebeen calculated using as initial condition c0 = 1.

It may be seen that results on both cases are quite similar, so they can be ac-cepted and the two dimensional model can be assumed as correct also.

Page 48: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

46Mathematical modeling of

heterogeneous biological wastewater processes

No oxygen’s entrance

0 0.5 10

0.5

1

1.5

Xbh

0 0.5 10

0.5

1

1.5

Xba

0 0.5 10

0.5

1

1.5

Ss

0 0.5 10

0.5

1

1.5

So

0 0.5 10

0.5

1

1.5

Snh

0 0.5 10

0.5

1

1.5

2

2.5

Sno

0 0.5 1

0

0.5

1

1.5

Xs

0 0.5 10

0.5

1

1.5

Xp

0 0.5 10

0.5

1

1.5

2

2.5

Snd

0 0.5 10

0.5

1

1.5

Xnd

0 0.5 10

0.5

1

1.5

Sal

k

0 0.5 10

0.5

1

1.5

Si

0 0.5 10

0.5

1

1.5

Xi

Oxygen’s entrance

0 0.5 10

0.5

1

1.5

Xbh

0 0.5 10

0.5

1

1.5

Xba

0 0.5 10

0.5

1

1.5

Ss

0 0.5 10

2

4

6

8

10

So

0 0.5 10

0.5

1

1.5

Snh

0 0.5 10

0.5

1

1.5

2

2.5

Sno

0 0.5 1

0

0.5

1

1.5

Xs

0 0.5 10

0.5

1

1.5

Xp

0 0.5 10

0.5

1

1.5

2

2.5

Snd

0 0.5 10

0.5

1

1.5

Xnd

0 0.5 10

0.5

1

1.5

Sal

k

0 0.5 10

0.5

1

1.5

Si

0 0.5 10

0.5

1

1.5

Xi

Figure 5.6: Evolution of concentration on the complete ASM1 equation model withoxygen entrance

Page 49: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Validation 47

5.4 Defining τ

It is not that easy to see instabilities on results produced with a initial conditionequal one, but when it is defined as zero, those are quite important. In figure 5.7,where initial condition c0 = 0 has been used, they can be seen. Those instabilitiescan be better appreciated on the time-concentration graphic, so on this figure con-centration along the time on the exit boundary is presented.

0 1 20

0.5

1

1.5

t

Xbh

0 1 20

0.5

1

1.5

t

Xba

0 1 20

0.5

1

1.5

t

Ss

0 1 20

5

10

t

So

0 1 20

0.5

1

1.5

t

Snh

0 1 20

0.5

1

1.5

2

2.5

t

Sno

Figure 5.7: Results of the six equation model using initial condition c0 = 0

Then, the need of a stabilization technique is evident. And so a stabilization pa-rameter τ shall be defined. There is plenty of different formulations for the wide rangeof equations and its different conditions. Just for unsteady convection-diffusion-reaction problems several of them can be found.

Some examples can be found in [4]. When steady state is the one which concernsin the solution, next expressions can be used.

τ =h

2a

(coth(Pe)− 1

Pe

)(5.1)

Page 50: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

48Mathematical modeling of

heterogeneous biological wastewater processes

τ =h

2a

(1 +

1

Pe

+h

2aσ

)−1

(5.2)

τ =h

2a

(1 +

9

P 2e

+

(h

2aσ

)2)−1/2

(5.3)

Due to nature of the reaction term, which is not constant, it may not be consid-ered on the stabilization parameter, so expressions can be rewritten as

τ =h

2a

(coth(Pe)− 1

Pe

)(5.4)

τ =h

2a

(1 +

1

Pe

)−1

(5.5)

τ =h

2a

(1 +

9

P 2e

)−1/2

(5.6)

On figure 5.8, three different graphics of SNO concentration can be seen, whichare the result of the six equations model. Each one of them compares the resolutionof the Galerkin solution without stabilization versus the use of a stabilization tech-nique where each τ is used. There, τa corresponds to the use of expression 5.4, τb isexpressed on formulae 5.5 while τc is the one on expression 5.6.

τa τb τc

0 0.5 1 1.5 20

0.5

1

1.5

2

2.5

t0 0.5 1 1.5 2

0

0.5

1

1.5

2

2.5

t

Sno

0 0.5 1 1.5 20

0.5

1

1.5

2

2.5

t

Sno

Figure 5.8: Results of SNO on six equations model using initial condition c0 = 0calculated with stabilization technique using different expressions from τ

As it may be seen, stabilization is achieved, and on the three, results are almostthe same. But it adds a lot of diffusion, which could be reduced. That has a lotof sine, because those expressions are not made for this particular problem. So a

Page 51: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Validation 49

readjustment should be made, which may be seen on figure 5.9.

To obtain these results τ has been divided by different numbers (5, 10 and 25) inorder to obtain a better value, that means trying to find a stabilization parameterwhich does not give instabilities but also does not add too much diffusion. Resultshave been also presented on SNO solution obtained by the six equations model.

0 0.5 1 1.5 20

0.5

1

1.5

2

2.5

t

Sno

Figure 5.9: Comparison on SNO results of solutions reached without stabilizationand using τ/5, τ/10 and τ/25

It may be seen that solution presented on red does not have any perturbation,and its added diffusion is littler than the one in green. This one corresponds to theτ/10 solution. Then the stabilization parameter which shall be used in this particularproblem under the conditions before described is

τ =1

10

h

2a

(coth(Pe)− 1

Pe

)(5.7)

But from a more generic point of view, τ should be written as

τ = αh

2a

(coth(Pe)− 1

Pe

)(5.8)

where α could be another value when some aspects of the problem change.

Page 52: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

50Mathematical modeling of

heterogeneous biological wastewater processes

Page 53: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Chapter 6

Results

Once the model has been implemented and the goodness of it has been proved, it istime to present results.

On the first section of this chapter, results presented are those of the flow ofwater on an homogeneous domain, either where oxygen’s entrance is allowed or it isnot.

Later, results presented are quite more realistic because oxygen’s entrance isallowed only on the upper part of the domain. In this case, new oscillations havebeen found, and ways to reduce its presence on the solution tried out.

6.1 Results on a homogeneous domain

Two different models have been implemented, and different domains have been used(one dimension and two dimensions). But all this steps have been made only toreach a model from the whole Activated Sludge Model No. 1 in a two dimensionsdomain. So here results presented will refer just to this case.

Results on modeling the ASM1 on Ω = [0, 1]x[0, 1] as it was defined on chapter3 are shown next. Both cases, letting oxygen enter through the whole domain andavoiding its entrance, are considered.

Firstly results when oxygen entrance is allowed on the whole domain are pre-sented.

Next, results shown are the ones when the only oxygen which gives on the wetlandis the one that enters solved on the wastewater.

It can be seen that results do not have oscillations thanks to the stabilizationparameter chosen before.

Page 54: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

52Mathematical modeling of

heterogeneous biological wastewater processes

00.5

1 00.5

10

0.5

1

1.5

Xbh

00.5

1 00.5

10

0.5

1

1.5

Xba

00.5

1 00.5

10

1

2

Ss

00.5

1 00.5

10

5

10

So

00.5

1 00.5

10

0.5

1

1.5

Snh

00.5

1 00.5

10

1

2

Sno

00.5

1 00.5

10

0.5

1

1.5

Xs

00.5

1 00.5

10

0.5

1

1.5

Xp

00.5

1 00.5

10

1

2

Snd

00.5

1 00.5

10

0.5

1

1.5

Xnd

00.5

1 00.5

10

0.5

1

1.5

Sal

k

00.5

1 00.5

10

0.5

1

1.5

Si

00.5

1 00.5

10

0.5

1

1.5

Xi

Figure 6.1: Evolution of concentration on the ASM1 model with oxygen entrance onthe whole section of the wetland

0 0.5 10

0.5

1

1.5

Xbh

0 0.5 10

0.5

1

1.5

Xba

0 0.5 10

0.5

1

1.5

2

2.5

Ss

0 0.5 10

2

4

6

8

10

So

0 0.5 10

0.5

1

1.5

Snh

0 0.5 10

0.5

1

1.5

2

2.5

Sno

0 0.5 10

0.5

1

1.5

Xs

0 0.5 10

0.5

1

1.5

Xp

0 0.5 10

0.5

1

1.5

2

2.5

Snd

0 0.5 10

0.5

1

1.5

Xnd

0 0.5 10

0.5

1

1.5

Sal

k

0 0.5 10

0.5

1

1.5

Si

0 0.5 10

0.5

1

1.5

Xi

Figure 6.2: Evolution of concentration on the ASM1 model with oxygen entrancealong the wetland

Page 55: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Results 53

0 1 20

0.5

1

1.5

t

Xbh

0 1 20

0.5

1

1.5

t

Xba

0 1 20

0.5

1

1.5

2

2.5

t

Ss

0 1 20

2

4

6

8

10

t

So

0 1 20

0.5

1

1.5

t

Snh

0 1 20

0.5

1

1.5

2

2.5

t

Sno

0 1 20

0.5

1

1.5

t

Xs

0 1 20

0.5

1

1.5

t

Xp

0 1 20

0.5

1

1.5

2

2.5

t

Snd

0 1 20

0.5

1

1.5

t

Xnd

0 1 20

0.5

1

1.5

t

Sal

k

0 1 20

0.5

1

1.5

t

Si

0 1 20

0.5

1

1.5

tX

i

Figure 6.3: Evolution of concentration of each component on the exit boundary whenoxygen entrance is given on the whole domain along the time

00.5

1 00.5

10

0.5

1

1.5

Xbh

00.5

1 00.5

10

0.5

1

1.5

Xba

00.5

1 00.5

10

1

2

Ss

00.5

1 00.5

10

0.5

1

1.5

So

00.5

1 00.5

10

0.5

1

1.5

Snh

00.5

1 00.5

10

1

2

Sno

00.5

1 00.5

10

0.5

1

1.5

Xs

00.5

1 00.5

10

0.5

1

1.5

Xp

00.5

1 00.5

10

1

2

Snd

00.5

1 00.5

10

0.5

1

1.5

Xnd

00.5

1 00.5

10

0.5

1

1.5

Sal

k

00.5

1 00.5

10

0.5

1

1.5

Si

00.5

1 00.5

10

0.5

1

1.5

Xi

Figure 6.4: Evolution of concentration on the ASM1 model with oxygen entrance onthe whole section of the wetland

Page 56: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

54Mathematical modeling of

heterogeneous biological wastewater processes

0 0.5 10

0.5

1

1.5

Xbh

0 0.5 10

0.5

1

1.5

Xba

0 0.5 10

0.5

1

1.5

2

2.5

Ss

0 0.5 10

0.5

1

1.5

So

0 0.5 10

0.5

1

1.5

Snh

0 0.5 10

0.5

1

1.5

2

2.5

Sno

0 0.5 10

0.5

1

1.5

Xs

0 0.5 10

0.5

1

1.5

Xp

0 0.5 10

0.5

1

1.5

2

2.5

Snd

0 0.5 10

0.5

1

1.5

Xnd

0 0.5 10

0.5

1

1.5

Sal

k

0 0.5 10

0.5

1

1.5

Si

0 0.5 10

0.5

1

1.5

Xi

Figure 6.5: Evolution of concentration on the ASM1 model with oxygen entrancealong the wetland

0 1 20

0.5

1

1.5

t

Xbh

0 1 20

0.5

1

1.5

t

Xba

0 1 20

0.5

1

1.5

2

2.5

t

Ss

0 1 20

0.5

1

1.5

t

So

0 1 20

0.5

1

1.5

t

Snh

0 1 20

0.5

1

1.5

2

2.5

t

Sno

0 1 20

0.5

1

1.5

t

Xs

0 1 20

0.5

1

1.5

t

Xp

0 1 20

0.5

1

1.5

2

2.5

t

Snd

0 1 20

0.5

1

1.5

t

Xnd

0 1 20

0.5

1

1.5

t

Sal

k

0 1 20

0.5

1

1.5

t

Si

0 1 20

0.5

1

1.5

t

Xi

Figure 6.6: Evolution of concentration of each component on the exit boundary whenoxygen entrance is given on the whole domain along the time

Page 57: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Results 55

6.2 Results on a heterogeneous domain (or epi-

logue)

Models presented until now which separate both situations, when oxygen entersthrough the whole domain and when it does not, may be interesting to observe howdo the implementations work. But this models have not much to do with wetlandsreality.

There, as briefly explained before, oxygen enters through the superior boundary,as also from roots of the existing plants on the upper part of the domain.

So a quite more realistic implementation has been made. It consists on havingdifferent reaction terms depending on the position of the point of Gauss within thedomain. While ones use the term presented on the ASM1 as

∑j νijρj, others add to

this term the Oxygen Transmission Rate (equation 2.17).

6.2.1 Discontinuous OTR reaction term

On the first case, the border has been defined on the upper 40% of the domain,where the reaction term presents the OTR, while the other 60% does not. On this60% of the domain, this discontinuous reaction term is imposed with values equalzero, while on the others, its values are equal one.

As it may be seen on next figures, this option presents some computationalproblems, and its computational cost is so high that just till final time 0.2 has beencomputed.

On figure 6.7 it can be seen that the discontinuity on oxygen entrance by thereaction term produces a big oscillation on several unknowns of the problem, whereseveral variables take negative values. Those negative values could be filtered usinga modification of the time integration scheme imposing at each time step that allnegative values equal zero. However this would affect the convergence of the timeintegrator, and, moreover, the tendency to present negative values will remain andthe overall reaction term will be affected.

Page 58: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

56Mathematical modeling of

heterogeneous biological wastewater processes

0 0.5 1 00.5

10

0.5

1

1.5

mlss heterotrophic0 0.5 1 0 0.510

0.5

1

1.5

mlss autotrophic0 0.5 1 0

0.510

0.5

1

1.5

bod0 0.5 1 0

0.510

5

10

do0 0.5 1 0

0.510

0.5

1

1.5

Snh

0 0.5 1 00.5

10

1

2

Sno0 0.5 1 0

0.510

0.5

1

1.5

Xs0 0.5 1 0

0.510

0.5

1

1.5

Xp0 0.5 1 0

0.510

1

2

Snd0 0.5 1 0

0.510

0.5

1

1.5

Xnd

0 0.5 1 00.5

10

0.5

1

1.5

Salk0 0.5 1 0

0.510

0.5

1

1.5

Si0 0.5 1 0

0.510

0.5

1

1.5

Xi

Figure 6.7: Evolution of concentration of each component when oxygen entrance isgiven on the upper 40% of the domain (final dimensionless time = 0.2)

Page 59: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Results 57

6.2.2 Continuous OTR reaction term

Both, because of the problems of the discontinuous reaction term and because ac-tually a transition between both zones, the one with oxygen and the one without,may be expected, a second modeling option has been tested.

A linear transition from zero to one in reaction term is imposed on y directionfrom 0.6 to 0.8. Provided that a vertical discretization on 20 elements is used, thetransition includes four elements. A reaction term with value one is imposed on the20% upper domain.

Results may be seen on figure 6.8, where computation was executed until finaldimensionless time 0.5, and on figure 6.9, where final dimensionless time was 2.

0 0.5 1 00.5

10

0.5

1

1.5

mlss heterotrophic0 0.5 1 0 0.510

0.5

1

1.5

mlss autotrophic0 0.5 1 0

0.510

0.5

1

1.5

bod0 0.5 1 0

0.510

5

10

do0 0.5 1 0

0.510

0.5

1

1.5

Snh

0 0.5 1 00.5

10

1

2

Sno0 0.5 1 0

0.510

0.5

1

1.5

Xs0 0.5 1 0

0.510

0.5

1

1.5

Xp

0 0.5 1 00.5

10

1

2

Snd 0 0.5 1 00.5

10

0.5

1

1.5

Xnd

0 0.5 1 00.5

10

0.5

1

1.5

Salk0 0.5 1 0

0.510

0.5

1

1.5

Si0 0.5 1 0

0.510

0.5

1

1.5

Xi

Figure 6.8: Evolution when oxygen entrance is given on the upper 20% of the domain,while on the lowest 60% it is not, and on the 20% in between there is a lineartransition (final dimensionless time = 0.5).

As it should be expected, results on the upper part of the domain are as thoseobtained with O2 presence, and in the lower part as those without it.

Page 60: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

58Mathematical modeling of

heterogeneous biological wastewater processes

0 0.5 1 0 0.510

0.5

1

1.5

mlss heterotrophic0 0.5 1 0 0.510

0.5

1

1.5

mlss autotrophic0 0.5 1 0

0.510

0.5

1

1.5

bod0 0.5 1 0

0.510

5

10

do0 0.5 1 0

0.510

0.5

1

1.5

Snh

0 0.5 1 00.5

10

1

2

Sno0 0.5 1 0

0.510

0.5

1

1.5

Xs0 0.5 1 0

0.510

0.5

1

1.5

Xp0 0.5 1 0

0.510

1

2

Snd0 0.5 1 0

0.510

0.5

1

1.5

Xnd

0 0.5 1 00.5

10

0.5

1

1.5

Salk0 0.5 1 0

0.510

0.5

1

1.5

Si

0 0.5 1 00.5

10

0.5

1

1.5

Xi

Figure 6.9: Evolution when oxygen entrance is given on the upper 20% of the domain,while on the lowest 60% it is not, while on the 20% in between there is a lineartransition (final dimensionless time = 2.0).

Page 61: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Results 59

It is remarkable that the small oscillations presented during the evolution of theprocess (figure 6.8) are also presented on the stationary state (figure 6.9), althoughthere they are concentrated around sharp profiles.

On figure 6.10 a finer discretization along the y direction can be seen, where 40elements have been used. So now transition is made through eight different elements.

0 0.5 1 0 0.510

0.5

1

1.5

mlss heterotrophic0 0.5 1 0 0.510

0.5

1

1.5

mlss autotrophic0 0.5 1 0

0.510

0.5

1

1.5

bod0 0.5 1 0

0.510

5

10

do0 0.5 1 0

0.510

0.5

1

1.5

Snh

0 0.5 1 00.5

10

1

2

Sno 0 0.5 1 00.5

10

0.5

1

1.5

Xs 0 0.5 1 00.5

10

0.5

1

1.5

Xp0 0.5 1 0

0.510

1

2

Snd0 0.5 1 0

0.510

0.5

1

1.5

Xnd

0 0.5 1 00.5

10

0.5

1

1.5

Salk0 0.5 1 0

0.510

0.5

1

1.5

Si0 0.5 1 0

0.510

0.5

1

1.5

Xi

Figure 6.10: Evolution when oxygen entrance is given on the upper 20% of thedomain, while on the lowest 60% it is not, and on the 20% in between there is atransition, while velocity is increased by a factor 5.

Here oscillation on most of the variables on the transition between both zones,theone with O2 presence and the one without, does not decrease but increase. This re-sults confirm that the oscillation is produced due to the sharp profile of oxygen onthe y direction.

As the element size has been decreased (halved on on y direction), the oxygenprofile is better defined. However, the profile in this direction increases suddenlywith the presence of O2, and the first element affected by it concentrates the main

Page 62: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

60Mathematical modeling of

heterogeneous biological wastewater processes

part of this increase. The smaller the element is, the sharper this variation will be,and this produces the oscillations on all the other variables.

Oxygen discontinuity can be directly related to different relative velocities be-tween oxygen source/reaction term and convective transport. This can be confirmedon figure 6.11, where horizontal velocity has been increased by a factor 5.

0 0.5 1 0 0.5 10

0.5

1

1.5

mlss heterotrophic0 0.5 1 0

0.510

0.5

1

1.5

mlss autotrophic0 0.5 1 0

0.510

0.5

1

1.5

bod0 0.5 1 0

0.510

5

10

do0 0.5 1 0

0.510

0.5

1

1.5

Snh

0 0.5 1 00.5

10

0.5

1

1.5

2

2.5

Sno0 0.5 1 0

0.510

0.5

1

1.5

Xs0 0.5 1 0

0.510

0.5

1

1.5

Xp0 0.5 1 0

0.510

0.5

1

1.5

2

2.5

Snd0 0.5 1 0

0.510

0.5

1

1.5

Xnd

0 0.5 1 00.5

10

0.5

1

1.5

Salk0 0.5 1 0

0.510

0.5

1

1.5

Si0 0.5 1 0

0.510

0.5

1

1.5

Xi

Figure 6.11: Evolution of concentration of each component when oxygen entranceis given on the upper 20% of the domain, on the lowest 60% no oxygen entrance isallowed, while on the 20% in between there is a transition (final dimensionless time= 2.0).

Now oscillations have been widely decreased.

Page 63: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Chapter 7

Conclusions and future work

7.1 Conclusions

In the present master thesis, a new way on the mathematical modeling of wastew-ater treatment processes which occur in subsurface flow constructed wetlands hasstarted to be developed. Mathematical models which already had been used in othercontexts of wastewater treatment, are not much useful for those treatment plants.

From the biological part of the modeling, the Activated Sludge Models fromIWA have been seen as the more adequate ones to express rates. Not only due to itsinternational acceptance and reputation, but also to its presentation, on a clear andworkable matrix. This allows an easily formulation of the components rates. Alsothe use of continuous functions on its process rates helps on the resolution of theequations system.

Although it is a really good model, not all the aspects may help. The worst ofthem is that its process rates are coupled. This leads to more slow resolutions of thesystem. Obviously, as nature processes are coupled, this could not be simplified.

When refereing strictly to the mathematical part of the model, here the finiteelement method has been applied, in contrast from the cases found on bibliogra-phy, where finite differences where normally used [19] [8]. There, normally domain’sdiscretization was made doing partitions in only one axe. In this work, a two dimen-sional section of the whole domain has been used, and its division has been doneon both directions. This may allow a better approximation on the differentiation ofaerobic and anaerobic zones on the wetlands, which is really useful to understandprocess there given.

Page 64: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

62Mathematical modeling of

heterogeneous biological wastewater processes

For the resolution of the spatial discretization, the Galerkin formulation has ap-peared to be a reasonable method to solve it, although a stabilization techniqueis necessary. The three presented on this work (Stream Upwind Petrov-Galerkin,Galerkin-Least Squares and Subgrid Scale) apply same results as they end up withthe same expression due to the election of linear elements for the discretization. Sothe three of them are adequate for the resolution.

Otherwise, on the spatial discretization the Runge-Kutta-Fehlberg method ap-pears to be a good method due to its variable stepsize. The implementation madehere using fourth and fifth order methods should probably be reduced to lower or-der ones. This would lead to a resolution with minor computational cost, althoughdamages accuracy should be studied.

Observing first results acquired, it seems that the model solves the problem ina proper manner. So it can be concluded that the mathematical modeling of theASM1 on a homogeneous domain works properly.

Posterior adaptations to get a more realistic situation, where oxygen’s entranceis only allowed in a part of the domain, have shown spurious oscillations on thediscontinuity produced due to this difference. These can be reduced implementing alinear transition between both zones, although they don’t disappear. Also increasingthe horizontal velocity of the flow reduces their presence.

7.2 Future work

Through all this work, one and two dimension models have been used. Extendingthis to a three dimensional one, although it may bring a bit more of information,does not seem much important. Firstly because its computational cost would in-crease widely, but mainly because much more adaptations should be done before inorder to obtain more realistic values. Lets see some of them that have been outlinedalong the present master thesis.

• Posterior IWA models could be used, either the ASM2, the ASM2d or theASM3.

• Other geometries of the domain, as also flow models, should be considered,attending to more realistic situations.

Page 65: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

• Adsorption could be considered, not only the linear expression but also a morecomplex one which could represent much better this process.

• Other spatial discretization techniques (instead of the GLS, SUPG and SGS)should be proved, in order to avoid instabilities. The Least-squares formula-tion, which has been briefly described on chapter 4 may be a good one to startwith.

• Order of the time discretization schema could be reduced, starting probablywith a Runge-Kutta-Fehlberg 2-3.

• Stabilization of discontinuities produced due to the entrance of oxygen on theheterogeneous domain shall be studied.

• The upper boundary condition for some of the components should be modifiedto represent the fact that some of them escape on a gaseous manner.

• Finally, some more aspects relating to these wetland operation would be nec-essary. Between others hydraulic parameters and deposition of the particulatecomponents.

Although the list seems quite short, there is a lot of work to do, but it seems notonly possible but also useful the use of finite elements method to study this blackbox that subsurface flow constructed wetlands already are.

Page 66: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important
Page 67: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Acknowledgements

I beg your pardon, but on this part I will use catalan, my language and the one Iuse with the people whom I would like to thank. It is not that I don’t want othersto understand this, but just that due to my (poor) English level, these acknowledge-ments would be colder than they should.

Primerament, agrair a l’Agustı Perez Foguet, el tutor, l’esforc i les hores de ded-icacio que ha posat en aquesta tesina, aixı com la seva paciencia en front dels meusdubtes i desconcerts. Ha estat un llarg perıode de treball en que sempre que ho henecessitat m’ha ajudat. Moltes gracies per la teva gran disponibilitat, pel teu treballi per la teva confianca.

Tambe agrair a l’Esther Sala Lardies la seva paciencia en atendre’m cada copque l’Agustı no hi era i algun dubte em sorgia. Moltes gracies per rebre’m sempreamb un somriure i amb molta paciencia.

Es de justıcia agrair tambe en Roger Vilaseca i Cabo, per la seva ajuda inicialen els meus dubtes sobre els EF, i el cop de ma que m’ha donat amb el LATEX2ε.Gracies, tot i que el meu agraıment mes sincer per a tu be tambe despres.

Cal fer un especial agraıment a tots els grans amics que m’han acompanyat enel (llarg) camı que han estat aquests estudis, no nomes els darrers dos anys amb latesina, sino els gairebe 8 anys de carrera.

Primerament als amics de ”la casa”, per les moltes hores compartides a l’Escola,pels moments de nervis (sino histeria) en epoques d’examens, per les hores al bar iles hores de festa, per les esquiades, les hores de biblioteca, les converses intimistes...Gracies per ser com sou i aguantar-me tal com soc, amb les meves desaparicions iel meu magnıfic humor.

Pero tambe als de PACCS que, tot i que de forma mes distant, tambe han patitla meva carrera. I en especial a en Xavi, la Mireia i la Guime per compartir l’estudi

Page 68: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

(i uns quants cafes) al llarg d’aquests vuit anys. Gracies a tots per haver-me acom-panyat en el camı i haver-me deixat ser el vostre intendent.

I com no, a aquells qui han patit mes tant aquests dos anys de tesina com elsvuit d’estudis, la meva famılia. A la tia, pels seus anims. A les meves germanes,l’Ester i la Sılvia, i als meus cunyats, en Marco i en David, pel suport que m’handonat sempre, per la seva voluntarietat i per intentar treure ferro als patiments delsmeus pares. I sobretot als meus pares, que m’han ajudat en tot el que han poguti mes, i han patit cada examen i cada nota tant o mes que jo. Moltes gracies perser-hi sempre i per aguantar totes les meves idees tot i que les trobessiu fora de lloc(per dir-ho finament).

A tots vosaltres, moltes gracies.

Page 69: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Bibliography

[1] J. Bolmstedt and G. Olsson. Exercise 1. control of biological wastewater treat-ment, 2002.

[2] F.L. Burton and G. Tchobanoglous. Wastewater Engineering. Treatment, dis-posal, and reuse. McGraw-Hill, 1972.

[3] I.G. Currie. Fundamental Mechanics of Fluids. Marcel Dekker Inc., New York,third edn edition, 2003.

[4] J. Donea and A. Huerta. Finite Element Methods for Flow Problems. JohnWiley & sons., West Sussex, England, 2003.

[5] R.L. Droste. Theory and Practice of Water and Wastewater Treatment. JohnWiley & sons., 1997.

[6] H. Vanhooren et al. West: modelling biological wastewater treatment. Journalof Hydroinformayics, pages 27–50, January 2003.

[7] M. Henze et al. Activated Sludge Models ASM1, ASM2, ASM2d and ASM3.IWA Publishing, 2000.

[8] Y. Zeng et al. Hydraulic modelling and axial dispersion analysis of uasb reactor.Biochemical Engineering Journal, Vol. 25:113–123, 2005.

[9] Water Environment Federation. Biological Nutrient Removal (BNR) Operationin Wastewater Treatment Plants. McGraw-Hill, 2005.

[10] E. Fehlberg. Low-order classical runge-kutta formulas with stepsize control andtheir application on some heat transfer problems. 1969.

[11] Y. Shen G.F. Carey and R.T. McLay. Parallel conjugate gradient performancefor least-squares finite elements and transport problems. International Journalfor Numerical Methods in Fluids, pages 1421–1440, 1998.

Page 70: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

[12] B. Roig J. Donea and A. Huerta. High-order accurate time-stepping schemesfor convection-diffusion problems. Comput. Methods Appl. Mech. Engrg., pages249–275, 2000.

[13] J. Morato J. Garcıa and J.M. Bayona. Nuevos criterios para el diseno y op-eracion de humedales construidos. Ediciones CPET, 2004.

[14] A. Hernandez Muoz. Depuracion de aguas residuales. Paraninfo, S.A., 1990.

[15] X. Oliver and C. Agelet de Saracıbar. Mecanica de medios continuos paraingenieros. Edicions UPC, Barcelona, second edn edition, 2000.

[16] G. Olsson and B. Newell. Wastewater Treatment Systems. Modelling, diagnosisand control. IWA Publishing, London, 1999.

[17] F.Y. Wang T.T. Lee and R.B. Newell. On the evaluation of the exit boundarycondition for the axial dispersion bioreactor system. Chemical Engineering andTechnology, Vol. 21.

[18] F.Y. Wang T.T. Lee and R.B. Newell. Dynamic modelling and simulation of ac-tivated sludge process using orthogonal collocation approach. Water Research,Vol. 33, No. 1:73–86, 1999.

[19] F.Y. Wang T.T. Lee and R.B. Newell. Dynamic simulation of bioreactor sys-tems using orthogonal collocation on finite elements. Computers and ChemicalEngineering, Vol. 23:1247–1262, 1999.

Page 71: Mathematical modeling of heterogeneous biological wastewater … · 2020-02-12 · 2.2 Biochemical modeling Modeling and simulation of wastewater treatment plants has been found important

Recommended