Denitrification Control in a Recirculating Aquaculture System—A Simulation Study

The recirculating aquaculture system (RAS) is a land-based water treatment technology, which allows for farming aquatic organisms, such as fish, by reusing the water in the production (often less than 5%). This technology is based on the use of filters, either mechanical or biological, and can, in principle, be used for any species grown in aquaculture. Due to the low recirculation rate, ammonia accumulates in the system and must be converted into nitrate using nitrification reactors. Although less toxic for fish, nitrate can also be further reduced into nitrogen gas by the use of denitrification biofilters which may create several issues, such as incomplete denitrification, resulting in toxic substances, such as nitrite and nitric oxide, or a waste of carbon source in excess. Control of the added quantity of carbon source in the denitrification biofilter is then mandatory to keep nitrate/nitrite concentrations under toxic levels for fish and in accordance with local effluent regulations, and to reduce costs related to wasted organic carbon sources. This study therefore investigates the application of different control methodologies to a denitrification reactor in a RAS. To this end, a numerical simulator is built to predict the RAS behavior and to allow for the comparison of different control approaches, in the presence of changes in the operating conditions, such as fish density and biofilter removal efficiency. First, a classical proportional-integral-derivative (PID) controller was designed, based on an SIMC tuning method depending on the amount of ammonia excreted by fish. Then, linearizing and cascade controllers were considered as possible alternatives.


