1 Introduction

Egypt generates almost 3.5 billion cubic meters of wastewater per year, whereas the existing processing capacity is approximately 1.6 billion m3 per year. By 2017, an extra 1.7 billion m3 of treatment capacity is targeted [1]. The Abu-Rawash WWTP is the largest on the West Bank of the Nile River, serving 8 million people. The daily flow of sludge at Abu-Rawash WWTP reached the total constructed capacity of 2 million m3 per day. As a result, it is necessary to improve the performance in order to cope with the increased wastewater flows caused by population growth and wastewater services, as well as to increase its capacity. Although the capacity building of wastewater treatment plant operators is significant, it will not suffice to cope with the foreseeable rise in municipal wastewater generation. Therefore, untreated charges reaching water bodies will not reduce in years to come. Over 2 million m3/year are generated alone, mainly from Cairo and Alexandria, Egypt’s two biggest cities. In the municipalities, treatment plants serve 55% of the population [2]. The selection and design of wastewater processing plants are heavily dependent on the costs of processes, including investment in capital, operation and maintenance (O&M), land needs, management and disposal of sludge, and monitoring [3]. Egypt has around 57 billion cubic meters (BCM)/year of available renewable water resources. About 97% comes from the Nile; the rest is caused by plaster, which is largely on the north shore. The supply quantity is determined. On the other hand, water demand is growing. It is expected to be 72 BCM a year, of which more than 80% are used in farming [2]. Egypt is an arid country with limited water resources. The current per capita water availability is less than 1000 m3/year and may reach 600 m3/year in 2025, indicating water scarcity. In 2002, it was estimated that approximately 3.5 billion m3/year of municipal wastewater was discharged into the Nile River and the sea, with only 1.6BCM/year treated (about 45%). Industries produce about 1.3 billion cubic meters per year of wastewater released into surface waters, and only a portion of it is treated [4]. Agriculture is the main consumer of water in Egypt, with a share of more than 80 to 85% of the total water demand. Due to overpopulation, inefficient water use, especially in the agricultural sector, and climate change, recycling wastewater has become necessary for sustainable development. Therefore, there must be a proactive step for the regions that are exposed to water scarcity as a proactive step in their environmental and agricultural policies. Major applications of treated water use include agricultural and landsca** irrigation, industrial reuse, and groundwater recharge. Agriculture and landscape irrigation for these applications are widely utilized worldwide, with good health and agronomic practices standards. Sustainable agriculture depends heavily on the state’s ability to protect and manage its water resources [4, 5]. Biological technology is promising because of its simplicity and a promising net positive energy [6]. Even when heating the liquid is required, it could be produced from wastewater containing recalcitrant and toxic organics by different operation conditions and bio-systems. It has been well documented previously how UASB reactors treat sewage and the recommendations for their startup and operation [7,8,9]. There is, however, lacking data about the measures and approaches that can be employed to improve the startup of UASB reactors and aerobic treatment. Furthermore, these studies are geared toward system evaluation rather than accelerating startup and process stability under inhibition.

Therefore, this study aimed to apply a novel strategy for rapid startup and evaluate an integrated anaerobic–aerobic bio-system as a cost-effective and efficient technology for municipal wastewater bioremediation. The study additionally aims to improve bioenergy production under different operational conditions during continuous long-term operation.

2 Materials and methods

2.1 Wastewater collection and characterization

Wastewater samples were collected weekly from Abu-Rawash station in Giza governorate at the first unit operation used (screening) and transported to the lab in a 25-l plastic container to avoid changes in wastewater characteristics. Each time, the wastewater samples were tested on the day of the collection according to the standard methods for wastewater analysis [10] to monitor wastewater quality changes throughout the experiment. The analysis results were compared to water quality criteria specified in Egyptian guidelines (law 48 for 1982) [11] (see Table 1).

Table 1 Analysis of raw wastewater from the Abu-Rawash WWTP and the law 48/1982 for the discharged effluent

2.2 Bio-system configuration and operation

2.2.1 Up-flow anaerobic sludge bed (UASB) reactor

A polyvinyl chloride up-flow anaerobic sludge bed reactor was built for continuous cellulosic industrial wastewater treatment (see Fig. 1). The UASB reactor has a 6-l active volume and was inoculated with mesophilic anaerobic mixed microorganisms. Over the height of the column, different uniformly dispersed sample ports were fitted. A peristaltic pump continually delivered raw wastewater into the reactor under ambient temperature.

Fig. 1
figure 1

Systematic diagram of continuous experimental design

2.2.2 Aerobic reactor

