Influence of multivalent ions on renewable energy generation in reverse electrodialysis†

Renewable energy can be generated when mixing seawater and river water. This energy is captured in reverse electrodialysis (RED) using ion exchange membranes. Although natural sources of seawater and river water are composed of a mixture of monovalent and multivalent ions, laboratory research on RED is generally performed with artificial solutions of sodium chloride. This research demonstrates that the presence of magnesiumand sulphate ions in feed solutions with NaCl has a major effect on the obtained open circuit voltage and power density for three different membrane types. When using a mixture with a molar fraction of 10% MgSO4 and 90% of NaCl in both feed waters, the experimentally obtained power density in steady state decreases from 29% to 50% compared to the case where the feed solutions contain only NaCl as a salt. This effect is among others explained by the transport of Mg and SO4 2 against their concentration gradient, as is elaborated in a theoretical framework and which is justified by experimental data. Non-stationary cases, where feed water is switched from a NaCl solution to a mixture of NaCl and MgSO4, show that the voltage response time is in the order of tens of minutes up to several hours, due to ion exchange between the membranes and the feed water. The knowledge gained from electrochemical measurements under stationary and non-stationary conditions and a novel technique to monitor the ion transport inside cation exchange membranes can be used to improve the obtained power density in practical applications of RED using natural feed water.


Introduction
Renewable energy can be generated from mixing salt water, such as seawater, and fresh water, e.g. river water, using reverse electrodialysis (RED). [1][2][3][4][5] This available energy from salinity differences can be captured using ion exchange membranes, which are selective for cations (cation exchange membranes, CEMs) or anions (anion exchange membranes, AEMs). The salinity difference induces a potential difference over the membranes when seawater is supplied at one side and river water is supplied at the other side of the membrane. Stacking the CEMs and AEMs alternately, with seawater and river water supplied in between, accumulates the voltage. When electrodes are introduced at the outer ends of the membrane pile, this voltage can be used to generate a redox reaction, 6,7 or for capacitive storage, 8,9 which enables an electrical current when an external circuit is connected.
The potential to generate power from the mixing of seawater and river water is huge, as approximately 2 TW can be generated theoretically from the global river water runoff. 10,11 This is close to the current worldwide electricity demand. 12 Additionally, salinity gradient power can be generated by mixing brine (e.g., from salt water lakes) and seawater or fresh water. 13 For articial feed water and laboratory conditions, high energy efficiencies (>50%) 3,14 and high gross power densities (>2 W m À2 ) 15 can be obtained. However, the obtained power and energy efficiency decrease rapidly when natural feed water sources are used. A recent study on RED using natural feed water for 25 days indicated that the power density decreased to approximately 50% of the initial power at a timescale of several hours. 16 This result implies that articial feed water composed of pure NaCl solutions under laboratory conditions is not representative for natural feed water, although the dominant dissolved species in natural feed water is NaCl.
The decrease in power density as observed in previous research when using natural feed waters was among others attributed to organic foulants. 16 Additionally, the presence of multivalent ions was identied to be a limiting factor for the obtained power density. 16 Organic foulants, such as humic acids, are known to shield the charged groups of the ion exchange membranes and consequently lower the selectivity and increase the membrane resistance. 17,18 The negative impact of multivalent ions on the obtained power density in RED is less well known.
Only very limited research is done on the effect of other salts than NaCl, such as MgSO 4 , on the obtained power in RED. 19,20 Post et al. 19 indicated that MgSO 4 in the feed water reduces the stack voltage and increases the stack resistance compared to solutions with NaCl only. 19 Lacey et al. 21 indicated that multivalent ions such as iron, borates and silicates may shield the membrane charge irreversibly, which would decrease the membrane permselectivity and increase the membrane resistance. Quantitative results on the obtained power density and the typical timescale of the effects of multivalent ions are lacking, while they may have a major impact on the power density in practical applications of reverse electrodialysis.
Previous research on multivalent ions in electrodialysis (ED) cannot be used a priori for RED, as some effects may work similarly (e.g. effect on membrane resistance) but other effects work differently in ED to those in RED (e.g. direction of ion transport). In order to identify and understand the negative effect of multivalent ions on the power density in RED, the stationary and non-stationary effects of monovalent ions, multivalent ions and mixtures thereof need to be investigated systematically. Such research will explain the cause of the rapid decrease of approximately 50% in power density observed when using natural feed waters instead of articial NaCl feed solutions. 16 This paper unravels the effect of the presence of MgSO 4 in feed waters on the RED performance and explains the underlying mechanisms. The use of MgSO 4 provides an indication of the effects of multivalent ions in feed water in general, as the concentrations of Mg 2+ and SO 4 2À are typically highest aer Na + and Cl À in natural feed water. 16 The concentration of MgSO 4 in the feed water is systematically varied and the RED performance in terms of voltage, resistance and power density is analyzed. Additionally, the effect of the type of membrane and the distribution of MgSO 4 in the membranes using SEM-EDX is investigated. The results show how RED can be operated using feed mixtures of NaCl and MgSO 4 , as a representative for natural feed waters, while maintaining a high power density.

