~
Computers and Chemical Engineering Supplement (1999) S403-S406 «;l 1999 Elsevier Science ltd. All rights reserved
Pergamon
PH:S0098-1354/99/OO145-3
Towards a benchmark for evaluating control strategies in wastewater treatment plants by simulation M.N. Pons', H. Spanjers',U. Jeppssorr' I
Laboratoiredes Sciences du Genie Chimique,CNRS-ENSIC-INPL,Nancy, France 2 AEST, WageningenAgriculturalUniversity, Wageningen,The Netherlands 3 lEA, Lund Instituteof Technology, Lund, Sweden
Abstract A methodology for evaluatingand comparingcontrol strategies forwastewatertreatmentplants wasdeveloped. The performingthe simulationsare outlined. basic setup of the benchmarkis describedand the dynamic input data for Initial results usingdifferentsimulation platforms(Fortrancode, Matlab/Simulinkand GPS-X) are presented.
Keywords: Wastewatertreatmentplant, Benchmarking,Simulation,Controlstrategy Introduction Fortran,etc.) as well as conunercialWWTP simulation Wastewatertreatment plants(WWTPs) are large non- packagescan be used. linear systems subject toperturbationsin flow and load, A typical benchmark run to test. a control strategy together withuncertaintiesconcerning the composition consists of the following steps: of the incoming wastewater. Nevertheless these plants 1. Implementationof the model equations have to be operatedcontinuously, meeting stricterand 2. Verificationof the correctimplementationby stricter regulations. Many control strategies have been means of steady-stateand dynamicsimulations proposed in the literature but theirevaluation and 3. Tuningof the controllers comparison,either in real-lifeapplicationsor based on 4. Assessment of the performanceson the basic control strategy simulations, is difficult. This is partly due to the variability of the influent, the complexity of the S. Developing your own controlstrategy biological and hydrodynamical phenomena and the The purpose of this contribution is to describe the large range of time constants (from a few minutes to simulation part of the benchmark and the test several days, even weeks), but also to the lackof procedures in open-loop scheme to assess the standardevaluation criteria. It isdifficult to judge the correctrJessof the implementation. particularinfluence of the applied control strategy on reported performance increase, because the reference Plantdescription situation is often not optimal. Due to the complexity of A relatively simple plant layout was selected that the systems the effort todevelop alternative control combines nitrificationwith predenitrification,which is approaches is so high that a faircomparison between most conunonlyused for nitrogenremoval (Fig. 1). The different options is very rarely made. Then it remains plant was designed to treat an average flowof 20 000 difficult to conclude to what extent the proposed rrr'.d" with an average biodegradable COD solution is process orlocationspecific. concentrationof 300 mg.l", The plant consistsof a S· To enhance the acceptance of innovating control compartmentbioreactor (6 000 m') and a secondary strategies theevaluationshould be based on a rigorous settler (6 000 rrr').For a sludge concentrationof 3 kg. methodology including a simulation model, plant m" this correspondsto a sludge loadof approximately layout, controllers, performance criteria and test 0.33 kg BOD.l.kg-1 sludge.day"which is quite critical at procedures. IS'C, so that theeffluent compositionis sensitive to the The COST1 682 Working Group No 2 hasdeveloped a appliedcontrol strategy. benchmark for evaluating control strategies for The first two compartmentsof the bioreactorare not activated sludge plants by meanso f simulation. aerated whereas theother three are aerated. All the The benchmarkis a simulation environmentdefining a compartments are considered to be ideally mixed plant layout, a simulation model, influent loads, test whereas thesecondarysettler is modelIed with a series procedures andevaluation criteria. It is not linked to a of 10 layers (one-dimensionalmodel). particular simulationplatform: direct coding (C/C++, A basic control strategy is proposed to test the benchmark.Its aim is to control the dissolved oxygen concentrationin the finalcompartmentof the reactor by manipulationof the oxygen transfercoefficient, and to I
EuropeanCooperation in the field of Scientific and Technical Research
5404
Compu ters and Chemical Engineering Supplem ent(/999) S403-5406
control the nitrate level in the last anoxic compartment Matlab/Simulink/MathWorks, 1995) Matlab and Simulink, its general add-on product for by manipulationof the internal recycle flow rate. modelling andsimulation purposes, is one of the most widely used software packages for numerical calculat ions. A large number of predefined building blocks areincludedin the package,and it is easy for the user to extend thefunctionality of Simulink by adding model blocks of his own. 70000
Q•• Z,
Fig. I: Process layout for thebenchmark. Z representsany concentration. The IAWQActivatedSludge Model no. I (Henze et al., 1987) was chosen to simulate the biological process. It takes into account the aerobic and anoxic growthof heterotrophs, the aerobic growth of autotrophs, the decay of both types of bacteria, theammonificationof soluble organicnitrogenand thehydrolysisof entrapped organics andorganicnitrogen. The double-exponential settling velocity model proposed by ' Takacs et ai. (1991) was selected to describe thebehaviourof the settler. As in many plants, oxygen supply (by means of the oxygen transfer coefficient, kLa), the internaland external recycle flow rates (Qa and Q, respectively) and the waste flow rate (Q...) could be used asmanipulatedvariables . Plant layout, model equations and control strategy are provided on a website (http://www.ensic.unancy.fr/COSTWWTP). The reason to provide a detailed descriptionof the model equationsis to enable the user to implement the simulation model from scratch.
-
- - -.-
-
-
-
-
-,
i $OOOO ! .oooo ~
i :s
300Cl0
20000
tl~I~II~I~IlHIiMI~I'lj~:I'
10000
o - I - - - -__- - - - + - - ~ 10 15 o Tim.
(d~YI)
500 ~-------__r 60 50
. 00
~
;- 300
~
I
200
"
~ 100
o
l~l~kitJjI~rtklllJ4 ..JJ o
10
10
0
IS
Tim. (day.)
Fig. 2: (a) Flow rate, (b)XI and SNU from the storm weatherfile.
In order to obtain areasonable performance of the simulations withMatlab/Simulinkit is recommendedto create S-funct ions(written either as special m-fiIes or C-files), which arecompiled into binarycode. For theopen-loop simulationsa Gear solver (ode51s) is used. A commonly encountered problem when implementing models in MatIab/Simulink is the occurrence of algebraic loops. The problem appears when there is direct feedthrough of a variable and an output of one model block is at the same instant an input to a 'previous'model block in the same system (by means of a feedback loop) . This is often the case for flow rates in wastewaterapplicationsdue to the useof Platforms direct feedbackof the internal andexternalrecirculation The benchmarkcan be run on anysimulationplatform. flows to the previous biological reactors. One possible As examples of the different poss ibilities, the direct work-around is to add afirst-orderfunction for the flow implementation in FORTRAN, the use of a general rates within eachreactor(i.e. l/(l+sT) with a small time simulat ion package (MatIab/Simulink) and of a constant). The effects on themodel behaviourwill be commercial WWTP simulation package (GPS-X) are negligible but it maygreatly improve'the performance describedbelow. of the simulation. FORTRANcoding GPS-X(Hydromantis, Hamilton, Canada) Gear's method (Gear, 1971) (routines from the GPS-X is a modular, multi-purposecomputerprogram Harwell's library) is used for integrationof the set of for thesimulationof wastewatertreatm ent plants . In this 145 differential equations, coded in FORTRAN 90 program the user has access to the process segment of (Digital) . the source code so thatmodels can be modified, which may be necessary in order to implement the exact benchmark. In the GPS-Xsimulationstoo, Gear'sstiff is selected as theintegrationalgorithm. Influentload The influentcharacteristicsare available from three files based on different weather conditions. Each file starts with one week of dry weather, and then one weekof either dry weather, storm events or a long rain. The weekend effect on influent flow and composition is taken intoaccount(Spanjerset 01., 1998). The time step is 0.25 hr. Every controlstrategyshould be tested using each of these weather files. Some variables from the storm weather event influent data are represented in Figure 2..
5405
Computers and Chemical EngineeringSupplement (1999) S403-5406
therefore, 10 times the largest time constant of the Results system. Figure 3 depicts theconvergence rate of the Steady-state evaluation In order for the user to check thecorrectness of the nitrogenconcentrationin the 5th compartment. implementation,the benchmarkis run first inopen-loop Fortran Layer GPS-X Matlab (i.e. no active controllers)with constantinputs for flow rate andconcentrations(load-averagesvalues from the 6341. 6335. 6530 1 (bottom) dry weather influent files) and with fixed manipulated 354. 354. 674. 2 variables for the internal recycle flow and the oxygen 354. 354. 354. 3 transfercoefficient in the lastaeratedcompartment.The 354. 354. 354. 4 steady-state values obtained after 100 days of 354. 354. 354. 5 simulationare compared. Tables 1 to 3 provide someof 354. 354. 354. 6 the key variables for the three platforms. 65.2 68.7 68.7 7 29.5 29.5 25.8 8 Variables(2"") GPS-X Matlab Fortran 18.1 18.1 14.3 9 l S/(g.m· ) 30. 30. 30. 10 (top) 12.4 12.4 8.45 l 1.16 1.16 1.08 Ss(g ·m· ) Table 3: Steady states values for totalsuspendedsolids 1180. X/(g.m·l ) 1150. 1149. (i.e. sum of all X-variables)in the settler obtainedafter 102. 111. 111. Xs(g·m·') 100 days. 2510. 2540. 2509. XB•II(g·m") 207. 142. 142. XB.A(g.m") These results have been obtained with the Fortran Xp(g.m·') 441. 454. 441. coding. The initial values werereasonablevalues, which O. O. O. So (g.m") could be guessed by a user having some general 4.37 1.95 1.94 S",o(g·m") knowledge about thebehaviourof WWTP's. For most 12.2 12.2 10.7 S,.w(g·m·l ) state variables 50 to 60 days seem to be sufficient to 0.73 0.692 0.691 S",o(g·m·l ) reach steady state, corresponding to five. times the largesttime-constant.In any case theconvergence rates 7.19 6.62 7.2 x,"o(g.m·') are zero at 70 days. 5.30 5.57 SALdmo1.m·l ) Table 1: Steady states values In second anoxic 2$£-eJ . . - - - - - - - - - - - , compartmentobtainedafter 100 days. Variables (5th)
GPS-X
Matlab
Fortran
~
z.oce-oa
~
1,5CE-e3
€
1,0C£-C3
30. 30. 0.896 0.87 1149. 1180. 54.9 49.8 2550 2526. 144. 210. 459. 445. 1.85 0.483 So 15.2 12.7 S.\·o 0.11 1.44 S.\·H 0.71 0.700 S.\·o 3.60 3.95 x,\,o 3.77 4.04 SALK Table 2: Steady states values In final aerated compartmentafter 100 days.
To speed up the stabilisation,steady-state values after 100 day!!'were stored and reused as initial values. In that case the steady state was obtainedafter 10 days (i.e. one sludge age) (Figure 4) and thesteady-statevalues were exactly the same as those obtained with a 100 days stabilisationperiod.
Matlab/Sirnulink and GPS-X provide very similar results. Alkanity is not considered here in GPS-X. The Fortran code providesgenerally similar results to the two other platforms,althoughlarge discrepanciescan be found forS.\·o in the second anoxic compartment,So and S"'II in the final aeratedcompartment,and XB..~ in all compartments. No clear explanation for these discrepancieshave been found so far.
Use a/weatherfiles Once the steady-statevalues in open loop scheme have been checked, the dry weather file is used to test the effect due to dynamics, again in open loop with fixed manipulatedvariables and using the 100 dayssteady of state as the initial states. Figure 5 shows the results some key variablesobtainedfrom simulationof the first eight days of the dryweatherfile.
Sf Ss X/ Xs XB•H XB,A XI'
30. 0.896 1150. 54.9 2530. 145. 445. 0.482 12.7 1.45 0.701 3.95
One important point is theinitialisationof the variables: a bad initialisation affects the results and makes comparison impossible. The sludge age of the benchmarkplant is about 10 days: 100 days represent,
•
~
~ 5.OCE..o.& u
O.OOE-00 ¢<::;::;:>"'~~*"'.o--o--o--o--O-'"9
-5.00E-04 .L-
,0
eo
--'
Tlmeld'rl
Fig. 3: Convergencerate in final aeratedcompartment (0) Sso, (0) SSH'(O)S",o.
S406
Computers and Chemical Engineering Supplement(1999) S403-5406
Takacs I., Patry G.G. and Nolasco D. (1991) lVat. Res. 25 (10)
O.OOE+OO
1263.
a
f:y~J\/t'\r~~J(
~: .,(~,}))
·2,50E-C2 - I - ' ' - - - - + - - - - - - - ! - - - - - - l 15 o '0
u
Timlld.1ysJ
Fig. 4: Convergencerate of suspendedsolids in recycle flow for the initialisationwith saved steady-statevalues. Time (day.)
b
Conclusions The advantages of performing benchmarksimulations for evaluatingand comparingdifferentcontrolstrategies for wastewater treatment plants have been discussed. Initial results using three differentsimulationplatforms have been presented. The steady-state results of the implementationin Matlab/Simulinkand GPS-X are in good agreement. However the results of the Fortran simulations deviate up to 125% from those of the other platforms. Actual work is directed towards the understanding of the discrepancies, and the development of the evaluation criteria for the control strategies. Notations Alkalinity (mol.m" SI Soluble inert organic matter (g.m" S.VD Soluble biodegradable organic nitrogen (g.m? S."H NH/ + NHJ nitrogen (g.m" S,,·o Nitrate and nitrite nitrogen (g. in') So Dissolved oxygen (g.m? Ss Readily biodegradable substrate (g.m" Xs A Active autotrophic biomass (g.m" XS:H Active heterotrophic biomass (g.m? XI Particulate inert organic matter (g.m? X.VD Particulate biodegradable organic nitrogen
3000 r - - - - - - - - - - - - - - , 2500
~
2000
~~
1500
J
1000 500
XB,A
o t:::::==:;:::::==::;:::::===+=:::::::~
o
Tim. [doysj
c
18 r - - - - - - - - - - - - - - , IS
"
SALK
•
Time (doysj
d
rocco , - - - - - - - - - - - - - - - - ,
(g.m?
Xp
Xs
Particulate products arising from biomass decay (g.m" Slowly biodegradable substrate (g.rn?
Acknowledgements TOrecei~rt,I body ~ayer 10) The authors wish to thank the COST Program. The paper is the outcome of the fruitful work of COST 682 Working Group No 2: J. 1 +---+----+----+-----1 Alex, JF Beteau, B. Carlsson, J. Copp, D. Dochain, E. Dernokos, B. • 6 o Gioli, C. Hellinga, S. Isaacs, U. Jeppsson, A. Karpati, K. Keesman, Tim. (days! N. Hvala, S. Marsili-Libelll, M. Nielsen, G. Olsson, X. Ostolaza, M. Pelkonen, M.N. Pons,\Y. Rauch,C. Rosen, HR Siegrist, H. Spanjers, Fig. 5: (a and b)second anoxic compartment,(c) final J.P. Steyer,H. Vanhooren,P. Vanrolleghem,M. Zec. aeratedcompartment;d: settler. Results obtainedwith
References Gear, C.W. (1971), Numerical initial-value problems in ordinary differential equations, Prentice-Hall, Englewood Cliffs, Nl Henze M., Grady C.P.L.lr., Gujer W., Marais G.v.R. and Matsuo T. (1987), Activated Sludge Model No. J. IAWPRC Scientific and Technical Reports No.1., London, UK MathWorks.(1995), Simulink"• Dynamic System Simulation Software, User's Guide. The Mathworks, Inc., Natick, Massachusetts,USA Spanjers H., Vanrolleghem P.A., Nguyen K., Vanhooren H., Patry G.G.(1998), IVai. Sci. Tech. 37 (12J.219
Matlab/Simulink.