Large energy consumption is one of the main weaknesses of RO desalination. A new method is proposed to reduce the energy consumption of RO desalination which depends on the salinity of the feedwater. Low salinity feedwater can be obtained using groundwater wells which extracts both fresh groundwater and subsurface sea water. Subsurface feedwater is advantageous in overcoming other problems associated with surface seawater intakes. Salinities of groundwater depend on a number of factors. In this work a new simulation-optimization model is proposed to identify well locations and pumping rates with would provide the required design flow rate with the minimum salinity. When groundwater is developed in a coastal area, the saltwater wedge advances inland and may contaminate existing groundwater wells, which must be prevented. The model can protect existing wells while developing minimum salinity feedwater. Examples are provided to demonstrate the usage of the model.