Online Backwash Optimization of Membrane Filtration for Produced Water Treatment

In the offshore oil and gas sector, produced water is discharged into the sea, but increasing environmental concerns and stricter governmental regulations require new technologies to be considered. Membrane filtration is a promising technology to improve separation, but fouling of the membranes causes a significant reduction in flow capacity. To reduce fouling, optimization of the backwashing parameters is given much attention. Comprehensive and time-consuming experiments are used to model the effect of backwashing, but most methods neglect time varying features present in the offshore produced water treatment train. In this paper, a backwashing scheduling algorithm is proposed, which dynamically selects the filtration and backwashing durations to maximize the average net permeate production. The proposed algorithm is tested on a lab-scaled pilot plant, where it was able to adapt as irreversible fouling accumulated and the OiW concentration changed. The paper concludes that the removal rate of oil fouling was observed to be dependent on the rate at which the backwashing pressure could be established. As the proposed method online adapts to the current conditions, it can improve the filtration capacity compared to cases with constant backwashing and filtration durations throughout the lifetime of the facilities.


Introduction
In the petroleum industry, produced water (PW) is the largest waste stream, especially as the water cut increases with oil field maturity [1,2]. Typically, the PW is treated to comply with Danish regulations, where the oil-in-water (OiW) concentration must be below 30 mg/L before discharged and the total amount of discharged dispersed oil must remain below 222 tonnes annually, regardless of concentration. In 2015, an oil producer discharged 95% of their annual allowed limit, which incentify the need for new methods and technologies to comply with future regulations [3]. Crossflow (CF) membrane filtration is an attractive candidate for improving OiW separation for produced water treatment (PWT). Membrane technology has been investigated for OiW separation, but challenges such as the complexity of the PW, fouling, and required installation footprint complicates industrial implementation. The complexity of PW is especially problematic as the composition varies with respect to well, maturity, and field [4].
Backwashing of the membranes are often deployed to remove accumulated fouling. During backwashing, the transmembrane pressure (TMP) is reversed and produced permeate is used to wash away the accumulated fouling. Typically, fouling is categorized into four groups depending on how the fouling blocks the pores of the membrane. The four groups are commonly defined as: complete blockage, intermediate blockage, standard blockage, and cake blockage [5].

Experimental
This section is divided into two parts: Firstly, the lab-scale pilot plant used for experiments and validation is described. Secondly, the experimental conditions, OiW mixture, and operation are described.

Pilot Plant
The pilot plant is developed to emulate process control related problems for offshore topside OiW separation [16]. The plant consists of a supply system, horizontal pipeline, vertical riser, gravity-based separators, hydrocyclones, and CF membrane filtration, but only the supply system and membranes are used in this study. The filtration system consists of 24 membranes, each with a membrane surface area of 0.34 m 2 , divided into eight filtration units each capable of parallel or serial configuration. The deployed membranes are made of silicon carbide (SiC) with a nominal pore size of 0.04 µm (ultrafiltration) and are produced by LiqTech. The SiC membranes are well known for their chemical stability, narrow pore size distribution, high flux, and hydrophilic properties. The hydrophilic properties of the membrane ensure that oily particles and oil droplets are not absorbed by the membranes [17]. Furthermore, based on the selected pore size, the pilot plant should be able to reduce the OiW concentration to less than 3 mg/L [18]. Figure 1 shows an overview of the membrane filtration unit used in this study. The CF pump (WP 02 ) is delivering crossflow velocities (CFV) up to 2.553 m/s, and the feed pump (WP 01 ) is used to control the TMP.
The pilot plant is equipped with both Jorin Visual Process Analyser (ViPA) (Leicestershire, UK) and Turner Designs TD-4100XD (Fresno, CA, USA). The ViPA analyses droplet size and shape, and provides a concentration estimate, based on video microscopy. The Turner Designs TD-4100XD is a fluorescence-based monitor that measures the OiW concentration online. The two analyzers have been used and results seem promising, but the instruments should be validated using industrial approved standard methods, such as the gas chromatography with flame ionization detector (GC-FID) [19,20].  Matlab Simulink Real-Time (R2016b, MathWorks, Natick, MA, USA) is selected as the implementation platform for fast and flexible prototyping. Matlab is connected to the sensors and actuators of the pilot plant through National Instruments (Austin, TX, USA) and Speedgoat (Bern, Switzerland) I/O-cards. The entire system is sampled at 100 Hz, providing the opportunity to study relatively fast process dynamics.

