CHAPTER 1                 


Modelling Fundamentals

Introduction to Modelling and Simulation

The purpose of this chapter is to provide a basic introduction to modelling and simulation. This chapter will serve to establish the basic definitions for terms that will be used throughout the technical reference. In addition, emphasis will be placed on the advantages of simulation.

When speaking about modelling and simulation, the following terms are often used:

·         System

·         Experiment

·         Model

·         Simulation

System

A system is a set of interdependent components that are united to perform a specified function.

In a general sense, the notion of a system may be defined as a collection of various structural and non-structural elements which are interconnected and organized to achieve some specified objective by the control and distribution of material resources, energy, and information. (Smith et al., 1983)

One of the basic aspects of a system is that it can be controlled and observed. Its interactions with the environment fall into two categories:

1.       Variables generated by the environment that influence the behaviour of the system (called inputs).

2.       Variables that are determined by the system that in turn influence the behaviour of the environment (called outputs).

Accordingly, a system is a potential source of data in that inputs can be defined and observation of the behaviour of the system can be made.

Experiment

An experiment is the process of extracting data from a system through the manipulation of the inputs.

Experimentation is probably the single most important concept of a system as it is through experimentation that we develop a better understanding of the system. Experimentation implies that two basic properties of a system are being used:

1.       Controllability, and

2.       Observability

To perform an experiment implies the application of a set of external conditions as the inputs of a system (i.e., the accessible inputs) and observing the reaction of the system by recording the behaviour of the outputs (i.e., the accessible outputs). This is where some of the advantages of a system begin to appear. One of the major advantages of experimenting with a "simulated" system as opposed to the "actual" or "real" system, is that real systems are usually under the influence of many additional inaccessible inputs (i.e., disturbances) and that many useful outputs may not be available through measurement (i.e., they are internal states of the system).

One of the major motivations for simulation is that in the simulation world, all inputs and outputs are accessible. This allows the execution of simulations that lie outside the range of experiments that are applicable to the real system.

Model

A model is an abstraction of a system. One definition of a model is: A model is an approximation of a system to which an experiment can be applied to answer questions about the system.

A model does not imply a computer program. We should be clear to distinguish between a model and a computer program. A model could be a piece of hardware or simply an understanding of how a system works. Models are often coded into computer programs.

Why is Modelling Important?

Modelling means the process of organizing knowledge about a given system. By performing experiments, knowledge about a system is gathered. In the beginning, the knowledge is unstructured. By understanding the cause-and-effect relationships and by placing observation in both a temporal and spatial order, the knowledge gathered during the experiment is organized. Thus, the system is better understood by the process of modelling.

Simulation

Simulation is to a model what experimentation is to a system.

Again, many different definitions exist for the term “simulation”. One of the simplest definitions is: A simulation is an experiment performed on a model Again, this does not imply that the simulation is performed on a computer; however, the vast majority of engineering simulations are performed using a computer program. A mathematical simulation is a coded description of an experiment with a reference point to the model to which this experiment is to be applied. The goal is to be able to experiment with models as easily and conveniently as with real systems. It is desired to be able to use the simulation tools as easily as a control chart in the operation of a facility.

While the scientist is normally happy to observe and understand the world, that is, creating a model of the world, the engineer (applied scientist) wants to modify it to his/her advantage. While science is analysis, the essence of engineering is control and design. Thus, simulation can be used for analysis and design.

Why is Simulation Important?

Besides experimenting with the real system, simulation is the only technique available for the analysis of arbitrary system behaviour. The typical scenario of scientific discovery is as follows:

1.       Perform an experiment on the real system and extract data to gather knowledge (understanding of the cause-and-effect relationship of the real world).

2.       Postulate several hypotheses related to the data.

3.       Simplify the problem to help make the analysis tractable.

4.       Perform several simulations with different experimental parameters to verify that the simplifying assumptions are justified.

5.       Analyze the system, verify the hypotheses, and draw conclusions

6.       Simulations are performed to draw conclusions.

Simulation Tools

A wide variety of simulation tools are available to help you in this task. Assuming the reader is particularly interested in the dynamic modelling of wastewater treatment, the tools appropriate for this task are emphasized.

