Introduction

Water shortages caused by industrialization and urbanization gain attention to the reuse of treated wastewater (Bao and Fang 2012). Furthermore, 4.2 billion people lack access to safely managed sanitation, leaving 2 billion people to consume water contaminated by human feces (WHO 2023). These factors may contribute to the spread of diseases like cholera, dysentery, diarrhea, and typhoid in inhabitants living in these areas. The majority of developed countries have access to clean water and control wastewater pollution. As stated before in the literature wastewater management remains a challenge in low- and middle-income nations, particularly in rural and pre-urban areas (Weerasekara 2017; Hassan et al. 2021).

The produced wastewater from rural areas should be treated before direct discharge to save human health and control environmental pollution (Kamika et al. 2021; Hassan et al. 2022). Rural wastewater treatment has become a growing source of concern (Wu et al. 2011). Moreover, wastewater treatment plants are a significant investment because of their high capital, operating, and maintenance costs. Poor wastewater treatment plant functioning is a result of constrained municipal budgets, a lack of local competence, and a lack of finance in developing nations (Ćetković et al. 2022).

Centralized wastewater treatment systems, which use advanced collection and treatment methods, are typically designed to handle large volumes of wastewater (Hellal et al. 2021; Abdo et al. 2023). As a result, building such systems in peri-urban or small-town communities in low-income countries could put a financial burden on the local population (Chirisa et al. 2017; Liang and Yue 2021). In addition, the establishment of centralized sewage treatment plants in rural areas has many limitations. This requires a large number of pumps, sewerage networks, using of massive pipelines, large excavations, and many necessary access hatches for centralized systems. Governments typically operate these systems for collecting and treating large quantities of wastewater for a large population (Wilderer and Schreff 2000; Angelakis et al. 2022).

Decentralized systems are regarded as the ultimate solution for wastewater treatment in remote villages or towns with low population density. Decentralized systems are easier to use and more affordable than centralized systems, which require significant capital investment in sewerage infrastructure (Capodaglio 2017; Ibrahim et al. 2020; Abd-Elmaksoud et al. 2021). Moreover, the United States Environmental Protection Agency (USEPA) mentioned that decentralized wastewater treatment systems are more suitable for low-density populations with varying site conditions and these systems are more economical than centralized wastewater treatment plants (El-Khateeb et al. 2019).

There are several decentralized wastewater treatment systems such as septic tanks and constructed wetlands have been applied before (Abdel-Shafy et al. 2009; Abdel-Shafy and El-Khateeb 2013). The septic tank is the most commonly used as a decentralized wastewater system exclusive for developing countries (El-Khateeb and El-Gohary 2003; El-Khateeb et al. 2019). If septic tanks are not properly maintained, effluent can overflow into the neighborhood and have a negative influence on local health (Fizer et al. 2018). In turn over for constructed wetland systems, these systems need minimal operation and a small land area, they are inexpensive to operate and construct but still have some drawbacks such as their need for regular maintenance, continuous influent supply, affected by seasonal variations, and might be destroyed by overloads of ammonia and solids (Abdel-Shafy and El-Khateeb 2013; Abdel-Shafy et al. 2017).

