Introduction

Wastewater treatment plants (WWTPs) are essential for the cleaning and processing of wastewater in order to prepare its release into the environment (Hamidian et al. 2021). The performance of WWTPs is a measure of their effectiveness in removing pollutants and ensuring treated wastewater meets regulatory standards for safe discharge or reuse (Schellenberg et al. 2020). WWTPs employ a range of treatment methods to eliminate physical, chemical, and biological impurities from wastewater. Primary treatment involves removing of substantial solids by means of procedures such as screening and sedimentation. Next, secondary treatment is implemented, wherein organic matter is decomposed through aeration and biological processes facilitated by microbial action (Asthana et al. 2017; Kanaujiya et al. 2019; Ahmed et al. 2021). To evaluate the performance of WWTPs, several key parameters are monitored. These include Biochemical Oxygen Demand (BOD), which measures the amount of oxygen microorganisms require to break down organic matter (Sonawane et al. 2020); Chemical Oxygen Demand (COD), which indicates the overall level of organic pollutants present (Li et al. 2018); total suspended solids (TSS), which measures the amount of solid particles in the wastewater; and nutrient levels such as nitrogen and phosphorus (Landsman and Davis 2018). The level of effectiveness in removing pollutants is a key measure of performance for WWTPs. The aim is to attain elevated rates of BOD and COD removal, guaranteeing that the treated wastewater complies with the applicable requirements set by environmental authorities. Furthermore, effective removal of suspended solids and nutrients, such as nitrogen and phosphorus, is vital to prevent eutrophication of receiving bodies of water (Gangul and Dewan 2020; Preisner et al. 2020).

As water becomes scarcer and environmental protection becomes more pressing, wastewater's role in integrated water resources management is expanding (Mishra et al. 2021). Utilizing treated wastewater for various purposes is becoming a crucial component of sustainable water management. Based on regional guidelines and the efficacy of the processed wastewater, it can be utilized for many applications like irrigation, industrial operations, and even the replenishment of drinking water (Khan et al. 2022). The performance of the treatment process and the anticipated reuse application must be carefully considered when deciding whether to reuse treated wastewater. It could be essential to perform further treatment procedures like enhanced filtration or disinfection to make sure the water quality satisfies the specifications of the reuse application. In order to ensure that treated wastewater is safe and reliable for reuse, strict monitoring and routine testing are essential (Salgot and Folch 2018). In general, enhancing the efficiency of WWTPs is essential to protect the ecosystem, public health, and sustainable water management techniques. By maintaining high removal efficiencies and implementing appropriate treatment processes, WWTPs can contribute to the safe and effective reuse of treated wastewater, thus conserving precious freshwater resources (Silva 2023).

The performance of WWTPs depends mainly on the water quality of the effluents that are discharged into rivers or water bodies. Therefore, it is significant to study the effects of the treated wastewater on the surface water ecosystem. The effluent of treated wastewater may still contain a variety of chemicals and pollutants, depending on the efficacy of the treatment process (Ahmed et al. 2017). These pollutants, such as heavy metals, medicines, and microplastics, possess the capacity to inflict harm on aquatic organisms and disturb the equilibrium of the ecosystem (Rogowska et al. 2020; Kesari et al. 2021). The discharge of treated wastewater can impact the composition and variety of organisms in the river environment by causing changes in water quality. Certain creatures exhibit greater resilience to fluctuations in water quality, whilst others possess distinct tolerance thresholds (Hamdhani et al. 2020). Treated wastewater discharge can cause a decline in biodiversity by selectively benefiting certain species while disadvantaging others through modifications to the natural environment (Saravanan et al. 2021). Discharges of treated wastewater, especially in large amounts, have the potential to influence the physical characteristics of the river. Heightened water flow has the potential to damage riverbeds, change the patterns of deposition, and affect the distribution of plant and animal species within the ecosystem (Hamdhani et al. 2020). Effluent wastewater frequently contains elevated concentrations of nutrients, such as nitrogen and phosphorus. Although these nutrients are essential for the growth of plants, excessive quantities can result in the proliferation of algae and aquatic plant communities. Eutrophication, a phenomenon, can have detrimental effects on the general well-being of river ecology. Algal blooms have the ability to obstruct sunlight, exhaust oxygen levels, and generate dead zones, which have harmful effects on fish and other aquatic animals (Manasa and Mehta 2020; Tiwari and Pal 2022). Although the emphasis is typically on the negative effects, certain discharged and treated wastewater might yield beneficial outcomes. During periods of low rainfall or in dry areas, processed wastewater can be used to augment river currents, sustain water levels, and provide support to ecosystems reliant on uninterrupted water supply (Hamdhani et al. 2020). In addition, wastewater that is rich in nutrients can serve as a fertilizing agent, boosting the growth and productivity of aquatic plants and serving as a useful food source for fish and other creatures (Carvalho et al 2018). In order to mitigate the negative effects of treated wastewater on river ecosystems, it is essential to employ effective wastewater treatment processes, employ advanced filtration approaches, constantly monitor water quality, and set regulations and recommendations for appropriate release (Teodosiu et al. 2016).

