1 Introduction

Anaerobic treatment systems have become popular for both domestic sewage treatment and wastewater treatment of a wide variety of industries such as breweries and beverages, distilleries and fermentation, chemical, pulp and paper, food, and landfill leachate (Ersahin et al. 2011; Fang 2010; Noyola et al. 2012).

Beyond the organic load, some industrial activities are responsible for producing effluents with high nitrogen loads, such as petrochemical industry, slaughterhouse, tannery, and rice parboiling (Browner et al. 2000).

In the same way, domestic sewage is an important contributor to nitrogen loads, in form of organic and ammonia nitrogen in effluents without treatment and nitrite and nitrate nitrogen after aerobic treatment, produced by the nitrification process (Tchobanoglous et al. 2003).

To prevent nitrogen from being disposed into water bodies, techniques that combine the removal of nitrogen and carbonaceous matter in anaerobic reactors can be implemented for wastewater treatment.

The upflow anaerobic sludge blanket reactor (UASB) and the anaerobic filter (AF) are anaerobic treatment systems commonly used for domestic sewage and industrial wastewater treatment. According to Noyola et al. (2012), the UASB reactor is the third most used for sewage treatment in the analysis of 2734 municipal plants in 6 Latin American and Caribbean countries. UASB reactors are considered a consolidated technology, especially in Latin America where several full-scale plants have been treating domestic sewage with UASB for over 10 years (Chernicharo et al. 2015). Likewise, Indian government decided to implement UASB full-scale reactors to improve water quality, evidencing that the technology has been recognized worldwide (Stazi and Tomei 2018). The AF is also widely used in decentralized areas in Brazil and by important sanitation companies for domestic sewage centralized treatment (Singh et al. 2015).

The wastewater treatment by anaerobic reactors is well consolidated in terms of carbon removal. According to van Haandel and Lettinga (1994), a UASB reactor is able to remove organic matter by 65–80%. Comparable results were found by Kodera et al. (2017), Mateo-Sagasta Dávila et al. (2009), Niu et al. (2018), Parawira et al. (2006), and Souza et al. (2011).

Although both UASB and AF systems operate as high rate anaerobic reactors, the biological process for UASB is based on suspended growth and for AF is based on attached growth (Tchobanoglous et al. 2003). Therefore, high sludge age in AF is expected and consequently high removal efficiency as described by Sánchez et al. (1995) and Azevedo et al. (2018), although some authors have found comparable organic matter removal efficiency for both reactors or even higher efficiency for UASB (Parawira et al. 2006).

But anaerobic reactors have negligible effect on the removal of nitrogen and phosphorus and might increase the ammonia concentrations in the effluent (Saliba and Von Sperling 2017). Therefore, in order to enhance the removal of organic matter and to enable nitrification, there is a need for an aerobic post-treatment.

It is worth mentioning the most frequently applied flow sheets in the so-called combined systems (anaerobic/aerobic), such as UASB + polishing ponds; UASB + overland flow system; UASB + wetlands; UASB + trickling filter (TF); UASB + activated sludge (AS); and UASB + flotation unit (Chernicharo et al. 2015; Von Sperling and Chernicharo 2005). However, such treatment systems only enable nitrification to occur, not promoting the effective removal of nitrogen through denitrification.

In many developing countries that apply anaerobic technology, there are still no nitrogen release standards, but observing international legislation, it can be inferred that this will be required in the future. For example, in Europe, the requirement for discharge of sewage treatment plants in areas subject to eutrophication is defined as lower than 15.0 mg L−1 of total nitrogen (Council Directive 91/271/EEC 1991). In the USA, concentrations equal to or less than 3.0 mg L−1 of total nitrogen are becoming common (USEPA 2009).

Thus, it is important to seek the removal of nitrogen while maintaining the design of existing systems, which are composed by the association of anaerobic and aerobic reactors, as mentioned above. The denitrification process can be combined with carbon source supply by the raw effluent in existing systems, improving the nutrient removal (Al-Zreiqat et al. 2018; Polprasert and Park 1986; Silva et al. 2015; Zhao et al. 2015). In such case, the anaerobic reactor should only treat a part of the raw sewage of the influent (possibly no more than 50–70%). The remaining part (30–50%) should be directed to the complementary biological treatment, aiming at nitrification and denitrification, so that there can be enough organic matter for the denitrification step (Chernicharo et al. 2015).

Another possibility would be the recirculation of the nitrified effluent to the anaerobic reactor. However, this recirculation might cause problems to the system, especially those related to the biomass adaptation and hydrodynamic characteristics. Several factors can affect the hydrodynamic behavior of reactors and consequently its overall efficiency, such as the gas bubbling due to biogas production in the anaerobic digestion (Levenspiel 1999; Peña et al. 2006; Renuka et al. 2016; Zheng et al. 2012). Some results in the literature indicate the production of gases, which promote stirring in the reactors, increase the mixing characteristics in UASB and AF reactors. It can improve mass transfer rates leading to greater efficiencies (Mao et al. 2015), but also can increase sludge loss (Méndez-Romero et al. 2011; Quaff and Guha 2011; Renuka et al. 2016), depending on the mixing level promoted.

