<figure><img src="image_1.png" /></figure>

1 **ABACO-2: a comprehensive model for microalgae-bacteria consortia validated outdoor at**
2 **pilot-scale**

3 Rebecca Nordio<sup>a,b</sup>, Enrique Rodríguez-Miranda<sup>b,c</sup>, Francesca Casagli<sup>d</sup>, Ana Sánchez-Zurano<sup>a,b</sup>,

4 José Luis Guzmán<sup>b,c</sup>, Gabriel Acién<sup>a,b</sup>

5 <sup>a</sup> Department of Chemical Engineering, Universidad de Almería, E04120 Almería, Spain.

6 <sup>b</sup> CIESOL Solar Energy Research Centre, Joint Centre University of Almería-CIEMAT, 04120

7 Almería, Spain.

8 <sup>c</sup> Department of Informatics, Universidad de Almería, E04120 Almería, Spain.

9 <sup>d</sup> Biocore, INRIA centre d'Université Côte d'Azur, Sophia-Antipolis F-06902, France.

10

11

12

<footnote>* Corresponding author: Rebecca Nordio, rnordio@ual.es</footnote>
13

**Abstract**

14

Modelling microalgae-bacteria in wastewater treatment systems has gained significant attention in the last few years. In this study, we present an enhanced version of the ABACO model, named ABACO-2, which demonstrates improved accuracy through validation in outdoor pilot-scale systems.

15

16

17

ABACO-2 enables the comprehensive characterization of microalgae-bacteria consortia dynamics, allowing to predict the biomass concentration (microalgae, heterotrophic bacteria, and nitrifying bacteria) and nutrient evolution. The updated version of the model incorporates new equations for nutrient coefficient yields, oxygen mass balance, and microorganism cellular decay, while significantly reducing the number of calibrated parameters, simplifying the parameter identification.

18

19

20

21

22

Calibration and validation were performed using data from a 80 m² raceway reactor operated in a semicontinuous mode over an extensive period (May to November, total of 206 days) at a fixed dilution rate of 0.2 day⁻¹ (corresponding to 5 days of hydraulic retention time), where untreated urban wastewater was used as culture medium. ABACO-2 exhibited robustness, accurately forecasting biomass production, population dynamics, nutrient recovery, and prevailing culture conditions across a wide range of environmental and water composition conditions. Mathematical models are essential instruments for the industrial development and optimization of microalgae-related wastewater treatment processes, thereby contributing to the sustainability of the wastewater treatment industry.

23

24

25

26

27

28

29

30

31

32

**KEYWORDS:** Microalgae, wastewater, modeling

33
## 1. Introduction

Water reuse and recycling have become crucial topics of discussion in recent decades, owing to their significant environmental and social implications. With rapid industrialization and population growth, the volume of wastewater generated annually has escalated (Angelakis and Gikas, 2014). contributing to water stress in various regions worldwide, particularly in southern Europe, including Spain, Italy, and Greece (Strosser et al., 2012). Consequently, researchers have directed their efforts toward developing innovative water remediation technologies. Among these technologies, microalgae-based wastewater systems have emerged as a promising solution, capable of replacing traditional secondary and tertiary classical wastewater treatment processes (Abdel-Raouf et al., 2012). The utilization of microalgae in water remediation offers several advantages. Firstly, it demands less energy compared to conventional methods. Secondly, it significantly reduces greenhouse gas emissions. Additionally, microalgae systems eliminate residues effectively and yield valuable biomass, which can be utilized in various industrial applications (Mohd Udaiyappan et al., 2017).

Microalgae are photosynthetic microorganisms capable of using CO₂ as a carbon source and light as an energy source, in addition to using nitrogen (N) and phosphorus (P) present in wastewater to produce biomass. Moreover, thanks to the presence of bacteria, the organic matter's degradation is ensured (Muñoz and Guieysse, 2006). The effectiveness of microalgae-based wastewater systems has been demonstrated through pilot-scale testing in raceway reactors (Morillas-España et al., 2021b) and thin layers (Grivalský et al., 2019). These studies have proven that these systems are robust and reliable, enabling the recovery of nutrients from wastewater and producing treated water that meets the regulatory standards set by European legislation (Council Directive of May 1991 concerning urban wastewater treatment, 1991). One of the key factors contributing to the success of this technology is its resilience in the face of significant variations in water composition and weather conditions (Nordio et al., 2023). However, high costs and relatively low efficiency are foreclosing the entire industrial development of these systems (Acién et al., 2014). The industrial development of these processes can be possible only after the improved understanding and
61

optimized management of the biological system allowing to study which are the main parameters
influencing biomass productivity and the water remediation capacity (Solimeno and García, 2017).

62

63

In this framework, mathematical modelling serves as a valuable tool for describing these processes;
as it enables simulations and performance evaluations under different environmental and process
conditions, aiding optimization and the development of control strategies (Solimeno and García,
2017). In the literature, it is possible to find many examples of microalgae models that evaluate the
growth rate as a function mainly of light, temperature, nutrients and pH (Lee et al., 2015). On the
contrary, a few examples of comprehensive models for microalgae-based wastewater treatments
are available, defined as models that consider the effect of multiple process parameters and
biological mechanisms. Examples of recent comprehensive models are the Zambrano model
(Zambrano et al., 2016), the BIOALGAE model (Solimeno et al., 2019), and the ALBA model (Casagli
et al., 2021). Nevertheless, it is challenging to obtain validation data over an extended period and
using urban wastewater in industrial facilities, so in the literature, some alternatives can be found,
such as validations achieved with digestates, synthetic waters, or small-scale reactors. However, it
is crucial to develop models that accurately represent the biological system in real conditions (both
environmental and operational) since they are intended for use in commercial wastewater treatment
facilities. In Spain, for example, there are currently four industrial facilities using microalgae for urban
wastewater treatment, employing reactors ranging from 0.5 to 1.0 ha (Masojídek et al., 2022).

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

To apply these models to large-scale production, it is important to balance complexity and realism.
For instance, very complex mathematical descriptions of all the metabolic reactions involved in
photosynthesis, may not improve the model prediction accuracy, compared to the computational
cost required. Additionally, mechanisms that are not relevant for long-time series and continuous
conditions can be omitted from the model (Darvehei et al., 2018). Furthermore, in wastewater,
thousands of bacterial groups can interact with microalgae, and it is fundamental to carefully select
the most relevant groups to reduce the number of equations and the overall complexity. Generally,
only a few groups are considered relevant, as they influence nutrient uptake from the culture
medium. The first model was proposed by Buhr & Miller in 1983 (Buhr and Miller, 1983), for example,

80

81

82

83

84

85

86

87
only two populations (algae and aerobic bacteria) were considered. However, afterwards, the leading
bacterial groups identified were the heterotrophic bacteria, which permitted the oxidation of the
organic matter, and nitrifying bacteria that compete with microalgae for the consumption of nitrogen
(together with phosphorous and carbon) in some cases distinguished between ammonia-oxidizing
bacteria (AOB) and nitrite-oxidizing bacteria (NOB) (Aparicio et al., 2022a).

In this work, an improved version of the ABACO model (Sánchez-zurano et al., 2021), named the
ABACO-2 model is proposed, calibrated and validated for outdoor conditions. Specifically, new
equations are included to reduce the number of calibrated parameters, and the use of the oxygen
mass balance allows for improvement in the accuracy of the model. Equations have been
implemented using Python language and numpy packages while the calibration has been carried
out with Scipy library and the optimization tool that uses the "Nelder-Mead" algorithm. The model
has been validated over an extensive period (May-November); data have been collected from a
demonstrative pilot-scale raceway reactor of 12 m³ (80 m²) on which the prevailing strain was
*Scenedesmus sp.* The reactor was operated in semi-continuous mode at a fixed rate of 0.2 day⁻¹
using urban wastewater as culture medium. For this study, wastewater not pre-treated besides the
removal of large particles was used, so subjected to high variation in terms of composition. This
large variability of water nutrient concentration, together with different values of solar radiation and
temperature typical of different year seasons, allowed to calibrate and validate the model in a wide
range of conditions (Section 2.2), so increasing its prediction accuracy and robustness.

## 2. Material and methods

### 2.1. Raceway reactor and inoculum

Experimental data were collected from an 80 m² (12 m³) raceway reactor working in semi-continuous
mode between April and December, with a fixed dilution rate of 0.2 day⁻¹. The raceway was installed
in the SABANA Demo Plant located in the IFAPA research centre in La Cañada, Almería, Spain. It
was composed of a double channel of 40 m and a sump of 0.59 m³ for the gas injections through
diffusers and an electric motor connected to a paddlewheel system for culture mixing. The pH was
monitored through sensors and controlled through CO₂ injection in the reactor sump. Additionally,
an independent airflow allowed reducing the concentration of dissolved oxygen. The culture depth was fixed at 0.15 m. In order to thoroughly monitor the culture dynamics, additional sensors have been installed for recording the dissolved oxygen (0-400% Sat), pH (0-14), temperature (0-80°C) and culture depth (4-40 cm). Moreover, a meteorological station allowed for registering the weather conditions regarding solar radiation and environmental temperature.

The chosen inoculum was *Scenedemus sp.* because it was demonstrated to be suitable microalgae that can easily be grown in wastewater and a wide range of conditions (Fernández Sevilla et al., 2006). The strain was initially grown on a fertilizer medium (0.9 g·L⁻¹ of NaNO₃, 0.18 g·L⁻¹ of MgSO₄, 0.14 g·L⁻¹ of KH₂PO₄ and 0.003 g·L⁻¹ of Kerantol), first using columns of 0.1 m³ and then in a tubular system of 3 m³ until it reached the concentration of 1 g·L⁻¹. The biomass was then used as inoculum for the raceways. The culture was diluted with wastewater and kept in batch mode for one week, after that being operated in semi-continuous mode until it reached a stable biomass concentration (approximating a steady state condition).

## 2.2. Environmental conditions and water composition

As previously mentioned, environmental conditions in terms of temperature and radiation were continuously recorded throughout the entire period. The Photosynthetically Active Radiation (PAR) registered were ranged from 2000 µE·m⁻²·s⁻¹ during the months of April and May, gradually decreasing during the colder seasons with peaks at 1200 µE·m⁻²·s⁻¹, with an average of 620 µE·m⁻²·s⁻¹ and 350 µE·m⁻²·s⁻¹ respectively. Regarding temperature, the highest values were recorded during the summer season (July-August), reaching peaks of 38°C, while in the spring season (April-May), they ranged between 25-35 °C, and in the autumn season (September-November), between 25-12 °C.

Regarding the culture medium, it consisted of wastewater collected from the University of Almería during the entire data collection period, except for August when the water was sourced from the primary water treatment plant in the city of Almería. In both instances, the water underwent pre-treatment, involving the removal of solid particles through an industrial filter (Azud Helix, 200 µm), before being introduced into the culture. During the study period, the nutrient concentration of the
142 wastewater varied over a wide range. Specifically, ammonium ($NH_4^+$) concentration varies between
143 10 - 400 $g·m^{-3}$, nitrate ($NO_3^-$) concentration ranged from 0- 13 $g·m^{-3}$, phosphate ($PO_4^{2-}$) between 30
144 - 76 $g·m^{-3}$, while the chemical oxygen demand (COD) between 100 – 600 $gO_2·m^{-3}$.

145 **2.3. Biomass concentration and nutrients analysis**

146 The influent wastewater and the filtered effluent were analysed in terms of nutrient content (N-NO₃⁻,
147 N-NH₄⁺, P-PO₄³⁻) and COD. The biomass concentration in the culture was daily measured through
148 the dry weight (DW) method. The culture was collected in the morning after the reactor sump, and
149 100 mL were filtered in a 0.5 µm filter and let dry for 24h at 80°C in an oven. Regarding the nutrients,
150 they were analysed through colourimetric methodologies in a spectrophotometer according to
151 standard procedures (Standard IC 74246, Standard IC 38364, Standard IC 59755). The total COD
152 was measured with Hanch-Lange kits (LCI-400) and the biodegradable soluble organic matter
153 (BSMO) was estimated as a percentage of the total COD as reported in the literature by Pasztor I.
154 et al., 2009.

155 **2.4. Data collection and analysis**

