Reverse Osmosis Desalination Plants Energy Consumption Management and Optimization for Improving Power Systems Voltage Stability with PV Generation Resources

: This paper studies energy consumption management of seawater Reverse Osmosis (RO) desalination plants to maintain and enhance the Voltage Stability (VS) of Power Systems (PS) with Photovoltaic (PV) plant integration. We proposed a voltage-based management algorithm to determine the maximum power consumption for RO plants. The algorithm uses power ﬂow study to determine the RO plant power consumption allowed within the voltage-permissible limits, considering the RO process constraints in order to maintain the desired fresh water supply. Three cases were studied for the proposed RO plant: typical operation with constant power consumption, controlled operation using ON/OFF scheduling of the High-Pressure Pumps (HPPs) and controlled operation using Variable Frequency Drive (VFD) control. A modiﬁed IEEE 30-bus system with a variable load was used as a case study with integration of three PV plants of 75 MWp total power capacity. The adopted 33.33 MW RO plant has a maximum capacity of 200,000 m 3 /day of fresh water production. The results reveal that while typical operation of RO plants can lead to voltage violation, applying the proposed load management algorithm can maintain the vs. of the PS. The total transmission power loss and power lines loading were also reduced. However, the study shows that applying VFD control is better than using ON/OFF control because the latter involves frequent starting up/shutting down the RO trains, which consequently requires ﬂushing and cleaning procedures. Moreover, the speciﬁc energy consumption ( SEC ) and RO plant recover ratio decreases proportionally to the VFD output. Furthermore, the power consumption of the RO plant was optimized using the PSO technique to avoid unnecessary restriction of RO plant operation and water shortage likelihood.


