Comparative Study of Balancing SRT by Using Modified ASM 2 d in Control and Operation Strategy at Full-Scale WWTP

Detailed knowledge on the composition of the influent going into the wastewater treatment system is essential for the development of a reliable computer model. In the context of WWTPs (wastewater treatment plants), the wastewater characteristics are not only important for activated sludge system modelling, but also have an impact on the appropriate control of single unit operations. The aim of this study was to evaluate the concepts of COD (chemical oxygen demand) fractionation measurement in municipal wastewater with a respirometric method in control, and modelling the biological treatment processes at WWTP using the modified Activated Sludge Model no. 2d (ASM2d) developed by Drewnowski and Makinia. The batch OUR (oxygen uptake rate) test results and COD measurements obtained at BNR plant (96,000 m3/d) in Gdansk (Poland), were compared and evaluated with the main BNR (biological nutrient removal) WWTP (144,000 m3/d) located in Malaga (Spain). Respirometric tests and COD fractionation provided the experimental database for the comparison of the wastewater characteristics and model predictions at both large WWTPs. Some parameters, such as the heterotrophic growth yield (YH) coefficient, required calibration/validation of the range (YH = 0.64 and 0.74 gCOD/gCOD for Gdańsk and Malaga WWTP, respectively) to fit the modified ASM2d. The crucial issue when dealing with the newly developed model and proposed wastewater characterization for both study plants were extremely low and high values of the XS/XI ratio, which can be used to control full-scale WWTP and balance the solid retention time (SRT) in activated sludge systems.