156 Experimental online data were collected every second by a set of sensors, connected to a
157 Programming Logic Controller (PLC) and a Supervisory Control and Data Acquisition (SCADA)
158 system. On the contrary, data coming from laboratory analysis as described in the previous section,
159 were collected once a day. Given the big amount of data available, it was necessary to perform a
160 prior data analysis following a procedure inspired by the "Cross Industry Standard Process Alliance
161 for Data Mining" (CRISP-DM) approach (Ncr and Clinton, 1999). This methodology is one of the
162 most used among data mining problems and it is composed of six main steps: (i) Business
163 understanding, (ii) Data understanding, (iii) Data preparation, (iv) Modelling, (v) Evaluation, and (vi)
164 Deployment. In this research, the first five steps have been developed as briefly described below:

165 I. **Business understanding**: the objective is to develop a model that can describe the evolution
166 of microalgae-bacteria populations in wastewater-related systems. The aim is to develop a
167 tool that allows the simulation of the variation of biomass and nutrient concentration with time
168 as a function of environmental and process parameters.

169 II. **Data understanding**: data have been collected as described in the previous section, studied,
170 and analysed.

171 III. **Data preparation**: Datasets have been ordered, cleaned, and prepared for the modelling step.

172 IV. **Modelling**: the biological system has been modelled as described in the next sections.
173 Stepping back to data preparation is often necessary. A part of the experimental data set has
174 been used for the identification of the calibration parameters.

175 V. **Evaluation**: the developed model has been validated with long-term outdoor dataset. If the
176 quality of the model was not enough to reach the defined objective, the data preparation and
177 modelling part has been reviewed.

178 VI. **Deployment**: this step was not addressed in this research. However, a web interface for
179 model utilization will be developed in future works.

180 **3. Model development**

181 **3.1. Model concept**

182 This work considers three microbial groups: microalgae, heterotrophic bacteria and nitrifying bacteria
183 as they are the main actors in the nutrient uptake and the O₂/CO₂ fluxes (Figure 1). During the day,
184 microalgae perform photosynthesis consuming the inorganic carbon and fixing nitrogen and
185 phosphorus while producing O₂. The preferred nitrogen form for microalgae growth is NH₄⁺, which is
186 highly present in urban wastewater. Microalgae compete with nitrifying bacteria for the uptake of this
187 compound since they use it to transform it into NO₃⁻ during the nitrification. The nitrification process
188 involved the oxidation of NH₄⁺ to NO₂⁻ by AOB and then NOB transform NO₂⁻ into NO₃⁻. For this
189 study, it is considered that the nitrification is complete because it was not registered a significant
190 concentration of NO₂⁻ in the culture (consistently below 5 g·m⁻³). Moreover, microalgae can use NO₃⁻
191 as a form of nitrogen, but its consumption takes place only when ammonium is found below a given
192 threshold (prior experimental analysis have estimated it as 80 g·m⁻³). Heterotrophic bacteria are
193 considered the leading bacteria group as they are the main ones responsible for the degradation of
194 organic matter. For the present work, the COD has been fractionated as proposed by Pasztor I. et
al., 2009. Briefly, the total COD can be divided into two main fractions: the biodegradable (readily and slowly) and the non-biodegradable (soluble and particulate). Heterotrophic bacteria can consume only the readily biodegradable organic matter estimated as 22% of the total COD and it will be called BSMO (biodegradable soluble organic matter) in this work. Summarizing, the BSMO concentration is decreased in the culture due to the heterotroph's activity and it can be increased due to the cellular death and decay of the microorganisms present in the culture. Regarding the gas fluxes, the inorganic carbon necessary for microalgae growth is partially provided by the on-demand injection of CO₂ for pH control and the natural release of CO₂ given by bacteria during respiration. This study assumes that microalgae are never limited by inorganic carbon concentration, as CO₂ injection always ensures enough carbon availability for microalgal growth, as already demonstrated by previous studies (Posadas et al., 2015). Additionally, experimental data performed into the system indicate that the liquid bulk alkalinity into the medium is never exhausted, preventing the loss of injected CO₂ used for pH control. On the contrary, the O₂ is produced during photosynthesis by microalgae and used by bacteria for their respiration, and it is partially removed from the culture broth due to mass transfer phenomena, mainly aeration into the sump installed on the reactor.

## Main changes implemented from ABACO model

Despite the ABACO model served as the starting point for the development of ABACO-2, significant modifications have been implemented to enhance prediction accuracy and process understanding. Indeed, the ABACO model proposed by Sánchez-zurano et al., 2021, can be considered a preliminary study, conducted with a limited expertise regarding microalgae cultivation phenomena. Furthermore, this model was developed using a restricted dataset and calibrated using data from laboratory-scale experiments conducted under controlled conditions. In contrast, with ABACO-2, the intention is to calibrate parameters under industrial conditions, utilizing a more extensive dataset that encompasses diverse operational and climatic scenarios.

219

220
The foremost modification involved the integration of models to account for cell death and respiration, coupled with the variation in BSMO content within the culture, subsequently reduced by heterotrophic bacterial activity. This refinement also led to a reduction in the number of parameters necessitating calibration. As an additional parameter reduction strategy, it was assumed that phosphate consumption by bacteria is minimal and primarily relevant for microalgae. Consequently, phosphate consumption yields for these microorganisms were excluded from the calibration set. Regarding nutrient yields, equations were introduced to describe the dynamics of nutrient uptake by algae as a function of their concentration in the medium. In this context, process rates were adjusted to consider that NO₃⁻ consumption by algae is significant only when NH₄⁺ levels are substantially reduced. Furthermore, in relation to nutrients, a correction parameter was incorporated into the Monod equations to account for nutrient accumulation by microalgae, preventing zero growth in such scenarios. In the context of refining the calibration process, parameters associated with nutrient consumption by bacteria (originally calibrated) were set and adopted from the Activated Sludge Models (ASM), and an oxygen balance was introduced. The O₂ concentration is a continuous measurement within the reactor and it significantly facilitated parameter recognition during the calibration process. Finally, the parameters of the cardinal temperature equations were adjusted using those proposed by Casagli et al., 2021, as they are more representative, having been calibrated while considering winter seasons.

## 3.2. Model components

This section summarizes the main model components:

* S<sub>NH4</sub> [g·m⁻³]: ammonium. It is present in the influent, and it is consumed especially by microalgae and nitrifying bacteria and in a lower amount by heterotrophic bacteria.

* S<sub>NO3</sub> [g·NO3·m⁻³]: nitrate. This form of nitrogen is generally null in the influent, but it is generated by the nitrifying bacteria during the nitrification process. Nitrate is consumed by microalgae when ammonium concentration in the medium is low.
246 • S<sub>PO4</sub> [g<sub>PO4</sub>•m<sup>-3</sup>]: phosphate. Phosphorus is present as a dissolved component in the water inlet.
247 Its consumption is mainly due to the activity of microalgae, while the uptake from bacteria is
248 considered negligible.

249 • S<sub>BSMO</sub> [g<sub>BSMO</sub>•m<sup>-3</sup>]: biodegradable soluble organic matter. This is a fraction of the total COD,
250 assumed as 22%. It is consumed by heterotrophic bacteria and generated during the cellular
251 decay of both microalgae and bacteria.

252 • S<sub>O2</sub> [g<sub>O2</sub>•m<sup>-3</sup>]: dissolved oxygen. Oxygen is produced by microalgae during photosynthesis and
253 consumed by microalgal respiration and by the activity of both bacterial populations. Moreover,
254 the dissolved oxygen can be stripped to the atmosphere by bubbling air into the reactor sump.

255 • X<sub>alg</sub> [g<sub>alg</sub>•m<sup>-3</sup>]: microalgae biomass. Microalgae proliferate starting from an initial inoculum, thus
256 microalgae biomass is produced by fixing nitrogen and phosphorus, also consuming CO<sub>2</sub> while
257 producing oxygen. Microalgae concentration in the inlet wastewater is considered negligible,
258 while a given amount is harvested every day. Moreover, their growth decreases due to cellular
death.
259

260 • X<sub>nit</sub> [g<sub>nit</sub>•m<sup>-3</sup>]: nitrifying bacteria biomass. Nitrifying bacteria proliferate starting from an initial
261 inoculum by consuming nitrogen in the form of ammonium and releasing nitrate. It is assumed
262 that their concentration entering the system is negligible, while a given concentration is exiting
263 during the harvesting. Moreover, their growth decreases due to cellular death.

264 • X<sub>het</sub> [g<sub>het</sub>•m<sup>-3</sup>]: heterotrophic bacteria biomass. Heterotrophic bacteria proliferate starting from an
265 initial inoculum by consuming the BSMO and nitrogen in the form of ammonium. It is assumed
266 that their concentration entering the system is negligible, while a given concentration is exiting
during the harvesting. Moreover, their growth decreases due to cellular death.
267

268
3.3. Boundary conditions

269
Concentrations must be always positive or equal to zero. This boundary condition can be expressed
270
as in equation (1): when a concentration is approaching zero (assuming ε in the order of 10<sup>-8</sup>), its
271
derivative has to be equal or more than zero, meaning that it cannot generate negative matters.

$$
272 \qquad \text{if } X_i \le \epsilon \rightarrow \dot{X}_i \big|_{X_i=0} \ge 0 \quad (1)
$$
As a result, all the balances implemented for this model have been implemented according to equation (2), guaranteeing the boundary conditions to be satisfied.

$$ \dot{X} = f(x, y) \cdot \frac{X}{X + \varepsilon} \quad (2) $$

### 3.4. Biological processes

Table 1 summarizes the processes taken into consideration of the microalgae and the bacterial growth, while **Error! Reference source not found.** is the relative matrix of the stoichiometric parameters. The mass balances for the microorganism's growth have been built according to equation (3):

$$ \text{Inlet} - \text{Outlet} + \text{Reaction} = \text{Accumulation} \quad (3) $$

where the Inlet and Outlet are the flowrates in [m³·s⁻¹] in and out of the system, generically defined as (4) and (5):

$$ \text{Inlet} = Q_d X_{\text{in}} \quad (4) $$

$$ \text{Outlet} = Q_h X_{\text{out}} \quad (5) $$

where $Q_d$ is the dilution flow rate in [m³·s⁻¹], $Q_h$ is the harvesting flow rate in [m³·s⁻¹], $X_{\text{in}}/X_{\text{out}}$ (or $S_{\text{in}}/S_{\text{out}}$) is the concentration of component inlet or outlet in [g·m⁻³].

The reaction ($r_i$, [g·m⁻³·day⁻¹]) term can be obtained by summing the product of the stoichiometric coefficients, $v_i$ (Table 3) and the process rate, $\rho_j$, as described in (6) (Henze et al., 2000)

$$ r_i = \sum_j v_{i,j} \rho_j \quad (6) $$

In summary, the processes considered in the ABACO-2 model are:

* $\rho_1$: microalgae growth in $NH_4^+$-source, and contemporarily consuming $PO_4^{3+}$ and $CO_2$ while producing $O_2$.
294 • $\rho_2$: microalgae growth in $NO_3^-$ Microalgae grow photosynthetically using $NO_3^-$ as a nutrient source, and contemporarily consuming $PO_4^{3+}$ and $CO_2$ while producing $O_2$. The growth in this nitrogen source is activated only once the medium is decreasing in $NH_4^+$ concentration.

297 • $\rho_3$: microalgae decay. This process includes both the algal biomass loss (decay), increasing the BSMO concentration in the medium, and the algal respiration that leads to a consumption of oxygen all over the entire process.

300 • $\rho_4$: nitrifying bacteria growth. Nitrifying bacteria growth consumes $NH_4^+$ and $O_2$ and produces $NO_3^-$.

302 • $\rho_5$: nitrifying bacteria decay. Bacterial biomass loss due to their decay; it leads to an increase in the BSMO concentration.

304 • $\rho_6$: heterotrophic bacteria growth. Heterotrophic bacteria growth consuming the BSMO, $O_2$ and $NH_4^+$.

306 • $\rho_7$: heterotrophic decay. Bacterial biomass loss due to their decay (it leads to an increase in the BSMO concentration).

### 3.4.1. Photosynthesis and respiration

The growth rate as a function of light was modelled using the equation proposed by Molina (Grima et al., 1994), as described in equation (7), where $I_k$ in [$\mu E \cdot m^{-2} \cdot s^{-1}$] is the irradiance constant that represents the equivalent irradiance necessary to reach half of the maximal growth rate, $n$ is the shape constant and $I_{av}$ is the average light inside the reactor in [$\mu E \cdot m^{-2} \cdot s^{-1}$].