The process of dynamic modelling of facilities involves the solution of thousands of coupled nonlinear ordinary differential equations. The formulation and solution of this type of problem is facilitated using Continuous Simulation Languages (CSL). CSLs date back to the late 1960s when IBM introduced the language called CSMP (Continuous System Modelling Program). Of the number of very specialized simulation languages that are available, GPS-X uses ACSL for conducting simulations.

Benefits of Mathematical Modelling

Mathematical models assist in developing a thorough understanding of the behaviour of a system and in evaluating various system operating strategies. A proposed system can be evaluated without building it. Experiments can be conducted on a costly or unsafe system using a model rather than disturbing the real system.

Why COD is Important to Know

One of the most important ways to check the operation of a wastewater treatment plant, the consistency of the analytical procedures and the integrity of the mathematical model is to perform mass balances around the system for the different compounds. This task is not always simple as components transform into other substances, while bacterial cells grow, respire and decay.

Regarding the organic substances, a commonly measurable parameter is the Chemical Oxygen Demand (COD). We could measure organic carbon as Total Organic Carbon (TOC) in the plant, but we would miss the fraction which was removed in the form of CO2 gas after oxidation. It is difficult to determine the oxygen requirement based on TOC, as different substances require different amounts of oxygen depending on their chemical composition. The influent wastewater is truly a non-homogenous mixture in this respect.

We could measure the 5-day Biochemical Oxygen Demand (BOD5) and suspended solids as most plants in North America do. Suspended solids have the same problem as TOC with respect to oxidation. BOD5 seems to give relevant information, but it is inappropriate for continuous monitoring, and the accuracy of the results is not comparable to other analytical methods. BOD5 measures only the part of organics which were used for respiration in the BOD test during the 5-day interval and does not give information about the amount converted into bacterial cells. Ultimate BOD (BODu) corrects this problem but the required analytical time and sometimes the accuracy is unacceptable. The BOD test completely ignores a very important fraction of the influent wastewater (inert particulates), which contributes in a major way to excess sludge production.

COD overcomes the above-mentioned problems. It can be automated and measures all organic fractions of the wastewater. The sludge COD can also be easily determined. COD measures all organics in oxygen equivalent; that is the electron donating capacity of the organic matter. This way it provides a direct link between organic load and aeration requirement. The yield constant is truly constant only if expressed in COD units. Mass balance is easy to establish with COD in a non-nitrifying plant: at steady state, the influent COD must equal the sum of the effluent COD, the COD of the wasted sludge, and the oxygen consumed in the degradation of organic matter.

It is for this reason that the International Association on Water Quality (IAWQ) committee selected and endorses the use of COD as a measure of organic parameter in simulation of activated sludge plants.

Data Requirements

For modelling purposes, each unit process/operation is represented by a process model (mathematical model) that reflects the dynamic behaviour of that process. One of the main features of GPS-X is that it is model-independent, meaning that GPS-X is not limited to a specific process model. Accordingly, a variety of modelling approaches (process models) are available within GPS-X to handle a specific unit operation or unit process. For example, the activated sludge process can be modelled using any one of the following GPS-X activated sludge process models:

·         IAWQ Task Group models of the activated sludge process (Henze et al.,1987a; Henze et al., 1994; Henze et al., 1998)

·         The general (bio-P) model (Dold, 1990, Barker and Dold, 1997)

·         Extended IAWQ (Mantis), described in Mantis Model (MANTIS) section of 0

·         Comprehensive plant-wide model developed by Hydromantis/Hatch (Mantis2/ Mantis3)

Consequently, a general calibration/verification approach to GPS-X must be broadly defined. The calibration requirements of individual process models are established based on the nature of each model (i.e., its mechanistic basis). Alternatively, modellers may need to refer to the original literature reference to assess the calibration requirements of a particular model in more detail.

Each calibration/verification study follows the same general principles. Accordingly, the purpose of this section is to provide some guidelines pertaining to the calibration of the models to full-scale wastewater treatment plants. The most popular process models have been selected for illustration purposes, including the IAWQ Task Group Activated Sludge Model No. 1 (Henze et al., 1987a) and layered settler model developed by Hydromantis /Hatch (Takács et al., 1991).

Overview of Data Requirements