Introduction
Maintaining Voltage Stability (VS) is a critical issue for recent power systems due to the existence of renewable energy (RE) generation [1,2]. Several measures were proposed to maintain and enhance VS. The connected load is one of the main reasons for voltage instability. Therefore, the direct control of electrical demand is considered an effective way to tackle the vs. issue in recent power systems by shedding some of the connected load units [3][4][5].
Reverse osmosis (RO) desalination plants are big load units that consume a large amount of electrical energy. New RO plants are being built worldwide and this will continue in the near future to fulfill the growing human society fresh water requirements.
Nevertheless, RO plants are modular and they own operation flexibility features. Therefore, many studies proposed the integration of RO plants in electric system planning studies [6] and in providing ancillary services [7]. This integration can help in generationload balancing, enhancing PS flexibility for better RE share, congestion management, and load curve flattening [8].
In ref. [9], the authors modeled and optimized a system that comprises a diesel generator, a desalination plant, a water storage, heat pumps, domestic hot water storage RE sources and energy storage. They found that this integration could lower the operational cost. The desalination plant-without RE sources-enhanced the operational dispatch of the diesel generators by allowing them to run between 60% and 80% of their rated capacity in which their efficiency is higher. In ref. [10], a micro-grid comprising RE and water treatment plants was studied technically and economically to check the feasibility of the system in autonomous and grid connected schemes. The flexibility provided by the water treatment plant's pumps with RE decreased the cost of energy from 0.082 to 0.02 €/kWh. Moreover, as reported by [11], the services that can be gained from a flexible desalination process include: regulation, RE integration, contingency services, adding system capacity.
The dynamic energy consumption control of an RO desalination plant was proposed using a variable salinity feed RO process [12]. The authors proposed varying the salinity of feed water by mixing seawater with brackish water to obtain different salinity levels and hence, different levels of pumps/motors (power) consumption. Therefore, the consumption of the RO process can be adjusted according to availability of power generation. When there is surplus in power generation, RO process desalinates saline water and consumes much power. In contrast, when there is shortage in power supply, the RO process desalinates saline water with a lower salinity and hence, consumes less power. The fresh water production is not affected in both cases. The study revealed that the proposed system could be used as a flexible load and can participate in grid ancillary services without affecting the fresh water demand.
Using desalination plants as flexible loads in an island micro grid powered by hybrid diesel/RE resources was performed in ref. [13]. The results showed that the integration of desalination plants as flexible load was very favorable from economical and technical points of view. The levelized costs of energy and water were the lowest for the third case (using the desalination plant as a flexible load). A coordinated sizing of an RO plants with flexible operation and a micro grid was proposed and optimized in ref. [14]. The operation flexibility of the RO plant units was conducted using ON/OFF control. The authors concluded that the proposed coordinated sizing is more economic than the conventional separated sizing of the RO plant and the micro grid components. In another study [15], it was shown that applying energy management techniques (ON/OFF control with different management schemes) for standalone RO systems powered by solar PV resources with water storage and a small battery storage system can reduce the cost of the whole system. In ref. [16], the authors studied experimentally the control of an RO process using the high pressure pumps (HPPs) duty control and the retentate valves opening control in order to increase the fresh water production utilizing solar PV resources, under the constraints of applied pressure and water quality.
Ref. [17] studied the integration of RO desalination plants in unit commitment (UC) problem to investigate the impact on the total cost. The IEEE 118-bus system was integrated with six desalination plants and the UC model was modified to include the RO model as flexible loads. The results revealed that the coordination between RO plants and power generation planning (UC problem) could lower the operation cost by 20%-40%. Similarly, ref. [18] proposed using controlled operation of RO plants for day ahead scheduling but with more detailed modeling and renewable resources.
In ref. [19], the authors prototyped an actual stand-alone wind powered RO process. They studied and analyzed the operation of the system under the variation of wind speed and hence wind generation. The system involved a control system to adapt the wind generation to the RO power requirement. They found that the variation of the RO process dod not cause any destruction in the RO process components, and did not affect the water quality or production rate. Hence, they concluded that the system was technically feasible. The role of RO plants in managing the RE fluctuation challenge was studied for a small power system integrated with RE resources in [20]. The study was conducted in Porto Santo island which is powered by a conventional thermal power plant with an installed capacity of 16 MW and 3.3 MW from PV and wind plants. The RO plants total power was 1.6 MW. The idea was to operate the RO plant when RE is available and to store water for later usage. The findings showed that controlling RO process operation can yield a reduction in peak load, a reduction in RE variation effects on the power system and can power an RO plant from RE free resources. Ref. [21] studied in detail the impact of using desalination plants in micro grids. Different scenarios were considered. The scenarios comprised energy conversion, energy storage, and desalination processes. An optimization and techno-economic study was performed on the Cape Verde island Brava as a case study for one year on an hourly basis. The desalination plants were simulated as constant loads and variable loads in order to study the possible benefits of desalination plants when they are cooperated with the RE resources. The results showed a noticeable reduction in the surplus RE, fuel consumption, and energy storage requirement because of the flexibility of the RO desalination plants. The objective function was the net present cost of all the system components. Similarly, it was reported that a reduction in energy storage requirement could be achieved for a renewable powered brackish water RO system under variable operation [22]. The pressure was controlled up and down according to the availability of RE, and a 20% decrement in energy storage requirement could be achieved. Moreover, a novel ON/OFF control strategy was applied on a brackish water RO system supplied from variable power resources and fed from a feed water with variable concentrations [23].
However, due to the interdisciplinary nature of this topic, the majority of the research focused on one area more than the others. Therefore, all the aforementioned references did not involve details about RO plants energy consumption control and how it can be linked to the grids from an operational point of view, except ref. [12] which presented a detailed modelling regarding the RO plants' energy consumption control using the variable frequency drive (VFD) and its effects from a planning point of view. In contrast, it did not deeply study the electric system operational performance like the voltage profiles, and electric branch loading. Considering these parameters is extremely important because in reality, PS performance will be affected in such situations and might be malfunctioning.
Ref. [17] linked the energy consumption of six RO plants to the UC study, mainly to reduce the desalination cost. But it modelled them in an aggregation form by assuming that the RO plants energy consumption changes by varying the water production. It did not include the detailed modelling of RO plants operation and how it can be controlled in accordance with PS conditions. Moreover, ref. [15] did not study the impact on the vs. and power lines loading and losses.
Yet, there is a strong need for studies that incorporate both sides (RO plants and power systems) in detailed technical and economical approaches. Moreover, because the large RO plants draw a huge amount of electrical energy, their impact on the voltage stability must be investigated. In addition, the nature of the electrical load of the RO plants is highly inductive because they consist of electrical motor-driven pumps in all stages of their processes. Thus, they consume a vast amount of reactive power, which imposes another challenge on the voltage stability of the grids. However, the impact of the RO plants' operation on the voltage stability was not investigated. Therefore, this study tries to fill the gap in this scientific research area. We studied the effect of different control schemes of seawater RO plants on the voltage stability. We proposed a novel voltage-based energy consumption management algorithm which integrates the RO process and fresh water requirements constraints to the electrical grids vs. constraints. Another contribution is that we conducted an optimization study to maximize the RO plant energy consumption in order to take full advantage of the RO capacity under the proposed algorithm. The PS performance was investigated using power flow study, which provides full information about all parts of the PS. All the technical limits were checked in details. Moreover, two control schemes were investigated and applied on the RO desalination plant with a detailed real design, practical constraints and full performance information.

Problem Formulation
This research investigates the management and optimization of RO plants' energy consumption in order to enhance the voltage stability of power systems with integration of solar PV resources. First, the impact of the typical operation of RO plants on the PS voltage stability was studied. Then, the energy consumption management was applied on the RO plant and the impact on the voltage stability was analyzed. In addition, the power (transmission) lines loading and active loss were calculated for both cases.
Finally, an optimization study was conducted to optimize the RO plant energy consumption, so that the optimal condition satisfied the contradictory requirements of water demand and voltage stability. Figure 1 shows the general system layout of this research. The power system consists of an electrical power network, generators and loads. Three PV plants are connected to three different buses and one large RO desalination plant is connected to another bus. The load of the PS is variable. The power generation of the PV plants is uncontrolled and considered as a negative load. The RO plant energy consumption is to be managed and controlled, so that the voltage stability of the power system is maintained within the technical permissible limits. The RO plant energy consumption is managed by two methods: RO trains ON/OFF method and the VFD control method. This study was conducted using three well-known softwares: Matlab (version R2019a from MathWorks), PowerWorld simulator (version 16 from PowerWorld Cooperation) and IMSDesign (version 2.228.2002.19.86 from Nitto Hydranautics). The IMSDesign software was used to design the RO process. Then, the parameters and constraints of the RO process were used in Matlab scripts which, in turn, sent the electrical load data, including the RO plant energy consumption and PV plants data, to the PowerWorld to conduct a power flow study. The results of the power flow study were sent back to Matab for further analysis. This was repeated each hour over the simulation time frame. This was done for all the scenarios. The details of various parts of Figure 1 are presented in the sections below.