$$ \mu(I_{av}) = \frac{I_{av}^n}{I_k^n + I_{av}^n} \quad (7) $$

The average light inside the culture was expressed following equation (8), and it depends on the incident light $I_0$ [$\mu E \cdot m^{-2} \cdot s^{-1}$], the extinction coefficient $K_a$ [$m^2 \cdot g^{-1}$], the algal biomass concentration ($X_{alg}$) in [$g \cdot m^{-3}$] and the culture depth $h$ [m].

$$ I_{av} = \frac{I_0}{K_a X_{alg} h} (1 - \exp(-K_a X_{alg} h)) \quad (8) $$
Moreover, the average light was used to express the microalgal endogenous respiration as given by equation (9); where $m_{max}$ and $m_{min}$ are the maximum and the minimum respiration in [day$^{-1}$], $I_{kr}$ is the irradiance necessary to stop photosynthesis and let begin the respiration and $n_r$ is the shape form for respiration.

$$m_{alg} = m_{min} + \frac{m_{max} I_{av}^{n_r}}{I_{kr}^{n_r} + I_{av}^{n_r}} \quad (9)$$

Finally, bacterial decay has been taken into consideration as a constant effect during the cultivation process. $m_{nit}$ and $m_{het}$ [day$^{-1}$] have been modelled as a percentage of the maximum growth rate (as summarized in Table 4) corrected by a coefficient dependent on the temperature $\theta$, as described in equation (10).

$$\theta = \theta_i(T - 20^{\circ}C) \quad (10)$$

Where $\theta_i$ are specific parameters that depend on the bacterial population considered (Table 3).

### 3.4.2. Influence of pH, temperature, dissolved oxygen and nutrients

As described in Table 1, for each microorganism, the growth rate depends on a maximum specific growth rate $\mu$ value multiplied by a series of normalized factors that depends on the culture conditions of temperature, pH, $O_2$ and nutrient concentration. The growth rates of microalgae exhibit a bell-shaped function in response to temperature and pH. Initially, as temperature (or pH) increases from low values, the growth rate rapidly increases until it reaches its maximum, corresponding to the optimal parameter value. However, beyond the optimum, the growth rate decreases sharply with further increases in temperature (or pH). The minimum, maximum, and optimal values of these parameters can be determined through laboratory measurements using the photo-respirometric method, and the summarized values are in Table 4. It is possible to observe that bacteria parameters differ from one of the microalgae since their growth is favoured by higher values of both temperature and pH. The growth dependence can be described through a cardinal equation with inflexion, developed for the first time by Bernard et alt. (Bernard and Rémond, 2012) (11). Similarly, the model proposed by Ippoliti et al. was used to describe the pH dependence (Ippoliti et al., 2016) (12).
343

$$ \overline{\mu(T)} = \frac{(T - T_{max})(T - T_{min})^2}{(T_{opt} - T_{min})[(T_{opt} - T_{min})(T - T_{opt}) - (T_{opt} - T_{max})(T_{opt} + T_{min} - 2T)]} \quad (11) $$

344

$$ \overline{\mu(pH)} = \frac{(pH - pH_{min})(pH - pH_{max})^2}{(pH_{opt} - pH_{min})[(pH_{opt} - pH_{min})(pH - pH_{opt}) - (pH_{opt} - pH_{max})(pH_{opt} + pH_{min} - 2pH)]} \quad (12) $$

345

346

347

348

349

350

Regarding the effect of dissolved oxygen, it is known that high concentrations are inhibitory for microalgal photosynthesis. According to previous studies on *Scenedemsus sp.*, the growth rate can be reduced by 25% when the concentration is increased up to 150% Sat, while below 250% Sat the photosynthesis is completely stopped. This effect was modelled using the equation proposed by Costache et al., 2013 and reported in equation (13). On the contrary, oxygen has been modelled as a nutrient source for bacteria growth, as described below.

351

$$ \overline{\mu(O_2)_{alg}} = 1 - \left( \frac{S_{O_2}}{S_{O_2,max}} \right)^z \quad (13) $$

352

353

354

355

356

357

358

359

360

361

362

363

Finally, the influence of nutrient concentration on the growth rate was taken into account. As mentioned, nitrogen is a fundamental macronutrient that must be provided to microalgae to ensure their growth. The inorganic nitrogen can be assimilated into acids for the protein formations in many forms, such as $NH_4^+$, $NO_2^-$ and $NO_3^-$.

However, in this study, the main nitrogen form present in wastewater was ammonium, while nitrate was formed only after the complete nitrification process.

Ammonium is the favoured nitrogen form for microalgae as it requires less energy to be assimilated.

Only after a given concentration threshold do microalgae begin to consume $NO_3^-$, which will be transformed into $NH_4^+$ to be assimilated into the cells. Phosphate is another fundamental macronutrient for microalgal growth, as it is necessary for the synthesis of RNA into the nucleotides, while it is assumed that this component is not consumed by bacteria. The growth rate as a function of the substrate concentration, has been modelled using the Monod equation, as described in (14), (Monod, 1949)

364

$$ \overline{\mu(S_i)} = \frac{S_i}{S_i + K_s} \quad (14) $$

365

366

The Monod equations for the nitrogen and the phosphorus for the process n.1 and 2 in **Error! Reference source not found.** have been modified by the inclusion of a correction factor. With this
modification, zero-growth when no longer nitrogen/phosphate are present in the medium was avoided. Indeed, it is already known that microalgae can store nutrients in cells guaranteeing their survival and growth even when the medium is limited in nutrients. This fact can be represented by more complex models such as the Droop model (Droop, 1970), which considers the cells quota of the limiting element. However, quotas are difficult to be estimated as they required specific laboratory techniques. For this reason, in this work, a simplified description of this phenomenon was chosen by correcting the concentrations in the Monod equation as the sum of the component available in the medium and the one present in the algal biomass (equal to 10% in nitrogen and 2% in phosphorus, multiplied by the "assimilation" factor α) (14), (15).

$$S_N = S_{N,medium} + X_{alg} * 0.1 * \alpha \quad (15)$$

$$S_p = S_{p,medium} + X_{alg} * 0.02 * \alpha \quad (16)$$

The kinetic parameters used for the Monod equation are summarized in Table 3.

### 3.4.3. Nutrient yields

Nutrient yield can be defined as the amount of nutrients consumed from the medium per gram of biomass produced. In the literature, it can be found that the nutrient yield for algae is not constant, but changes depending on the nutrient amount present in the medium. More specifically, it was found that the nutrient uptake rate is higher at lower nutrient concentrations until it is reached a maximum. This can be explained by some biological mechanisms like the "luxury uptake" (Solovchenko et al., 2019): microalgae store a larger amount of nutrients than the ones necessary for immediate growth. It is possible to suppose that nutrients yield not only depends on the nutrient concentrations in the medium but even on environmental conditions and process parameters. However, modelling this phenomenon is complex, and in the literature can be found different results that mainly depend on the strain used and the type of experiment performed. The equations developed by Zurano et al., 2021 were taken as a good approximation of ammonium and phosphorus consumption rates by microalgae, as described in equation (17), where S is the substrate consumed by microalgae ($NH_4^+$, $NO_3^-$ or $PO_4^{3-}$). It is possible to observe that the equations are the combination of a Monod equation
together with a Cardinal limited by a maximum value; the equation parameters are summarized in Table 5.

$$ Y_{s,alg} = \left[ \frac{Y_{max} S^{t_s}}{S_N^{t_s} K_{s,Y_s}^{t_s}} \right] + \left[ \frac{(S - S_{max}) (S - S_{min})^2}{(S_{opt} - S_{min}) \left( \left( (S_{opt} - S_{min})(S_N - S_{opt}) \right) - \left( (S_{opt} - S_{max})(S_{opt} + S_{min} - 2S) \right) \right)} \right] \quad (17) $$

Regarding the nutrient yield of bacteria, the ones proposed by the ASM models (Henze et al., 2000) were considered a good approximation, and they are summarized in Table 3.

### 3.4.4. Dissolved oxygen

During the day, microalgae produce oxygen through photosynthesis, which is partially consumed for algal and bacteria respiration. At the same time, dissolved oxygen can be desorbed to the atmosphere according to two different phenomena: (i) natural mass transfer from the culture to the atmosphere in the reactor channels and paddlewheel; (ii) oxygen release and consecutive reduction of the culture dissolved oxygen thanks to the bubbling of air in the reactor sump. The two phenomena are represented by two different mass transfer coefficients $K_{la}$ (equal to 1.0 and 110 $h^{-1}$ respectively) and Henry law as described in (18):

$$ m_{O_2} = K_{la} (H_{O_2} P_{O_2} - S_{O_2}) \quad (18) $$

## 4. Model parameters

### 4.1. Calibration procedure

Figure 2 represents the calibration strategy adopted. The experimental dataset used to calibrate the model parameters was selected to include data from different seasons, such as summer, winter, and intermediate seasons (28/04-15/05, 9/08-15/08, 1/11-15/11). In total, the calibration days chosen were 41 (20% of the total amount of data). In this way, it was possible to address the parameters by accounting for various climatic conditions. The final set of parameters was chosen once the objective function described in (19) was minimized.

$$ Obj = \sum \frac{\sum (y_{sim} - y_{exp})^2}{\sigma_{exp}} \quad (19) $$
where $y_{sim}$ is the model output, $y_{exp}$ the experimental data and $\sigma_{exp}$ is the experimental data standard deviation. The experimental data used for the model calibration regarded $X_{tot}$, $S_{NH4}$, $S_{PO4}$, $S_{NO3}$, $S_{BSMO}$, $S_{O2}$ where $X_{tot}$ was defined as the sum of $X_{alg}$, $X_{nit}$ and $X_{het}$ and evaluated experimentally as the total dry weight. The model calibration was carried out using Scipy library in Python and “Nelder-Mead” algorithm which is a robust algorithm mainly used for solving unconstrained optimization problems (Gao and Han, 2012). The list of calibrated parameters with their corresponding values is presented in Table 6.

## 4.2. Sensitivity analysis

Table 7 presents the findings of a sensitivity analysis that examined all biological and process parameters together with the associated standard deviation. In this analysis, each parameter was individually varied by +/-20% from its nominal value, and the percentage error (20) between the nominal parameter value ($y_{nom}$) and the varied parameter value ($y_{var}$) was evaluated.

$$ \% err = \frac{\sum |y_{nom} - y_{var}|}{\sum y_{var}} * 100 \quad (20) $$

Results indicate that the most sensible parameters are the ones for microalgae growth rate as a function of light ($I_{av}$, $K_a$, n), the maximum growth rates of all the organisms ($\mu_{max,alg}$, $\mu_{max,nit}$, $\mu_{max,het}$) and the nutrient yield of $NH_4^+$ and $NO_3^-$ ($Y_{NH4,alg}$, $Y_{NO3,nit}$, $Y_{NH4,nit}$). Additionally, the cardinal parameters ($T_{max}$, $T_{min}$, $T_{opt}$) of temperature and pH ($pH_{max}$, $pH_{min}$, $pH_{opt}$) show to be highly sensitive. Given their significant impact on the final prediction, these parameters should be carefully selected based on the biological system analysed and the climatic conditions. Notably, only a few of the nutrient yields were deemed relevant to model error.

## 4.3. Parameters uncertainty and error propagation

Once the most sensible parameters have been identified, it was possible to calculate the model variance and the confidence interval (Denis Dochain, 2001). From the sensitivity analysis, it was
possible to define a sensitivity matrix as (21), which collects the functions of the given output y by
440
441
varying the parameter pᵢ.

$$
442
S = \left[ \frac{\delta y}{\delta p_1} ; \frac{\delta y}{\delta p_2} ; \dots ; \frac{\delta y}{\delta p_j} \right] \quad (21)
$$

The standard deviation of the parameter can be calculated as (22), where C<sub>ij</sub> is the covariance matrix
and p<sub>j</sub> is the associated parameter:
443
444

$$
445
\vartheta_j^2 = p_j \sqrt{C_{j,j}} \quad (22)
$$

The covariance matrix is the inverse of the Fisher information matrix (23), defined as the variance of
the score function (Fujita et al., n.d.).
446
447

$$
448
F = C^{-1} \quad (23)
$$

And it can be calculated starting from the sensitivity analysis according to (24):
449

$$
450
F = S^T Q^{-1} S \quad (24)
$$

where Q is the array of the measured standard deviation.

