(1) If "dirty" means organic chemicals in the water, these usually have
enough vapor pressure that what you get is "codistillation." The
condensing liquid is a mixture of all the volatile components... hardly
pure water. The condensate is enriched in the more volatile
substance(s), which might not be water. Take "moonshiners" for example.
The water/alcohol/mash from the fermentation process, when distilled,
yields more-pure alcohol, not more-pure water.
(2) With mixtures of volatile compounds, to get high-purity separation
you have to do repetitive distillations. You can do simultaneous
repetitive distillations by the process of "fractional distillation"
using a fractionating column. This is commonly done in many chemical
plants, especially refineries.
(3) If "dirty" means inorganic chemicals with negligible vapor pressure
(such as desalination of water) then a single distillation can get
fairly pure water, but you either have to boil slowly (so you get only
honest-to-goodness vapor, as opposed to droplets that can contain
"dirt") or you need some baffles to prevent the droplets from getting
into the condenser.
This is typically considered "physical chemistry" and is fully described
in college-level physical chemistry texts. You might also Google or
otherwise look up words like codistillation, fractional distillation,
and desalination.
Michael D. Edmiston, Ph.D.
Professor of Physics and Chemistry
Bluffton University
Bluffton, OH 45817
(419)-358-3270
edmiston@bluffton.edu