In general, modelling of large-scale wastewater treatment plants requires that an extensive number of plant and model parameters be assessed. Many parameters can be measured directly, while others are based on experimental data taken from the literature. Those parameters that cannot be measured directly or estimated from the literature are usually determined using nonlinear dynamic optimization techniques based on actual plant records and/or experimental data collected at the plant or in the lab. It is recognized that the reliability of the calibrated model degrades with increasing numbers of mathematically optimized parameters.

Data requirements fall into one of the following categories:

1.     Physical plant data, including Process flow sheet (flow lines, channels, recycle lines, by-passes, etc.); Flow pattern (plug flow, Continuously Stirred Tank Reactor (CSTR), etc.); Sludge collection and withdrawal locations (location, how? when? etc.);Dimensions of the various reactors (length, width, depth).

2.  Operational plant data, including Flow, Control variables (independent variables), and Responsive variables (dependent variables).

3.  Influent wastewater characteristics, including Basic water quality parameters, influent organic fractions, and influent nitrogen fractions.

4.  Kinetic and stoichiometric model parameters for organic, nitrogenous, and phosphoric compounds and settling parameters (primary and secondary).

5.   Some of these data and/or parameters vary over the course of a day (i.e., subject to dry-weather diurnal variations or during a storm even), while others remain relatively constant.

Physical Plant Data

Elements of this data group are generally easy to obtain from plant blueprints and operation manuals. It should be remembered that the physical volume of a reactor is only an approximation of the active or operational volume of the unit. In a well-designed system the effect of dead-space and hydraulic short-circuiting is normally minimal. In other cases, it may be necessary to determine the true hydraulic characteristics of a particular unit process, as in the case of a quasi-plug flow aeration tank. In this case, a dye-test is normally required, as the number of CSTRs becomes a model parameter.

System Configuration

The General-Purpose Simulator can handle practically any flow scheme. Based on our experience it is very important to identify as closely as possible the hydraulic characteristics of a plant, including plant by-passes, overflows, flow splits and combiners, proportional, constant or SRT driven sludge wastage, etc. Parallel trains, multiple units and plug flow systems are easily simulated, but should be simplified where possible (unless the supporting data required for calibration is available).

Operational Plant Data

Flow Control Variables (Independent Variables)

This is an important data group. For example, if the aeration capacity is not known (or cannot be estimated from the aerator power or other means), then the correct dissolved oxygen (DO) level can be set by either changing the KLa or some stoichiometric or kinetic parameters (yield coefficient, growth rate, etc.). This makes the correct estimation of those parameters difficult. Similarly, model parameters having a strong effect on the aeration tank Mixed Liquor Suspended Solids (MLSS) are difficult to estimate when the wastage rate is not known.

Activated Sludge Response Variables

MLSS, Volatile Suspended Solids (VSS), COD of the mixed liquor, DO, and Oxygen Uptake Rate (OUR) are required to calibrate the activated sludge portion of the model. The importance of COD was discussed in Why COD is Important to Know. In general, the stoichiometry of the mixed liquor (% VSS and COD/MLSS) is relatively constant over time and can be assessed occasionally during a calibration/verification study, e.g., on a monthly or bi-weekly basis. However, the other parameters are generally dynamic, following the diurnal patterns of the plant.

It is important to be able to perform a solids mass balance around the system. Accordingly, the sludge blanket height (and preferably the solids concentration profile) and underflow solids concentration are required to calibrate the settler portion of the model.

Primary and Final Effluent Response Variables

Water quality constituents such as BOD5 (inhibited), Total Suspended Solids (TSS), Total Kjeldahl Nitrogen (TKN), ammonia (NH3) and nitrates (NO3) are necessary for the calibration of the various unit processes. For example, BOD (in lack of COD) is used to calibrate and verify the carbonaceous component of the IAWQ activated sludge model, while suspended solids measurements can be useful in identifying the settling parameters of Hydromantis/Hatch’s layered settler model. The nitrogenous compounds are needed to calibrate the nitrification-denitrification component of the model.

Influent Wastewater Characteristics

Basic Parameters

Basic influent wastewater characteristics such as BOD5, BODu, COD, TSS, VSS, and TKN are important to know in that they allow us to establish mass balances across the system. The biochemical oxygen demand (BOD) provides only partial information on the influent organic load (see Why COD is Important to Know). COD measurements are not readily available in some wastewater treatment plants. In this case, the BOD5/BODu ratio can better estimate the influent organic load. Suspended solids, influent VSS and BOD together, can be used to determine the different influent organic fractions, which are critical for the proper use of the IAWQ activated sludge model, as discussed in GPS-X Objects. Influent TKN is generally more useful than ammonia concentration alone