A lab-scale bioreactor with an active volume 6 l was constructed for the anaerobic effluent as a post-treatment (see Fig. 1) under continuous mode. The bioreactor was operated at 27 ± 3 °C temperature, and pH was between 7.6 and 7.9. The system was filled with activated sludge from Gabal El-Asfar Wastewater Treatment Plant (GAWWTP), Madinet Al Khankah, Al Khanka, Al Qalyubia Governorate. A constant-speed pump (RS-628A) provided the air to the bottom of the reactor for mixing and supplying oxygen. A 5300A biological oxygen monitor was used to monitor the DO concentration in the reaction zone. While the pH was not adjusted, it remained constant at 7.3 ± 0.1 throughout the entire operation. In this study, a polyurethane sponge carrier was used, and it was formed into a cylindrical form, 0.3 cm in diameter, and 0.3 cm long. A polyethylene plastic net was used to prevent sponge compaction. The sponge has a specific surface area of 600 m2/m3, a pore size of 0.5 mm, and a density of 2.5 kg/m3.

2.3 Source of microorganisms

The anaerobic mixed microflora was collected from Gabal El-Asfar Wastewater Treatment Plant (GAWWTP), Madinet Al Khankah, Al Khanka, Al Qalyubia Governorate. Table 2 shows the anaerobic inoculum’s characteristics that were passed through a 2 mm sieve and stored at 27 °C.

Table 2 The inoculum chemical and microbiological characteristics

2.4 Biogas production and composition

The gas collecting setup comprised of a water bath and a 1-l capacity inverted graduated plastic cylinder filled with water. The tube is fitted on top of the inverted cylinder so that the gas bubbles up and displaces a size of water equal to the size of biogas generated. The percentage of CH4 was determined by a gas chromatograph (PerkinElmer Clarus 480) equipped with a thermal conductivity detector (TCD) and a stainless steel column packed with a molecular sieve 5A (60/80 3 mm0). The detector and column temperatures were maintained at 100 °C and 70 °C, respectively.

2.5 Retinue analyses

Biological oxygen demand (BOD5), the volatile suspended solids (VSS), volatile solids (VS), total suspended solids (TSS), and total solids (TS) were measured according to the procedures described in the standard methods [7]. Chemical oxygen demand (COD) was estimated by semi-automated colorimetry. The sample, blanks, and standards in screw tubes are heated in a block digester in the presence of dichromate at 150 °C for 2 h. The tubes were spectrophotometrically measured at 600 nm.

3 Results and discussion

3.1 Effect of UASB treatment on bioenergy production and effluent quality

A polyvinyl chloride lab-scale UASB reactor was constructed with a total volume of 6L in this study (Fig. 1 and Table 3). The performance of 336 h of the long-term continuous experiment is presented in Fig. 2. Throughout the course of the experiment, the temperature of the UASB system was maintained at 27 ± 3 °C. The reactor showed efficient energy production from Abu-Rawash WWTP’s wastewater. The experimental results showed that a promising net positive energy could be produced from wastewater under UASB treatment. The biogas production ranged between 48.42 and 148.27 L/m3/day. The effluent of UASB during the time course was constantly monitored. The experimental findings indicated that the anaerobic treatment effluent still included a sufficient level of COD that was required post-treatment to turn it into a safe and clean form [12]. The COD removal ranged between 35.7 and 74.5% under different operational conditions. The previous studies indicated that anaerobic mixed microflora is a promising option for the wide range of varying wastewater compositions.

Table 3 average performance of the UASB reactor and effluent quality
Fig. 2
figure 2

The performance of the UASB reactor

3.2 Effect of HRT on biogas production and COD degradation under UASB treatment

The influence of different HRT times of 12, 6, 3, and 1 h on biogas generation and COD elimination was studied at temperatures ranging from 24 to 30 °C. The performance of UASB treatment was optimized under 6 h HRT, and the best effluent quality was recorded (see Fig. 3). The highest methane output was 8.63 mol CH4 /Kg COD (see Table 4). On the other hand, the reactor demonstrated deterioration in performance at HRT 3 h. This fall might be attributed to a decrease in the contact time of wastewater with mixed microorganisms. The lowest gas recovery efficiency was recorded at HRT 1 h, with a 1.68 mol CH4 /Kg COD value. These findings indicated that the UASB reactor was not resistant to increasing HRT. Previous research found that at a hydraulic retention time (HRT) of 9 h, the UASB treatment achieved 81% COD removal under ambient temperature [13]. However, Chen et al. (2020) reported that when the HRT was decreased to less than 3 h, the removal performance of the UASB reactor declined [14].

Fig. 3
figure 3

Effect of HRT on the methane yield and COD removal under UASB reactor

Table 4 Effect of HRT on biogas production and bioenergy conversion efficiency

3.3 Effect of aerobic treatment on final effluent quality and functional resilience

