Thermohaline convection in flowing groundwater