Experimental Conditions
As the PW quantity demanded by the experiment poses a safety and fire risk, the feed mixture used in this study is not equivalent to offshore PW, but rather a refined oil mixed with tap water. Based on pilot plant experience, a normal grade motor oil contains surfactants to a degree where the mixture becomes milky white and the mixture becomes difficult to separate for disposal. As such, the feed mixture consists of tap water and non-detergent SAE 30 motor oil from Midland (Riga, Latvia). The OiW mixture has a natural tendency to separate in the feed tank, therefore two large mechanical stirrers from Milton Roy mixing (Houston, TX, USA) are deployed to ensure proper and consistent oil and droplet size distribution in the feed tank (2 m 3 mixture). The speed of the stirrers can be controlled to either decrease or increase the droplet size. The mechanical stirrers have a combined electrical effect of 2.2 kW and a mixing intensity of 1469 m 3 /h. The droplet size distribution during stirring was analyzed in [21] and is shown in Figure 2. Based on the results, 95% of the droplets are between 5.4 µm and 46.6 µm, which are close to the 5 µm-50 µm range reported in [22]. Real PW contains a varying degree of natural surfactants depending on well location, posing a challenge to the separation train. In particular, the difference between the feed mixture and real PW is a known limitation of the pilot plant. Ideally, real PW should have been used, but the quantity required poses a safety risk which must be dealt with before real PW can be introduced into the pilot plant. To ensure relatively constant concentration throughout the experiments, the permeate, reject, and backwashing media are returned to the feed tank except for a small amount of permeate that is kept in a separate tank to be used for backwashing. The ratio between the total feed volume and the permeate stored for backwashing is over 10, thus reducing the oscillation in OiW concentration that occurs as a consequence. The feed concentration is intentionally higher than the expected concentration in PW to artificially increase the fouling growth. According to the TD-4100XD, the mean concentration of feed is 1277 mg/L.
The active controllers and the control pairings used throughout this study are illustrated in Figure 1.

Results and Discussion
In this section, the scheduling strategy is described and modified based on the observed fouling behavior. The method is discretized and implemented on the pilot plant, and lastly the results are presented and discussed.

Scheduling Strategy
Fouling occurs during filtration and increases the permeate flow resistance, but commonly fouling is partly removed by backwashing, as illustrated in Figure 3. The proposed example is to model how the resistance develops over a filtration cycle (n), and, based on the previously estimated resistance models, R f |n−1 and R b|n−1 , the current filtration and backwashing duration can be selected such that the net permeate production is maximized. The considered optimization problem is defined as the maximization of net permeate production over a filtration cycle, which is formulated as: where t b|n and t f |n are the backwashing and filtration durations for the current filtration cycle, respectively, and j avg|n is the average flux over the filtration cycle: where j f |n (t) and j b|n (t) are the flux during filtration and backwashing for cycle no. n. Assuming steady state, Darcy's law can be used to describe the relationship between flux, TMP, and resistance [9,23]: where j is the permeate flux, ∆P is the TMP, and R is the permeate resistance for 1m 2 membrane area. Darcy's law can estimate the resistance during periods where the changes in resistance is significantly slower than the hydro-, valve, and pump dynamics. However, the estimated resistance is inaccurate during transient periods. As the resistance model for the current cycle is unknown, the resistance models estimated based on the previous cycle, R b|n−1 (t) and R f |n−1 (t), can be used to predict fouling behavior for the current cycle. Assuming constant pressure filtration and applying Darcy's law, Equation (2) can be reformulated as: where ∆P f and ∆P b are the pressures applied during the filtration and backwashing phases, respectively.

