Introduction

Sulfonamide antimicrobials are one of the most used classes of synthetic antibiotics in both human and veterinary medicine. In livestock production, these substances are used to treat and control diseases, as well as to improve feeding efficiency, when administered in subtherapeutic concentrations. Sulfonamides are partly absorbed in tissues and may undergo metabolic reactions. However, a significant part of the administered dose is excreted in its original form, becoming a considerable source of antimicrobial dispersion to the environment. The main issue regarding untreated antibiotic discharges is the potential development of resistant bacteria due to the exposure to these substances in the environment, which represents a risk for both human and animal health (Kemper 2008; Oliveira et al. 2016; Perez et al. 2005; Pomies et al. 2013). Sulfonamide antimicrobials are widely used in pig farming, resulting in wastewaters contaminated with up to 400 µ L−1 of sulfonamides in the liquid phase (Campagnolo et al. 2002), and more than 160 mg kg−1 in the solid phase (Baran et al. 2011). Sulfamethazine (SMZ) is a widely used veterinary antimicrobial (Oliveira et al. 2017) and was evaluated in the present work as a model for veterinary sulfonamides.

The efficiency of sulfonamide removal in wastewater treatment processes (WTPs) is highly variable, as it depends on the antimicrobial physicochemical properties, the plant design and operational conditions. This complexity is exacerbated by the existence of multiple possible removal pathways, such as biodegradation and adsorption (Pomies et al. 2013). Despite the increasing use of anaerobic digestion for the treatment of livestock waste, most studies concerning antibiotic treatments were performed using activated sludge technology (Michael et al. 2013; Oliveira et al. 2016). Anaerobic digestion has been shown to be partially successful in the removal of sulfonamides. While some sulfonamides, such as sulfamethoxazole, have been shown to be completely removed (Carballa et al. 2007), no SMZ removal was observed by Mohring et al. (2009) and partial degradation was shown by Oliveira et al. (2017), all under anaerobic conditions. Additionally, in environmental concentrations, from a few to hundreds of ng L−1, the antimicrobials may not support microbial growth and the biotransformation may occur by cometabolism, which is a biochemical mechanism that degrades non-growth substrates in the presence of primary substrates (Criddle 1993; Fernandez-Fontaina et al. 2014).

A more in-depth understanding of the involved mechanisms is crucial to improve the contaminant removal efficiency of WTP. Biodegradation mechanisms are mostly affected by operational conditions, such as hydraulic retention time (HRT) and applied organic load rate (OLR) (Oliveira et al. 2016; Pomies et al. 2013), which can be evaluated using mathematical models. The biodegradation of micropollutants is often represented by pseudo-first-order cometabolic process-based kinetics. The degradation can also be linked to a specific strain or may occur in a mixed community (Sathyamoorthy et al. 2013). Moreover, through modeling, it has been found that micropollutants could be competitively inhibited by the growth-supporting substrate (Fernandez-Fontaina et al. 2014).

Despite a large number of studies concerning anaerobic digestion (AD) modeling, only a few consider antibiotic removal, and none were found that assessed the degradation via co-metabolic pathways. Most studies focus on linking primary or readily available substrates to the micropollutant degradation (Fonseca et al. 2018; Pomies et al. 2013). Thus, the first aim of this study was to evaluate and model the metabolic pathways of an anaerobic process treating pre-treated swine wastewater contaminated with sulfamethazine in a horizontal-flow anaerobic immobilized biomass (HAIB) reactor, under ten distinct HRT and OLR conditions. The second objective was to conduct a correlation study to link all proposed metabolic pathways to sulfamethazine degradation. The third objective was to develop a long-term model, based on the findings of Fonseca et al. (2018), to describe several distinct metabolic pathways of the process subjected to several variations of the operational conditions. Finally, the long-term model was used as an innovative approach to track which of the evaluated metabolic pathways are most related with the antibiotic removal.

Experimental procedures

All experimental procedures were carried out in a HAIB reactor, as described by Oliveira et al. (2017). The reactor was constructed in an acrylic tube with 5 cm of inner diameter and 100 cm of length, which was filled with polyurethane foam cubes, with 0.5 cm sides. It resulted in a bed porosity of 0.62, and consequently a useful volume of 1022 mL. Spatial profiles during pseudo-steady state conditions were monitored in four equally spaced sampling ports along the tube, in the influent and in the effluent streams. The measured variables were filtered chemical oxygen demand (CODf), sulfamethazine concentration and organic acids: malic, succinic, formic, citric, propionic, butyric, isobutyric, valeric and isovaleric. Particulate COD in the influent wastewater was also monitored. The acclimatization process was conducted in two phases: the first was related to the organic load rate (OLR) range of this study, and the second to the presence of the sulfamethazine in the influent, as shown in Table 1 (operational phases OP 1 and OP 2). The average influent total COD (CODt), particulate and soluble, the filtered COD (CODf) and the average sulfamethazine (SMZ) loads, and the operational phase (OP) hydraulic retention time (HRT) are also shown in Table 1. The reactor was fed with synthetic wastewater formulated to simulate swine wastewater pre-treated by an anaerobic lagoon (Oliveira et al. 2016). The influent COD concentration used was based on those reported for swine wastewater from concentrated animal feeding operations with intensive water use (Duda et al. 2015). Synthetic wastewater was chosen instead of in natura wastewater to avoid seasonal fluctuations in the composition that could make it difficult to interpret the results. The wastewater was spiked with 10 g SMZ m−3, which is compatible with the contamination levels commonly observed in swine wastewaters (Baran et al. 2011; Shelver et al. 2010; Managaki et al. 2007; Ben et al. 2013; Zhou et al. 2013). The influent CODf was composed of carbohydrates, proteins and fats, which, in COD fractions, were respectively: 0.5, 0.3 and 0.2. The main organic components of the laboratory produced wastewater were beef extract, sucrose, soluble starch, cellulose and soy oil, respectively with a concentration, in mg L−1, of 876, 306, 920, 306, and 705 µL L−1, for a CODf of 2000 mg L−1.

Table 1 Operational conditions of each operational phase (Oliveira et al. 2017)

The anaerobic reactor used in the experimental setup, the horizontal-flow anaerobic immobilized biomass, is a tubular, packed-bed system that presents predominantly plug-flow-like hydrodynamic patterns. Besides decoupling the liquid flow (horizontal) of biogas flow (radial), it is also capable of sustaining high cellular retention times and elevated biomass concentrations (Oliveira et al. 2017). In addition, it has been successfully used in the treatment of toxic and xenobiotic compounds (de Nardi et al. 1999; Oliveira et al. 2004; Saia et al. 2007).

Mathematical modeling

The model was divided into four main stages: 1 substrate degradation, 2 biomass growth, 3 sulfamethazine degradation and 4 long-term quantification of operational condition variations. The latter stage was developed as shown in “Metabolic pathways” section. Considering the first stage, the influent substrate was split into carbohydrates, proteins, and lipids, and their respective COD fractions were 0.5, 0.3 and 0.2. According to Batstone et al. (2002), the COD fraction of lipids that are degraded to acetate varies from 91 to 98% in mass, thus for modeling simplicity, lipids were considered to be completely converted into acetate. Carbohydrates and proteins were considered degraded to butyrate, propionate, and acetate; however, a fraction of the proteins were also converted into valerate and isovalerate. Moreover, the metabolic pathways by which the influent substrate is converted may dynamically vary depending on the processes and the operational conditions. The metabolic rates can also vary due to inhibition, and consequently, the pathways may be shifted. Considering the process data available (Oliveira et al. 2016, 2017), and the previous inhibition models (Blumensaat and Keller 2005), the propionic acid was presumed to be the main inhibitor.

According to Fonseca et al. (2018), the most suited modeling structure to describe the HAIB reactor is a combination of the Contois kinetics with the reactional volume in terms of biomass occupation per gram of foam support. A strong relationship between kinetic performance with biomass concentration along the reactor was observed, as can be found in “Metabolic pathways” section.

Metabolic pathways

The microbial metabolic pathways considered in the model are shown in Fig. 1 (Cai et al. 2016; Saady 2013; Xiao et al. 2014; Zhuge et al. 2013). It is important to note that when the protein pathway changes from valerate to isovalerate or any other route, the fractions of the other acids produced from proteins change as shown in Eqs. (1) and (2). The acid production and consumption rates are shown in Table 2, where the parameters of Eq. (2), \({\mathrm{Y}}_{{\mathrm{aa}}_{\mathrm{i}}}\) and \({\mathrm{Y}}_{{\mathrm{su}}_{\mathrm{i}}}\), are defined. Equation (1) parameters \({\mathrm{Y}}_{\mathrm{Iva}}\) and \({\mathrm{Y}}_{\mathrm{Va}}\) are, respectively, the isovaleric and the valeric acids yield coefficients, and \({\mathrm{Y}}_{\mathrm{av}}\) the complementary for other acid production. The highlighted boxes in Fig. 1 indicate precursors of some metabolic pathway, which, despite having not been measured, were critical to describe those metabolic pathways kinetics.