The UASB reactors have been commonly used for wastewater treatment, especially in many tropical countries as low-cost technology. These systems have several advantages including; low operation costs, producing low sludge, high pollutants removal efficiencies, and able to produce methane that could be used as bioenergy (Abdel-Shafy et al. 2009; Chernicharo et al. 2015; Vassalle et al. 2020). The UASB process has a number of drawbacks, such as sensitivity to influent solids (which are ineffectively removed and prevent the formation of the granular bed), inability to produce discharge-quality effluent in some countries (100 mg COD/L), difficulty operating at lower temperatures (30 °C), and inability to reactively remove nitrogen or phosphorus, and difficulty managing pH for high-strength wastewaters (Rattier et al. 2022). Depending on the treatment stage and the efficiency of the system, bacterial concentrations can vary widely. For instance, secondary treated effluent might contain bacteria levels ranging from 105 to 107 gene/mL, whereas more advanced treatment processes can reduce this to less than 102 gene/mL (Wéry et al. 2008). Various microbial communities play crucial roles at different stages of wastewater treatment. In the primary and secondary stages, bacteria such as Proteobacteria, Bacteroidetes, and Firmicutes are predominant and help break down organic pollutants (Chen et al. 2022b). Aerobic bacteria oxidize organic matter into carbon dioxide and water (Demirbas et al. 2017), while anaerobic bacteria can convert organic matter to methane and carbon dioxide (Wilkie 2005). Nitrifying bacteria transform ammonia into nitrate, and denitrifying bacteria convert nitrate to nitrogen gas (Yang et al. 2016). The collective metabolic activities of these communities effectively reduce the pollutant load in wastewater. The integration of a DHNW system with UASB significantly enhanced wastewater treatment quality, achieving removal rates of 90%, 78%, 95%, and 72% for COD, BOD, total suspended solids (TSS), and TN, respectively. Moreover, there was a notable 3 log10 reduction in coliform levels (El-Khateeb et al. 2018). A combined approach using UASB/DHS (downflow hanging sponge) and DHNW systems for municipal wastewater treatment resulted in over 90% removal of key pollutants, including COD and BOD, and more than 80% removal of total nitrogen (TN) (Zhao et al. 2021). Therefore, in this study, an innovative system DHNW will be used after the UASB system to improve the treated wastewater effluent. Accordingly, the main objectives of this study were to (1) assess the performance of the innovative compact unit (CU) composed of UASB, DHNW, and ABR on the treatment of raw sewage, (2) study the degradation efficiency of sewage in the CU, (3) characterize by amplicon sequencing, the microbial community, and identify the key microbial community in the different stages of sewage treatment and (4) study the techno-economic approach for the application of the CU.

Materials and methods

The compact unit

The structure of the compact unit for wastewater treatment is as follows; the primary treatment is two overlapping UASB reactors, followed by a DHNW reactor (secondary treatment) and the ABR (tertiary treatment). The effluent of the ABR step is mixed with chlorine and represents the final effluent of the CU. The dimensions of the compact unit are 2.0 × 2.0 × 1.0 m in length, width, and depth, respectively. The dimensions of the UASB reactors are 2 × 1.25 × 1.0 m in length, width, and depth, respectively. The detention time (DT) was kept constant at 5 h in the UASB chamber. One more modification for the compact unit in this study period was that the new upper compartment was combined with the compact unit. The upper compartment is the container for the chlorine used for the disinfection of the final treated effluent in the middle of the piffled reactor. The chlorine container and the middle of the ABR reactor are connected with a controlled dropper (Figure S1). Figures S2 and S3 illustrate the process flow sheet and plant layout of the anaerobic (UASB)/aerobic (DHNW) /anaerobic (ABR) bioreactor compact unit wastewater treatment for 1000 and 10,000 persons used in the economic studies. Moreover, Table S1 shows the operating conditions of the compact unit. The operating conditions did not change during the period from January to December 2022. One sample from each stage was processed for microbial community analysis. The sampling plan considered all the treatment stages and a round of 42 batches of samples were collected during the period extended from January to December 2022.

Physicochemical characterization

Physicochemical characterizations of all stages of the system (i.e., inlet, anaerobic, aerobic, final effluents) were carried out according to the American Public Health Association (APHA 2017). Characterizations include COD, BOD, TSS, total phosphates (TP), total Kjeldahl nitrogen (TKN), ammonia nitrogen (NH3-N), nitrite nitrogen (NO2-N), and nitrate nitrogen (NO3-N).

DNA extraction, PCR amplification, and 16S rRNA amplicon sequencing