Once the covariance of the parameter has been evaluated, it was possible to estimate the model
error propagation of the output variable y at the given instant time t as (25):
452
453

$$
454
\sigma_y(t) = \sqrt{\sum_{i=1}^{m} S_i(t)^2 \vartheta_{p_i}^2} \quad (25)
$$

The model confidence interval at 95% has been calculated on the model output as (26):
455

$$
456
[y_i - 1.95\sigma_y ; y_i + 1.95\sigma_y] \quad (26)
$$

5. Model validation

The model prediction accuracy has been evaluated by calculating the normalized squared root error
(NRMSE) and Theil's inequality coefficient (TIC) (H. Theil. et al., 1959), as described in (26), (27).
Results are reported in Table 8, it is important to note that when the TIC is lower than 0.3, it is
458
459
460
possible to consider a good agreement between the experimental data and the model predictions.

Additionally, Figure 3 to Figure 5 represent the model estimation and the respective experimental data, as described in the next session.

$$NRMSE = \frac{\sqrt{\sum(y_{sim} - y_{exp})^2}}{(y_{exp,max} - y_{exp,min})} \quad (26)$$

$$TIC = \frac{\sqrt{\sum(y_{sim} - y_{exp})^2}}{\sum y_{sim}^2 + \sum y_{exp}^2} \quad (27)$$

Overall, it is possible to affirm that the model can accurately reproduce the biological system. The ABACO-2 model is remarkably accurate for describing the total biomass concentration and the nutrient concentration evolution (NRMSE between 0.14 and 0.23, TIC between 0.16 and 0.24). Additionally, the model accurately can trace the dissolved oxygen in the culture (NRMSE= 0.14, TIC=0.21).

# 6. Discussion

## 6.1. Simulation results

Although microalgae-bacteria consortia are considered a promising technology for wastewater treatment, they still address several challenges. An accurate microalgae-bacteria model is a powerful tool to overcome the bottlenecks of this technology (Aparicio et al., 2023). The ABACO-2 model aims to act as a tool for robust and accurate prediction of the evolution of biomass concentration in a microalgae-bacteria system, and, therefore, to differentiate between the evolution of both populations in the face of operational and environmental conditions. Figure 3A represents the evolution of the total biomass concentration from 15th May to 15th November. The dots represent the experimental data while the model is shown with a solid line, and the shading is the model confidence interval at 95%. Total biomass is the sum of the contributions of algae and bacteria that can be approximated to the biomass experimentally evaluated through the dry weight method. The results showed that the model reproduces the trend of the experimental data, with a NRMSE=0.21 and TIC=0.16 (Table 8). The concentration of heterotrophic and nitrifying bacteria over the study
period is shown in Figure 3B. According to the simulations, heterotrophic bacteria exhibit higher
concentrations than nitrifying bacteria as they vary between 0 and 80 g\_het\cdot m\^{-3}, whereas nitrifying
bacteria range from 0 to 10 g\_nit\cdot m\^{-3}. Regarding heterotrophic bacteria, the strong fluctuations
observed could be explained by the large variability in the COD concentration in the influent (100 –
600 gO₂\cdot m\^{-3}). This variability arises from the use of two different types of water sources, one from
the University and the other from the city, with the latter typically containing a higher organic matter
content. The concentration over the months of the nitrifying bacteria was lower, considering their
slower maximum growth rate compared to the one of heterotrophic bacteria. Results show that the
concentration of nitrifying bacteria increased from October to November. This increase may be due
to a reduction in the aeration rate in this specific period, which decreased from 200 L\cdot min\^{-1} (set-point
in normal operations) to 50 L\cdot min\^{-1}. During that months, the dissolved oxygen concentration
increased in the culture, as the aeration was insufficient to remove it efficiently. Previous studies
have shown that dissolved oxygen concentration strongly influences the growth of microalgae, as it
has an inhibitory effect on photosynthetic activity (Rossi et al., 2020a). Thus, by decreasing the
concentration of microalgae, nitrifying activity is favoured, as both populations compete for the N-
NH₄⁺ present in the medium. Previous authors suggested that competition for N-NH₄⁺ is the most
frequently negative interaction between microalgae and AOB (Aparicio et al., 2022b). The microalgal
biomass concentration is represented in Figure 3C. Algal productivity is primarily influenced by
variations in light and temperature throughout the seasons (Muñoz and Bernard, 2021). During
spring, the biomass concentration is approximately 0.7 g\_alg\cdot L\^{-1}, while in summer it can reach higher
values of up to 1.5 g\_alg\cdot L\^{-1}. However, during the colder seasons, it decreases to 0.3 g\_alg\cdot L\^{-1}. Overall,
the model effectively captures the evolution of biomass concentration, highlighting the prevalence of
algae biomass compared to bacterial biomass within the culture. Although there is a lack of
experimental data on bacterial concentration, this outcome remains reasonable, supported by
analysis conducted in previous studies on similar systems (Sánchez Zurano et al., 2020).

Figure 4 represents the PO₄³⁻·NO₃⁻, NH₄⁺ and BSMO concentration in g·m⁻³ respectively. In Figure 4A it is shown that the phosphate concentration in the culture can vary between 10 and 60 g·PO₄·m⁻³.

The uptake of this component depends only on the activity of microalgae, given that the influence of
bacteria can be considered negligible. In previous studies, it has been demonstrated that the consumption of phosphate is efficient, but not sufficient to lower it to a concentration below the minimum required for the wastewater discharge (Nordio et al., 2023). Figure 4B represents the $NO_3^-$ concentration, that remained constant from May to October, however, from October to November, it was observed an increase in the $NO_3^-$ concentration, mainly generated during the nitrification process by nitrifiers. The concentration of this compound can vary greatly (between 0 and 300 $g_{NO3} \cdot m^{-3}$) depending on the activity of the nitrifying bacteria, which, as already explained, was enhanced at the end of the study. Nitrate increase and accumulation in the system can be considered one of the main challenges in microalgae-bacteria-based systems. A decrease in microalgae activity leads to an increase in nitrifying activity, which results in the accumulation of nitrate in the medium. The nitrate generated must be consumed by the microalgae. However, as long as ammonium is available in the medium, it will not be consumed or will be consumed slowly, in breach of discharge regulations. Therefore, ensuring correct microalgae activity is essential to achieve treated water at the end of the process. Regarding the organic matter, its degradation is due to the activity of the heterotrophic bacteria and it can be present with a concentration of up to 250 $g_{O2} \cdot m^{-3}$ in the culture (Figure 4C). Finally, in Figure 4D there is the evolution of the ammonium concentration. It is possible to observe that, despite the high $NH_4^+$ concentration entering the system with the wastewater, in the outlet its concentration is mostly lower than 60 $g_{NH4} \cdot m^{-3}$, meaning that microalgae and nitrifiers can uptake this nutrient with a high efficiency. The peak generated by the simulation is mainly due to the high concentration of this compound entering the system during the dilution/harvesting process at a specific time of the day.

Concluding, Figure 5 represents the simulation of the dissolved oxygen in the culture. Specifically, Figure 5A shows the experimental and simulated values of dissolved oxygen concentration along the entire study period, while Figure 5B shows the representation of the dissolved oxygen concentration in a shorter period. The concentration of dissolved oxygen can reach a high concentration during the day due to the microalgal photosynthesis (up to 25 $mg_{O2} \cdot L^{-1}$), while it decreases to anoxic conditions during the night due to the couple effect the algae and bacteria respiration.
The results obtained show that the evolution of nutrients in the system together with the simulated biomass concentration agree with those obtained in the experimental data, demonstrating the usefulness of ABACO-2 in microalgae-based systems for wastewater treatment, and its potential on an industrial scale.

## 6.2. Case study: evaluating microalgae-bacteria consortia as function of the operational conditions

Studying the populations living in wastewater systems treated with microalgae poses a significant challenge, primarily because there are no fully validated protocols to effectively differentiate between bacterial and microalgal communities. The primary method for assessing biomass in raceway reactors is dry weight, encompassing contributions from both algae and bacteria. Separating them remains challenging yet significant, as their ratios impact various process outcomes, such as biomass quality and water remediation efficiency. Some methods, like successive filtrations based on cell size differences, have been explored, though they often result in a notable presence of bacteria clinging to microalgae due to cell aggregation (Sánchez-Zurano et al., 2020). Alternative methods, including flow cytometry techniques (FCM), prove valuable in assessing the relative composition of mixed microorganism populations, encompassing both prokaryotes and eukaryotes. This approach discriminates between groups by analyzing intrinsic characteristics of individual cells, such as size, complexity, and autofluorescence. Additionally, molecular identification techniques like amplification of 16S and 18S rDNA sequences serve to evaluate microbial community structure (Barreiro-Vescovo et al., 2021). Alongside these methods, photo-respirometry, based on traditional respirometry, has been employed to discern population differences (Rossi et al., 2018). However, these methods lack a direct correlation in biomass concentration (g·L⁻¹), which is more straightforward to interpret.

In this context, mathematical models offer a useful tool of indirectly study how the balance between populations evolves. Operational conditions, notably cultivation height, dilution/harvesting strategy, and oxygen removal capacity, exhibit a substantial influence. This section presents a case study employing the ABACO-2 model to assess how the proportion between algae and bacteria shifts
based on the operational conditions. Simulations have been carried out using the same solar radiation and temperature registered for the validation of the model. On the contrary, the inlet values of nutrient concentration have been maintained constant (as an average values measured in the wastewater medium) in order to avoid their influence in the evaluation of the process conditions (180 $mg·L^{-1} NH_4^+$, 30 $mg·L^{-1} PO_4^{3-}$, 80 $mg·L^{-1} BSMO$, 3.4 $mg·L^{-1} NO_3^-$).

### Culture height

The cultivation height is one of the fundamental parameters to consider when operating raceway-type reactors as it significantly influences the penetrative capacity of light within the cultivation. It has been demonstrated that light reaches the cells only in the first three centimeters of culture, while the rest remains in a state of darkness due to an effect of autoshading, and, therefore, photosynthetically inactive. Furthermore, light penetration depends on other factors, such as the extinction coefficient ($K_a$), which can vary from cultivation to cultivation and depends on the property of microalgae to scatter the received light (Barceló-Villalobos et al., 2019).

In general, facilities that aim to treat large quantities of water prefer to operate at a rather high culture height, around 30 cm. However, this could be a disadvantage in terms of producing high-quality biomass, as the dark zone favors the growth of bacterial populations over phototrophic ones. Figure 6 A,B and C show the populations varying with cultivation height among the seasons (summer, spring and autumn). As expected, at 8 cm, the algal productivity is favored at the expense of the amount of treated water, with the maximum concentration reached in spring as it is the period when the maximum irradiance is reached (Figure 6A). The possibility of being able to increase productivity by reducing the culture height has already been studied through the development of new reactors called "thin layers" that operate at around 2 cm; they have also been tested for treating wastewater in previous studies (Morillas-España et al., 2021a). On the contrary, microalgal concentration decreases as much as the culture height increases, mitigating the effects related to the different seasons, in favour of the proliferation of the bacterial population (Figure 6B,C). This is particularly evident in the case of nitrifiers. An increased water depth and greater availability of ammonium, owing to a reduced uptake capacity by microalgae, enable an increase in their activity. Previous
works demonstrated that the depth of the culture has a striking effect on the composition of the microalgae-bacteria consortia, specially in relative abundance of nitrifiers (Figure 6C). Remarkably, at an 8 cm depth where algae activity is more significant, ammonium consumption mainly occurs within the algae population, resulting in minimal involvement of nitrifying bacteria. Conversely, variations in cultivation height appear to have little effect on the concentration of heterotrophic bacteria (Figure 6B). This is because they do not compete with microalgae for nutrient uptake like nitrifying bacteria; their primary substrate is organic carbon.

In conclusion, the choice of the optimal culture height is of relevance and its regulation mainly depend on the specific goals of the remediation process. These goals may involve achieving high-quality, productive biomass or ensuring efficient water treatment on a larger scale. While a lower culture height is generally recommended to facilitate light penetration, further studies should be carried to avoid heat accumulation and the cellular death. Moreover, it's essential to recognize that significantly increasing the culture depth could enhance the activity of nitrifying bacteria and lead to the accumulation of NO₃⁻ within the reactor. Based on the outcomes of this simulation study, a culture height of 15 cm appears as a good compromise between treated water quantity, productivity, and balance between algal and bacterial populations.

### Dilution/harvesting rate