Electromotive force
The supply of waters with different salinity on either side of an ion exchange membrane creates a voltage over that membrane due to the Donnan potential at the membrane-water interface. This voltage is given by the Nernst equation, corrected for the activity of the feed waters and the apparent permselectivity of the non-perfect membrane: 22 in which E is the electromotive force over the membrane (V), a is the apparent membrane permselectivity of the membrane (-), R is the universal gas constant (8.314 J mol À1 K À1 ), z i is the valence of the ionic species i (-), F is the Faraday constant (96 485 C mol À1 ), and a i is the activity of ionic species i in the feed water (M). The subscripts s and r indicate seawater or river water, respectively. Eqn (1) shows that the salinity ratio of monovalent ions (e.g. Na + , Cl À ) creates twice the voltage created by the same salinity ratio of divalent ions (e.g. Mg 2+ , SO 4 2À ), assuming that the activities and apparent membrane permselectivity remain constant.

Uphill transport
However, transport is more complex when a mixture of monovalent and multivalent ions is present at both sides of an ion exchange membrane. [23][24][25][26] In that case, ions are exchanged through the membrane, in order to obtain equilibrium in chemical potential at both sides of the membrane. 23 This can be illustrated using an exemplary system with NaCl and MgSO 4 at both sides of a cation exchange membrane (CEM), in the same ratio but at different concentrations, as illustrated in Fig. 1.
Because of the valence of the ion, the electromotive force related to the difference in [Na + ] is larger than that of [Mg 2+ ] (see eqn (1)). Hence, Mg 2+ is transported from the dilute solution to the concentrated solution in exchange for double the amount of Na + in the opposite direction (Fig. 1B), to obey electroneutrality at both sides of the membrane. The transport of Mg 2+ against the concentration gradient is described in the literature as the uphill transport. 19,23 This system can be illustrated in an electrical circuit, having two power sources with an unequal voltage (Fig. 1C) in parallel. The source with the lowest voltage will be loaded, at the cost of the source with the highest voltage. The membrane resistances for Mg 2+ and Na + -ions, which are illustrated in the electrical circuit as an electrical resistance, slow down the uphill transport of Mg 2+ .
The uphill transport of Mg 2+ sacrices the salinity difference of the monovalent species, in this case Na + , while at the same time no net charge transport is obtained. As a consequence, the presence of multivalent ions causes an irreversible loss in the available energy from monovalent ions. 19 A similar process occurs at the anion exchange membrane (AEM) for Cl À and SO 4 2À .
The uphill transport stops when the salinity differences are such that the electromotive forces of both ionic species are equal. This can be best dened considering the case in which the feed waters are not refreshed (i.e., a batch process). Using eqn (1) and assuming that the apparent permselectivity is equal for both ionic species, this stationary situation is reached when the ion activities at either side of the membrane obey: The molar transport of Mg 2+ , in exchange for 2Na + , can then be calculated as a function of the initial feed water concentrations and the activity coefficients. When the changes in feed water concentration are regarded small, the activity coefficients g (-) can be assumed constant, and the molar transport of Mg 2+ can be solved from: in which c is the salt concentration of Na + or Mg 2+ (M), J is the molar transport (mol) of Mg 2+ towards the seawater compartment and V is the volume of the compartments (L). The uphill transport J can be calculated numerically from eqn (4). The molar transport J as a function of the fraction of MgSO 4 in the feed water is given in the ESI (Fig. S1 †). The initial concentrations plus or minus the uphill transport yield the nal concentrations of Na + and Mg 2+ when uphill transport completes.