Biological Reactor and Final Settler

Organic Compounds

The IAWQ activated sludge model contains many stoichiometric and kinetic parameters, which describe the degradation of organic matter in the activated sludge process (Henze et al., 1987a). Some of the analytical tests are laborious and are not discussed here. Many of the default model parameters can be used with a high degree of confidence. Site-specific model parameters include the maximum growth rate and the yield coefficient of the heterotrophs. If the data described in the previous sections are known (e.g., sludge wastage rate and wastewater influent fractions), it is relatively easy to optimize the maximum growth rate and yield coefficient of the heterotrophs to match the measured MLSS, sludge production, and oxygen uptake rate.

Nitrogenous Compounds

Based on our experience, the most important parameter to calibrate in the IAWQ model is the autotrophic growth rate. It is possible to calibrate this parameter using field ammonia and nitrate data, if:

1.       The plant is not overloaded, i.e., the plant is at least partially nitrifying; or

2.      The plant is not seriously under loaded. In such a case, almost any value of the growth rate constant (typically between 0.2 and 0.5 d-1) will provide complete nitrification.

The autotrophic growth rate is easier to identify in a partially nitrifying plant. Process start-up data (i.e., corresponding to a slowly developing nitrifier population) can sometimes be used. Laboratory testing (oxidation of an ammonia spike) is also a possibility.

Settling Characteristics (Primary and Secondary)

The settling velocity function in Hydromantis/Hatch's layered settler model contains five parameters, which must be determined separately for the primary and the secondary clarifiers. A preliminary version of the model is described in detail elsewhere (Takács et al., 1991). The model is based on the use of a unified settling velocity equation described in CHAPTER 8. The parameters of the settling velocity equation can be estimated from a combination of experimental and numerical procedures.

A short summary of the proposed experimental procedures is given below for each parameter:

·         Minimum solids attainable – In general, this parameter for final settlers is usually less than 10mg/L. For most plants, amin will be close to zero. A sludge sample is allowed to settle for about two hours. The suspended solids concentration of the supernatant is measured and equated to xmin. Alternatively, xmin can be said to be equal to the suspended solids concentration take from the final settler under dry-weather flow conditions when the hydraulic load to the plant is minimal.

·         Maximum floc settling velocity parameter – Dilute the activated sludge to 1 - 2 g/L, measure the settling velocity of large individual floc particles in a batch test. In general, no floc particle will settle faster than the settling velocity of individual floc particles under quiescent conditions.

·         Vesilind zone settling parameters – These two parameters give the settling velocity of the sludge in the hindered settling zone (exponential portion of the curve). They can be determined through a series of column tests (Vesilind, 1968).

·         Flocculant settling parameter – If all the above settling parameters are known, then this one is generally easy to estimate by fitting the simulated effluent suspended solids simulations to observed data.

Alternatively, settling velocity model parameters can be estimated using a time-series of influent and effluent (overflow and underflow) suspended solids. The non-linear parameter optimization procedure available in GPS-X can be used effectively in this case.

pH Dependent Bacterial Growth Model

The effect of pH on the overall oxidation process is normally associated with specific enzymatic processes. Over some pH range for each enzyme the activity approaches a maximum and falls off above or below this range (Eckenfelder and O’Connor, 1961). The pH may also affect substrate availability for some of the bacterial species. It is now well accepted that both ammonia-oxidizers and nitrite-oxidizers utilize unionized forms of NH3 and HNO2, respectively. The pH is also suggested to affect the process stoichiometry. For example, under anaerobic metabolism of PAOs, the ratio of P-released/COD-uptake depends on the pH of the system (Smolders).