Backwash Resistance Model
In order to maximize Equation (1), the resistance models R f and R b must be identified, where it is anticipated that R f and R b are linear and exponential functions of time, respectively [15,24]. Figure 4 shows the estimated resistance, flux, and pressure during filtration and backwashing operation. The fouling behavior during the filtration phases behaved as expected based on different studies addressing fouling of membranes treating oily waste water [10,[25][26][27][28][29]. However, the resistance during backwashing did not behave as theorized, indicating that backwashing has no apparent effect on the estimated resistance. Based on the experiment, the estimated resistance is non-decreasing during backwashing, whereas the subsequent filtration phase shows that the permeate resistance has been reduced during the backwashing phase. Since the reduction in resistance caused by backwashing only is observed once filtration is reestablished, the dynamic behavior is difficult to identify. It is conceivable that the removable fouling is removed during the transient period between filtration and backwashing; consequently, the dynamics from the valves and pumps obscure the dynamic behavior of the permeate flow resistance. The same fouling behavior was observed in [30] where municipal wastewater was treated, indicating that the observed fouling behavior does indeed exist outside the laboratory setup. Furthermore, the backwashing durations in several different studies indicate that it is possible that oil fouling of the ceramic membranes is removed during the transient period between filtration and backwashing [7][8][9]31]. However, none of the studies explicitly study the flux recovery as a function of backwashing duration.  Since the reduction in resistance caused by backwashing can be observed once filtration is reinitiated, a set of different backwashing durations (1 s to 100 s) were tested to investigate the relationship between backwashing duration and recovered flux, where the recovered flux is defined as: where ∆t is 10 s to reduce the impact of noise on the estimated recovered flux. Figure 5 shows the backwashing experiment, whereas the recovered flux for each backwashing duration is shown in Figure 6. For the backwashing durations (>10 s), the backwashing pressure controller is unable to establish the reference pressure before termination. Based on results, the recovered flux remains relatively constant for backwashing durations between 10 s and 100 s. Approximately 10 s is required to achieve the desired pressure and the highest degree of recovery in flux, implying that the removable oil fouling is quickly removed once the desired pressure is achieved or removed during the pressure building phase. Furthermore, as shown in Figure 7, the backwashing flux can be eight times higher than the filtration flux when identical drive pressures are applied. As the large difference in flow rate is only present once fouling has accumulated, it is theorized that the fouling behaves similar to a check valve, where fouling is temporarily pushed away only to move back once the flow direction is reversed. It is conceivable that, by increasing the shear rate and thereby backwashing pressure, more fouling could be dislodged from the membranes. However, the pilot plant is unable to deliver higher pressure and extensive modification is required to test backwashing behavior at higher pressures.
The large difference between filtration and backwashing flow rate highlights how essential it is to reduce the backwashing duration to a minimum while keeping fouling at a minimum. Based on the experimental observations, no incentive exists to extend the backwashing duration beyond what is required to achieve the desired pressure. To ensure the highest degree of removal and minimizing permeate spent backwashing, backwashing is terminated once is satisfied. Furthermore, extending the backwashing duration beyond 70 s seems to decrease the flux recovered, but additional data are required to be conclusive. The observation could be correlated to the occurrence of fouling during backwashing, as the backwashing media (permeate) contains oil to a degree where fouling on the permeate side of the membrane occurs. Fouling during backwashing is observed in Figure 8, where the estimated resistance increases during backwashing. In addition, a membrane was inspected, and oil fouling was found on the permeate side of the membrane-see Figure 9. Oil droplets Figure 9. Oil accumulated on the permeate side of the membrane, the light gray color across the membrane is an area where the oil is scraped off.