Introduction
The introduction of activated sludge modelling into the engineering practice was a breakthrough in wastewater treatment, which resulted in a significant improvement of the design, operation, and monitoring of many wastewater treatment plants (WWTPs) [1][2][3].It constitutes an indispensable tool that could provide efficient and low-cost treatment under variable environmental conditions [4][5][6].However, one of the major problems in Activated Sludge Models (ASMs) is their successful calibration, defined as the adaptation of the general model to fit a certain set of information obtained for a particular wastewater treatment plant [6,7].Detailed knowledge on the composition of the influent going into the wastewater treatment system is essential for the development of a reliable computer model.In the context of WWTPs, the wastewater characteristics are not only important for activated sludge system modelling, but also have an impact on the appropriate control of single unit operations [8,9].The kinetic and stoichiometric coefficients as well as COD fractionation are mainly determined for modelling purposes [10][11][12].The division of chemical oxygen demand into fractions is the main parameter that describes the organic matter presented in wastewater [13,14].In contrast to BOD (biological oxygen demand), COD (chemical oxygen demand) or VS (volatile solids) that traditionally describe the content of carbonaceous substrate, COD fractionations refer to the size of particles, as well as to the susceptibility of the organic matter to biodegradability [1,[15][16][17].The total COD can be divided into several fractions, according to the complexity and assignment of the model [1,14].In ASM1 and ASM3, a simplified division has been presented [18,19].ASM1 includes two main compounds: non-biodegradable and biodegradable ones.The non-biodegradable fractions are biologically inert and are transferred through the activated sludge system without any significant modification.The concentration of inert soluble organic matter (SI) does not change during the treatment.The particulate inert fraction (XI) is removed from the system with waste activated sludge.The readily biodegradable substrate (SS) consists of simple soluble compounds that can be directly available for biodegradation by microorganisms.On the other hand, the slowly biodegradable fraction (XS) as well as the rapidly hydrolysable COD fraction (XH), are mainly composed of particulates, colloidal and complex organic molecules, which have to be hydrolysed by extracellular enzymes of bacteria.Additionally, more complex division of organic substrate has been described in the modified Activated Sludge Model no.2d.New variables have been introduced, including volatile acids (SA) (i.e., fermentation products that are considered to be acetate), readily fermentable substrate (SF), as well as readily hydrolysable organic compounds (XSH).The first fraction (SA) mainly includes the final products of fermentation.The fermentable, readily biodegradable organic compounds (SF) can be easily absorbed by heterotrophic organisms.Furthermore, it can be used as a substrate for the fermentation process.The sum of these variables replaced the readily biodegradable substrate (SS) in ASM2d [1,14].The final compound XSH involves a two-step hydrolysis process that is hydrolysed faster than XS under aerobic, anoxic, and anaerobic conditions [20].
The aim of this study was to evaluate the concepts of COD fractionation measurement in municipal wastewater with a respirometric method in the control and modelling of biological treatment processes at WWTP using the modified Activated Sludge Model no.2d (ASM2d) developed by Drewnowski and Makinia [20].The crucial issue dealing with the new developed model and proposed wastewater characterization for both study plants involved examining different extremes: low and high value of the XS/XI ratio, which can be used to control WWTP and balance the solid retention time (SRT) in activated sludge (AS) systems.For example, the SRT-reduction approach in worldwide application is based on the effect of producing more sludge by reducing decay in the AS systems [21,22].In turn, EBPR increases the P-content of the sludge by promoting the growth of P-storing bacteria [23].This is a sequence of anaerobic and aerobic conditions in AS technology, as a prerequisite for the development of P-accumulating microorganisms [24].In most cases, the increased sludge disposal costs, related to the reduced SRT and introduction of EBPR, are compensated by the energy savings gained from reduced oxygen demand [25].
Therefore, SRT is the basic and most important process parameter in design, operation, and control of (AS) systems, especially with nitrification and enhanced biological phosphorous removal (EBPR).However, determination of SRT at the full-scale WWTP may not be straightforward and the significance of proper SRT control is often underestimated by plant operators, which may lead to severe operational problems, including complete nitrification failure [26].Taking into account the importance of the SRT as a process parameter of AS systems and the practical difficulties encountered in reliable determination and control of SRT, the authors find it worthwhile to compare the results obtained using various methods for the operational data of the full-scale WWTP under real and computer simulating operating conditions by using modified ASM2d.The batch oxygen uptake rate (OUR) test results and COD measurements obtained at BNR plant (96,000 m 3 /d) in Gdansk (Poland), presented earlier by Drewnowski [27], and the main BNR plant (144,000 m 3 /d) located in Malaga (Spain) described by Szaja and co-authors [17], provided the experimental database for the comparison of wastewater characteristics and model predictions at both large full-scale WWTPs.

Materials and Methods
The study was divided into two steps.In the first, labeled "long-term" OUR batch tests (Step I), the OUR (both endogenous/respiration phase) was measured under standard stable operational conditions of biological treatment.In the second step, called "short-term" OUR batch tests (Step II), AS was only aerated in the high COD substrate consumption (under conditions characterizing aerobic hydrolysis concept of AS).

Study Area
The main characteristics of the examined WWTPs in Gdańsk and Malaga as well as the settled wastewaters are listed in Table 1.This study was conducted at two large wastewater treatment plants located in Gdańsk (Poland) and Malaga (Spain) during summer sessions.The SRT were 14.6 d and 2.54 d under the average operating conditions for Gdańsk and Malaga WWTP, respectively.They were used in order to examine different extremes: low and high value of the SRT, which can be used to control WWTP and balance the XS/XI ratio in activated sludge systems according to the new model, ASM2d.The first plant, located in Gdańsk, includes primary and secondary treatments.It serves a population of 600,000 P.E (population equivalent) and is one of the largest facilities on the Baltic Sea, treating the wastewater originating from the city of Gdansk and surrounding communities.The biological step consists of six parallel bioreactors, which run in the Modified University of Cape Town (MUCT) process configuration, connected to 12 circular secondary clarifiers.The second WWTP, located in Malaga, is also a major facility in the region, operating 700,000 P.E.In this plant, wastewater is preliminarily treated by screening, grit removal, and sedimentation, and then is secondarily treated by activated sludge process and settling in clarifiers.The biological part consists of three parallel bioreactors with a total volume of 22,173 m 3 .Each reactor consists of anoxic (739 m 3 ) and aerobic (3326 m 3 ) zones.Additionally, this facility includes tertiary treatment (i.e., coagulation/flocculation, decantation, sand filtration, and disinfection).
Generally, the wastewater characteristics depend on the climate conditions, type, and share of industrial wastewater as well as the kind of settlement (touristic, academic, industrial etc.).Moreover, the composition of influent wastewater depends on the customs of habitants [28].Another often neglected factor is the type of the sewer system.However, nowadays, more attention is drawn to the transformations that occur in collectors during the transportation of wastewater.Generally, the physical, chemical, and biochemical processes are involved which could significantly affect the wastewater composition that enters a WWTP [29].
Both WWTPs collect the wastewaters from the seaside areas with comparable community structure.Those objects have to deal with the irregular inflow and variable characteristic of wastewater caused by periodic touristic and academic activities.However, the WWTP in Malaga serves a larger and more extensive territory than Gdańsk.It is characterized by a higher population (P.E.) and flow.Currently, the sewer system in these cities is separate; it includes both gravity and pressure sewer conduits.In the case of Malaga, the system is longer than in Gdańsk.Despite the noted similarities, the characteristics of wastewater composition as well some operational parameters differ significantly.
In this case, the main reason for the observed changes involves the climate conditions.Although in both cases the study was conducted during the summer period, significantly different temperatures and precipitation were noted.The climate in Gdańsk is classified as moderately warm with significant rainfall in summer.In contrast, in Malaga, subtropical-Mediterranean climate occurs with high temperatures (above 26 °C) and small precipitation.
At the Malaga WWTP, the study was performed during the summer period with a high temperature of influent.According to Shahzad et al. [26] the SRT should be changed in a "dynamic" way, depending on the temperature of wastewater.The lowest values of this parameter are more suitable for the summer periods (higher temperature).However, at low temperatures, the SRT should be raised to maintain the same treatment performance.

Extracting Experimental Data and Modelling Study
In both cases, laboratory OUR batch experiments with the process biomass and settled wastewater were carried out in a specially designed and constructed experimental set-up consisting of a batch reactor, which was equipped with stirring and aeration as well as control systems, DO (dissolved oxygen) probe, and a pH electrode.A water jacket was used to keep the temperature of the activated sludge constant at 20 ± 0.1 °C.During the experiment, aeration was supplied continuously to maintain a dissolved oxygen concentration of about 6-7 mg O2/dm 3 .Furthermore, all analyses were carried out at pH between 7.0-8.0.The oxygen uptake rate data were collected online by the measurement of the decrease in DO concentration in the reactor.The activated sludge was taken from the aerated bioreactor chamber of the examined plants and aerated for several hours before use.In order to eliminate the oxygen consumption due to nitrification, allylthiourea (ATU) was used during the measurements.
The dissolved oxygen concentrations (DO) were measured at 30-s intervals until they reached a value close to full depletion.The respiration rate was calculated from the slope, according to the following equation: where DO1,2 are initial and final dissolved oxygen concentration, respectively; and t2 − t1 is the time interval between the first and last DO measurement.
The OUR measurement was determined in two replications for two variants, i.e., "long-term" and "short-term" batch tests.The results of the respirometer test were simulated with modified ASM2d to compare predictions in terms of the OUR and COD behavior in both studied plants.The biodegradable COD fractions were directly estimated during OUR batch tests.The soluble inert COD component (SI) of the settled wastewater was determined according to the experimental procedure proposed by an earlier study [30] (the treated wastewater-effluent COD value); the other fractions were defined by additional calculations.
The hydrolysis concept of Drewnowski and Makinia [20], as well as the original ASM2d and its modification considering a two-step hydrolysis process with a new variable (i.e., rapidly hydrolysable substrate, XSH), are both illustrated in Figure 1.In this study, the authors have decided not to show the detailed procedure of the mathematical modelling and computer simulation, as a similar model was briefly described in the previous research paper [20].However, the most important part of the methodology was presented below.The modified model of ASM2d was eliminated, according to new data sets obtained in the full-scale Gdansk and Malaga WWTP which were used for steady-state simulations in the software GPS-x ver.5.0.2.In order to carry out an accurate calibration, the data sets from the both full-scale WWTPs and from the laboratory batch tests were used.The stoichiometric and kinetic parameters were determined by numerical optimization using the Nelder-Mead simplex method [31].The respirometric batch tests (OUR and corresponding COD consumption for estimate fractionation) were carried out; the consumption of oxygen, biodegradable substrates monitoring, and the conditions of activated sludge were determined as well.Once calibrated and validated, the model integrated with the previous data collected in different seasons of year [20], was further evaluated in this study, for modelling and monitoring of SRT as well as COD fractionation at Gdansk and Malaga full-scale WWTPs by GPS-x platform.The newly developed two-step hydrolysis concept in the modified ASM2d with extended wastewater fractionation is crucial in the mathematical modelling and computer simulations to predict the process kinetics as well as to control the full-scale WWTP operation and balance SRT.The use of OUR (respirometry) to characterise wastewater is a very well-known method and a useful tool for measurements from activated sludge, either in continuously fed reactors or in batch reactors.Moreover, using the OUR measurement, peak nitrification could be detected.It is possible to track the nitrifier populations in AS and impacts to nitrifiers in the system due to operational changes in full-scale WWTP.On the basis of the kinetics of nitrification, as seen in Figure 2, the peak nitrification OUR is proportional to the concentration of nitrifiers (Cb).By adding ammonia at a dose beyond the saturation concentration (Ks which is between 2-3 mg/L) into the OUR batch test, the resulting OUR is proportional to the amount of nitrifiers.Hence, the peak nitrification OUR is a good indicator of nitrifier concentrations, OURs can also be used to monitor and predict the population shifts due to operational changes.At the same hydraulic retention time and loading, but operated at different SRT, there is an initial phase where an increase in the peak nitrification OUR might be observed versus days of operation after which the peak nitrification rate tapers.At higher SRTs, a similar pattern is observed with the exception that the peak nitrification OUR is always higher than the peak nitrification detected by OUR measurements at the lower SRT.

SRT Development
The SRT constitutes the mean of two parameters, i.e., Mx,g that corresponds to the residence time of AS flocs in the system (ratio of the AS mass in the system) and ΔX, g/d-which is the daily net sludge production (total load of the sludge entering and produced in the system minus the sludge disappearing from it).It is calculated using the formula below: The daily net sludge production in a steady-state system corresponds to the daily load of the discharged sludge; thus, the SRT is relatively easy to determine.The mass of sludge in the system involves both the sludge in the bioreactor (MR, g) and secondary settling tanks (MSST, g).In contrast, the daily load of sludge discharged from the system comprises the sludge removed with wasted activated sludge (ΔXWAS, g/d) and with the treated effluent (ΔXE, g/d)-see Equation (2).
Unfortunately, due to loading variations, temperature fluctuations, and changes in process parameters, full-scale plants seldom operate in steady-state.Therefore, the classical methods do not ensure the correctness of the SRT determination.
In actual systems that work under stable conditions, Equation (3) enables the correct determination of the SRT value, especially when average values are considered for a certain period of time.Application of classical methods in the plants operating under transient conditions, resulting for instance from significant changes in the WAS load, may lead to calculation errors, because the SRT is only represented by means of a numerical value that does not correspond to the real SRT in the system.In a scenario where a steady-state system works at a 5-day SRT and the WAS load is rapidly decreased twice, the classical SRT would increase from 5 to 10 days.Such a situation is virtually impossible, because the sludge cannot "age" by more than 1 day within 24 h.It would take several days before the system reached the new steady state at 10-day SRT.Vaccari et al. [33] suggested the idea of dynamic SRT (SRTD, d) for determining the actual SRT in technical systems operating under transient conditions.This idea was later developed by Takacs [34] who proposed the equation presented below, in which FP (g/d) corresponds to the daily gross sludge production: Under steady-state conditions, the dynamic SRT determined using Equation ( 4) can be simplified to the classical equation (Equation ( 3)).However, under transient conditions, the dynamics of the AS process is better reflected while the actual SRT is determined correctly, enabling the prediction of the system performance.Due to the difficulties pertaining to reliable determination of gross sludge production resulting from the poverty of data for actual systems, the application of dynamic SRT in practice is limited.Therefore, at WWTPs, the SRT is usually determined using the classical methods.As long as the constraints of the steady-state system are borne in mind, the results will be correct.For the AS system presented in Figure 1, which will be further discussed in the paper, the SRT can be calculated using the classical method, in the following manner: where VR (m 3 ) is the volume of the bioreactor, XR (g/m 3 ) is the sludge concentration in the bioreactor, QWAS (m 3 /d) and XWAS (g/m 3 ) are the flowrate and concentration of WAS, QE (m 3 /d) and XE (g/m 3 ) are the flowrate and suspended solids concentration of the treated effluent.
In practical applications, simplifying assumptions are often made regarding the mass of sludge in the secondary settler and the sludge load in the effluent.The mass of sludge in settlers is often neglected, because in the systems with biological nutrient removal, settlers should be operated at a low sludge layer, so the mass of sludge accumulated therein is usually relatively small; moreover, it is difficult to estimate without the sludge concentration profile at the depth of the settler.It is also acceptable to omit the load of sludge discharged in the treated wastewater, if the suspended solids concentration is low.With these two assumptions, Equation ( 5) simplifies to Therefore, to determine the SRT, it is necessary to know the values of at least four parameters.However, bioreactor volume (VR) is generally known and constant for a given system, and the WAS flowrate (QWAS) is usually measured on-line with satisfactory resolution and accuracy.On the other hand, determination of sludge concentration usually requires laboratory analyses.Obtaining the results is delayed due to the time required to perform them, ranging from a few hours to several days, depending on whether the plant has its own laboratory.The sludge concentration in the bioreactor (XR) is relatively constant, so even grab samples taken once a day give reliable results, whereas WAS concentration (XWAS) varies significantly during the day, which means that successive grab samples or a daily composite sample would be needed for a meaningful result.However, hydraulic SRT control proposed by Garrett [35], which assumes the discharge of excess sludge directly from the bioreactor, the WAS concentration is equal to the bioreactor sludge concentration (XWAS = XR), which simplifies Equation (6) to Using this method, maintaining the SRT of n days requires a daily WAS discharge equal to 1/n of the bioreactor volume, and does not necessitate determining the sludge concentration.This method is rarely used in practice, because its greatest disadvantage is that the WAS stream is not thickened.

Analytical Methods
Total and Volatile Suspended Solids (TSS and VSS) as well as the biological oxygen demand (BOD5) concentrations were determined according to Standard Methods (APHA,1992).The total and soluble COD, Ptot, P-PO4, Ntot, N-NO3, and N-NH4, were analysed using a Xion 500 (WWTP Gdańsk) and UV-VIS DR 5000 (WWTP Malaga) spectrophotometers (Hach Lange GmbH, Germany).The analytical procedures were adapted by Hach Lange GmbH, following the APHA methods.The soluble COD fractions were obtained by filtration (0.45 μm) and/or the rapid physical-chemical method of Mamais et al. [36].In the case of Gdansk WWTP, the WTW CellOx ® 325 DO sensor with integrated temperature compensation and membrane leak monitoring, was used to measure the DO concentration and kept the DO set point in the laboratory reactors during batch tests.Additionally, a DO probe WTW SitrrOx G was used to measure the actual OUR as its features include a quick response time (t99 < 60 s) and low-maintenance operation.Moreover, several parameters (including DO, pH, Temperature, and ORP) were determined and recorded by using WTW probes installed in the batch reactor and connected to the computer.At WWTP in Malaga the "short-term" batch tests were performed in a BM respirometer provided by SURCIS company.This device consisted of three main parts: batch reactor with closed recirculation (the active volume 1.0 dm 3 ), thermostatic unit, and computer with software.The reactor chamber was equipped with a DO probe-Stratos 2402 Oxy-that controlled the DO concentration, temperature and pH level.The aeration system contained an air compressor and a ceramic diffuser.The batch reactor was divided into two zones: aeration and reaction connected by a membrane valve.The reaction chamber included the mechanical stirrer.The respirometer directly recorded two fractions: total biodegradable and readily biodegradable.The measurement was conducted in accordance with the procedure given by Surcis company in static mode.Additionally, at WWTP in Malaga this device was used for modelling (model calibration) as well as controlling (activated sludge process/biomass condition) purposes.

Results and Discussion
Table 2 contains the results of the average COD fractionation in the settled wastewater at the Gdańsk and Malaga WWTPs during the summer study period.The estimated SS accounted for 19.0% and 34.2% of total COD at the Gdańsk and Malaga WWTP, respectively.The comparative studies performed on raw wastewater in 21 Dutch full-scale WWTPs revealed that the ratio of SS/total COD varied within the range of 9-42%, with an average value of 26% [37].Ginestet et al. [38] found that in the studied plants, this ratio increased in the settled wastewater compared to the raw wastewater.On the other hand, the results of Naidoo et al. [39] showed that SS can be relatively low in the case of French wastewater, i.e., 7-15% of total COD.The important issue dealing with the modelling and wastewater characterization is the XS/XI ratio, which can be used to balance the solid retention time (SRT) in activated sludge systems.In recent years, several works, e.g., [40][41][42][43], that offer an original approach to this challenge have been published.According to this study, the calculations of the XS/XI ratio were 1.36 and 0.21 for Gdańsk and Malaga WWTPs respectively.Those critical parameters (extremely low and high value of the XS/XI ratio), were dealing with the developed model of ASM2d and newly proposed wastewater characterization for balancing with SRT.For operational strategy and control biochemical processes in both WWTPs were balance SRT: 14.6 and 2.5 for Gdańsk and Malaga WWTPs, respectively-in the activated sludge systems-as well as several mechanisms during the process: temperature, industrial wastewater inflow, and/or DO, etc. at both studied plants.The initially estimated XI/total COD ratio varied within the range of 32.4-50.8%at the Gdańsk and Malaga WWTPs, respectively, as a process parameter of AS systems and identified problems with SRT determination and control in WWTPs.In response to the challenge involving reliable determination of WAS concentration, Greenwood et al. [44] proposed a method for hydraulic SRT control, which is based on the sludge mass balance for bioreactors and secondary settlers.This method eliminates the need for sludge concentration analyses, because in order to determine the SRT, it only requires the flowrates of the influent wastewater QI (m 3 /d), recirculated QRAS (m 3 /d), and wasted QWAS (m 3 /d) AS, according to the equation: The use of this method in mathematical modeling and computer simulations is particularly attractive, because in practical applications based on the on-line measurements-depending on the system operating conditions-it is possible to implement an automated algorithm to control excess sludge discharge in order to maintain the pre-set SRT in full-scale WWTPs.Derivation of this method, however, presupposes some simplifications as it neglects the sludge load discharged with treated effluent and assumes that there is no significant change in the mass of sludge in secondary settling tanks.However, it is recommended that the obtained results should be periodically verified using the classical SRT determination method.According to the studies by Puig et al. [41] that focused on improving the reliability of the SRT determination, particularly for the mathematical modelling of AS systems, it was recognized that for a dependable simulation study the SRT values should be known with 95% accuracy, so it is necessary to check the quality of sludge production data.The only way to verify the correct quality and coherence of operational data is the mass balance determined for a given AS system.The mass balance for the biological treatment unit could be calculated with using different methods (e.g., COD, total nitrogen, total phosphorus or flow).Therefore, only in the last two cases, if the measurements are conducted in all wastewater and sludge streams, we will be dealing with a closed balance, which allows for its verification.On the other hand, the mass balance for COD and nitrogen will be open due to the component present in the gas phase -CO2 or N2, respectively, which is usually not measured.Unfortunately, total phosphorus (as well as COD and total nitrogen) is usually only determined in wastewater streams, which makes it impossible to check the mass balance.On the basis of this concept, Puig et al. [41] proposed an alternative method to determine the SRT based on the particulate phosphorous concentration in sludge.Derivation of this method requires the assumption that there is no significant release of phosphorus from the sludge in the secondary settler.Moreover, the particulate phosphorus concentration in sludge should also be known, which is calculated as a difference between the analytically determined total and dissolved phosphorus concentrations.As there are different variants of this method, the SRT based on the particulate phosphorous mass in the system and the particulate phosphorus load discharged from the system could be determined according to the following formula: where PXR (g P/m3), PXWAS (g P/m 3 ), and PXE (g P/m 3 ) are the particulate phosphorous concentration in the bioreactor, WAS, and effluent, respectively.The other variant allows determination of the SRT based on the particulate phosphorus mass in the system and the total phosphorus load entering the system (it is not necessary to determine particulate phosphorus in the WAS) according to the following equation: where PI (g P/m 3 ) is the total phosphorous concentration in the influent, and PSE (g P/m 3 ) is the soluble phosphorous concentration in the effluent.The last variant, which does not require the particulate phosphorous determination at all, because it is based on the difference between the total and soluble phosphorus concentrations in the effluent, will be characterized by a high scatter of results: where PE (g P/m 3 ) is the total phosphorous concentration in the effluent.Taking into account the importance of mathematical modeling and computer simulation as well as the SRT as a process parameter of AS systems and the practical difficulties encountered in reliable determination and control of SRT, the authors find it worthwhile to compare the results obtained using various methods for the operational data of the full-scale Gdansk and Malaga WWTPs under stable and transient operating conditions.Using the newly developed model of ASM2d and the extended fractionation by dividing typically used Xs fraction in ASM into two hydrolysable substrates (XS and XSH) gives an adequate simplification for wastewater characterization and modelling purposes as well as being crucial in the SRT calculations for full-scale WWTP.

Calibration of ASM2d Using the Results of Batch Experiments
The examined modified ASM2d was calibrated using the experimental data from a number of batch tests, which were carried out in the summer experimental series at the Gdansk and Malaga WWTPs.The respirometry test was calibrated within the default range and the values obtained during study at both plants.Similarly to Mąkinia [30], the models were calibrated from a process engineering perspective, which means that the parameters were selected for calibration and modified based on the knowledge of the "mechanistical reasoning" processes rather than on their sensitivity [45].
The first step was to calibrate the examined ASM2d with the data from the Gdańsk WWTP.As a starting point, the default values of kinetic and stoichiometric coefficients were used for ASM2d [46].The modelled processes are coupled to each other, and the calibration of a specific process inevitably affected the previously fitted processes.Consequently, the final sets of the coefficients were obtained after several iteration loops in the calibration procedure.In the next step, the sets of adjusted parameters served as a basis for further calibration/validation of the ASM2d with the data from the Malaga WWTP.
The purpose of such an approach was to use the same sets of model parameters at both studied plants.The main kinetic and stoichiometric parameters were determined from the full and the labscale tests.The values of the stoichiometric/kinetic parameters adjusted at each calibration level of both studied plants with a comparison to the default ASM2d values are presented in Table 3.The initial approximations of the stoichiometric and kinetic values obtained in the tests were adjusted so that the predictions of the model accurately agreed with the actual data.In order to do that, the values of the parameters were modified with the aim to minimize the errors with the actual results.The values of the less sensitive parameters were taken from the data reported in the literature [46].Due to the complexity of the ASM2d model, extensive calibration and validation procedures were applied and compared with several literature parameter estimations for AS systems in municipal wastewater, as was presented in Table 4.

Modified ASM2d Model Components and Parameter Identification
A complex modified ASM2d model, taking many different processes into account, required the calibration of a large number of model parameters and initial concentrations of model components.Naturally, such variables vary from case to case and need to be determined for every model application.Unfortunately, this is often a major challenge facing practical engineering problems.Therefore, only the most important processes may be taken into account.However, which processes are most important depends on the microbial environment to be simulated, e.g., in activated sludge systems, the concentration of heterotrophic biomass is high and the readily biodegradable substrate concentration is low [50].Under these circumstances, no direct, continuous method for the determination of the COD components exists.The determination of the heterotrophic biomass respiration rate in terms of the oxygen uptake rate (OUR) was made by the comparison of settled wastewater and after coagulation-flocculation (c-f), representing total vs. soluble COD.Two samples of wastewater used during OUR measurements are shown in Figure 3a,b.By measuring OUR, one model component-the consumed dissolved oxygen (DO)-is explicitly determined online as 6-7 mg/dm 3 .According to the concept (Figure 1), an OUR measurement allows the initial concentrations of heterotrophic biomass (XH) and readily biodegradable substrate (SS) to be calculated when the growth is not limited by substrate.The two hydrolysable substrate fractions (XS and XSH) can be found when the availability of readily biodegradable substrate limits the microbial transformations [20].The interpretation of OUR measurement using the concept of Drewnowski and Mąkinia [20] was performed by simulation from Gdańsk and Malaga WWTPs of the long-and short-term respirometric tests, respectively (Figures 3 a,b and 4a).
The concept was written as three differential equations: one each for aerobic, anoxic, and anaerobic transformation of new readily hydrolysable organic compounds (XSH).Enzymatic hydrolysis is primarily a surface phenomenon, which means that the hydrolysis rate is different, e.g., smaller molecules are readily degraded, whereas the degradation of larger material can be kinetically limited.A few hours after the beginning of the OUR experiment on wastewater, the growth of the heterotrophic biomass becomes limited by the availability of the organic substrate.The substrate is present, but the biomass could not be utilized directly: it has to undergo hydrolysis into SS before it can be taken up.If the rate with which SS is produced by hydrolysis is higher than that at which SS is consumed for biomass maintenance, the biomass will continue to grow.Wastewater contains many different types of organic matter hydrolyzed at different rates.Dividing the typically used Xs fraction in ASM models into two fractions of hydrolysable substrates (XS and XSH) gives an adequate simplification for wastewater characterization and modelling purposes-original vs. modified ASM2d (Figure 4a).Consequently, the importance of microbial processes differs in the Gdańsk and Malaga WWTPs, leading to different types of systems and microbial transformations involved according to the climate and local special industries (e.g., vineyards in Malaga).However, for the purpose of characterizing the in-sewer transformations, seeding with activated sludge would make it problematic to distinguish between, e.g., biomass and substrate limitations.The readily biodegradable fraction, as described by Ekama et al. [15], was divided into the so-called "directly" and "easily" biodegradable fractions.The former, i.e., fermentation products, comprises acetic acid and forms the soluble fraction, which is non-perceptible.The latter comprises VFAs, alcohols, amino acids, and simple carbohydrates, i.e., fermentable substrates.Henze et al. [51] provided a more detailed profile of wastewater by summing all the physical, chemical, and biological components.Hence, OUR is measured on individual batches of wastewater to determine an adequate profile for COD fractionation [52].Moreover, some parameters, such as heterotrophic growth yield (YH) coefficient, required calibration/validation of range (YH = 0.64 and 0.74 gCOD/gCOD for Gdańsk and Malaga WWTP, respectively) to fit the modified ASM2d to the experimental measurements of the OUR test.According to the final parameter estimation (YH = 0.68 gCOD/gCOD), the removal of COD by degradation was stoichiometric to the oxygen usage, reflecting the consumption of biodegradable substrates in the settled wastewater by the heterotrophic growth of biomass, which depended on the COD fractionation and initial concentration for the both studied sample plants during the respirometry test.Once the calibration stage was finished, the model offered accurate predictions, being able to simulate the variations of the effluent concentrations.After calibration, the model was validated by comparing the actual results from an unused data set with the model predictions obtained by the calibrated model.The average deviations between the measured and calculated COD, ammonia and total phosphorus concentrations were always lower than 10%, which indicates that the calibrated parameters represent Q the Gdansk and Malaga WWTP behavior without significant deviations.

Balancing SRT by Using Modified ASM2d in Operation Strategy of Full-Scale WWTP
The calculations of SRT were 14.6 and 2.54 under the average operating conditions for Gdańsk and Malaga full-scale WWTPs, respectively.In fact, consideration of this critical parameter was not accidental.It was used as a high and low value in process evaluation of the developed model ASM2d with the newly proposed wastewater characterization for both studied plants.The importance of SRT as a process parameter of AS systems and identified characterisation of wastewater with its proper fractions determination for control and operation strategy of full-scale WWTP makes this issue still a valid research challenge.
In comparison with the studies of other authors [40] it was confirmed that the SRT is the most important process parameter of AS systems; however, under unstable operational conditions typical for full-scale WWTPs, the SRT values calculated with the classical method may be unreliable and not representative.Therefore, several new SRT determination methods were proposed in the recent years to overcome this challenge.The conducted investigations show that under stable operational conditions, all the SRT determination methods give similar results; thus, the simple hydraulic method SRTQ can be applied during standard operation, even at small WWTPs, which lack laboratory facilities.The hydraulic method is based on continuous on-line flowrate measurements; therefore, it gives the opportunity to implement an algorithm to automatically control SRT and sludge wastage from the system.However, during the periods of intensive changes in the discharged WAS load, the SRTPI method based on the phosphorus balance (using the total phosphorus load entering the system) provides better estimation of the actual SRT value than other methods.It is recognized that for a dependable simulation study, the SRT values should be known with 95% accuracy, so it is necessary to check the quality of sludge production data and better recognition of COD fractionation to introduce an appropriate model for computer simulations study, as it was presented in Figures 3 and  4.This study showed that the matter of improving the reliability of the SRT determination is particularly important for the mathematical modelling of AS systems, in addition to design, operation, and control of AS systems, especially with BNR WWTP.The SRT, as a control parameter, is often underestimated or not fully understood by plant operators, which may lead to severe operational problems, including a complete nitrification failure.The practical problems with SRT control urge plant operators to use other methods of determining the required excess sludge disposal.
The commonly used methods are based on maintaining the following parameters: a constant sludge concentration in the bioreactor, less often a constant food to microorganism ratio (due to the need for laborious and long-lasting BOD5 measurements), but also unreliable constant sludge settled volume after 30 min, which is strongly dependent on variable settling properties.These methods might be adequate for the operation of small organic removal systems, but do not ensure the control of the preset SRT, and are therefore inadequate for nitrifying and BNR WWTP.
The SRT influences the required bioreactors volume, and thus the investment costs, the oxygen demand, and the related operational costs, as well as microbiological sludge composition which is connected with the settling properties and achieved treatment effects.Furthermore, SRT impacts the waste activated sludge (WAS) production and chemical composition, and hence the potential biogas production in the case of anaerobic sludge digestion [53][54][55].On the basis of the results [40] it can be stated that in the period of stable WWTP operation, the SRT values determined using all the compared methods are similar-the differences between individual methods and the classical SRTXL method (as well as the mean of all methods) generally do not exceed 1 day (<5% of the reference value)-and such accuracy is completely sufficient for the operation of the WWTP.It was also confirmed that issues arise when STR is really low like in Malaga or there are other conditions or circumstances such as unstable operation period under transition of WWTP.From the point of view of a WWTP operator, the basis for SRT control, to maintain proper operating conditions in the system, is to discharge the proper load of excess sludge during the day, by applying proper WAS flowrate for the current WAS concentration.Due to the variability of WAS concentration, determination and control of SRT at the full-scale WWTP is not as straightforward.This means that under typical stable operating conditions, the quality of the simple hydraulic SRT control method, which is based on the on-line measurements of wastewater and sludge flowrates, is comparable to the conventional SRT method.Therefore, the SRTQ method can be successfully used for the purpose of full-scale WWTP operation (with periodic verification by the classical SRT method).It is thus possible to implement a simple and effective SRT control even in the plants where, due to too low frequency of sludge concentration analysis, it is not possible to control the SRT using the classical method.

Conclusions
The wastewater characteristics and SRT are crucial in the mathematical modelling and computer simulations to predict the process kinetics as well as to control full-scale WWTP operation and effluent.The use of OUR (respirometry) to characterise wastewater is a well-known method and constitutes a useful tool for measurements from activated sludge, either in continuously fed reactors or in batch reactors.The following conclusions can be drawn from the study: (1) Evaluation of the OUR profile could be recommended as a method for COD characterisation (2) A novel procedure, based on standard batch tests with parallel (SWW and after c-f) samples was adapted for the evaluation of the OURs fractionation in the activated sludge systems.(3) In addition to the experimental observations, the wastewater characteristics (i.e., the soluble, colloidal, and particulate fractions) and loading of biodegradable organic compounds (relatively low Xs = 11% in Malaga compared to Gdańsk-almost four times higher) could affect the performance of OURs as well as several mechanisms during the process: temperature, industrial wastewater inflow, and/or DO, etc. at both plants.(4) This comparative study was proved that the characteristic of municipal wastewater could be relatively different, which has a crucial significance in case of carbon deficient for a control of WWTP and cost-effective global solution in balancing with a proper SRT and modeling simulations studies.(5) A complex modified ASM2d model, taking many different processes into account, needed the calibration and validation of a large number of model parameters and initial concentrations of model components.Considering a two-step hydrolysis process with a new variable (i.e., rapidly hydrolysable substrate, XSH), the two hydrolysable substrate fractions (i.e., XS and XSH) could be found to be an important issue for SRT balancing when the availability of carbon source as slowly and/or readily biodegradable substrate limits the microbial transformations in the activated sludge systems and has a direct impact on the control and operation strategy for high cost-effective WWTPs.(6) The SRT determination methods all give similar results under stable operational conditions, even the simple hydraulic method which is based on continuous on-line flow rate measurements.It gives an opportunity to implement an algorithm to automatically control SRT and sludge wastage from the system according to the new ASM2d model but further computer simulation studies should be performed in full-scale WWTPs.

Figure 3 .
Figure 3. Sample results of measured date and model predictions from (a) Gdansk WWTP-longterm OUR (oxygen uptake rate) batch tests (b) Malaga-short-term OUR batch tests

Figure 4 .
Figure 4. Exemplary results of the respirometry test and COD measurements during the summer study period, T = 20 °C from Gdańsk WWTP: (a) OUR behavior vs. model prediction with the settled wastewater and biomass (b) total vs. soluble COD with the settled wastewater and after coagulationflocculation (c-f)

Table 1 .
Characteristics of the average operating conditions during the study period.

Table 2 .
Results of the average COD (chemical oxygen demand) fractionation in the settled wastewater at the Gdańsk/Malaga WWTPs (wastewater treatment plants).

Table 3 .
List of default values of stoichiometric/kinetic parameters in ASM2d, and the values adjusted during model calibration at both studied plants.

Table 4 .
Parameter estimation for AS systems in municipal wastewater.