IEEE 30-Bus System
The power system in Figure 1 is the IEEE 30-bus system. The IEEE 30-Bus system is a well-known transmission lines power system that is widely used by researchers in var-  The details of various parts of Figure 1 are presented in the sections below.

IEEE 30-Bus System
The power system in Figure 1 is the IEEE 30-bus system. The IEEE 30-Bus system is a well-known transmission lines power system that is widely used by researchers in various studies of power systems. This system was a part of the American Electric Power System (in the Midwestern US) in 1961. The system involves 30 buses with six generators at buses 1, 2, 5, 8, 11 and 13. The original IEEE 30-bus system load has a constant load equals 283.2 MW. The generators' total active power capacity is 435 MW. In this study, the PV plants are connected to buses 2, 10, and 30 and the RO plant to bus 10. Figure 2 shows the 30-bus IEEE system single line diagram [19]. The details of various parts of Figure 1 are presented in the sections below.

IEEE 30-Bus System
The power system in Figure 1 is the IEEE 30-bus system. The IEEE 30-Bus system is a well-known transmission lines power system that is widely used by researchers in various studies of power systems. This system was a part of the American Electric Power System (in the Midwestern US) in 1961. The system involves 30 buses with six generators at buses 1, 2, 5, 8, 11 and 13. The original IEEE 30-bus system load has a constant load equals 283.2 MW. The generators' total active power capacity is 435 MW. In this study, the PV plants are connected to buses 2, 10, and 30 and the RO plant to bus 10. Figure 2 shows the 30-bus IEEE system single line diagram [19].

Power Flow Study
The basic power flow equations are shown below: where V i , P i and Q i is the voltage, active and reactive injected power into the ith bus respectively. δ i is the angle of ith bus, Y ij is the admittance between buses i and j, and n is the number of buses. The total generation must satisfy the total load plus the total transmission losses, that is Equations (3) and (4) represent PS equality constraints. P l and Q l are the total active and reactive power transmission losses, P g and Q g are the generated active and reactive power, and P D and Q D are the active and reactive load respectively.
For each generator, the following constraints are maintained throughout the study: For each bus, the following constraints must be respected: When the solar PV and RO plants are inserted into the system at the kth bus, Equations (3) and (4) need to be modified as follows: where P RO,k is the active power consumption of the RO plant and P PV,k is the solar PV generation. The power generated by the PV plats is modelled as a negative active load (Q PV,i = 0). Equations (9) and (10) link the RO process energy consumption to the power system conditions and RE power generation. Thus, the role of RO process on the overall performance is determined by the way in which P RO and Q RO vary. In typical cases, these terms are changed (via the RO process operators) to meet its own objectives (which include constant fresh water production under variable temperature and salinity of feed water) irrespective of the conditions of the power source/grid. However, in this work, the terms P RO,i and Q RO,i are controlled according to two requirements: the PS requirement to maintain vs. constraints given in Equation (7), and the fresh water provision requirement. However, only the results of the active power consumption of the RO plant are demonstrated for three reasons: firstly, active power is bigger in value than reactive power, secondly, it is the one used and discussed in the field of RO desalination engineering (during the calculation of the specific energy consumption (SEC) whose unit is kWh/m 3 ), and finally, the reactive power can be found from the active power using the power triangular relations.

PV Power Plants Modelling
Three solar PV power plants are connected to the IEEE 30-bus system at buses 2, 10 and 30. These buses were only selected to uniformly distribute the PV plants, one for each ten buses. However, because the bust 1 is the slack bus of the system, it was not possible to change its load in PowerWorld from Matlab. Therefore, bus 2 was selected for the first PV plant. Each PV plant consists of 100,000 PV modules with the specifications given in Table 1 at standard test conditions STC.