The mixing in reactors can also affect the biomass size characteristics, the micro-environment characteristics, and flocs of microbial communities (Han et al. 2012; B. Jin and Lant 2004; Jin et al. 2012; Xue et al. 2016). In addition to gas production, a change in the substrate composition between the process of methanogenesis and denitrification is responsible for modifying the biological diversity (Leal et al. 2016; Lu et al. 2014; Mac Conell et al. 2015; Shen et al. 2013).

To understand the effect of the denitrification on overall behavior of the reactors, this study aimed at comparing the AF and UASB in terms of organic matter and nitrogen removal efficiencies using synthetic medium to simulate the recirculation of nitrified effluent to an anaerobic reactor in secondary treatment. Besides the evaluation of the denitrification efficiency, the research also sought to understand possible interferences of nitrogen removal process in the hydrodynamic behavior of the reactors, the characteristics and diversification of biomass, and the quality of the biogas to be used for energy generation.

2 Materials and Methods

The AF and UASB reactors were constructed using polyvinyl chloride (PVC) tubes with 50 mm diameter and 800 mm liquid height (Fig. 1). The AF was filled with plastic support media (Kaldnes K1; nominal diameter: 9.1 mm; nominal length: 7.2 mm; specific biofilm surface area: 500 m2 m−3). The working volumes of the AF and UASB were 920 mL and 1220 mL, respectively. Synthetic wastewater was pumped into the bottom of the reactors by a peristaltic pump and flowed upwards. Sampling taps were set before reactor inlet (A—raw effluent) and at heights 266 mm (U1—UASB and F1—AF), 532 mm (U2 and F2), and 800 mm (U3 and F3—outlet), for analysis at various stages of treatment.

Fig. 1
figure 1

UASB (I), AF (II), and gas-liquid-solid separator (III). Dimensions in mm

A gas-liquid-solid separator was installed in both reactors, for gas sampling. However, after operation started, the biogas collection was better performed at the same point as effluent outlet, through a liquid-gas separator system. The sludge samples were collected at the bottom of the reactors. The reactors were maintained at a constant mesophilic temperature of 30 °C with a water jacket (B).

The synthetic wastewater had the following composition: sucrose (38.5 mg L−1), starch (125.4 mg L−1), cellulose (37.4 mg L−1), meat extract (228.8 mg L−1), soy oil (56.1 mg L−1), NaCl (138.0 mg L−1), MgCl2.6H2O (3.9 mg L−1), CaCl2.2H2O (2.5 mg L−1), and NaHCO3 (220.0 mg L−1). KNO3 was used to incorporate different concentrations of NO3-N in the same synthetic wastewater.

2.1 Experimental Procedure

The inoculum used in the reactors was obtained from an anaerobic filter that had been in operation for over 10 years, treating an effluent with domestic sewage characteristics (Cruz et al. 2013; Silva et al. 2015; Tonetti et al. 2010; Tonetti et al. 2013). About 20% of each reactor’s volume was filled with the inoculum, with 78% of total solids corresponding to volatile solids. The reactors were operated simultaneously at the same theoretical hydraulic retention time (HRT) of 12 h. The superficial velocity was 66.67 mm h−1 for both reactors and the feed flow rate of AF and UASB was 1.28 and 1.69 mL min−1, respectively. The velocity and HRT in sedimentation compartment in UASB was 141.54 mm h−1 and 11.7 min. The settler dimensions were reduced due to the very small upflow velocity. As the same device for gas-liquid-solid separator was introduced in AF, the performance comparison between reactors was accomplished, despite the differences between attached growth in AF and suspended grow in UASB. The studies were developed in lab-scale reactors of very small dimensions and upflow velocity. The overall conclusions provide a better understanding of the denitrification process; however, they should be considered for the lab-scale experiments and low retention time in sedimentation compartment.

The mean total COD concentration in raw sewage was 430 mg L−1 and organic loading rate was 0.83 kgCODm−3 day−1. The reactors were operated until a steady-state performance was reached, indicated by effluent COD removal efficiency. The steady-state conditions were maintained to enable collection of data for analysis and performance evaluation.

The reactors were operated in six stages: stage 1: tracer test for hydrodynamic characterization with tap water; stages 2 to 6: reactor fed with synthetic wastewater with increasing NO3-N concentration: 0.0, 25.0, 50.0, 75.0, and 100.0 mgNO3-NL−1 (Table 1).

Table 1 Operational stages

2.2 Water Quality Monitoring

Effluent was collected twice a week along stages from each sampling tap. Analysis of NO3-N was conducted according to procedures described by Robarge et al. (1983). Analysis of chemical oxygen demand (COD), dissolved organic carbon (DOC), total alkalinity (TA), pH, NO2-N, NH3-N, and total Kjeldahl nitrogen (TKN) were performed according to Standard Methods for the Examination of Water and Wastewater (APHA, AWWA, and WEF 2012).

2.3 Gas Sample and Measurement

The biogas was collected in a biogas bag after steady-state performance was established. The composition of the biogas (N2, CH4, CO2, N2O) was analyzed by a gas chromatograph Shimadzu 17A coupled with a mass spectrometer QP5050A. A capillary column TG-BOND Q from Thermo Scientific, with 30 m length, 0.32 mm internal diameter, and 10 μm thickness was used. The carrier gas was helium at a flow rate of 1.7 mL min−1. The samples were injected manually with Hamilton gastight syringes. The injection volume was 100 μL per sample in split mode (1:100). An isotherm of 25 °C was used for gas separation in the analytical column. A mass range of m/z 12 to m/z 60 was used for the development of analytical curves for each gas evaluation.