Introduction
Recirculating Aquaculture Systems (RAS) have been increasingly used due to the growth of the aquaculture industry [1]. They can be defined as systems where less than 10% of the total water volume is replaced per day and respond to the need of more intensive practices, growing environmental constraints on water consumption and effluent quality, as well as the possibility to supply fish in places where it would be otherwise difficult [2,3]. The main drawback of these systems is the accumulation of some toxic compounds, such as ammonia, when there is no proper treatment. Ammonia can be introduced into the system by fish excretion, 60-70% of the nitrogen consumption by fish being excreted as ammonia through the gills, or the degradation of uneaten feed [4]. The nitrogen removal process reduces the ammonia level using microorganisms that transform it into nitrate (nitrification). The latter, although much less toxic for fish, also accumulates in the system and needs to be removed to avoid system sustainability and environmental issues. Thus, another unit is often considered in order to convert nitrate into nitrogen gas (denitrification). The use of anaerobic denitrification to remove nitrate is not yet widely applied to commercial RAS due to its level of efficiency, its complexity and cost [5]. The complexity of RAS, created by its intrinsic closed-loop and the interactions between water treatment and fish grow-out, implies to build dynamic models to analyze the process behavior and Processes 2020, 8,1306 2 of 23 to optimize it (configuration, size, fish, feed, flows etc) with respect to cost, robustness and water quality [6]. Indeed, manual control of denitrifying biofilters may easily lead to an unstable process performance and high cost [7]. Nitrite, which is toxic for fish, can accumulate in transient phases [8]. It is an intermediate compound in the denitrification process, a set of four reactions converting nitrate NO − 3 to nitrogen N 2 . Particularly, the lack of carbon source for complete denitrification could make this problem more severe. The absence of nitrite/nitrate/oxygen, however, if large quantities of organic matter exist, causes the production of sulfides (such as hydrogen sulfide) which are also extremely toxic [9]. Although nitrate control has been addressed many times regarding municipal wastewater treatment, its application in the context of RAS is not widespread [7,[10][11][12]. A multivariable PID control, manipulating recirculation flowrates and aeration to control nitrate levels is proposed in [12] while an online control strategy/algorithm optimizing a denitrification biofilter through carbon dosage and backwash is shown in [7]. In [10], a simple feedback control strategy by methanol addition is used to minimize nitrite production and [11] proposes an output-feedback control scheme for a wastewater treatment biofilters in order to regulate nitrate and nitrite concentrations.
In this study, a global assessment of nitrate control using acetic acid (pH is considered regulated and constant) as manipulated variable is first achieved and two different control methodologies are considered: a classical PID control whose parameters are estimated by a SIMC tuning method [13], and a simple model-based linearizing control. PID control is widely used in process industries [14], and have been extensively used to control WWTPs. Unfortunately, PID controllers may present robustness limitations when applied to nonlinear systems with modeling uncertainties as well as measurement noise. They might indeed require tuning each time the operating conditions significantly vary. Linear controllers, on the other hand, take advantage of the availability of accurate nonlinear models often based on reaction networks and mass balances. However, as bioprocess models generally present uncertain kinetic structures, adaptive and/or robust solutions are required [15][16][17][18]. Taking advantage of both controller structures, a cascade of PI and linearizing control (accounting for possible model inaccuracies) is further proposed and compared with an adaptive linearizing strategy. The controller performances are tested with regard to typical industrial plant variations: changes in fish density, biofilter nitrate conversion efficiency, effluent guidelines regarding nitrate and water/acid pump malfunction in the denitrification reactor.

Industrial Plant
The industrial-scale RAS under consideration was composed of fish tanks, a physical filtration system and two biofilters (one for nitrification and another for denitrification). The reactor sizes and flowrates are presented in Figure 1.
The fish were reared in the tanks from where water flowed into a physical filtration system in order to remove particles. This water flow was then bypassed by a denitrification system where a carbon source, acetic acid, was injected. The nitrification filter was composed of 6 compartments, each one filled with fixed plastic support. Oxygen was added to the nitrification filter up to its saturation point and fresh water could also have been introduced in the system at a rate F f resh .
In the following analyses, the RAS system is assumed to operate at a specific setpoint and model-based control strategies are designed to allow the user to choose specific operating conditions (i.e., to keep the current setpoint in steady-state or to chose another setpoint) and the closed-loop system to compensate possible disturbances. Regarding the simulated industrial plant, the nominal steady-state corresponds to a 6.4 L/h acetic acid flow rate (F Acid ) added to keep a constant nitrate concentration in the denitrification biofilter of 26.6 gN/m 3 . Water leaves the fish basins (and enters the denitrification biofilter) with oxygen, ammonium and nitrate concentrations of, respectively, 6.8 gCOD/m 3 , 0.5gN/m 3 and 98 gN/m 3 .

Model Description
Each block of the industrial RAS are described by the following models whose components and nomenclature are related to the Activated Sludge Models (ASM) from [19].
• Fish Tanks: The fish excretion rate is considered with assumed constant fish size and population. It can be 95 translated into ASM variables using the waste matrix reported in [6]. The fish respiration is calculated based on the values reported in [20] and [21] (see Table 1).
The Fish basins are modeled as perfectly mixed tank reactors where no biological reaction occurs, applying mass balances as in: where variable ξ may be used to represent both soluble (S) and particulate (X) waste compounds 100 and V is the fish tank volume. The corresponding waste production rates ϑ waste , all quantified in Table 1, are estimated for an assumed constant fish density of 12kg/m 3 and body weight of 8.5kg. These rates can also be translated into ASM variables using the waste matrix reported in [6] while the fish respiration is calculated based on the values reported in [20] and [21] (see Table 1). The fish basin may therefore be modeled by the replication of the generic equation (1) 105 for each waste component of Table 1. • Physical particle filter: 90% of the particulate components in the inlet are filtered, leading to: where X k,outlet and X k,inlet represent respectively the outlet and inlet concentrations of particulate component k.

110
• Denitrification filter: The denitrification filter consists of a moving bed perfectly mixed tank reactor. Solubles that exist in the reactor bulk (index b) dissolve into the biofilm (index c) where the main part of the

Model Description
Each block of the industrial RAS is described by the following models whose components and nomenclature are related to the Activated Sludge Models (ASM) from [19].

•
Fish Tanks: The fish excretion rate is considered with assumed constant fish size and population. It can be translated into ASM variables using the waste matrix reported in [6]. The fish respiration is calculated based on the values reported in [20,21] (see Table 1).
The Fish basins are modeled as perfectly mixed tank reactors where no biological reaction occurs, applying mass balances as in: where variable ξ may be used to represent both soluble (S) and particulate (X) waste compounds and V is the fish tank volume. The corresponding waste production rates ϑ waste , all quantified in Table 1, are estimated for an assumed constant fish density of 12 kg/m 3 and body weight of 8.5 kg. These rates can also be translated into ASM variables using the waste matrix reported in [6] while the fish respiration is calculated based on the values reported in [20,21] (see Table 1). The fish basin may therefore be modeled by the replication of the generic Equation (1) for each waste component of Table 1.
• Physical particle filter: 90% of the particulate components in the inlet are filtered, leading to: where X k,outlet and X k,inlet represent, respectively, the outlet and inlet concentrations of particulate component k.
• Denitrification filter: The denitrification filter consists of a moving bed perfectly-mixed tank reactor. Solubles that exist in the reactor bulk (index b) dissolve into the biofilm (index c) where the main part of the is not considered in ρ 1 , ρ 2 and ρ 3 ). Acetic acid is added to this bioreactor (4) as a carbon source for denitrification, which can therefore be modeled as: where F Acid is the acetic acid flow rate in L/h, ϕ is the coefficient of conversion of acid into easily biodegradable organic matter in gCOD/L and φ ξ is the production/consumption rate of component ξ, which can be calculated using stoichiometry-that is, the corresponding coefficient Table S1, in Supplementary Materials) and rate ρ w (provided in Table S2, in Supplementary Materials), as in: where w is an index denoting the process referenced in Tables S1 and S2 in Supplementary Materials.
• Nitrification filter: The nitrification filter is hydraulically modeled assuming six sequential perfectly mixed tank reactors filled with solid media. Biologically, a modified ASM1 model with the inclusion of two-step nitrification/denitrification is used (provided in Tables S1 and S2, in Supplementary Materials). This model has been validated using the data from the COST Simulation Benchmark in [22]. It has to be noticed that oxygen is also added to this bioreactor. Particles present in the inlet remain in the outlet. However, the particles already existing in each compartment (rs) do not move to others. The resulting mass balances lead to: where D represents the dilution rate, k di f f is the diffusion coefficient in m 3 /h, V b is the empty volume of the reactor in m 3 , φ S i,rs and φ X k,rs are the consumption/production rates of solubles i and particulates k, calculated from (8), F is the volumetric flowrate in m 3 /h,ṁ is the mass flowrate in g/h, K d is the detachment coefficient in h −1 · m 3 and k La is the oxygen mass transfer coefficient in h −1 .

