Unraveling the literature chaos around free ammonia inhibition in anaerobic digestion

Keywords: Biogas, Davies equation, toxicity, ionic strength, modelling, methanogenic archaea Ac -, acetate, AD, anaerobic digestion, ADM1, anaerobic digestion model no. 1, Bu -, butyrate, Ci, concentration of species i, COD, chemical oxygen demand, CSTR, continuous stirred tank reactor, f, activity coefficient, FAN, free ammonia nitrogen, GSA, global sensitivity analysis, HRT, hydraulic retention time, I, ionic strength, IC50, 50 % inhibitory concentration, Ka, acid dissociation constant, Ka_25, acid dissociation constant at 25 ºC, KImax, concentration where inhibition is almost complete, KImin, concentration where inhibition starts, LHS, Latin Hypercube Sampling, MSW, municipal solid waste, syntrophic acetate oxidizing bacteria, SMA, specific methanogenic activity, SRC, standardised regression coefficient, T, temperature, TAN, total ammoniacal nitrogen, TS, total solids, UASB, upflow anaerobic sludge blanket reactor

This review aims at providing a unified methodology for free ammonia nitrogen (FAN) calculation in anaerobic digesters, also identifying the factors causing the huge disparity in FAN inhibitory limits. Results show that assuming ideal equilibria overestimates the FAN concentrations up to 37 % when compared to MINTEQA2 Equilibrium Speciation Model, used as reference. The Davies equation led to major improvements. Measuring the concentrations of NH4 + , Na + and K + was enough to achieve major corrections. The best compromise between complexity and accuracy was achieved with a novel modified Davies equation, with systematic differences in FAN concentrations of 2 % when compared to MINTEQA2. Applying this modified Davies equation, data from the literature (1,590 data points from over 50 scientific studies) were used to recalculate FAN inhibitory limits using a clustering approach. This procedure allowed to link inhibition resilience with operational conditions and microbial communities, providing also generalized values of inhibitory constants. The results showed that pH and temperature are the main factors affecting FAN inhibition. Consequently, thermophilic systems have a higher resilience towards FAN inhibition. The clustering results showed that Methanosaeta-dominated reactors have the lowest resilience towards FAN, verifying the relatively low inhibition limits for acetoclastic archaea. Mixotrophic Methanosarcina dominated at intermediate FAN concentrations, being more resistant than Methanosaeta but more vulnerable than hydrogenotrophic archaea.

Methanoculleus appeared as the most resilient methanogen. This article provides general guidelines for accurate FAN calculation, explaining also how FAN resilience relates to the operational conditions and the microbial communities, underlying the importance of microbial adaptation.

• Assuming ideal equilibrium overestimates FAN concentrations up to 37 %

• A proposed modified Davies equation reduced this error to below 2 %

• FAN concentrations from literature were recalculated using the modified Davies equation

• Clusters identified according to FAN resilience

• Temperature and pH (rather than TAN contents) as main factors affecting FAN resilience

• Acetoclastic methanogens as least resilient archaea. Mixotrophs dominated at intermediate levels. Hydrogenotrophs as most resilient

Introduction

Anaerobic digestion (AD) is a key technology in the field of environmental engineering. It is widely applied for the treatment of several organic wastes, such as sewage sludge, municipal solid waste, green waste, food waste and animal manure [START_REF] Mao | Review on research achievements of biogas from anaerobic digestion[END_REF][START_REF] Capson-Tojo | Food waste valorization via anaerobic processes: a review[END_REF][START_REF] Kothari | Different aspects of dry anaerobic digestion for bio-energy: An overview[END_REF]. AD is a multistage biological process that besides a proper waste treatment and stabilization, also allows to produce renewable energy in the form of biogas and to recover nutrients (e.g. N, P and K) via digestate application. These advantages, together with lower costs and environmental impacts when compared to other treatment options, make AD a major technology for wastewater and waste treatment [START_REF] Batstone | The role of anaerobic digestion in the emerging energy economy[END_REF].

Nevertheless, AD is a complex process and several factors can affect its performance and stability, such as temperature (T), organic loading rate (OLR), hydraulic retention time (HRT), structure of microbial communities and presence of inhibitors. Ammoniacal nitrogen, including free ammonia nitrogen (FAN, NH3) and ammonium ion (NH4 + ), is an inhibitor often encountered in AD. Ammoniacal nitrogen is produced during AD due to the reduction of the organic N present in the substrate in the form of proteins, amino acids, urea or nucleic acids [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF][START_REF] Chen | Toxicants inhibiting anaerobic digestion: a review[END_REF][START_REF] Yenigün | Ammonia inhibition in anaerobic digestion: A review[END_REF]. Thus, high concentrations of total ammoniacal nitrogen (TAN) in AD appear when treating N-rich substrates (e.g. manure, slaughterhouse waste or food waste). Besides, modifications in the operational conditions, waste pre-treatment, digestate recirculation and/or co-digestion can also lead to high TAN concentrations [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF]. On one hand, TAN is a key macronutrient and therefore a certain concentration is required for a proper microbial growth.

TAN also contributes to increase the media buffer capacity and keep the pH stable [START_REF] Mao | Review on research achievements of biogas from anaerobic digestion[END_REF][START_REF] Batstone | The IWA Anaerobic Digestion Model No 1 (ADM 1)[END_REF][START_REF] Banks | Energetic and environmental benefits of codigestion of food waste and cattle slurry: A preliminary assessment[END_REF].

On the other hand, TAN concentrations above 1,000-1,500 mg TAN-N•L -1 have been often

reported as the primary cause of AD failure due to FAN inhibition [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF][START_REF] Chen | Inhibition of anaerobic digestion process: A review[END_REF]. However, as addressed in this review, there are no universally applicable inhibition threshold concentrations for FAN inhibition (neither for any inhibitory compound), since the inhibition resilience of a microbial community is influenced by several factors.

Although there has been a debate about which microorganisms are more affected by TAN/FAN inhibition in AD, nowadays, it is widely accepted that methanogenic archaea are more vulnerable than most of bacteria, with the exception of some syntrophic acetate oxidizing bacteria (SAOB) [START_REF] Wang | Ammonia effect on hydrogenotrophic methanogens and syntrophic acetate oxidizing bacteria[END_REF][START_REF] Vrieze | Methanosarcina: The rediscovered methanogen for heavy duty biomethanation[END_REF]. Therefore, a decline in the methanogenic activity and AD performance is often observed at high FAN/TAN concentrations [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF]. This reduced methanogenic activity typically results in the accumulation of intermediate compounds, such as volatile fatty acids (VFAs), since the decline in activity of fermentative bacteria does not occur to the same extent. This will further inhibit the methanogenic archaea and reduce the methane production rates, causing a feedback inhibition loop that might lead to AD failure [START_REF] Capson-Tojo | Accumulation of propionic acid during consecutive batch anaerobic digestion of commercial food waste[END_REF][START_REF] Banks | A pilot-scale trial comparing mesophilic and thermophilic digestion for the stabilisation of source segregated kitchen waste[END_REF][START_REF] De Baere | Influence of high NaCl and NH4 Cl salt levels on methanogenic associations[END_REF]. It has been observed that high levels of both FAN and/or NH4 + can inhibit the methanogenic communities [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF][START_REF] Kayhanian | Ammonia Inhibition in High-Solids Biogasification: an Overview and Practical Solutions[END_REF][START_REF] Sung | Ammonia inhibition on thermophilic anaerobic digestion[END_REF]. However, it is generally recognized that FAN is the most inhibitory species. For this reason, the inhibition of AD processes due to the presence of FAN has been widely researched in the last decades, aiming at understanding the toxicity mechanisms involved and developing solutions to this issue [START_REF] Braun | Ammonia toxicity in liquid piggery manure digestion[END_REF][START_REF] Angelidaki | Anaerobic thermophilic digestion of manure at different ammonia loads: Effect of temperature[END_REF][START_REF] Capson-Tojo | Addition of granular activated carbon and trace elements to favor volatile fatty acid consumption during anaerobic digestion of food waste[END_REF].

Many studies have researched the influence of both TAN and FAN concentrations on the AD performance. Generally, the change in the specific methanogenic activity (SMA) is measured at different inhibitor concentrations, resulting in an inhibition coefficient representing the concentration at which the SMA is half the maximum (IC50). Previous reviews addressing the topic of FAN/TAN inhibition in AD have reported a huge disparity in the inhibitory limits, which range from 27 to 1,450 mg FAN-N•L -1 and from 1.1 to 11.8 g TAN-N•L -1 [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF][START_REF] Chen | Toxicants inhibiting anaerobic digestion: a review[END_REF][START_REF] Yenigün | Ammonia inhibition in anaerobic digestion: A review[END_REF][START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF][START_REF] Chen | Inhibition of anaerobic digestion process: A review[END_REF][START_REF] Vrieze | Methanosarcina: The rediscovered methanogen for heavy duty biomethanation[END_REF][START_REF] Nakakubo | Ammonia Inhibition of Methanogenesis and Identification of Process Indicators during Anaerobic Digestion[END_REF][START_REF] Astals | Development and validation of a rapid test for anaerobic inhibition and toxicity[END_REF] (Table 1). These wide ranges of inhibitory concentrations hinder the extrapolation of the obtained results and restrain the applicability of the given limits to almost each case study. Thus, it is important to include batch inhibition tests as part of AD studies, which provide specific inhibition data for the microbial communities under study [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF][START_REF] Astals | Development and validation of a rapid test for anaerobic inhibition and toxicity[END_REF]. It has been suggested that this large variability on FAN inhibition is caused by: (i) the different microbial communities used in the studies (some archaea and/or bacteria are more vulnerable to FAN/TAN than others), (ii) particular operational factors such as temperature, pH and ionic strength (I), (iii) microbial acclimation strategies, and (iv) the different mathematical methods used for FAN calculation [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF][START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF][START_REF] Vrieze | Methanosarcina: The rediscovered methanogen for heavy duty biomethanation[END_REF][START_REF] Capson-Tojo | Methanosarcina sp. as key archaea to avoid acidification in dry anaerobic digestion of food waste[END_REF][START_REF] Hafner | Modeling of ammonia speciation in anaerobic digesters[END_REF][START_REF] Tian | Acclimation to extremely high ammonia levels in continuous biomethanation process and the associated microbial community dynamics[END_REF].

Table 1. IC50 values for both FAN and TAN reported in the literature (adapted and extended from Chen et al. [START_REF] Chen | Toxicants inhibiting anaerobic digestion: a review[END_REF] and Yenigün and Demirel [START_REF] Yenigün | Ammonia inhibition in anaerobic digestion: A review[END_REF]) 124

Substrate

