Evaluation of the operational performance of Karbala waste water treatment plant under variable ﬂ ow using GPS-X model

: As Karbala City is a religious tourism destination, millions of tourists visit the city annually, so there is a high ﬂ uctuation of ﬂ ow in the wastewater between the plants during the year. The aim of this study is to evaluate the performance of the wastewater treatment plant (WWTP) in Karbala, Iraq, in removing pollutants for di ﬀ erent ﬂ ow rates in ﬁ ve scenarios using the GPS-X model. The most important phase in modeling, which greatly impacts simulation accuracy, is characterizing the in ﬂ uent composition to meet the mass balance. As a result, the in ﬂ uent waste-water was initially described and thoroughly examined. The model has been calibrated, followed by the collected data ’ s validation. The sensitivity of di ﬀ erent stoichiometric and kinetic factors in the GPS-X was examined and screened to calibrate the model. To demonstrate the consistency between the simulated and measured data, the route mean square error was used in this instance. The result showed that the Karbala WWTP complies with Iraqi environmental regulations for water discharged to surface water or water for other uses and has an appropriate e ﬃ ciency of wastewater treatment even if the ﬂ ow entering the plant reaches the peak ﬂ ow rate of 180,000/day. An improvement in orthophosphate removal e ﬃ ciency was observed as the ﬂ ow rate increased because of the contact time in the anaerobic basins, which gradually decreased as the ﬂ ow increased until it reached the appropriate time for − PO 43 removal. The outcomes of the present study provide an impression to the operators of the treatment plant of the impact of ﬂ uctuating ﬂ ow on the treatment plant. The developed model can also be used for future studies.


Introduction
The volume of wastewater entering the treatment facilities has increased due to urbanization and industrial growth.Wastewater contains substances that are harmful to both people and the environment.As a result, dumping untreated wastewater in natural water bodies creates serious sustainability issues, like endangering aquatic and terrestrial life and raising the expense of treating the polluted water [1].Consistency with discharge characteristic criteria, harm inhibition on the environment and human health, feasible water reuse, and recovery concerns connected to energy and materials (e.g., nutrients) make proper wastewater management a significant global task [2].To adhere to environmental regulations, enterprises that produce pollutants must effectively treat their wastewater before releasing it to maintain the long-term viability of their water resources [3].Activated sludge-based systems are currently the most popular choice since they are the most cost-effective and efficient of the several biological wastewater treatment methods used today.Severe weather might bring either dry or rainy spells, and the population expansion will create new difficulties for operating a wastewater treatment facility.The wastewater treatment process (WWTP) can be simulated under various intake circumstances to prepare for these issues.In harsh climatic circumstances, the feed stream flow rates may exceed the intended maximum values, and the compositions may fluctuate greatly [4].
It is crucial to employ simulation to make the most of the model's predictive skills, which may be used to quickly and effectively weed out the optimal design option and cut down on the time and expense of laboratory testing.Modeling is the process of simplification of actual representation.Mathematical operations and equations used time-dependent variables and parameters to define the model [5].Recent times have seen a rise in dynamic modeling and simulation in wastewater treatment.Many models are created to enhance activated sludge.Several software programs, such as SIMBA, GPS-X, AQUASIM, BioWin, STOAT, FOR, and WEST that promote dynamic modeling of wastewater treatment facilities use these models.Tools for simulation and modeling are used to evaluate process procedures, optimize designs, and analyze costs [6].The calibration and validation steps are crucial for these models to give accurate results.To precisely manage and calibrate the plant's operation, the stoichiometry of the reactions inside the reactor controls the materials produced and consumed.To investigate the microbial transformation process in removing organic matter and nutrients, kinetics and stoichiometric measurements in the titration and verification procedures were considered necessary [7].
The GPS-X model has been used in a wide range of research.Faris et al. [5] investigated the medium volume, dissolve oxygen content, and sludge return to the moving bed biofilm reactor by using sensitivity analysis.The results demonstrated that the nitrification process is impacted when the dissolved oxygen content exceeds 3 mg/L in the ammonia-rich side streams generated from the rejected water of the anaerobic digester.Alwardy et al. [8] evaluated Al-muamirah WWTP in Hilla City, the results revealed that the facility has an acceptable level of wastewater treatment efficiency and produces water that complies with Iraqi environmental standards for water discharged to surface water or water for other uses.Kobeyeb et al. [9] Presented a study to design and model an on-site greywater treatment system for a hotel building in Los Angeles, California.Many greywater treatment plant options were rigorously examined and modeled using the GPS-X software.The MBR plant was the best option for considering location and standards and was advised for use in hotel structures.Hammed et al. [10] used the GPS-X model to investigate how to lower nutrient concentrations in a full-scale plant.The findings demonstrated that the lack of rbCOD in significant quantities to aid in reducing nitrates rendered having a proportion of internal recycle (IR) of 3% worthless.Cao et al. [7] introduced an innovative way using GPS-X and response surface methodology to improve the removal of total nitrogen (TN) in WWTPs.61 parameters' sensitivities were checked and examined.The findings demonstrated that the denitrification rate was significantly impacted by the DO concentration that diffused into various biological compartments.SRT and TN elimination go hand in hand.Key parameter relevance and optimization orders were examined.
Due to the city of Karbala's popularity as a destination for religious travelers, there is a significant variation in wastewater flow into the plant.The present study aims to study the effect of variation in flow on the operational efficiency of the Karbala WWTP by using five scenarios with different flow rates (minimum flow to peak flow) in GPS-X software to model the plant.Additionally, the optimal operation of the WWTP was suggested for each scenario of different flow rates depending on the model results after calibration and validation of the model.