Plant Dynamics: A Preliminary Study
A first hydraulic study of the plant is achieved in order to assess the RAS inherent dynamics. To this end, a simulation of the concentration variation of an inert soluble component in the denitrification reactor following a production rate unitary step increase (in gCOD/(m 3 · h)) is shown in Figure 2 where, obviously, the plant takes up to 4000 h to reach the new steady state. Indeed, the step response can be approximated using a first order transfer function G 1 with time constant τ C = 744 h-i.e., 5τ C ≈ 4000 h. As already mentioned, the plant is a semi closed system with 1% of regenerated water flowrate. This small inlet of water, along with the high considered volume, causes the very slow drift towards the new steady-state. This preliminary numerical analysis aims at demonstrating that the current RAS is very delicate to control due to the recirculating loop dynamics. In the upcoming sections, dedicated to control design, these slow dynamics are taken into account using adapted controller settings.

Control Implementation: Classical Approach
This section aims at first designing a classical PID controller to regulate the nitrate level in the denitrification reactor. From the corresponding model of differential Equations (3) and (4), acetic acid is obviously the sole manipulated variable and the following control law is proposed: where F Acid represents the initial acetic acid flowrate ensuring the industrial plant nominal steady-state (F Acid = 6.4 L/h), e(t) represents the measurement error, K C is the proportional gain, τ I and τ D , respectively, are the integral and derivative time constants, S * NO3 is the desired nitrate concentration setpoint and S NO3 (t) is the measured nitrate concentration. Expression (13) therefore aims at compensating any deviation from the chosen nominal steady-state trajectory which is assumed to be a priori knowledge from heuristics. Although (13) only presents three parameters, finding optimal settings without resorting to a systematic procedure may be complex. One way to design the gains is to first focus on the Proportional-Integral (PI) (i.e., τ D = 0) part in order to set a satisfactory steady-state response (no steady-state error) and then consider the derivative part to improve the transient response [13,23].
In this study, the SIMC design method, as presented in [13], is chosen since it involves the transfer function of the system which can be easily computed considering a specific operating point and the corresponding step response, for instance, using the MATLAB model identification toolbox.
As shown in Figure 3, a one pole model already provides a very good approximation, and reads: The numerator of (15) shows that the system presents a steady-state gain (G(0)) equal to −32 and no delay (θ = 0) while the denominator provides the system time constant (τ 1 ) which, as expected, is particularly large (890 h). Such slow systems, according to [13], may be approximated by a simple integrator: ke −θs using the ratio between the gain G(0) and the time constant τ 1 , denominated k , to determine PI-settings in a much shorter time frame (see Figure 4). k is therefore calculated as follows: .09 − 25.59 (240 − 24)(6.762 − 6.44) = −0.05 (17) where ∆y represents the variation in nitrate concentration during ∆t hours, for a variation in acid flowrate ∆u.
The SIMC method then proposes, for a general first-order process with delay, the PID tuning rules presented in Table 2, where τ C represents the time constant of the desired first-order response of the system. The second row shows how this method is applied to the considered industrial-scale plant.     Considering y, the current nitrate concentration in the denitrification filter, y S the desired setpoint, and θ the time delay, Equation (18) shows the relation between these variables and τ C : The rate at which nitrate is produced/consumed in the system depends on either the quantity of ammonia released by fish (and consequent quantity converted into nitrate) or the amount of nitrate the denitrification biofilter is able to convert into nitrogen (gas). Regarding nitrate consumption, an increase in available carbon source induces biomass growth and nitrate consumption increases (assuming that the biofilter size is properly designed). However, nitrate production is entirely driven by the quantity of ammonia produced in the system. τ C is then limited by the "maximum" production rate of nitrate and can be estimated using the quantity of ammonia produced by the fish. This can be further explained by Equation (18), considering θ = 0, represented in Figure 5. It has to be noticed that τ C should always be greater than d y ys dt max , that is, τ C ≥ τ C,min as shown in Figure 5, depending on the amount of ammonia excreted by fish. The controller parameter calculation conditions, related to the case-study, are presented in Table 3. All the ammonia introduced in the system is considered as completely converted into nitrate. As shown in Figure 6, where setpoint changes of +15/−15 gN/m 3 are simulated, an anti-windup configuration (using Equation (19)) is recommended to avoid detrimental effects due to input saturation and the control law reads: with e aw being the anti-windup term calculated by the following equation: e aw is only greater than 0 when the controller output is greater than the allowed maximum value (F acid,max = 200 L/h) or lower than its minimum value (F acid,min = 0 L/h). When this happens, the control action is limited and e aw is calculated accordingly (K aw is the anti-windup gain). Figure 6 shows the effect of the anti-windup when a K aw value of −1 is used. When the nitrate setpoint is increased, the controller decreases the acid flowrate accordingly. However, nitrate concentration will continue to increase due to the ammonia conversion reaction which causes the integral term of the PI controller to go on increasing. When the nitrate concentration finally reaches the desired setpoint, the accumulated integral action entails overshoot. K aw values chosen between −0.1 and −10 are sufficient to solve the issue. Nevertheless, using a high K aw value tends to slow down setpoint tracking. A K aw value of −1 is ideally chosen and used in future simulations. The design of the derivative gain is achieved following the analysis of the controller response to setpoint changes. Comparative results using different derivative gain values (driven by the choice of τ D ) can be found in Figure 7. The input calculated by the PID therefore reads: where the derivative term is approximated by a continuous high-pass filter using η as intermediate variable.
Including the derivative action leads to the new results of Figure 7, where oscillations are attenuated and the tracking is improved. A τ D value of 1 provides the most satisfactory result and is therefore selected. The resulting PID performance is assessed in Figure 8 where, following several setpoint changes and step disturbances in waste production (ϑ S NH ), robust and fast tracking is achieved. Values of −11.6 L·m 3 /(g·h), 6.9 h, 1 h and −1 are, respectively, used for K C , τ I ,τ D and K aw . Robustness analysis with respect to other operating condition disturbances is also presented in Figure 9. Variations in the available biomass concentration X BH and the bypass flowrate F denitri are identified as severe system disturbances. A sudden increase in biomass decay rate (b H term in Table S2 is increased 3 fold, from 2.6 × 10 2 to 7.8 × 10 −2 h −1 ) is therefore simulated and indeed causes response oscillations, as shown in Figure 9, while step variations on the bypass flowrate are compensated very fast.
For the exact same perturbation in the biomass decay rate as in the previous test, the situation gets worse when adding measurement noise, as shown in Figure 10, where a Gaussian noise with zero mean and 10% relative standard deviation is added to the measured variable (S NO3 ). A sampling time of 0.01h is also used to match the probe measurement sampling process. The controller obviously faces tracking problems, sometimes reaching unacceptable nitrate concentration values even when trying to retune the controller proportional gain ( Figure 10 shows the results for two values of the gain). To avoid this undesired effect, two solutions could be considered-they are, (a) low-pass filtering of the output signal or (b) replacing the PID by a PI, which is, in essence, less sensitive to measurement noise.