The analysis of UASB effluent revealed that the effluent still contains enough solids and organics to deteriorate the quality of water bodies if discharged as is [15, 16]. Therefore, an aerobic post-treatment was applied to treat the UASB’s effluent with a total volume of 6 l (see Fig. 1). The experimental findings revealed that the reactor could efficiently treat the UASB’s effluent by raising the HRT (see Table 5). Under HRT 6 h, the fecal coliform count was decreased and the best final effluent quality was obtained. The MLVSS/MLSS ratio was kept constant at 0.75, which is another key finding provided by this configuration (see Fig. 4). Therefore, it could be confirmed that the suggested configuration is an attractive technological option for municipal wastewater remediation. The results also demonstrated that the sponge bio-carriers could improve overall treatment performance and substantially improved MLVSS/MLSS ratio at an appreciated range. Wang et al. (2021) reported that reducing the HRT from 16 to 8 h enhanced sedimentation capacity and biomass concentration. However, the aerobic granular sludge performance deteriorated when the HRT was reduced further from 8 to 4.8 h [17]. Consequently, the combination of anaerobic–aerobic bioprocess enhances biodegradation efficiency and could be applied in a wide range of wastewater containing high COD and emerging organic pollutants [14, 18, 19]. According to Collivignarelli et al. (1990), the anaerobic–aerobic system is a promising treatment option due to its low sludge output and energy consumption. These findings will allow for identifying precise design requirements for the development of more cost-effective treatment plants on a bigger scale [20]. As a result of our research, we proved that the integrated bio-system might be used to directly treat sewage and/or industrial wastewater as a decentralized treatment system in arid and semi-arid locations. The concentration of retained sludge in the aerobic reactor was approximately ten times greater than in the activated sludge process due to the sponge as a bio-carrier. Under 6-h HRT, the bio-system met the effluent discharge standards stipulated by the Egyptian law 48/1982. In Egypt, there are health standards and guidelines that regulate low-quality water reuse for agricultural purposes. TSS, main cations and anions, and fecal coliform bacteria are all commonly used to characterize irrigation water quality. Our innovative technology provided excellent quality irrigation water to promote food safety in conformity with authorized Egyptian requirements.

Table 5 Average performance of aeration reactor and effluent quality
Fig. 4
figure 4

Effect of HRT on fecal coliform count of treated wastewater

3.4 The COD mass balance

The COD mass balance is the perfect concept to understand the hole bio-system performance and bioremediation efficiency [19, 21, 22]. A comparison of the COD mass balance and bio-system performance between two different bioprocesses under different HRTs is shown in Fig. 5. Under the anaerobic stage, the results indicated that the best COD bioconversion reached 55.3% under 6 h HRT on the other hand, a significant deterioration of performance was recorded by increasing HRT, and the lowest COD bioconversion reached 10.7% under 1 h HRT. Although the anaerobic stage showed instability performance by changing HRT values, the aerobic stage could deal with that deterioration. The experimental results showed that the COD removal reached 79.6% under 1 h HRT. These results concluded that the sponge as a bio-carrier improved the overall performance due to maintaining MLVSS/MLSS ratio at an appreciated range. Therefore, this operating strategy can be widely applied to the efficient treatment of mixed wastewater containing a high load of organic pollutants as well as COD conversion into a safe and clean form with energy bioenergy recovery reaching 7.7 MJ/m3 wastewater. The most critical capital cost in terms of economic evaluation would be the major equipment. Because wastewater is a waste that must be treated before being discharged into the environment, no cost will be incurred. The use of sponges as carriers improved treatment efficiency as well as high stability in the presence of inhibitory factors, lowering maintenance costs. The main sources of revenue were biogas production and safe treated water. Therefore, the integrated bio-system can provide an economically feasible alternative for wastewater management in the decentralized concept.

Fig. 5
figure 5

Effect of HRT on total COD mass balance and biodegradability

3.5 Effect of developed bio-system on potentially toxic elements removal

It became clear from the results that the wastewater flowing into Abu-Rawash WWTP is contaminated due to heavy metals or toxic elements. The levels of chromium (Cr), lead (Pb), nickel (Ni), copper (Cu), and manganese (Mn) are higher than the defined limit. The effect of a two-stage bio-system on the potential toxic element removal under different hydraulic retention times (HRT) was investigated (see Table 6). The experimental results showed that the best performance was obtained under HRT of 6 h, and the arsenic was not detected in the raw wastewater. Our developed bio-system had the ability to remove Zn, Mn, and Fe at a high rate of up to 96.6%, which indicates that sulfate reduction leads to the formation of hydrogen sulfide and most heavy metals react with sulfide to form highly insoluble precipitates under the anaerobic stage. On the other hand, under low HRT, the system showed deterioration performance for heavy metal removal, and the lowest removal efficiency was recorded at HRT of 1 h. This drop may be due to the decrease in the contact time of wastewater with microflora [23].

Table 6 Heavy metal removal from wastewater in integrated bio-system

4 Conclusion

This study has investigated the improvement of effluent water quality of Abu-Rawash WWTP’s wastewater using a continuous lab-scale integrated bio-system. The results indicated that the UASB followed by suggested aeration treatment is an attractive biotechnological solution for wastewater treatment challenges. The maximum methane yield was 8.6 mol CH4 kg COD−1 at HRT 6 h. The system was successfully adopted, and the experiment results showed that the COD removal reached 97.6%. In the second stage, the sponge bio-carriers could improve overall treatment performance and final effluent quality.

The study also investigated the effect of long-term operation and different HRT on bio-system performance. From the results, the system showed deterioration with increasing HRT, and the best condition was gained. This operating technique has the potential to be widely used for the effective treatment of wastewater having a high load of organic contaminants, as well as COD conversion into a safe and clean energy source.