An analysis was performed on prokaryotic communities using a portion of all water samples (~ 500 mL) that were obtained and filtered through 0.22 μm membrane filters (Millipore, Bedford, MA, USA) (Gad et al. 2020). The filters were stored at − 20 °C until DNA extraction. DNA has been extracted from the filters by using the DNeasy PowerLyzer PowerSoil Kit (QIAGEN, USA), according to the manufacturer’s instructions. To amplify the V4-V5 region of prokaryotic 16S rRNA genes, a universal primer pair consisting of 515F (5′-GTG YCA GCM GCC GCG GTA-3′) and 907R (5′-CCG YCA ATT YMT TTR AGT TT-3′) was utilized (Quince et al. 2011). The PCR amplification cycles for 16S rRNA genes consisted: of initial denaturation at 95 °C for 5 min, followed by 25 cycles of 95 °C for 30 s, 55 °C for 30 s, and 72 °C for 90 s, and a final extension at 72 °C for 10 min. Each PCR reaction was performed in a 25-μL reaction volume, consisting of 12.5 μL of the AmpliTaq™ Gold PCR Master Mix (2 ×) (Applied Biosystems, CA, USA), 0.4 μM of each primer and ~ 20 ng DNA template. Once the PCR product was obtained, it was purified and quantified using a previously described method (Hu et al. 2017). The purified PCR products were sequenced on an Illumina MiSeq platform (Illumina Inc., San Diego, CA, USA) with a paired-end approach (2 × 250 bp).

Sequence analyses