Fig. 1
figure 1

Microbial metabolic pathways

Table 2 Substrate production and consumption processes
$${\mathrm{Y}}_{\mathrm{av}}=1-{\mathrm{Y}}_{\mathrm{Iva}}-{\mathrm{Y}}_{\mathrm{Va}},$$
(1)
$${\mathrm{Y}}_{{\mathrm{aa}}_{\mathrm{i}}}={\mathrm{Y}}_{{\mathrm{su}}_{\mathrm{i}}} \cdot {\mathrm{Y}}_{\mathrm{av}}.$$
(2)

Biomass was explicitly considered for each organic acid for the hydrolysis components, e.g., fats, carbohydrates and proteins/amino acid degradation, and for the estimated succinic acid precursor. For modeling simplicity, the growth yield coefficient was divided into two stages: hydrolysis and acid consumption. To develop a more reliable model, the precursor of the valeric acids was also taken into account, and its metabolization was considered to be performed by the protein degraders. Furthermore, the biomass decay effects, e.g., endogenous and sludge retention time (SRT), were considered as only one effect in the modeling, in which the latter was recognized as the most relevant. The impacts of SRT on biomass were based on the foam matrix porosity and on the HRT. Thus, considering the foam matrix porosity as 0.62 (Oliveira et al. 2017), and polyurethane density of \(28\mathrm{ kg }{\mathrm{m}}^{-3}\), the reactional volume (Vr), without biomass, was calculated as \(13.57\mathrm{ mL }{\mathrm{g}}_{\mathrm{Foam}}^{-1}\) (the sludge density was considered \(1.0\mathrm{ g m}{\mathrm{L}}^{-1}\)). Therefore, the higher the biomass concentration, the higher the occupied Vr, and the higher the negative impacts of HRT on the biomass decay.

Due to the HAIB reactor hydrodynamic characteristics, the modeling approach was a series of N continuously stirred tanks (de Nardi et al. 1999), and it was split up into 51 reactors. This number was chosen so that the reactors were in the same position as the sampling ports of the actual reactor. The first and the last tanks were considered, respectively, the influent and the effluent sampling ports. The kinetic rate equations for each component are shown in Table 2. Each specific biomass growth rate equation is shown in Table 3 and Eqs. (3) and (4) show how each component/biomass was evaluated, considering the N-tanks approach.

Table 3 Biomass growth processes
$$\frac{{\mathrm{dS}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}}{\mathrm{dt}}=\frac{{\mathrm{S}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}-1}}-{\mathrm{S}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}}{{\mathrm{D}}_{\mathrm{H}}}+\sum\limits_{\mathrm{j}=1}^{17}{\uprho }_{{\mathrm{j}}_{\mathrm{k}}},$$
(3)
$$\frac{{\mathrm{dX}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}}{\mathrm{dt}}={\mathrm{Y}}_{\mathrm{h},\mathrm{a}}\sum\limits_{\mathrm{j}=1}^{17}{\uprho }_{{\mathrm{j}}_{\mathrm{k}}}-\frac{\mathrm{D}}{{\upeta }_{\mathrm{k}}}{\left(\frac{\mathrm{Q}}{{\mathrm{Q}}_{0}}\right)}^{2}\left({\mathrm{X}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}-{{\mathrm{X}}_{\mathrm{r}}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}\right),$$
(4)

where term \(\sum\nolimits_{\mathrm{j}=1}^{17}{\uprho }_{{\mathrm{j}}_{\mathrm{k}}}\) is the sum of the specific kinetic rates for process j at tank k. Notice, as shown in Table 2, that the kinetic rates were related to biomass concentration, by using the Contois kinetics (1959). Vr is the reactional volume of each tank, \({\eta }_{k}\) is the complement of the reactional volume that is occupied by a biomass volume. The assumed biomass density was 1.0 mg L−1. \({\mathrm{D}}_{\mathrm{H}} ({\mathrm{h}}^{-1})\) is the dilution rate of each tank, calculated by Eq. (8), which, associated to the term \({{\upeta }_{\mathrm{k}}^{-1}\left(\mathrm{Q}.{\mathrm{Q}}_{0}^{-1}\right)}^{2}\), represents the effects of the shear stress force in sludge retention time caused by the HRT and by the biomass concentration at each tank. The influent volumetric flow is represented by the coefficient Q, as shown in Eq. (6), and Q0 is the volumetric flow for an HRT of 24 h. \({\upeta }_{\mathrm{k}}\) is calculated in Eq. (5), and \({\mathrm{v}}_{\mathrm{s}}\) is the liquid superficial velocity, calculated by Eq. (7). \({{\mathrm{X}}_{\mathrm{r}}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}\) is the residual biomass in near absence of support substrate in the wastewater.

$${\upeta }_{\mathrm{k}}=1-\frac{\sum\nolimits_{\mathrm{j}=1}^{17}{\mathrm{X}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}}{{\uprho }_{\mathrm{X}}{\mathrm{V}}_{\mathrm{r}}},$$
(5)
$$\mathrm{Q}=\mathrm{V}/\mathrm{HRT }\left(\mathrm{L }{\mathrm{h}}^{-1}\right),$$
(6)
$${\mathrm{v}}_{\mathrm{s}}=\frac{\mathrm{L}}{\mathrm{HRT}},$$
(7)
$${\mathrm{D}}_{\mathrm{H}}=\frac{{\mathrm{v}}_{\mathrm{s}}}{\mathrm{L}/\mathrm{N}}.$$
(8)

Sulfamethazine degradation hypotheses

In addition to biodegradation, sulfamethazine removal can be associated to sludge adsorption, as well to solid surfaces from the influent. Oliveira et al. (2016) found that, in short-term experiments (days), adsorption represented nearly 50% of the SMZ removal when compared to biodegradation. On the other hand, in the long-term experiments (several months) presented by Oliveira et al. (2017), adsorption represented less than 1% of the total SMZ removal. Therefore, given that this study is focused on the long-term experiment, adsorption was considered negligible and biodegradation was considered the main removal mechanism.

Sulfamethazine biodegradation was evaluated using two approaches: (1) as a cometabolic transformation for each of the degraded substrates and (2) as a bulk liquid enzymatic reaction during each influent component hydrolysis. The model used to represent the first approach is shown in Eq. (9), while the second is described by Eqs. (10) and (11).

$$\frac{{\mathrm{dSmz}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}}{\mathrm{dt}}=\frac{{\mathrm{Smz}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}-{\mathrm{Smz}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}-1}}}{{\mathrm{D}}_{\mathrm{H}}}+{{\mathrm{k}}_{\mathrm{z}}}_{\mathrm{j}}{\mathrm{Smz}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}{\mathrm{X}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}{\uprho }_{{\mathrm{i}}_{\mathrm{k}}},$$
(9)
$$\frac{{\mathrm{dEmz}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}}{\mathrm{dt}}=\frac{{\mathrm{Emz}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}-{\mathrm{Emz}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}-1}}}{{\mathrm{D}}_{\mathrm{H}}}+\left({{\mathrm{k}}_{\mathrm{E}}}_{\mathrm{j}}{\mathrm{X}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}{\uprho }_{{\mathrm{i}}_{\mathrm{k}}}-{\mathrm{k}}_{{\mathrm{D}}_{\mathrm{E}}}{\mathrm{Emz}}_{\mathrm{i},{\mathrm{j}}_{\mathrm{k}}}\right){\mathrm{I}}_{{\mathrm{ps}}_{\mathrm{k}}},$$
(10)
$$\frac{{\mathrm{dSmz}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}}{\mathrm{dt}}=\frac{{\mathrm{Smz}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}-{\mathrm{Smz}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}-1}}}{{\mathrm{D}}_{\mathrm{H}}}-{\mathrm{Emz}}_{\mathrm{i},{\mathrm{j}}_{\mathrm{k}}}{\mathrm{Smz}}_{{\mathrm{i},\mathrm{j}}_{\mathrm{k}}}{\mathrm{I}}_{{\mathrm{ps}}_{\mathrm{k}}},$$
(11)

where \({\mathrm{I}}_{{\mathrm{ps}}_{\mathrm{k}}}=1/\left(1+\frac{{\mathrm{S}}_{{\mathrm{AcP}}_{\mathrm{k}}}}{370}\right).\)

Long-term quantification of OLR and HRT effects on metabolic pathways