Reactor operation Temperature (ºC) pH IC50 TAN (mg TAN-N FAN stands for free ammonia nitrogen, TAN for total ammoniacal nitrogen, nr for "non-reported", OFMSW for organic fraction of municipal solid waste, CSTR for continuous [START_REF] Batstone | The IWA Anaerobic Digestion Model No 1 (ADM 1)[END_REF] The goal of this review is to analyze and understand the impacts of the environmental and microbial factors causing the disparity in FAN inhibition of AD systems. For this purpose, different algorithms for FAN calculation have been compared, aiming at finding the best compromise between simplicity and accuracy. Recommendations for the application of each method have also been discussed. Applying the FAN calculation method considered to be the most convenient, the FAN inhibitory limits have been recalculated via a clustering approach using data from the literature (1,590 data points). The resulting inhibitory limits were compared in terms of substrate fed in the experiments, operational conditions (i.e. T and pH) and predominant archaeal communities. This study gives general indications to achieve an accurate FAN quantification in N-rich AD systems. In addition, the results presented in the literature have been unified, giving inhibitory limits that can be extrapolated to general AD conditions and linking the observed values with the operational conditions and the microbial communities. Although different reviews have already addressed ammonia inhibition in AD [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF][START_REF] Jiang | Ammonia inhibition and toxicity in anaerobic digestion : A critical review[END_REF], this is the first study using large amounts of experimental data to produce general, non-specific, results. A unified methodology for FAN calculation and general FAN inhibitory limits can have significant implications in both laboratory and industrial applications, reducing the errors in FAN estimation and helping to explain the behaviors of AD systems working at high FAN concentrations.

Data collection and treatment

Data collection

Both quantitative and qualitative data were retrieved from 50 scientific studies carried out at different operational conditions (i.e. T, pH, reactor operation, etc.) and using different microbial inocula. The data retrieved combined with 339 values from an internal industrial project with Suez (Suez S.A., France) as partner (already used for research purposes, see Hao et al. [START_REF] Hao | New insights into the key microbial phylotypes of anaerobic sludge digesters under different operational conditions[END_REF]), generated a database containing 1,590 data points.

To produce a homogeneous database that would allow the analysis of the data retrieved, different categories were defined, i.e. inocula type, substrate digested, reactor operation (e.g. batch, semi-continuous, CSTR, etc.) and dominant archaeal genus. In addition, different hypotheses were made:

-No nitrates were present in the reactors or the substrates (Total Kjeldahl Nitrogen equals total nitrogen).

-If not reported otherwise, the oxidation states of the ions were assumed to be the predominant species at anaerobic conditions (Na as Na + , Ca as Ca 2+ , K as K + , P as PO4 -If the concentrations of soluble species in continuous reactors were not reported, the values were calculated according to the initial amounts in the reactor and the substrate, the substrate loads, and the retention times given.

-If not reported otherwise, the total solids (TS) contents in the reactors were assumed to be constant.

-Concentrations below detection limits were considered to be zero.

-The reductions in the SMAs were calculated, when possible, as a percentage of decrease in the specific methane production rates when compared to a control reactor or a previous steady state where no (or negligible amounts of) FAN was present.

A table comprising all the bibliographic data used in this study and the categories used is given in the supplementary material (Table S1).

Methods for free ammonia calculation

Three different approaches were compared: (i) assuming an ideal solution (ideal equilibrium),

(ii) considering a non-ideal solution behavior by taking into account the ionic strength (I) of the media (Davies equation) and (iii) using MINTEQA2 Equilibrium Speciation Model (see Section 2.2.3).

Ideal equilibrium

The FAN concentrations were calculated combining equations 2 and 3 [START_REF] Hansen | Anaerobic digestion of swine manure: Inhibition by ammonia[END_REF]. This approach assumes that the solute behavior is ideal and that the only species in equilibrium with FAN is

NH4 + . 𝑁𝐻 4 + ↔ 𝑁𝐻 3 (𝑎𝑞) + 𝐻 + Eq. 1 𝐹𝐴𝑁 = 𝐾 𝑎 •𝑇𝐴𝑁 𝐾 𝑎 + 10 -𝑝𝐻
Eq. 2

𝐾 𝑎 = 𝐾 𝑎_25 • 𝑒 51965 𝑅 ( 1 298.15 - 1 𝑇 ) Eq. 3
Where FAN is the FAN concentration in mg FAN-N•L -1 , R is the ideal gas constant (8.314 J•mol -1 •K -1 ), TAN is the TAN concentration in mg TAN-N•L -1 , Ka is the acid dissociation constant, Ka_25 is the acid dissociation constant at 25 ºC (10 -9.25 ), and T is the temperature in K.

Davies equation

The FAN concentrations were calculated using the Davies equation. This approach considers the pH, the T and the I of the media [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF]. The Davies equation is based upon the introduction of an activity coefficient (f) as correction factor into the ideal equilibrium equation (Eq. 2), resulting in Equation 4 [START_REF] Stumm | Aquatic Chemistry: Chemical Equilibria and Rates in Natural Waters[END_REF]. The set of expressions used is as follows:

𝐹𝐴𝑁 = 𝐾 𝑎 •𝑓•𝑇𝐴𝑁 𝐾 𝑎 •𝑓+ 10 -𝑝𝐻 Eq. 4 𝑓 = 10 (-𝐴•𝑧 𝑖 2 •(( √𝐼 1+√𝐼 )-𝜆•𝐼))
Eq. 5

𝐴 = 1.82 • 10 6 • (𝜀 • 𝑇) -3 2 Eq. 6 𝐼 = 1 2 ∑ 𝐶 𝑖 • 𝑧 𝑖 2 𝑛 𝑖=1
Eq. 7

Where I is the ionic strength (M), T is the temperature in K, λ is an empirically determined constant (0.2), ε is the dielectric constant of water at the working temperature (74.828 and 68.345 at 35 and 55 ºC, respectively), Ci is the concentration of the species i (M), and zi is the corresponding charge. Among the different possibilities for calculating f (see for instance Stumm and Morgan [START_REF] Stumm | Aquatic Chemistry: Chemical Equilibria and Rates in Natural Waters[END_REF]), Equation 5with λ equal to 0.2 was selected because it is the value valid at the widest range of I values (up to 0.5 M) [START_REF] Stumm | Aquatic Chemistry: Chemical Equilibria and Rates in Natural Waters[END_REF].

Four different approaches using the Davies equation were evaluated, comparing the FAN concentrations given by each option.

1.

Comprehensive approach: this method considered the contribution of the main chemical species to I (i.e. Na + , Ca 2+ , K + , Mg 2+ , Fe 2+ , Mn 2+ , Mo 2+ , Cu 2+ , Zn 2+ , Co 2+ , Ni 2+ , Se 2+ , PO4 2-, Cl -, C2H3O2 -, C3H5O2 -, C4H7O2 -and C5H9O2 -). These species were selected because they are the most common ions present in anaerobic media [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF][START_REF] Romero-Güiza | The role of additives on anaerobic digestion: A review[END_REF]. The VFAs were also considered. To account for the counterions that are generally not measured (i.e. HCO3 -or CO3 2-), a monovalent ion was added into the calculation of I. The concentration of this counterion was calculated as the missing amount required to close the charge balance. In addition, since the concentration of NH4 + affects the value of I, an iterative process was implemented by a loop recalculating the NH4 + concentration according to the previous FAN content.

2.

Simplified I calculation with iterative NH4 + correction: this approach is similar to the previous one but considers that the single ionic species contributing to I were NH4 + and its counterion (a monovalent ion used to close the charge balance). The NH4 + concentration was calculated using the aforementioned iterative process. This simplification was tested to assess the error caused by the lack of input data if only few ions are considered. In addition, this approach also allowed assessing which ions are to be measured to correct most of the error in FAN concentration calculations.

3.

Simplified I calculation without iterative NH4 + correction: previous simplified approach but avoiding the iterative processes to determine I by calculating the contribution of NH4 + using the ideal equilibrium equation (Eq. 2) and assuming it to be constant. This simplification was tested to elucidate if iterative processes could be avoided without causing a significant error. If the iterative process is not needed, the computational requirements of the FAN calculation method would be much lower, facilitating its integration in complex AD models.

4.

Modified Davies equation: the original Davies equation for f calculation (Eq. 5) was recalibrated to fit the results given by MINTEQA2 using a non-linear least square analysis (considering the value of I as constant and as the one used in MINTEQA2). This approach simply modifies the empirical parameter of the original equation (λ) to obtain the best possible fit of the experimental data [START_REF] Truesdell | A COMPUTER PROGRAM FOR CALCULATING CHEMICAL EQUILIBRIA OF NATURAL WATERS[END_REF]. Calibrating λ using the MINTEQA2 FAN data resulted in a value of 0.1276, instead of 0.2. The corresponding modified Davies equation is:

𝑓 = 10 (-𝐴•𝑧 𝑖 2 •(( √𝐼 1+√𝐼 )-0.1276•𝐼))
Eq. 8

MINTEQA2 Equilibrium Speciation Model

Among the different geochemical models available (see Di Bonito et al. [START_REF] Bonito | Models of Geochemical Speciation: Structure and Applications[END_REF]), MINTEQA2 has been used in this study as reference scenario for equilibrium speciation calculations.

MINTEQA2 is a geochemical equilibrium speciation model revised in 2006 that was developed by the United States Environmental Protection Agency (EPA) to calculate the equilibrium composition of aqueous systems [START_REF] Allison | MINTEQA2/ PRODEFA2, A Geochemical Assessment Model for Environmental Systems: Version 3[END_REF][START_REF]User's manual version 4.03[END_REF]. MINTEQA2 can be easily accessed using the Visual MINTEQ package, which is one of the chemical equilibrium software applications most used among researchers publishing in Elsevier journals [START_REF] Gustafsson | Visual MINTEQ[END_REF]. This geochemical equilibrium speciation model allows computing mass distribution equilibria among dissolved species, adsorbed species, and multiple solid phases under a variety of conditions including a gas phase with constant partial pressures. MINTEQA2 includes a comprehensive database of reliable thermodynamic data that is adequate for solving a broad range of problems without the need of additional user-supplied equilibrium constants. The model employs a predefined set of components that includes free ions such as Cl -or NH4 + and neutral and charged complexes (e.g., C2H3O2 -, C3H5O2 -, C4H7O2 -). The database of reactions is written in terms of these components as reactants. Chemically, the system is modelled from a set of components and a set of species, as described by Allison et al. [START_REF] Allison | MINTEQA2/ PRODEFA2, A Geochemical Assessment Model for Environmental Systems: Version 3[END_REF]. MINTEQA2 allows calculating the equilibrium composition with precision since the model takes into account different factors such as T and activity coefficient corrections of equilibrium constants (through the van't Hoff and Davies/modified Debye-Hückel equations, respectively), charge and activity coefficients for organic species, complexation of metals by dissolved organic matter, activity of water, total alkalinity, pH and I of the media, and saturation index and formation/dissolution of chemical precipitates. A precise description of the set of equations defining MINTEQA2 can be found in Appendix B.

The chemical components considered in MINTEQA2 were the same as those used in the comprehensive approach applied with the Davies equation. Also as previously, to account for the counterions generally not measured (i.e. HCO3 -or CO3 2-), a monovalent ion was considered (its concentration was calculated as the missing amount required to close the charge balance).

The described MINTEQA2 can be used for different purposes, such as (i) calculating the speciation of inorganic ions and complexes in water, (ii) evaluating the effect of dissolving or precipitating solids on water chemistry, (iii) investigating the equilibrium speciation of common redox couples, (iv) simulating the change in chemical composition of a water sample during a titration, or (v) estimating the binding of ions to (hydr)oxide surfaces and organic matter using state-of-the-art complexation models (SHM or NICA-Donnan for organic complexation, CD-MUSIC, TLM, CCM or DLM for surface complexation). Indeed, MINTEQA2 has been widely applied for different purposes within the waste treatment field (e.g., [START_REF] Serralta | An extension of ASM2d including pH calculation[END_REF][START_REF] Robles | Sub-critical long-term operation of industrial scale hollow-fibre membranes in a submerged anaerobic MBR (HF-SAnMBR) system[END_REF][START_REF] Barat | Biological Nutrient Removal Model No. 2 (BNRM2): a general model for wastewater treatment plants[END_REF][START_REF] Lizarralde | A new general methodology for incorporating physico-chemical transformations into multi-phase wastewater treatment process models[END_REF][START_REF] Solon | Effects 55 of ionic strength and ion pairing on (plant-wide) modelling of anaerobic digestion[END_REF][START_REF] Jia | Applying a chemical equilibrium model for optimizing struvite precipitation for ammonium recovery from anaerobic digester effluent[END_REF]).

It must be mentioned that, as MINTEQA2 applies the Davies equation using a λ of 0.3, the manual warns the user that the activity correction model is generally not intended to be used at I values greater than 0.7-1.0 M (cut-off for effective use treated as 1.0 M in the last manual). However, it also mentions that these correction equations may still provide usable results that should be verified for the specific modelled system, even I values higher than 1.0 M. As an alternative to the Davies equation, MINTEQA2 offers the possibility of applying the modified Debye-Hückel equation for activity corrections [START_REF] Nordholm | Applications of the Corrected Debye-Hückel Theory[END_REF]. Nevertheless, the basic Debye-Hückel correction has been reported to lead to substantial errors at I above 0.1 M, even for simple solutions [START_REF] Morel | Principles and Applications of Aquatic Chemistry[END_REF]. In addition, the Debye-Hückel method has been found to be particularly inaccurate for correcting the activities of monovalent ions (such as NH4 + ) [START_REF] Harned | The Physical Chemistry of Electrolytic Solutions[END_REF]. To ensure that the best method for activity corrections was used, both the Davies and the modified Debye-Hückel equations were used in MINTEQA2 (data not shown), concluding that the Davies equation was the most convenient approach (more coherent results in agreement with the literature were obtained).

Considering the aforementioned statements, the FAN results given by MINTEQA2 were considered as the reference scenario for comparison and validation purposes. The wide application of this model, its correct predictions with I values up to 1.0 M and the fact that it considers the interactions between all the components considered in the media (including dissolved species, adsorbed species, multiple solid phases and gas phases), as well as the complexation of metals by dissolved organic matter (ion-binding), are main supporters of this choice.

Validation of the proposed modified Davies equation

Using MINTEQA2 as reference scenario, an uncertainty framing was defined for validation of the proposed modified Davies equation (Eq. 8) as a method for FAN calculation in a wide range of I values. In addition, a global sensitivity analysis (GSA) based on Monte Carlo simulations was conducted for identifying the influential factors affecting MINTEQA2 results. Monte Carlo results were used to assess uncertainties between the results from the modified Davies equation and MINTEQA2.

For this purpose, the concentrations of the different ionic species considered were varied according to the average experimental concentrations found in the database. Average experimental concentrations and uncertainty factors are both shown in supplementary material (Table S2). The FAN concentration given by MINTEQA2 was used as output variable.

The GSA was conducted using the standardised regression coefficient (SRC) method and Monte Carlo was conducted using the semi-random Latin Hypercube Sampling (LHS) method [START_REF] Helton | Latin hypercube sampling and the propagation of uncertainty in analyses of complex systems[END_REF]. A coefficient of determination (R 2 ) above 0.7 was obtained, validating the standardised regression slope (βi) as sensitivity measure [START_REF] Saltelli | Sensitivity analysis in practice: A guide to accessing scientific models[END_REF]. Input factors resulting in βi higher than 0.1 were selected as influential factors. To reduce stratification of sampling, the number of Monte Carlo runs (N) was set to 10,000 by performing batches of 100 runs 100 times.

Calculation of inhibitory constants and data clustering

This section aimed at obtaining representative/generalized values of the inhibitory constants given in the literature. This was done by identifying clusters of the data retrieved from the literature according to their FAN resilience.

The values corresponding to the TAN concentrations, temperatures, pH and SMAs, together with the FAN concentrations calculated using the modified Davies equation were used to determine generalized values of the inhibitory constants (IC50). The modified Davies equation was used for FAN calculation because it was the approach showing the best compromise between accuracy and complexity (see Section 3.2). The inhibition function considered was the threshold inhibition function proposed by Astals et al. [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF]:

𝑆𝑀𝐴 𝑟𝑒𝑑𝑢𝑐𝑡𝑖𝑜𝑛 (%) = { 0 ; 𝑖𝑓 𝐹𝐴𝑁 ≤ 𝐾𝐼 𝑚𝑖𝑛 100 • (1 -𝑒 -2.77259( (𝐹𝐴𝑁-𝐾𝐼 𝑚𝑖𝑛 ) (𝐾𝐼 𝑚𝑎𝑥 -𝐾𝐼 𝑚𝑖𝑛 ) ) 2 ) ; 𝑖𝑓 𝐹𝐴𝑁 > 𝐾𝐼 𝑚𝑖𝑛
Eq. 9

Where KImin and KImax representing the FAN concentrations where inhibition starts (onset concentration) and when it is almost complete (SMA = 0.06•SMAmax), respectively [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF]. The arithmetic average of KImin and KImax equals IC50 (i.e. IC50 = (KImin + KImax)/2). Thus, results from this approach can be extrapolated and compared to the IC50 obtained when using a noncompetitive inhibition function.

As the microbial resilience can vary greatly among different studies, different IC50 can be extrapolated from the collected data. Therefore, when plotting the reduction of the SMA (Yaxis) against the FAN concentrations (X-axis), it can be expected that more than one inhibition curve (given by Eq. 9) could fit the collected data. Therefore, a procedure was tailored to cluster the data according to a set of inhibition curves. This clustering approach depended on two parameters: εFAN and εSMA, which correspond to the accepted error around inhibition curves on the X-axis (i.e. FAN concentrations) and on the Y-axis (i.e. SMA reduction), respectively. Hence, it was possible to define an area around each inhibition curve inside which all the points could be considered to belong to the respective inhibition curve.

This approach was implemented to consider and mitigate FAN and SMA measurement errors.

A precise description of the iterative approach followed to define each cluster can be found in Appendix C.

Once the optimal clusters were defined, the corresponding quantitative and qualitative data (e.g. temperature, AD substrate, pH or main archaeal genus) were compared. Prior analysis, data points with 0 and 100 % of SMA reduction were removed from the intermediate and last clusters and from the first and intermediate clusters, respectively, as they could not be attributed to any cluster with certitude (e.g. 100 % inhibition for the second cluster could also belong to the first one). Statistical differences between clusters for quantitative data was assessed on R 3.5.0 (2018) using the non-parametric Kruskal-Wallis test with the kruskal.test function. Then, multiple pairwise comparisons were carried out using the Dunn's test [START_REF] Dunn | Multiple comparisons using rank sums[END_REF] applying the dunnTest function of the package "FSA". All the p-values were adjusted according to the Holm's method [START_REF] Holm | A simple sequentially rejective multiple test procedure[END_REF] and statistical significance was assumed for p-values < 0.01.

This approach allowed (i) identifying clusters of data that represented the values belonging to each curve and (ii) obtaining the values of the IC50 corresponding to each cluster.

Sensitivity analysis of the clustering procedure

The number of clusters and the overall quality of the approach strongly depend on the values of the parameters εFAN and εSMA. Thus, a sensitivity analysis was carried out to assess their optimal values according to the minimization criterion presented in Equation 10. The complete clustering procedure was carried out for εFAN and εSMA ranging from 0.05 to 0.25 log10(FAN) and 5 to 25 % SMA reduction, respectively. Smaller values of εFAN and εSMA were not considered to ensure the stability of the clustering process. The quality of the clustering result was quantitatively assessed considering three parameters to be minimized: (i) the number of clusters (to avoid overfitting of the data); (ii) curve overlapping, i.e. the number of points that could be attributed to two different clusters according to εFAN and εSMA (expressed as % of the total points); and (iii) the total number of non-attributed points, not belonging to any cluster (expressed as % of the total points). For instance, overlapping could occur when a new cluster was defined with an IC50 lower than the previous IC50 + 2 εSMA, while nonattributed points were typically points above the final inhibition curve during the clustering loop.

The optimal εFAN and εSMA couple was determined by minimizing the following function:

Clustering score = 𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑐𝑙𝑢𝑠𝑡𝑒𝑟𝑠 max(𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑐𝑙𝑢𝑠𝑡𝑒𝑟𝑠) + 𝑂𝑣𝑒𝑟𝑙𝑎𝑝𝑝𝑖𝑛𝑔 max(𝑂𝑣𝑒𝑟𝑙𝑎𝑝𝑝𝑖𝑛𝑔) + 𝑁𝑜𝑛-𝑎𝑡𝑡𝑟𝑖𝑏𝑢𝑡𝑒𝑑 𝑝𝑜𝑖𝑛𝑡𝑠 max(𝑁𝑜𝑛-𝑎𝑡𝑡𝑟𝑖𝑏𝑢𝑡𝑒𝑑 𝑝𝑜𝑖𝑛𝑡𝑠)
Eq. 10

Evaluation of methods for FAN calculation

Importance of considering the ionic strength for FAN calculation

Amongst the different mathematical methods used to calculate FAN concentration, the ideal equilibrium equation and the Anthonisen equation are the most used formulas in the literature [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF][START_REF] Anthonisen | Inhibition of nitrification by ammonia and nitrous acid[END_REF]. In an ideal solution, the FAN concentration will depend on the TAN concentration, the T and the pH (equations 1 to 3) [START_REF] Hansen | Anaerobic digestion of swine manure: Inhibition by ammonia[END_REF]. Nevertheless, these methods do not take into account that the AD media is a non-ideal solution. Therefore, equations 2 and 3 should be applied only in diluted systems, where the chemical behavior can be simplified to that of an ideal pure water-ammonia solution (e.g. wastewater) [START_REF] Hafner | Modeling of ammonia speciation in anaerobic digesters[END_REF][START_REF] Vaddella | An Empirical Model of Ammonium Ion Dissociation in Liquid Dairy Manure[END_REF]. During the treatment of more concentrated substrates, this approach is not appropriate as it is critical to account for the effect of I on the chemical activity of the ions (e.g. animal manure and food waste) [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF][START_REF] Hafner | Modeling of ammonia speciation in anaerobic digesters[END_REF][START_REF] Solon | Effects 55 of ionic strength and ion pairing on (plant-wide) modelling of anaerobic digestion[END_REF][START_REF] Pastor-Poquet | High-solids anaerobic digestion model for homogenized reactors[END_REF]. This implies that in most cases the ideal equilibrium equation is not applicable and other approaches for the calculation of the FAN concentration must be used.

Therefore, activity corrections must be considered and, if required, chemical species other than NH4 + that might be in equilibrium with FAN must be accounted for. Hafner and Bisogni [START_REF] Hafner | Modeling of ammonia speciation in anaerobic digesters[END_REF] showed that if activity corrections were not considered in reactors digesting animal manure, significant overestimations of the FAN concentrations occurred, with errors up to 40 %. Hafner and Bisogni [START_REF] Hafner | Modeling of ammonia speciation in anaerobic digesters[END_REF] proposed a comprehensive speciation model based on the Pitzer's ion-interaction approach. The authors concluded that, although the complex model was more precise, simply including an activity coefficient for NH4 + in the ideal equilibrium equation already resulted in much more accurate estimates. The influence of including ion activity corrections has also been studied for AD modelling. Solon et al. [START_REF] Solon | Effects 55 of ionic strength and ion pairing on (plant-wide) modelling of anaerobic digestion[END_REF] included activity coefficients into the anaerobic digestion model no. 1 (ADM1) using the Davies equation.

They observed that the salinity and the pH were significantly different when compared to the default ADM1 and recommended the application of activity corrections at values of I higher than 0.2 M. In a recent study, Patón et al. [START_REF] Patón | Activity corrections are required for accurate anaerobic digestion modelling[END_REF] evaluated the impact of neglecting activity corrections on the prediction of key AD processes. They concluded that the systematic incorporation of activity corrections in AD models was needed if errors in the alkalinity ratios, the inhibition factors (i.e. for H2S and FAN) and phosphorus speciation were to be avoided. Patón et al. [START_REF] Patón | Activity corrections are required for accurate anaerobic digestion modelling[END_REF] also used the Davies equation to account for non-ideality due to its fair compromise between simplicity and accuracy. Even though the Davies equation is only valid up to a certain ionic strength, this approach has been the most widely applied method to account for non-ideality. Other authors have used modelling software such as MINTEQA2 [START_REF] Serralta | An extension of ASM2d including pH calculation[END_REF][START_REF] Robles | Sub-critical long-term operation of industrial scale hollow-fibre membranes in a submerged anaerobic MBR (HF-SAnMBR) system[END_REF][START_REF] Barat | Biological Nutrient Removal Model No. 2 (BNRM2): a general model for wastewater treatment plants[END_REF][START_REF] Lizarralde | A new general methodology for incorporating physico-chemical transformations into multi-phase wastewater treatment process models[END_REF]. This latter method is the best option to use when a precise knowledge of the physicochemical processes involved is required (e.g. for pH modelling, for modelling biogas composition or gas stripping through liquid-gas equilibria, or for modelling chemical precipitations, among others) [START_REF] Serralta | An extension of ASM2d including pH calculation[END_REF][START_REF] Robles | Sub-critical long-term operation of industrial scale hollow-fibre membranes in a submerged anaerobic MBR (HF-SAnMBR) system[END_REF][START_REF] Barat | Biological Nutrient Removal Model No. 2 (BNRM2): a general model for wastewater treatment plants[END_REF]. Nevertheless, the effectiveness of this approach increases with the level of characterization of the media, giving comparable results to other simpler approaches when the number of ionic species measured is reduced (e.g. NH4 + ).

Regardless of the methodology used, to date, only few authors have considered non-ideality in FAN calculations, which represents a source of data misinterpretation as discussed in the following subsection.

Comparison of different methods for FAN calculation

In this section, the FAN concentrations given by the ideal equilibrium equation (no I considered) are compared with those given by MINTEQA2 and by the Davies equation, which consider the influence of I. Figure 1 shows the results corresponding to the application of MINTEQA2 and the Davies equation considering the main chemical species in the media.

The differences between the FAN concentrations given by each of these methods and the ideal equilibrium equation (Eq. 2) are presented. presented). FAN stands for free ammonia nitrogen

In both cases, the obtained curves followed a similar trend, with higher FAN differences at increasing values of I. This was expected since higher I values lead to lower f values (Eq. 4 to 7) [START_REF] Hafner | Modeling of ammonia speciation in anaerobic digesters[END_REF]. Starting with MINTEQA2 (Figure 1A), FAN differences higher than 25 % were found for values of I > 0.25 M, which indicates the importance of considering this parameter for FAN calculation even at low concentrations of ionic species. At higher values of I, the FAN differences continued to increase, with differences up to 37 % at values of I over 1.00 M. This is in agreement with previous studies, where differences of 30-40 % were found when accounting for the effect of I for FAN calculation [START_REF] Hafner | Modeling of ammonia speciation in anaerobic digesters[END_REF][START_REF] Capson-Tojo | Kinetic study of dry anaerobic co-digestion of food waste and cardboard for methane production[END_REF]. Taking the results given by MINTEQA2 as the most realistic approach (but also the most analytic-demanding to obtain enhanced results), the large errors associated to the application of the ideal equilibrium equation for FAN determination are evident. It can be concluded that the application of Eq. 2

for FAN calculation in AD systems is not recommended.

The main reasons leading to FAN overestimation using the ideal equilibrium equation are related to the assumption of a pure solution with FAN and NH4 + as single species in equilibrium. According to Equation 1, the presence of ionic species in the media (thus higher values of I) shifts the equilibrium towards the formation of NH4 + , thus reducing the FAN concentration. In addition, interactions with other ionic species reduce the NH4 + concentrations (e.g. via precipitation or complexation), further decreasing the FAN contents.

Regarding the comprehensive Davies equation (Figure 1B), the FAN differences where always slightly lower when compared to MINTEQA2. The main reason for this is that the Davies method considers that the only species in equilibrium with NH4 + is FAN, which leads to a slight overestimation of the FAN concentrations. At low values of I (< 0.5 M), both curves were almost identical with differences between the FAN values given by both methods between 0 and 6 %. However, as it can be observed in Figure 1B, at higher values of I a maximum appeared when applying the Davies equation. Differences in FAN around 30 % were reached, remaining relatively constant until values of I of 0.75-0.80 M. At this point, the FAN differences compared to the ideal equilibrium equation started to follow a slightly decreasing trend. This caused an increase in the differences between the FAN values given by the Davies equation and those calculated with MINTEQA2, with values up to 16 % (Davies vs MINTEQA2). The decreasing trend in Figure 1B (thus the increase in the differences between both methods) appears due to the limited application range of the equation for calculating f when using the Davies method (Eq. 5). This expression is an empirical equation that should not be applied at values of I over 0.5 M [START_REF] Stumm | Aquatic Chemistry: Chemical Equilibria and Rates in Natural Waters[END_REF]. However, it must be mentioned that Figure 1B shows that, despite of this limitation, the Davies equation gives in any case a better estimation of the FAN concentrations than the ones obtained applying the ideal method, which clearly overestimates much more significantly the FAN concentrations. The value of I was lower than 0.7 M for 92 % of the data and lower than 0.5 M for the 84 %, implying that the Davies equation could be applicable for most of the conditions found in AD systems, even when treating concentrated substrates. The I in AD influents generally range from 0.1 to 1.0 M [START_REF] Batstone | Towards a generalized physicochemical framework[END_REF]. Diluted substrates such as diluted industrial wastewaters and domestic wastewaters generally have an I below 0.1-0.2 M [START_REF] Batstone | Towards a generalized physicochemical framework[END_REF][START_REF] Jeppsson | Benchmark simulation model no 2: General protocol and exploratory case studies[END_REF]. However, for high solids and manure digesters I is generally above 0.2 M [START_REF] Solon | Effects 55 of ionic strength and ion pairing on (plant-wide) modelling of anaerobic digestion[END_REF]. For instance, values of 0.5-0.6 M and 0.6-0.8 M have been reported during food waste and poultry manure AD, respectively [START_REF] Capson-Tojo | Addition of granular activated carbon and trace elements to favor volatile fatty acid consumption during anaerobic digestion of food waste[END_REF][START_REF] Pechan | Anaerobic digestion of poultry manure at high ammonium nitrogen concentrations[END_REF].

As previously mentioned, two simplifications using the Davies equation were compared with the comprehensive approach: (i) a simplified I calculation considering that the only two contributors to I were the NH4 + and its counterion, and (ii) this latter approach but avoiding the iterative processes to determine the contribution of NH4 + to I. The differences between the FAN concentrations due to each simplification are shown in Figure 2. The first simplification led to significant differences in the FAN concentrations in some cases (up to 26 % when compared to the comprehensive Davies method considering all the main ions; Figure 2A). However, avoiding the iterative step did not further increase the error significantly, with the differences between the application of the iterative process or not (when considering only the NH4 + ) up to 0.76 % (Figure 2B). This simplification can be particularly useful for integration with existing models that do not aim at predicting extensively the physicochemical interactions in the media (e.g. for inclusion with the ADM1

or simpler kinetic models), as it would reduce the time required to run a simulation. It must be mentioned that the error caused by removing the iterative process when applying the comprehensive Davies method considering all the ions was also negligible, with differences always below 1 %.

The FAN differences due to considering only the NH4 + and its counterion as single contributors to I are presented in Figure 2A. Although relatively high errors were observed due to this simplification, the differences were below 3 % for 93 % of the data and below 5 % for 97 % of the data. These results indicate that, in most of the cases, it would not be necessary to measure all the ionic species in the media to correct most of the error in FAN concentration. To elucidate which were the ions responsible for the differences observed in Figure 2A, the relative contribution to the total I of each ionic species were calculated (as % of total I). The results, shown in Figure 3, further prove that the NH4 + is the main species contributing to I in AD of N-rich substrates. Considering both NH4 + and its counterion, they represent most of the I in most of the experiments. However, when looking at the contributions of other ions, it is clear that other species also contributed to I. More precisely, while the impact of the trace elements (i.e. Fe 2+ , Mn 2+ or Cu 2+ ) was clearly negligible, some ions (i.e. Na + , K + and Cl -) and some VFAs (i.e. acetate and propionate) had an impact on the value of I due to their relatively high concentrations. Considering the results shown in Figure 3, it can be assumed that in most cases simply measuring the NH4 + concentration to account for its contribution (and that of its counterion) in the Davies equation will already account for most of the error in the FAN concentration calculation. However, in experiments where the Na + /K + /Cl -concentrations are above 1 g•L -1 and/or VFA concentrations are above 1 g COD•L -1 , the contribution of these ionic species to I must not be neglected. Nevertheless, it must be considered that as Cl -and VFAs are anions, their impact on I would not modify the FAN value when applying the Davies method used in this study (its concentration would belong to the pool of monovalent counterions used to close the charge balance). Thus, measuring the concentrations of NH4 + , Na + and K + should be enough to account for most of I in most of the studies.

A modification of the Davies equation was carried out, calibrating the experimental parameter these values provide a quasi-constant value of the activity coefficients at I ranging from 0.3 to 0.7 M, a I of 0.5 M is generally assumed as the application limit for this equation [START_REF] Stumm | Aquatic Chemistry: Chemical Equilibria and Rates in Natural Waters[END_REF][START_REF] Morel | Principles and Applications of Aquatic Chemistry[END_REF].

Over this limit, the linear term becomes predominant and the value of λ must be recalibrated.

The corresponding modified Davies equation corresponds to Equation 8, with a λ of 0.1276.

This value is lower than those used in the Davies equation (0.2) or in MINTEQA2 (0.3).

As it can be observed in Figure 2C, this modified Davies equation resulted in differences between the FAN values below 2 % (below 1 % for 72 % of the data) when compared to those given by MINTEQA2. It must be commented that, according to the results from the previous simplifications, the value of I for the calibration was estimated considering all the main ions in the media and avoiding the iterative approach for NH4 + calculation (using the I values obtained from the Davies equation for the calibration). When considering the iterative recalculation of I, the error was below 1 % for 70 % of the data (Figure S1).

To verify that the obtained equation could be applied at different operating conditions (pH, T and concentrations of ionic species, thus I values), the modified Davies equation was validated by comparing the resulting FAN concentrations with the ones given by MINTEQA2 at several conditions (see Section 2.3). GSA results revealed that pH, TAN and T are influential factors affecting FAN calculation using MINTEQA2 (βi higher than 0.1; see Figure S2). This finding further justifies the possibility of applying a simplified equation considering these parameters, such as the Davies equation. The Monte Carlo simulations validate the proposed equation. A regression analysis of the FAN values given by MINTEQA2 and those calculated using the modified Davies equation on the 10,000 conditions studied resulted in a R 2 of 0.9999 and a systematic error of 2.1 % (slope of 0.978) (Figure S3). The differences between the FAN concentrations obtained with the modified Davies equation and MINTEQA were always below 5 % (below 3 % for 69.5 % of the conditions simulated), confirming the applicability of the proposed equation (Figure S4). For an equal I, these errors were generally higher in thermophilic conditions (53-57 °C; up to 4.9 %) when compared to mesophilic temperatures (33-37 °C; up to 3.6 %). This might be related to the higher FAN concentrations at increasing temperatures and due to the predominance of mesophilic conditions in the database. Nevertheless, it must be considered that the Monte Carlo simulations based on average conditions led to extreme concentrations of FAN and I values (particularly high in thermophilic conditions), much higher that what can be usually found in AD systems. These results show that the modified Davies equation is a step forward for increasing the accuracy of the Debye-Hückel theory for FAN estimation in AD systems at high I values (up to around 1.0 M).

To simplify the presentation of the conclusions drawn, a comparison of the tested methods for FAN determination is presented in Table 2. Recommendations for their application are also given. Nevertheless, to profit of its advantages, MINTEQA2 demands a broader analytical input, as well as programming knowledge for automatic on-line calculations. For everyday FAN calculation, the Davies equation appears as a much simpler and straight-forward approach whose implementation can be generalized for almost any AD system, excluding only those presenting an I above 0.5 M. In addition, its low computational requirements, together with its simplicity if the iterative process is avoided, allow an easy integration with existing AD models. The application of the Davies equation considering just the NH4 + and its counterion appears as a simplification that can be applied without causing significant errors in systems working at low concentrations of other ionic species. If the concentrations of other ions cannot be neglected, the most relevant species to be considered are Na + and K + . Finally, the modified Davies equation represents a much more precise calculation method for FAN estimation in AD systems when compared to the classic algorithm. This latter option appears as the method providing the best compromise between simplicity and accuracy (for I values up to 1.0 M). The simplifications tested with the classic Davies equation (e.g. considering only the NH4 + and its counterion) can also be applied with the proposed modified Davies equation.

Understanding the variability in FAN inhibitory limits

Cluster definition and IC50 estimation

The gathered values of the SMAs at different FAN concentrations, together with the results of the clustering process described in Section 2.4 are presented in Figure 4. RMSE and the number of points belonging to each cluster are presented in Table 3. First, it must be mentioned that the results presented in Figure 4 and Table 3 were obtained using the values of εFAN and εSMA that were found to minimize the clustering score from Equation 10(see Section 2.5). They corresponded to values of 0.205 log10(FAN) and 5 % SMA reduction, respectively. These were the values showing the lowest clustering score (0.32), with only 5.9 % of non-attributed points and an overlapping of 16.2 %. It is important to mention that the distribution of the values of the clustering score followed a normal trend, indicating that the optimum found did not correspond to a local minimum. This also reinforces the obtained results, as it proves that the collected data have been correctly gathered. The values of the clustering score resulting from the sensitivity analysis, the distribution of the clustering scores and the values of each parameter considered for its calculation (i.e. number of clusters, number of non-attributed points and overlapping) at the different values of εFAN and εSMA that were tested can be found in the supplementary material

(Figures S5 to S9).
The obtained clustering results show the divergence existing in the literature regarding FAN inhibition. This disparity in the resilience of a microbial community towards FAN inhibition has been linked to several factors, such as background FAN concentration, acclimation strategy, temperature, pH, and substrate type [START_REF] Chen | Inhibition of anaerobic digestion process: A review[END_REF][START_REF] Tian | Acclimation to extremely high ammonia levels in continuous biomethanation process and the associated microbial community dynamics[END_REF][START_REF] Lu | Relationship between microbial community, operational factors and ammonia inhibition resilience in anaerobic digesters at low and moderate ammonia background concentrations[END_REF][START_REF] Vrieze | Ammonia and temperature determine potential clustering in the anaerobic digestion microbiome[END_REF][START_REF] Gao | Tolerance response to in situ ammonia stress in a pilot-scale anaerobic digestion reactor for alleviating ammonia inhibition[END_REF][START_REF] Tian | Different cultivation methods to acclimatise ammonia-tolerant methanogenic consortia[END_REF]. The first cluster, with an IC50 of 39 mg FAN-N•L -1 could correspond to non-adapted microbial inocula with low FAN background concentrations, thus vulnerable to inhibition at low FAN contents. As shown in Table 1, similar values have been previously reported. IC50 values of 27 and 40 mg FAN-N•L - 1 have been previously reported using digested sewage sludge as inoculum [START_REF] He | Inhibitory effect of ammonia and lincomycin on anaerobic digestion[END_REF][START_REF] Belmonte | Effect of free ammonia nitrogen on the methanogenic activity of swine wastewater[END_REF][START_REF] Lu | Relationship between microbial community, operational factors and ammonia inhibition resilience in anaerobic digesters at low and moderate ammonia background concentrations[END_REF]. Using similar inocula, a maximum allowable FAN concentration of 55 mg FAN-N•L -1 was found by Bhattacharya and Parkin [START_REF] Bhattacharya | The effect of ammonia on methane fermentation processes[END_REF]. Regarding the second cluster (IC50 of 84 mg FAN-N•L -1 ), similar values have been reported using inocula acclimated to slightly higher FAN concentrations. IC50 values of 70 and 86 mg FAN-N•L -1 were found using digested sewage sludge as inoculum but treating substrates with higher N contents [START_REF] Astals | Development and validation of a rapid test for anaerobic inhibition and toxicity[END_REF][START_REF] Buendía | Feasibility of anaerobic codigestion as a treatment option of meat industry wastes[END_REF]. The IC50 resulting from the third cluster (208 mg FAN-N•L -1 ) was close to values found when treating N-rich biowastes and manure. Benabdallah El Hadj et al. and Borja et al. reported IC50 values of 215 and 280 mg FAN-N•L -1 for digesters treating OFMSW and cattle manure, respectively [START_REF] Borja | Influence of ammonia concentration on thermophilic anaerobic digestion of cattle manure in upflow anaerobic sludge blanket (UASB) reactors[END_REF][START_REF] El Hadj | Ammonia influence in anaerobic digestion of OFMSW[END_REF]. The fourth cluster (458 mg FAN-N•L -1 ) mainly consists of digesters treating N-rich wastes at thermophilic conditions. IC50 values of 468, 520, 635 and 690 mg FAN-N•L -1 have been reported in thermophilic AD when treating OFMSW, manure, slaughterhouse waste and OFMSW, respectively [START_REF] Borja | Influence of ammonia concentration on thermophilic anaerobic digestion of cattle manure in upflow anaerobic sludge blanket (UASB) reactors[END_REF][START_REF] Gallert | Mesophilic and thermophilic anaerobic digestion of source-sorted organic wastes: effect of ammonia on glucose degradation and methane production[END_REF][START_REF] El Hadj | Ammonia influence in anaerobic digestion of OFMSW[END_REF][START_REF] Bayr | Mesophilic and thermophilic anaerobic codigestion of rendering plant and slaughterhouse wastes[END_REF]. Regarding the fifth cluster, with an IC50 of 1,082 mg FAN-N•L -1 , similar results have only been achieved by Nakakubo et al. [START_REF] Nakakubo | Ammonia Inhibition of Methanogenesis and Identification of Process Indicators during Anaerobic Digestion[END_REF], who reported an IC50 of 1,450 mg FAN-N•L -1 when digesting pig manure at thermophilic conditions. Finally, no study has so far given an IC50 as high as the one obtained for the last cluster, with an estimated IC50 value of 2,565 mg FAN-N•L -1 . However, several studies have shown that acclimated microbial communities can carry out efficient AD without signs of inhibition at very high TAN (8.0-10 g TAN-N•L -1 ) and/or FAN (1,000-1,500 mg FAN-N•L -1 ) concentrations [START_REF] Capson-Tojo | Addition of granular activated carbon and trace elements to favor volatile fatty acid consumption during anaerobic digestion of food waste[END_REF][START_REF] Nakakubo | Ammonia Inhibition of Methanogenesis and Identification of Process Indicators during Anaerobic Digestion[END_REF][START_REF] Tian | Acclimation to extremely high ammonia levels in continuous biomethanation process and the associated microbial community dynamics[END_REF][START_REF] Poirier | Anaerobic digestion of biowaste under extreme ammonia concentration: Identification of key microbial phylotypes[END_REF][START_REF] Capson-Tojo | Addition of biochar and trace elements in the form of industrial FeCl3 to stabilize anaerobic digestion of food waste: dosage optimization and long-term study[END_REF]. Therefore, it can be expected that the IC50 values corresponding to these systems would be much higher than those previously reported.

Influence of the operational conditions on the resilience to FAN inhibition

To elucidate which were the main factors driving FAN resilience, the substrate type, operational conditions, and microbial communities of each cluster were evaluated. These variables/parameters have been previously identified as key factors influencing FAN resilience. Figure 5 shows the repartition of AD substrates for each cluster.

OFMSW stands of organic fraction of municipal solid waste

The first two clusters corresponded to experiments where the substrates were generally low in N, such as VFAs, sewage sludge, or wastewater. The third cluster corresponded to the AD of substrates such as animal manure and biowaste/food waste, feedstocks that are richer in N than the previous ones [START_REF] Capson-Tojo | Food waste valorization via anaerobic processes: a review[END_REF][START_REF] Agyeman | Anaerobic co-digestion of food waste and dairy manure: Effects of food waste particle size and organic loading rate[END_REF][START_REF] Zhang | The anaerobic co-digestion of food waste and cattle manure[END_REF]. The last three clusters where fed with similar N-rich substrates, mainly consisting of animal manure and biowaste/food waste. Nevertheless, it must be mentioned that in many of the experiments used to determine IC50 values, N is externally added to synthetic carbon and electron sources, such as acetate, CO2, hydrogen, methanol or sugars [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF][START_REF] Astals | Development and validation of a rapid test for anaerobic inhibition and toxicity[END_REF][START_REF] Tian | Effect of different ammonia sources on aceticlastic and hydrogenotrophic methanogens[END_REF]. This is the reason for the presence of experiments fed with hydrogen and CO2 and/or acetate in the last three clusters. In addition, many studies dealing with nitrogen inhibition, particularly those operated at relatively high TAN concentrations (> 4-6 g TAN-N•L -1 ), usually increase the nitrogen concentration in the reactors by adding an external source of TAN, such as NH4Cl or NH4CO3. Substrate type has been reported as a factor influencing FAN resilience (independent of the background FAN concentration) [START_REF] Bayr | Mesophilic and thermophilic anaerobic codigestion of rendering plant and slaughterhouse wastes[END_REF].

However, Figure 5 shows that microbial communities can be acclimated to high FAN concentrations for a wide variety of substrates.

In fact, while a compositional pattern can be observed in Figure 5, the corresponding TAN concentrations in each cluster were quite similar (Figure 6A). Although the TAN concentration medians followed a moderate increase with higher IC50 values (Figure 6A and Table 4), no significant differences were found except for a slightly higher value in Cluster 5.

The same occurred with the NH4 + concentrations, although they were increasingly lower than the TAN contents at higher IC50 values due to the increasing proportions of FAN (Figure 6B).

On the other hand, the temperature and the pH medians for each cluster did increase significantly (p < 0.01) with the obtained IC50 values (Figure 6C and Figure 6D). These results suggest that the speciation of TAN and FAN (FAN proportion) is the main factor determining inhibition of AD by FAN. As microorganisms able to grow at high pH and temperatures are more likely to be exposed to high FAN concentrations, it is logical to expect higher IC50 values under these conditions, i.e. a greater resistance to inhibition. These results highlight that thermophilic microorganisms have higher FAN inhibitory limits than mesophilic ones, which is agreement with previous results presented in the literature [START_REF] Gallert | Mesophilic and thermophilic anaerobic digestion of source-sorted organic wastes: effect of ammonia on glucose degradation and methane production[END_REF]. The debate regarding the impact of temperature on FAN resilience has been ongoing for years, with studies confirming that thermophiles are more resilient to FAN inhibition and others showing that thermophilic AD reactors are more vulnerable to TAN/FAN increases than mesophilic systems [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF]. This latter observation is usually a consequence of the higher FAN proportions at higher temperatures, which implies that smaller TAN increments are more detrimental to thermophilic reactors non-adapted to high TAN/FAN contents because more FAN is actually added. Nevertheless, this observation is not against the claim of adapted thermophiles being more resilient to FAN than adapted mesophilic archaea, as this finding simply confirms that microorganisms more likely to live at higher FAN levels are more resilient to FAN inhibition. Because of this, adaptation of the archaeal community to high FAN concentrations is even more relevant at high temperatures. Although FAN is the main inhibitor of digesters operated at high TAN concentrations, several publications have shown that NH4 + is also an inhibitor of the AD process [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF][START_REF] Kayhanian | Ammonia Inhibition in High-Solids Biogasification: an Overview and Practical Solutions[END_REF][START_REF] Sung | Ammonia inhibition on thermophilic anaerobic digestion[END_REF][START_REF] Lay | The influence of pH and ammonia concentration on the methane production in high-solids digestion processes[END_REF][START_REF] El Hadj | Ammonia influence in anaerobic digestion of OFMSW[END_REF].

Indeed, the results presented in Figure 6B show that the resilience to FAN inhibition is independent of the NH4 + concentrations, which is agreement with Benabdallah et al. [START_REF] El Hadj | Ammonia influence in anaerobic digestion of OFMSW[END_REF] and Astals et al. [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF], who were able to model the separate impact of both inhibitors. For digested sewage sludge (a non-adapted inocula belonging to clusters 1 and 2), Lay et al. [START_REF] Lay | The influence of pH and ammonia concentration on the methane production in high-solids digestion processes[END_REF] and Astals et al. [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF] observed that FAN starts inhibiting as soon as its concentration was increased (1-10 mg FAN-N•L -1 ), whereas a certain threshold concentration had to be reached prior observing NH4 + inhibition (~1 g NH4 + -N•L -1 ). The results from Lay et al. [START_REF] Lay | The influence of pH and ammonia concentration on the methane production in high-solids digestion processes[END_REF] and Astals et al. [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF] also showed that the difference between the starting inhibition concentration and the concentration where inhibition is complete is an order of magnitude for FAN (from 10 to 150 mg FAN-N•L -1 ) and 2 to 5-folds for NH4 + (from 1 to 5 g NH4 + -N•L -1 ). FAN and NH4 + inhibition can only be distinguished by carrying out experiments at different TAN and pH values. In practice, this is only achievable in batch inhibition tests where a range of conditions can be tested for a given inoculum [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF][START_REF] Lay | The influence of pH and ammonia concentration on the methane production in high-solids digestion processes[END_REF][START_REF] El Hadj | Ammonia influence in anaerobic digestion of OFMSW[END_REF]. Astals et al. [START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF] proposed a methodology to differentiate the impact of both inhibitors. However, the long legacy of FAN as main AD inhibitor and the fact that FAN is, in most cases, a stronger inhibitor than NH4 + , means that NH4 + inhibition in AD systems remains overlooked. It must be commented that the mechanisms behind NH4 + toxicity remain unknown. The reported decrease in methanogenic activities could be related to higher osmotic pressures due to higher concentrations of ions in the media. Experiments should be carried out to differentiate between a potential specific NH4 + toxicity and the impact of high osmotic pressures.

Influence of the microbial community on FAN resilience

Regarding the structure of the microbial communities in each cluster, Figure 7 and Table 4 show the repartition of dominant archaeal genus (archaea are the most vulnerable microorganisms to FAN inhibition) for each cluster. Only the predominant genus (that with the highest percentage in relative abundance) was considered for the counting. "Non-reported" corresponds to studies in which the microbial communities were not analyzed The first two clusters (IC50 of 39 and 84 mg FAN-N•L -1 ), the most vulnerable to FAN inhibition, were mostly dominated by acetoclastic methanogens (mainly Methanosaeta).

Different studies have demonstrated that the inhibitory effect due to the presence of FAN is generally stronger for acetoclastic methanogens when compared to hydrogenotrophic methanogens [START_REF] Angelidaki | Anaerobic thermophilic digestion of manure at different ammonia loads: Effect of temperature[END_REF][START_REF] Capson-Tojo | Addition of granular activated carbon and trace elements to favor volatile fatty acid consumption during anaerobic digestion of food waste[END_REF][START_REF] Poirier | Anaerobic digestion of biowaste under extreme ammonia concentration: Identification of key microbial phylotypes[END_REF][START_REF] Tian | Effect of different ammonia sources on aceticlastic and hydrogenotrophic methanogens[END_REF][START_REF] Calli | Effects of high free ammonia concentrations on the performances of anaerobic bioreactors[END_REF][START_REF] Capson-Tojo | Methanosarcina plays a main role during methanogenesis of high-solids food waste and cardboard[END_REF][START_REF] Koster | Anaerobic Digestion at Extreme Ammonia Concentrations[END_REF][START_REF] Bayrakdar | Dry anaerobic digestion of chicken manure coupled with membrane separation of ammonia[END_REF][START_REF] Banks | Trace element requirements for stable food waste digestion at elevated ammonia concentrations[END_REF]. Methanosaeta is a genus formed by acetoclastic methanogens able to perform a more efficient acetate conversion to methane than hydrogenotrophic archaea [START_REF] Vrieze | Methanosarcina: The rediscovered methanogen for heavy duty biomethanation[END_REF]. Therefore, they are usually the predominant archaea under non-stressed AD conditions (i.e. low TAN/FAN and VFA concentrations). However, Methanosaeta have been reported to be particularly sensitive to FAN inhibition, with IC50 values up to 175 mg FAN-N•L -1 [START_REF] Rajagopal | A critical review on inhibition of anaerobic digestion process by excess ammonia[END_REF][START_REF] Lu | Relationship between microbial community, operational factors and ammonia inhibition resilience in anaerobic digesters at low and moderate ammonia background concentrations[END_REF][START_REF] Capson-Tojo | Methanosarcina plays a main role during methanogenesis of high-solids food waste and cardboard[END_REF]. Studies working at increasing FAN concentrations have reported that acetoclastic archaea dominate at low FAN/TAN concentrations, while mixotrophic and hydrogenotrophic archaea dominate at higher FAN concentrations. Thus, high FAN concentrations cause a shift from acetoclastic to hydrogenotrophic methanogenesis. Under these circumstances, syntrophic acetate oxidation (SAO) is the predominant acetateconsuming pathway [START_REF] Lu | Relationship between microbial community, operational factors and ammonia inhibition resilience in anaerobic digesters at low and moderate ammonia background concentrations[END_REF][START_REF] Gao | Tolerance response to in situ ammonia stress in a pilot-scale anaerobic digestion reactor for alleviating ammonia inhibition[END_REF][START_REF] Poirier | Anaerobic digestion of biowaste under extreme ammonia concentration: Identification of key microbial phylotypes[END_REF][START_REF] Jiang | Quantifying the percentage of methane formation via acetoclastic and syntrophic acetate oxidation pathways in anaerobic digesters[END_REF][START_REF] Zamanzadeh | Anaerobic digestion of food waste -effect of recirculation and temperature on performance and microbiology[END_REF][START_REF] Ruiz-Sánchez | Effect of ammonia on the active microbiome and metagenome and from stable full-scale digesters[END_REF][START_REF] Moestedt | Ammonia threshold for inhibition of anaerobic digestion of thin stillage and the importance of organic loading rate[END_REF][START_REF] Werner | Microbial community dynamics and stability during an ammonia-induced shift to syntrophic acetate oxidation[END_REF][START_REF] Westerholm | Bioaugmentation of syntrophic acetate-oxidizing culture in biogas reactors exposed to increasing levels of ammonia[END_REF].

Consistently, at increasing values of the IC50, the mixotrophic Methanosarcina and hydrogenotrophic methanogens (i.e.

Methanoculleus, Methanobacterium and

Methanobrevibacter) started to gain importance (Cluster 3, IC50 of 208 mg FAN-N•L -1 ). The role of the genus Methanosarcina in this transition from low to high FAN levels has been reported to be particularly important, being more resistant to FAN than strict acetoclastic methanogens (e.g. Methanosaeta). Methanosarcina are able to degrade acetate, which allows this genus to thrive even if an effective SAO community is not present [START_REF] Vrieze | Methanosarcina: The rediscovered methanogen for heavy duty biomethanation[END_REF][START_REF] Capson-Tojo | Methanosarcina plays a main role during methanogenesis of high-solids food waste and cardboard[END_REF]. In agreement with our results, a total failure of Methanosaeta-dominated reactors has been observed at FAN contents up to 600-700 mg FAN-N•L -1 ), being more resistant to FAN than acetoclastic methanogens but more vulnerable than hydrogenotrophs [START_REF] Vrieze | Methanosarcina: The rediscovered methanogen for heavy duty biomethanation[END_REF][START_REF] Capson-Tojo | Kinetic study of dry anaerobic co-digestion of food waste and cardboard for methane production[END_REF][START_REF] Capson-Tojo | Methanosarcina plays a main role during methanogenesis of high-solids food waste and cardboard[END_REF][START_REF] Karakashev | Influence of Environmental Conditions on Methanogenic Compositions in Anaerobic Biogas Reactors[END_REF][START_REF] Bayrakdar | Anaerobic digestion of chicken manure by a leachbed process coupled with side-stream membrane ammonia separation[END_REF][START_REF] Capson-Tojo | Dry anaerobic digestion of food waste and cardboard at different substrate loads, solid contents and co-digestion proportions[END_REF][START_REF] Dennehy | Anaerobic co-digestion of pig manure and food waste; effects on digestate biosafety, dewaterability, and microbial community dynamics[END_REF][START_REF] Calli | Community changes during star-up in methanogenic bioreactors exposed to increasing levels of ammonia[END_REF].