2.4 Tracer Test

For tracer study, 1 mL of lithium chloride (LiCl) concentrated solution (UASB: 7440.0 mg L−1; AF: 5600.0 mg L−1) was introduced in the reactor to reach an average concentration of 1.0 mg L−1. Lithium concentrations were determined by an atomic absorption spectrophotometer (Perkin Elmer AAnalyst 300, air-acetylene flame method at 670.80 nm) according to SM 311B (APHA, AWWA, and WEF 2012). In clean-bed condition (stage 1), the tracer tests were performed only with tap water for both reactors before starting operation with inoculum and synthetic water. Then, the tracer test was performed to evaluate dirty-bed condition, in which reactors were in operation with synthetic wastewater (stages 2 to 6).

From tracer tests, the following parameters were obtained: HRTt (theoretical hydraulic retention time); HRTobs (observed hydraulic retention time); N (number of CSTR reactors in series for N-CSTR model); TP (time at which the peak concentration occurs); and MDI (Morril Dispersion Index, given by the reason of the time at which 90% and 10% of the tracer has passed through the reactor) (Kreft et al. 1986; Levenspiel 1999).

2.5 Particle Size Distribution

The sludge samples were collected at the bottom of the reactors after steady-state performance was established in stages 2 to 6. Particle size distribution and mean diameter D[4,3] of different samples were evaluated by laser diffraction (LD) using a Mastersizer 2000 (Malvern Instruments Ltd., UK). Three readings were made with samples in duplicate, resulting in a total of six repetitions for each sample. The analysis was conducted in the range of 0.020 to 2000 μm, with agitation of 1750 rpm, degree of obscuration of approximately 10%, and water as dispersing medium.

2.6 Microbial Analysis

Bacterial community structure was analyzed by the molecular fingerprinting method denaturing gradient gel electrophoresis (DGGE). Sludge samples from both reactors were collected after steady-state performance was established in stage 2 and stage 5. The samples were centrifuged (3000 rpm, 10 min) and the pellet was washed three times with phosphate-buffered saline (PBS) solution, followed by centrifugation. The final pellets were frozen at − 20 °C until DNA extraction.

Genomic DNA was extracted based on the methodology of Aamir et al. (2015) and purified using the UltraClean GelSpin DNA Extraction Kit (MO BIO) according to the manufacturer’s instructions.

The 16S ribosomal RNA genes were partially amplified using the primer pair 341f-GC and 907r (Muyzer et al. 1993; Muyzer et al. 1997) for further separation in DGGE. PCR reactions were performed in a final volume of 50 μL containing 1X PCR buffer (Invitrogen), 1.5 mM MgCl2, 0.2 μM dNTP Mix (Invitrogen), 0.5 μM of each primer, 2.0 U Taq DNA Polymerase (Invitrogen), and 5.0 μL of the DNA sample (~ 50 ng). Amplification was carried out on a Gene Amp PCR System 9700 (Applied Biosystems) and the amplification program consisted of 1 denaturation cycle at 94 °C for 5 min; 35 cycles at 94 °C for 1 min, 60 °C for 1 min and 72 °C for 2 min, followed by 10 cycles at 60 °C for 30 s and 72 °C for 1 min. PCR products were firstly confirmed on 1% agarose gel stained with 0.02 μL/mL SYBR Safe 10,000× in DMSO (Invitrogen).

The DGGE system used was the INGENY UPhor (Ingeny) and the denaturing gradient ranged from 45 to 60%. Electrophoresis was performed for 15 h at 100 V. The gel was stained using 10 mL of a solution containing 4 mL of SYBR Green I (Invitrogen®) in TAE buffer 1× for 1 h and then photographed using ImageQuant LAS 4.000 GE system (GE Healthcare). BioNumerics software (version 6.6; Applied Maths, Kortrijk, Belgium) was used to compare the band patterns corresponding to the bacterial community structure among samples.

The similarity coefficient and dendogram were determined using the Pearson coefficient and UPGMA algorithm (unweighted pair group method with arithmetic mean), respectively.

2.7 Denitrifying Assay

After the operation of the reactors, denitrifying tests were realized with all suspended sludge from both compartments and with adhered biofilm from the anaerobic filter. The test was performed in triplicate. Duran® recipients of 500 mL were inoculated (40 mL of sludge from anaerobic filter and 65 mL of sludge from UASB) for a concentration of total suspended solids (TSS) of 300 mgTSSL−1. The reaction volume was completed with synthetic effluent that was identical to the one used in stage 6.

The tests with support medium were done in triplicate for each height value (height 1: up to 266 mm; height 2: 266 to 532 mm; height 3: 532 to 800 mm). For each reactor recipient, 75 pieces of support medium were used, for a reaction volume of 500 mL, completed with synthetic effluent that was identical to the one used in stage 6. At the end of the test, the total suspended solids in solution were determined, with the sludge that detached from support media due to agitation.

Prior to the start of the test, argon gas was introduced in liquid phase to ensure the absence of dissolved oxygen. Reactors were kept in a shaker at 150 rpm and 30 °C during the whole test. Chemical oxygen demand and NO3-N analyses were performed so that removal potentials could be obtained for each biomass.

Profiles for the variation of NO3-N and COD concentration were adjusted in Origin 9.1 software according to first-order kinetic model (Tchobanoglous and Schroeder 1985) described by:

$$ {C}_x=A.{e}^{-{k}_x.T}+B $$
(1)

where Cx is the concentration of NO3-N or COD, mg L−1; kx is the first-order constant for NO3-N or COD consumption, h−1; T is the reaction time, h; A and B are regression parameters; and A + B = C0 (initial concentration of NO3-N or COD).

Besides consumption constant k, the specific consumption constant k*, which takes into account the biomass concentration in the test, was also calculated.

$$ {k}_i^{\ast }=\frac{k_i}{X} $$
(2)

where \( {k}_i^{\ast } \) =\( {k}_{NO_3^{-}}^{\ast } \) and \( {k}_{DQO}^{\ast } \) is the specific first-order constant, LmgVSS−1 h−1; and X is the biomass concentration in terms of VSS, mgVSSL−1.

2.8 Statistical Analysis

Statistical analyses were performed using Origin® software, and Wilcoxon and Kruskal-Wallis tests (p ≤ 0.05). Lowercase and uppercase letters are used in figures and tables to show the results of the statistical comparison. There is no statistical comparison between lowercase and uppercase letters. The interpretations should be made from the comparison of the letters of the same category. The same letter is used to represent equal results statistically while results that are statistically different are represented by different letters. In each figure or table, it is also specified how the results should be interpreted.

3 Results and Discussion

3.1 Hydrodynamics Characterization

The results presented here were obtained from experiments performed with lab-scale reactors of very small dimensions and upflow velocity. The conclusions about hydrodynamic characterization provide a better understanding of the denitrification process; however, hydrodynamic behavior for a full-scale UASB and AF may present different results.

The values for HRTobs and TP/HRTt were lower for dirty-bed condition than for clean-bed condition (Table 2). As discussed by Show and Tay (1999), short circuit caused by biomass accumulation and biogas lifting can promote hydrodynamic behavior and hydraulic retention time alterations in reactors.

Table 2 Summary of hydrodynamic parameters

The configuration of AF, with the presence of the support media, allowed the effluent to remain for a longer time inside the reactor compared to UASB, considering the HRTobs/HRTt results for each stage. In addition, the presence of the support media in AF also contributed to the maintenance of its similar hydrodynamic behavior throughout the stages, unlike the UASB reactor, which showed an increase in the mixing effect promoted by the biogas production, characterized by the reduction of the parameters HRTobs, TP, and N, and increase of MDI.

Similarly, Peña et al. (2006) and Renuka et al. (2016) evidenced mixing effects in anaerobic reactors promoted by the biogas production, which is more significant in dispersed growth reactors.

The denitrification process promoted an increase in the mixing effects and reduced the hydraulic retention time in UASB reactor. This effect was not observed in AF reactor due to the presence of the support media. Hydrodynamic behavior and hydraulic retention time did not present trends of change by increasing nitrate concentration inlet.

The mixing effect contributed to the lower particle size in UASB, and thus the most significant change in biological diversity and higher potential for NO3-N removal biomass compared to AF, as observed with biomass characterization described below. Nevertheless, there is an important contribution of the microorganisms in the biofilm attached to the support medium in AF, which is less impacted by biogas production. Besides that, the effluent remained longer in AF due to its constructive characteristics, thus contributing to a better efficiency of the denitrification process in this reactor.

3.2 Denitrification Process

The denitrification process was complete in AF and UASB during stages 2, 3, and 4, and both compartments were able to promote the complete removal of NO3-N already in its first one-third volume (F1 and U1) due to the concentration of organic matter and microorganisms in this region (Table 3).

Table 3 NO3-N concentration profile (mg L−1) and removal (%) in stage 6 along height

During stage 5, however, NO3-N removal was incomplete until F1 and U1 heights, indicating a saturation of the system to promote the complete denitrification process. In spite of this, the complete process was still observed at the exit of the reactors, indicating that microorganisms present in the upper heights of the reactors contributed to the removal process (Table 3).

From stage 3 to stage 5, denitrification efficiency rates above 96% were achieved for both reactors. Similar efficiency rates were obtained by Chang et al. (2004), Lim and Fox (2011), and Silva et al. (2015) with the use of AF, and by Kodera et al. (2017), Mateo-Sagasta Dávila et al. (2009), and Niu et al. (2018) with the use of UASB reactor, for different substrates.

During stage 6, the NO3-N removal was incomplete in both reactors. The final removal (%) average is calculated for each sample port, considering the released concentration in each reactor height. There is a statistically significant difference for the removal performed from height F2 to F3, reaching a final average of 87.9 ± 5.2%. In the UASB reactor, however, there is no difference between the U2 and U3 heights (83.3 ± 4.5%), which is the only region that differentiates it from the AF reactor in the removal of NO3-N. This may indicate that the presence of the biofilm in the region between F2 and F3 heights is fundamental to the improvement of the denitrification process. With the presence of residual NO3-N above F2 height, the AF biofilm with denitrifying potential was also developed in this region, thus promoting a higher NO3-N removal, as it will be discussed later.

Khan et al. (2011) have already shown that attached growth systems present better treatment performance compared to suspended growth systems, not only due to the higher age of the sludge in the system but also due to the better removal kinetics and greater biological diversity of the consortium of microorganisms attached. The best efficiency of AF can also be associated with the results of the hydrodynamic characterization of the reactors, which indicate that the effluent remains longer in the AF compared to the UASB considering lab-scale reactors. In this way, the development of the denitrifying microbiota in upper heights of the reactor was facilitated, thus improving the removal of NO3-N.