The harvesting/dilution factor plays a crucial role in microalgae industrial production. When deciding on the best approach to adopt, key considerations include the optimal dilution rate and its application method - whether through continuous or semi-continuous mode. In the first case, dilution occurs gradually over the 12 hours of daylight, while in the latter, both dilution and harvesting take place at specific moments of the day. Figure 6 D, E and F illustrate how varying the dilution rate can impact the productivity and composition of algal-bacterial populations, assuming to operate the reactor in a semi-continuous mode. The optimal dilution rates for algae range between 0.15 to 0.2 day⁻¹, exceeding these rates leads to a significant decrease in productivity (Figure 6D). This finding is consistent with previous research in similar raceway reactors, which suggested a fixed optimal dilution rate of 0.2 day⁻¹ throughout the year (Morillas-España et al., 2020). Concerning the bacterial
622 population, it is evident that nitrifying activity decreases significantly beyond a dilution rate of 0.2 day⁻¹.
623 This phenomenon, known as "culture washout," indicates that the growth rate of nitrifying bacteria
624 lags behind the dilution rate, potentially affecting process effectiveness (Figure 6F). Conversely, a
625 contrasting positive impact is observed on heterotrophic bacteria with increased dilution rates (Figure
626 6E). This could be attributed to their rapid growth rate and the enhanced organic matter influx,
627 promoting proliferation.

628 In summary, the simulations presented in this study underscore the critical importance of selecting
629 the optimal dilution factor for the efficient operation of raceway reactors. Traditionally, dilution factors
630 are determined experimentally through batchs, which establish the maximum growth rate and
631 consequently the dilution rate. Alternatively, some studies have suggested comparing reactors at
632 different dilutions operated in parallel. While these methods are effective, they can be laborious and
633 time-consuming. Furthermore, conventional laboratory techniques primarily evaluate productivity in
634 terms of dry weight without delving into the dynamics of the populations involved. Therefore, our
635 research demonstrates that a simulation-based approach offers a viable alternative for identifying
636 the most effective dilution and harvesting strategies.

637 **Air desorption**

638 The concentration of oxygen in a microalgae culture is crucial in biological systems. When oxygen
639 levels surpass air saturation, they can induce inhibitory effects due to the diffusion of dissolved
640 oxygen through microalgae membranes, resulting in oxidative stress on the cells. This inhibitory
641 impact becomes more pronounced with prolonged exposure to elevated oxygen levels (Antonino
642 Baez and Joseph Shiloach, 2014). Microalgae, as photosynthetic organisms, generate oxygen while
643 consuming carbon dioxide, leading to its accumulation in the culture. Studies, such as the one
644 conducted by Rossi et al. in 2020, have shown that excessive oxygen accumulation in cultures can
645 hinder microalgal cell growth (Rossi et al., 2020b). However, there is a scarcity of research assessing
646 how oxygen levels actually influence productivity on a large scale. The prevailing assumption is that
647 oxygen is naturally removed through channels or within the paddlewheel zone. Nonetheless, our
experimental data presented herein emphasize the necessity of air injection to reduce oxygen levels in the reactor.

Figure 6G, H, and I illustrate the simulation results in scenarios both without air injection and with a Kla equal to 110 $h^{-1}$. Once again, it is evident that forced air input is advantageous in promoting algal population production compared to bacterial populations (Figure 6G). Specifically, when air is not removed, microalgal concentration drastically decreases by 65%, underscoring the significance of air injection in the reactor to lower dissolved oxygen levels. Concerning the bacteria, it's notable that air injection predominantly affects nitrifying population, with heterotrophic ones being less affected. Heterotrophic batteries exhibit a slight decrease in concentration when air isn't injected. Conversely, nitrifying batteries show significant growth when oxygen isn't removed from the reactor using compressed air. These results align with the model validation discussed earlier and may offer an explanation for occasional $NO_3^-$ accumulations in cultures. As previously explained, validation data indicated increased nitrification activity when air injection was reduced from 200 $L min^{-1}$ to 50 $L min^{-1}$, unfavoring algal growth but favoring nitrification. These simulations confirm this trend, although further experimental studies are needed for confirmation.

In conclusion, these simulations reaffirm the critical significance of oxygen removal from the reactor, not only for enhancing productivity but also for ensuring effective water remediation.

## Conclusions

ABACO-2 is a comprehensive model for microalgae-bacteria consortia in wastewater systems. The model was calibrated and validated in a pilot-scale wastewater treatment reactor, exposed to environmental changes and fed with real urban wastewater (with daily changes in the concentration of nitrogen, phosphorus and organic matter), over a long period (May-November). The model allowed to predict the biomass, dissolved oxygen and nutrient concentration evolution with high accuracy. Overall, the use of the ABACO-2 model's relative simplicity allows for good predictions while offering advantages in terms of understanding, practicality, efficiency, and versatility. Concluding, the ABACO-2 model can be considered a useful biological model for the description of algae-bacteria in wastewater systems. In order to increase the robustness, in the future it will be
necessary to carry out additional validation studies in several data set (accounting for different climatologies and wastewater types) and in higher industrial scales.

## Credit authorship contribution statement

**R. Nordio:** Investigation, Formal Analysis, Validation, Software, Data Curation, Visualization, Writing – Original Draft; **E. Rodríguez-Miranda:** Investigation, Formal Analysis, Validation, Software, Data Curation, Writing – Original Draft; **F. Casagli:** Formal analysis, Validation; **A. Sanchez-Zurano:** Investigation, Writing – Original Draft; **J. L. Guzmán:** Conceptualization, Supervision, Writing – Review & Editing, Funding Acquisition; **G. Acien:** Conceptualization, Supervision, Writing – Review & Editing, Funding Acquisition.

## Acknowledgements

This research was funded by the H2020 Research and Innovation Programme under the Marie Skłodowska-Curie grant agreement (project: Digitalgaesation, 955520) and by the H2020 Research and Innovation Framework Programme (projects: PRODIGIO, 101007006; REALM, 101060991).
Also, this work was supported by the Spanish Ministry of Science and Innovation (project: HYCO2BIO, PID2020-112709RB-C21). All the authors would like to thank the Institute for Agricultural and Fisheries Research and Training (IFAPA).

## References

692 Abdel-Raouf, N., Al-Homaidan, A.A., Ibraheem, I.B.M., 2012. Microalgae and wastewater treatment. Saudi J Biol Sci. https://doi.org/10.1016/j.sjbs.2012.04.005

694 Acién, F.G., Ferná Ndez, J.M., Molina-Grima, E., 2014. Economics of Microalgae Biomass Production.

695 Angelakis, A.N., Gikas, P., 2014. Water reuse: Overview of current practices and trends in the world with emphasis on EU states, Water Utility Journal.

697 Antonino Baez, Joseph Shiloach, 2014. Effect of elevated oxygen concentration on bacteria, yeasts, and cells propagated for production of biological compounds. Microb Cell Fact 13.

699 Aparicio, S., González-Camejo, J., Seco, A., Borrás, L., Robles, Á., Ferrer, J., 2023. Integrated microalgae-bacteria modelling: application to an outdoor membrane photobioreactor (MPBR). Science of the Total Environment 884. https://doi.org/10.1016/j.scitotenv.2023.163669

702 Aparicio, S., Robles, Á., Ferrer, J., Seco, A., Borrás Falomir, L., 2022a. Assessing and modeling nitrite inhibition in microalgae-bacteria consortia for wastewater treatment by means of photo-
704 respirometric and chlorophyll fluorescence techniques. Science of the Total Environment 808.

705 https://doi.org/10.1016/j.scitotenv.2021.152128

706 Aparicio, S., Robles, Á., Ferrer, J., Seco, A., Borrás Falomir, L., 2022b. Assessing and modeling nitrite

707 inhibition in microalgae-bacteria consortia for wastewater treatment by means of photo-

708 respirometric and chlorophyll fluorescence techniques. Science of the Total Environment 808.

709 https://doi.org/10.1016/j.scitotenv.2021.152128

710 Barceló-Villalobos, M., Fernández-del Olmo, P., Guzmán, J.L., Fernández-Sevilla, J.M., Acién Fernández, F.G.,

711 2019. Evaluation of photosynthetic light integration by microalgae in a pilot-scale raceway reactor.

712 Bioresour Technol 280, 404-411. https://doi.org/10.1016/j.biortech.2019.02.032

713 Barreiro-Vescovo, S., González-Fernández, C., de Godos, I., 2021. Characterization of communities in a

714 microalgae-bacteria system treating domestic wastewater reveals dominance of phototrophic and

715 pigmented bacteria. Algal Res 59. https://doi.org/10.1016/j.algal.2021.102447

716 Bernard, O., Rémond, B., 2012. Validation of a simple model accounting for light and temperature effect on

717 microalgal growth. Bioresour Technol 123, 520-527. https://doi.org/10.1016/j.biortech.2012.07.022

718 Buhr, H., O., Miller, S., B., 1983. A dynamic model of the high-rate algal-bacterial wastewater treatment

719 pond. Water Research 17, 29-37.

720 Casagli, F., Zuccaro, G., Bernard, O., Steyer, J.P., Ficara, E., 2021. ALBA: A comprehensive growth model to

721 optimize algae-bacteria wastewater treatment in raceway ponds. Water Res 190.

722 https://doi.org/10.1016/j.watres.2020.116734

723 Costache, T.A., Gabriel Acien Fernandez, F., Morales, M.M., Fernández-Sevilla, J.M., Stamatin, I., Molina, E.,

724 2013. Comprehensive model of microalgae photosynthesis rate as a function of culture conditions in

725 photobioreactors. Appl Microbiol Biotechnol 97, 7627-7637. https://doi.org/10.1007/s00253-013-

726 5035-2

727 Council Directive of May 1991 concerning urban waste water treatment, 1991.

728 Darvehei, P., Bahri, P.A., Moheimani, N.R., 2018. Model development for the growth of microalgae: A

729 review. Renewable and Sustainable Energy Reviews. https://doi.org/10.1016/j.rser.2018.08.027

730 Denis Dochain, 2001. Bioproceeds control, in: Denis Dochain (Ed.), Wiley-ISTE Series, pp. 52-56.

731 Droop, M.R., 1970. Vitamin B 12 and marine ecology. Continuous culture as an approach to nutritional

732 kinetics. Journal of the Marine Biological Association of the United Kingdom 48, 629-636.

733 Fernández Sevilla, J.M., Molina Grima, E., Perez Parra, J., Acién Fernández, F.G., Magán Cañadas, J.J., Friedi,

734 T., 2006. New species of microalgae and its application for animal and human consumption and in the

735 production of carotenoids. WO 2006/087405.

736 Fujita, K., Okada, K., Katahira, K., n.d. The Fisher information matrix: A tutorial for calculation for decision

737 making models.

738 Gao, F., Han, L., 2012. Implementing the Nelder-Mead simplex algorithm with adaptive parameters.

739 Comput Optim Appl 51, 259-277. https://doi.org/10.1007/s10589-010-9329-3

740 Grima, E.M., Camacho, F.G., Pérez, J.A.S., Sevilla, J.M.F., Fernández, F.G.A., Gómez, A.C., 1994. A

741 mathematical model of microalgal growth in light-limited chemostat culture. Journal of Chemical

742 Technology & Biotechnology 61, 167-173. https://doi.org/10.1002/jctb.280610212
743 Grivalský, T., Ranglová, K., da Câmara Manoel, J.A., Lakatos, G.E., Lhotský, R., Masojídek, J., 2019.

744 Development of thin-layer cascades for microalgae cultivation: milestones (review). Folia Microbiol

745 (Praha). https://doi.org/10.1007/s12223-019-00739-7

746 Henze, Mogens., Gujer, Willi., Mino, Takashi., Van Loosdrecht, Mark., 2000. Activated sludge models ASM1,

747 ASM2, ASM2d and ASM3. IWA Pub.

748 Ippoliti, D., Gómez, C., del Mar Morales-Amaral, M., Pistocchi, R., Fernández-Sevilla, J.M., Acién, F.G., 2016.

749 Modeling of photosynthesis and respiration rate for Isochrysis galbana (T-Iso) and its influence on the

750 production of this strain. Bioresour Technol 203, 71-79.

751 https://doi.org/10.1016/j.biortech.2015.12.050

752 Lee, E., Jalalizadeh, M., Zhang, Q., 2015. Growth kinetic models for microalgae cultivation: A review. Algal

753 Res. https://doi.org/10.1016/j.algal.2015.10.004