Linearizing Control
A linearizing control strategy, as illustrated in Figure 11, may also be proposed as an alternative solution. The control law is established based on a simplified ASM1 model [19] (in order to limit the quantity of measured variables) and the following assumptions:

•
Only the denitrification reactor is considered; • This reactor only contains heterotrophic bacteria; • Since the oxygen concentration is low, no nitrification can occur; • Biomass is retained in the tank (X BH,out = 0); • Only three other components besides biomass are considered: oxygen (S O ), easily biodegradable organic matter (S S ) and nitrate (S NO3 ); • Only two reactions are assumed to occur: 1. Aerobic growth of heterotrophs: 2.
Anoxic growth of heterotrophs on nitrate: • Acid is added as a carbon source and ϕ represents the conversion of acid flowrate (F acid , L/h) into easily biodegradable carbon source flowrate (gCOD/h)).
Applying mass balances to (23) and (24), the following simplified differential equation system is obtained: where φ SS and φ NO3 are the easily biodegradable organic matter and nitrate reaction rates given by: where υ SS,aerob , υ SS,anox and υ NO3 are stoichiometric coefficients depending on biomass yield Y H as in: and ρ 1 and ρ 2 are the aerobic and anoxic growth rates of heterotrophs: Considering a first-order linear reference as in (33): where S * NO3 is the desired nitrate concentration setpoint. Replacing Equation (33) in Equation (26): In steady-state, S S variation tends to zero: and injecting (34) into (25), assuming (35), yields: As previously mentioned, an anti-windup term should be added to cancel input saturation effects: As shown in Figure 12, the linearizing controller provides good performances even in the presence of measurement noise with zero mean and 10% relative standard deviation, and biomass concentration decrease. However, in an attempt to decrease the undesired oscillations, two additional strategies, which aim at being more robust to model uncertainties, are proposed in the following section, one combining both control structures in cascade and another estimating the biomass unknown dynamics.