Theoretical energy and voltage
The available energy from mixing solutions with different concentrations can be derived from the Gibbs free energy of mixing. 27 When using mixtures of salts, the contribution of each ionic species to the available energy can be calculated individually considering the molar fraction of that specic salt only. Such a calculation has been performed for mixtures of the monovalent salt NaCl and the multivalent salt MgSO 4 , disregarding uphill transport. In addition, the available energy is calculated for the concentrations aer uphill transport, as are derived from the equilibrium condition in eqn (3). These calculations of the available energy are shown in Fig. 2A as a function of the molar salt fraction of MgSO 4 in both the seawater and river water feed. Fig. 2B considers the open circuit voltage over a perfectly selective membrane, when uphill transport is completed, as a function of the fraction of MgSO 4 in both feed waters. The voltage without considering uphill transport cannot be given, as the voltage due to the monovalent species conicts that of the multivalent species. In addition, Fig. 2B shows the cases in which MgSO 4 is only present in the seawater feed or river water feed. Fig. 2A shows that the available energy decreases when a larger fraction of NaCl is substituted for MgSO 4 , even when disregarding the loss due to uphill transport. The contribution of NaCl decreases practically linearly, proportional to the molar fraction of NaCl, due to the lower concentrations of NaCl. However, the contribution of MgSO 4 cannot compensate for this decrease in available energy, due to the relatively low activity coefficients for MgSO 4 , which effectively limit the increase in entropy when mixing the feed waters. Hence, the total available energy of a mixture of NaCl and MgSO 4 is lower than when using NaCl only. This effect is inevitably related to the use of MgSO 4 as a salt and hence will also be relevant to other salinity gradient power technologies such as pressure retarded osmosis (PRO) 27,29 and capacitive mixing (CAPMIX). 9,30,31 The uphill transport of MgSO 4 , and the corresponding exchange for NaCl, further limits the available energy in RED. Because two moles of NaCl are exchanged for one mole of MgSO 4 , available energy is lost when uphill transport of MgSO 4 occurs. This irreversible loss is largest for a fraction MgSO 4 of approximately 60%, where it accounts for approximately 10% of the available energy. The maximum is found at this particular fraction due to a combination of large uphill transport J (eqn (4)) when both ionic species are present in signicant fractions and the different contributions of NaCl and MgSO 4 to the available energy.
The open circuit voltage (OCV) over each ion exchange membrane decreases relatively much more than the total available energy when increasing the fraction of MgSO 4 in the feed water (Fig. 2B). When MgSO 4 is mixed in both feed waters, the OCV decreases from approximately 80 mV for feed water without MgSO 4 to little more than 20 mV for feed water with MgSO 4 only. This decrease is much larger than that for the available energy, mainly due to the fact that the valence (z i ) appears in the denominator in eqn (1). Hence, the voltage is halved for solutions with MgSO 4 only compared to NaCl only even when equal activities would be considered.
Additionally, uphill transport plays a larger role in the OCV because the salinity ratio, which determines the OCV, is more sensitive to small changes in the river water concentrations than the available energy. Although it is impossible to calculate the voltage without uphill transport, the effect of the uphill transport is visible when considering the cases in which a fraction of MgSO 4 is present in the seawater or in the river water only. As shown in the ESI, † the case with MgSO 4 in the seawater only, at fractions <80%, has a minimum of uphill transport. The difference between this case and the other two cases provides an indication of the uphill transport effect on the open circuit voltage. Fig. 2B shows that uphill transport has substantial inuence on the obtained voltage, and hence on the power density, while the effect is rather small for the available energy ( Fig. 2A).
In practical cases, the fraction of multivalent ions in seawater (typically 10% 16 ) is oen lower than that in river water, which makes the uphill transport extra relevant. The uphill transport as demonstrated for MgSO 4 occurs similarly for other multivalent ions. As a consequence, scaling of poorly soluble multivalent salts (such as calcium phosphates) is possible at the seawater compartments, which was already observed in RED using natural feed water. 16 The use of monovalent selective membranes reduces the disadvantageous inuence of multivalent ions 19 and hence increases the actual obtained voltage. A perfectly monovalent selective membrane would induce an open circuit voltage that is based on the difference in NaCl concentration only, i.e., approximately 80 mV for all fractions of MgSO 4 in Fig. 2B. Although this would signicantly improve the obtained voltage, and hence the power density, the existing monovalent selective membranes do still allow a substantial part of the multivalent ion transport. 19,32 Power density The much lower open circuit voltage, but only slightly lower available energy, suggests that a larger membrane area is required to capture an equal portion of the available energy when a fraction of MgSO 4 is present in the feed water. In other words, the power density is expected to be lower when the fraction of multivalent ions is increased. The obtainable power  (5) in which P dens is the power density (W m À2 membrane area), N m is the number of membranes (-) and R stack is the electrical area resistance of the RED stack (U m 2 stack cross-sectional area). The electrical resistance is composed of an ohmic contribution, due to the membrane, feed water and spacers, and a non-ohmic contribution, due to the concentration changes when ions are transported under the inuence of an electrical current. Although this theoretical framework helps to understand the effect of MgSO 4 , the actual open circuit voltage, electrical resistance and power density are more complex to calculate. For example, the equilibrium as described in eqn (4) assumes a batch mode and hence disregards the supply of new feed water. Therefore, the actually generated voltage, electrical resistance and obtained power in RED need to be investigated experimentally, which is described in the next section.

