Gas-Permeable Membrane Technology Coupled With Anaerobic Digestion for Swine Manure Treatment

This study was aimed at evaluating gas-permeable membrane technology (N-recovery) coupled with anaerobic digestion for the treatment of swine manure. For this purpose, 66.7% of the initial total ammoniacal nitrogen contained in centrifuged swine manure (SM) was first recovered by an e-PTFE gas-membrane as an ammonium sulfate solution. The resultant manure effluent with reduced ammonia (ATM) was evaluated as anaerobic digestion (AD) substrate. It was compared with AD using the initial swine effluent (SM) without the N-recovery step (control). An organic loading rate (OLR) of 2.8 ± 0.5 g TCOD L-1 day-1 was established to ensure a stable process when working at semi-continuous mode. Regardless of the operation mode, methane yields of 105 ± 2 mL CH4 g TCOD -1 were obtained for ATM. The combined treatment resulted in an organic matter removal efficiency of 68.6%. Initial TCOD accounted for 54.69 g L-1. The results prove that it is feasible to combine gas-permeable membrane technology and anaerobic digestion for the treatment of swine manure, contributing to ammonia emissions mitigation and sustainable livestock waste treatment. Moreover, by means of this technology combination, a variety of valuable products is obtained, namely sustainable energy in the form of methane and fertilizers.