Karbala WWTP
The WWTP in the city of Karbala serves 2.5 million people.The conventional activated sludge method is vital to Karbala's WWTPs.Four sewage treatment facilities utilizing the conventional activated sludge system of type A2/O are used in an integrated wastewater treatment project in Karbala City.Each facility has a daily discharge capacity of 100,000 m 3 .This plant's geographical coordinates are 32.525590°North and 44.074909°East.Figure 1 shows a satellite.00000000000eimage of the Karbala WWTP.
The plant involves five steps of treatment.The first step is preliminary (physical) treatment, which includes four units, which are coarse and fine screens used for removing coarse and fine solid materials.A grit and oil removal chamber is used to remove sand and oil by a physical machine.The next step is primary treatment, carried out by four primary sedimentation basins.After that, there is the secondary treatment, which involves four tanks.There are two anaerobic reactors with a volume of 8,736 m 3 for both of them, two anoxic reactors with a volume of 14,112 m 3 , eight aeration reactor tanks with a volume of 54,054 m 3 , and eight sedimentation tanks with a surface area of 6,432 m 2 .The next step is tertiary treatment, which includes chemical disinfection through the chlorination tank with a surface area of 3,000 m 3 .The last stage is sludge treatment, which involves two gravity thickeners with a surface area of 400 m 2 , three mechanical thickeners with a surface area of 60 m 2 , four anaerobic digesters, and 60 cells of drying beds with a surface area of 50,000 m 2 .

Collection of samples
The purpose of the present study was to study the effect of variable flow on the operational performance of Karbala WWTP.Influent sewage has been analyzed for its properties to measure contaminants' concentrations prior to treatment.Moreover, concentrations of effluent contaminants following treatment have been evaluated and compared with the Iraqi standard limits.Four tests for each pollutant were conducted monthly for 1 year, from January 2022 to December 2022.According to the Standard Procedures for the Examination of Water and Wastewater, the tests were conducted in the laboratory of the Karbala Sewage Department (APHA 2017).The biological oxygen demand (BOD 5 ), chemical oxygen demand (COD), total suspended solids (TSS), ammonia-nitrogen ( ), and nitrite ( - ) are measured.Table 1 displays the concentrations of contaminants in the influent and effluent wastewater.

