A mean field approach for molecular simulations of fluid systems