Scheduling Strategy Modifications
Because backwashing termination depends purely on the required time to reach the desired backwashing pressure, the maximization problem defined in Equation (1) is reduced to only be dependent on t f |n . As t f |n depends on the backwashing phase and t b|n is independent from the filtration phase, the problem complexity can be reduced by interchanging the filtration and backwashing phases. The suggested optimization problem in Equation (2) is reformulated in terms of backwashing volume (V b|n ) and the order of the filtration and backwashing phase is switched: where t b|n and V b|n should remain relatively constant as they largely depend on pump dynamics. Furthermore, V b|n can be calculated after the backwashing phase, and the filtration flux can be integrated online to provide an online estimation of the average flux. Based on data from Figure 5, the average flux is calculated and illustrated in Figure 10, where two cases with different backwashing durations are highlighted. For the 3.1 s case ( Figure 10 bottom left), the average flux for the filtration cycle peaks at the 42 min mark, whereas the 9.1 s case ( Figure 10 bottom right) does not reach maximum flux during the filtration cycle, indicating that the filtration time should be prolonged. Even though the 3.1 s case has the highest maximum average flux for a single filtration cycle, nearly no fouling is removed during the backwashing period, which is confirmed by Figures 5 and 6. To ensure long-time sustained flux and avoid frequent chemical cleaning, it is critical that backwashing pressure is established and the removable fouling is removed before termination of the backwashing phase as written in Equation (6).
To detect if the maximum average flux is reached, the derivative is used and the filtration phase is continued while d dt j avg|n (t) ≥ 0 is satisfied.

