Aimed at the shortcomings of complexity and low efficiency of calculation program in numerical simulation of groundwater flow and contaminant transport,the paper studied a combined numerical simulation of groundwater flow and quality. Based on MEB, it firstly built a coupled model of groundwater flow and contaminant transport and programmed a coupled program by using Matlab so as to solve single flow, contaminant transport with steady flow and contaminant transport with unsteady flow. Then it studied one dimensional solute transport by using the program and compared the method with other ones. Finally, the paper simulated the diffusion distribution of groundwater pollutant in a certain place.Results show that by controlling the custom feature numbers,the paper solved the problem of different hydro-geological characteristics; when using upstream weighted method to resolve the problem of big Peclet number pollution dispersion, there no obvious numerical dispersion phenomenon and.the method can solve the vibration of numerical solutions;the program has higher computing efficiency and can significantly improve the visibility of postprocessing.