Cascade Control
The cascade control methodology takes advantage of linearizing control to impose a first-order closed-loop dynamic in the inner loop, and a PI controller is used in the outer loop (see Figure 13). This cascade structure provides robustification, for instance, to model uncertainties, as follows: where S * NO3 (t) = S * NO3 + K C,cascade e(t) + S * NO3 (t) = S * NO3 + K C,cascade e(t) +

Adaptive Linearizing Control
Lumping the kinetic uncertainties into one single parameterθ, Equation (38) can be re-written: where θ represents parameter mismatch θ = θ −θ. An adaptive scheme, as described in [16,24], can be designed to develop an asymptotically stable control law, considering the following positive Lyapunov candidate function: and its time derivative:V where S NO3 = S * NO3 − S NO3 , θ = θ −θ and γ is a striclty positive parameter. All the terms in ρ Lin are assumed to be slowly varying so that dθ dt = 0 and we get: Considering possible parameter mismatch, the error dynamics may be written: Replacing Equations (50) and (51) in (49), we obtain: Considering Lyapunov stability theory,V L should be negative and since the first term of (52) is, as long as the second and third terms cancel each other, the stability of the closed-loop is verified, as in: The adaptive control law reads: It should be noticed that the adaptive linearizing controller is equivalent to (38) where an integral action is added.