Implementation and Discretization
The pilot plant operates at a sample frequency of 100 Hz, but for this implementation the signals are downsampled to 10 Hz to reduce computational and data storage requirements. Discrete time variables, l n and k n , are defined to simplify notation for the discretization: where T s is the sample time. The first step in the proposed backwashing scheduling method is backwashing, where the goal is to continue backwashing until the desired pressure is achieved.
To reduce noise and potential incorrect switching, a lowpass filter with the specifications from Table 1 is deployed. As defined in Equation (6), backwashing is terminated once the backwashing pressure is above or equal to the reference. However, as the measurements are noisy and the controller is unable to keep the system at the exact reference, a soft threshold of 95% is combined with a 3 s delay to ensure that backwashing is not unnecessarily prolonged or triggered by noise. As a result, backwashing is continued while: is satisfied, where ∆P b,re f is the reference for the backwashing pressure controller, which is kept constant. While the backwashing is executed, the volume of backwashing media spent is calculated online as: The second step is to continue filtration while the average flux is increasing. For that purpose, Equation (7) is discretized to: The termination of the filtration phase relies on Equation (8), which can be approximated as: where h is the current sample. The approximation can be formulated as: The inequation can then be simplified to: The condition defined in Equation (8) can be written as: Based on Equations (10) and (16), the proposed backwashing scheduling algorithm is formulated as in Algorithm 1. V b|n = V b|n + j b|n (l n T s )T s 8: l n = l n + 1 9: k n = k n + 1 10: while Equation (16) (k n − l n )T s < 50 s do Continue filtration 11: Filtration 12: The suggested backwashing scheduling algorithm maximizes the net flux production over a filtration cycle and completely avoids any model estimation process, ensuring easy implementation. t b|n is determined by the required time to reach the desired backwashing pressure plus 3 s, avoiding being triggered by noise and ensuring removed oil exits the system before the filtration phase is reinitiated. Simultaneously, the volume of permeate used for backwashing this cycle is calculated based on flow measurements, which is used in Line 10 Equation (16). After the backwashing phase, the filtration phase is continued while the calculated average flux increases.
The algorithm relies on the derivative of j avg|n , which is sensitive to noise, thus the measurements are filtered using a lowpass filter to reduce high frequency noise. The lowpass filter introduces a delay, depending on filter type and order, potentially delaying the switch between backwashing and filtration and thereby reducing performance.
The algorithm is implemented in Simulink and an experiment is conducted to evaluate the performance of the online numerically calculated j avg|n and d dt j avg|n -see Figure 11. The experiment is divided into two phases. Firstly, backwashing is carried out according to the algorithm. Secondly, the filtration phase is carried out beyond what would initiate backwashing, such that the performance of the online numerically calculated j avg|n and d dt j avg|n could be evaluated and observed in the transition phases. Based on the experiment, two problems are observed. Firstly, initialization of the filtration system and lowpass filter, combined with switching between backwashing and filtration, causes the algorithm to initiate backwashing prematurely as shown in Figure 12 (the two top figures). The problem can be avoided by enforcing a minimum filtration time of 50 s, as described in Algorithm 1. Secondly, the derivative amplifies the measurement noise, as highlighted in Figure 12 (bottom right). The amplified noise could initiate backwashing before the true d dt j avg reaches zero. A premature termination of the filtration phase will cause a loss in overall production, but to which degree is unclear. To quantify the consequence of an untimely termination of the filtration phase, the production loss, as defined in Equation (17), is plotted as a function of filtration time in Figure 13:   (17)), where the red cross is the optimal point (0% P loss )-based on data from Figure 11. Figure 13 highlights the filtration time ranges with a maximum of 1% and 8% production loss compared to the optimal point (red cross), respectively. The loss in permeate production is not symmetric around the optimal point and favors late over early termination. Furthermore, Table 2 shows the filtration time ranges at which the filtration phase must be terminated if P loss should be less than the given percentages. For example, filtration must be terminated within a 3 min window if P loss should be less than 0.1%. The table with respect to filtration duration and production loss highlights the irrelevance of the 4.25 s filter delay on the flow measurements. The estimated production losses and time windows are case dependent, and the exact values will vary with membrane conditions, feed properties, and process conditions. Based on the experiment shown in Figure 11, the effect of extending the backwashing duration is estimated. To estimate the potential loss caused by extending the backwashing duration, it is assumed that the extended duration provides no additional fouling removal, and the backwashing flow rate can be maintained for the extended duration. As the optimal filtration time changes as the backwashing time is extended, the average flux loss as a function of time for different extensions is shown in Figure 14. By extending the backwashing duration by 5 s, the estimated loss using the proposed algorithm is 8.8%. However, the loss caused purely by extending the backwashing duration is reduced as the filtration duration is extended, and, if the filtration is allowed to continue for the full duration of the experiment (50 min), the loss is reduced to 3.5%.