Experimental setup
Stack Three RED stacks were built, each with different ion exchange membranes. One stack was composed of heterogeneous membranes (Ralex CMH/AMH, MEGA AS, Czech Republic), a second stack was composed of commercial homogeneous membranes (Neosepta CMX/AMX, Tokuyama, Japan) and a third stack was composed of a new type of homogeneous membranes (V1 CEM/V1 AEM, Fujilm Europe, The Netherlands). The specications of these membranes are listed in Table 1.
These membranes are selected to observe the effect of MgSO 4 for different types of membranes (heterogeneous and homogeneous) and possible difference in (uphill) ion transport due to the differences in membrane thickness and membrane resistance.
A woven net spacer of 200 micrometer thickness (Sefar 06-300/51, Switzerland) was used in between the ion exchange membranes to create alternately compartments for salt water and fresh water. The spacer geometry, gaskets and inow geometry were described in previous studies. 3,33 All stacks were conned between two endplates with embedded Ti-Ru/Ir mesh electrodes (MAGNETO Special Anodes B.V., The Netherlands) with a dimension of 10 cm by 10 cm.
The electrode rinse solution, composed of 0.05 M Fe(CN) 6 3À/4À and 0.25 M NaCl, was circulated in the electrode compartments at a ow rate of 150 mL min À1 and kept at a static overpressure of 0.5 bar to ensure that the membranes are closely packed. The stack with Fujilm membranes was equipped with additional buffer compartments similarly to a previous study, 34 created by a Neosepta CMX membrane between the membrane pile and the electrode compartment. This buffer compartment was circulated with 0.25 M NaCl. The buffer compartment was installed in this case to avoid leakage of the electrode rinse solution towards the feed water, which was no issue with the other membrane types.
To correct for the additional resistance of the electrode compartment and the possible buffer compartment, the resistance of an empty stack, composed of two electrodes, corresponding electrode compartments and possibly buffer compartments, was measured. The resistance of such a blank was used to correct the resistance of the measurement series, and allowed comparison of the different stacks.

Feed water
Salt and fresh water streams, composed of a mixture of dissolved NaCl (99.5% purity, ESCO, The Netherlands) and/or MgSO 4 , MgCl 2 or Na 2 SO 4 (at least 98% purity, VWR, The Netherlands), were fed into the RED stacks. The total salt concentration of the articial seawater was 0.508 M in all cases, whereas the total salt concentration of the articial river water was always 0.017 M. In other words, compared to articial solutions with only NaCl, part of the NaCl was replaced with MgSO 4 , MgCl 2 or Na 2 SO 4 , in order to maintain the molarity of the inowing feed (and hence the conductivity, to a certain degree) constant.
When considering mixtures of NaCl and MgSO 4 , a molar percentage of 0%, 5%, 10%, 25%, 50% or 100% of the total dissolved salt was accounted for by MgSO 4 . This percentage was equal for both feed water streams. The remaining amount of dissolved salt was NaCl. When considering the mixtures of NaCl and MgCl 2 or Na 2 SO 4 , 10% of the dissolved salts was MgCl 2 or Na 2 SO 4 and the remaining 90% was NaCl.
All stacks were rst fed with solutions containing 0.508 M NaCl and 0.017 M NaCl, to equilibrate the membranes with NaCl solutions. Aer at least one hour of operation, the feed water solutions were suddenly switched to one of the previously described mixtures. The stacks operated for at least 4 hours using these solutions before switching back to solutions with dissolved NaCl only. The effluent was sampled and effluent concentrations were measured using ion chromatography (IC) and inductively coupled plasma (ICP).

View Article Online
The ow rate of the feed water solutions was 60 mL min À1 in all cases, which is equivalent to a ow velocity of 1.3 cm s À1 and a Reynolds number of 5. The effluent was not re-cycled, i.e., new feed water was supplied continuously. The temperature of the feed waters was maintained at 25 AE 1.5 C.

Electrochemical measurements
A chronopotentiometric series was applied (Ivium Technologies, The Netherlands), comprising a stage with no current (open circuit) and a stage with a current density of 10 A m À2 . Both stages were applied for 60 seconds and repeated continuously. The stack resistance was calculated from the difference in voltage at these two stages, divided by the current density.
Some measurements were duplicated to check the reproducibility. The steady voltages of these duplicates were typically within 3% of the original series.
In addition, the open circuit voltage over a single membrane (CEM or AEM, 10 cm Â 10 cm) was measured, using a single membrane enveloped with only two compartments for feed water connected to an Ag/AgCl reference electrode (QIS, The Netherlands). The same feed water solutions as for the stacks were used for these individual membrane setups and were supplied at a ow rate of 12 mL min À1 .