In a simultaneous methanogenesis and denitrification process, the NO2-N accumulation occurs when insufficient carbon is supplied and inhibits methanogenic activity. In AF and UASB studied, the NO2-N detection was similar to the NO3-N. From stages 2 to 5, no concentrations of this compound were detected, whereas during stage 6, concentrations below 0.3 mgNO2-NL−1 were detected in the effluent of the reactors (Table 4). The low concentrations of NO2-N indicate that the process was occurring in a balanced manner, without significant accumulation, which would indicate insufficient supply of carbon source.

Table 4 NO2-N (mg L−1), NTK-N (mg L−1), pH, and total alkalinity (TA) (mgCaCO3L−1) during stages

According to Andalib et al. (2011), inhibitory effects were visualized at concentrations above 2.8 mgNO2-NL−1 when acetate was used as substrate. The NO2-N profile (Fig. 2) indicates that higher concentrations were obtained at height F1, which was not configured as an inhibitory process since nitrite and nitrate continued to be consumed throughout the reactor. The presence of NO2-N together with NH3-N may favor the development of ANAMMOX inside the reactor, diversifying the microbiological community. A similar profile was obtained by Hanaki and Polprasert (1989) and Saliling et al. (2007).

Fig. 2
figure 2

NO3-N and NO2-N (mg L−1) concentration profile along height of reactors. Different lowercase letters indicate difference between reactors for the same stage (Wilcoxon p < 0.05). Different uppercase letters indicate difference between stages for the same reactor (KW p < 0.05)

NO3-N and NO2-N concentration profiles indicate that, even with the increase of the mixing effect in the UASB by the biogas production, the lab-scale reactor cannot be classified as a complete CSTR, since differences in nitrate removal between U2 and U1 heights were observed. Nevertheless, this difference is more intense in the AF reactor, in which the support media allowed an increase in the effluent retention time and the development of microorganisms capable of improving the removal of NO3-N.

Total COD removal in UASB was not affected by the denitrification process (Fig. 3), since there were no significant differences along the stages. Regarding the AF, although the reactor had better COD removal performance at all stages, there was a slight efficiency loss during stage 6, characterized by a removal of 79.2 ± 1.8% compared to the removal average of stages 2 to 5 of 85.8 ± 3.6%. This alteration in AF can be related to the beginning of sludge and biofilm loss caused by turbulence due to biogas production. The solid particles interfere in the characterization of the COD of the effluent. Azevedo et al. (2018) also report a loss of biomass attached in a packed reactor operating with an extreme condition of HRT of 2 h, which changed the reactor behavior.

Fig. 3
figure 3

COD removal (%) in AF and UASB. Different lowercase letters indicate difference between reactors for the same stage (Wilcoxon p < 0.05). Different uppercase letters indicate difference between stages for the same reactor (KW p < 0.05)

The AF showed better efficiency compared to the UASB under the conditions applied and lab-scale configuration. Some results in literature show comparable organic matter removal efficiency rates for both reactors or even higher efficiency for UASB (Parawira et al. 2006). This variation may be related to different operating conditions and distinct wastewater physicochemical characteristics which can affect the biological reactors efficiency rates.

Unlike COD, DOC removal (Fig. 4) showed no difference between the reactors through the stages. The raw sewage DOC concentration was 168.3 ± 12.6 mgL−1 and part of the difference in total COD removal between the reactors is related to the loss of sludge in UASB, due to suspended growth configuration, which impairs biomass retention (compared to the attached growth configuration in the AF). In this case, the recirculation of nitrified effluent to UASB reactor to promote denitrification could be less advantageous compared to AF.

Fig. 4
figure 4

DOC removal (%) in AF and UASB. Different lowercase letters indicate difference between reactors for the same stage (Wilcoxon p < 0.05). Different uppercase letters indicate difference between stages for the same reactor (KW p < 0.05)

Gavrilescu and Macoveanu (2000) discuss the advantages of immobilized biomass, such as retention of biomass in the reactor, even for high flow rate operation. In addition, the diffusional barrier into the biofilm allows the biomass to be less susceptible to irreversible damage, as toxic loads. Azevedo et al. (2018) also observed better removal efficiency rates in packed bed reactor operating with HRT of 12 h due to its characteristic of cell retention.

In respect to the hydrodynamic characteristics presented by the systems through the operation stages, it was observed that the effluent presented a shorter real retention time in UASB than in AF. Thus, in addition to the dispersed growth configuration, which favors the biomass washing process, the shorter time makes it harder for the finer particles to decant, which causes them to leave the reactor with the final effluent, contributing to an increase in COD concentration at treatment outlet.

It is important to note that the recirculation of nitrified effluent to anaerobic reactors, simulated by the synthetic wastewater, had little influence on the organic matter removal in AF and no influence in UASB. Therefore, the accomplishment of the tertiary treatment promoting the nitrogen removal in existing anaerobic reactors cause no harm to operation in terms of effluent quality. It is an important complement for treatments that are commonly performed nowadays, even though there is loss of biogas energetic power due to the effects in biogas composition, as discussed below.

One of the limiting factors of the denitrification process is the C/N ratio provided. Figure 5 shows the evolution of the C/N ratio in the form of COD/NO3-N throughout the stages.