Methanosarcina have been found to be responsible for a partial resistance of acetoclastic methanogenesis to sudden increases of the FAN levels and they have also been found to be the archaea allowing the recovery of methane production after severe FAN inhibition and VFA accumualtion [START_REF] Capson-Tojo | Methanosarcina plays a main role during methanogenesis of high-solids food waste and cardboard[END_REF][START_REF] Chen | Microbial responses and metabolic pathways reveal the recovery mechanism of an anaerobic digestion system subjected to progressive inhibition by ammonia[END_REF][START_REF] Hao | Stable isotope probing of acetate fed anaerobic batch incubations shows a partial resistance of acetoclastic methanogenesis catalyzed by Methanosarcina to sudden increase of ammonia level[END_REF]. The ability of Methanosarcina to consume both acetate and hydrogen allow this genus to thrive when an effective SAO community is not present.

Therefore, transitional periods might be a niche where Methanosarcina thrive, being outcompeted afterwards when a functional SAO-hydrogenotrophic syntrophy is developed.

Methanoculleus has been reported as the predominant archaea at extreme FAN levels [START_REF] Tian | Acclimation to extremely high ammonia levels in continuous biomethanation process and the associated microbial community dynamics[END_REF][START_REF] Ruiz-Sánchez | Effect of ammonia on the active microbiome and metagenome and from stable full-scale digesters[END_REF][START_REF] Moestedt | Ammonia threshold for inhibition of anaerobic digestion of thin stillage and the importance of organic loading rate[END_REF]. Methanoculleus have been found to be more tolerant to FAN than Methanosarcina, which is in agreement with the results presented in Figure 7 and Table 4.

