In recent years, batch and semi-batch reverse osmosis (RO) processes have received wide attention because of their internal staging feature. However their performance is severely compromised by salt retention induced by incomplete flushing, which leads to elevated salt concentration, uplifted peak pressure, and extra power consumption. Herein we adopt transient three-dimensional computational fluid dynamics to systematically analyze the effect of the V-shape feed spacer geometries on hydrodynamics and mass transfer characteristics. After a sensitivity analysis of all geometric parameters, a heuristic optimization framework is proposed for inverse design of the feed spacer. Using the optimized feed spacer, flushing efficacies after one displacement volume are 0.936, 0.962, 0.969 and 0.974 respectively for one, three, five and seven membrane elements connected in series (whereas 0.884, 0.926, 0.942 and 0.952 for commercial spacers), which help to mitigate membrane scaling and fouling. Moreover, the optimized spacer has a pressure drop per meter 73 % lower than that of the commercial spacer. If used in conjunction with high permeability membranes, batch RO and semi-batch RO could save 29.9 % and 24.1 % specific energy consumption relative to conventional one-stage seawater RO.