Fig. 5
figure 5

COD/NO3-N throughout denitrification stages

The limiting COD/NO3-N ratio for complete denitrification process was 4.4, in stage 6. For the chosen carbon sources and composition of the synthetic effluent, the average theoretical COD consumption estimated is 4.20 mg for the conversion of 1.0 mgNO3-N into N2 (Klas et al. 2006).

Sucrose and starch are more readily biodegradable carbon sources, thus providing the COD required for the process in stages 2 to 5. On the other hand, cellulose is a source of difficult degradation. Thus, during stage 6, COD provided by sucrose and starch was not sufficient for complete denitrification and the remaining COD, of difficult degradation, could not be used by microorganisms.

Other parameters evaluated during the denitrification process are presented in Table 4. The concentration of TKN through the stages was not affected by the denitrification process; therefore, the removal of total nitrogen was due to the transformation of NO3-N into N2. pH, as well as total alkalinity, increased throughout the stages, since the denitrification process produces alkalinity.

The overall comparison between AF and UASB in denitrification process should be made considering limitations of lab-scale configuration and low upflow velocity of both reactors. Under the conditions applied, the recirculation of nitrified effluent to AF results in better denitrification performances compared to UASB considering NO3-N concentration higher than 100.0 mg L−1. The factors that contributed to its better performance were better retention of the biomass due to the support media (Azevedo et al. 2018; Gavrilescu and Macoveanu 2000) and development of biofilm with complementary capacity of removal (Azevedo et al. 2018; Khan et al. 2011) especially in the upper height of the reactor. The COD removal was not influenced by the denitrification process, indicating that an adaptation of the existing systems for nitrogen removal would allow the complementation of the treatment without prejudice to the previously accomplished.

3.3 Biogas Composition

Figures 6 and 7 show the composition (% v/v) of the biogas produced in both reactors throughout the stages. There was no detection of the compound N2O, indicating that the denitrification process was complete, with no accumulation of intermediate gas. According to Kampschreur et al. (2009), the production of N2O can be influenced by factors such as inhibition of enzymes (for example N2O reductase) by oxygen, nitrite accumulation, and low availability of biodegradable organic carbon. Likewise, Wunderlin et al. (2012) showed a strong correlation between N2O production and NO2-N concentration during the denitrification process. The oxygen conditions and availability of organic matter were adequate for the complete denitrification process, since there was no accumulation of NO2-N (Table 4).

Fig. 6
figure 6

N2, CH4, and CO2 biogas composition [%(v/v)] along the stages in AF

Fig. 7
figure 7

N2, CH4, and CO2 biogas composition [%(v/v)] along the stages in UASB

There are significant differences in N2, CH4, and CO2 concentrations in stages 2 and 6. This indicates that the denitrification process has considerably altered the composition of the biogas produced. During stage 2, with anaerobic digestion as the predominant process, the AF and UASB biogas compositions were 70.3 ± 0.1% and 73.7 ± 0.7% of CH4 and 13.7 ± 0.1 and 13.6 ± 0.8 of CO2. The results presented in this stage are in agreement with the results obtained by recent studies on the biogas production in anaerobic reactors treating domestic effluent (Rosa et al. 2016, 2018; Souza et al. 2011).

From stage 3 to 6, an increasing N2 concentration in biogas was observed, thus reducing the concentration of CH4 and CO2. As already described by Andalib et al. (2011), there are inhibitory effects of denitrification on methanogenesis processes occurring simultaneously, since the nitrogen oxides are energetically more favorable to act as electron receptors. Thus, NO3-N is priority consumed, producing N2 and then the remaining organic matter is used in methanogenesis process.

An et al. (2008) and Eiroa et al. (2004) discussed that the methanogenesis process begins only after denitrification is complete. During stages 3 to 5, it can be observed that CH4 composition reduced in biogas, because only the remaining organic matter from denitrification is consumed in methanogenesis process. However, during stage 6, the denitrification process was not complete due to the unavailability of sufficient carbon source supply. In this way, there was practically no formation of CH4 in any of the reactors.

Although NO3-N removal (%) decreased in both reactors in step 6, absolute removal in mgL−1 was reduced from 75.5 ± 2.9 in step 5 to 89.9 ± 6.6 in AF and 84.9 ± 5.1 in UASB during step 6. The absolute removal difference between the steps was not enough to promote a change in the composition of the biogas, within the number of samples analyzed.

The volume of biogas produced was measured during step 5 to evaluate the nitrogen mass balance (Table 5). The amount of nitrogen released as N2 (STP) was approximately 75% of the nitrogen introduced as NO3-N. Considering solubility of 15.5 mg of N2 in 1 kg of water (Perry 1950) and the flow of AF and UASB reactors, approximately 1.2 mg and 1.6 mg were respectively dissolved, representing 20% of the introduced NO3-N. The remaining 5% may be related to nitrogen adhered to the reactor sludge.

Table 5 Nitrogen mass balance during step 5