Shifts from Methanosarcina-dominated reactors towards Methanoculleus-dominated systems have been found at increasing high FAN concentrations [START_REF] Tian | Effect of different ammonia sources on aceticlastic and hydrogenotrophic methanogens[END_REF][START_REF] Li | Removal of nitrogen from chicken manure anaerobic digestion for enhanced biomethanization[END_REF]. In addition, experiments applying bioaugmentations strategies using Methanoculleus bourgensis have demonstrated that the addition of this archaea can alleviate the effect of FAN toxicity on the AD performance [START_REF] Fotidis | Enriched ammonia-tolerant methanogenic cultures as bioaugmentation inocula in continuous biomethanation processes[END_REF][START_REF] Fotidis | Bioaugmentation as a solution to increase methane production from an ammonia-rich substrate[END_REF].

It has also been found that mesophilic hydrogenotrophic methanogens are more sensitive to FAN toxicity compared to thermophilic methanogens, being Methanoculleus thermophilus more tolerant than Methanoculleus bourgensis [START_REF] Wang | Ammonia effect on hydrogenotrophic methanogens and syntrophic acetate oxidizing bacteria[END_REF]. Methanothermobacter is another thermophilic archaeal genus that has been found to be dominant at high FAN levels [START_REF] Capson-Tojo | Addition of granular activated carbon and trace elements to favor volatile fatty acid consumption during anaerobic digestion of food waste[END_REF][START_REF] Yin | An explanation of the methanogenic pathway for methane production in anaerobic digestion of nitrogenrich materials under mesophilic and thermophilic conditions[END_REF]. This is in agreement with the results presented in Figure 6C, showing increasing IC50 values at higher temperatures. Unfortunately, most of the studies that operated digesters at high FAN concentrations did not report the microbial community (see "non-reported" proportions in clusters 3 to 6 in Figure 7). More research should be carried out to elucidate which are the archaea dominating at these conditions and to determine their FAN inhibition limits and their practical growth rates.