Most bacteria cannot tolerate pH levels above 9.5 or below 4.5. Generally, the optimum pH for bacterial growth lies in the range of 6.5 to 7.5 (Metcalf and Eddy). Nitrification is pH sensitive, and rates decline significantly at pH values below 6.8. At pH values between 5.8 and 6.0, the rates may be 10 to 20 percent the rate at a pH value of 7.0. Optimal nitrification rates occur at pH values in the 7.5 to 8.0 range (Metcalf and Eddy). No significant effect on the denitrification rate has been reported for pH values between 7.0 and 8.0. At pH values below 6.5, phosphorus removal efficiency is greatly reduced (Metcalf and Eddy, orig. Sedlak 1991). Anaerobic processes are sensitive to pH. A near neutral pH value is preferred as methanogenic activity is inhibited below a pH of 6.8.

 In addition to the effect of pH on microorganism growth rates, extracellular hydrolysis may also be inhibited at either high or low pH values and is probably caused by partial denaturation of enzymes (Batstone et al.). Boon (1994) demonstrated the effect of batch digestion on primary sludge and showed optimal hydrolysis at pH 6.8, with minimal changes between pH values of 6.5 and 7.5. Veeken et al. (2000) and Sanders (2001) have studied the pH inhibition functions for hydrolysis.

pH Dependency Model

A Michaelis function, which is used to model the effect of pH on enzymatic reactions (Segel, 1975), was used by Estuardo et al. (2008). The function is as shown in Equation 1‑1, rearrange in Equation 1‑2.

Equation 11

image

Equation 12

image

Where:

image          = the rate at a given pH

image     = the maximum rate at the optimum pH

image     = the hydrogen ion concentration

image       = the lower proton concentration where r is equal to image

image       = the higher proton concentration where r is equal to image

The optimum pH corresponding to the maximum value of  image can be estimated using Equation 1‑3.

Equation 13

image

A drawback of this model is when the values of image and image are less than 3.5 units apart, the ratio of imagedoes not equal 1 at the optimum pH.

Equation 1‑2 was modified by Glass et al. (1997) introducing a correction factor in the original equation:

Equation 14

image

The value of “A” is calculated in such a way that at optimum pH (image), image becomes 1.

An expression for A in Equation 1‑4 was defined by Batstone et al. (2002) to define Equation 1‑5 which was first used in Angelidaki et al. (1999).

Equation 15

image

The modifications made to Equation 1‑5 corrected the problem image not approaching the value of 1 at the image, however, in the above equation, values calculated at imageand pKs2 no longer represented the values at 50% inhibition.

While developing an extension to ASM2d to include pH calculations, Serralta et al. (2004) proposed a pH dependence function for PAOs. The proposed function, Equation 1‑6, was a combination of Monod inhibition and inhibition kinetics for pH.

Equation 16

image

The imagewas analytically estimated in such a way that for a given imageand image, the value of imageequates to 1. The expression for imageis shown in Equation 1‑7.

Equation 17

image

The main drawback of this model is that KH and KIH do not represent any specific inhibition conditions (e.g., 50% inhibition).

Henze et al. (1995) proposed Equation 1‑8 to handle the effect of pH on biological growth. Van Hulle et al. (2004) and Magri et al. used this function to model the effect of pH in SHARON process.

Equation 18

image

The function is one side bounded. At pH = image the function gives a value of image=1. The drawback of Equation 1‑8 is that it is not bounded by the maximum value of 1. Moreover, image is more like a fitting parameter and do not have any physical interpretation.

While modeling the anaerobic digestion process, Siegrist et al. (1993) and Mosche and Jordening (1999) proposed a pH influence model using a non-competitive inhibition by image and image ions. The pH effect terms used in the proposed model are shown in Equation 1‑9.

Equation 19

image

image and image represent the upper and lower inhibition pH at which the inhibition activity is 50%. This function is not bounded and the maximum values at image depend on the chosen values of image and image. Further, the calculated value of I significantly deviate from the 50% value for pH = image and image if the difference between the image and image values is lower than 2 units.

Ko et al. (2001) proposed a pH inhibition effect on activated sludge using a pseudo toxic concept model.  The model equation proposed can be seen in Equation 1‑10.

Equation 110

image

image, and image are empirically determined. Experimental studies found image and image were 0.748 and 6.77 under acidic conditions and 1.194 and 7.8 under basic conditions. The major deficiency of the model is that the coefficient values depended on the pH it is applied to. For example, for acidic and basic range applications will require different coefficient values Additionally, to address the maximum activity between a pH range, an additional equation to set the value to 1 will be required.

ADM1 (Batstone et. Al) applies pH correction in the kinetic equations for:

1)    Acidification of sugar (reaction 5) image 

2)    Acidification of Amino acids (reaction 6) image

3)    Acidification of fatty acid image

4)    Acetogenesis of propionate image

5)    Acetoclastic methanogenesis image

6)    Hydrogentrophic methanogenesis image

In reactions 1, 2, 3 and 4 only the low-end pH inhibition is used, while for reaction 5 and 6 both sides of the inhibition function are used. Use of the pH inhibition models is illustrated in Equation 1‑11 and  Equation 1‑12. Equation 1‑11 applies pH inhibition correction only below the low pH threshold. Equation 1‑12 applies pH inhibition in both high and low pH ranges.

Equation 111

image

Equation 112

image

Equation 1‑12 was proposed by Angelidaki et al. (1999). The model parameters suggested for acetogenesis and acetoclastic methanogenesis are image = 6.0 and image = 8.5, which differ from those in ADM1.

The above review suggests that there is no specific pH model which meets all the following requirements:

1.       Bounded with maximum values of 1 at an optimum temperature.

2.       Achieve a specified inhibition (50%) at the upper and lower image.

3.       Possible to have asymmetric curve

4.       Flat top for a specified range of pH

The model proposed by Siegrist (1993) best meets the above requirements if the difference between the upper and lower pH values is more than 4 units.

Park et al. (2007) presented a pH dependence model for the maximum specific growth rate of nitrifiers. They proposed an empirical bell-shaped model considering a cosine function. The model shown in Equation 1‑13 and Equation 1‑14.

Equation 113

image

Equation 114

image

Piece-wise linear model (Model implemented in GPS-X)

A piece wise empirical model may be used to better describe the experimentally observed pH inhibition terms. The model can be constructed with four parameters: the low and high image at which 50% inhibition occurs (image, image) and the low and high image for maximum activity (image and image).  A visual representation of the piece-wise linear model is shown in Figure 1‑1 and the corresponding equations are shown in Equation 1‑15, Equation 1‑16, and Equation 1‑17.

image

Figure 11 - Piece-Wise Linear pH Model.

Equation 115

image

Equation 116

image

Equation 117

image

A pH correction factor is applied in all the bacterial growth equations. Based on the evidence in literature, the hydrolysis process is also pH dependent. The pH correction factor used for heterotrophic growth is used in the hydrolysis equation. Although, bacterial decay rate depends on the pH, no additional pH correction is applied for decay reactions. It is assumed that correction applied in growth rate kinetics is the combined correction for growth-decay process.

A Typical Calibration Event

In an ideal case all the physical, operational, and influent parameters are known for the given wastewater treatment plant, while some of the most important kinetic, stoichiometric and settling parameters are experimentally determined. In such a case the modeller estimates the missing parameters using defaults at the beginning, then modifying those which need adjustment and observing the response of several system output variables.

It is possible to start with a steady-state calibration, i.e., taking the dry weather days from a daily log of the treatment plant and optimizing for the average of these values. Averages, which contain high flow periods (typical monthly or yearly averages), should not be used for steady-state calibration.

Dynamic calibration should follow with typical diurnal data or selected high disturbance (storm flow) events. The larger the scale of the disturbance between reasonable limits, the more sensitive the calibration procedure will be. Hydraulic shocks are usually ideal for settler calibrations, while diurnal data, process start-up, or recovery is better for calibration of organic degradation and nitrification.

One fully documented event gives reasonable confidence for the given conditions (flow, temperature, influent composition, etc.). If the model is to be used under varying conditions, the above procedure has to be repeated accordingly (i.e., winter, summer, dry weather, wet weather, etc.). Verification means simulating a dynamic event with a given calibrated set of parameters, without modifying those, and finding reasonable accordance of simulated data with the measurements.

A few or several parameters may be missing from the physical, operational and influent group. This does not make calibration/verification impossible, as the interdependencies in a treatment plant are complex and default values are relatively well known.  Reasonable estimation of unknown parameters is sometimes possible. In the case of underflows, the solids mass distribution between the aeration tank and the settler depends largely on the recycle flow. Knowing aeration tank MLSS and underflow concentration (maybe sludge blanket height), the missing value can be recreated by numerically fitting these variables as a function of the underflow. However, with increasing number of such optimized parameters the confidence in the predictions of the model erodes.