754 Masojídek, J., Gómez-Serrano, C., Ranglová, K., Cicchi, B., Encinas Bogeat, Á., Câmara Manoel, J.A., Sanches

755 Zurano, A., Silva Benavides, A.M., Barceló-Villalobos, M., Robles Carnero, V.A., Ördög, V., Gómez

756 Pinchetti, J.L., Vörös, L., Arbib, Z., Rogalla, F., Torzillo, G., Lopez Figueroa, F., Acién-Fernándéz, F.G.,

757 2022. Photosynthesis Monitoring in Microalgae Cultures Grown on Municipal Wastewater as a

758 Nutrient Source in Large-Scale Outdoor Bioreactors. Biology (Basel) 11.

759 https://doi.org/10.3390/biology11101380

760 Mohd Udaiyappan, A.F., Abu Hasan, H., Takriff, M.S., Sheikh Abdullah, S.R., 2017. A review of the

761 potentials, challenges and current status of microalgae biomass applications in industrial wastewater

762 treatment. Journal of Water Process Engineering. https://doi.org/10.1016/j.jwpe.2017.09.006

763 Monod, J., 1949. THE GROWTH OF BACTERIAL CULTURES.

764 Morillas-España, A., Lafarga, T., Acién-Fernández, F.G., Gómez-Serrano, C., González-López, C.V., 2021a.

765 Annual production of microalgae in wastewater using pilot-scale thin-layer cascade photobioreactors.

766 J Appl Phycol 33, 3861-3871. https://doi.org/10.1007/s10811-021-02565-2

767 Morillas-España, A., Lafarga, T., Gómez-Serrano, C., Acién-Fernández, F.G., González-López, C.V., 2020.

768 Year-long production of Scenedesmus almeriensis in pilot-scale raceway and thin-layer cascade

769 photobioreactors. Algal Res 51. https://doi.org/10.1016/j.algal.2020.102069

770 Morillas-España, A., Lafarga, T., Sánchez-Zurano, A., Gabriel Acién-Fernández, F., Rodríguez-Miranda, E.,

771 Gómez-Serrano, C., Cynthia, &, González-López, V., 2021b. Year-long evaluation of microalgae

772 production in wastewater using pilot-scale raceway photobioreactors: Assessment of biomass

773 productivity and nutrient recovery capacity.

774 Muñoz, I.L., Bernard, O., 2021. Modeling the influence of temperature, light intensity and oxygen

775 concentration on microalgal growth rate. Processes 9. https://doi.org/10.3390/pr9030496

776 Muñoz, R., Guieysse, B., 2006. Algal-bacterial processes for the treatment of hazardous contaminants: A

777 review. Water Res. https://doi.org/10.1016/j.watres.2006.06.011