The CH4 and CO2 volume and theoretical N2 produced were calculated using the methodology proposed by Chernicharo (2007) and stoichiometric reactions suggested by Klas et al. (2006). There are some discrepancies comparing real and theoretical N2 compositions in step 2 (Table 6) that may be related to the gas that accesses the reactor dissolved in the synthetic effluent, being released along the process. The gas portion originating from this source is not considered in the theoretical calculation of N2 production. In general, for the other steps, the estimation of gas production and composition in terms of % (v/v) was compatible with the results obtained experimentally, evidencing the coherence of the mass balance suggestion considering the conversion of 1.0 mgNO3-N into 1.0 mg of N2 (Klas et al. 2006) and approximately 20% of the dissolved gas, as evidenced in step 5. By means of the data presented in Table 6 and in Figs. 6 and 7, it is possible to estimate the total biogas production and the quantities for each analyzed gas.

Table 6 Theoretical and real N2 composition in biogas [%(v/v)] and theoretical N2 production (mL day−1)

Besides N2, it is worth mentioning that CO2 and CH4 have solubility of approximately 900 and 4 mg of gas per kg of water (Perry 1950). Specially for CO2, the composition obtained experimentally in the biogas can be greatly affected by the solubility characteristic. Thus, although the denitrification process followed by the methanogenesis produces the gas, it dissolves easily in the effluent, justifying its rapid decay along the stages of the denitrification process.

The biogas generated by anaerobic digestion consists in a potential source of thermal or electric energy due to the presence of CH4, a flammable gas. Besides the loss by dissolution that can reach up to 40% of the total of methane produced in the anaerobic reactor (Souza et al. 2011), the denitrification process, when it occurs simultaneously with methanogenesis, is responsible for the loss of biogas energetic quality, since the concentration of CH4 in the final biogas is reduced or even suppressed, as occurred in stages 3 to 6. This is a disadvantage in adapting existing systems by promoting recirculation of nitrified effluent into the anaerobic compartment, since the biogas will lose its capacity of energy reuse.

However, there are advantages in mixing the raw sewage with nitrified effluent in anaerobic reactor, such as savings on external carbon supply to the denitrification process. The overall cost-benefit must be studied in detail for each case in order to define the best process.

3.4 Biomass Characterization

The sludge appearance changed throughout the treatment stages, especially in UASB. From a typical dark, concentrated anaerobic sludge inoculated to the reactors to a yellowish brown sludge at the end of stage 6. The same was observed by Jin et al. (2012), Niu et al. (2018), and Pagáčová et al. (2010). The authors attributed this change to the development of denitrifying bacteria and granular sludge, which was possible due to an increase in extracellular polymeric substances (EPSs) that enhanced the aggregation of microorganism, as a protection against harsh environments promoted by nitrate concentration (Kodera et al. 2017).

The particle size distribution in both reactors was also analyzed. The sludge particle size distribution from AF reactor showed a significant increase in diameter along the stages, which occurred more subtly in the UASB reactor (Fig. 8 and Table 7). This difference may be related to the increase in mixing effect in UASB reactor, which may have caused greater agitation of the medium and consequently prevented the formation of larger flakes. Xue et al. (2016) also observed shallower sludge due to mixing gas production.

Fig. 8
figure 8

Particle size distribution along the steps

Table 7 Diameters D[4,3] (μm) of AF and UASB along the steps

The increase in the mean diameter of the sludge particles of AF and UASB can be related to the increasing concentration of NO3-N in synthetic wastewater (Eiroa et al. 2004; Pagáčová et al. 2010). Despite the size growth, Jin and Lant (2004) explain that the size distribution of the flakes as well as their structure are affected by rupture and coalescence processes. A typical assumption in the literature is that rupture predominates in high turbulence and coalescence occurs in a more static recirculation region. The increase of the mixing effect in the UASB may have promoted the greater particle rupture in this reactor, entailing the smoother increase in particle size distribution. The same mixing effect was also responsible for denitrifying biomass formation in this reactor, as described by Jin et al. (2012).

Han et al. (2012) studied the NO3 distribution within activated sludge flakes and the effect of particle size on microbiological composition. The authors showed that the increase in particle size above 100 μm results in lower concentrations of NO3 in the center of the flake compared to its surface. Whereas the mean particle diameters were bigger than 150 μm in AF and UASB, the gradient distribution of NO3 concentration within granules occurred.

Regarding the change in visual appearance of the sludge from both reactors, it can be considered that the yellowish-brown shade acquired by UASB particles is attributed to the development of anoxic microorganisms in the sludge. In AF, on the other hand, due to the most significant gradient, the development of such microorganisms occurred more superficially, thus promoting a subtle visual change in this sludge.

The DGGE analysis allowed a comparison of sludge bacterial community between the reactors at stage 2 and stage 5, evidencing the visual changes (Fig. 9). Cluster analysis of the DGGE band patterns showed a high similarity level (83.2%) of the bacterial community between AF and UASB in stage 2. The visual and particle size analysis already indicated the similarity between the sludge from the reactors in stage 2. The anaerobic digestion process, therefore, was not responsible for altering the bacterial consortium between the reactors.

Fig. 9
figure 9

Similarity analysis based on DGGE band profiles for the Bacteria domain. a DGGE electrophoresis with all samples. b Cluster analysis of the sludge samples of stages 2 and 5 of both reactors, in triplicate, using the Pearson coefficient and UPGMA algorithm

Comparing stage 2 to stage 5, in which there was complete denitrification of 75.0 mg NO3-NL−1, there was a reduction to 68.7% similarity to the sludge from the AF, and 30.2% similarity to the UASB biomass. Niu et al. (2018) also observed an intense composition modification of an anaerobic sludge during their denitrifying sludge granulation process in a UASB reactor using methanol as carbon source. They found bacteria from genus Aeromonas, Pseudomonas, Clostridium, and other methanol metabolizers.

