Modeling the reaction pathway of contaminants in groundwater