778 Ncr, (, Clinton, J., 1999. CRISP-DM 1.0 Step-by-step data mining guide. DaimlerChrysler.

779 Nordio, R., Delgado, F.J., Sánchez-Zurano, A., Hernandez, J.G., Rodríguez-Miranda, E., Guzmán, J.L., Lafarga,

780 T., Acién, G., 2023. Long-term assessment of the nutrient recovery capacity and biomass productivity

781 of Scenedesmus almeriensis in raceway reactors using unprocessed urban wastewater. Bioresour

782 Technol 369. https://doi.org/10.1016/j.biortech.2022.128374
783 Pasztor I., Thury P., Pulai J., 2009. Chemical oxygen demand fractions of municipal wastewater for modeling
784 of wastewater treatment. International Journal of Environmental Science and Technology 6, 51–56.

785 Posadas, E., Morales, M. del M., Gomez, C., Acién, F.G., Muñoz, R., 2015. Influence of pH and CO2 source on
786 the performance of microalgae-based secondary domestic wastewater treatment in outdoors pilot
787 raceways. Chemical Engineering Journal 265, 239–248. https://doi.org/10.1016/j.cej.2014.12.059

788 Rossi, S., Bellucci, M., Marazzi, F., Mezzanotte, V., Ficara, E., 2018. Activity assessment of microalgal-
789 bacterial consortia based on respirometric tests. Water Science and Technology 78, 207–215.
790 https://doi.org/10.2166/wst.2018.078

791 Rossi, S., Casagli, F., Mantovani, M., Mezzanotte, V., Ficara, E., 2020a. Selection of photosynthesis and
792 respiration models to assess the effect of environmental conditions on mixed microalgae consortia
793 grown on wastewater. Bioresour Technol 305. https://doi.org/10.1016/j.biortech.2020.122995

794 Rossi, S., Casagli, F., Mantovani, M., Mezzanotte, V., Ficara, E., 2020b. Selection of photosynthesis and
795 respiration models to assess the effect of environmental conditions on mixed microalgae consortia
796 grown on wastewater. Bioresour Technol 305. https://doi.org/10.1016/j.biortech.2020.122995

797 Sánchez Zurano, A., Garrido Cárdenas, J.A., Gómez Serrano, C., Morales Amaral, M., Acién-Fernández, F.G.,
798 Fernández Sevilla, J.M., Molina Grima, E., 2020. Year-long assessment of a pilot-scale thin-layer
799 reactor for microalgae wastewater treatment. Variation in the microalgae-bacteria consortium and
800 the impact of environmental conditions. Algal Res 50. https://doi.org/10.1016/j.algal.2020.101983

801 Sánchez Zurano, A., Gómez Serrano, C., Acién-Fernández, F.G., Fernández-Sevilla, J.M., Molina-Grima, E.,
802 2021. Modeling of photosynthesis and respiration rate for microalgae-bacteria consortia. Biotechnol
803 Bioeng 118, 952–962. https://doi.org/10.1002/bit.27625

804 Sánchez-Zurano, A., Gómez-Serrano, C., Acién-Fernández, F.G., Fernández-Sevilla, J.M., Molina-Grima, E.,
805 2020. A novel photo-respirometry method to characterize consortia in microalgae-related wastewater
806 treatment processes. Algal Res 47. https://doi.org/10.1016/j.algal.2020.101858

807 Sánchez-zurano, A., Rodríguez-miranda, E., Guzmán, J.L., Acién-fernández, F.G., Fernández-sevilla, J.M.,
808 Grima, E.M., 2021. Abaco: A new model of microalgae-bacteria consortia for biological treatment of
809 wastewaters. Applied Sciences (Switzerland) 11, 1–24. https://doi.org/10.3390/app11030998

810 Solimeno, A., García, J., 2017. Microalgae-bacteria models evolution: From microalgae steady-state to
811 integrated microalgae-bacteria wastewater treatment models – A comparative review. Science of the
812 Total Environment. https://doi.org/10.1016/j.scitotenv.2017.07.114

813 Solimeno, A., Gómez-Serrano, C., Acién, F.G., 2019. BIO_ALGAE 2: improved model of microalgae and
814 bacteria consortia for wastewater treatment. Environmental Science and Pollution Research 26,
815 25855–25868. https://doi.org/10.1007/s11356-019-05824-5

816 Solovchenko, A.E., Ismagulova, T.T., Lukyanov, A.A., Vasilieva, S.G., Konyukhov, I. V., Pogosyan, S.I.,
817 Lobakova, E.S., Gorelova, O.A., 2019. Luxury phosphorus uptake in microalgae. J Appl Phycol.
818 https://doi.org/10.1007/s10811-019-01831-8

819 Strosser, P., Dworak, T., Andrés Garzon Delvaux, P., Berglund, M., Schmidt, G., Mysiak, J., Kossida, M.,
820 Iacovides, I., Ashton, V., Seiz Puyuelo, R., De Paoli, G., Stanley, K., 2012. Gap Analysis of the Water
821 Scarcity and Droughts Policy in the EU Final Report Gap Analysis of the Water Scarcity and Droughts
822 Policy in the EU European Commission.
823 Zambrano, J., Krustok, I., Nehrenheim, E., Carlsson, B., 2016. A simple model for algae-bacteria interaction
824 in photo-bioreactors.

825 Zurano, A.S., Serrano, C.G., Acién-Fernández, F.G., Fernández-Sevilla, J.M., Molina-Grima, E., 2021.

826 Modelling of photosynthesis, respiration, and nutrient yield coefficients in Scenedemus
827 almeriensis culture as a function of nitrogen and phosphorus. Appl Microbiol Biotechnol 105,
828 7487–7503. https://doi.org/10.1007/s00253-021-11484-8

829 Tables

<table><caption>830 Table 1.- ABACO-2 model process rates</caption><thead><tr><th>n.</th><th>Process</th><th>Process rate [g·m<sup>-3</sup>·day<sup>-1</sup>]</th></tr></thead><tbody><tr><td>1</td><td>Microalgae growth on NH<sub>4</sub></td><td>μ<sub>max,alg</sub> · μ(I<sub>av</sub>) · μ(T) · μ(pH) · μ(O<sub>2</sub>)<sub>alg</sub> · μ(N − NH<sub>4</sub>) · μ(P − PO<sub>4</sub>) · X<sub>alg</sub></td></tr><tr><td>2</td><td>Microalgae growth on NO<sub>3</sub></td><td>μ<sub>max,alg</sub> · μ(I<sub>av</sub>) · μ(T) · μ(pH) · μ(O<sub>2</sub>)<sub>alg</sub> · μ(N − NO<sub>3</sub>) · μ(P − PO<sub>4</sub>) · (1 − μ(N − NH<sub>4</sub>)) · X<sub>alg</sub></td></tr><tr><td>3</td><td>Microalgae decay</td><td>m · X<sub>alg</sub></td></tr><tr><td>4</td><td>Nitrifying bacteria growth</td><td>μ<sub>max,nit</sub> · μ<sub>nit</sub>(T) · μ<sub>nit</sub>(pH) · μ<sub>nit</sub>(O<sub>2</sub>) · μ<sub>nit</sub>(N − NH<sub>4</sub>) · X<sub>nit</sub></td></tr><tr><td>5</td><td>Nitrifying bacteria decay</td><td>θ<sub>nit</sub> · m<sub>nit</sub> · X<sub>nit</sub></td></tr><tr><td>6</td><td>Heterotrophic bacteria growth</td><td>μ<sub>max,het</sub> · μ<sub>het</sub>(T) · μ<sub>het</sub>(pH) · μ<sub>het</sub>(O<sub>2</sub>) · μ<sub>het</sub>(N − NH<sub>4</sub>) · μ<sub>het</sub>(BSMO) · X<sub>het</sub></td></tr><tr><td>7</td><td>Heterotrophic bacteria decay</td><td>θ<sub>het</sub> · m<sub>het</sub> · X<sub>het</sub></td></tr></tbody></table>

831

<table><caption>832 Table 2.- ABACO-2 stoichiometric matrix</caption><thead><tr><th colspan="2">Component → i</th><th>S<sub>NH4</sub></th><th>S<sub>NO3</sub></th><th>S<sub>PO4</sub></th><th>S<sub>BSMO</sub></th><th>S<sub>O2</sub></th><th>X<sub>alg</sub></th><th>X<sub>nit</sub></th><th>X<sub>het</sub></th></tr><tr><th>j</th><th>Process</th><th>[gNH4·m<sup>-3</sup>]</th><th>[gNO3·m<sup>-3</sup>]</th><th>[gPO4·m<sup>-3</sup>]</th><th>[gBSMO·m<sup>-3</sup>]</th><th>[gO2·m<sup>-3</sup>]</th><th>[galg·m<sup>-3</sup>]</th><th>[gnit·m<sup>-3</sup>]</th><th>[ghet·m<sup>-3</sup>]</th></tr></thead><tbody><tr><td>1</td><td>Microalgae growth on NH<sub>4</sub></td><td>−Y<sub>NH4,alg</sub></td><td>−Y<sub>PO4,alg</sub></td><td>−Y<sub>PO4,alg</sub></td><td>+Y<sub>O2,alg</sub></td><td>1</td><td></td><td></td><td></td></tr><tr><td>2</td><td>Microalgae growth on NO<sub>3</sub></td><td></td><td>−Y<sub>NO3,alg</sub></td><td>−Y<sub>PO4,alg</sub></td><td>+Y<sub>O2,alg</sub></td><td>1</td><td></td><td></td><td></td></tr><tr><td>3</td><td>Microalgae endogenous respiration</td><td></td><td></td><td>1 − f<sub>alg</sub></td><td>−Y<sub>O2,alg</sub></td><td>-1</td><td></td><td></td><td></td></tr><tr><td>4</td><td>Nitrifying bacteria growth</td><td>−Y<sub>NH4,nit</sub></td><td>+Y<sub>NO3,nit</sub></td><td></td><td>−Y<sub>O2,nit</sub></td><td></td><td>1</td><td></td><td></td></tr><tr><td>5</td><td>Nitrifying bacteria decay</td><td></td><td></td><td>1 − f<sub>bac</sub></td><td></td><td></td><td>-1</td><td></td><td></td></tr><tr><td>6</td><td>Heterotrophic bacteria growth</td><td>−Y<sub>NH4,het</sub></td><td></td><td></td><td>−Y<sub>BSMO</sub></td><td>−Y<sub>O2,het</sub></td><td></td><td></td><td>1</td></tr><tr><td>7</td><td>Heterotrophic bacteria decay</td><td></td><td></td><td></td><td>1 − f<sub>bac</sub></td><td></td><td></td><td></td><td>-1</td></tr></tbody></table>

833

834

835
836

837

838

839

840

841

<table><caption>Table 3.- Stoichiometric coefficients.</caption><thead><tr><th>Parameter</th><th>Value</th><th>Units</th><th>Source</th></tr></thead><tbody><tr><td>Y<sub>NH<sub>4</sub>,nit</sub></td><td>7.9</td><td>g<sub>NH<sub>4</sub></sub> &middot; g<sub>nit</sub><sup>-1</sup></td><td>(Henze et al., 2000)</td></tr><tr><td>Y<sub>NO<sub>3</sub>,nit</sub></td><td>26.7</td><td>g<sub>NO<sub>3</sub></sub> &middot; g<sub>nit</sub><sup>-1</sup></td><td>(Henze et al., 2000)</td></tr><tr><td>Y<sub>NH<sub>4</sub>,het</sub></td><td>0.16</td><td>g<sub>NH<sub>4</sub></sub> &middot; g<sub>het</sub><sup>-1</sup></td><td>(Henze et al., 2000)</td></tr><tr><td>Y<sub>BSMO</sub></td><td>2.3</td><td>g<sub>BSMO</sub> &middot; g<sub>het</sub><sup>-1</sup></td><td>(Henze et al., 2000)</td></tr><tr><td>Y<sub>O<sub>2</sub>,alg</sub></td><td>1.33</td><td>g<sub>O<sub>2</sub></sub> &middot; g<sub>alg</sub><sup>-1</sup></td><td></td></tr><tr><td>Y<sub>O<sub>2</sub>,nit</sub></td><td>12.44</td><td>g<sub>O<sub>2</sub></sub> &middot; g<sub>nit</sub><sup>-1</sup></td><td>(Henze et al., 2000)</td></tr><tr><td>Y<sub>O<sub>2</sub>,het</sub></td><td>0.4</td><td>g<sub>O<sub>2</sub></sub> &middot; g<sub>het</sub><sup>-1</sup></td><td>(Henze et al., 2000)</td></tr><tr><td>f<sub>alg</sub></td><td>0.1</td><td>—</td><td>(Solimeno et al., 2019)</td></tr><tr><td>f<sub>bac</sub></td><td>0.1</td><td>—</td><td>(Solimeno et al., 2019)</td></tr><tr><td>&theta;<sub>het</sub></td><td>1.07</td><td>&deg;C</td><td>(Casagli et al., 2021)</td></tr><tr><td>&theta;<sub>nit</sub></td><td>1.1</td><td>&deg;C</td><td>(Casagli et al., 2021)</td></tr></tbody></table>

843

<table><caption>Table 4.- Microalgae kinetic parameters.</caption><thead><tr><th>Parameter</th><th>Value</th><th>Units</th><th>Source</th></tr></thead><tbody><tr><td colspan="4">Microalgae kinetic parameters</td></tr><tr><td>I<sub>K</sub></td><td>168</td><td>&mu;E &middot; m<sup>-2</sup> &middot; s<sup>-1</sup></td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>n</td><td>1.7</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>K<sub>a</sub></td><td>0.08</td><td>m<sup>2</sup> g<sup>-1</sup></td><td>This study</td></tr><tr><td>I<sub>K<sub>r</sub></sub></td><td>134</td><td>&mu;E &middot; m<sup>-2</sup> &middot; s<sup>-1</sup></td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>n<sub>r</sub></td><td>1.4</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>T<sub>min,alg</sub></td><td>-10</td><td>&deg;C</td><td>(Casagli et al., 2021)</td></tr></tbody></table>
<table><tr><td>T<sub>max,alg</sub></td><td>38</td><td>°C</td><td>(Casagli et al., 2021)</td></tr><tr><td>T<sub>opt,alg</sub></td><td>20</td><td>°C</td><td>(Casagli et al., 2021)</td></tr><tr><td>pH<sub>min,alg</sub></td><td>1.8</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>pH<sub>max,alg</sub></td><td>12.9</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>pH<sub>opt,alg</sub></td><td>8.5</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>S<sub>O<sub>2</sub>,max</sub></td><td>22.68</td><td>g<sub>O<sub>2</sub></sub>·m<sup>-3</sup></td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>z</td><td>4.15</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>K<sub>S,N-NH<sub>4</sub>,alg</sub></td><td>1.54</td><td>g<sub>N-NH<sub>4</sub></sub>·m<sup>-3</sup></td><td>(Zurano et al., 2021)</td></tr><tr><td>K<sub>i,N-NH<sub>4</sub>,alg</sub></td><td>571</td><td>g<sub>N-NH<sub>4</sub></sub>·m<sup>-3</sup></td><td>(Zurano et al., 2021)</td></tr><tr><td>n<sub>N-NH<sub>4</sub>,alg</sub></td><td>2</td><td>—</td><td>(Zurano et al., 2021)</td></tr><tr><td>K<sub>S,N-NO<sub>3</sub>,alg</sub></td><td>2.77</td><td>g<sub>N-NO<sub>3</sub></sub>·m<sup>-3</sup></td><td>(Zurano et al., 2021)</td></tr><tr><td>K<sub>i,N-NO<sub>3</sub>,alg</sub></td><td>387</td><td>g<sub>N-NO<sub>3</sub></sub>·m<sup>-3</sup></td><td>(Zurano et al., 2021)</td></tr><tr><td>n<sub>N-NO<sub>3</sub>,alg</sub></td><td>2</td><td>—</td><td>(Zurano et al., 2021)</td></tr><tr><td>K<sub>S,P-PO<sub>4</sub>,alg</sub></td><td>0.43</td><td>g<sub>P-PO<sub>4</sub></sub>·m<sup>-3</sup></td><td>(Zurano et al., 2021)</td></tr></table>

## Heterotropic bacteria kinetic parameters

<table><tr><td>T<sub>min,het</sub></td><td>-3</td><td>°C</td><td>(Casagli et al., 2021)</td></tr><tr><td>T<sub>max,het</sub></td><td>42</td><td>°C</td><td>(Casagli et al., 2021)</td></tr><tr><td>T<sub>opt,het</sub></td><td>25</td><td>°C</td><td>(Casagli et al., 2021)</td></tr><tr><td>pH<sub>min,het</sub></td><td>6</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>pH<sub>max,het</sub></td><td>12</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>pH<sub>opt,het</sub></td><td>9</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>K<sub>S,O<sub>2</sub>,het</sub></td><td>1.98</td><td>g<sub>O<sub>2</sub></sub>·m<sup>-3</sup></td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>K<sub>S,N-NH<sub>4</sub>,het</sub></td><td>0.5</td><td>g<sub>N-NH<sub>4</sub></sub>·m<sup>-3</sup></td><td>(Henze et al., 2000)</td></tr><tr><td>K<sub>S,BSMO,het</sub></td><td>0.299</td><td>g<sub>BMSO</sub>·m<sup>-3</sup></td><td>(Henze et al., 2000)</td></tr></table>

## Nitrifying bacteria kinetic parameters

<table><tr><td>T<sub>min,nit</sub></td><td>-8</td><td>°C</td><td>(Casagli et al., 2021)</td></tr><tr><td>T<sub>max,nit</sub></td><td>38</td><td>°C</td><td>(Casagli et al., 2021)</td></tr></table>
<table><tr><td>T<sub>opt,nit</sub></td><td>20</td><td>°C</td><td>(Casagli et al., 2021)</td></tr><tr><td>pH<sub>min,nit</sub></td><td>2</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>pH<sub>max,nit</sub></td><td>13.4</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>pH<sub>opt,nit</sub></td><td>9</td><td>—</td><td>(Sánchez Zurano et al., 2021)</td></tr><tr><td>K<sub>s,O<sub>2</sub>,nit</sub></td><td>1.080</td><td>g<sub>O<sub>2</sub></sub>·m<sup>-3</sup></td><td>(Henze et al., 2000)</td></tr><tr><td>K<sub>s,O<sub>2</sub>,nit</sub></td><td>104.9</td><td>g<sub>O<sub>2</sub></sub>·m<sup>-3</sup></td><td>(Henze et al., 2000)</td></tr><tr><td>K<sub>S,N-NH<sub>4</sub>,nit</sub></td><td>1</td><td>g<sub>N-NH<sub>4</sub></sub>·m<sup>-3</sup></td><td>(Henze et al., 2000)</td></tr></table>
<table><caption>Table 5.- Microalgae nutrient yield parameters.</caption><thead><tr><th>Parameter</th><th>Value</th><th>Units</th><th>Source</th><th>Parameter</th><th>Value</th><th>Units</th><th>Source</th><th>Parameter</th><th>Value</th><th>Units</th><th>Source</th></tr></thead><tbody><tr><td>Y<sub>NH<sub>4</sub>,max</sub></td><td>0.4</td><td>g<sub>N-NH<sub>4</sub></sub> · g<sub>alg</sub></td><td>Calibrated</td><td>Y<sub>NO<sub>3</sub>,max</sub></td><td>0.1</td><td>g<sub>N-NO<sub>3</sub></sub><br>· g<sub>alg</sub></td><td>Calibrated</td><td>Y<sub>PO<sub>4</sub>,max</sub></td><td>0.003</td><td>g<sub>P-PO<sub>4</sub></sub><br>· g<sub>alg</sub></td><td>Calibrated</td></tr><tr><td>K<sub>S,NH<sub>4</sub></sub></td><td>25</td><td>-</td><td></td><td>K<sub>S,NO<sub>3</sub></sub></td><td>25</td><td>-</td><td></td><td>K<sub>S,PO<sub>4</sub></sub></td><td>3.2</td><td>-</td><td></td></tr><tr><td>t<sub>NH<sub>4</sub></sub></td><td>2</td><td>-</td><td></td><td>t<sub>NO<sub>3</sub></sub></td><td>2</td><td>-</td><td></td><td>t<sub>PO<sub>4</sub></sub></td><td>2.14</td><td>-</td><td></td></tr><tr><td>NH<sub>4</sub><sub>max</sub></td><td>80</td><td>g<sub>N-NH<sub>4</sub></sub> · m<sup>-3</sup></td><td>(Zuran<br>o et al.,<br>2021)</td><td>NO<sub>3</sub><sub>max</sub></td><td>80</td><td>g<sub>N-NO<sub>3</sub></sub><br>· m<sup>-3</sup></td><td>(Zurano<br>et al.,<br>2021)</td><td>PO<sub>4</sub><sub>max</sub></td><td>22</td><td>g<sub>P-PO<sub>4</sub></sub><br>· m<sup>-3</sup></td><td>(Zurano<br>et al.,<br>2021)</td></tr><tr><td>NH<sub>4</sub><sub>min</sub></td><td>10</td><td>g<sub>N-NH<sub>4</sub></sub> · m<sup>-3</sup></td><td></td><td>NO<sub>3</sub><sub>min</sub></td><td>10</td><td>g<sub>N-NO<sub>3</sub></sub><br>· m<sup>-3</sup></td><td></td><td>PO<sub>4</sub><sub>min</sub></td><td>2</td><td>g<sub>P-PO<sub>4</sub></sub><br>· m<sup>-3</sup></td><td></td></tr><tr><td>NH<sub>4</sub><sub>opt</sub></td><td>55</td><td>g<sub>N-NH<sub>4</sub></sub> · m<sup>-3</sup></td><td></td><td>NO<sub>3</sub><sub>opt</sub></td><td>55</td><td>g<sub>N-NO<sub>3</sub></sub><br>· m<sup>-3</sup></td><td></td><td>PO<sub>4</sub><sub>opt</sub></td><td>15</td><td>g<sub>P-PO<sub>4</sub></sub><br>· m<sup>-3</sup></td><td></td></tr></tbody></table>

847

848

<table><caption>Table 6.- List of calibrated parameters and their corresponding values</caption><thead><tr><th>Parameter</th><th>Description</th><th>Value</th><th>Units</th></tr></thead><tbody><tr><td>μ<sub>max,alg</sub></td><td>Maximum algal growth rate</td><td>1.5</td><td>day<sup>-1</sup></td></tr><tr><td>m<sub>min</sub></td><td>Minimum algal respiration rate</td><td>0.1</td><td>day<sup>-1</sup></td></tr><tr><td>m<sub>max</sub></td><td>Maximum algal respiration rate</td><td>0.008</td><td>day<sup>-1</sup></td></tr><tr><td>μ<sub>max,nit</sub></td><td>Maximum nitrifying bacteria growth rate</td><td>0.75</td><td>day<sup>-1</sup></td></tr><tr><td>m<sub>nit</sub></td><td>Nitrifying bacteria decay</td><td>0.05 μ<sub>max,nit</sub></td><td>day<sup>-1</sup></td></tr><tr><td>μ<sub>max,het</sub></td><td>Maximum heterotrophic bacteria growth rate</td><td>3.4</td><td>day<sup>-1</sup></td></tr><tr><td>m<sub>het</sub></td><td>Heterotrophic bacteria decay</td><td>0.2 μ<sub>max,het</sub></td><td>day<sup>-1</sup></td></tr><tr><td>Y<sub>NH<sub>4</sub>,max</sub></td><td>NH<sub>4</sub><sup>+</sup> microalage nutrient yield max</td><td>0.6</td><td>g<sub>NH<sub>4</sub></sub> · g<sub>alg</sub><sup>-1</sup></td></tr><tr><td>Y<sub>NO<sub>3</sub>,max</sub></td><td>NO<sub>3</sub><sup>-</sup> microalage nutrient yield max</td><td>0.1</td><td>g<sub>NO<sub>3</sub></sub> · g<sub>alg</sub><sup>-1</sup></td></tr><tr><td>Y<sub>PO<sub>4</sub>,max</sub></td><td>PO<sub>4</sub><sup>3-</sup> microalage nutrient yield max</td><td>0.004</td><td>g<sub>PO<sub>4</sub></sub> · g<sub>alg</sub><sup>-1</sup></td></tr><tr><td>Kl<sub>a</sub></td><td>O<sub>2</sub> natural mass transfer</td><td>0.1</td><td>h<sup>-1</sup></td></tr><tr><td>α</td><td>Nutrient assimilation coefficient</td><td>1</td><td>—</td></tr></tbody></table>

850
<table><caption>851 Table 7.- List of most sensible parameters</caption><thead><tr><th>Parameter</th><th>Units</th><th>Nominal value</th><th>Standard deviation</th><th>Most affected parameters</th></tr></thead><tbody><tr><td>I<sub>k</sub></td><td>μE·m<sup>-2</sup>·s<sup>-1</sup></td><td>168</td><td>0.02</td><td>X<sub>alg</sub>, X<sub>het</sub>, X<sub>nit</sub>, S<sub>NH<sub>4</sub></sub>, S<sub>NO<sub>3</sub></sub>, S<sub>PO<sub>4</sub></sub>, S<sub>BSMO</sub>, S<sub>O<sub>2</sub></sub></td></tr><tr><td>K<sub>a</sub></td><td>m<sup>2</sup>g<sup>-1</sup></td><td>0.08</td><td>1.4E-5</td><td>X<sub>alg</sub>, X<sub>het</sub>, X<sub>nit</sub>, S<sub>NH<sub>4</sub></sub>, S<sub>NO<sub>3</sub></sub>, S<sub>PO<sub>4</sub></sub>, S<sub>BSMO</sub>, S<sub>O<sub>2</sub></sub></td></tr><tr><td>n</td><td>–</td><td>1.7</td><td>1.6E-4</td><td>X<sub>alg</sub>, X<sub>het</sub>, X<sub>nit</sub>, S<sub>NO<sub>3</sub></sub>, S<sub>PO<sub>4</sub></sub>, S<sub>O<sub>2</sub></sub></td></tr><tr><td>μ<sub>max,alg</sub></td><td>day<sup>-1</sup></td><td>1.5</td><td>5.38E-4</td><td>X<sub>alg</sub>, X<sub>het</sub>, X<sub>nit</sub>, S<sub>NH<sub>4</sub></sub>, S<sub>NO<sub>3</sub></sub>, S<sub>PO<sub>4</sub></sub>, S<sub>BSMO</sub>, S<sub>O<sub>2</sub></sub></td></tr><tr><td>μ<sub>max,het</sub></td><td>day<sup>-1</sup></td><td>3.4</td><td>0.0016</td><td>X<sub>het</sub>, S<sub>BSMO</sub></td></tr><tr><td>μ<sub>max,nit</sub></td><td>day<sup>-1</sup></td><td>0.75</td><td>0.0004</td><td>X<sub>nit</sub>, S<sub>NO<sub>3</sub></sub>, S<sub>NH<sub>4</sub></sub></td></tr><tr><td>m<sub>min</sub></td><td>day<sup>-1</sup></td><td>0.1</td><td>8E-6</td><td>X<sub>alg</sub>, X<sub>het</sub>, X<sub>nit</sub>, S<sub>NO<sub>3</sub></sub>, S<sub>BSMO</sub>, S<sub>O<sub>2</sub></sub></td></tr><tr><td>m<sub>nit</sub></td><td>day<sup>-1</sup></td><td>0.05 μ<sub>max,nit</sub></td><td>8.34E-5</td><td>X<sub>het</sub>, X<sub>nit</sub>, S<sub>NO<sub>3</sub></sub>, S<sub>BSMO</sub></td></tr><tr><td>m<sub>het</sub></td><td>day<sup>-1</sup></td><td>0.2 μ<sub>max,het</sub></td><td>6.8E-5</td><td>X<sub>het</sub>, X<sub>nit</sub>, S<sub>NO<sub>3</sub></sub>, S<sub>BSMO</sub></td></tr><tr><td>O<sub>2,max</sub></td><td>mgO<sub>2</sub>·l<sup>-1</sup></td><td>22.68</td><td>0.0011</td><td>X<sub>alg</sub>, X<sub>het</sub>, X<sub>nit</sub>, S<sub>NO<sub>3</sub></sub>, S<sub>PO<sub>4</sub></sub>, S<sub>BSMO</sub>, S<sub>O<sub>2</sub></sub></td></tr><tr><td>Y<sub>NH<sub>4</sub>,max</sub></td><td>–</td><td>0.6</td><td>0.001</td><td>X<sub>het</sub>, X<sub>nit</sub> S<sub>NH<sub>4</sub></sub>, S<sub>NO<sub>3</sub></sub></td></tr><tr><td>Y<sub>NH<sub>4</sub>nit</sub></td><td>–</td><td>0.4</td><td>0.016</td><td>X<sub>nit</sub>, S<sub>NH<sub>4</sub></sub></td></tr><tr><td>Y<sub>NO<sub>3</sub>,nit</sub></td><td>–</td><td>26.76</td><td>0.11</td><td>S<sub>NO<sub>3</sub></sub></td></tr></tbody></table>

<table><thead><tr><th>Cardinal parameters</th><th>Units</th><th>Opt, max, min</th><th>Standard deviation</th><th>Most affected parameters</th></tr></thead><tbody><tr><td>T<sub>alg</sub></td><td>°C</td><td>38,20,-10</td><td>0.0026</td><td>X<sub>alg</sub>, X<sub>het</sub>, X<sub>nit</sub>, S<sub>NH<sub>4</sub></sub>, S<sub>NO<sub>3</sub></sub>, S<sub>PO<sub>4</sub></sub>, S<sub>BSMO</sub>, S<sub>O<sub>2</sub></sub></td></tr><tr><td>pH<sub>alg</sub></td><td>–</td><td>8.5, 12.9, 1.8</td><td>0.0032</td><td>X<sub>alg</sub>, X<sub>het</sub>, X<sub>nit</sub>, S<sub>NH<sub>4</sub></sub>, S<sub>NO<sub>3</sub></sub>, S<sub>PO<sub>4</sub></sub>, S<sub>BSMO</sub>, S<sub>O<sub>2</sub></sub></td></tr><tr><td>T<sub>nit</sub></td><td>°C</td><td>20,38,-8</td><td>0.04</td><td>X<sub>het</sub>, X<sub>nit</sub> S<sub>NH<sub>4</sub></sub>, S<sub>NO<sub>3</sub></sub>, S<sub>BSMO</sub></td></tr><tr><td>pH<sub>nit</sub></td><td>–</td><td>9, 13.4, 2</td><td>0.024</td><td>X<sub>het</sub>, X<sub>nit</sub> S<sub>NH<sub>4</sub></sub>, S<sub>NO<sub>3</sub></sub>, S<sub>BSMO</sub></td></tr><tr><td>T<sub>het</sub></td><td>°C</td><td>25,42,-3</td><td>0.034</td><td>X<sub>het</sub>, X<sub>nit</sub>, S<sub>NO<sub>3</sub></sub>, S<sub>BSMO</sub></td></tr><tr><td>pH<sub>het</sub></td><td>–</td><td>9, 12, 6</td><td>0.0026</td><td>X<sub>het</sub>, X<sub>nit</sub>, S<sub>NO<sub>3</sub></sub>, S<sub>BSMO</sub></td></tr></tbody></table>
<table><caption>Table 8.- Validation errors of the ABACO-2 model.</caption><thead><tr><td>Parameter</td><td>NRMSE</td><td>TIC</td></tr></thead><tbody><tr><td>X<sub>tot</sub> [g·m<sup>-3</sup>]</td><td>0.21</td><td>0.16</td></tr><tr><td>S<sub>NH<sub>4</sub></sub> [g·m<sup>-3</sup>]</td><td>0.22</td><td>0.55</td></tr><tr><td>S<sub>NO<sub>3</sub></sub> [g·m<sup>-3</sup>]</td><td>0.15</td><td>0.21</td></tr><tr><td>S<sub>PO<sub>4</sub></sub> [g·m<sup>-3</sup>]</td><td>0.23</td><td>0.24</td></tr><tr><td>S<sub>BSMO</sub> [g·m<sup>-3</sup>]</td><td>0.21</td><td>0.2</td></tr><tr><td>S<sub>O<sub>2</sub></sub> [g·m<sup>-3</sup>]</td><td>0.14</td><td>0.21</td></tr></tbody></table>

855

Figures

<figure><img src="image_2.png" /><figcaption>Figure 1.- Schematic description of the biological mechanisms taking in place in microalgae-bacteria wastewater systems.</figcaption></figure>

857

858

859

860
<figure><img src="image_3.png" /><figcaption>Figure 2.- Calibration methodology used in the present work.</figcaption></figure>

861

862

863
<figure><img src="image_4.png" /><figcaption>Figure 3.- Biomass concentration evolution. A) Total biomass concentration (sum of algae and bacteria, simulated (continuous line) and experimental (scatter plot); B) Nitrifying and heterotropic concentration; C) Algae concentration. The model shade is the model confidence interval at 95%.</figcaption></figure>

864

865

866

867

868
<figure><img src="image_5.png" /></figure>

<figure><img src="image_6.png" /></figure>

<figure><img src="image_7.png" /></figure>

<figure><img src="image_8.png" /></figure>

869

870 Figure 4.- Variation of culture nutrients A) PO₄³⁻, B) NO₃⁻, C) NH₄⁺ and D) BSMO concentration, in g·m⁻³

871 respectively (experimental, scatter plot; model prediction, continuous line).

872
<figure><img src="image_9.png" /><figcaption>Figure 5.- Simulation of the dissolved oxygen in the culture. A) Experimental and simulated dissolved oxygen along the entire study period, B) Representation of the oxygen in a shorter period.</figcaption></figure>

873

874

875

876
<figure><img src="image_10.png" /><figcaption>Figure 6: Application of ABACO-2 model in a case-study. Algae, heterotropic and nitrifying bacteria concentration evolution depending on: A), B), C) culture height; D), E), F) Dilution rate; G), H), I) with or without injecting air into the system</figcaption></figure>

877

878

879

880

881

882
<figure><img src="image_11.png" /></figure>

Define the biological system

Model development

Calibration of parameters

Validation