Ion exchange membrane systems: Modeling and optimization for salinity gradient energy generation