Systematic Modeling of Municipal Wastewater Activated Sludge Process and Treatment Plant Capacity Analysis Using GPS-X

: Mathematical modeling has become an indispensable tool for sustainable wastewater management, especially for the simulation of complex biochemical processes involved in the activated sludge process (ASP), which requires a substantial amount of data related to wastewater and sludge characteristics as well as process kinetics and stoichiometry. In this study, a systematic approach for calibration of the activated sludge model one (ASM1) model for a real municipal wastewater ASP was undertaken in GPS-X. The developed model was successfully validated while meeting the assumption of the model’s constant stoichiometry and kinetic coefficients for any plant influent compositions. The influence of vital parameters on the treatment plant performance and capacity analysis had an effect on meeting locally treated wastewater effluent discharge limits. Lower influent chemical oxygen demand in mgO 2 /L (COD) could inhibit effective nitrification and denitrification, while beyond 250 mgO 2 /L, there is a tendency for effluent quality to breach the regulatory limit. The plant performance can be satisfactory for handling even higher influent volumes up to 60,000 m 3 /d and organic loading when Total Suspended Solids/Volatile Suspended Solids (VSS/TSS) and particulate COD (X COD )/VSS are maintained above 0.7 and 1, respectively. The wasted activated sludge (WAS) has more impact on the effluent quality compared to recycle activated sludge (RAS) with significant performance improvement when the WAS was increased from 3000 to 9000 m 3 /d. Hydraulic retention time (HRT) > 6 h and solids retention time( SRT) < 7 days resulted in better plant performance with the SRT having greater impact compared with HRT. The plant performance could be sustained for a quite appreciable range of COD/biochemical Oxygen Demand in a 5-day incubation period in mgO 2 /L (BOD 5 ) ratio, Mixed Liquor Suspended Solid (MLSS) of up to 6000 mg/L, and when BOD 5 /total nitrogen (TN) and COD/TN are comparatively at higher values. This work demonstrated a systematic approach for estimation of the wastewater treatment plant (WWTP) ASP parameters and the high modeling capabilities of ASM1 in GPS-X when respirometry tests data are lacking.