WWTPs utilize various conventional biological methods of treatment to eliminate pollutants and organic materials from wastewater in order to meet the environmental requirements for the effluent before discharging it into the surface water bodies. These techniques employ bacteria that breakdown and destroy organic substances, eventually cleaning the water (Kanaujiya et al. 2019). There are many common biological treatment techniques employed in WWTPs such as: Activated Sludge Process this process involves combining wastewater with a microbial culture called activated sludge within a tank that is equipped with aeration (Widajatno et al. 2022; Yeasmin et al. 2023), Trickling Filters which is utilized the process of moving wastewater over a bed of solid material, such as stones or plastic media, that is inhabited by a biofilm (Ali et al. 2017; Deng 2018), Lagoons or ponds This method is one of the oldest waste management strategies using oxidation ponds that were constructed on affordable property situated in isolated rural areas. (Al-Hashimi and Hussan 2014; dos Santos and van Haandel 2021). These conventional biological treatment methods are employed in combination with physical and chemical processes to achieve effective wastewater treatment. They rely on the inherent ability of microorganisms to break down organic matter, transforming pollutants into less harmful substances (Noor et al. 2023).

Consistent monitoring programmers are necessary for accurate estimations of water quality of wastewater treatment plants due to the time-dependent changes of the water quality factors. This generates a data matrix rich in physical and chemical variables (Ding et al. 2015), which can be challenging to analyze in order to derive useful conclusions and necessitates a systematic approach to process monitoring and analysis (Wang et al. 2022). Multivariate analysis is a method for analyzing and organizing data sets with several variables (Mertler and Vannatta 2016). Multivariate analysis of environmental data can shed light on seasonality-related shifts in both natural and manmade causes (Ismail et al. 2018; Mahmood et al. 2019; Gradilla-Hernández et al. 2020; Hussain et al. 2021; Kareem and Shekha 2022). For decades, it has been used to monitor performance (Zhou et al. 2022). Its usefulness has also been demonstrated in the field of wastewater treatment (Aguado and Rosen 2008; Ebrahimi et al 2017; Zhou et al. 2022; Rahmat et al. 2022). These statistical approaches and exploratory data analysis are the proper strategies for meaningful data reduction and interpretation of multi-consistent physical and chemical observations (Mujunen et al. 1998). Factors Analysis (FA) and other multivariate statistical methods have been widely accepted as objective approaches to the analysis of water-quality data for gaining actionable insights (Fu et al. 2020; Yang et al. 2020; Nafi'Shehab et al. 2021; Yu et al. 2022; Hellen et al 2023).

Evaluating the performance of Al-Rustumiah WWTP became necessary due to the rising population in the Al-Rustamiya WWTP area, which now stands at almost 4 million individuals, which is more than twice the design capacity (Ismail 2013), as well as the lack of enhancements to the processing units since their construction, which may cause deterioration in the quality of the effluent. Therefore, the main aim of the present study is to assess the performance of the Al-Rustumiah wastewater treatment plant using the FA method and identify the most important factors influencing the performance of the Al-Rustumiah WWTP.

Methodology

Description of Al-Rustamiya WWTP

Baghdad is located on a broad plain that is divided into two parts by the Tigris River. The eastern part is called Al- Rusafa, while the western part is known as Al-Karkh. Baghdad, the capital city of Iraq, has a population of over eight million persons and covers an area of around 900 km2. It is considered the most populous and advanced metropolis in the country (AbdulRazzak 2013; Tawfeek et al. 2020). There are 457 individual "sectors" in the city, and sewage systems reach around 82% of those areas (AbdulRazzak 2013). The city of Baghdad has three separate large wastewater treatment plants, namely: The Al-Karkh plant (the old and new projects), the Al-Rustamiya Southern Plant (1st and 2nd extensions), and the Al-Rustamiya Northern Plant (3rd extension) (Ismail 2013).

The Al-Rustamiya wastewater treatment plant (3rd extension) is located in the southern area of Al-Rusafa in Baghdad, approximately 500 m away from the Diyala River. It is covering an area of around 400,000 square meter, which is considered the largest treatment plant in Iraq and the newest of the three Rustamiya plants, as shown in Fig. 1 (AbdulRazzak 2013). The plant has been constructed with a designed capacity of 300,000 m3 per day and a maximum flow rate of 450,000 m3 per day (Ismail 2013). It has been designed by an English company (Haiste Partners Consulting Engineers) from two parallel units of equal size, and each unit consists of two lines of different stages of treatment, as shown in Fig. 2. It has been functional since 1984 and serves more than 1.5 million people per year. The raw wastewater goes through a series of treatment stages within the facility to undergo physical, chemical, and biological processes, such as screens, grit chambers, aeration tanks, primary sedimentation tanks, secondary sedimentation tanks, chlorination, and sludge treatment as it shown in Fig. 2. The purpose of these treatments is to comply with Iraqi regulations for discharging treated wastewater into the Diyala River, with a flow rate ranging from 25 to 650 m3/s (Ismail 2013; Al-Obaidi 2020).

Fig. 1
figure 1

Al-Rustumiah wastewater treatment plant location

Fig. 2
figure 2

Al-Rustumiya Wastewater Treatment Plant Schematic Diagram with and sampling points location

Sampling and analysis

A calculation of the outflow wastewater quality from the Al-Rustamiya WWTP was made using an analysis of physical and chemical parameters. Al-Rustamiya WWTP Office, Mayoralty of Baghdad provided the data that was used in this study, which was then compared to FAO irrigation criteria (FAO 1999) and Iraqi quality standards (IQS) for outflow disposal (IQS 2012). Between January 2012 and December 2021, four physicochemical parameters were measured in the Sewage Treatment Plant (STP)'s raw influents and treated effluents, and the results were represented as annual average values for each parameter. The information gathered included Total Suspended Solids (TSS), Biochemical Oxygen Demand (BOD), Chemical Oxygen Demand (COD), and Hydrogen Ion Concentration (pH). The pH was measured in situ by pH meter. TSS was analyzed using Temperature controlled oven method (Parmer 2019). BOD was estimated using Winkler method (APHA 1998) and finally the COD was analyzed using potassium dichromate as an oxidizing agent (Kolb et al. 2017).

Data treatment and multivariate statistical analysis

The Shapiro–Wilk (W) test was employed to verify normality of distribution before the widespread usage of multivariate statistical methods (Al-Adili 1998). The Shapiro–Wilk (W) test was performed to confirm that the water quality variables had a normal distribution, a prerequisite for their use in factor analysis. In order to make sense of the data, the formula x′ = log10(x) (APHA 2005) was applied to the original variables whose distributions were not normal.

Factor analysis (FA) was performed to identify the most important variables and key contributors to water quality at the AL-Rustamiya WWTP. First, correlation matrices are generated; next, a preliminary set of factors is extracted by the principal component analysis (PCA) method; and finally, the retrieved factors are rotated via the Varimax rotation (Ismail et al. 2015; Al-Ani et al 2019).

$$zj = aj1f1 + aj2f2 + ... + ajfm + eij;j = 1,2,...,p$$
(1)

where Z: the value that measured.

f: the score of factor.

a: the loading of factor.

e the residual term accounting for errors or other sources of variation.

i: number of sample.

j: number of variable.

m: total number of factors.

The statistical analysis was carried out using IBM SPSS.25 software.

Correlation analysis

The correlation analysis assesses the degree of agreement between the chosen variables, particularly when the correlation coefficient approaches + 1 or -1. This indicates a strong linear relationship between the two variables. Therefore, this analysis aims to determine the nature of the relationship between the parameter for water quality (Al-Obaidi 2020).

Removal efficiency

The removal efficiency of BOD, COD, and TSS was calculated using Eq. 2 (Darajeh et al. 2016):

$${\text{\% Removal Effecincy}} = \frac{{C{\text{ inf }} - C{\text{ outf}}}}{{C {\text{outf}}}} \times 100$$
(2)

where:

Cinf: initial parameter concentration.

Coutf: final parameter concentration.

Results and discussions

Factor analysis

Over the course of the study period, four parameters for both the raw (inflow) and processed (outflow) wastewater of the AL-Rustamiya WWTP were subjected to factor analysis and correlation matrix using IBM SPSS 25 (Hussain et al. 2021; Shrestha 2021; Bibi et al. 2023). The variables' correlation matrix was generated using the Centroid method and then factors were eliminated and rotated using Varimax rotation (Yurtseven and Randhir 2020). The Eigenvalue of a component can be used as a measure of its importance; the component with the highest Eigenvalue is the most important. Eigenvalues greater than one are considered significant (Shekha 2016; Howladar et al. 2021). Based on Fig. 3 and the subsequent examination of the factor loadings, the first four factors were taken out while the remaining components were discarded. This means that the majority of the variation in the raw data can be attributed to the first four components. Then, interpretable factor loadings were generated using factor rotation (Varimax) (Despois and Doz 2023). The amount of variation that can be accounted for by the first four criteria is shown in Table 1.

Fig. 3
figure 3

Scree plot of eigenvalues versus components for the observed wastewater quality

Table 1 The explanation of total variance before and after Varimax rotation

The data on the observed water quality shows that the first, second, third, and fourth components, in that order, account for 20.795%, 16.018%, 15.492%, and 13.975% of the total variance, respectively. About 66.279% of the total variation can be attributed to the first four components, while the next four only account for 33.721%.

The factor loadings for the first four components of the observed water quality data are displayed in Table 2. The first factor (F1) had positively significant loads for BODinf, and CODinf, low positive loading for TSSinf, BODoutf and pHoutf, and negative loading for CODoutf, TSSoutf, and pHinf. This factor accounts for 20.795% of the total variation and represents the quantity of organic matter in what enters wastewater to the treatment facility. Therefore, this factor can be termed the pollution factor.

Table 2 Factor loading matrix and cumulative variance explained following Varimax rotation

The second factor, F2, had high positive loading from other factors for pHinf and pHoutf, low positive load for CODinf and CODoutf, and substantial negative loading from BODinf, BODoutf, TSSinf and TSSoutf. This factor accounted for 16.018% of the total variation and represents the pHinf and pHoutf that is related to CO2 concentration via organic matter concentration due to oxidation during the pre-aeration tank unit present in the plant.

The third factor (F3) shows high positive loadings on for CODoutf and BODoutf gradually and explains 15.492% of the overall variation. This factor presents the COD and BOD concatenation in final effluent of the treated water which id depending on the efficiency of removal in the plant. Therefore, this factor can be referred to the efficiency of the WWTP removing the organic pollution factor.

The fourth factor (F4) exhibits high positive loadings on TSSoutf and TSSinf gradually, which is accounting for the least amount of the total variance (13.975%). This factor represents the TSS concentration the raw influent wastewater and effluent treated water and reflect the suspended solids and the TSS removal efficiency.

The results of the factor analysis lead to the conclusion that there are four components, each of which represents a different process: the organic load in the raw influent wastewater and the removal efficiency of the Al-Rustumiah wastewater treatment plant.

Table 3 shows the correlation matrix, which indicates there are weak negative and positive significant correlations between variables, mostly at level (P < 0.01) and less at level (P < 0.05). This weak relation is due to the type of water that has been studied, which is wastewater.

Table 3 Correlation matrix

Removal efficiency

The removal efficiency of BOD, COD, and TSS in the Al-Rustumiah WWTP has been examined using the average annual laboratory data collected for the period from 2012 to 2021, as shown in Table 4. In raw water, the corresponding BOD ranged from 196 to 439.5 mg/l, with a mean value of 264.15 mg/l. The BOD concentration ranged from 20.4 to 41 mg/l in the treated effluent, with a mean value of 30.21 mg/l. The COD in the influent ranged from 296.5 to 469.5 mg/l, with a mean value of 380.01 mg/l. While the residual COD in the final effluent ranged from 30.8 mg/l to a maximum of 76.5 mg/l, with a mean value of 43.22 mg/l. The mean TSS concentration in raw influent was 452.52 mg/l, while the mean TSS concentration in treated effluent was 32.07 mg/l. Even while the TSS content of raw influent rose significantly (between 230.4 and 925.5) mg/l over ten years, the TSS concentration of treated effluent changed relatively little (between 17.6 and 63.6 mg/l) (Table 4). This suggests that the features of the raw influent have no effect on the performance of Al-Rustamiyah WWTP.

Table 4 The mean values of BOD, COD, and TSS and its removal efficiency of for Al-Rustumiah WWTP

The raw wastewater concentration data for BOD, COD, and TSS at the Al-Rustumiah WWTP shows that the BOD concentrations are medium to high, the COD concentrations are weak to medium, and the TSS concentrations are high (Table 5). On the other hand, the treated effluent concentrations have been recorded below the permissible limits for the Iraqi water quality standard for the treated wastewater discharged to surface water bodies (Table 5), excluding the mean values of BOD for the years 2012 and 2021, which were over the limitations as illustrated in Table 4. From 2012 to 2021, Table 4 and Fig. 4 show that the removal efficiency for the BOD, COD, and TSS. The result present that the BOD removal efficiency was 82.75%, 88.58%, 88.57%, 86.06%, 87.21%, 84.60%, 88.55%, 91.46%, 93.17%, and 90.66%, respectively. The BOD removal efficiency’ results did not meet the Union Nations Environment Programme (UNEP)'s typical removal efficiency limit of more than 90% for the activated sludge processing method (UNEP 2011), for the whole study period excluding 2019, 2020, and 2021. The COD removal efficiency got to in this study was consistent with the UNEP's average limitation of 70% for COD removal efficiency (UNEP 2011). The recorded efficiencies for each study year were 75.05%, 88.68%, 88.00%, 86.30%, 88.16%, 86.96%, 91.27%, 92.96%, 93.44%, and 90.26%, respectively. Finally, the removal efficiency for the TSS was 72.38%, 94.36%, 89.42%, 91.54%, 91.56%, 91.00%, 95.11%, 94.76%, 98.10%, and 93.51% from 2012 to 2021, respectively, which gives indication that this is an acceptable level for the whole study period except for 2012, according to the UNEP limitation on TSS removal efficiency, which is limited by 80%(UNEP 2011).

Table 5 Characteristics of raw and treated wastewater for BOD, COD, and TSS (Abbas et al. 2022)
Fig. 4
figure 4

The BOD, COD, and TSS removal efficiency for Al-Rustumiah WWTP

The Al-Rustamiyah Wastewater Treatment Plant's overall efficacy in removing BOD, COD, and TSS more than 88%, 88%, and 91%, respectively, was considered in acceptable matter exclude the BOD treatment which was not satisfied. The clearance rates for BOD, COD, and TSS indicate that there are numerous organic compounds that bacteria can break down. The findings are in complete agreement with the findings of (Ismail 2013) and with (Al-Obaidi 2020) in relation to the outcomes of COD and TSS.

BOD and COD Relationship

The part of the study focused on the impact of BOD on the COD levels in the wastewater entering the Al-Rustumiah WWTP. Figure 5 provides a distinct depiction of the correlation between COD and BOD in the plant. The graph clearly demonstrates a there no linear relationship between BOD and COD, with some degree of scattering according to the R2 value, which is recorded equal to nearly 0.37. The atypical ambiguous pattern may arise due to mistakes in estimating the BOD and COD values in such cases. Due to the association between BOD and COD, it has become feasible and generally dependable to estimate BOD values by utilizing the rapid COD test and the plant-specific Biodegradability Index (BI). Therefore, it can be utilized as an evaluative measure to analyze performance and promptly respond.

Fig. 5
figure 5

The relationship between BOD5 and COD for Al-Rustumiah WWTP

In order to reduce the utilization of these indicators in existing wastewater treatment facilities, it is necessary to develop a link between BOD and COD. In order to establish the BOD/COD correlation for a specific wastewater, it is necessary to get COD and BOD values for many representative samples of the wastewater. Graph the BOD measurements in relation to the COD values, and subsequently utilize regression analysis to ascertain the correlation.

Regularly evaluating the biodegradability index values and comparing them to the average Biodegradability Index (BI) of the particular wastewater treatment plant can help monitor the existence of dangerous and non-biodegradable substances. This, in turn, facilitates the implementation of appropriate preventive measures. Prior to choosing a technology for a biological wastewater treatment plant, it is crucial to comprehend the biodegradability index of the untreated influent wastewater. This selection will greatly affect the quality of the plant's effluent. When the BOD/COD ratio exceeds 0.6, it indicates that the waste is biodegradable and can be efficiently managed through biological means. Seeding is necessary to biologically treat a BOD/COD ratio ranging from 0.3 to 0.6, as the process will be somewhat sluggish due to the time needed for microorganisms to adapt and assist in the decomposition process. If the biochemical oxygen demand to chemical oxygen demand ratio (BOD/COD) is less than 0.3, the wastewater produced by these operations cannot be treated via biological methods due to its poisonous or difficult-to-degrade properties, which inhibit the metabolic activity of bacterial seed.

In the present study, the BI has been calculated using the collected data for the BOD and COD concentration for treated wastewater which has been recorded equal to 0.6225 with standard deviation equal to 0.15326. The correlation between BOD and COD for the Al-Rustumiah WWTP can serve as a benchmark to assess the efficiency of these wastewater treatment plants for prompt intervention, and it may also aid in monitoring the existence of detrimental and non-degradable substances.

Conclusions

In order to examine the effects of population growth and the lack of treatment unit improvements, a FA was applied to assess the performance of the Al-Rustamiya WWTP. The finding reveals there are four factors had percentages of 20.795%, 16.018%, 15.492%, and 13.975%, respectively, with a total of about 66.279% of the overall variation. The WWTP removal efficiency results indicate that the plant achieved removal efficiencies of 88% for BOD, 88% for COD, and 91% for TSS, which is acceptable percentages exclude BOD below the acceptable level. Regression analysis was employed to determine the correlation between BOD and COD as a tool for assessing these WWTPS and determining the need for immediate action. The key factors impacting the performance of the WWTP are the organic load in the influent wastewater and the efficiency of its removal. Therefore, the improvement of the plant units by adopting new techniques is required to meet the desired requirements as well as follow a periodic maintenance program.