It can be concluded from the data that acclimation of the microbial communities to high FAN concentrations is a key factor affecting their resilience. Recently, Tian et al. [START_REF] Tian | Different cultivation methods to acclimatise ammonia-tolerant methanogenic consortia[END_REF], who compared three different acclimation strategies (batch, fed-batch, continuous reactor), reported that a fed-batch reactor was the most efficient method to enrich a FAN-resistant microbial community since it allowed a stepwise increase of FAN concentration while preventing biomass washout. This is in agreement with other studies showing the effectiveness of consecutive batch operation for microbial acclimation [START_REF] Capson-Tojo | Addition of granular activated carbon and trace elements to favor volatile fatty acid consumption during anaerobic digestion of food waste[END_REF][START_REF] Gao | Tolerance response to in situ ammonia stress in a pilot-scale anaerobic digestion reactor for alleviating ammonia inhibition[END_REF][START_REF] Abouelenien | Dry mesophilic fermentation of chicken manure for production of methane by repeated batch culture[END_REF][START_REF] Mahdy | Ammonia tolerant inocula provide a good base for anaerobic digestion of microalgae in third generation biogas process[END_REF][START_REF] Ramirez | Modeling microbial diversity in anaerobic digestion through an extended ADM1 model[END_REF].

The variation of the microbial distribution with time before, during and after inhibition (light or severe) must be always considered if a resilient AD system is to be achieved.

