Modeling and Optimization of Membrane Process for Salinity Gradient Energy Production