Membrane cross-sections
To study the ion transport through the membranes, the position of the ionic species in the membrane cross-sections was iden-tied with energy dispersive X-ray spectra (EDX or EDS). Membrane cross-sections were made for all membranes, aer 0, 2, 15, 30, 45 and 300 min of operation with feed water solutions in which 10% of the salt concentration was MgSO 4 and 90% was NaCl.
Aer this specied duration, the stacks were opened, the membranes were rinsed in demineralized water and directly frozen in liquid nitrogen to conserve the position of the ions in the membranes. The process to stop the stack operation, dismantle the stack and freeze the membranes took approximately 1 minute. Subsequently, the frozen membranes were broken and freeze dried (Edwards, United Kingdom).
The EDX analysis (JEOL, JSM 6010LA, United States) was performed over at least two cross-sectional lines of each sample, each comprising at least 10 scan points. The average atomic percentages of the detected elements of Na, Cl, Mg and S were calculated. More details on the EDX analysis are provided in the ESI. †

Results and discussion
The results will rst comprise the stationary RED performance with different NaCl-MgSO 4 mixtures, which is representative for large-scale operations with steady feed water conditions. Subsequently, the transition from one feed to another feed is presented, which resembles the cases where e.g. tides cause uctuating feed water concentrations.

Stationary open circuit voltage
The open circuit voltages (OCV) for steady operation are shown in Fig. 3 for stacks with Ralex, Neosepta or Fujilm membranes, as a function of the percentage of MgSO 4 to the total dissolved salt of both feed water streams.
The open circuit voltage decreases when more MgSO 4 , relative to the total amount of dissolved salt, is present in the feed water (Fig. 3). This decreasing trend was expected, as demonstrated already in Fig. 2B. The open circuit voltage is highest for the stack with Neosepta membranes, due to the high charge density of these membranes 35,36 and the high permselectivity according to its specications ( Table 1).
The open circuit voltage is close to the theoretical voltage for perfectly selective membranes in the case of 0 or 100% MgSO 4 , which indicates that the membranes are highly selective and coions are excluded in these cases. The exclusion of co-ions is dependent on the electrical force on these ions, which is proportional to the product of the Donnan potential and the ion charge. In other words, co-ions are optimally excluded when a high Donnan potential is available and all co-ions have a high valence, as all co-ions experience the maximum electric force expelling them from the double layer in this case. The relatively high selectivity for 0% MgSO 4 is well known and originates from the high Donnan potentials that exclude the co-ions effectively from the double layer when using monovalent ions only. On the other hand, when using multivalent ions only, the high ionic charges (2+ or 2À) exclude the co-ions from the double layer, which is visible as a good agreement between the theoretical and experimental values at 100% MgSO 4 . However, the experimental OCV is lower than the theoretical one when mixtures of monovalent and multivalent ions are used. This is explained from the combination of relatively low Donnan potentials (due to the presence of multivalent ions) and relatively low valence of the monovalent co-ions, which increases the permeation of co-ions through the ion exchange membranes. 24 In this case, more monovalent cations will permeate through the AEMs and more monovalent anions through CEMs, compared to solutions with purely monovalent or multivalent ions. In other words, the permeation of co-ions through the non-ideal membranes is an increasing issue when using a mixture of monovalent and multivalent ions. This coion transport is not taken into account for the theoretical curve, as the theory assumes a perfect 100% selective membrane under all conditions (a ¼ 1). The actual apparent permselectivity is lower when using mixtures of monovalent and multivalent ions, which results in a lower open circuit voltage than the theoretical equivalents. This effect is signicant, and even more pronounced in the power density which is dependent on the OCV squared (eqn (5)).

Stationary power density
The area resistance and obtained power density for steady operation are shown in Fig. 4 for stacks with Ralex, Neosepta or Fujilm membranes, as a function of the percentage of MgSO 4 to the total dissolved salt of both feed water streams.
The ohmic resistance increases slightly with increasing MgSO 4 fraction for all membrane types (Fig. 4A), due to higher membrane resistance as well as slightly lower conductivity of the feed water. A higher electrical resistance in the case of mixtures with MgSO 4 was observed before 19 and can be explained from the slightly lower diffusion coefficients of Mg 2+ and SO 4 2À compared to Na + and Cl À . Additionally, steric hindrance of the larger (hydrated) Mg 2+ and SO 4 2À ions possibly plays a role. 37 Nevertheless, the increase in ohmic resistance is less pronounced than the decrease in open circuit voltage when increasing the fraction of MgSO 4 . The non-ohmic resistance on the other hand does not change signicantly (not shown), as this contribution is mainly dependent on the hydrodynamics of the feed water. [38][39][40] The decreasing OCV and to a lesser extent the increasing ohmic resistance are reected in the obtained power density (Fig. 4B). Because the power density is proportional to the OCV squared, the power density decreases rapidly when increasing the fraction of MgSO 4 in the feed water. When the salt in the feed water comprises only 10% MgSO 4 , which is most representative for typical seawater and river water, the power density decreases with 29% (Fujilm), 37% (Neosepta) and even 50% (Ralex) compared to pure NaCl as feed. This large decrease in power density emphasizes the importance of the open circuit voltage when using mixtures of NaCl and MgSO 4 .