Practical implications and industrial relevance

In the last decades, the industrial application of AD has been extended from the treatment of waste activated sludge in wastewater treatment plants to the valorization and stabilization of several waste streams, such as municipal solid waste, food waste and animal manure [START_REF] Mao | Review on research achievements of biogas from anaerobic digestion[END_REF][START_REF] Capson-Tojo | Food waste valorization via anaerobic processes: a review[END_REF][START_REF] Kothari | Different aspects of dry anaerobic digestion for bio-energy: An overview[END_REF].

The introduction of a more diverse variety of influents has boosted tremendously the development of AD as treatment technology but, at the same time, it has raised novel challenges. In the case of concentrated, N-rich, substrates, the main challenge has been process inhibition due to ammonia-N accumulation, which has frequently led to reactor failure. The most common practical solution to maintain stable operation is substrate dilution, which is associated to significant economic losses and different process complications (e.g. larger equipment and digestate volumes). Because of this, several research and industrial projects have been focused on the subject, aiming at understanding the issue and at finding a solution.

This review aimed at unifying all the previous efforts to provide a methodology that can serve to correctly calculate the FAN concentrations in digesters, producing comparable, accurate data. The proposed modified Davies equation can serve as a straight-forward option to reduce the errors in FAN calculations to negligible values in both industrial and research purposes. A main limitation for its application is the necessity of determining the I of the media, which requires the measurement of different chemical species. Nevertheless, the results presented in Figure 3 confirm that few ions need be measured to account for most of the I (e.g. NH4 + , Na + and K + ). Therefore, a routine analytical set could easily serve for FAN monitoring for industrial applications, simply measuring NH4 + and pH. If required, estimating the Na + and K + concentrations could be done via conductivity measurements (after previous calibration).

