Fundamental descriptions of chemical precipitation, adsorption, ion exchange, and membrane processes; applications to water and wastewater treatment