Parameter Value
The power of the PV module can be calculated using the following Equation [25]: where I PV is given by Equation (12): where I Ph and I 0 are the photovoltaic and saturation currents of the array, respectively, V t = N s kT/ q e is the thermal voltage of the array with Ns cells connected in series (K is the Boltzmann's constant, T is temperature of the p-n junction in Kelvin and q e is the charge of electron), R s is the equivalent series resistance, R P is the equivalent parallel resistance of the PV array and a is the ideality constant. The term I Ph is given by the following equation where I Ph,n is the light-generated current at the nominal condition (25 • C and 1000 W/m 2 ), ∆T = T − T n (T and T n being the actual and nominal temperatures (Kelvin), respectively), G (W/m 2 ) is the irradiation on the device surface, and G n is the nominal irradiation. Likewise, the saturation current I 0 depends on the nominal saturation current I 0,n and more details can be found in ref. [19]. Real data of solar radiation and ambient temperature were used in the simulation. Moreover, maximum power-point tracking MPPT algorithm was implemented to extract the maximum power form the solar PV array at each hour.

RO Plant and Energy Consumption Modeling
The RO desalination plant is connected to bus 10. The RO power consumption P RO is the total RO plant power consumption. The majority of this consumption occurs in the centrifugal HPPs where the pressure of the feed water is increased to several bars. Typically, P HPP consumes 73-85% of the total RO plant energy consumption [26,27]. The remaining power is consumed in other parts of RO process such as intake, pre-treatment, posttreatment, product pumping and brine discharge processes. The rated power consumption in MW of the HPPs is given by the following Equation [28]: where p f is the pressure difference between inlet and outlet of the pump (bar), q f is the water flow rate (m 3 /h) and η VFD η m η p are the efficiency of the VFD, the motor and the pump respectively. The effect of changing the factor f (the rotational speed/frequency of the centrifugal pumps) on the pressure, flow rates and power consumption is expressed by the affinity law. Mathematically, the affinity law is described using Equation (15) [29]: where n is the pump rotational speed which is proportional to the electricity source frequency and f is the factor of actual frequency/rated frequency of the VFD. Hence, changing the rotational speed/electricity frequency is proportional to a cubic variation of power consumption, a square variation of pressure (and also fresh water production) and linear variation of feed water flow rate.
Therefore, under VFD control, the total power consumption of the HPPs will be where M is numbers of the HPPs. Then, P RO = P HPP,total + P others (17) where P others is the power consumption of the other processes in the RO plant. Assuming P others is constant, Likewise, the reactive power consumption of the RO desalination plant Q RO (MVAR) is: Q RO = Q HPP,total + Q others (19) However, since the electrical load of the RO plants is mostly induction motors, the Q RO term can be calculated from P RO using the electrical power triangular relationships and assuming the power factor is 0.8.
Hence, the total power consumption of the HPPs pumps can be controlled either by controlling the number of the running HPPs, (M) or by controlling the setting of the VFD (f ).
To produce fresh water, the gained pressure must overcome the osmotic pressure of the saline water p os (bar) given by the following Equation [21]: where R is the universal gas constant (0.0809 L·bar/mol·K), T is the water temperature ( • C), and ∑ m j is the sum of the molar concentrations of all constituents in the saline water [21]. As a rule of thumb, each 1000 mg/L of salinity yields 0.7 bar osmotic pressure [21]. The fresh permeate water production is governed by the following equation: where A is the water transport coefficient (L/m 2 ·bar), S is the membrane area (m 2 ) and NDP is the net driving pressure (bar) given by Equation (18) [21]: where p p is the permeate water pressure (bar) which is usually assumed 0 bar, and p d is the pressure drop (bar), which is a function of the membrane fouling, membrane design and system configuration. Moreover, flow regime, velocity, direction and feed spacer geometry have significant effects on p d [30][31][32].
The membrane permeate flux J (L/m 2 ·h) is an important parameter which is given by Equation (23): During designing RO plants, the value of J is specified according to source water quality and membrane type. Comparing Equations (21) and (23), Another important factor in RO plant design is the permeate recovery factor R r which is the ratio of the permeate water to the feed water: The value of R r is usually in the range of 40-50% for large RO plants [21]. The well-known software IMSDesign [33] was used in this study to design the RO plant to be integrated in the system assuming that the maximum plant capacity of water production is 200,000 m 3 /day and average fresh water demand equals 180,000 m 3 /day (7500 m 3 /h). The RO design implemented in this study is a dedicated pump configuration in which each train is connected to a separated pump. This design is more flexible and ensures simple hydraulic control [26]. Figure 3 shows the RO membrane schematic diagram of the water flow for the RO process. The RO desalination plant consists of 16 trains; each one produces 521 m 3 /h (12,504 m 3 /day). Each train involves 100 vessels and each vessel comprises eight elements of SWC4 MAX RO membrane from Hydranautics. The detailed specifications of this membrane are available in [34]. train is connected to a separated pump. This design is more flexible and ensures simple hydraulic control [26]. Figure 3 shows the RO membrane schematic diagram of the water flow for the RO process. The RO desalination plant consists of 16 trains; each one produces 521 m 3 /h (12,504 m 3 /day). Each train involves 100 vessels and each vessel comprises eight elements of SWC4 MAX RO membrane from Hydranautics. The detailed specifications of this membrane are available in [34].  Table 2 shows the flow rate, pressure, TDS and electrical conductivity of each stream in Figure 3. The TDS is the total dissolved solids in the water and the PX in Figure 3 is a pressure exchanger which is an energy recovery device ERD that returns the pressure of the concentrated stream (no. 5) to a part of the feed stream (no. 8). The booster is a pump that boosts the stream 8 (which is few bars below stream 3) to the pressure of the HPP output.  Table 2 shows the flow rate, pressure, TDS and electrical conductivity of each stream in Figure 3. The TDS is the total dissolved solids in the water and the PX in Figure 3 is a pressure exchanger which is an energy recovery device ERD that returns the pressure of the concentrated stream (no. 5) to a part of the feed stream (no. 8). The booster is a pump that boosts the stream 8 (which is few bars below stream 3) to the pressure of the HPP output.

RO Plants Energy Consumption
In this research, we divide the RO desalination plant processes based on the control of power consumption into two categories: Uncontrolled processes (with fixed power consumption)-These are the processes whose power consumption is not controlled according to the need of the power grid.
Controlled processes (with variable power consumption)-This is the RO process that consumes most of the power in the RO desalination plants. From the IMSDesgin software, the rated pump power is 1.295 MW/pump at SEC pump = 2.49 kWh/m 3 and therefore, the total RO HPPs power is We assumed that the total RO plant SEC plant = 4 kWh/m 3 [26]. Hence, the SEC other_processes (the uncontrolled processes) equals As the rated RO plant product flow is 8333.33 m 3 /h then, the uncontrolled processes power consumption is which is~37.75% of total power consumption. Consequently, in this work, we control the HPPs power consumption (20.76 MW) and the RO plant uncontrolled processes power consumption (12.6 MW) is always considered.
The RO power consumption is controlled/adjusted using two control schemes: Constant recovery control and variable recovery control.

• Constant Recovery Ratio Control (CRRC) Scheme
This scenario can be applied when the VFD devices are not used to control the HPPs of the RO process. This scheme involves switching off some (or all) HPPs. The working HPPs will continue running at the normal operation with constant recovery ratio because they are separated from the others. This scheme requires some procedures to be implemented for safe ON/OFF RO trains operation. These procedures are applied to avoid damage of RO membranes and to prolong their operational life. For example, before RO trains shut down, a flushing process is recommended to remove the remaining brine water and contaminants. Moreover, it is recommended to apply the flushing process at a low pressure and low flow rate before RO trains start up to remove air from the membranes. After air is removed, the feed pressure is ramped up gradually at a rate not more than 0.69 bar per second [35]. The flushing process may take 15-30 min [35,36]. Consequently, implementing the CRRC scheme results in frequent shut-down and start-up processes, which imposes another restraint in time. The ON/OFF process time must not be less than 30 min. As this study is performed in hourly basis, this constraint in fulfilled.

• Variable Recovery Ratio Control (VRRC) Scheme
This scheme is implemented using VFD control to change the operating frequency of the HPPs and hence, the power consumption of the HPPs. The feed water pressure and flow change accordingly. The pressure of the feed water will change in a quadratic manner, as shown in Equation (15). The permeate water q p is related linearly to the feed water pressure (Equations (21) and (22)). However, the feed water flow q f is linearly related to the HPP speed; it will change linearly. Therefore, under VRRC, the new recovery ratio R VFD , will be Hence, the recovery ratio will vary linearly with the factor f in this control scheme. Moreover, applying VFD control will change the specific energy consumption (SEC) of the RO pumping section and hence, the overall SEC value of the RO plant. This is illustrated as follows: By definition, Under VFD control, the energy consumption will be P rated f 3 , and the permeates water flow is q rated f 2 , and therefore, Hence, we conclude that under the VFD control, the new SEC value will be the old SEC multiplied by the factor f.
However, during the VRRC scheme, there are some constrains that must be respected: 1.
The fresh water objective must be maintained at the end of the day so that the water security will not be affected.

2.
The minimum operating pressure of the HPPs must be higher than the osmotic pressure to prevent back flow. 3. The RO trains pressurization and depressurization must be conducted in a controlled way to avoid the mechanical damage of the system. Hydranautics recommends that the RO system be pressurized at no more than 0.69 bar/second to ensure no damage occurs to the membranes. As this study is performed at hourly time basis, this constraint is respected. 4.
The minimum frequency at which the HHPs can run must not be exceeded. This is taken as 80%-75% of the nominal frequency [37]. Thus, in this study, the minimum frequency was no lower than 80%. This is to avoid pumps heating and cavitation [38]. 5.
The salinity and temperature of the feed water are constant. 6.
At any instance, and for safe operation, the RO membrane pressure-temperature limits must not be exceeded. For Hyranautics membranes, the pressure-temperature limits is shown in the following fitted equation [39]: where p in bar and T in • C. We assume that the sea water temperature is 25 • C. Therefore, the designing feed pressure (69.1 bar) is well below the limit (79.68 bar).
The steps of the proposed RO plant energy consumption management are as follows: first, the electrical data at each bus and the solar radiation and ambient temperature data are defined. The loading of RO plant energy consumption is set to its maximum. Moreover, the RO process constraints are checked. Then the PV generation is calculated. Then, after defining the system buses load, the PV generation and RO power consumption, the power flow study is performed and the voltage profile is analyzed. If the minimum voltage is lower than the threshold value, the RO loading is reduced by one step till the minimum voltage is higher than the threshold. Then, the fresh water produced is checked, if it is lower than the objective, the voltage threshold value is lowered and the steps are repeated. This is repeated each hour. The reduction of the RO plant energy consumption is done by one train in ON/OFF control or by ∆f, which is assumed as 0.01 in this study in VFD control.

Base Case
This case represents a modified IEEE 30-bus system which involves the original case with a variable active and reactive load and with three solar PV power plants located at buses 2, 10 and 20. The rated peak power of each plant is 25 MWp. This case is the reference case in this study. Figure 4 shows the daily electrical active basic, net load (the total load minus the total PV power generation) and PV power generation. The shape of the basic load curve is similar to an actual real daily demand curve [40]. The maximum active power demand is 459.5 MW. The integration of solar PV power reduced the peak load from 459. 5

Base Case
This case represents a modified IEEE 30-bus system which involves the original case with a variable active and reactive load and with three solar PV power plants located at buses 2, 10 and 20. The rated peak power of each plant is 25 MWp. This case is the reference case in this study. Figure 4 shows the daily electrical active basic, net load (the total load minus the total PV power generation) and PV power generation. The shape of the basic load curve is similar to an actual real daily demand curve [40]. The maximum active power demand is 459.5 MW. The integration of solar PV power reduced the peak load from 459.5 MW at hour 16 to 433.36 at hour 18. To resemble the real conditions of power systems, the reactive power demand (not shown here) at each bus was also varied by a ratio equals to the original load Q/P ratio of the buses of the original IEEE 30-bus system.
The data of solar radiation and ambient temperature are real data for the city of Riyadh. The weather data were fitted using the Matlab fitting toolbox. Figure 5 shows the temperature and solar radiation fitted curves. To resemble the real conditions of power systems, the reactive power demand (not shown here) at each bus was also varied by a ratio equals to the original load / ratio of the buses of the original IEEE 30-bus system.
The data of solar radiation and ambient temperature are real data for the city of Riyadh. The weather data were fitted using the Matlab fitting toolbox. Figure 5 shows the temperature and solar radiation fitted curves.

RO Plant Integration without Power Consumption Control
This case represents the integration of RO plant at bus 10 with conventional operation of RO desalination plants. Typically, RO plants run at fixed operation and constant fresh water production. In this scenario, the RO plant runs at its full capacity and hence, consumes its full rated power (33.33 MW). The permeate water production is 200,000 m 3 /day. Since the fresh water demand is 180,000 m 3 /day, the surplus fresh water is assumed to be stored in tanks. This scenario represents the typical operation of RO desalination plants in which no consideration of electric grid is taken into account.

CRRC Scheme
This case represents the integration of RO plant at bus 10 with power consumption control. The adjustment of the hourly RO power consumption was performed by switching off some HPPs. After determining the number of operating RO trains M, the total power consumption is (M) 1.295 MW and the total fresh water production is (M) 521 m 3 /h. The voltage threshold value was 0.92 p.u. to ensure all voltage profiles through the day were above the permissible limit (0.9 p.u.) with a suitable voltage margin 0.02. Following this algorithm, Figure 6 shows the hourly RO power consumption under the CRRC. When electrical demand was light (hours 1-9) or solar PV power was available (hours 10-15), the RO power consumption was at the maximum because it did not affect the power system performance. Later, as the electrical demand increased and the solar PV generation declined, the RO plant power consumption was adjusted by shutting down some HPPs gradually. Before hour 16, the number of running trains was 16 units (all trains were ON) and the total power consumption was 33.33 MW. At hour 16, two train were switched off and therefore, the RO power consumption was reduced to 30.74 MW. At hour 17, another two trains were switched off (four trains were OFF). Then, the RO power consumption was 28.15 MW. At hour 18, the electrical demand was maximum and therefore, the RO power consumption was further reduced by shutting down another two trains. Hence, at hour 18, 6 trains were OFF and 10 trains were running and the RO power consumption was 25.55 MW. At hour 19, the electrical demand started declining and consequently, the RO power consumption increased by energizing three trains which raised the power consumption to 29.44 MW. Finally, at hour 20 all the trains were energized and the RO plant ran at its full capacity. Using this load management approach, the RO power consumption reacts with the power system and solar PV generation. The yellow bars represent the constant (uncontrolled) power consumption of the RO desalination plant which is~12.58 MW. sumption was 28.15 MW. At hour 18, the electrical demand was maximum and therefore, the RO power consumption was further reduced by shutting down another two trains. Hence, at hour 18, 6 trains were OFF and 10 trains were running and the RO power consumption was 25.55 MW. At hour 19, the electrical demand started declining and consequently, the RO power consumption increased by energizing three trains which raised the power consumption to 29.44 MW. Finally, at hour 20 all the trains were energized and the RO plant ran at its full capacity. Using this load management approach, the RO power consumption reacts with the power system and solar PV generation. The yellow bars represent the constant (uncontrolled) power consumption of the RO desalination plant which is ~12.58 MW.

VRRC Scheme
Under this scheme, the power consumption is controlled by adjusting the rotational speed of the HPPs via VFD electronic devices. Hence, the HPPs power consumption, operating pressure and feed water flow rate will change accordingly.
Under this scheme, the total power consumption is ( f 3 ) 20.76 MW and the total fresh water production is ( f 2 ) 8333.33 m 3 /h. Figure 7 shows the RO plant power consumption under the VRRC scheme. Before hour 16, the RO power consumed 33.33 MW which is the rated power consumption. During the electrical peak demand hours, the RO power consumption decreased gradually down to 26.2 MW by adjusting the frequency ratio from 100% to 96%, 91%, and 87% at hours 16, 17 and 18 respectively. At hour 19, the RO plant power consumption increased to~29.8 MW because the electrical demand decreases. The yellow bars represent the constant (uncontrolled) power consumption of the RO desalination plant.

VRRC Scheme
Under this scheme, the power consumption is controlled by adjusting the rotational speed of the HPPs via VFD electronic devices. Hence, the HPPs power consumption, operating pressure and feed water flow rate will change accordingly.
Under this scheme, the total power consumption is 20.76 MW and the total fresh water production is 8333.33 m /h. Figure 7 shows the RO plant power consumption under the VRRC scheme. Before hour 16, the RO power consumed 33.33 MW which is the rated power consumption. During the electrical peak demand hours, the RO power consumption decreased gradually down to 26.2 MW by adjusting the frequency ratio from 100% to 96%, 91%, and 87% at hours 16, 17 and 18 respectively. At hour 19, the RO plant power consumption increased to ~29.8 MW because the electrical demand decreases. The yellow bars represent the constant (uncontrolled) power consumption of the RO desalination plant.

Comparison between the RO Operational Schemes
This section compares the three RO operational scenarios. The comparison will be in terms of minimum voltage of the voltage profiles, power lines loadings, power lines power loss, amount of fresh water produced. The following factors are defined and used in comparison:

Comparison between the RO Operational Schemes
This section compares the three RO operational scenarios. The comparison will be in terms of minimum voltage of the voltage profiles, power lines loadings, power lines power loss, amount of fresh water produced. The following factors are defined and used in comparison: Minimum voltage = min(V i ) (p.u.) (33) where i = 1, . . . , 30 (no. of buses), Power line loading factor PLLF = ∑ MVA k ∑ PG y (MVA/MW) (34) where MVA is the apparent power flow in each branch and k = 1, . . . ., 45 (no of branches), PG is the active power generated and y = 1, . . . , 9 (number power generation units including PV plants).

Power lines active loss
where MWL is the active power loss in each branch. Figure 8 displays the minimum voltage profile variation under the three scenarios. The bus voltage undergoes steep changes (decline and raise) during the peak demand period under the typical RO operation. Moreover, the voltage profile has a very small voltage margin during the peak load hours, which implies that the system could experience voltage stability issues if any contingency event or/and sudden load increment occur. In contrast, when the RO load is managed, the voltage was flattened during that period. Therefore, it can be deduced that the RO load management improves the voltage stability. In contrast, when the RO load is managed, the voltage was flattened during that period. Therefore, it can be deduced that the RO load management improves the voltage stability.  Figure 9 demonstrates the evaluation factors for the three schemes. It shows that the VRRC scheme achieved a reduction in the PLLF factor and PLAL factor by 0.03% and 0.25%, respectively. The minimum voltage was 0.92 p.u. On the other hand, using the CRRC scenario attained a reduction in the PLLF and PLAL factors by 0.04% and 0.29%, respectively. Thus, the transmission lines loading and power loss are reduced under the schemes CRRC and VRRC.   Figure 9 demonstrates the evaluation factors for the three schemes. It shows that the VRRC scheme achieved a reduction in the PLLF factor and PLAL factor by 0.03% and 0.25%, respectively. The minimum voltage was 0.92 p.u. On the other hand, using the CRRC scenario attained a reduction in the PLLF and PLAL factors by 0.04% and 0.29%, respectively. Thus, the transmission lines loading and power loss are reduced under the schemes CRRC and VRRC. Figure 9 demonstrates the evaluation factors for the three schemes. It shows that the VRRC scheme achieved a reduction in the PLLF factor and PLAL factor by 0.03% and 0.25%, respectively. The minimum voltage was 0.92 p.u. On the other hand, using the CRRC scenario attained a reduction in the PLLF and PLAL factors by 0.04% and 0.29%, respectively. Thus, the transmission lines loading and power loss are reduced under the schemes CRRC and VRRC.

Impact of 5% Increment in Electrical Demand
In this section, the performance of the power system voltage; under the three RO operational schemes, was investigated in the case of 5% increment in the electrical demand. Figure 11 displays the mean and minimum voltage profiles under the three operational schemes and with the minimum voltage set to 0.9 p.u. As Figure 10 shows, the voltage experienced a sever voltage decline under the normal operation of the RO plant. The voltage is much lower than the permissible limit in most of the buses, which indicates a voltage collapse event. The RO plant will stop under the situation of voltage collapse. In contrast, the proposed management algorithm kept the voltage profile above the permissible limits (≥0.9 p.u.) and hence, protected the PS from blackout due to voltage collapse and prevented stopping the RO plant operation, which maintains the fresh water security. The voltage profiles of the CRRC and VRRC schemes are identical (red and orange Hourly permeate water production (m 3 /h) Figure 10. Fresh water hourly production rate of the three operational schemes.

Impact of 5% Increment in Electrical Demand
In this section, the performance of the power system voltage; under the three RO operational schemes, was investigated in the case of 5% increment in the electrical demand. Figure 11 displays the mean and minimum voltage profiles under the three operational schemes and with the minimum voltage set to 0.9 p.u. As Figure 10 shows, the voltage experienced a sever voltage decline under the normal operation of the RO plant. The voltage is much lower than the permissible limit in most of the buses, which indicates a voltage collapse event. The RO plant will stop under the situation of voltage collapse. In contrast, the proposed management algorithm kept the voltage profile above the permissible limits (≥0.9 p.u.) and hence, protected the PS from blackout due to voltage collapse and prevented stopping the RO plant operation, which maintains the fresh water security. The voltage profiles of the CRRC and VRRC schemes are identical (red and orange curves).

Impact of 5% Increment in Electrical Demand
In this section, the performance of the power system voltage; under the three RO operational schemes, was investigated in the case of 5% increment in the electrical demand. Figure 11 displays the mean and minimum voltage profiles under the three operational schemes and with the minimum voltage set to 0.9 p.u. As Figure 10 shows, the voltage experienced a sever voltage decline under the normal operation of the RO plant. The voltage is much lower than the permissible limit in most of the buses, which indicates a voltage collapse event. The RO plant will stop under the situation of voltage collapse. In contrast, the proposed management algorithm kept the voltage profile above the permissible limits (≥0.9 p.u.) and hence, protected the PS from blackout due to voltage collapse and prevented stopping the RO plant operation, which maintains the fresh water security. The voltage profiles of the CRRC and VRRC schemes are identical (red and orange curves).  Figure 11. The minimum voltage profiles and the 24 h mean voltage profiles for each scenario under 5% increment in electrical system demand.
The PLLF factor values are 2.437 for the two control schemes and 2.48 for the normal operation. The PLAL factor value is 0.0321 for the two control schemes and 0.037 for the normal operation. This indicates better utilization of the power lines under the proposed management algorithm.

RO Power Consumption Optimization
The aforementioned results reveal that typical operation of RO plants could cause voltage problems in some buses of the grid. Moreover, it was disclosed that reducing the RO energy consumption could resolve this issue to some extent. However, the management of RO plants operation may result in water shortage or unsatisfied water demand. Therefore, there is a need for an optimization study to find the optimal situation that compromises the two opposing requirements.
Hence, this section studies the optimization of RO energy consumption under the proposed algorithm, so that we ensure not to unreasonably restrict the RO operation and results in water shortage problem. The particle swarm optimization (PSO) algorithm is used to maximize the RO energy consumption. The objective function is the HPPs power consumption given in Equation (16). Both of the parameters M and f can be selected as a control variable. However, we chose only the factor f as a control variable because switching off running HPPs is not preferred. Since the RO plant consists of 16 trains, the dimension of the control variable will be 16 (f 1 , f 2 , . . . , f 16 ). The formulation of the optimization algorithm is as follows Subjected to the voltage constraints in Equation (7): And the fresh water production constraint: Fresh water produced ≥ objected amount The voltage constraint is bounded by upper and lower boundaries and the fresh water production is bound by a lower boundary. The upper boundary of the fresh water production is the maximum capacity of water desalination which is inherently respected.
Each control variable f is bounded by the range [0. . In total, 100 iterations and 50 particles were used in the PSO algorithm. Figure 12 shows the optimized RO power consumption compared to the non-optimized one (Figure 7). The figure shows only the results for the electrical peak load hours, because during the light load periods, they are identical. The optimal consumption improved the loading of the RO plant by raising the energy consumption during the peak load hours. The optimal consumption is higher than the non-optimal one by 2.83 MW. This is a significant difference for one day. This improvement will accumulate for long periods like a one month or one year. Table 3 shows the dynamic adjustment of the frequency factor f of the 16 HPPs for the optimal consumption during the peak load hours. The optimization algorithm enabled adjusting only the needed HPPs at each hour and avoided unnecessarily adjustment of all HPPs. For example, at hour 17, nine HPPs were controlled. Out of them, five HPPs were operated at f = 0.8, and the other HPPs were adjusted at 0.84, 0.87, 0.92 and 0.97. Hence more flexibility is provided and the number of controlled HPPs is proportional to the hourly electrical demand.  The total fresh water production under the optimal scenario is 195,827 m 3 . This is 0.467% more than the VRRC scheme total water production (194,917 m 3 ) and 1.89% more than the CRRC scheme total water production (192,190 m 3 ).  The total fresh water production under the optimal scenario is 195,827 m 3 . This is 0.467% more than the VRRC scheme total water production (194,917 m 3 ) and 1.89% more than the CRRC scheme total water production (192,190 m 3 ).

Conclusions
This study investigated in details the implementation of load management on big RO desalination plants in order to enhance the voltage stability of power systems under RE integration. A voltage-based loading algorithm was proposed to link the RO power consumption to the conditions of the power system. Two control schemes were presented and applied: CRRC scheme which involves changing the number of running RO HPPs/trains according the RE and the power system conditions.
The second control scheme was VRRC using the VFD control. In this scheme, the rotational speed of the HPPs (the most power consumers inside the RO plants) was controlled in order to change the operating point of the pumps and hence, their power consumption, feed water flow and feed pressure. The two operational schemes were compared to the typical constant operation of RO plants.
The results show that RO plants can play an important role as a flexible load in power systems. Controlling the power consumption of big RO plants can maintain voltage stability and avoid voltage violation that occurs due to the incoordination between the RO plants and power systems operation. The proposed management approaches kept the power system voltage within the permissible limits, even when electrical demand increased. The power lines' loading and losses were also reduced by 0.03% and 0.25% using the VRRC scheme and by 0.04% and 0.29% using the CRRC scheme. Moreover, the fresh water production was not affected under the proposed schemes.
Finally, RO energy consumption was optimized to guarantee that the RO plant operation and fresh water supply were not unintentionally confined.