This modification may be associated with the hydrodynamic characteristic of the UASB reactor that allows greater mixing inside the reactor due to biogas production, compared to AF in this lab-scale experiment. It prevents the formation of larger granules (Xue et al. 2016) and enhances the development of denitrification biomass (Jin et al. 2012). Thus, the nitrate-rich influent into UASB allows greater biological diversification due to the denitrification process.

The DGGE technique did not allow identification of the bacterial species present in the sludge; however, the analysis performed by Shen et al. (2013) on the biomass responsible for nitrogen removal indicated that 99.71% of the biofilm species belonged to the phylum Proteobacteria, Bacteroidetes, Chloroflexi, Firmicutes, Spirochaetes, and Actinobacteria.

Lu et al. (2014) also showed that the phylum Proteobacteria represented 59% and the Bacteroidetes 16% of the denitrifying bacteria in effluent treatment. In this way, it is inferred that the bacterial community developed in the reactors belongs to these phyla, especially the UASB biomass.

Leal et al. (2016) evaluated an annamox in sequencing batch reactor by adding a synthetic medium with glucose and real anaerobic effluent. The authors observed bacteria within the phylum Chloroflexi, which can be related to COD removal, due to its capacity to degrade starch, sugar, and peptides (Hug et al. 2013). The authors also observed denitrifying bacteria of Proteobacteria phylum, closely related to Denitratisoma oestradiolicum, able to reduce NO3 to N2O and N2.

Considering the suitability of systems already in operation for the denitrification process, the introduction of nitrified effluent into the anaerobic reactor would promote an adaptation of the microbial community. Sludge adapted to the simultaneous process of denitrification and removal of organic matter can promote the complementation of the treatment without prejudice to the removal of organic matter until then practiced.

The denitrifying assays were performed to evaluate the effects of the changes in reactor biomass on COD and NO3-N removal potentials along stages, as well as to evaluate the potential for removal of those compounds by the biofilm attached to AF support media. The profile data was described with a first-order removal rate model, as proposed by some researchers (Leverenz et al. 2010; Tchobanoglous and Schroeder 1985). Additional studies are recommended to better characterize the nitrate removal kinetic; however, it is possible to compare AF and UASB potential with the present research (Table 8).

Table 8 First-order rate constant (k) and specific rate constant (k*) of NO3-N and COD consumption for AF (suspended and attached biomass) and UASB (suspended biomass) reactors

Comparing the specific COD and NO3-N rate removal constant for the AF and UASB sludge, the results indicate that biomass in UASB reactors consumes substrate more quickly. This may be related to the more expressive development of denitrifying microorganisms in this reactor, as previously discussed.

However, despite the greater potential presented by the suspended sludge developed in the UASB, it is necessary to consider the performance of the microorganisms developed in the biofilm of the AF media. Regarding the NO3-N and COD utilization constant, there is no significant difference between the heights of the support medium. There is no distinct potential between the microorganisms developed along the height of the AF. Although the microbiological analysis was not performed in the biofilm, it is possible to assume that it is formed by similar organisms to the UASB, which were fundamental for the denitrification process in the AF, thus complementing the removal promoted by the suspended sludge in this reactor.

Khan et al. (2011) observed a better performance of COD and total nitrogen removal in attached growth bioreactors compared to suspended growth. The authors attributed the greater efficiency to the diverse microbial consortium formed in the support media and the greater microbial activity of this biofilm.

Azevedo et al. (2018) also evaluated bacterial community diversity for biomass and sludge samples in a packed and non-packed reactor. They found out that the biomass and sludge samples taken from the packed reactor were more divergent from each other compared to non-packed reactor, which suggests that the presence of support material affected bacterial communities.

4 Conclusions

The comparison between the AF and UASB reactors in the simultaneous denitrification and methanogenesis process indicates a better performance of the AF in the removal of NO3-N and COD. The characteristics of the AF that contributed to this better performance are hydrodynamic behavior with greater permanence of the effluent in the AF, retention of the biomass due to the support media, and development of biofilm with complementary capacity of removal.

Regarding the biogas, the denitrification process was responsible for the significant alteration in its composition. During stage 2, in which the predominant process was anaerobic digestion, the biogas contained concentrations of CH4 of approximately 70% and CO2 of approximately 13% in both reactors. During stage 6, however, when reactors were fed with 100.0 mgNO3-NL−1, the predominant compound was N2, corresponding to more than 85% of the biogas composition in the AF and UASB, thus reducing its energy potential. There was no significant difference in the composition of the biogas produced by AF and UASB.

The greater change in hydrodynamic behavior in the UASB reactor is related to biogas production, which made the reactor behavior closer to a mixed flow. This impacted the distribution of sludge particle size as well as the biological diversification in this reactor.

However, the presence of the biofilm in the AF reactor, with potential for NO3-N and COD removal, was the most important factor to promote greater denitrification and greater COD removal in this reactor than in UASB, under the same operating conditions.

Considering the suitability of systems already in operation for the denitrification process, the recirculation of nitrified effluent to the anaerobic compartment is an interesting option, since it promotes the complementation of the treatment with a nutrient removal step without prejudice to the commonly practiced removal of organic matter, also allowing cost reduction, due to the smaller consumption of external sources of carbon.