Numerical Results
Simulation results aim at assessing the controller performance following an increase in biomass (death rate) considering measurement white noise with zero mean and 10% standard deviation on all measured variables (S NO3 , S S , S O and X BH ), as shown in Figure 12. A sampling time of 0.01 h is used to simulate the corresponding probe behavior. Regarding the linearizing controller, the parameters 0.5 h −1 , 6 L/h 2 m 3 and −10 are, respectively, used for λ lin , λ lin,I and K aw,lin . The PI used in cascade is parameterized with K C,cascade = 0.001 and τ I,cascade = 0.5 h (keeping λ lin = 0.5 h −1 ) and the adaptive controller uses γ = 5 (keeping λ lin = 0.5 h −1 ). All the controllers perform reasonably well when noise is added and both the adaptive and cascade controllers are capable of attenuating the previously described oscillations.
In addition, comparative results between the linearizing controller with the cascade and the adaptive controller for several system disturbances are shown in Figures 14-17.   It is noticeable from Figures 9 (left) and 12 that all controllers oscillate following a perturbation in the biomass concentration. This is related to the operating point of the RAS and, by setting a new higher nitrate setpoint, it is possible to obtain a smoother response, as shown in Figure 18.

Conclusion and Perspectives
In this study, a control study of a recirculation aquaculture system is undertaken. Different control methodologies are tested in simulations for an industrial scale system. Both PID and linearizing controllers are capable of keeping the system stable when used with an anti-windup action. The PID controller gains can be calculated based on fish waste production (ammonia). The addition of a derivative action leads to a noticeable decrease in controller output oscillations. Nonetheless, the PID presents robustness issues when considering measurement noise. The linearizing controller is, however, able to overcome this problem and can also be further improved by adding an adaptive law to face possible model uncertainties. A cascade control strategy (combining PI and linearizing controllers) may also improve the control robustness to model uncertainties, compromising the tracking performance. The system has an operational region around which all the considered feedback strategies present oscillating responses. Operational conditions should then be changed to accommodate this phenomenon. The controllers show good robustness with respect to disturbances, such as the increase in ammonia production due to variations in the fish population. The control strategies discussed in this article are versatile and could be applied to other RAS configurations at different scales. Future perspectives could include the analysis of nitrite accumulation and the possibility to limit its concentration.

Funding:
The authors gratefully acknowledge the support of the WAGRALIM project NUTRIVERT funded by the Walloon Region.

Conflicts of Interest:
The authors declare no conflict of interest.