Scheduling Results
The proposed algorithm is implemented on the pilot plant, where new membranes are installed to highlight how the algorithm adapts the durations as irreversible fouling accumulates. The results are presented in Figures 15-17. During the validation experiment, the CFV, TMP, and the backwashing pressure are maintained at levels indicated in Figure 15 by deploying feedback control, and the temperature is 21 • C. To ensure the proposed algorithm is able to adapt to changes, the OiW concentration (likely also droplet size), irreversible fouling, and the feed flow rate varied during the experiment. The filtration and backwashing durations throughout the experiment are shown in Figure 16, where the backwashing duration remains relatively constant, and the filtration duration is slowly and steadily increasing as irreversible fouling accumulates in the newly installed membranes. The fact that the backwashing frequency is decreased as irreversible fouling occurs contradicts the results from the TMP/flux threshold-based method described in [12], where the backwashing frequency is increased as irreversible fouling accumulates. It is conceivable that accounting for irreversible fouling growth in the backwashing fouling model would increase the backwashing frequency to avoid accumulation of irreversible fouling. Furthermore, the constant TMP control mode can also contribute to the decreasing backwashing frequency. However, as irreversible fouling accumulates, the flux is reduced as a consequence of constant TMP control. As the flux is reduced so does the fouling growth rate and the need for backwashing the membrane. Consequently, the backwashing frequency is reduced. Despite the fouling state of the membranes, the cost of backwashing is the same and, as the filtration flux is reduced, filtration must be carried out for a longer period in order to justify the permeate cost of backwashing. The feed concentration in Figure 17 showed the same decreasing tendency as the permeate flow rate, indicating that the decrease in concentration could be caused by oil accumulating in the membranes. Furthermore, the concentration peaks occurring after each backwash are unrelated to the storing of the permeate after each backwash as the concentration should be decreasing and not increasing. The concentration peaks are likely a combination of two factors: firstly, the sensor is drained for water, which allows air inside the view cell during backwashing. Secondly, it is observed that OiW concentrations this small are difficult to measure and the instrument is sensitive to the dynamic transition between backwashing and filtration. The decreasing OiW concentration during the experiment does probably affect the droplet size distribution of the feed. Ideally, the distribution should be measured over the course of the validation experiment. However, the ViPA is based on video microscopy and the size of the view cell means that only a very small fraction of the flow can be observed. Consequently, the sensor is required to run for several hours under steady-state conditions to gather enough samples to create a representative size distribution, and, as the conditions are constantly changing during the experiment, the relationship between OiW concentration and size distribution is unknown.
The mean outlet concentration for the entire experiment was constantly −9.7 ppm, according to the TD-4100XD. The observed negative concentration is caused by a calibration offset, which confirms that the absolute precision is not to be completely trusted, but it does provide an indication of how the feed concentration changes over the course of the experiment.

Conclusions
The fouling removal during backwashing was concluded to be unobservable, making online estimation of the resistance difficult with the available measurements. While no reduction in resistance was observed during backwashing, a reduction resistance could be observed once the filtration phase was initiated. Furthermore, prolonging the backwashing duration beyond what is required to achieve the desired TMP resulted in no additional flux recovery, as such permeate used by backwashing could be reduced by optimizing the pressure delivering capabilities of the backwashing supply system.
The backwashing flux could be up to eight times higher than the filtration flux, emphasizing the criticality of the backwashing duration. To quantify, a 5 s backwashing extension causes a production loss of between 3.5% to 8.8%, whereas an extension of 13.4 min for filtration duration only causes a production loss of 3%. Evidently, the backwashing duration is more time critical. Consequently, the delay introduced can impact permeate production, and efforts should be aimed towards reducing any switching delay. In particular, the filter delay combined with the 3 s delay defined in Equation (10) can decrease the overall performance. It is conceivable that the lowpass filter would be sufficient to avoid backwashing termination caused by measurement noise.
Based on the observed fouling behavior, a scheduling algorithm is proposed and tested on the pilot plant. The algorithm is limited to filtration systems with measurements and subject to constant TMP control, and modification is required to adapt the algorithm to non-constant TMP control. A benefit of the suggested algorithm is that both the backwashing and filtration durations are completely dependent on measurements, requiring no model and allowing for fast adaptation to changes in irreversible fouling and OiW concentration. Longer or more frequent backwashing could conceivably reduce irreversible fouling growth, as the correlation between backwashing scheduling and irreversible fouling is not considered. Currently, only the current cycle is considered for optimization. However, to account for long-term operation, backwashing is continued until the backwashing pressure is established and all removal fouling is removed.
In future work, the suggested algorithm should include irreversible fouling and backwashing pressure into the fouling removal behavior, to reduce irreversible fouling and ensure that the maximum degree of fouling is removed. As the suggested algorithm completely relies on measurements, sensor faults or calibration error are critical and Kalman filter based methods could be deployed to detect sensor failure [32]. Lastly, the OiW mixture used in the study is a simplification of the real offshore PW neglecting the chemical and biological interaction present in real PW, potentially changing the fouling behavior. To ensure that the method is deployable for PWT, the difference must be compared. The validation is carried out at different concentrations and irreversible fouling levels, but future work should also include different oil compositions.