Introduction
Activated sludge system (ASS) is one of the critical treatment processes for various wastewaters, with over 90% of the municipal wastewater treatment plant (WWTP) using it as the core part of their treatment scheme [1,2]. The activated sludge process (ASP) uses suspended microbial consortium in the wastewater to remove biodegradable organic matters and nutrients, mainly under aerobic conditions [3,4]. Mathematical modeling has become an indispensable tool, especially for the simulation of complex biochemical processes involved in ASP, which requires a substantial amount of data related to wastewater and sludge characteristics, as well as process kinetics and stoichiometry. Among various dynamic and steady-state mathematical expressions and models describing the ASP, activated sludge models (ASM) such as suggested by the International Water Association (IWA) have most frequently been employed for the design, operation, and optimization of biological wastewater treatment plants [5]. Amongst these models, the ASM number one (ASM1) has become an internationally accepted ASM, describing the biological removal processes of organic matter and nitrogen, including nitrification and denitrification mechanisms [5,6]. The model comprises eight essential processes: (i) aerobic growth of heterotrophic biomass, (ii) anoxic growth of heterotrophic biomass, (iii) aerobic growth of autotrophic biomass, (iv) heterotrophic biomass decay, (v) autotrophic biomass decay, (vi) soluble organic nitrogen ammonification, (vii) hydrolysis of entrapped particulate organic matter, and (viii) hydrolysis of entrapped organic nitrogen [5,7]. ASM1 has been considered as the primary reference model because it prompted the universal recognition of ASS modeling. With high potentials of providing a good depiction of the sludge production process, the ASM1 primarily describes the removal of organic and nitrogenous compounds with concurrent NO3 − and O2 consumption as acceptors of the electron [5]. ASM1 model basically adopts COD as a parameter for representing organic matter concentration in wastewater. The ASM models developed by IWA have been incorporated into the various design, simulation, and optimization software such as GPS-X ((Hydromantis Environmental Software Solutions, Inc. Ontario,Canada), BioWin ((EnviroSim associates LTD. Hamilton,Canada), ASIM Activated Sludge SIMulation Program (Swiss Federal Institute of Aquatic Science and Technology Eawag, Dübendorf , /Switzerland), SIMBA (IFAK-Institut für Automation und Kommunikation e. V.Magdeburg, Germany), WEST (DHI A/S Hørsholm, Denmark), STOAT WRc plc., Wiltshire ,UK) and Sumo (Dynamita, Sigale,, France) [8]. The learning and prediction performances of the software mentioned herein are significantly dependent on the successful calibration and validation of the model [9].
The parameters that have the greatest impact on the model can be identified by performing the sensitivity analysis with the parameter estimation method during the dynamic or steady-state calibration steps [10,11]. Following the calibration stage, the model must be validated by comparing the actual treatment plant data and predicted data by the calibrated model. The GPS-X software, a comprehensive plant-wide model, developed by Hydromantis Environmental Software Solutions Inc. [12], has recently been receiving great attention due to its wide variety of pre-compiled treatment technologies, ease of use, and easily accessible training materials [13][14][15]. In steady-state model calibration, parameters such as fp, bH, and YH that influence long-term behavior are an example of relevant parameters to be considered [16]. Nevertheless, calibration parameters responsible for the short-term (i.e., dynamic behavior), such as μmaxH, μmaxA, the correction that included ηanoxic,h, KS, KNH4, KOH, and KOA, are equally important to be estimated during the steady-state calibration [10,12,16]. However, one of the major setbacks for ASM calibration is identifying and selecting the most appropriate parameters -amongst several parameters-that are crucial for achieving apt and good calibration for a given ASP [10]. Thus, the appropriate methodology needs to be adopted for success in this regard [10], which is usually achieved via performing analysis to ascertain the ability of the combination of set parameters that would adequately describe the ASP [16]. Finding the right and most appropriate ASM parameters for a given system is challenging due to the complex nature of ASMs, several integrated model's parameters as well as their interdependencies [5,6,16]. This renders the determination of all necessary model parameters and successful ASP calibration time-consuming and expensive processes [10]. Consequently, several methodologies have been proposed for achieving successful ASM calibrations [10,11,15,[17][18][19][20][21]. In this regard, sensitivity analysis has been applied in the determination of the most influential ASMs model parameters as it helps in achieving calibration, reduces the difficulty, and to optimize the process [11,22]. Other authors [17,19,23] presented detailed steps for the most relevant parameters for real WWTP data under ASM1. Their analysis resulted in identifying a set of kinetic and stoichiometric coefficients that included YH, YA, μmaxH, BH, μmaxA, KS, KOA, and ηanoxic,H as the most relevant parameters for their model. Systematic methodologies were also presented for the selection of the most relevant parameters for the ASM2d model [17,24]. Using BioWin software, Liwarska-Bizukojc and Biernacki [10] identified 17 most influential stoichiometric and kinetic and parameters for ASM-based models from 46 stoichiometric and 71 kinetic parameters via sensitivity analysis.
Generally, identifying and selecting the most relevant parameters during modeling WWTP using ASP models' platforms is a cumbersome and challenging task to implement during the calibration process. Approaches presented by other authors using methods such as sensitivity analysis are prone to be challenging as they rely on other technicalities (such as requirements for determination of statistical parameters), which are outside the capabilities and jurisdiction of GPS-X software. This is manifested in its bare implementation, especially for complex ASM GPS-X ASP models, as demonstrated in the reviewed literature. Thus, in this study, a simple and systematic approach for successful steady-state calibration implemented, entirely, under GPS-X based ASP model for a real WWTP modeling is presented. The approach does not rely on any prior information about real influent composition such as organic and nitrogen fractions and other required mass balance data related to state and composite variables and their fractionation; hence it does not require respirometry tests. Characterization of influent via laboratory respirometry protocols is used for determining several stoichiometric and biokinetics for biological process calibration under study [25]. Respiratory protocols are related to oxygen consumption measurements for biomass aerobic activities involving autotrophic and heterotrophic bacteria exogenous-growth (classed into NOB and AOB ammonium oxidizing bacteria) as well as their endogenous-respirations [13,25,26]. These measurement protocols are highly technical, expensive, and often challenging. Moreover, the approach presented herein is supported by the visual as well as real-time output presentation capabilities of GPS-X models. This work targeted employing the high potential modeling capabilities of ASM1 executed in GPS-X software for identifying the most influential and relevant kinetic and stoichiometric parameters and applying them for modeling and understating the influence of operational parameters on real WWTP.

Description of Dhahran North Sewage Wastewater Treatment Plant (DWWTP)
Dhahran North Sewage Wastewater Treatment Plant (DWWTP) is located at the Dhahran district of Eastern Province, Saudi Arabia (26°18′31.18″ N 50°9′40.87″ E) ( Figure 1). DWWTP is an activated sludge wastewater plant and receives only domestic wastewater with an average flow rate of 52,012 (±4440) m 3 /d. The wastewater flow enters the DWWTP via gravity sewers from three areas: Doha residential area, Saudi Aramco Dhahran facility, and King Fahd University of Petroleum and Minerals (KFUPM) campus area. The influent first contacts with mechanically cleaned step screens followed by vortex grit removal chambers. A flow equalization tank is used to balance the peak flows. After that, the screened and de-gritted wastewater flow is distributed to the aeration tanks, where the biological stabilization of organic matter is accomplished. The aerated effluent exiting the aeration tanks is conveyed to secondary settling tanks for the removal of solids. The belt filter press units have been used for sludge dewatering of excessive sludge.

DWWTP Wastewater Quality Characteristics
The influent and effluent data used in this research are collected from the influent into the ASP from the primary clarifier and effluent from the secondary clarifier of the DWWTP, respectively. The collected samples were transferred to the Environmental Chemistry Laboratory of Environmental Engineering Department, Imam Abdulrahman Bin Faisal University, and analyzed immediately for pH, conductivity, turbidity, dissolved Chemical Oxygen Demand in mgO2/L (COD), Biochemical Oxygen Demand in a 5−day incubation period in mgO2/L (BOD5), NO2 − NO3 − , NH3−N, and Total Nitrogen (TN) in compliance with the procedures in "The Standard Methods for the Examination of Water and Wastewater" [27]. Table 1 summarizes the descriptive statistics such as mean, median, standard deviation (SD), minimum (Min), maximum (Max), kurtosis, and skewness of the analyzed parameters for influent and effluent samples of the DWWTP. During the studied period, the pH values of influent samples were found to be 2.40% (±2.76) higher than those of effluent samples, which could be ascribed to the denitrification process resulting in pH increase [28,29]. The turbidity removal efficiency of the DWWTP was calculated as 96.8% (±2.23), while conductivity change between influent and effluent samples was negligible. The BOD5 and COD treatment performances of the ASP in DWWTP were 89.2% (±7.79) and 75.4% (±20.74, respectively. The NH3 + −N was the dominating nitrogen form in the influent samples and treated with 98.6% (±1.74) efficiency, leading to 67.6% (±6.90) of TN removal efficiency while meeting regulatory limits as provided in Table 2.

MANTIS GPS-X Model
GPS-X software version 6 (education license) developed by the modeling software company Hydromantis is used in this present work [12]. It is a widely used comprehensive standalone model built with integrated biological wastewater treatment processes for ASP and anaerobic digestion system (ADS), as well as many other involving physical and chemical reactions. The Mantis model integrated into GPS-X software re-adapted ASM1, incorporating some amendments about additional growth processes related to heterotrophic and autotrophic organisms. Additionally, the Mantis model factored aerobic denitrification as part of its components [30]. In this work, the ASP model employed was designed in a carbon and nitrogen custom components library in GPS-X software under the MANTIS and simple1d clarifier model [12]. The model comprises of over 60 composite and state variables along with several libraries of expressions describing the processes with more than 30 stoichiometric and 24 kinetic input and output parameters incorporated [12]. This implies that the modeling approach adopted ASM1 for carbon degradation, nitrification, and denitrification thereby, targeting only removal of COD, BOD5, and nitrogen components (i.e., NO2 − + NO3 − , NH3−N, and TN).

Model Assumptions
With model constraints as per ASM1 [5], the assumptions are adopted for the development of the model in this study are as follows • ASP operates at a content temperature • a constant concentration of dissolved oxygen (DO) is maintained, and there is sufficient mixing within the reactor • pH is steady and near-neutral value • The model's coefficients are assumed to be constants for any influent characteristics • there are enough inorganic nutrients to ensure sufficient growth • there is simultaneous hydrolysis of organic and nitrogenous compounds.

GPS-X Modeling Approach
Using the data in Table 2, the modeling in this study was undertaken via simulation in the GPS-X environment using the following steps 1. Collection minimum real DWWTP data required for the GPS-X modeling 2. Portraying the existing DWWTP in terms of influent and physical data of the central unit operations 3. Selection of model objects via the construction of the DWWTP layout representation in GPS-X environment 4. Characterization DWWTP influent wastewater quality parameters (inserting the required values of the easy to measure, i.e., COD, NO2 − + NO3 − , NH3−N, and TN) 5. Adjusting and setting influent fractionation of the COD and nitrogen components (not easy to measure influent components) using the GPS-X influent advisor to an acceptable state and composite variables mass balance 6. Running the model and calibration via adjusting kinetic, stoichiometric, and other relevant parameters to fit the model to obtain the best matching between model output and the actual plant effluent quality data 7. Validate the calibrated model using a different set of DWWTP wastewater quality data 8. Running simulations under different scenarios to analyze the effect of relevant operational parameters of the plant capacity and performance in terms of final effluent quality.

Systematic GPS-X Model Calibration and Validation
The influent data for month 1 (as presented in Table 2) was employed as the calibration simulation input data. Meanwhile, for the model validation, the period covering three months (months 2-4) was used as the input data. The schematic steps for the systematic model calibration and validation adopted in this study are illustrated in Figure 2. The standard statistical, as elaborated earlier, was undertaken (as provided in Table 1), and the calculated confidence intervals were found to be within a 90-95% significance level. The simulations were performed under steady-state conditions for both model calibration and validation processes. The best-identified parameters proving collective matching of measured plant effluent quality data, i.e., total COD, BOD5, NO2 − + NO3 − , NH3−N and TN for the calibration, were then applied on the for validation simulations undertaken for the different periods (month 2, 3, and 4). The steps for the DWWTP plant steady-state systematic calibration process are explained as follows. 4. If GPS-X influent advises mass balance calculations requirements (i.e., organic, nitrogen and MANTIS fractions) are satisfactory for the state, and composite variables move to step 6. 5. If there exists an imbalance in mass balance calculations in step 4 above, manually adjust organic, nitrogen, and MANTIS fractions until satisfactory state and composite variables balance are achieved. 6. Run calibration using month 1 data based on GPS-X defaults kinetics and stoichiometric parameters values. If the model prediction fits all the respective effluent quality parameters data within acceptable limits, calibration is done. 7. If the GPS-X default model fails, initial screening and identifying of the most sensitive parameters is undertaken by running ASP and clarifier model parameters optimizations for four whole months plant data via manually adjusting the relevant defaults parameters values oneby-one while visually observing GPS-X output response in collective predicting the effluent quality parameters in terms of COD, BOD5, NO2 − + NO3 − , NH3−N, and TN. 8. Re-run the calibration of month 1 data via changing the values of the identified and screened parameters in step 7 to optimize their prediction abilities further. 9. Select the parameter values that yielded the best modeling prediction in terms of standard effluent quality parameters. These are the final calibrated parameters. 10. Validate the performance of the above-developed model against a different set of real DWWTP data (i.e., month 2, 3, and 4).

WWTP Performance and Capacity Analyses
The capacity of DWWTP under different steady-state operational scenarios of influencing parameters was investigated via simulations using the validated GPS-X model. The influence of primary influent wastewater characteristics, fractioning components of COD and nutrients as well as the physical, operational variables were assessed against collectively, meeting regulatory effluent discharge limits of COD, BOD5, NO2 − + NO3 − , NH3−N, and TN.

DWWTP ASP Model Calibration
The model calibration simulation targeted estimation of the best-fitted parameters for a specific given set of real data acquired from the DWWTP understudied. Data for month 1 was used for initial calibration using GPS-X default parameter values [12]. This was achieved by characterizing the influent composition satisfying the mass balance expressions that required changing the GPS-X default values of the influence fractioning for BOD5/BODultimate, Si, Ss, Xi, XBH, XBA, and Snh from 0.66, 0.05, 0.2, 0.13, 0, and 0 to 0.75, 0.0556, 0.32, 0.12, 0.176 and 0.142, respectively ( Table 3). The initial calibration result under this scenario as depicted in Figure 4a was excellent for carbon contents (i.e., COD and BOD); however, it failed to capture the actual values of all the nitrogenous components by grossly overestimating NH3−N (13.093 against 0.0408 mgN/L) and TN (14.23 against 7.49 mN/L) and underestimating NO2 − + NO3 − (0.16 against 2.45 mgN/L). Thus, this necessitated an additional strategy adopted by first identifying the most relevant parameters, and then adjusting them to balance the model's predictability, collectively, for both the carbonous and nitrogenous quality parameters using procedure elaborated under Section 2.3.4 steps 7-9. The calibration results for this second approach presented in Figure 4b shows that there is good agreement between the predicted and actual for all the parameters, collectively. This was achieved after identifying and optimizing the thoroughly mixed tank composite variables stoichiometry, model stoichiometry, kinetics parameter as well as the clarifier parameters as provided in Tables 3 and 4. The quality of the GPS-X calibration results was ascertained after confirming that simulated output was within the actual data values statistical confidence interval. In contrast, the difference between measured and simulated values of the quality parameters was insignificant [10,16,31]. Additionally, most of the values of the settings for the calibrated models are well within the range of values reported in the literature [10,[32][33][34][35][36][37]. The GPS-X default calibration failure was high, attributed to the lower or higher values of the parameters as suggested by GPS-X [12], especially those related to nitrogenous compounds (such as i XB, i XP, K NH4, and k A) in Table 4. These parameters were found to be very sensitive to slight changes, yet they had to be systematical, increased by 2.47, 3.24, 3.58, and 4 folds to achieve the acceptable calibration (Table  4). This was the case despite initially satisfying major parameters accountable for the long-term behavior (such as, i.e., YH, bH, for NOB (baerob,N) and AOB (baerob,A). This corroborates earlier observation reported by other authors [10] that achieved lower predictions of simulated COD and BOD5 which they postulated to be as results of overestimation of BioWin model biomass affinity to their studied wastewater (represented by a half-saturation constant for heterotrophic biomass for their model).
Interestingly, in this present study, the model's performance during the calibration was found to be significant, influenced by the RAS and WAS, which had to be changed to reflect the reality of the studied DWWTP from low default values of 2000 and 1200 m 3 /d drastically increased to 15,000 and 10,000 m 3 /d before achieving the obtained good calibration. Earlier studies indicated the strong influence and contribution of WAS and RAS for successful ASP model calibration [35].

DWWTP ASP Model Validation
After the successful calibration of the plant, validation became the next task. Model validation can be defined as the excellent agreement of the model's predictions when compared with a different set of data that did not partake in the model's development within acceptable limits. The validation was achieved by considering months 2, 3, and 4 discrete average monthly effluent quality from which the calibrated model simulations results were compared with the actual as depicted in Figure 4b-d, respectively. Similarly, these validation results marched with the existing plant data well and within the acceptable limit. It is interesting to observe that all model's stoichiometry and kinetic parameters are similar and are applicable for both the calibration and validation (all month 1 to 4 simulated data). However, in each case, it requires initial characterizing of the influent stoichiometry fractions (Table  3) to depend on the influent wastewater quality parameters, which vary from month to month ( Table  2). This adequately satisfies the model's assumption that all the constants model's coefficients for any influent characteristics. The model validation results show that calibrated models performed well in capturing the biological processes at the DWWTP for treating the municipal wastewater and be adequately considered to be acceptable. Thus, the performance capacity of the DWWTP was further investigated and analyzed under different operating conditions, as presented under the sections below.

Influence Parameters on DWWTP Performance and Capacity Analyses
The simulation results for DWWTP performance and capacity analyses under different steadystate operational scenarios of influencing parameters using the validated GPS-X model are presented and discussed under this section with meeting regulatory effluent discharge limits for COD, BOD5, NO2 − + NO3 − , NH3−N, and TN. Among them are some of the most influential parameters observed during the calibration process, which included wastewater quality parameters, VSS parameters biomass, and endogenous fractioning COD fractioning on activated sludge and clarifier sizing.

Influence of Activated Sludge and Clarifier Sizing DWWTP Capacity and Performance
The effect of reactor tanks size in terms of AST volume and CSA are provided in Figure 5a,b, respectively. As the AST volume was increased (Figure 5a), so also the concentrations of the effluent quality parameters decrease, reaching an optimal value at 30,000 m 3 , which is comparable with the DWWPT AST of 29,841 m 3 . Even though higher AST volume beyond this value would be inconsequential on the effluent quality for COD and BOD5 removal, yet it was susceptible to significantly diminish the degradation of the nitrogenous compounds. Figure 5b suggests that CSA larger values above 5000 m 3 would yield better plant performance, although the operational plant clarifier area of 3810 m 2 was quite adequate. These results imply that the sizes of the plant's main reactors were optimally designed to handle the scenario during the present study. Additionally, the plant performance can be sustained even if higher inflow volumes are to be treated.

Influence of Inflow, RAS, and WAS on DWWTP Capacity and Performance
The impact of Q presented in Figure 5d depicts a steady decrease in the plant's ability to remove COD and BOD5 for increasing the Q from 10,000 to 50,000 m 3 /d reaching maximum values of 23 and 8 mgO2/L, respectively. Meanwhile, this inflow change resulted in a slight improvement of TN and a decline in effluent NO3-N + NO2-N. Afterward, higher Q values led to the effluent quality (TN, COD, and BOD5) to deteriorate rapidly with the vulnerability of the plant to fail in meeting discharge limits when Q > 60,000 m 3 /d. This suggests that the monthly DWWTP flow of 52,012 (±4440) m 3 /d was entirely within desirable values for effective plant performance. Simultaneously, the plant can accommodate slightly higher Q values without undermining its performance within the acceptable effluent quality. RAS and WAS are the two vital parameters required to be set to ensure the retention of the active microbial community in ASP [35,[38][39][40]. There existed marked differences between the influences of changes there two parameters on the DWWTP performances. This can be deduced from Figure 5d,e, which shows that the WAS has more impact on the effluent quality compared to RAS. As increasing the RAS over a considerable range, 3000 to 18,000 m 3 /d, exerted no influence on the plant performance; however, there is substantial performance improvement when the WAS increased from 3000 to 9000 m 3 /d. The COD and BOD5 are dramatically decreased from 130 and 95 mgO2/L to 40 and 20 while the TN decreased from 30 to 10 mgN/L, respectively. The insignificant effect of RAS could be attributed to the fact that the simulations were run under steady-state at the plant design while the maximum recycled ratio was 0.25 to 0.34, a typical range for conventional ASP. Invariably, the attainment of the design MLSS was only feasible at a minimum WAS of 9000 m 3 /d. Thus, the respective plant operational RAS and WAS of 15,000 and 10,000 m 3 /d were sufficient to sustain the plant performance for acceptable effluent quality. This is attributed to the higher influence of the WAS and the SRT which is one of the vital operational parameters of ASP as corroborated by earlier studies and discussed below. Similar to the present study, Elawwad et al. [35] reported a successful achievement optimization of a huge WWTP with great contributions of WAS flow rates.

Influence of MLSS, HRT, and SRT on DWWTP Capacity and Performance
As critical ASP design and operating parameters [38], the influence of MLSS, hydraulic retention time (HRT), and SRT on DWWTP performance are presented in Figure 6. For that, the treated water effluent and the sludge flow lines were employed for the assessments of the performance of the DWTTP. The MLSS trend shown in Figure 6a suggested that the plant could maintain its performance over an appreciable range of MLSS of up to 6000 mg/L. Even though above this MLSS value, the BOD5 and nitrogen components removal will insignificantly be affected, yet there could be a dramatic increase in the COD components. This can be attributed to the sudden increased in the TN in the final effluent when the MLSS reached 6000 mg/L. While the model indicated that higher HRT resulted in better COD and TN removals (Figure 6b), in contrast, higher SRT are prone to significantly undermine the ability of the DWWTP to eliminate both COD and TN (Figure 6c) despite its effectiveness in ammonia-N removal under the various investigated operational parameters. The modeling data suggest that the condition for better performance is when the plant was set to operate at HRT > 6 h and SRT < 7 days. Results presented by Elwaad et al. [35] indicated better nitrification and denitrification when operated at SRT of 7 days, in agreement with the present study. However, other similar studies reported higher SRT values of up to 15 days [24,39,41]. These results further demonstrate that SRT-which is controlled via setting the WAS flow based on the design MLSS in the AST, and it decreases with an increase in the WAS-stands as the single vital parameter influences ASP compared to HRT [41,42]. The SRT, when operated under the lower WAS > 6000 m 3 /d was expected to ensure improved plant performance for both carbon and nitrogen compounds removal (Figure 5d). Additionally, the HRT should be kept as low as possible for optimal COD removal, effective clarifier performance as well as nitrification. At the same time, higher values necessitate leading to energy expenditure due to oxygen requirements [41]. Other studies indicated that higher SRT leads to increased ASP O2 requirements and energy expenditure, while too low is susceptible to result in partial denitrification and higher effluent nitrogen content [41].

Influence of Influent Wastewater Quality Parameters on DWWTP Capacity and Performance
The results depicted in Figure 7a show that the CODout and BOD5out increases proportionally, with increasing CODin concentration. Meanwhile, at lower CODin the inhibition of effective nitrification and denitrification is manifested in the higher effluent nitrogenous parameter concentrations that decrease as the CODin increases [38]. As the CODin reaches beyond 250 mg/L, there was a tendency for CODout and BOD5out to breach the regulatory limit of 50 mg/L and 40 mg/L, respectively. This was also the case for the TN, which started to drastically increase at the 250 mg/L CODin inflation point (Figure 7b). Considering that most of the average influent of the plant was far below this threshold (ranged between 129.05-215 mg/L), this implies that the plant performance was satisfactory for the handling even higher influent organic loadings. While the increase in influent total (NO3 − + NO2 − ) insignificantly influenced both nitrogen and carbonous compounds degradation (Figure 7c), however, lower influent TN (Figure 7b) was susceptible to result in higher CODout and BOD5out (near the discharge limits) which could drastically reduce at higher TN values before stabilizing when the TN was beyond 14 mN/L. Similarly, an increase in total influent NH3−N would slightly affect CODout and BOD5out ( Figure  7d). The plant was favorably useful for nitrogen removal when operated at lower influent NH3−N and TN up to 12.5 and 14 mN/L, respectively. However, above these values, the nitrification and denitrification efficacy would tend to dwindle considerably. This nitrification-denitrification process, which is responsible for wastewater removal of nitrogen with approximately up to 67% of this mechanism is occurring under anoxic (i.e., anaerobic) condition [43]. However, denitrification is also known to take place under aerobic conditions by special denitrifying bacteria. Meanwhile, the influent wastewater organic nitrogen (i.e., the amine groups, −NH2), is converted to ammonia via ammonification by heterotrophic bacteria as given in equation 1 [43]. Accordingly, for organic oxidation under ASP, microbes can be either heterotrophic (mostly, bacteria or fungi and protozoa), deriving energy from organic compounds oxidation, or autotrophic, which are nitrifying bacteria getting energy from the oxidation of reduced inorganic compounds such as NH3−N, NO3 − , ferrous iron, and S 2− [38]. Thus autotrophic microbes are responsible for oxidizing NH3−N from which energy for CO2 uptake and growth are produced through the nitrification process via two-step oxidation: (i) oxidization of NH3−N to NO2 − and (ii) NO2 − to NO3 − by nitroso−bacteria and nitro-bacteria, in equation 2 and 3 respectively. Under anoxic conditions, NO3 − or NO2 − can be reduced to N2 via the denitrification process [38]. The high rate of NH3− N removal is manifested in the model's high ammonification rate of 0.4, which resulted in lower simulated NH3− N for all cases investigated. This is corroborated in the higher NH3 − N removal performance of the DWWTP lowering the NH3−N in the effluent (average 0.261 mgN/L) compared to the influent concentration of average 18.7 mgN/L.  Figure 8a,b presents the dependencies of effluent quality parameters on influent VSS/TSS and XCOD/VSS ratio, respectively. Appropriate proportioning of these ratios is of paramount importance for ensuring the efficacy of WWTP biological treatment processes [38]. As shown in Figure 8a, lower VSS/TSS values were not favorable for the effective removal of both TN and carbonous materials in the wastewater, yet effective NH3−N oxidization was achievable under the whole range of VSS/TSS. This suggests that denitrification cannot be successful under lower values of the VSS/TSS ratio, which needed to be maintained above 0.7, with the best performances stabilized from 0.8. Even though a similar trend is associated with XCOD/VSS, however, it can be observed that change in this parameter has more impact on the effluent wastewater quality compared to the VSS/TSS (Figure 8b). Lower XCOD/VSS can significantly hinder the overall plant capacity to treat the wastewater because the developed model indicated that only 12-13% of the XCOD accounts for the inert fraction (i.e., Xi in Table 3). Thus, to get the best DWWTP performance and ensure acceptable effluent quality, the influent wastewater XCOD/VSS should be maintained at a value greater than 1 with an optimal value of 1.38. This optimal value agrees with reported values of 1.41 and 1.22, as reported by Abdelsalam Elawwad et al. [35] and Nadja Hvala et al. [32], respectively. Moreover, this modeling results provided an insight into the VSS parameters considering the inconsistent data collected from the plant for the present study. This suggests that the plant VSS/TSS was more likely to be the range between 0.75-0.8 as obtained from the model calibration and validation.

Influence of Influent Wastewater COD Fractioning and Nitrogen Fractioning on DWWTP Capacity and Performance
The tCOD in wastewater organic matter is divided into biodegradable and nonbiodegradable components, Equation (4), with a relative proportion of these components known to influence the efficacy of biological treatment processes [11,12,38,44,45]. However, in biological processes such as ASP, further subdivisions do exist, including active biomass (XBH and XBA discussed under Section 3.3.8) that forms part of the tCOD [12,24,44,45].

tCOD = Ss + Si + Xs + Xi
Even though the influence of Ss on the efficacy of ASP has been reported intensively, in the literature, investigation on other components of the COD received lesser attention [45,46]. For instance, the XS fraction and/or substrates can be a significant source of the Ss in the form of organic colloidal and/or particulate that can significantly influence the processes of COD, nitrogenous compounds removal as well as other wastewater treatment processes [46]. As shown in Figure 8c, the CODout and BOD5out decreased from 30 and 15 mgO2/L to about 20 and 5 mgO2/L when the Ss was decreased from 0.1 to 0.3 before stabilizing over the considerable range (0.3-0.7). Afterward, the CODout and BOD5out linearly increased significantly, reaching up to 90 and 70 mgO2/L for Ss = 1, respectively. Despite effective nitrification and denitrification over the whole range of the Ss, which yielded TN, NH3-N, and NO3-N + NO2-N below their respective regulated limits, however, the optimal plant capacity for nitrogenous compounds removal was observed when the Ss was set at a minimum value of 0.8. However, the DWWPT model developed was at Ss = 0.32, which is sufficient to get all effluent quality parameters within the acceptable limit. Contrastingly, the plant capacity for removal of both nitrogenous and carbonous compounds persistently deteriorated as the inert proportion of the particulate COD (i.e., Xi) was increased (Figure 8d). The Xi should be kept below 0.2 to ensure acceptable effluent quality as corroborated by the model's adjusted values (Table 3). Meanwhile, as the Xi = 0.12 and Si = 0.0556 are comparatively low, the model assumes that the higher proportion of the sbCOD (i.e., soluble biodegradable particulate and colloidal COD) effectively underwent extracellular enzymes hydrolyzation and availability for biomass assimilation [30]. On the other hand, Figure 8e shows the relevance of Snh (i.e., NH4/TKN ratio) on TN removal, which suggests that for acceptable plant performance, the Snh should be kept above 0.55. Meanwhile, the Snh has a lesser influence on the CODout and BOD5out, and increasing it improves the effluent quality, which steadied for Snh > 0.45. For both the nitrogenous and carbonous quality parameters, the obtained simulated values of the Snh for the plant data follow the GPS-X default value of 0.9. The ASM1 model adopted in this study considers both XND and XS as transformed into SS and SND, respectively, via hydrolysis [5,45], which is evident from the presented results.
3.3.7. Influence of COD/BOD5, BOD5/TKN, and COD/TKN Ratios on DWWTP Capacity and Performance The ASPs are common, operational under carbon-limited conditions with COD/BOD5 ratio as an acceptable index for evaluating the biological treatability efficacy of municipal wastewater [38,44,47]. The COD/BOD5 ratio of raw domestic wastewaters has usually been reported within the range of 1.25 and 2.50 [38]. Wastewater having the COD/BOD5 ratio below 2 can easily be biodegraded while the biodegradability of sewage is susceptible to be limited if the COD/BOD5 > 3 [48][49][50][51]. With the mean COD/BOD5 of 2.23 for the DWWTP, Figure 9a suggests that the DWWTP performance could be sustained for a quite appreciable range of COD/BOD5 ratio. Moreover, the insufficient biodegradable organic carbon content concerning the nitrogen content in raw DWW influent is one of the limiting parameters for effective biological nitrogen removal. Low BOD5/TN ratio in an influent leads to a quick carbon deficit and an uneven nitrification and denitrification process due to the competition between denitrifying bacteria and other heterotrophs substrate [20,52]. On the other hand, with a lower COD/TKN ratio, ASPs could be in more carbon-limited conditions for some domestic wastewaters, which might be inadequate to attain complete denitrification [48]. However, this is not the case for DWWTP having an average value of 7.89, which is manifested in the high denitrification of by the DWWTP.  9b,c reveal similar trends for BOD/TN and COD/TN ratios, which indicated better DWWTP performance when the ratios are kept comparatively at higher values. This corroborated earlier findings that showed high COD/TN > 5.5 is desirable for achieving efficient nitrogen removal [53]. Similarly, BOD5/TN < 4 suggests nitrification occurring as a separate process for domestic wastewaters, whereas the BOD5/TN > 4 combined approach is more likely to occur [44].

Influence of Influent Wastewater Biomass and Endogenous COD Fractions on DWWTP Capacity and Performance
The effects of organic biomass fractions of the COD are provided in Figure 8. The trends in Figure  10a,b are comparable for both heterotrophic (XBH) and autotrophic (XAH) influent of the biomass organic fraction and the final effluent quality. As both the increase of the fraction, there is a continuous decline of the effluent quality. The obtained calibrated XBA = 0.176 and XAH = 0.142 for the DWWTP indicated that they are quite adequate for the excellent operational performance of the plant. The influence of endogenous fraction UH and UA has shown in Figure 10c,d, respectively, suggests that the dynamics of UA insignificantly influence the plant performance, which contrasted that of UH. For the latter case, an increase in the fraction could substantially improve the quality parameters, mostly the COD. As a consequence, the model corroborates the GPS-X defaults (Table 4) [12]. The endogenous respiration phase in an ASP process considers no addition of an external substrate. The biomass is left on its own, and the substrate is generated via a decay and hydrolysis process. The process results in the release of both non-degradable matter Xi and nutrients, XND [5,7,38,45]. Thus, under this phase, the ASM1 mass balance considers only Ss, Xs, Xi, and XBH [45]. In the mass balance cycle, the production of heterotrophic organisms represented by XBH is lost by the decay XBH, which transforms XBH to Xs. Meanwhile, the generated Xs are lost via hydrolysis leading to the Ss production of which is further used by heterotrophic growth converted to produce XBH at the expense of component So (i.e., respiration). Similarly, the biomass growth and decay follow a similar pattern for the processes involving nitrogen components (XND, SND, and SNH) and nitrifying (autotrophic) organisms (XBA).

Summary and Conclusions
In this study, a systematic approach for calibration of the ASP model for a real municipal wastewater plant activated sludge process was undertaken in GPS-X. The developed model was successfully validated while meeting the assumption of the model's constant stoichiometry and kinetic coefficients for any plant influent characteristics. The developed model was employed for the treatment of plant performance and capacity analysis. The study concludes that: 1. The sizes of the plant's main reactors were optimally designed to handle the scenario during the present study, although the plant performance can sustain higher inflow volumes. 2. Lower influent COD could inhibit the active nitrification and denitrification, while at influent COD beyond 250 mg/L, there is the tendency for effluent quality COD, BOD5, and TN to breach the regulatory limit, implying that the plant performance can be satisfactory for handling even higher influent organic loadings. 3. The plant favorably performed well for nitrogen removal when operated at lower influent NH3−N and TN up to 12.5 and 14 mN/L, respectively. However, above these values, the nitrification and denitrification efficacy would tend to dwindle considerably. 4. The plant could maintain its performance over an appreciable range of MLSS of up to 6000 mg/L.
While above this MLSS value, the BOD5 and nitrogen components removal will have an insignificant effect, yet there could be a dramatic increase in the COD components attributed to a sudden increase in the effluent TN. 5. Higher HRT resulted in better COD and TN removals; in contrast, higher SRT are prone to significantly undermine the ability of the DWWTP to eliminate both COD and TN despite its effectiveness in an ammonia-N reduction under the various investigated operational parameters with better performance when the plant was set to operate at HRT > 6 h and SRT < 7 days. 6. The influence of COD/BOD5 suggests that the DWWTP performance could be sustained for a quite appreciable range of COD/BOD5 ratio, while the plant influent BOD5/TN ratio of 7.89 manifested in results in high denitrification. 7. Better DWWTP performance could be achieved when the BOD5/TN and COD/TN are kept comparatively at higher values. 8. Lower VSS/TSS values were not favorable for the effective removal of both TN and carbonous materials in the wastewater, and the ratio should be maintained above 0.7, yet effective NH3−N oxidization was achievable under the whole range of VSS/TSS. 9. XCOD/VSS has more impact on the effluent wastewater quality compared to the VSS/TSS. Lower XCOD/VSS can significantly hinder the overall plant capacity to treat the wastewater. To ensure the best plant performance and acceptable effluent quality, the influent wastewater XCOD/VSS should be maintained at a value greater than 1. 10. Increasing the Q from 10,000 to 50,000 m 3 /d slightly, decreased the plant's ability to remove COD and BOD5 while resulting in a slight improvement of TN and a decline in effluent NO3-N + NO2-N. Afterward, higher Q values led to the effluent quality (TN, COD, and BOD5) to suddenly increased for Q > 60,000 m 3 /d 11. The WAS has more impact on the effluent quality compared to RAS. Increasing the RAS over a considerable range (3000 to 18,000 m 3 /d) comparatively, exerted an insignificant influence on the plant performance. However, when the WAS increased from 3000 to 9000 m 3 /d, the COD and BOD5 noticeably decreased from 130 and 95 mgO2/L to 40 and 20, respectively, while the TN decreased from 30 to 10 mgN/L. 12. This work further verifies the high potential modeling capabilities of ASM1 executed in GPS-X software for identifying influential and relevant kinetic and stoichiometric parameters and employing them for modeling and understating the influence of operational parameters on real WWTP when respirometry tests data are lacking Author Contributions: O.A. conceived, designed the research idea, and secured the required data. N.D.M. performed GPS-X modeling, analyzed, and interpreted the results. I.A. process required data. All authors participated in writing the manuscript as well as its review. O.A. performed project administration and funding acquisition. All authors have read and agreed to the published version of the manuscript.

Funding:
The authors acknowledge the financial support provided by King Abdulaziz City for Science and Technology (KACST) Saudi Arabia for funding this work through grant number (10-WAT1336-46) and the support of Deanship of Scientific Research (DSR) at Imam Abdulrahman bin Faisal University (IAU).

Acknowledgments:
The authors acknowledge the financial support provided by King Abdulaziz City for Science and Technology (KACST) Saudi Arabia for funding this work through grant number (10-WAT1336-46) and the support of Deanship of Scientific Research (DSR) at Imam Abdulrahman bin Faisal University (IAU).

Conflicts of Interest:
The authors declare no conflict of interest.