Navier–Stokes, Gross–Pitaevskii and generalized diffusion equations using the stochastic variational method