Membrane voltage
To further understand the behavior of NaCl-MgSO 4 mixtures, the individual effect of Mg 2+ and SO 4 2À is investigated separately using mixtures with MgCl 2 or Na 2 SO 4 next to NaCl. The obtained open circuit voltages using single membranes (CEM or AEM) are shown in Fig. 5. Fig. 5 shows that the type of cation (Mg 2+ or Na + ) only affects the voltage over the CEMs signicantly, while the type of anion (SO 4 2À or Cl À ) only inuences the voltages over the AEMs signicantly. This is a direct effect of the charge selectivity of the ion exchange membranes. Ralex membranes show the largest decrease in OCV when comparing 100% NaCl to 10% MgSO 4 /90% NaCl, while these membranes feature the largest membrane resistance. Apparently, the uphill transport is not strongly inuenced by the membrane resistance. This can be explained from the concept of the double layer at the membrane-water interface. A very small ux of ions through the membrane (due to uphill transport) is sufficient to bring the concentration in the thin double layer to equilibrium with the chemical potential and determine the voltage over the membrane. Therefore, the membrane resistance does not play a signicant role for this ion transport in the stationary case.
The reason that Ralex membranes demonstrate even largest decreases in OCV when mixtures of monovalent and multivalent ions are present is that these membranes have a relatively low xed charge density. 35 Therefore, these membranes feature a relatively low permselectivity, especially when mixtures of monovalent and multivalent ions are used. As explained before, the combination of relatively low Donnan potentials due to the presence of multivalent ions and monovalent co-ions increases the permeation of coions through the ion exchange membranes. 24 Both homogeneous membrane types (Neosepta and Fujilm) show only a minor decrease in OCV due to the presence of multivalent counter-ions when compared to Ralex membranes (Fig. 5). The Neosepta membranes have a higher xed charge density than the Ralex membranes (Table 1). 35 The charge density of Fujilm membranes is not specied, but it is expected to be more or less similar to that of the homogeneous Neosepta membranes.
The presence of Mg 2+ generally induces a larger decrease in membrane voltage for CEMs (Fig. 5A) than the presence of SO 4 2À does for AEMs (Fig. 5B). This may be due to the formation of ion pairs of sodium and sulphate, NaSO 4 À , which is effectively a monovalent ionic species. 41 Hence, the OCV for a stack with CEMs and AEMs will decrease less pronounced when SO 4 2À is present than when Mg 2+ is present.

Mass transport
The ionic transport rate, among others, of the uphill transport, can be analyzed when considering the salinity ratio (seawater to river water) of individual ionic species in the effluent. In the inuent, all ions have a salinity ratio of 30 : 1 between the seawater and river water feed. The ratio of each ionic species in the effluent, when using 10% MgSO 4 in both feed waters, is shown in Fig. 6 as a function of the current density, for the stack with Neosepta membranes. Similar results are obtained for stacks with Ralex or Fujilm membranes (see ESI †). Fig. 6 shows that the ratio for all considered ions in the effluent decreases for increasing current density, as a higher ionic current directly implies a larger ionic ux from seawater to river water. In other words, a part of the available energy is used. However, also when no electrical current is generated, the concentration ratio for the monovalent ions in the effluent is already signicantly lower than 30. This is explained from the uphill transport of multivalent ions, in exchange for monovalent ions.
This uphill transport of multivalent ions is proven from the concentration ratio for Mg 2+ and SO 4 2À , which is signicantly higher than 30 when no current density is generated. The  concentrations of SO 4 2À are more pronounced than that for Mg 2+ , due to a lower resistance of the AEM compared to the CEM and the higher diffusion coefficient of the used anionic species than that of the cationic species. 42 Although the high concentration ratios of the multivalent ions clearly indicate uphill transport, the concentration ratios for multivalent ions are expected to be even higher based on the theoretical framework (eqn (3)). This discrepancy is also observed in previous research, 19 and justies the concept that the concentrations in the double layer (which determine the OCV) adapt quickly while the effluent concentrations are dominated by the concentrations in the bulk uids. The continuous feed water ow prevents that the concentrations in the bulk uids equilibrate with these in the double layer. The concentration ratios for multivalent ions decrease sharply when the current density increases. This is caused by a decrease in voltage over each membrane, due to an ohmic and non-ohmic voltage drop. Such a decrease in voltage reduces the electromotive force for uphill transport of multivalent ions at a higher current density. As a consequence, this effect shis the optimum current density to a higher value for a system with a mixture of monovalent and multivalent ions.