Another limitation of the modified Davies equation is the range of I values where it can be applied (up to 1.0 M). However, these conditions are very rarely reached neither in industrial nor in research applications, so the proposed equation is potentially applicable in most working conditions.

Another outcome with both academic and industrial interest is the definition of general IC50 values for different working conditions (i.e. TAN concentrations, temperature and pH).

Although the most precise approach is the experimental determination of the IC50 in each particular set-up, the values given here can act as indicators of the FAN resilience for given working conditions, even if the microbial communities are not known. The given values could obviously be used for modelling purposes either as model parameters or as initial estimates for calibration purposes. The given values can be directly applied in commonly used mechanistic models, such as the ADM1.

Finally, the results presented in Section 4.3 confirm the importance of the adaptation of the archaeal communities to high FAN concentrations, mainly related to a shift in the population dynamics. Although the microbial communities are rarely monitored in industrial digesters, the importance of adaptation must be considered in plants where the substrates are often changed, such us territorial digesters than frequently modify co-digestion proportions or add new influent streams. If feeding modifications lead to significant increases of the FAN concentrations, transient VFA peaks are to be expected, which might lead to reactor acidification if not properly managed. This is particularly relevant in thermophilic reactors, as increases in the TAN input are translated into much higher FAN levels when compared to mesophilic conditions. The utilization of additives, such us trace elements to favor the growth and development of particular archaea might be also useful for process stabilization and to favor microbial adaptation [START_REF] Capson-Tojo | Addition of granular activated carbon and trace elements to favor volatile fatty acid consumption during anaerobic digestion of food waste[END_REF][START_REF] Banks | Trace element requirements for stable food waste digestion at elevated ammonia concentrations[END_REF].

Although the amount of data available on both performance and microbial communities of AD at high TAN/FAN contents has increased significantly in the last years, it is clear when looking at the obtained results (i.e. "non-reported" fractions for clusters 4, 5 and 6 in Figure 7; 66.7-87.1 %) that more research must be carried out to study the microbial communities in Nrich systems at high FAN levels.

Conclusions

The presented results show that the ideal equilibrium equation should not be applied for FAN calculation in AD. This method overestimates significantly the FAN concentrations (up to 37 % when compared with MINTEQA2). The application of the Davies equation considering only few ions (e.g. NH4 + , Na + and K + ) can lead to major improvements in most cases. The proposed modified Davies equation appears as the method presenting the best compromise between complexity and accuracy. The differences in the FAN concentrations obtained by this approach and the ones given by MINTEQA2 were below 1 % for 70 % of the data (with a systematic error of 2 %). Analysis of data from the literature dealing with FAN inhibition resulted in six clusters. The results of the clustering procedure proved that pH and temperature, rather than the TAN content itself, are the main factors affecting inhibition of AD by FAN. Methanosaeta-dominated reactors presented lower inhibition limits when compared to mixotrophic and hydrogenotrophic systems. Only the predominant genus (that with the highest percentage in relative abundance) was considered for the counting. "Non-reported" corresponds to studies in which the microbial communities were not analyzed

Figure 1 .

 1 Figure 1. Differences in the FAN concentrations at different ionic strengths: (A) the ideal

Figure 2 .

 2 Figure 2. Differences in the FAN concentrations at different ionic strengths: (A) the comprehensive Davies method vs the simplified Davies method considering only the NH4 + and its counterion, (B) the simplified Davies method considering only the NH4 + and its counterion vs the same method without iterative NH4 + calculation, and (C) the modified Davies method (Eq. 8) vs MINTEQA2. Only data from experiments with significant concentrations of ions other than NH4 + have been considered in A and B (1,132 data points). 1,590 data points are presented in C.

Figure 3 .

 3 Figure 3. Contributions of each chemical species to the total ionic strength of the media. Only data from experiments reporting significant concentrations of ions other than NH4 + have been considered (1,097 data points). I stands for ionic strength and Ac -, Pr -, Bu -and Val -stand for

λ

  in Equation 5 to fit the obtained FAN concentrations to the ones given by MINTEQA2. The Davies equation is itself the result of an empirical modification of the Debye-Hückel theory, by adding the linear term -λ•I to the formula. Davies estimated the parameter λ by optimizing the measured activity coefficients at I below 0.1 M, obtaining values of 0.2-0.3. Although

Figure 4 .

 4 Figure 4. Reduction of the SMA at different FAN concentrations reported in the literature.

Figure 5 .

 5 Figure 5. Repartition of the substrates used as AD feed in each of the resulting clusters.

Figure 6 .

 6 Figure 6. Values of the (A) TAN concentrations, (B) NH4 + concentrations, (C) temperatures

Figure 7 .

 7 Figure 7. Repartition of the main archaeal genus after AD for each of the resulting clusters.

