The ecology of the urban environment significantly depends on the intensity and toxicity of industrial and other wastewater discharges, both within the city limits and in the areas adjacent to the city. This paper discusses advanced technologies for wastewater treatment from heavy and non-ferrous metal ions in industrial and small enterprises of urban agglomerations. An analysis of the efficiency of using flow-through three-dimensional electrodes for wastewater treatment from harmful reagents is presented. The use of mathematical modeling allows calculating and predicting the results of the technological process, as well as optimizing the process by calculating the effective values of the control parameters, in particular, calculating the modes of treatment of galvanic wastewater from heavy and non-ferrous metals in devices with three-dimensional flow electrodes. The given mathematical models of electrochemical processes in three-dimensional flow electrodes in relation to the extraction of metals from solutions of galvanochemical production allow us to conduct computational experiments. For this purpose, a set of programs has been developed that allows calculating the parameters of the electrochemical process of metal deposition from electrolyte solutions on three-dimensional flow electrodes. The input data for the calculation are the parameters of the deposited component (ion valence, diffusion coefficient), the ion concentration of the deposited component in the solution, the flow rate of the solution, the mass transfer coefficient, the electrical conductivity of the solid and liquid phases of the electrode – solution system, the overall current density, the electrode parameters (porosity, fiber radius, electrode thickness), the electrolysis time. The results of the calculation are: the concentration of metal ions (calculation can be carried out for one or two metal ions contained in the solution), the distribution through the thickness (volume) of the electrode, its conductivity, the mass of metals, the speed of flow of the electrolyte, the coefficients of mass transfer of metal ions, the mass transfer coefficient for oxygen, the potential profiles of the current metals, profile of the current oxygen profile of the current hydrogen, given the profile of the current metals. The solution of a scientific problem of practical importance for improving the ecological state of the urban environment is presented.