Non-stationary performance
The previous results discussed stationary performance, i.e., when feed water with the same concentrations is fed for a long time. Non-stationary cases, for example when feed water with monovalent ions only is suddenly replaced by feed water with mono-and multivalent ions, allow the mass transport mechanisms to be analyzed in the membrane, double layer and feed water bulk. The power density as a function of time aer such feed water change is shown for all stacks in Fig. 7.
In all cases, the steady power densities for the stack with heterogeneous Ralex membranes are lower than for the stacks with homogeneous membranes, especially when mixtures of NaCl and MgSO 4 are used, as already demonstrated in Fig. 3.
However, the non-stationary power density in Fig. 7 reveals that the stack with Ralex membranes responds slower than the stack with Neosepta membranes and this is even more pronounced when compared to the stack with Fujilm membranes. When using a mixture with 10% MgSO 4 , the power density does not reach a constant value aer 4 hours of operation in the case of Ralex membranes, while for Fujilm membranes the power density is rather constant aer 0.5 h already. These differences in response time are also observed when the feed water is switched back to feed water with NaCl only (not shown).
The decrease in power density and the corresponding response time match qualitatively and quantitatively very well with previous experiments with real natural feed water, in which Ralex membranes were used and approximately 10% of the ions is multivalent. 16,43 Comparing this practical case with the present experiments with Ralex membranes and 10% MgSO 4 , the power density decreases in both cases by approximately 50% in a typical timescale of hours. Therefore, this articial mixture of monovalent (90%) and multivalent (10%) ions is considered to be representative for at least the rst hours of operation of RED with natural feeds.

Membrane cross-sections
The slow response of the power in the case of mixtures with MgSO 4 is the consequence of the limitations in ion exchange between the membrane and the double layer and that between the double layer and the diffusive boundary layer. The double layer, which is as thin as only a few nm, experiences hardly any ion transport from the bulk uid by convection and hence is strongly inuenced by the ionic composition of the membranes. The Ralex membranes are much thicker than the homogeneous membranes, and therefore have the largest NaCl buffer when switched to a solution with a fraction of MgSO 4 . This process suggests a gradual change of the counter-ions within the membrane interior over time. Fig. 8 shows the percentage of magnesium elements relative to the total counter-ions (magnesium + sodium) in cross-sections of the cation exchange membranes of Ralex, Neosepta and Fujilm, for different durations of operation on feed water with 10% MgSO 4 -90% NaCl. Fig. 8 shows that the interior of the cation exchange membranes does not contain any magnesium before switching to feed water with MgSO 4 (i.e. at 0 min) within the accuracy of the measurement. The contribution of magnesium strongly increased to 30% to 60% of the total amount of counter-ions aer 300 minutes of operation with feed water with 10% MgSO 4 . The relatively large fraction of magnesium in the membrane material is explained from its high valence (z ¼ 2 for Mg 2+ ) compared to Na + (z ¼ 1). Therefore, Mg 2+ binds stronger to the negative xed membrane charges than Na + does. This results in a relatively large fraction of magnesium elements in the membrane aer 300 min. The strong affinity for Mg 2+ of the CEMs explains why the ohmic resistance is most sensitive to only small fractions of MgSO 4 , as observed already in Fig. 3B.
When considering the Ralex membrane in more detail, the gradient in the relative concentration of magnesium is directed from the seawater compartment towards the river water compartment aer 15 min, while it is opposite aer 300 min of operation (Fig. 8A). The exact shape of this curve cannot be determined due to the limited accuracy, but the contributions of MgSO 4 at the seawater side are signicantly different from those at the river water side. Both observations are expected based on the theoretical framework. Because the ionic current is directed from the seawater compartment towards the river water compartment, magnesium enters the membrane initially from the seawater side, which explains the prole at 15 min. When steady concentration proles are established in the membrane (i.e., at 300 min), the concentration gradient of multivalent ions should be directed towards the highest concentration, 24 in line with the uphill transport of multivalent ions. Such a concentration prole was already predicted by Higa et al., 24 and is, to the best of our knowledge, for the rst time experimentally observed, in this case in the Ralex membrane. These details in concentration proles cannot be distinguished for the other membrane types, probably due to ion exchange in these thinner membranes when dismantling the stack and preparing the membrane samples for EDX analysis. Hence, no conclusions can be drawn from the gradient in each crosssection for the Neosepta and Fujilm membranes. The much larger thickness of the Ralex membranes better conserves the concentration gradients as representative during the experiment. Future experiments using (thick) membranes that can be frozen directly aer operation will provide more details on the exact shape of the concentration proles inside the membranes, but are beyond the scope of this paper.
The relative concentration of Mg 2+ increases much faster in Fujilm CEMs and (in less degree) in Neosepta CEMs compared to Ralex CEMs. The contribution of magnesium more than doubles between 45 min and 300 min for Ralex membranes (Fig. 8A), while it increases only slightly for Neosepta membranes in this period (Fig. 8B). For Fujilm membranes (Fig. 8C), the relative concentration of magnesium does not even change signicantly anymore aer the rst 30 min. The transition time to establish a steady concentration prole in the membrane is expected to be proportional to the ion exchange capacity and the membrane thickness. The Ralex membranes offer a slightly higher ion exchange capacity and are much thicker than Neosepta membranes 35 and therefore provide the largest source of Na + , which is in agreement with Fig. 8. Although the ion exchange capacity of Fujilm membranes is not specied, the fast stabilization of the concentration prole predicts a low ion exchange capacity of these membranes. However, an exact value cannot be inferred, as micro-heterogeneity in the membranes complicates the uniform release of monovalent ions from the membrane interior. 44 During the non-stationary period, the double layer is supplied with Na + ions transported out of the membrane in exchange for Mg 2+ transported into the membrane, which effectively reduces the fraction of multivalent ions in the double layer. Hence, the voltage over the CEMs is temporarily higher compared to steady operation on feed water with a fraction of MgSO 4 . The same effect occurs for AEMs, where Cl À is slowly released in exchange for SO 4 2À (not shown due to the less reliable detection of sulfur). This slow release of monovalent ions towards the double layer also explains the slow transition in power density as observed in Fig. 7, in particular for Ralex membranes.

