We consider the problem of shape and topology optimization in fluid mechanics with a general objective functional. A phase field approach is introduced and discussed in terms of well-posedness and first order necessary optimality conditions. The state constraints are either given by the Stokes or the stationary Navier-Stokes equations. We find that minimizers of the diffuse interface setting have a converging subsequence as the interface thickness tends to zero. If this sequence fulfills a certain convergence rate or the total potential power is minimized in a Stokes flow, we obtain that the limit element is a minimizer of the sharp interface formulation. Additionally, we can derive in both, the Stokes and stationary Navier-Stokes setting, ...