INTRODUCTION
Spain is the second European country with the highest pig population, accounting for 29,970,000 swine heads in 2017. Estimating a production of 2.5 m 3 manure per head per year, the calculated swine manure (SM) production would be around 75 million m 3 of manure every year (Spanish Royal Decree 324, 2000;EUROSTAT, 2018). SM has been traditionally applied for agricultural purposes close to the farm. However, this is not always possible in recent times, due to the size increase in livestock farms together with their location in concentrated areas. Moreover, high transportation costs due to the high water content of SM makes its transportation economically unfeasible (Flotats et al., 2009). Since agriculture is nowadays the largest source of ammonia (NH 3 ) emissions (EEA, 2015), which are closely related to a variety of environmental problems and to human health risks, an improved management of SM with reduced NH 3 emissions is urgently required. In this vein, a new European Directive was proposed in 2016 to improve the quality of the air (EC-European Commission, 2016). In the case of Spain, the reduction commitment for NH 3 annual emissions accounts for 3% for any year from 2020 to 2029 and for 16% for years after 2030, compared to 2005, which was selected as the base year. Reducing nitrogen content in SM could help to balance nutrient composition and fertilizing value while minimizing NH 3 emissions. Different technologies are being successfully applied to reduce nitrogen from livestock wastes. These technologies are mainly based on biological methods, as nitrificationdenitrification (Riaño and García-González, 2014), microbial fuel cells (Kuntke et al., 2012) or anammox process (Molinuevo et al., 2009) and physical-chemical approaches, as ammonia stripping (Bonmatí and Flotats, 2003), ion exchange (Milan et al., 1997), struvite precipitation (Laridi et al., 2005), reverse osmosis (Masse et al., 2010), or, more recently, gas-permeable membrane technology (García-González et al., 2015;Vanotti and Szogi, 2015). In most of the cases, nitrogen is eliminated from the waste and either released to the atmosphere (as N 2 ) or trapped in an inert material and, therefore, not recovered. However, nitrogen should be considered as a resource and technologies should be aimed at recovering this compound.
Besides the capacity of recovering NH 3 , gas-permeable membrane technology presents diverse advantages over traditional technologies such as its large contact area between the liquid waste and NH 3 -trapping solution, the low-pressure performance or no need of additives in the liquid waste. More specifically, just a diluted acid is used to recover the nitrogen, which is further valorized as fertilizer. pH control is carried out using low-rate aeration, reducing operational costs by 57% when compared to alkali chemical addition (García-González et al., 2015). Moreover, the energy consumption is lower than in other nitrogen recovery technologies. For instance, energy demand is 18 times lower than for air stripping (Zarebska et al., 2015). Ammonia passes through the microporous hydrophobic membrane by diffusion. Mass transfer depends on the differences in NH 3 concentration between the wastewater and a concentrated acidic solution, which is circulating inside the membrane lumen and it is used to recover nitrogen as an ammonium sulfate solution. The efficiency of the process is dependent on the pH and temperature in the manure, which determines free NH 3 concentration. Total ammoniacal nitrogen (TAN) recoveries up to 82% of the initial TAN have been reported with pH adjustment. This value decreased to 55% without pH control (Garcia-González and Vanotti, 2015). Moreover, organic matter is partially removed during SM treatment by gas-permeable membrane technology at low-aeration rates. Percentages between 26 and 65% of the initial total chemical oxygen demand (TCOD) in SM (initial TCOD between 16.7 and 67.1 g TCOD L −1 manure ) have been reported (García-González et al., 2015;Riaño et al., submitted). Unfortunately, none of these studies has presented an explanation for this fact.
The resultant effluent after treating manure by gas-membrane technology, from now on called ammonia-trapped manure (ATM), which is characterized by a low TAN content, still needs stabilization. Similar to fresh manure, the high buffer capacity together with the high content of organic matter makes ATM a potential substrate for anaerobic digestion (AD). Anaerobic digestion is a well-established stabilization technology by which organic matter is converted into renewable energy.
Additionaly, AD contributes to greenhouse gas mitigation, odor and pathogen reduction, and organic nitrogen mineralization into available nitrogen for plant growth (Cantrell et al., 2008). Moreover, coupling gas-permeable membranes with AD could contribute to reduce potential NH 3 -mediated inhibitions of the acetoclastic methanogenic biomass, which would result in an enhanced methane production. The use of gas-permeable membrane technology in order to counteract the NH 3 inhibition in AD has been minimally studied (Lauterböck et al., 2012(Lauterböck et al., , 2014 and further research is needed. Lauterböck et al. (2012) proposed the introduction of a membrane module inside AD reactors. They reported acid leakage and low pHs (only 10% of the total TAN was dissociated to free NH 3 ), resulting in low nitrogen recovery rates. The present study is aimed at evaluating gas-permeable membrane technology coupled to AD for the treatment of SM. In order to avoid possible operational issues and with the objective of optimizing nitrogen recovery (N-recovery), both processes were separated. For this purpose, nitrogen from fresh SM was first recovered by an e-PTFE gasmembrane. ATM was evaluated as substrate for AD and its stabilization was studied. Hence, batch and semi-continuous AD at increasing organic loading rates (OLRs) were investigated for ATM compared to a control treatment (i.e., AD of SM). Finally, the nutrient removal efficiencies and the obtained products (i.e., fertilizers and methane) were assessed for the combined treatment compared to the control.

MATERIALS AND METHODS
Origin of the Two Substrates, Swine Manure (SM) and Ammonia-Trapped Manure (ATM), and the Inoculum Centrifuged SM was collected from a farm located in Narros de Cuellar (Segovia, Spain). The manure was transported in coolers to the laboratory and subsequently stored at 4 • C for further use. ATM was obtained from the N-recovery experiments described in section N-Recovery Step. The inoculum used for the AD experiments (AD inoculum) was a mesophilic anaerobic sludge that was obtained from the municipal wastewater treatment plant (WWTP) in Valladolid, Spain.

N-Recovery Step
Nitrogen recovery was conducted in semi-continuous experiments as described by Riaño et al. (submitted). Ammonia separation tanks contained a total working volume of SM of 2 L. A tubular gas-permeable membrane, made of expanded polytetrafluoroethylene (e-PTFE) (Zeus Industrial Products Inc., Orangeburg, SC, USA), was submerged and fixed in horizontal position in the bottom of the NH 3 separation tank. Continuous stirring was provided and a nitrification inhibitor was added in order to avoid nitrification processes in the SM. Continuous aeration was supplied with an airflow rate of 0.24 L air L −1 manure min −1 . Sulfuric acid 1N was continuously recirculated through the tubular membrane. Initial pH in the manure accounted for 7.6. It rapidly increased during the five first days of operation, being in the range of 8.4-8.6. pH in the acidic solution was maintained below 2. A protocol was established: concentrated H 2 SO 4 (96-98%) was added to the acidic solution to an endpoint of pH < 1 whenever the pH of the acidic solution increased to 2. The NH 3 separation tank was fed once a day each weekday at a hydraulic retention time (HRT) of 7 d during 30 d (period I) and a HRT of 5 d for 20 d (period II). These HRTs corresponded to ammonium loading rates (ALR) of 491 and 696 mg TAN L −1 d −1 , respectively. TAN removal reached 79% for period I and 56% for period II, with 90% of recovery by the membrane in both periods. TCOD removal reached 37% for period I and 27% for period II, respectively (initial TCOD in SM was 67.1 ± 10.1 g TCOD L −1 ) (Riaño et al., submitted). Moreover, a solution of up to 19 g TAN L −1 was obtained, since NH 3 was converted to ammonium sulfate. N-recovery experiments were carried out in semi-continuous mode and different operational conditions were tested. In this manner, different ATM batches were obtained during the experimental time. ATM effluents from the whole experiment were utilized for the AD experiments.

Biochemical Methane Potential (BMP) Experiments
The biochemical methane potential (BMP) of the different substrates was carried out in bottles with a total volume of 0.57 L. Two different experiments (batch 1 and batch 2) with different substrate (S o ) to inoculum (X o ) ratios were run. Thus, batch 1 and batch 2 were performed with S o /X o ratios of 1 and 3, respectively. The units for S o were g TCOD L −1 and the units for X o were g VS L −1 . These ratios were chosen based on substrate characteristics (González-Fernández and García-Encina, 2009;Raposo et al., 2011). The S o /X o ratio of 1 was chosen to study the maximum BMP that can be obtained from the substrates, while ensuring a stable process. The S o /X o ratio of 3 was used to investigate the potential inhibitors during AD of the substrates. More specifically, a S o /X o ratio of 3 in SM AD would result in reactor imbalances due to acetate and propionate accumulation (González-Fernández and García-Encina, 2009). The composition of ATM was similar to SM but with more recalcitrant organic matter, so that a S o /X o ratio of 3 was chosen in this case to study the possible imbalances caused by VFA accumulation. Two different substrates were studied in each batch experiment, namely ATM and SM. Anaerobic sludge was used as inoculum (AD inoculum). Chemical characteristics of AD inoculum, SM, ATM1 (ATM effluent used for batch 1) and ATM2 (ATM effluent used for batch 2) are shown in Table 1. Quantities of substrates and inoculum were calculated to get the desired S o /X o ratio in each case. More specifically, in batch 1, 87 and 51 g of fresh ATM1 and fresh SM were added to the bottles corresponding to BMPs of ATM1 and SM, respectively. Concerning batch 2, 130 and 76 g of fresh ATM2 and fresh SM were added to the bottles corresponding to BMPs of ATM2 and SM, respectively. The amount of AD inoculum in each bottle was 200 and 100 g for bottles in batch 1 and bottles in batch 2, respectively. In every bottle, water up to a final amount of 300 g of liquid mixture was added, thus allowing headspace for the gas of approximately 0.27 L. For the determination of endogenous methane production, blanks containing only AD inoculum were run. The BMP assays were run in triplicates using the method of Molinuevo-Salces et al. (2013). After the set-up of each bottle, the headspace was flushed with nitrogen in order to ensure anaerobic conditions. Then, the bottles were placed in an incubator at 36 ± 1 • C and continuous agitation was provided by a shaker. The incubation time was 35 days. The volume of biogas produced by the different substrates was calculated by measuring the pressure of the bottle's headspace. Biogas composition was analyzed twice per week. Methane yield, expressed as CH 4 per gram of TCOD added, was calculated.

Anaerobic Digestion Step: CSTRs Set-Up
In order to study the feasibility of treating ATM effluents in AD plants, the results obtained in the batch experiments were scaled up in a semi-continuous system. Two semi-continuous stirred tank reactors (CSTR) with a working volume of 2 L were utilized: one reactor (R1) was used for AD of diluted swine manure (DSM) and the other for AD of ATM (R2). Fresh SM was ATM1 and ATM2 correspond to the ATM effluents used for batch 1 and batch 2, respectively. TS, VS, TCOD, SCOD, TVFA, TAN, and TKN stand for total solids, volatile solids, total chemical oxygen demand, soluble chemical oxygen demand, total volatile fatty acids, total ammoniacal nitrogen and total Kjeldahl nitrogen, respectively. STDEV stands for standard deviation. n.d., not determined.
diluted with water, resulting in DSM. The high organic matter removals during N-recovery made it necessary to dilute the fresh SM. This was done in order to keep a constant and equal influent concentration of TCOD in both reactors and compare the AD performance of both substrates (DSM and ATM) at exactly the same OLR. Figure 1 presents a scheme of the experimental setup. Agitation was magnetically provided in both reactors (400 rpm). The temperature was maintained at 37 ± 1 • C using a water jacket connected to a temperature-controlled water bath. The reactors were initially filled with 2 L of AD inoculum ( Table 1). After one day, manual feeding of the reactors was started once per day, every weekday. Substrates for R1 and R2 were daily prepared by diluting the substrate in water when necessary. Three different stages were established for the semi-continuous operation of the reactors. The first stage corresponded to an acclimation period which lasted 20 days. The second stage (period I) was started by fixing OLR and HRT for both reactors at 2.7 ± 0.4 g TCOD L −1 d −1 and 11 days, respectively. Finally, for period II, OLR and HRT were set for both reactors to 7.0 ± 1.3 g TCOD L −1 d −1 and 5 days, respectively. Table 2 presents the operational parameters, influents chemical composition, effluents chemical composition, and biogas characteristics for R1 and R2 during both periods. Biogas production (quantified by water displacement) and pH were measured every weekday. Influent and effluent samples were taken and analyzed for total alkalinity (TA), partial alkalinity (PA), total solids (TS), VS, TCOD, soluble chemical oxygen demand (SCOD), total volatile fatty acids (TVFA), TAN, and total Kjeldahl nitrogen (TKN) twice a week. Biogas composition was measured once per week.

Mass Balances
Mass balances in terms of TAN, TKN, SCOD, and TCOD were carried out both for the combined SM treatment (Nrecovery from SM by gas-permeable membrane technology and AD of ATM) and for the control treatment (AD of SM). These mass balances were performed with data corresponding to the best scenarios in semi-continuous mode for N-recovery from SM (section N-Recovery Step) and AD (section Anaerobic Digestion Step: CSTRs Set-Up). More specifically, the mass balances used data corresponding to period I in the N-recovery by gas-permeable membranes (Riaño et al., submitted) and data corresponding to period I for the AD-CSTRs experiments.

Analytical Methods
Analyses of TS, VS, TCOD, SCOD, TAN, and TKN were performed in duplicate in accordance with APHA (2005). TS content was determined by drying the sample to a constant weight at 103-105 • C. The TS residue was ignited at 550 • C to constant weight and the weight lost on ignition was the VS content. TCOD and SCOD were determined following closed reflux colorimetric method. TKN was measured according to the Kjeldahl digestion, distillation, and titration method. TAN was measured according to the distillation and titration method. Total alkalinity, PA, and pH were monitored using a pH meter Crison Basic 20 (Crison Instruments S.A., Barcelona, Spain); TA and PA were obtained by measuring the amount of 0.1 N-H 2 SO 4 needed to bring the sample to a pH of 4.3 and 5.75, respectively. IA and IA/PA ratio were determined as proposed by Ripley et al. (1986). Intermediate alkalinity (IA) is the result of subtracting PA from TA. Biogas composition was analyzed using a gas chromatograph (Agilent 7890A, USA) with a thermal conductivity detector, provided by a HP-Plot column (30 m 0.53 mm 40 µm) followed by a HP-Molesieve column (30 m 0.53 mm 50 µm). Helium (7 mL min −1 ) was used as the carrier gas. The injection port temperature was set at 250 • C and the detector temperature was 200 • C. The temperature of the oven was set at 40 • C for 4 min and thereafter increased to 115 • C. Methane values were expressed at normal conditions (i.e., 0 • C and 1 atm). The concentrations of acetate, propionate, butyrate, iso-butyrate, valerate, iso-valerate, and caproate were determined using a gas chromatograph (Agilent 7890A, USA) equipped with a Teknokroma TRB-FFAP column of 30 m length and 0.25 mm i.d. followed by a flame ionization detector (FID). The carrier gas  was helium (1 mL min −1 ). The temperature of the detector and the injector was 280 • C. The temperature of the oven was set at 100 • C for 4 min, then increased to 155 • C for 2 min and thereafter increased to 210 • C. TVFA were calculated as the sum of those acids.

BMP Tests
The accumulated methane yields, as mL of CH 4 per gram of TCOD added, are presented in Figure 2. Figure 2A corresponds to a S o /X o ratio of 1 (batch 1). Figure 2B corresponds to a S o /X o ratio of 3 (batch 2). In both S o /X o ratios, ATM achieved lower methane yields than SM and the differences were smaller when S o /X o ratio was 1. More specifically, in the case of a S o /X o ratio of 1, the difference in final CH 4 yields between ATM1 and SM was approximately 30% (106 ± 2 and 138 ± 2 mL CH 4 g TCOD −1 , respectively). However, with a S o /X o ratio of 3, the performance of ATM was affected, with a difference in final methane yields higher than 100% (61 ± 7 and 128 ± 1 mL CH 4 g TCOD −1 for ATM2 and SM, respectively). As expected, a lag phase during the first week in batch 2, corresponding to a S o /X o ratio of 3, was evidenced affecting AD for both ATM2 and SM ( Figure 2B).

Anaerobic Digestion in Semi-continuous Mode: CSTRs
Two AD CSTRs, namely R1 and R2, were run with DSM and ATM as substrate, respectively. Substrates were prepared daily prior to feeding the CSTRs to keep a constant HRT and equal influent concentration of TCOD in both reactors. This was achieved by diluting the substrate in water when necessary. The influent compositions are provided in Table 2. Figure 3 presents CH 4 yields and OLR of both reactors during this study. After an adaptation phase of approximately 20 days, both reactors reached steady state conditions. Regarding period I, averaged CH 4 yields for DSM (R1) were 1.4-fold higher than for ATM (R2), accounting for 145 ± 17 and 105 ± 17 mL CH 4 g TCOD −1 , respectively. An increase in the OLR from 2.7 to 7 g TCOD L −1 reactor d −1 resulted in a decrease in methane yield during period II. More specifically, yields of 56 ± 33 and 71 ± 20 mL CH 4 g TCOD −1 were obtained for DSM (R1) and ATM (R2) during period II, respectively. Besides methane yield, the stability of the AD process was evaluated in terms of TVFA concentration, pH, and ratio IA/PA. As seen in Figure 4 and Table 2, after the adaptation of the microbial community to the new substrates, the concentration of TVFA remained stable and at low levels during period I. The change in OLR resulted in a variation of AD performance. Thus, TVFA concentration increased and its composition varied ( Table 2). The ratio IA/PA is used as a stability parameter in AD, where ratios below 0.3 indicate a good state of the anaerobic process (Ripley et al., 1986). The fate of IA/PA ratio and pH over time is presented in Figure 4. Although pH remained stable during the complete experimental time, an increase in IA/PA ratio was observed during both the adaptation period and period II.

Membrane Technology Coupled With AD: Mass Removal Efficiencies and Evaluation of the Obtained Products
Nitrogen recovery and organic matter conversion were studied both for the combined treatment of SM, namely N-recovery by gas-permeable membrane technology followed by AD, and for the control treatment (AD of SM). Figure 5 presents mass balances for nitrogen in terms of TAN and TKN for the combined treatment ( Figure 5A) and the control treatment ( Figure 5B). Figure 6 presents mass balances for carbon in terms of TCOD and SCOD for the combined treatment ( Figure 6A) and the control treatment ( Figure 6B). The combined treatment of membranes and AD resulted in TAN recoveries as (NH 4 ) 2 SO 4 of 66.7%. TAN concentration in the ATM-Digestate accounted for 29.5% of the initial TAN. In the case of the control treatment of DSM, all the initial TAN was present in the DSM-Digestate. Concerning TKN, recovery efficiencies accounted for 92.4 and 97.5% for the combined and the control treatment, respectively. In the case of the combined SM treatment, 55.2% of the initial TKN was recovered as (NH 4 ) 2 SO 4 . 31.4 and 11.9% of the initial TCOD and SCOD, respectively, were found in the ATM-Digestate. These values were increased in the control treatment to 46.4 and 27.9% for TCOD and SCOD, respectively (Figure 6). Moreover, organic matter was converted in methane during AD. From the initial TCOD, 23.3 and 48.2% were recovered as methane for the combined treatment and the control treatment, respectively.
Three products were obtained by the combined SM treatment, namely renewable energy in the form of methane, a (NH 4 ) 2 SO 4 solution and ATM-Digestate. Methane content in the biogas produced with ATM as substrate accounted for 66-67% (R2;

BMP Tests
It is feasible to use ATM as a substrate for AD. Anaerobic digestion of ATM resulted in CH 4 yields in the range of 61-106 ml CH 4 g TCOD −1 . Regardless of the S o /X o ratio applied, CH 4 yields corresponding to the control (SM) were higher than CH 4 yields for ATM (Figure 2). This difference could be explained by the higher concentration of easily degradable organic matter in SM, when it is compared to ATM (Table 1). Consequently, the higher concentration of available easily  degradable organic matter in SM resulted in higher CH 4 yields than those obtained for ATM. The difference in concentration is the result of the partial degradation of organic matter that took place during the N-recovery process, resulting in TCOD removal values of 27-37% of the initial TCOD in SM. This degradation was probably due to the biological activity that takes place in SM at low HRT at room temperature. Moreover, this degradation could have been enhanced by the aerobic conditions caused by aeration. A previous study dealing with N-recovery by gas-permeable membranes using low-aeration rates reported TCOD removals up to 65% On the contrary; removed TCOD was very little when chemically adjusting wastewater to high pHs (García-González et al., 2015). Therefore, COD removal was most likely due to a mixture of both aerobic bacteria oxidation and COD volatilization during air bubbling.  . *It is assumed that the decrease of COD from ATM to ATM-Digestate was converted into biogas, except a 10% of that COD that was utilized for microbial growth during AD and not converted into biogas (Metcalf and Eddy, 2014).
Two parameters affecting AD stability, namely TAN concentration and organic load, were studied. First, the potential toxic effect of TAN during AD of ATM was not observed during these experiments, probably due to the high amount of inoculum utilized that diluted the TAN content during BMP incubation. Ammonium inhibitory levels for AD are established in the range of 4-10 g TAN L −1 (Angelidaki and Ahring, 1993;Rajagopal et al., 2013). In this case, TAN concentrations were far below those inhibitory levels for both ATM and SM ADs (up to 1.4 g TAN L −1 ). Second, and in order to investigate the effect of organic load over CH 4 yield, two different S o /X o ratios were studied. A lag phase was observed during the first week at a S o /X o ratio of 3 ( Figure 2B). This lag phase was probably due to the accumulation of TVFA after hydrolysis, which resulted in a delay in CH 4 production. However, a relatively high CH 4 yield together with an absence of TVFA and a stable pH (i.e., 7.49 in all the cases) after 35 days of AD indicates that the inhibition was partially overcome during the experimental time.
On the contrary, a S o /X o ratio of 1 avoided reactor imbalances due to TVFA accumulation. For this reason, the S o /X o ratio of 1 was selected as the optimum and any limiting effect in the hydrolysis due to a lack of organic matter for anaerobic bacteria was discarded. The obtained results in the batch experiments were used to select a proper HRT for the semi-continuous operation. As seen in Figure 2, CH 4 yields were stable after ∼11 days of AD, so that the starting HRT in semi-continuous mode (section Anaerobic CSTRs) was fixed at 11 days to maximize CH 4 production. In order to ensure a stable AD process, the OLR was established at ∼3 g TCOD L −1 d −1 (Banks and Heaven, 2013). For Period II, an HRT of 5 days was chosen to investigate if ATM could be used as AD substrate at lower HRTs than SM. Organic matter availability for AD microorganisms was different in SM and ATM, because the more degradable organic matter was eliminated during the N-recovery step. Even though the minimum generation time of acetoclastic methanogens is in the range of 2.7 days, and 5 is very close to this time, it has been demonstrated that AD of SM is feasible working at HRTs of 3-5 days and OLR between 3 and 5 g VS L −1 reactor d −1 (Hill and Bolte, 2000). Although OLRs was slightly higher in our case, a HRT of 5 days was chosen based in the results obtained in batch mode, where 80% of the final methane yield was obtained in the first 5 days (Figure 2A).

Anaerobic CSTRs
In order to obtain the same TCOD (i.e., the same OLR) in both R1 and R2, SM was diluted 1.6-1.8 times to reach the same TCOD concentration than ATM. This was done because an average of 32% of the initial TCOD in SM was lost during the Nrecovery step that produced the ATM (Riaño et al., submitted). Process performance during experimental AD of DSM (R1) and ATM (R2) is presented in Figure 3. Table 2 illustrates operational parameters, influent and effluent composition and biogas characteristics for each experimental period. The main difference between both substrates was that ATM substrate presented 10-times lower concentration of organic matter in the form of TVFA than DSM. Moreover, the initial TAN concentration accounted for 1.59 ± 0.2 and 0.87 ± 0.1 g L −1 for DSM and ATM during period I, respectively. Concerning period II, the initial TAN concentration accounted for 1.83 ± 0.2 and 0.95 ± 0.1 g L −1 for DSM and ATM, respectively. Similar to the results achieved in batch mode, maximum CH 4 yield for ATM (R2) at an OLR of 2.8 ± 0.5 g TCOD L −1 reactor d −1 was 105 ± 17 mL CH 4 g TCOD −1 . This value increased to 145 ± 17 mL CH 4 g TCOD −1 in the case of DSM (Figure 3). Thus, the higher concentration of easily biodegradable organic matter in DSM when it was compared to ATM, resulted in higher CH 4 yields for DSM ( Table 2). An increase in OLR during period II from 2.7 to 7.0 g TCOD L −1 reactor d −1 resulted in an organic overload as shown by the large reduction in CH 4 yield (Figure 3). Figure 4 presents TVFA concentration, pH and IA/PA ratio for both reactors during the experimental time. Volatile fatty acids (TVFA) are produced during the acidogenic phase of AD. If hydrolysis and methanogenesis are balanced, TVFA concentration in the reactor should be stable and generally low. TVFA remained stable and at low levels (0.59 g TCOD L −1 for R2) during period I (Figure 4). When there is any disturbance in AD performance (i.e., an OLR increase in this case), TVFA concentration increases and TVFA composition varies. More specifically, the perturbation resulted in an increase in long TVFA, as propionate, butyrate, valerate, and caproate ( Table 2). Similar to TVFA concentration, the ratio IA/PA increased with OLR. Total alkalinity measures the buffering capacity of a solution and it is expressed as milligrams of calcium carbonate per liter of solution. Regarding AD, PA is usually associated to OH − , NH 3 , HCO − 3 , and CO 3 while intermediate alkalinity (IA = TA − PA) is related to TVFA presence in the reactor. The ratio IA/PA is used as a stability parameter in AD, where ratios below 0.3 indicate a good state of the anaerobic process (Ripley et al., 1986). An increase in IA/PA ratio was observed during both the adaptation period and period II, which is in accordance to TVFA fate in the reactors. Opposite to that and regardless of the applied disturbances in the reactors, pH remained stable in the range of 7.8-8.0 during the complete experimental time. The high alkalinity registered in both reactors provided enough buffer capacity for preventing pH drop. Finally, TAN levels in the range of 4-10 g TAN L −1 have been reported to diminish anaerobic bacteria activity during AD leading to process failures (Angelidaki and Ahring, 1993;Rajagopal et al., 2013). In this case, maximum TAN concentrations of 1.84 and 1.06 g TAN L −1 were achieved after AD of DSM and ATM, respectively ( Table 2). Therefore, TAN levels in the reactors were below the inhibitory levels, so that no NH 3 -mediated inhibition was detected.
To sum up, an OLR of around 3 g TCOD L −1 reactor d −1 is recommended to achieve a stable AD process when anaerobically digesting ATM. Besides the demonstrated feasibility of using ATM as a substrate for AD, a stabilized digestate, similar to that obtained by AD of SM, would be achieved.

Membrane Technology Coupled With AD: Mass Removal Efficiencies and Evaluation of the Obtained Products
The treatment of SM by a combined treatment of N-recovery by gas-permeable membranes coupled with AD resulted in TAN and TKN recoveries of up to 96.2 and 92.4%, respectively ( Figure 5). Initial concentrations of TAN and TKN were 3.36 and 4.27 g L −1 , respectively (Table 1). During the first step of the combined treatment (N-recovery), TAN removals of up to 78% were obtained at a loading rate of 491 mg TAN L −1 d −1 by gaspermeable membranes. Up to 90% of this TAN was recovered in the acidic solution as (NH 4 ) 2 SO 4 , resulting in a solution of up to 19 g TAN L −1 . On the other hand, TAN and TKN were not removed during AD of DSM ( Figure 5B). More specifically, TAN concentration slightly increased due to N mineralization during protein break down in AD.
Chemical composition of the (NH 4 ) 2 SO 4 solution is shown in Table 3. This (NH 4 ) 2 SO 4 solution contained a nitrogen concentration of 19 g TAN L −1 , presenting several advantages as fertilizer: (1) nitrogen concentration in an easily spreadable solution, (2) reduction of transportation costs, and (3) reduction of nitrogen contamination and NH 3 emissions. Moreover, the solution presented low concentrations of organic matter (i.e., 0.139 ± 0.01 g TCOD L −1 and 0.064 ± 0.03 g VFA-COD L −1 , respectively). The presence of low concentrations of organic matter in the (NH 4 ) 2 SO 4 solution could be attributed to the osmotic distillation taking place during TAN diffusion (Riaño et al., submitted). In this manner, volatile organic compounds are transported across the hydrophobic membranes together with water vapor since they present partial vapor pressures comparable to or higher than water vapor (Xie et al., 2016). Although this (NH 4 ) 2 SO 4 solution presents promising fertilizing properties, very few field studies with this solution have been carried out (Majd et al., 2012). Therefore, this product should be further evaluated as soil amendment in field trials.
With regard to organic matter, 88.1% of the initial SCOD and 68.6% of the initial TCOD were removed during the combined treatment (Figure 6). A 20.5 and a 23.3% of the initial SCOD and TCOD recovered as CH 4 during AD, respectively. Methane content in biogas produced with ATM as substrate accounted for 66-67% (R2; Table 2). Besides CH 4 , a stabilized liquid by-product with possibilities as soil amendment (i.e., anaerobic digestate) was obtained. If compared to raw SM, anaerobic digestate presents outstanding fertilizing properties. More specifically, nitrogen mineralization may result in a higher short-term nitrogen fertilizer value (Cavalli et al., 2016;Baral et al., 2017) while the conversion of easily organic matter in CH 4 results in a higher stability of the anaerobic digestate. In this case, chemical composition of both digestates revealed that ATM-Digestate presented 1.65-fold lower TAN and 1.40-fold higher K + concentrations DSM-Digestate. No differences between the DSM-Digestate (control treatment) and ATM-Digestate COD concentration were found (Table 3), concluding that AD of ATM results in a stable ATM-Digestate.
This novel combined treatment resulted in the conversion of a problematic stream, as it is swine manure (SM), into three valuable products namely methane, anaerobic digestate-fertilizer and ammonium sulfate solution.

FUTURE DIRECTIONS
The use of gas-permeable membrane technology in combination with AD has been narrowly studied. Since further research is needed in this area, some points were identified and are listed below: • Livestock wastes present high TAN concentrations, which may result in a problem for AD processes, due to the inhibitory effect on microorganisms, causing TVFA accumulation and reactor failure. Gas-permeable membrane technology could help to mitigate TAN inhibition during AD, contributing to the economical sustainability of the process. The inhibitory effect of NH 3 on AD microorganisms was not detected in the present study because the SM was diluted to obtain the same TCOD concentration as in the ATM effluents. This resulted in a dilution of the TAN content in SM, avoiding NH 3 -mediated inhibition. A comparison between AD of undiluted SM and ATM effluents (obtained after N-recovery by gas-permeable membrane technology) would be useful to properly asses if the inhibition of AD at high NH 3 concentrations could be diminished. • On the other hand, TCOD is partially removed during Nrecovery in SM by gas-permeable membranes. In this manner, that TCOD is not further converted in biogas during AD. In order to optimize the economy of the combined technology, further investigation is needed to study if the use of gaspermeable technology for N-recovery should be placed before or after AD. • pH values above 8.5 are necessary to obtain an efficient capture of NH 3 by gas-permeable membranes. Aeration has been proposed as an effective method to increase pH, resulting in TCOD removal. This is not desired if ATM is intended to be used as substrate for CH 4 production by AD. Alternative ways of pH control should be considered in order to maximize CH 4 production from ATM effluents.

CONCLUSIONS
It is feasible to combine N-recovery by gas-permeable membrane technology and AD for the treatment of SM, contributing to ammonia emissions mitigation and sustainable livestock waste treatment. Moreover, by means of this novel technology, a variety of valuable products is obtained, namely sustainable energy in the form of methane and fertilizers (i.e., ammonium sulfate solution and anaerobic digestate). First, 66.7 % of the initial TAN contained in SM was semi-continuously recovered as an ammonium sulfate solution. The resultant effluent was stabilized by AD. A methane yield of 105 mL CH 4 g TCOD −1 with an OLR of 2.8 ± 0.5 g TCOD L −1 day −1 was achieved during its semi-continuous AD. Moroever, an stabilized anaerobic digestate with fertilizing properties was obtained, containing 29.5% of the initial TAN. Overall, this combined treatment for SM resulted in a 96.2% TAN recovery and a 68.6% TCOD removal.

AUTHOR CONTRIBUTIONS
All the authors contributed to this work. MG-G and BR obtained research funding. BR and BM-S designed and performed the experiments and worked on data acquisition and interpretation. BM-S analyzed the data and wrote the manuscript. BR, MG-G, and MV revised and provided feedback on drafts of the manuscript. All authors approved the final version of the manuscript.