The long-term effects of the OLR, the HRT and the SMZ concentration variation modeling were quantified considering the process response time (in days) for each operational condition variation and in terms of the sensitivity of each metabolic pathway to those changes (Fonseca et al. 2018). The long-term quantification defines the performance of each biomass group related with the acids modeled in this subsection. Equations (12)–(14) show the process response time to COD, SMZ, and HRT variations. Thus, COD and SMZ variation will be observed in the reactor effluent four days after it was applied, and for the HRT, 11 days.

$$\Delta {\mathrm{COD}}_{\mathrm{t}}\left(\mathrm{t}\right)=\frac{1}{4}\sum\limits_{\mathrm{i}=\mathrm{t}-3}^{\mathrm{t}}{\mathrm{COD}}_{\mathrm{t}}\left(\mathrm{i}\right)-{\mathrm{COD}}_{\mathrm{t}}\left(\mathrm{i}-1\right),$$
(12)
$$\Delta \mathrm{SMZ}\left(\mathrm{t}\right)=\frac{1}{4}\sum\limits_{\mathrm{i}=\mathrm{t}-3}^{\mathrm{t}}\mathrm{SMZ}\left(\mathrm{i}\right)-\mathrm{SMZ}\left(\mathrm{i}-1\right),$$
(13)
$$\Delta \mathrm{HRT}\left(\mathrm{t}\right)=\left\{\begin{array}{c}\frac{1}{11}\sum\nolimits_{\mathrm{i}=\mathrm{t}-10}^{\mathrm{t}}\mathrm{HRT}\left(\mathrm{i}\right)/\mathrm{HRT}\left(\mathrm{i}-1\right),HRT\left(\mathrm{i}\right)>HRT\left(\mathrm{i}-1\right)\\ -\frac{1}{11}\sum\nolimits_{\mathrm{i}=\mathrm{t}-10}^{\mathrm{t}}\mathrm{HRT}\left(\mathrm{i}\right)/\mathrm{HRT}\left(\mathrm{i}-1\right),HRT\left(\mathrm{i}\right)<HRT\left(\mathrm{i}-1\right)\end{array}\right..$$
(14)

Specific metabolic pathway sensitivities were described as shown in Eqs. (15)–(17). \(\Delta {\mathrm{S}}_{{0}_{\mathrm{j}}}\left(\mathrm{t}\right)\) is related to the total COD variation effects, where parameters \({{\mathrm{F}}_{\mathrm{C}}}_{\mathrm{j}}\), \({\mathrm{f}}_{{\mathrm{C}}_{\mathrm{j}}}\) and \({\uptheta }_{\mathrm{j}}\) define the sensitivity of each metabolic pathway j, as described in Table 1. \({\uptheta }_{\mathrm{j}}\) is the sensitivity related with the amplitude of the operational condition. Parameters \({\mathrm{f}}_{{\mathrm{C}}_{\mathrm{j}}}\) are related with the negative variation effects, while \({{\mathrm{F}}_{\mathrm{C}}}_{\mathrm{j}}\) with positive ones. Analogously, \(\Delta {{\mathrm{S}}_{{\mathrm{mz}}_{0}}}_{\mathrm{j}}\left(\mathrm{t}\right)\) and \(\Delta {\mathrm{V}}_{\mathrm{j}}\left(\mathrm{t}\right)\) are respectively related with the SMZ and HRT variations, as well as parameters \({\mathrm{f}}_{{\mathrm{S}}_{\mathrm{j}}}\), \({\mathrm{F}}_{{\mathrm{S}}_{\mathrm{j}}}\), \({\mathrm{f}}_{{\mathrm{V}}_{\mathrm{j}}}\), and \({\mathrm{F}}_{{\mathrm{V}}_{\mathrm{j}}}\) that are associated, respectively, with the negative and positive variations of SMZ and HRT. These sensitivities were incorporated into the process kinetics described in Table 1 through Eq. (18), where \({\mathrm{K}}_{{\mathrm{j}}_{\mathrm{Max}}}({\mathrm{g}}_{\mathrm{COD}} \cdot {\mathrm{g}}_{\mathrm{f}} \cdot {\mathrm{g}}_{\mathrm{ssv}}^{-1} \cdot {\mathrm{cm}}^{-1} \cdot {\mathrm{L}}^{-1})\) is the substrate maximum degradation constant, which associated with \({\mathrm{k}}_{\mathrm{s}}\), represents the maximum substrates´ degradation rate. Notice that in Eq. (18), the filtered COD was used instead of the total COD that was used in Eqs. (15)–(17), and \({\mathrm{K}}_{\mathrm{s}}\) is the half-saturation constant. It is worth noting that to achieve an acceptable model adjustment procedure, accuracy and predictability, the isobutyric and butyric acids were grouped. The same grouping was done with the isovaleric and valeric acids, and to distinguish the long-term effect processes from those of the previous section, throughout the text, they will be referred to as the butyric group and valeric group. For the latter, the valeric acid precursor was maintained in the modelling and a new algebraic equation was added to estimate the fractions of COD that were allocated in each metabolic pathway, as shown in Eq. (19), where \({\mathrm{K}}_{{\mathrm{M}}_{\mathrm{V}}}\) is the maximum ratio between the metabolic pathways and \({\mathrm{K}}_{{\mathrm{s}}_{{\mathrm{i}}_{\mathrm{V}}}}\) is the inhibitory half-saturation constant. These fractions are defined as a function of the propionic acid inhibitory action on the valeric acid precursor consumption rate, and its value is defined by constant \({\mathrm{K}}_{{\mathrm{ip}}_{\mathrm{VA}}}\), as shown in Table 1. The long-term effects of the operational condition in the inhibition are represented by Eq. (20).

$$\Delta {{\mathrm{S}}_{0}}_{\mathrm{j}}\left(\mathrm{t}\right)=\left\{\begin{array}{c}{\mathrm{f}}_{{\mathrm{C}}_{\mathrm{j}}}\Delta CO{\mathrm{D}}_{\mathrm{t}}{\left(\mathrm{t}\right)}^{{{\uptheta }_{\mathrm{C}}}_{\mathrm{j}}}, \Delta CO{\mathrm{D}}_{\mathrm{t}}\left(\mathrm{t}\right)<0\\ {{\mathrm{F}}_{\mathrm{C}}}_{\mathrm{j}}\Delta CO{\mathrm{D}}_{\mathrm{t}}{\left(\mathrm{t}\right)}^{{{\uptheta }_{\mathrm{C}}}_{\mathrm{j}}}, \Delta CO{\mathrm{D}}_{\mathrm{t}}\left(\mathrm{t}\right)\ge 0\end{array}\right.,$$
(15)
$$\Delta {{\mathrm{S}}_{{\mathrm{mz}}_{0}}}_{\mathrm{j}}\left(\mathrm{t}\right)=\left\{\begin{array}{c}{\mathrm{f}}_{{\mathrm{S}}_{\mathrm{j}}}\Delta SMZ{\left(\mathrm{t}\right)}^{{{\uptheta }_{\mathrm{S}}}_{\mathrm{j}}}, \Delta SMZ\left(\mathrm{t}\right)<0\\ {{\mathrm{F}}_{\mathrm{S}}}_{\mathrm{j}}\Delta SMZ{\left(\mathrm{t}\right)}^{{{\uptheta }_{\mathrm{S}}}_{\mathrm{j}}}, \Delta SMZ\left(\mathrm{t}\right)\ge 0\end{array}\right.,$$
(16)
$$\Delta {\mathrm{V}}_{\mathrm{j}}\left(\mathrm{t}\right)=\left\{\begin{array}{c}{\mathrm{f}}_{{\mathrm{V}}_{\mathrm{j}}}\Delta {\mathrm{HRT}}_{\mathrm{j}}{\left(\mathrm{t}\right)}^{{{\uptheta }_{\mathrm{V}}}_{\mathrm{j}}}, \Delta HR{\mathrm{T}}_{\mathrm{j}}\left(\mathrm{t}\right)<0\\ {\mathrm{F}}_{{\mathrm{V}}_{\mathrm{j}}}\Delta {\mathrm{HRT}}_{\mathrm{j}}{\left(\mathrm{t}\right)}^{{{\uptheta }_{\mathrm{V}}}_{\mathrm{j}}}, \Delta {\mathrm{HRT}}_{\mathrm{j}}\left(\mathrm{t}\right)\ge 0\end{array}\right.,$$
(17)
$${\mathrm{K}}_{\mathrm{j}}={\mathrm{F}}_{\mathrm{j}}{\mathrm{K}}_{{\mathrm{j}}_{\mathrm{Max}}}\frac{{\mathrm{COD}}_{\mathrm{f}}\left(\mathrm{t}\right)}{{\mathrm{COD}}_{\mathrm{f}}\left(\mathrm{t}\right)+{\mathrm{K}}_{\mathrm{s}}},$$
(18)
$${\mathrm{Y}}_{{\mathrm{f}}_{\mathrm{pV}}}={\mathrm{K}}_{{\mathrm{M}}_{\mathrm{V}}}\frac{{\mathrm{K}}_{{\mathrm{ip}}_{\mathrm{pVA}}}}{{\mathrm{K}}_{{\mathrm{ip}}_{\mathrm{pVA}}}+{\mathrm{K}}_{{\mathrm{s}}_{{\mathrm{i}}_{\mathrm{V}}}}},$$
(19)
$$\frac{{\mathrm{dK}}_{{\mathrm{ip}}_{\mathrm{pVA}}}}{\mathrm{dt}}={\mathrm{k}}_{{\mathrm{i}}_{\mathrm{V}}}{\mathrm{K}}_{{\mathrm{ip}}_{\mathrm{pVA}}}\left(1-\frac{{\mathrm{K}}_{{\mathrm{ip}}_{\mathrm{pVA}}}}{{\mathrm{K}}_{{\mathrm{ip}}_{{\mathrm{V}}_{\mathrm{M}}}}}\right)-\left({\mathrm{F}}_{\mathrm{ip}}\Delta {\mathrm{S}}_{0}\left(\mathrm{t}\right)\right)\frac{{\mathrm{K}}_{{\mathrm{ip}}_{\mathrm{pVA}}}}{100}.$$
(20)

The biomass performance was divided into two stages; the first is related to supporting the substrate consumption rate of each group, Eq. (21), the second is associated with the metabolic pathway production yield, Eq. (22). Note that the parameters related to the long-term effects of the operational conditions in Eq. (22) are analogous to those described in Eqs. (15)–(17). Furthermore, parameter \({\mathrm{Y}}_{{\mathrm{i}}_{\mathrm{M}}}\) indicates the maximum yield coefficient for each metabolic pathway, and \({\mathrm{k}}_{{\mathrm{F}}_{\mathrm{j}}}\), \({\mathrm{k}}_{{\mathrm{Y}}_{\mathrm{j}}}\) indicate the rate, in hours, that at each process recovers from a perturbation. For the formic acid, and the valeric and butyric groups, \({\mathrm{Y}}_{{\mathrm{i}}_{\mathrm{M}}}\) was considered fixed, while for the propionic acid as a function of the operational conditions, as shown in Eq. (23). In the latter, term \({\mathrm{v}}_{{\mathrm{s}}_{0}}\) refers to the superficial velocity at an HRT of 24 h, and \({\mathrm{Y}}_{{\mathrm{P}}_{\mathrm{M}}}\) is the maximum production yield of the propionic acid.

$$\frac{{\mathrm{dF}}_{\mathrm{j}}}{\mathrm{dt}}={\mathrm{k}}_{{\mathrm{F}}_{\mathrm{j}}}{\mathrm{F}}_{\mathrm{j}}\left(1-{\mathrm{F}}_{\mathrm{j}}\right)-\left(\Delta {\mathrm{S}}_{{0}_{\mathrm{j}}}\left(\mathrm{t}\right)+\Delta {{\mathrm{S}}_{\mathrm{mz}}}_{\mathrm{j}}\left(\mathrm{t}\right)+\Delta {\mathrm{V}}_{\mathrm{j}}\left(\mathrm{t}\right)\right)\frac{{\mathrm{F}}_{\mathrm{j}}}{100},$$
(21)
$$\frac{{\mathrm{dY}}_{\mathrm{i}}}{\mathrm{dt}}={\mathrm{k}}_{{\mathrm{Y}}_{\mathrm{i}}}{\mathrm{Y}}_{\mathrm{i}}\left(1-\frac{{\mathrm{Y}}_{\mathrm{i}}}{{\mathrm{Y}}_{{\mathrm{i}}_{\mathrm{M}}}}\right)-\left(\Delta {\mathrm{S}}_{{0}_{\mathrm{i}}}\left(\mathrm{t}\right)+\Delta {{\mathrm{S}}_{\mathrm{mz}}}_{\mathrm{i}}\left(\mathrm{t}\right)+\Delta {\mathrm{V}}_{\mathrm{i}}\left(\mathrm{t}\right)\right)\frac{{\mathrm{Y}}_{\mathrm{i}}}{100},$$
(22)
$${\mathrm{Y}}_{{\mathrm{A}}_{\mathrm{c}}\mathrm{P}}=\frac{{\mathrm{Y}}_{{\mathrm{P}}_{\mathrm{M}}}}{{\mathrm{v}}_{\mathrm{s}}/{\mathrm{v}}_{{\mathrm{s}}_{0}}}.$$
(23)

Sulfamethazine degradation pathway hypotheses

Considering the results in “Sulfamethazine degradation hypotheses” section, the long-term sulfamethazine degradation was evaluated using two approaches: (1) a cometabolic transformation related to valeric/isovaleric acid consumption and (2) as a bulk liquid enzymatic reaction during the hydrolysis/acid formation stage. This latter approach was considered due to the results obtained by Oliveira et al. (2019), in which the antibiotic was successfully degraded in batch experiments both when adding carbohydrates and proteins as carbon sources. The model used to represent the first approach is shown in Eq. (24), while the second is described by Eqs. (25) and (26).

$$\frac{{\mathrm{dSmz}}_{\mathrm{k}}}{\mathrm{dt}}=\frac{{\mathrm{Smz}}_{\mathrm{k}}-{\mathrm{Smz}}_{\mathrm{k}-1}}{{\mathrm{V}}_{\mathrm{r}}}+{\mathrm{k}}_{\mathrm{z}}{\mathrm{Smz}}_{\mathrm{k}}{\mathrm{X}}_{\mathrm{k}}{\uprho }_{{\mathrm{i}}_{\mathrm{k}}},$$
(24)
$$\frac{{\mathrm{dEmz}}_{\mathrm{k}}}{\mathrm{dt}}=\frac{{\mathrm{Emz}}_{\mathrm{k}}-{\mathrm{Emz}}_{\mathrm{k}}}{{\mathrm{V}}_{\mathrm{r}}}+\left({\uprho }_{\mathrm{su}}{\mathrm{X}}_{\mathrm{su}}+{\uprho }_{\mathrm{aa}}{\mathrm{X}}_{\mathrm{aa}}-{\mathrm{k}}_{{\mathrm{D}}_{\mathrm{E}}}{\mathrm{Emz}}_{\mathrm{k}}\right){\mathrm{I}}_{{\mathrm{p}}_{\mathrm{k}}},$$
(25)
$$\frac{{\mathrm{dSmz}}_{\mathrm{k}}}{\mathrm{dt}}=\frac{{\mathrm{Smz}}_{\mathrm{k}}-{\mathrm{Smz}}_{\mathrm{k}-1}}{{\mathrm{V}}_{\mathrm{r}}}-{\mathrm{K}}_{{\mathrm{z}}_{\mathrm{E}}}\frac{{\mathrm{Y}}_{\mathrm{ca}}}{\mathrm{Q} \cdot {\mathrm{COD}}_{\mathrm{f}}\left(\mathrm{t}\right)+\left(1-{\mathrm{Y}}_{\mathrm{ca}}\right) \cdot \mathrm{Ksz}}{\mathrm{Emz}}_{\mathrm{k}}{\mathrm{Smz}}_{\mathrm{k}},$$
(26)

where \({\mathrm{Y}}_{\mathrm{ca}}=1-\left({\sum\nolimits \mathrm{Y}}_{{\mathrm{aa}}_{\mathrm{i}}}+{\sum\nolimits \mathrm{Y}}_{{\mathrm{su}}_{\mathrm{i}}}+{\mathrm{Y}}_{\mathrm{fa}}\right)\), which means that \({\mathrm{Y}}_{\mathrm{ca}}\) represents the fraction of acetic acid produced during the acid formation stage, and \(\mathrm{Q} \cdot {\mathrm{COD}}_{\mathrm{f}}\left(\mathrm{t}\right)\) is the volumetric organic load, given in \(({\mathrm{mg}}_{{\mathrm{O}}_{2}} \cdot {\mathrm{L}}^{-1} \cdot {\mathrm{ h}}^{-1})\) (Oliveira et al. 2017). It is worth noting that the usual Monod half-saturation coefficient was not considered constant, as can be seen in the denominator of Eq. (26). This approach represents the affinity of the cometabolic reaction with the current process conditions (Shaw et al. 2013).

Adjustment procedure for parameters

All modeling implementations were carried out in Matlab™ using the stiff solver ODE15s in an Intel I5 4590 CPU, running at 3.5 GHz. The parameter adjustment objective was the minimization of the distance between the model predictions and each measured variable. A weighted least squares (WLS) was calculated in order to simulate the chi-square goodness of fit (Gabor et al. 2017; Ottosen et al. 2016), and consequently, to have an indication of how well the model structure fitted the experimental data (Vera et al. 1992). The WLS was calculated as shown in Eq. (27), and the weights followed the rules established in Eq. (28). Other approaches could be chosen, such as the R2, however, considering the experimental results, with several observations close to zero and as some acids were produced at the end of the process, the lack of weight in the R2 calculations would result in biased indications. Moreover, with the weighted calculations, the most critical dynamics, which occur at the beginning of the reactor, will prevail in spite of the results at the end of the reactor. The statement \(\mathrm{max}\left(0.07{\mathrm{S}}_{{\mathrm{i}}_{\mathrm{op}}},0.07{\mathrm{S}}_{{\mathrm{i}}_{8}}\right)\) was assumed to avoid the zeros that would appear for some of the components in certain OP, leading to a more reliable analysis. The \({i}_{op}\) and \({i}_{8}\) indexes indicate that the comparison is made between the OP under analysis and the 8th OP, OP 8 of Table 1. Taking the chi-square goodness of fit as a threshold for identifiability, if the WLS values were higher than 11.1, for both COD and acid consuming stages, the assumed model structure was not able to describe the experimental observations. However, in the case of SMZ degradation, if the WLS were higher than 16.9, the tested cometabolic pathway correlation was weak (Fonseca et al. 2018).

$${\mathrm{W}}_{{\mathrm{LS}}_{{\mathrm{i}}_{\mathrm{op}}}}\left({\uptheta }_{\mathrm{op}}\right)=\sum\limits_{\mathrm{k}=2}^{6}\frac{{\left({\mathrm{y}}_{\mathrm{i},{\mathrm{j}}_{\mathrm{op},\mathrm{k}}}-{\widehat{\mathrm{y}}}_{\mathrm{op},\mathrm{k}}\left({\uptheta }_{\mathrm{op}}\right)\right)}^{2}}{{\upomega }_{{\mathrm{i}}_{\mathrm{k},\mathrm{op}}}^{2}},$$
(27)
$${\upomega }_{{\mathrm{i}}_{\mathrm{op},\mathrm{k}}}^{2}=\left\{\begin{array}{l}0.15{\mathrm{S}}_{{\mathrm{i}}_{\mathrm{op},\mathrm{k}}}, 0.15{\mathrm{S}}_{{\mathrm{i}}_{\mathrm{op},\mathrm{k}}}\ge \mathrm{max}\left(0.07{\mathrm{S}}_{{\mathrm{i}}_{\mathrm{op}}},0.07{\mathrm{S}}_{{\mathrm{i}}_{8}}\right)\\ \mathrm{max}\left(0.07{\mathrm{S}}_{{\mathrm{i}}_{\mathrm{op}}},0.07{\mathrm{S}}_{{\mathrm{i}}_{8}}\right), 0.15{\mathrm{S}}_{{\mathrm{i}}_{\mathrm{op},\mathrm{k}}}<\mathrm{max}\left(0.07{\mathrm{S}}_{{\mathrm{i}}_{\mathrm{op}}},0.07{\mathrm{S}}_{{\mathrm{i}}_{8}}\right)\end{array}\right..$$
(28)

\({\mathrm{W}}_{{\mathrm{LS}}_{{\mathrm{i}}_{\mathrm{op}}}}\) represents the sum of the WLS, index “op” indicates the OP under analysis, index “i” represents the component and index “k” the reactor sampling position.

For both objectives of this study, the metabolic pathways (“Metabolic pathways” section) and the long-term quantification of operational condition effects on metabolic pathways (“Long-term quantification of OLR and HRT effects on metabolic pathways” section) and the adjustment procedure was conducted in two phases, e.g., a manual adjustment seconded by an automatic search using an evolutionary operation. In both cases, the manual adjustment of the parameters was conducted following the flowchart in Fig. 2. The parameters presented in “Metabolic pathways” section were optimized using an evolutionary operation central composite design methodology for all product formation and consumption pairs (Kumar et al. 2011). For the succinic/malic acids, with four parameters to be adjusted, the evolutionary operation was based on a factorial design with five levels and four factors. The starting search levels were − 20, − 10, 0, + 10 and + 20% of the nominal value of each parameter and all 625 interactions were evaluated. The procedure was conducted iteratively. When finding the minimum \({\mathrm{W}}_{{\mathrm{LS}}_{{\mathrm{i}}_{\mathrm{op}}}}\) of the last search, the central point was reset and then the search limits were decreased by 5% of the levels. This procedure was repeated until the difference between the current minimum \({\mathrm{W}}_{{\mathrm{LS}}_{{\mathrm{i}}_{\mathrm{op}}}}\) and the previous minimum varied less than 0.02. Concerning the SMZ related parameters, for the bulk liquid enzymatic degradation, two parameters were involved. Thus, the search procedure followed the flowchart in Fig. 2. For the cometabolic transformation, with one parameter, the procedure was conducted aiming to minimize the \({\mathrm{W}}_{{\mathrm{LS}}_{{\mathrm{i}}_{\mathrm{op}}}}\) by calculating the minimum of a second-degree polynomial function based on a search procedure with seven levels. This procedure was repeated until the difference between the last \({\mathrm{W}}_{{\mathrm{LS}}_{{\mathrm{i}}_{\mathrm{op}}}}\) with the current \({\mathrm{W}}_{{\mathrm{LS}}_{{\mathrm{i}}_{\mathrm{op}}}}\) was less than 0.02.

Fig. 2
figure 2

Parameter adjustment procedure flowchart

Since, in the second objective, the results of each OP interfere with the general adjustment, the Euclidean norm (EN) was used to evaluate the parameter adjustment. This norm was chosen to penalize higher WLS values computed from distinct OPs. To achieve this aim, a quasi-random design of experiments, adopting the Matlab qrandstream function using Sobol stream associated with an evolutionary operation, was used. The main reason for this choice was that the number of tests in factorial designs for systems with a large number of parameters increases geometrically, while quasi-random designs remain limited with a reasonable covering of the set. However, according to Schoen (1998), as the number of parameters increase, the chance of missing global optimum does also. Therefore, to avoid local minimums, the adjustment procedure followed the sequence below, considering that the acid adjustment sequence was: propionic, valeric, butyric, formic and acetic. This sequence was chosen because of the order of influence of each acid in other metabolic pathways.

  1. 1.

    Manual adjustment of the parameters

  2. 2.

    Generate a set of parameters using the quasi-random function within a confidence interval of ± 20% of the previous center set value. The number of trials was 10 times greater than the parameter set size.

    1. 2.1

      Automatic evaluation of the set of parameters generated

    2. 2.2.

      After the iteration, find the minimum EN and center the set for those parameter values and decrease the confidence interval in steps of 2% from the original value. Return to 2.

  3. 3.

    After nine iterations, manually verify if there is any better adjustment. If true, return to 2, if false, end adjustment.

Process identifiability

To ensure the identifiability of the model, the influence of its parameters was evaluated by sensitivity and collinearity analyses. The mathematical procedures were conducted as stated by Gabor et al. (2017). This procedure was conducted for the parameter set of both modelling approaches, with parameters varying ± 20% from their central points. For the first approach, the number of intervals was 30 and for the second 60, because it must be higher than the number of parameters of the set, plus one. In addition, the sensitivity threshold was four orders of magnitude smaller than the maximum observed parameter influence.

Results and discussion

Process identifiability

Metabolic pathways

The interaction between the metabolic pathways, as shown in Fig. 1, becomes evident through the sensitivity analysis, as shown in Fig. 3, in which the marked colored boxes indicate how much each parameter influenced each process. The magnitude of influence was logarithmic scaled between the maximum observed and the least level considered to be significant, e.g., 10−4 (Gabor et al. 2017), as scaled in the color bar on the right. These results are the maximum influence of each parameter for OPs 2, 7, 8, 9 and 10. This approach was assumed in order to clarify the interaction between the metabolic pathways. White boxes mean that the calculated influence was below the 10−4 influence threshold.

Fig. 3
figure 3

Parameter influence magnitude. The black line in the middle of figure separates the substrates, on the left, from their related biomasses, on the right

As observed in Fig. 1 and as proposed in Eqs. (1) and (2), the production of each measured acid has a certain degree of correlation, thus if any metabolic pathway yields coefficient changes, the other will be impacted. The most significant parameters were those related with the hydrolysis, Ya, Yh, KFA, Kaa and Ksu, as well as the propionic acid inhibition and the biomass half-saturation constant of the Contois kinetics. In turn, the valeric acid precursor inhibition also influenced several other metabolic pathways, although none were expected. The influence of the isovaleric and valeric acid parameters on the other processes could also be observed, which were due to their relationship with the protein degradation pathways. Similarly, this correlation can be done for the other acid production/consumption parameters. In the case of the citric acid, since it was barely produced during the experiments, weak interaction with the other acids was expected.

Concerning the collinearity analysis, a collinearity index threshold (CI) of 20 was assumed (Gabor et al. 2017), which means that 95% of the effects of any parameter with a CI above that can be explained by another parameter influence. Only the parameter Ksh (Contois kinetics biomass half-saturation constant) presented an interaction with other parameters in the same metabolic pathway. This observation occurred for some substrate consumptions: in the hydrolysis stage, where its effects presented a similar behavior of the substrate uptake rate, and for the propionic, isobutyric, butyric, and succinic acids where its effect could be compensated by the component formation yield. However, Ksh did not interact with biomass component related parameters. Since the model depends on both component uptake and biomass growth, it was considered identifiable as conceived.

Parameter adjustment

Component uptake parameters

As observed by Ghasimi et al. (2015), variations in the operational conditions, such as the OLR, sludge retention time and HRT, cause changes in the microbial community. Thus, it was also expected that the metabolic pathway varies with the operational conditions. The acid formation yields from carbohydrate are shown in Table 4. The protein yields were calculated by Eqs. (1) and (2). In the last line of Table 4, the removed SMZ percentages are shown for each OP. Three points should be highlighted: 1 for OPs from 3 to 6, all acids were consumed before the first sampling port; 2 for OP 10, all acid measurements of the first sampling port were missing; and 3 in OP 11, only the caproic, isobutyric and isovaleric acids presented significant measurements throughout the reactor. For all OPs, the most produced fractions were the acetic acid, the propionic acid, the valeric and the isovaleric acids.

Table 4 Yield coefficient for all components at different operational conditions

The Pearson correlation coefficient was added to Table 4 to assess the correlation between acid production yield fractions with the average SMZ removal for each OP. This correlation may indicate if SMZ degradation is related with any evaluated metabolic pathway. As previously explained, it was calculated for OPs 2, 7, 8, 9 and 10, as shown by Choi et al. (2010). The strongest observed correlation was related with the acetic acid, followed by the malic acid, propionic, valeric and isovaleric acid production fractions. Regarding the acetic acid, its correlation was inversely proportional, meaning that the higher the acetic acid formation yield during acidogenesis, the lower the SMZ degradation. According to Gonzalez-Gil et al. (2019), cofactors can highly improve micropollutant degradation under anaerobic digestion. Therefore, considering the acetic acid correlation, it may be related with an enzyme or cofactor linked to its formation. Given the coefficient of the other acids, it is unlikely that the SMZ degradation occurs during their production.

According to Batstone et al. (2002), the uptake rate of the carbohydrates, proteins and fats are distinct. However, no significant difference was observed among them during the parameter adjustment procedure, as seen in Table 5. The main distinction between the degradation rates was related to fat degradation sensitivity to the propionic acid inhibition, as proposed in Table 2 and shown in the Figs. 1.2a. 1.3a, 1.4a, 1.5a, 1.6a, 1.7a, 1.8a, 1.9a, 1.10a and 1.11a of the Supplementary Material (SM). The highest substrate degradation rates were found between OP 3 and 6 when the influent CODf was kept between 500 and 2000 mgCOD·L−1, for a long period, as shown in Tables 1 and 5. In these OPs, the acids were consumed before the first sampling port. Thus, all acid degradation constants were adjusted by keeping the OP 2 values and multiplied by a factor in order to keep the first sampling port volatile fat acid concentration lower than 5 mg·L−1 (arbitrary). On the other hand, the acid degradation rates of OP 7 and OP 8 were the lowest. Interestingly, the hydrolysis degradation rates were not as affected as the acid uptake rates. It is also interesting to note the differences between the degradation constants of each biomass group, which means that they were distinctly affected by the changes in operational conditions. For all cases, the adaptability of the microbial community can be the reason for such differences (Fonseca et al. 2018).

Table 5 Component degradation, model adjustment and inhibition constants for each OP

The main simulated biomass group concentrations throughout the reactor are shown in the Supplementary Material, Figs. 1.2b, 1.3b, 1.4b, 1.25, 1.6b, 1.7b, 1.8b, 1.9b, 1.10b and 1.11b and the experimental data are shown in Figs. 1.7b and 1.11b. It can be observed that the simulated total biomass did not follow all experimental samples. In a previous study, Fonseca et al. (2018) achieved a better adjustment for biomass, considering both Contois kinetics and the effects of the biomass on the overall uptake rate. However, here the biomass effects on the overall uptake rate, using the same adjustments, were much more significant. Since no reasonable hypothesis was found to improve the adjustment, it was kept in the presented structure, once the results of OP 11 were accurate.

The adjusted WLS for all measured components are also shown in Table 5. Firstly, considering the caproic acid, for several OPs, the results were not accurate, which means that the proposed structure was not capable of representing its production pathways in all operational conditions, as can be observed in the Supplementary Material, Figs. 2.2l, 2.3l, 2.4l, 2.5l, 2.6l and 2.7l. However, chain elongation cycles are well-known, and thus acetate can be converted to butyrate that can be converted to caproate, at certain operational conditions (Kucek et al. 2016). This metabolic pathway was not implemented for two reasons: 1 both the caproic acid production and consumption rates significantly varied between the OP, and 2 in the current structure, increasing the number of parameters would not improve its predictability. On the other hand, this metabolic pathway could help to understand the late butyric and isobutyric acid formation that occurred in OP 8 and the butyric acid formation in OP 9. Nevertheless, it has not occurred in all OPs.

OP 8 also presented a strong inhibition for the valeric acid production, Supplementary Material, Figs. 2.2j, 2.3j, 2.4j, 2.5j, 2.6j, and 2.7j. As observed, its formation only started after most of the propionic acid had been consumed. A similar behavior was found in OP 9, but less significant. This indicates that the operational condition change from OP 7 to OP 8 has strongly affected this pathway, and it needed more than four weeks to recover since no similar dynamic was found in OP 10 (data shown in the Supplementary Material). The succinic acid production pathway was evident in OP 7 and OP 8, in which other dynamics ruled its production after the malic acid degradation, Supplementary Material Figs. 2.3c and 2.4c. It was presumed that the COD changes from OP 6 to OP 7 and from OP 7 to OP 8 has impaired this metabolic pathway. Concerning the isovaleric acid, the low WLS accuracy in OP 8 was due to its late production, as can be seen in Fig. 2.4j of the SM. However, the metabolic pathway that led to that result was not clear. This kinetic was also found in the formic acid dynamics in OP 7, Supplementary Material Fig. 2.3j. The acetic acid response occurred as predicted by the model, except for the lack of accuracy in OP 8, Supplementary Material Fig. 2.4e, which was due to the valeric acid degradation to acetic acid and to the sensitivity of the WLS methodology.

SMZ degradation hypotheses

The highest SMZ removal occurred at OP 5, 6 and 7, as shown in Table 4. When compared with the degradation constants, these results indicate that the process degradation performance is more closely related to the metabolic pathways than to their components´ uptake rates. When comparing Table 4 with Table 5, it can be seen that the inhibitory constants were not correlated with SMZ removal. The propionic acid inhibition to the valeric acid precursor was the most specific behavior in this study, as observed in OP 8 and 9. It was attributed to a sudden lowering of CODt from 7300 to 2300 \({\text{mg}}_{{{\text{O}}_{2} }} \;{\text{L}}^{ - 1}\) between OP 7 and OP 8 (data not shown). This change in the growth support substrate availability may have significantly impaired this metabolic pathway, which needed more than two months to recover. Interestingly, the SMZ degradation removal was not considered to be affected by this change, since it was not relevant in OP 10 and 11, and the SMZ degradation removal was low.

Two hypotheses were evaluated to explain the SMZ degradation mechanism, the apparent enzymatic activity degradation, and the component degradation cometabolism. The former was associated to the hydrolysis stage, while the latter was related to the fatty acid degradation. The cometabolic degradation hypothesis was evaluated by Oliveira et al. (2016). They conducted a batch experiment, with 1600 mg L−1 CODf and 100 µg L−1 SMZ. After the SMZ degradation stopped, because the CODf was consumed, they added 1600 mg L−1 of CODf in sucrose to the medium. After this COD pulse, the SMZ degradation started again, but with a kinetic distinct of the COD degradation, which indicates that the cometabolic reaction did not occur during the sucrose hydrolysis, but in a further reaction. Oliveira et al. (2019) carried out COD impulses by adding starch, cellulose, sucrose, glucose, fructose, meat extract, soy oil, ethanol, propionic acid, butyric acid, and acetic acid to compute the contribution of each substrate in SMZ degradation. When comparing it to the control experiment, SMZ removal was improved by sucrose, glucose, fructose and the meat extract.

The degradation coefficients for all evaluated components in all OPs are shown in Table 6. Their corresponding adjustments are shown in the WLS line and the sum of all WLS OPs in the column \(\sum\nolimits \mathrm{WLS}\). The lower the value of WLS and \(\sum\nolimits \mathrm{WLS}\), the higher the correlation of the SMZ cometabolic pathway. Thus, the best results were related with carbohydrate and protein enzymatic hydrolysis, and with propionic, butyric, and isovaleric acid cometabolism, as shown in Supplementary Material Figs. 3.7 and 3.9, which represent OP 7 and OP 9, respectively. These results are seconded by the formic acid, in which WLS was slightly higher than the others. Most of the other evaluated cometabolic pathways fail to represent the degradation due to the reaction rate throughout the reactor in one or more OPs. The most evident are from OP 7 to OP 10, in which the kinetics drastically change between the OPs. Since the metabolic pathways were distinctly affected in these OPs, the differences became clear. However, higher values of WLS do not mean that a specific metabolic pathway could not be related with the degradation, but less likely. Furthermore, the SMZ degradation in OP 7 is very similar to the COD consumption, as shown in Supplementary Material Fig. 1.7a. However, in OP 9, despite the fact that the COD consumption kinetic was similar to that observed for OP 7, the SMZ removal presented a ‘S’ shaped behavior, as can be seen in Supplementary Material Fig. 1.9, showing evidence of the impacts of the operational conditions on degradation kinetics. The SMZ degradation kinetic for all OPs is shown in the Supplementary Material Figs. 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.20 and 3.11.

Table 6 Sulfamethazine degradation coefficients for each component

Considering the results shown in Table 6 and the observations of Oliveira et al. (2019), the isovaleric acid degradation pathway could be considered an alternative. However, according to Batstone et al. (2002), the isovaleric acid formation is related to protein degradation. Moreover, in the batch experiments, the SMZ was degraded when only carbohydrates were added as substrate, meaning that it is possible that other metabolic pathways are involved in this process. According to Oliveira et al. (2019), the removal efficiency was improved by adding sucrose, glucose, fructose and meat extract. Since the greatest correlations were found as an apparent enzymatic activity degradation, a bulk enzymatic reaction during the acid formation stage was the most likely degradation mechanism. Further investigation was carried out by comparing this pathway with the isovaleric cometabolism in the long-term effects of the operational condition variations.

Long-term effects of the operational condition variation parameter adjustment

Long-term effect modelling depends firstly on the initial conditions of the process. Before OP 2, no kinetic data was available, only the influent and the effluent SMZ and COD concentration data. Thus, the initial conditions for all biomass adaptations were assumed to be equal. Furthermore, their adaptation levels were assumed to be the least necessary to assure that the effluent COD was completely consumed, as shown in Fig. 4a.

Fig. 4
figure 4

Biomass metabolic pathway adaptation for several operational condition variations. The metabolic formation yields are referred to as the degradable influent CODf

Concerning the acid formation yields, they were assumed to be equal to their maximum levels, parameter \({\mathrm{Y}}_{{\mathrm{j}}_{\mathrm{M}}}\) of Table 7. Most of the changes in the acid formation yield occurred due to HRT changes. However, it was found that the propionic acid formation should be affected by SMZ changes, otherwise a large amount of acids would be found in effluent COD during OP 2, resulting in a concentration of almost 1000 mgCOD L−1, while the measured concentration was between 200 and 340 mgCOD L−1.

Table 7 Long-term process adjusted parameters. Y_(j_M ) for the butyric group, the propionic and formic acids refer to sugars, while the valeric group refers to proteins. The “dashes” mean that the parameter had no influence on the respective process

In Table 7, some parameters had no influence in their respective process. This result is a combination of the collinearity/sensitivity analysis with the proposed initial condition restrictions. For most of the processes, the collinearity critical index (CI) would be higher than 20.0, if the formation yields were affected by either SMZ and COD variations. The SMZ effects on propionic acid formation yield did not affect its metabolic pathway CI. On the other hand, the acetic acid and the valeric group CI presented, respectively, a level of 28.1 and 25.5. This value was expected for the valeric acid, since as proposed by the modelling, except for the formic acid, all other acid fractions are degraded to acetic. As can be seen in Fig. 4a, all acids are affected very similarly by the operational conditions, which means that one or more pathway could affect acetic acid production, and consequently, its consumption. If only its consumption was considered, the CI would be lower than 4.0. For the valeric group, parameter \({\mathrm{f}}_{{\mathrm{V}}_{\mathrm{j}}}\) was responsible for that CI. Nevertheless, it was not possible to exclude it, neither any other parameter related with this metabolic pathway, without severely impairing any OP adjustment. Thus, despite failing to achieve the CI, this parameter was kept in the modeling. The adjusted parameters are shown in Table 7, while the initial biomass adaptation was assumed to have 25% of its maximum performance for this process.

The long-term parameters represent the effects of the operational conditions in each evaluated metabolic pathway. The higher the sensitivity parameters of Eqs. (15)–(17), the higher the impacts of operational condition variations on the overall process performance. Thus, the formation yields were mainly affected by HRT changes, which does not mean that they could not be affected by COD and SMZ variations. However, considering the experimental data available, they were not significant for the modelling adjustment. Furthermore, as can be seen in Table 7, most processes were not affected by increasing the surface velocity of the liquid, but no effect was observed as it decreased. Two exceptions were observed. The hydrolysis/acid formation stage was affected by all changes in HRT at the same level. The valeric group adaptation was only impaired when lowering the superficial velocity, while its formation yield was only affected when increasing it. As proposed in Eq. (17), the parameter \({{\uptheta }_{\mathrm{V}}}_{\mathrm{j}}\) concerning the impacts of HRT on the biomass adaptation and the metabolic formation coefficients was adjusted equal to 1.00 for all processes. The results of HRT changes in metabolic pathways can be seen in Fig. 4b, where the shift for acetic acid production during OP 9 and OP 10 is shown. Interestingly, no accumulation of this acid was observed, meaning that its consumption was not affected by HRT. It is also possible that other non-monitored acids were formed during these phases (Grootscholten et al. 2013). Even though the butyric group formation yield was not affected by operational conditions variations, it increased between OP 9 and OP 10, as shown in Fig. 4b. This rise occurred due to the lowering in the valeric group formation, which shifted the metabolic pathways from proteins to other pathways. This change also enhanced the other acid formation in those operational conditions.

By comparing the adaptation levels of the hydrolysis in OP 2 and in OP 5 in Fig. 5a, it can be observed that a variation of 8 µg L−1 of SMZ presents an impact on the process greater than a 1000 \({\text{mg}}_{{{\text{O}}_{2} }} \;{\text{L}}^{ - 1}\) of COD. It is also noticeable that these impacts also vary depending on the metabolic pathway. Figure 5a shows the valeric group and acetic acid adaptability to COD variation, as can be seen in Table 7. Both presented sensitivities almost one order of magnitude lower than the other acids. Considering the SMZ, all acid degradation processes were affected in a very similar level and with no differentiation between the negative and positive variations. For all cases, negative variations in COD affected the biomass adaptation more than 10 times lower than positive variations.

Fig. 5
figure 5

Simulated and experimental kinetics of the measured CODf and the estimated biomass in all OPs. Figures from (a) to (j) describe the kinetics for the OPs from (2) to (11), respectively. The solid red lines are the estimated total biomass, measured in mg of volatile suspended solids, the dotted x-marked red lines in OP 7 (f), and in OP 11 (j), are the measured biomasses. The dotted x-marked green lines are the measured CODf throughout the reactor for each OP and the solid blue lines are the estimated CODf. (Color figure online)

The maximum consumption constant for acid consuming processes, \({\mathrm{K}}_{{\mathrm{j}}_{\mathrm{Max}}}\), was several times higher than the hydrolysis constant, despite the fact that these values vary from process to process. These values are possibly related with the type of reactions that occur at each stage, e.g., bulk reactions in the hydrolysis stage versus intracellular reactions during the acid consumption phase (Barrera et al. 2015; Donoso-Bravo et al. 2009; Myint et al. 2007). The propionic acid presented the lowest degradation rate among the acids, while the highest value was observed for the formic acid. The biomass adaptation rate was equal to all acid consuming processes, but slower for the hydrolysis/acid production stage. As can be observed in Fig. 4a, the hydrolysis stage was more robust to those changes than acids consuming bacteria, despite the slower response to recover from operational condition variations. Considering the metabolic pathway formation yield, the formic acid was the slowest to recover, followed by the propionic acid.

\({\mathrm{Y}}_{{\mathrm{j}}_{\mathrm{M}}}\) for the butyric group, the propionic and formic acids refer to sugars, while the valeric group refers to proteins. The “dashes” mean that the parameter had no influence on the respective process.

The estimated CODf and the experimental CODf concentrations throughout the reactor are compared for all OPs in Fig. 5a to j, respectively for OP 2 to OP 11. Figure 5a–j shows the model accuracy to represent the filtered COD kinetics in each OP. In OP 4 (Fig. 5c), the WLS was 27.54. This was an expected result, given that the measured CODf increases throughout the reactor, while the model only describes decays. In OP 10 (Fig. 5i), the calculated WLS was of 7.80, and in OP 7 (Fig. 5f), the calculated WLS was of 4.94. All other WLS were lower than 3.19, OP 5. For all cases, if the χ2 critical value was considered as the goodness of fitness, and the least necessary degrees of freedom to accurately describe those kinetics were 5 (Fonseca et al. 2018), a model with a WLS lower than 11.07 can acceptably represent the process. Considering the volatile fatty acids, the butyric group OP 11 modelling was not capable of representing that observation, as can be seen in Fig. 2.7 g of the Supplementary Material, where the acid was detected only in the third and in the fourth sampling ports. As a group, the calculated WLS was 16.10, while isolated, the isovaleric acid WLS was of 88.89, as shown in Table 5. This difference occurred due to summing the butyric and the isobutyric acids in Eq. (25), which significantly decreases the WLS. Similarly, the grouping approach also decreased the WLS for the valeric group. As can be seen in Table 5, the worst result was in OP 10 with a WLS of 45.28 for the isovaleric acid. Meanwhile in the grouped approach, the highest calculated WLS was lower than 6.00. Table 8 shows the WLS for all processes and OPs and their respective figures are shown in the Supplementary Material, Figs. 4.1, 4.2, 4.3, 4.4 and 4.5.

Table 8 Calculated WLS for the whole long-term process at each OP

SMZ degradation hypothesis

Considering the available information about the long-term SMZ degradation hypothesis, it must be analyzed in two perspectives: the first is the biodegradation kinetics throughout the reactor, the second is the effluent concentration during the experiments. For the kinetics, the SMZ was measured in 6 equally spaced points throughout the reactor in each of the 10 experimental phases, resulting in 60 samples. In turn, there were 155 effluent samples. Figure 6 shows the experimental influent data for the SMZ, and the simulated effluent for both hypotheses. The black dashed-dotted lines represent 95% of the confidence interval for each OP. Therefore, for most of the time, both approaches have been statistically successful in representing the real process, except for OP 8, where the valeric group cometabolism failed. This event was firstly considered because of the grouping method; however, other simulations that were carried out to simulate only the isovaleric acid (data not shown), presented similar results. This occurred because of its low formation yield during OP 8, OP 9 and OP 10, as shown in Table 4. The amount of acid produced was not enough to achieve the degradation levels of early OP 8. Therefore, this observation only supports the idea that another metabolic pathway is involved.

Fig. 6
figure 6

Comparison between SMZ experimental data and simulated hypotheses along several operational conditions. The blue line represents the influent SMZ, the dark red the experimental effluent SMZ, and the yellow and the green lines represent, respectively, the bulk enzymatic reaction and the valeric/isovaleric group cometabolic approach. (Color figure online)

The enzymatic approach was divided into the enzyme production and enzymatic reaction. Due to the carbon sources that resulted in SMZ degradation improvements, as shown by Oliveira et al. (2019), only the sucrose carbohydrate fraction from the influent COD described by Oliveira et al. (2017) was considered able to sustain the formation of the enzymes capable of degrading SMZ. The sucrose fraction represented 60% of the carbohydrate COD, or 30% of the proposed wastewater COD. The meat extract was also considered capable of producing such enzymes, and it represented another 30% of the COD of the wastewater. The enzyme was degraded proportionally to their concentration and both production and degradation were related with a propionic acid inhibition. This inhibition presented a different level to the COD consuming stages, as shown in Table 9, among the other adjusted parameters for both approaches. The parameters \({{\uptheta }_{\mathrm{C}}}_{\mathrm{j}}\), \({{\uptheta }_{\mathrm{S}}}_{\mathrm{j}}\) and \({{\uptheta }_{\mathrm{V}}}_{\mathrm{j}}\) were equal as shown in Table 7. As shown in Eq. (26), the degradation capability is inversely related to the acetic acid direct production yield during the acid formation stage, as well as with the organic load rate. Furthermore, the half-saturation coefficient is proportional to the direct acetic acid formation.

Table 9 Long-term SMZ degradation hypothesis parameters

The biodegradation kinetics for both approaches is shown in Fig. 7. As can be observed in the yellow lines for the apparent enzymatic activity, during OP 4 to OP 6 the SMZ was not degraded to the measured levels, even though the substrate consumption modelling presented good results. Therefore, since the SMZ degradation rate is inversely related to acetic acid production during the acidogenesis stage, it was assumed that the other acid formation yields were underestimated. Thus, the propionic, butyric and formic acid formation yields were increased, and the other parameters were corrected to minimize the WLS for each pathway. The parameters´ adjustment results are shown in Table 9 and are graphically represented by the blue lines in Fig. 7. Substrate consumption WLS presented a maximum reduction of 0.2 for all metabolic pathways. These results support the hypothesis that the SMZ degradation occurs during the acidification stage. Further simulations were carried out by increasing the valeric group formation yield, which enhanced the WLS minimization for this pathway, as well as the SMZ degradation. However, due to the collinearity analysis, the addition of any other parameter to that metabolic pathway would not be plausible.

Fig. 7
figure 7

SMZ kinetics of both degradation approaches for all OPs. The dotted x-marked lines represent the experimental observations, the green lines the valeric group cometabolic degradation, the yellow the bulk enzymatic reaction with the substrate consuming parameters as shown in Table 7 and the blue line a reviewed version of those parameters to decrease the acetic acid production during acidogenesis. Here, (a) to (j), respectively represent OP 2 to OP 11. (Color figure online)

Considering the effects of enzymes and cofactors on antibiotics degradation shown by Gonzalez-Gil et al. (2019), and the acetic acid inverse relation found in this study, enzymes/cofactors near acetyl-coA that are responsible for the pyruvate transformation (Bensaid et al. 2015; Cai et al. 2016) could be considered in possible agents for SMZ degradation. On the other hand, the simulations show that the SMZ removal occurs in bulk liquid. Additionally, such enzymes and cofactors are mainly related to cellular internal reactions and no evidence that these are excreted were found. Finally, despite not being conclusive about the exact step of acetic acid formation during acidogenesis that leads to SMZ degradation, the developed model can help to identify possible operational conditions that improve it, by degrading acetate formation during acidogenesis.

Conclusion

A mathematical model with sixteen-component metabolic pathways, considering 12fatty acids, filtered COD and other two estimated and identifiable fatty acids precursors, was developed to represent an anaerobic process treating an antibiotic contaminated wastewater. Certain metabolic pathways were closely related to the average antibiotic removal, such as the malic, the propionic and the isovaleric acids, as well as the hydrolysis/acidogenesis stage of proteins and carbohydrates. Long-term adaptation modeling was developed to describe the process over more than 470 days of reactor operation. This innovative approach was used to evaluate the two most suited cometabolic SMZ biodegradation hypotheses based on component degradation kinetics, i.e., for a bulk-liquid apparent enzymatic reaction during hydrolysis/acidogenesis stage and for the isovaleric acids consuming cometabolism. The former presented higher correlation with the kinetics experimental observation and proved to be more robust when considering the effluent observations, since it did not register deviations larger than the confidence interval. These results indicated that the sulfamethazine degradation occurred during the acidogenesis stage and its performance depends mainly on operational condition stability.

The main advantages of the proposed modeling are the capability of describing other processes treating different wastewaters contaminated with distinct micropollutants. However, it will be needed to readjust both kinetic model and long-term parameters; consequently, a sensitivity and a correlation analysis must be carried out to assess the parameters that are influent to the modeling. This will be required, because different compounds distinctly affect the process. Further investigations using this modelling suggests that it may also be interactively used to improve the experimental design to track which metabolic pathways are most related to micropollutants cometabolism. This hypothesis is based on its ability to explore how OLR and synthetic wastewater components´ concentration affects the process performance. In addition, due to the N-tank in series approach, multi-stages reactor can also be evaluated.