Modeling of Karbala WWTP using GPS-X model
Mathematical modeling has emerged as an essential instrument for sustainable wastewater management, particularly in simulating intricate procedures inherent in activated sludge processes.Biological systems are very complicated.Temperature, flow fluctuation, the quantity of the wastewater pollutant, and the operational circumstances are just a few of the many variables significantly affecting treatment efficiency.The modeling technology company Hydromantis' GPS-X program, version 8.0.1 (education license), was utilized in the  Note: all parameter units are in (mg/l).
Evaluation of the operational performance of Karbala WWTP under variable flow  3 present study.GPS-X is a multipurpose modeling platform designed to simulate WWTPs.This allows for the interactive and dynamic examination of the complicated relationships between the plant's many unit processes [10].It was constructed with integrated biological WWTP and many other processes that involve physical and chemical reactions.Data were obtained from the WWTP of Karbala and fed into the GPS-X program.A comprehensive carbon, nitrogen, and phosphorus pH (mantis2lib) library was selected.The dimensions of each unit and the input concentration were entered into the model.The assumptions used to create the model in this study are: the pH is stable and close to neutral, and the biological process takes place at a temperature of 20°C (Figure 2).
To establish the best match between simulation results and actual plant effluent, the model was calibrated by adjusting stoichiometric, kinetic, and other important parameters to fit the simulation.After that, mathematical validation was used to check the model, and the following equations illustrate the results for root mean square error (RMSE) and correlation coefficient (R).The reasonable limits of these statistical criteria are 1 ≥ R > 0.8 and 0 ≤ RMSE < 1.5.
where C o is the actual data, C p is the modeled data, C o is the average of actual data, C p is the average of modeled data, and σ is the standard deviation over the dataset.Many simulation runs were carried out under different flow conditions to learn how varying flows may affect the plant's efficiency.The steps listed above, illustrated in Figure 3, are used to simulate the modeling of the plant [11].

Results and discussion
The average monthly flow entering the WWTP is 60,000 m 3 /day, under the design value of the plant, which has a value of 100,000 m 3 /day.There is little variation in flow during the year; the flow reaches its peak value during 2 months of the year because of the visitors coming to the city to revive religious rituals.The average monthly influent concentrations of TSS, COD, BOD 5 , NH 4 + , and 3 are 140, 250, 115, 28, and 4.5, and there is a variation in the parameters mentioned earlier during the year.This fluctuation is due to seasonal variations in wastewater concentrations and industrial wastewater from industrial regions that enter the Karbala wastewater treatment system through the municipal wastewater system.

Modeling of Karbala WWTP by using GPS-X program
The Karbala WWTP was modeled using GPS-X by utilizing five different scenarios.

Model calibration
In order to evaluate the effectiveness of the model, it is recommended to perform calibration procedures utilizing organic or default data.The model was verified using effluent COD, effluent TSS, BOD, orthophosphate, ammonia nitrogen, nitrite, and nitrate as indicators.This is compared with the calibration of the Albarrakiya WWTP by GPS-X software done by ref. [12], which uses the data of COD, BOD, and TSS to calibrate the model.Calibration is necessary due to the system's limited understanding of real physical, chemical, and biological processes and the desire to balance model simplicity with model accuracy.
The model ran with the default data inside; hence, the outcomes were wildly inaccurate [13].The model was calibrated with data on the average monthly pollutant concentration for 1 year in 2022.Compared with the study by Alwardy et al. [8], which uses data from 2 months to calibrate the Al-muamirah WWTP model by GPS-X extended from 1/2021 to 2/2021.Several critical parameters that influenced the alteration of outcomes were adjusted.Characterizing the influent wastewater is seen as the most important phase in the modeling process, requiring rigorous investigation.The laboratory data pertain to the influent and effluent data for an influent flow of 60,000 m 3 /day.This represents the second scenario, which involves adjustments to achieve minimal differences between the simulated and observed pollutants in the effluent wastewater.
The model used for influent characterization is the carbon, nitrogen, phosphorus, and pH (mantis3lib) library.In this regard, the GPS-X already contains the default settings for the COD fractions; however, these default values have been modified to ensure better model calibration [14].In Table 2, the significant influent raw wastewater portions are mentioned.
In this instance, the effluent TSS readings were found to be more than 30 mg/L, which was far from the result of the actual influent flow of 60,000 m 3 /day.As a result, the GPS-X model's sensitive parameters with regard to the secondary sedimentation basin were changed.Some delicate parameters have been adjusted, including the maximum Vesilind settling velocity, which has gone from 410 to 981.95 m/day; the maximum settling velocity, which has been adjusted from 274 to 356 m/day; and the feeding point from the bottom, which has been changed from the default 1 m to the real 4.3 m.Along with other operational characteristics of a different dimension, these three parameters were the most sensitive.
The effluent COD reading was higher than the result of the plant settling correction factor for xii, and the settling correction factor for xbai was adjusted from their default values 1, 1 to 0.07, 0.26.Acetate fraction of total COD was changed from the default value of 0 to 0.102 to adjust the value of PO 4 3− , whose reading was 5; after the calibration, the reading was 3.122.The default nitrate values were shown to be substantially lower than the actual quantities, but the adjustment resulted in fitting the projected nitrate concentration with reality after modifying some sensitive parameters on the kinetics of ammonia and nitrates, including (ammonium fraction of soluble TKN) and (Aerobic heterotrophic yield on soluble substrate).The effluent stoichiometry composition is shown in Table 3.
Figure 4 shows the technique to handle the calibration process.After calibration, the model is ready to be applied to the scenarios.