Outlook
The effect of multivalent ions on the obtained power density should be considered for practical applications of RED. As indicated in Fig. 2B, the voltage is mostly affected by the concentration in the river water side. It was already known that the (monovalent) salinity 45 and fouling potential 16 are important factors that need to be considered for selection of the feed water sources. The present research emphasizes that the contribution of multivalent ions in the feed water, in particular in the diluted stream, should be considered as well. Additionally, the observed slow response in power density (Fig. 7) suggests a strategy that reduces the impact of multivalent ions: the slow ion supply from the membrane interior predicts that the response can be accelerated at a higher current density, and that the response can be decelerated when the current density is periodically reversed. The latter behavior is recently observed for RED stacks that operate using natural feed water; a stack with periodic feed water switch (which induces a switch of the current direction) showed a slower decrease in power density than a stack with continuous feed water supply. 43 A fast response, which may occur at high current densities in the same direction, can be useful when applying a treatment with NaCl (brine) to ush the multivalent ions from the membranes. Such treatment should be applied as short as possible, to limit the volume of feed water required for such cleaning. In this way, the gradual ion exchange between monovalent and multivalent ions in the membrane can be used benecially. Hence, such an operational strategy can be applied to improve the power density when RED is used for power production from natural feed water streams.

Conclusions
Energy generation from mixing seawater and river water is mimicked representatively using articial mixtures of salts with monovalent ions (e.g., NaCl) and salts with multivalent ions (e.g. MgSO 4 ). The global potential for salinity gradient power, as quantied by the available energy per water volume, decreases only slightly for increasing fractions of MgSO 4 , while the obtained voltage and power density decrease drastically. For a mixture with a molar fraction of 10% MgSO 4 and 90% of NaCl in both feed waters, the experimentally obtained power density in steady state decreases between 29% and 50%, depending on the membrane type, compared to the case where the feed solutions contain only NaCl as a salt.
This decrease in power density is mainly due to a lower open circuit voltage and only slightly due to higher electrical resistance. This lower open circuit voltage is theoretically predicted due to the transport of Mg 2+ and SO 4 2À against their concentration gradient. This uphill transport of multivalent ions is driven by the difference in voltage as generated by a monovalent species and a multivalent species. In addition, the permeation of co-ions through the non-ideal membranes is an increasing issue when using a mixture of monovalent and multivalent ions. This effect is more pronounced for heterogeneous membranes than for homogeneous membrane types. Non-stationary cases, where feed water is switched from NaCl solutions to mixtures of NaCl and MgSO 4 , show that the voltage response time is in the order of tens of minutes up to several hours, due to ion exchange between the membranes and the feed water. The voltage remains temporarily higher than in its steady state due to the gradual release of monovalent ions from the membrane interior in exchange for multivalent ions, as is visible in the concentration proles in membrane crosssections. This knowledge opens the possibility to improve the power density in practical applications of RED using varying concentrations of feed water.