The DADA2 v1.1.3 software was utilized to denoise and assemble the raw paired-end reads, as well as cluster high-quality reads into amplicon sequence variants (ASVs) at 100% sequence identity, as previously described on the website (https://benjjneb.github.io/dada2/tutorial.html) (Callahan et al. 2016). Taxonomic assignment of the 16S rDNA reads was carried out using SILVA v138 by the RDP classifier (Klindworth et al. 2013; Quast et al. 2013). In order to standardize the uneven sequencing effort, all samples were subsampled randomly to match the smallest library size of 64,000 reads. The resulting analysis retained 10,188 prokaryotic ASVs after rarefying.

Parasite analysis

The parasite analysis was conducted on all collected batches. The sample volume for helminths ova quantification and molecular detection of protozoan pathogens was 5 L and 1 L per sample, respectively. Parasitic nematode ova were detected microscopically after floatation using zinc sulfate (Moodley et al. 2008). The protozoan pathogens investigated in this study were Cryptosporidium spp. and microsporidia. The used primers for microsporidia were PMP1, and PMP2, Cry-9, and Cry-15 (Spano et al. 1997; Fedorko et al. 2001). PCR was performed in a 25-µL using a Cosmo PCR red master mix (Willowfort company, Birmingham, UK) to detect the target protozoa in the samples. The reaction mixture contained 5 µL of the DNA template, 12.5 µL of the master mix, 0.5 µL of forward and reverse primers, and 6.5 µL of nuclease-free water. The predenaturation step was performed at 95 °C for 5 min, followed by 35 cycles of 30 s at 95 °C, 30 s at 55 °C, and 45 s at 60 °C. As a negative control, nuclease-free water was also included in each test.

Statistical analysis

The significance of differences in physicochemical parameters among the treatment stages of the treatment system was tested using permutational multivariate analysis of variance (PERMANOVA) and analysis of similarity (ANOSIM). The structure of prokaryotic communities between different treatment stages was characterized using nMDS. To examine the relationship between bacterial communities and physicochemical factors in the treatment system, RDA was employed. The predicted ecological and metabolic functions of the prokaryotic communities were inferred from taxonomy by a versatile Python script (collapse_table.py) and the FAPROTAX database (Louca et al. 2016). Statistical analyses and visualization were conducted using Origin (Pro) 2021 (OriginLab Corporation, Northampton, MA, USA), PRIMER v.7.0.21 (Quest Research Limited, Auckland, New Zealand), and R v4.2.2 (https://www.r-project.org/).

Results and discussion

The performance of the sewage treatment via the compact unit

The results of PERMANOVA (p < 0.001) and ANOSIM (p < 0.001) revealed that the treatment stages had a great influence on the variation of the physicochemical parameters. pH ranged from 6.8 to 7.8, confirming that the treatment sequence was standard for all stages of the proposed treatment. The average values of influents for COD, BOD, TSS, TKN, and TP were 387, 296, 140, 38.6, and 6.2 mg/L and these values reduced to 136, 99, 41, 34, and 5 mg/L, respectively, after anaerobic treatment and further reduced to 58, 25, 13, 15, and 3.9 mg/L after aerobic treatment (Fig. 1). The overall removal percentages corresponded to 85, 91, 90.7, 60.5, and 37% respectively, after all steps of the treatment. The current results are comparable with the results of Mahmoud et al. (2009), who used a combination of two systems for the treatment of municipal wastewater, the first anaerobic treatment and the second aerobic treatment. The removal of COD and BOD in that study reached 89 and 95%. However, our system is more economical, as shown in the following results. The results from our study revealed a significant positive correlation between pollutants removal (e.g., BOD, COD, and TSS) and temperature (Fig. 2). This implies that the efficiency of the integrated biological treatment system was heightened during the summer. For instance, the average removal rates for COD, BOD, TSS, and TKN in summer were 91.95%, 94.18%, 96.82%, and 57.22% respectively. In contrast, during winter, the corresponding removal rates for these parameters were 88.38%, 92.19%, 93.69%, and 53.69%.

Fig. 1
figure 1

The physicochemical characterization of wastewater in different treatment stages

Fig. 2
figure 2

Correlogram showed the correlation between the removal of different environmental parameters and bacterial indicators in the integrated wastewater treatment unit. The blue color gradient indicated positive correlation levels; the red color gradient indicated negative correlation levels. *** P < 0.001, ** P < 0.01, *P < 0.05

Temperature plays a pivotal role in influencing microbial diversity within wastewater. It is well understood that temperature fluctuations can often be attributed to climatic conditions, sampling intervals, and the duration of daylight. Previous research has underscored the intricate interplay between organic pollutants and microorganisms, which is modulated by temperature variations (Sun et al. 2021; Muloiwa et al. 2023). In a study from the same area as ours, recorded wastewater temperatures ranged from 19.8 °C in winter to 34.8 °C in summer. Additionally, the summer months exhibited elevated concentrations of coliform and bacterial pathogens (El-Liethy et al. 2022). Consistent with this, our study found higher coliform concentrations and a reduced rate of coliform removal.

Richness, diversity, and taxonomic complexity of the bacterial community through the whole treatment steps

In this study, nMDS based on Bray–Curtis similarity index was carried out to characterize the microbial community in different wastewater treatment processes. The results showed an apparent dissimilarity of bacterial community composition among inlet, outlet, and sludge samples. Moreover, there was an obvious similarity in bacterial community composition in anaerobic and aerobic wastewater treatment processes as shown in Fig. 3. This similarity could be attributed to the aerobic stage following the anaerobic one. The Venn diagram analysis was conducted to identify the unique and shared ASVs in each treatment step of the compact wastewater treatment unit (Fig. 4). A total of 10,188 ASVs were detected across all wastewater treatment steps, with 1880, 1389, 1455, 2507, and 2318 unique ASVs in the inlet, anaerobic, aerobic, outlet, and sludge samples, respectively. The analysis revealed that 623 ASVs (6.12%) were shared between the anaerobic and aerobic stages, and only 7 ASVs (0.07%) were shared among the inlet, anaerobic, and aerobic stages. Only 3 ASVs (0.03%) were shared between the outlet and sludge samples (Fig. 4). Additionally, a small number of ASVs (0.02%) was found to be present among the anaerobic, aerobic, and outlet stages, as well as between the aerobic stage and sludge samples, while the fewest ASVs (0.01%) were observed between the inlet and anaerobic stages (Fig. 4). Figure 5A illustrates the distribution of bacterial phyla in different treatment stages, including the inlet, anaerobic, aerobic, outlet, and sludge samples.

Fig. 3
figure 3

Non-metric multidimensional scaling (NMDS) of bacterial community composition based on Bray–Curtis similarity index

Fig. 4
figure 4

A Venn diagram showing the unique and shared amplicon sequence variants (ASVs) among the different treatment stages

Fig. 5
figure 5

A Relative abundance of bacterial communities at the top ten phyla. B Relative abundance of bacterial communities at the top ten orders. Others refer to the less contributed taxa and unclassified taxa

The most prevalent phyla were Proteobacteria, followed by Bacteroidota in the inlet, anaerobic, and outlet samples (Fig. 5A). Ye et al. (2017) also reported that Proteobacteria were the most abundant phylum in the anaerobic/anoxic/aerobic process of domestic and food wastewater samples, while Zeng et al. (2022) found that Proteobacteria and Bacteroidetes were the most abundant phyla in oxidation ditches of domestic wastewater. In addition, Zeng et al. (2022) reported that Proteobacteria and Bacteroidetes were the most common phyla in industrial wastewater treatment plants using anoxic/oxic (AO) and anoxic/oxic membrane bioreactor (AO-MBR) units. It was noted that Proteobacteria and Bacteroidetes were the dominant bacteria in the anaerobic system used for biogas production from farm wastes (Tawfik et al. 2021).

When comparing alpha diversity indices across the various wastewater treatment stages, the outlet stage was found to have the highest values (Figure S4). In the inlet sample, the highest relative abundance phyla were Proteobacteria (30%), Bacteroidota (18.8%), Actinobacteriota (14.9%), Firmicutes (12.4%), and Fusobactereriota (7.5%) (Fig. 5A). This finding is consistent with El-Liethy et al. (2023), who found that the most abundant phyla in the Egyptian domestic wastewater were Proteobacteria (24.45–94.83%), Bacteriodetes (0.5–44.84%), and Firmicutes (3.72–67.40%). In the anaerobic step, the most prevalent phyla were Proteobacteria (30.5%), Bacteroidota (22.8%), Firmicutes (21.4%), and Actinobacteriota (12.4%). Xue et al. (2023) found that the most dominant phyla in anaerobic sequencing batch reactors were Firmicutes (17.40%), Bacteroidota (16.55%), and Actinobacteriota. Firmicutes are frequently found during wastewater treatment at anaerobic conditions, indicating active hydrolysis and methanogenesis steps (Xu et al. 2017), while Actinobacteriota could enhance the biodegradation of organic compounds as mentioned in the literature (Fu et al. 2019).

In the aerobic process sample, the most abundant phyla were Proteobacteria (44.2%), Actinobacteriota (16.6%), Bacteroidota (13.2%), and Firmicutes (10.7%). In addition, Proteobacteria (36.9%), Bacteroidota (22.5%), Firmicutes (9.7%), and Actinobacteriota (9.5%) had the largest relative abundances in outflow samples. In the wastewater anaerobic sludge, the most dominant phyla were Proteobacteria (37%), Actinobacteriota (24.3%), Bacteroidota (13.6%), and Firmicutes (8.9%) (Fig. 5A). Meerbergen et al. (2017) reported that Chloroflexi, Planctomycetes, Acidobacteria, and Chlorobi were the most prevalent phyla in activated sludge of WWTPs. Additionally, sulfate-reducing bacteria were more prevalent in industrial WWTPs, while both nitrifying and denitrifying bacteria were more prevalent in municipal WWTPs (Meerbergen et al. 2017).

The provided Fig. 5B shows the relative abundances of the top 10 microbial orders in different wastewater treatment stages. The anaerobic inlet stage has the highest relative abundance of Bacteroidales (19.78%), while the aerobic and outlet stages have the highest relative abundance of Burkholderiales (> 18.59%). This suggests that the two stages may have different microbial communities with different functions in the treatment process. These findings are consistent with previous studies that have shown significant changes in microbial communities during the wastewater treatment process (Gu et al. 2022). It is important to note that the microbial communities in the wastewater treatment system are dynamic and can be influenced by various factors such as the type of organic matter, temperature, pH, and hydraulic retention time (HRT). In the inlet of the UASB system, the most abundant bacterial community orders were Fusobacteriales, Rhodobacterales, Lachnospirales, and Enterobacterales. During anaerobic wastewater treatment, the dominant orders were Desulforvibrionales, Veillonellales, Selenomonadales, Synergistales, Eubacteriales, Peptostreptococcales, Lactobacillales, Bacteroidales, and Oscillospirales. In the aerobic wastewater treatment stage, the most common orders were Thermomicrobiales, Propinibacteriales, Halothiobacillales, Xanthomonadales, and Rhizobiales (Fig. 6). Zhao et al. (2014) reported Rhizobiales and Burkholderiales as the most abundant orders in aerobic tanks of wastewater treatment plants in 8 Chinese cities. In the present study, the most frequent orders in the sludge sample were Frankiales, Corynebacteriales, Clostridiales, and Micrococcales (Fig. 6). It was observed that the top 10 dominant orders in activated sludge of municipal wastewater treatment plants were determined as Sphingobacteriales, Anaerolineales, Actinomycetales, Clostridiales, Burkholderiales, Caldilineales, Rhizobiales, Acidimicrobiales, TM7_order_IS, and Rhodocyclales (Zhao et al. 2014). Similar studies found Hydrogenophilales and Pseudomonadales, respectively, as the dominant orders in sludge from wastewater treatment plants (Meng et al. 2016; Ban et al. 2022).

Fig. 6
figure 6

Heatmap for the microbial community at order level, the highly contributed orders

RDA is a multivariate statistical technique that can be used to identify correlations between microbial communities and physicochemical parameters in wastewater treatment systems (Muyzer et al. 1993). In a study by Wu et al. (2011), RDA was applied to investigate the microbial community composition and its relationship with the performance of a UASB reactor treating pharmaceutical wastewater. The study found that Campylobacterales, a group of Gram-negative bacteria, showed a strong positive association between COD and BOD in inlet, anaerobic and anerobic stages (Fig. 7). These parameters are commonly used to assess the organic loading and treatment performance of wastewater treatment systems (Tchobanoglus et al. 2003). The positive correlation between Campylobacterales and COD or BOD suggests that these bacteria may serve as bioindicators of treatment performance in UASB reactors. Previous studies have also reported the presence of Campylobacterales in various wastewater treatment systems, including activated sludge and anaerobic digestion (Qiao et al. 2013). The ability of Campylobacterales to degrade complex organic compounds and their resistance to various environmental stresses, such as high salinity and low pH, may explain their presence in wastewater treatment systems (Gupta et al. 2018). The RDA analysis indicated that nitrate and nitrite denitrification groups were correlated negatively with NO2-N and NO3-N (Fig. 8). Denitrification is a process by which bacteria convert nitrate (NO3-N) and nitrite (NO2-N) into nitrogen gas (N2). A negative correlation with NO2-N and NO3-N suggests that as denitrification bacteria thrive, the levels of these nitrogen compounds decrease. This aligns with the role of denitrifying bacteria in reducing nitrogen compounds (Huang et al. 2017). The aerobic chemoheterotrophy displayed a positive correlation with TSS, COD, and BOD (Fig. 8). Heterotrophic bacteria exhibit the ability to utilize various organic compounds as sources of energy. These compounds encompass carbohydrates, fatty acids, and amino acids (Mara and Horan 2003). Furthermore, the function groups of bacteria including nitrate respiration and nitrogen respiration, and nitrate reduction demonstrated a positive correlation with NH3-N and TKN (Fig. 8). The conversion of nitrate to diverse gaseous nitrogen forms (e.g., nitric oxide, nitrous oxide), subsequently lost to the atmosphere, takes place under conditions characterized by limited oxygen. During this process, anaerobic bacteria utilize nitrate in respiration, facilitated by the presence of a carbon source such as organic matter (Tiedje et al. 1984).

Fig. 7
figure 7

RDA showed the relationship between bacterial community and physicochemical factors in the treatment system

Fig. 8
figure 8

RDA showed the relationship of the most important bacterial functional groups and physicochemical factors in the treatment system

The network analysis conducted in this study revealed a positive correlation between several different phyla in the integrated treatment systems. Specifically, Actinobacteriota, Bacteroidota, Campylobacteriota, Chloroflexi, Desulfobacterota, Firmicutes, Fusobacteriota, and Proteobacteria were found to be positively correlated with each other (Fig. 9). This result suggests that these bacterial phyla may work in synergy to degrade and remove pollutants in the treatment systems. Similar findings were reported in a study by Chen et al. (2022a, b), which found that the microbial community structure in an integrated vertical-flow constructed wetland was highly complex and composed of multiple phyla that were positively correlated with each other. The authors suggested that this positive correlation between different bacterial phyla may be due to the complementary metabolic functions of different microorganisms, leading to the efficient removal of pollutants from wastewater. Overall, the positive correlation between different bacterial phyla in the integrated treatment systems suggests that these systems may be highly effective in removing pollutants from wastewater, as multiple microbial communities work together to achieve this goal.

Fig. 9
figure 9

Co-occurrence network using ggClusterNet R package showing the correlation between bacterial ASVs in the wastewater treatment system. A connection stands for a strong (Spearman’s r > 0.8) and significant (adjusted p value < 0.001) correlation. The nodes represented the top 50 ASVs and their sizes showed their mean abundance

The study reports the efficacy of an integrated wastewater treatment system in removing parasitic nematodes, Cryptosporidium, and microsporidia. The results show that the system was able to achieve removal efficiencies of 66.67%, 62.5%, and 40.5% for parasitic nematodes, Cryptosporidium, and microsporidia, respectively (Fig. 10). These findings are consistent with previous studies that have demonstrated the effectiveness of UASB-based systems in removing parasitic organisms from wastewater (Jimenez 2007; Yaya-Beas et al. 2015). The detection of Cryptosporidium in the inlet samples is concerning, as this parasite is known to cause gastrointestinal illness in humans and animals. The fact that the number of positive samples decreased from 8 to 3 in the outlets suggests that the UASB + DHNW + ABR system was effective in removing this pathogen from wastewater. Similarly, the reduction in the number of positive samples for microsporidia in the outlets also indicates the system's effectiveness in removing this parasite. The presence of Ascaris ova in inlet and outlet samples is consistent with previous studies that have reported the prevalence of this parasite in wastewater (Yaya-Beas et al. 2015; Nasr et al. 2019). The fact that the number of positive samples decreased from 6 to 2 in the outlets suggests that the integrated system was effective in removing this parasite. Overall, the results of this study suggest that the integrated wastewater treatment system (UASB + DHNW + ABR) is effective in removing parasitic nematodes, Cryptosporidium, and microsporidia from wastewater. However, further studies are needed to investigate the effectiveness of the system in removing other pathogens and to evaluate the long-term sustainability of the system.

Fig. 10
figure 10

Occurrence and removal of parasites in the treatment system

Economic assessment

The techno-economic evaluation of the industrial scale wastewater treatment plant according to the definition of capital cost estimation (McCabe et al. 1993; Sinnott et al. 2005), the economic estimation in this study is classified as ‘‘study estimate’’. It is based on the process description and sizing of major process equipment as will be discussed in the following results. The anaerobic/aerobic bioreactor compact unit was based on the following assumptions: Community population 1000- and 10,000 persons water consumption 150 L/day (54 m3/year), wastewater plant capacity 54,000 and 540,000 m3/year (150 and 1500 m3/day), operating days for the wastewater treatment plant was assumed to be 360 days/year, a lifetime for equipment was assumed to be 25 years, treated wastewater sell price, 0.2 $/m3.

Total capital investment (TCI)

The total capital investment for the community population of 1000 and 10,000 persons in the compact unit is shown in Table 1. The fixed capital investment (FCI) is defined as the investment needed to make the plant ready for starting-up and it includes the costs of equipment; wastewater storage tank, screen, water pumps, the compact unit, treated water storage tank, land, field measurement instrument, piping, and installation cost. The cost estimation was conducted based on two scenarios, the first one considering the contingency cost and auxiliary facility, and the second one excluding the contingency cost and auxiliary facility. The total capital investment for the community population of 1000 and 10,000 persons including contingency costs and auxiliary facilities are $51,147 and $159,093, respectively, while the total capital investment for the community population of 1000 and 10,000 persons excludes contingency costs and the auxiliary facility is $43,733 and $134,800, respectively.

Table 1 Total capital cost include and exclude contingency and auxiliary facilities during the period extended from January to December 2022

Total operating cost (TOC)

Tables 2 and 3 illustrate the overall operating costs for communities of 1000 and 10,000 people, divided into direct and indirect operating costs that include and exclude operational supplies, laboratory charges, indirect manufacturing costs, and general expenditures. The direct manufacturing cost (DMC) includes energy, labor, maintenance, operating supplies, and laboratory charges. The indirect manufacturing costs include overhead, local taxes, and insurance. The general expenses include administration and research and development costs. The total cost includes the total operating cost (direct and indirect manufacturing costs and general expenses) and depreciation. For the labor cost, it was estimated at 133 $/month; the electricity cost was 0.1 $/KW h, and the treated water price is 0.2 $/m3.

Table 2 Total cost (direct and indirect operating cost), profit, and payback period include maintenance, operating supplies, laboratory charges, indirect operating costs, and general expenses during the period extended from January to December 2022
Table 3 Total cost (direct and indirect manufacturing cost), profit, and payback period exclude maintenance, operating supplies, laboratory charges, indirect operating costs, and general expenses during the period extended from January to December 2022

Cost analysis

According to the cost analysis, the total cost of wastewater treatment for communities of 1000 and 10,000 people, including maintenance, operating supplies, laboratory charges, indirect operating costs, and general expenses, is $9,916 and $17,919, respectively, and the cost of a cubic meter of treated wastewater is $ 3.13 and $ 0.6. The profit for 1000 community populations is not feasible (− $598). However, the profit for 10,000 community populations is $85,223, and the payback period for 10,000 community populations is 1.87 years (22.44 months). While the total cost of community populations of 1000 and 10,000 persons, excluding maintenance, operating supplies, laboratory charges, indirect operating costs, and general expenses are $7089 and $10,739, respectively, the cost of a cubic meter of treated wastewater is $0.13 and $0.02, respectively, the profit for community populations of 1000 and 10,000 is $3711 and $97,261, the payback period of community populations of 1000 and 10,000 is 11.79 years (141.5 months) and 1.39 years (16.68 months).

Conclusion

The compact integrated wastewater treatment unit was effective in reducing the physicochemical parameters of the wastewater with removal percentages of 85, 91, 90.7, 60.5, and 37% for COD, BOD, TSS, TKN, and TP, respectively. The microbial community composition varied among the different treatment stages, and a clear dissimilarity was observed between inlet, outlet, and anaerobic sludge samples. Proteobacteria was the most prevalent phylum in all samples, followed by Bacteroidota, and Actinobacteriota. The anaerobic and aerobic stages showed an obvious similarity in bacterial community composition, which may be attributed to the sequence of the treatment. The results of this study indicate that the treatment unit is a promising and economical technology for wastewater treatment.