Statistical analysis
The next task after the calibration of the model for a whole year in 2022 is to examine the calibration process using statistical analysis.Figure 5 shows the actual and simulated concentrations of each pollutant.The statistical equations used to examine the calibration process are the correlation coefficient (R) and RMSE.
The correlation coefficient for each actual and simulated parameter was above 0.8, which means that there is a positive linear relationship so that as one variable increases, the other variable also increases proportionally.
The RMSE for each parameter was close to zero, and that indicates that the model has more accurate predictions and matches the data well.Table 4 shows the correlation and the RMSE for each parameter of actual and simulated values for average monthly data for a period of 12 months during the year 2022.

Sensitivity analysis
In order to assess the potential effects of variation in flow on the output variables of BOD, COD, TSS, of effluent, a basic sensitivity analysis was carried out as part of this study.This research is advantageous because it improves model prediction and reduces the number of model parameters that require calibration as per EPA standards [15].
Figures 6 and 7 demonstrate how the influent discharge affects the plant's production.The hydraulic and  organic loads on the plant's reactors increase with the increase in the discharge.This has a negative effect on the treatment processes and increases the concentrations of BOD, COD, and TSS in the treated effluent wastewater.The BOD, COD, and TSS concentrations did not exceed the Iraqi standards even while the Karbala wastewater treatment facilities reached 180,000 m 3 /day, the plant's peak flow.Reducing the levels of pollutants in the treated wastewater might be possible if the mass balance could be immediately altered in response to the quantity and quality realities.It has been demonstrated that phosphate removal efficiency increases as discharge increases.For the removal of phosphorus during rbCOD fermentation, acetate is required.For rbCOD fermentation, retention times of 0.25-1.0h are sufficient [16].

Applied scenarios
Upon completion of the calibration processes of the model, the model is ready to be applied in the required scenario and estimate the plant's response to the variable flow.Five scenarios were used that depended on variable flow.In the first scenario, the number of primary sedimentation basins was decreased from 4 to 2, which resulted in a reduction in energy consumption by 50% as well as maintenance and operating expenses.The number of secondary  sedimentation basins was reduced from 8 to 3, which helped reduce energy consumption and maintenance costs by about 38%.In the second scenario, the number of primary and secondary clarifiers was reduced to half, which reduced 50% of the energy and cost of operation.While in the third scenario, the number of secondary clarifiers was reduced from 8 to 6.All the primary and secondary clarifiers were used in the fourth and fifth scenarios.Table 5 demonstrates that the COD and BOD removal efficiencies for each scenario's examined under different flows were over 90%, thus demonstrating that the organic matter was removed highly effectively.Microorganisms,  particularly heterotrophic bacteria, assisted in removing organic materials once the appropriate dissolved oxygen concentrations were present and there was enough mixing inside the reactor to cause these compounds to break down and turn into fixed substances [17].When the flow increases, COD and BOD readings increase; this increase could result from a shorter detention time period.The time wastewater is allowed to remain in the treatment system is known as the detention time.Shorter detention times occur when the influent flow is increased because the wastewater is treated more quickly.As a result, the microorganisms in charge of breaking down organic waste have less time to work, which raises the COD and BOD levels in the effluent, as indicated in Figures 8 and 9.
The increasing flow rate through the settling tanks leads to decreased settling efficiency.Table 6 demonstrates that TSS values also increase with the increase in flow rate.As a result, the amount of suspended particles in the  Evaluation of the operational performance of Karbala WWTP under variable flow  9 effluent may increase, increasing the TSS values, which can be attributed to shorter retention times.Higher TSS levels in the effluent might result from shorter contact times between the wastewater and the treatment processes, which can prevent suspended particles from settling.For all scenarios, the secondary sedimentation basins achieved a removal efficiency of greater than 90% of the suspended solids.The removal of nutrients was impacted by the very low concentration of rbCOD in the wastewater of the city of Karbala [18].Figure 10 shows the increase in TSS concentrations with the increase in the plant flow rates.), may be incomplete.As a result, higher ammonium levels can be observed in the effluent.Evaluation of the operational performance of Karbala WWTP under variable flow  11 value, which reduced the efficiency to 86% when it increased to 180,000 m 3 /day, as shown in Table 7.The nitrification process was functioning effectively at the Karbala WWTP, with ammonia being oxidized by over 95% for minimum and actual flow.The denitrification process at the Karbala WWTP is experiencing suboptimal performance due to an inadequate supply of appropriate organic substrate.The potential impact of nitrogen and phosphorous removal on the high levels of dissolved oxygen discharged through IR and return activated sludge flow rates should also be considered [19].The primary source of nutrition for phosphorous bacteria is rbCOD.Additionally, it serves as a source of feeding and functions as an electron donor in nitrate reduction.The competition for removing phosphates and nitrates by this compound may result in an uneven distribution of these nutrients.This parameter is highly responsive to the depletion of nutrients [20].Table 8 shows the removal efficiency of phosphorous of the Karbala WWTP is considered low for minimum and actual flow, 31 and 29%, and this is in agreement with the study by Hammed et al. [10].An increase in rbCOD concentration correlates with improved efficiency in phosphate removal and enhanced nitrification and denitrification processes.Due to the low concentrations present, it is necessary to incorporate an external carbon source to enhance the nutrient removal processes at the Karbala WWTP.The introduction or increase in rbCOD levels has the potential to impact the BOD and COD concentrations present in the plant's effluent.
It was noticed that when the discharge increases, the nitrates and nitrites are only slightly influenced.decreases when the flow increases (Figure 14).