TAN concentrations over 4 , 100 - 4 ,

 41004 200 mg TAN-N•L -1 , corresponding to FAN contents of 150-175 mg FAN-N•L -1 at the corresponding working conditions[START_REF] Astals | Characterising and modelling free ammonia and ammonium inhibition in anaerobic systems[END_REF][START_REF] Calli | Effects of high free ammonia concentrations on the performances of anaerobic bioreactors[END_REF][START_REF] Peces | Deterministic mechanisms define the longterm anaerobic digestion microbiome and its functionality regardless of the initial microbial community[END_REF][START_REF] Karakashev | Influence of Environmental Conditions on Methanogenic Compositions in Anaerobic Biogas Reactors[END_REF]. The Kmax for the Methanosaeta-dominated clusters (1 and 2) further verify these inhibition limits for acetoclastic archaea, with values of 72 and 152 mg FAN-N•L -1 , respectively. The Kmin corresponding to the third cluster (78 mg FAN-N•L -1 ) further proves the greater resistance of Methanosarcina to FAN inhibition, with a Kmax of 337 mg FAN-N•L -1 . This is also supported by the presence of this archaea in clusters 4 and 5, with Kmax of 741 and 1,878 mg FAN-N•L -1 , respectively. Consistently, efficient methane production has been achieved in Methanosarcina-dominated systems working at TAN concentrations over 7,000 mg TAN-N•L -1 (FAN contents up to 600-700 mg FAN-N•L -1 )[START_REF] Tian | Acclimation to extremely high ammonia levels in continuous biomethanation process and the associated microbial community dynamics[END_REF][START_REF] Capson-Tojo | Kinetic study of dry anaerobic co-digestion of food waste and cardboard for methane production[END_REF][START_REF] Bayrakdar | Anaerobic digestion of chicken manure by a leachbed process coupled with side-stream membrane ammonia separation[END_REF][START_REF] Capson-Tojo | Dry anaerobic digestion of food waste and cardboard at different substrate loads, solid contents and co-digestion proportions[END_REF].At increasing values of IC50 (i.e. last three clusters) a total disappearance of Methanosaeta occurred, which can be explained by the higher Kmin of these clusters (> 175 mg FAN-N•L -1 ) when compared to the Kmax of the first two (< 152 mg FAN-N•L -1 ), where Methanosaeta was the dominant methanogen. In addition, Methanosarcina was no longer the dominant methanogen, being replaced by hydrogenotrophic archaea. While Methanosarcina was no longer dominant in any study after the fifth cluster (Kmax of 1,878 mg FAN-N•L -1 ), Methanoculleus appeared as the most resistant methanogen, dominating the last cluster, with a Kmin of 743 mg FAN-N•L -1 and a Kmax of 4,387 mg FAN-N•L -1 . Recent studies indicate that when working at these high FAN concentrations hydrogenotrophs become dominant due to their higher tolerance to FAN, confirming the metabolic shift towards hydrogenotrophic methanogenesis[START_REF] Capson-Tojo | Addition of granular activated carbon and trace elements to favor volatile fatty acid consumption during anaerobic digestion of food waste[END_REF][START_REF] Poirier | Anaerobic digestion of biowaste under extreme ammonia concentration: Identification of key microbial phylotypes[END_REF][START_REF] Tian | Effect of different ammonia sources on aceticlastic and hydrogenotrophic methanogens[END_REF]. Amongst the most relevant genus of hydrogenotrophic archaea reported in the literature are Methanoculleus, Methanobacterium, Methanothermobacter and Methanobrevibacter[START_REF] Capson-Tojo | Addition of granular activated carbon and trace elements to favor volatile fatty acid consumption during anaerobic digestion of food waste[END_REF][START_REF] Poirier | Anaerobic digestion of biowaste under extreme ammonia concentration: Identification of key microbial phylotypes[END_REF][START_REF] Bayrakdar | Dry anaerobic digestion of chicken manure coupled with membrane separation of ammonia[END_REF][START_REF] Chen | Microbial responses and metabolic pathways reveal the recovery mechanism of an anaerobic digestion system subjected to progressive inhibition by ammonia[END_REF]. In agreement with the results presented in this document, Methanosarcina has been reported to be predominant at intermediate FAN concentrations (i.e.

Figure 4 .Figure 5 .Figure 6 .Figure 7 .

 4567 Figure 4. Reduction of the SMA at different FAN concentrations reported in the literature. The set of inhibition curves and IC50 values resulting from the clustering approach are also shown. SMA stands for specific methanogenic activity and FAN for free ammonia nitrogenFigure 5. Repartition of the substrates used as AD feed in each of the resulting clusters. OFMSW stands of organic fraction of municipal solid waste Figure 6. Values of the (A) TAN concentrations, (B) NH4 + concentrations, (C) temperatures and (D) pH for each cluster. For each parameter, conditions with different upper Greek letters are significantly different. The boxplots shown provide the values for the minimum, first quartile, median, third quartile and maximum. As the data were generally non-normally distributed, non-parametric tests were applied to assess significant differences (see Section 2.4). TAN stands for total ammoniacal nitrogenFigure 7. Repartition of the main archaeal genus after AD for each of the resulting clusters.Only the predominant genus (that with the highest percentage in relative abundance) was considered for the counting. "Non-reported" corresponds to studies in which the microbial communities were not analyzed

Table 2 .

 2 Comparison of the tested methods for FAN calculation and recommendations 577 a precise determination of the FAN concentrations and/or if interactions between other ionic species (including the formation of precipitates) are needed, the use of a comprehensive geochemical model such MINTEQA2 is recommended. This approach is clearly the most convenient option for comprehensive modelling of AD systems.

	Calculation method	Advantages	Disadvantages	Recommendations
	MINTEQA2	-Allows the most precise FAN calculation -Allows pH modelling trough proton balance -Provides physico-chemical knowledge -Interactions between different components considered -Precipitations considered	-Input-demanding for enhanced outputs -Interface required to integrate with existing models -Requires expertise and programming knowledge for automatic on-line calculations	-To be used for comprehensive modelling purposes -Recommended for I values > 0.5 M -Useful when the formation of precipitates is relevant
		-Simple to implement -Low computational requirements	-I should be below 0.5 M for precise results -Extensive data input required for I	-To be used for generalized process engineering and modelling
	Davies 1	-Easy to integrate in existing models -I can be estimated from conductivity measures	calculation -Interactions between different components and precipitations not considered	applications if interactions between NH4 + and other ionic species are not significant
	Davies considering only NH4 + and counterion 1	-Simple to implement -Low computational requirements -Easy to integrate in existing models -Low data input needed: the single ionic species to be measured is NH4 +	-I should be below 0.5 M for precise results -Significant errors at high Na + /K + concentrations considered -Interactions between different components and precipitations not	-To be used as substitute of the regular Davies application when the contributions of other ions to I are expected to be negligible
	Modified Davies equation 1	-Simple to implement -Low computational requirements -Easy to integrate in existing models -Applicable at higher values of I (up to 1.0 M) -I can be estimated from conductivity measures	-Extensive data input required for I calculation (reduced if only NH4 + , Na + and K + are considered) -Interactions between different components and precipitations not considered	-To be used as substitute of the Davies equation in AD of N-rich substrates for everyday process engineering and modelling applications
	1. Without iterative calculation of the NH4 + concentration

Table 3 .

 3 Results of the clustering method: values of the IC50, Kmin, Kmax, RMSE and number of points for each cluster

	Cluster #	IC50 (mg FAN-N•L -1 )	Kmin (mg FAN-N•L -1 )	Kmax (mg FAN-N•L -1 )	RMSE (% SMA reduction)	# of points
	1	39	6	72	18.1	129
	2	84	17	152	11.7	143
	3	208	78	337	18.0	109
	4	458	175	741	15.4	106
	5	1,082	285	1,878	16.1	90
	6	2,565	743	4,387	8.4	40
	FAN stands for free ammonia nitrogen, RMSE for root-mean-square error and SMA for specific methanogenic
	activity

Table 4 .

 4 Features of the clusters: main substrate fed, median TAN concentrations, median temperatures, median pH and predominant archaeal genus after AD Methanoculleus 1 FAN stands for free ammonia nitrogen and TAN for total ammoniacal nitrogen 1. The microbial communities were characterized in less than 50 % of the datasets in the cluster

	Cluster #	IC50 (mg FAN-N•L -1 )	Main substrate	TAN (g TAN-N•L -1 )	Temperature (ºC)	pH	Predominant archaeal genus
	1	39	Acetate	4.8	37	7.2	Methanosaeta
	2	84	Acetate	3.3	37	7.5	Methanosaeta
	3	208	Manure	4.0	37	7.7	Methanosarcina
	4	458	Manure	4.9	38	7.8 Methanoculleus 1
	5	1,082	Manure	6.0	55	7.9 Methanoculleus 1
	6	2,565	Manure	5.4	55	8.1

Figure 1 .

 1 The mixotroph Methanosarcina was dominant at intermediate FAN concentrations, being more resistant than Methanosaeta but more vulnerable than hydrogenotrophic methanogens. Methanoculleus appeared as the most resistant archaea, being predominant in AD systems working with the highest FAN levels (mainly fed with manure). Differences in the FAN concentrations at different ionic strengths: (A) the ideal equilibrium equation vs MINTEQA2, (B) the ideal equilibrium equation vs the comprehensive Davies equation. A Loess local regression curve is included (black curves; 1,590 data points presented). FAN stands for free ammonia nitrogen Figure2. Differences in the FAN concentrations at different ionic strengths: (A) the comprehensive Davies method vs the simplified Davies method considering only the NH4 + and its counterion, (B) the simplified Davies method considering only the NH4 + and its counterion vs the same method without iterative NH4 + calculation, and (C) the modified Davies method (Eq. 8) vs MINTEQA2. Only data from experiments with significant concentrations of ions other than NH4 + have been considered in A and B (1,132 data points). 1,590 data points are presented in C. Different y-axis scales are presented to allow a precise data interpretation. FAN stands for free ammonia nitrogen Figure 3. Contributions of each chemical species to the total ionic strength of the media. Only data from experiments reporting significant concentrations of ions other than NH4 + have been considered (1,097 data points). I stands for ionic strength and Ac, Pr, Bu and Val stand for acetate, propionate, butyrate and valerate, respectively

	Figure and table captions

Table 1 .

 1 IC50 values for both FAN and TAN reported in the literature (adapted and extended from Chen et al.[START_REF] Chen | Toxicants inhibiting anaerobic digestion: a review[END_REF] and Yenigün and Demirel[START_REF] Yenigün | Ammonia inhibition in anaerobic digestion: A review[END_REF])

Table 2 .

 2 Comparison of the tested methods for FAN calculation and recommendations

Table 3 .

 3 Results of the clustering method: values of the IC50, Kmin, Kmax, RMSE and number of points for each cluster

Table 4 .

 4 Features of the clusters: main substrate fed, median TAN concentrations, median temperatures, median pH and predominant archaeal genus after AD

mg NH4 + -N•L -1

Acknowledgement

Gabriel Capson-Tojo is grateful to the Xunta de Galicia for his postdoctoral fellowship (ED481B-2018/017). Sergi Astals is grateful to the Australian Research Council for his DECRA fellowship (DE170100497) and the Spanish Ministry of Science, Innovation and Universities for his Ramon y Cajal fellowship (RYC-2017-22372).