A wedge of saltwater can be entered to the coastal aquifer. Because of density difference between saltwater and freshwater is formed a transition zone between two fluids. Forward rate and extent of saltwater transition zone depends on several factors including: changes in sea level, aquifer characteristics, and hydrological conditions of upstream, tidal and seasonal fluctuations of seawater. One of ways for prevention of seawater intrusion in coastal aquifer is construction of underground dam. In this paper changes of hydraulic gradient in groundwater aquifer by tidal fluctuations of seawater over the weir of underground dam are caused advance of saltwater far away the sea at the coast. The multiphase flow is simulated by computational fluid dynamics method. By simulation of tidal flow over the weir of underground dam is defined position of another underground dam at upstream of first underground dam for prevention of seawater intrusion.