Conclusion
The GPS-X program was successfully used in the present study to model the largest WWTP in Karbala, Iraq.The default settings of some model parameters, such as the kinetic and stoichiometric parameters and the influent wastewater characterization, have been calibrated.The developed model can be used for future studies because the model's accuracy was acceptable, and the simulation result was close to the actual parameter concentrations of the plant.The results of the five scenarios with different flows show that the removal efficiency of the plant remains acceptable according to Iraqi standards when the influent flow is the minimum and actual flow for all pollutants except PO 4 3− , which has a removal efficiency of 31% for minimum flow and 29% for basic flow.The removal efficiency is acceptable even if the influent flow reaches 180,000 m 3 /day, which is above the peak flow of the plant.In the future, it is suggested to decrease the number of primary clarifiers to two and secondary clarifiers to three when the influent flow is 40,000 m 3 / day or less and use two primary clarifiers and four secondary clarifiers when the influent flow to the treatment plant reaches 60,000 m 3 /day in summer or dry days of the year.
Funding information: We declare that the manuscript was done depending on the personal effort of the author, and there is no funding effort from any side or organization.

Conflict of interest:
The authors state no conflict of interest.manuscript.The other datasets are available on reasonable request from the corresponding author with the attached information.

Figure 1 :
Figure 1: Google Earth satellite view of the Karbala WWTP.

Figure 5 :
Figure 5: The calibration of the actual and the simulated values.

Figure 6 :
Figure 6: Effect of flow rate on effluent COD, BOD, and TSS concentrations.

Figure 7 :
Figure 7: Effect of flow rate on effluent concentrations of ortho-phosphate, ammonia nitrogen, nitrite, and nitrate.

Figure 8 :Figure 9 :
Figure 8: The variation in the effluent concentrations of COD with various flow rates.

3 reaches 3 .
835 when the flow is 180,000 m 3 /day because the HRT decreases due to the increase in flow rate.With less time available for treatment, the nitrification process, which converts ammonium (

Figure 11 :Figure 10 :
Figure 11: The variation in effluent concentrations of -+ NH N 3 with different values of flow rates.

Figure 12 :Figure 13 :
Figure 12: The variation in the effluent concentrations of orthophosphate with different values of flow rates.
Figures 12  and 13  show that, unlike -

Figure 14 :
Figure 14: The variation in the effluent concentrations of nitrite with different values flow rates.

Table 1 :
Concentrations of influent and effluent sewage of Karbala WWTP

Table 2 :
Default and calibrated values of influent stoichiometry composition

Table 4 :
Value of R and RMSE of calibration process

Table 5 :
Effect of fluctuation of flow on effluent COD and BOD concentrations

Table 6 :
Effect of fluctuation of flow on effluent TSS concentration

Table 7 :
Effect of fluctuation of flow on effluent -

Table 8 :
Effect of fluctuation of flow rates on effluent PO 4