Minimization of freshwater consumption is very important in the management of water quality in drainage systems. In this paper, a mathematical technique for mass integration in drain systems was proposed. The main objective of this work is to manage the water quality in Kotchener drain (El‐Gharbia main drain) by chasing the physical and chemical parameters at sources and sinks. Kotchener drain is one of the largest drains in the Nile delta which moves from south of Egypt to the Mediterranean Sea in the north direction. Firstly, the data were collected from the studied area for 2 years along the Kotchener drain area. This was achieved by monthly monitoring five parameters of six sources sites and five sinks' sites. The results reveal that the concentration of the sources parameters in catchment area are within the permissible limits, except major constituents of total dissolved solid (TDS), chemical oxygen demand (COD), and biological oxygen demand (BOD). According to the degree of pollutants in the Kotchener drain area, the effective parameters that affected the irrigation along the Nile delta were studied. Secondly, a mathematical model was constructed by input the data of sinks, sources, and discharge point to Mediterranean Sea. Distribution of wastewater and freshwater between sources and sinks were studied according to the limiting mass loads of sources and sinks. Furthermore, the variables were optimized by applying LINGO Software with adding assumptions and constrains. The most effective network with minimal negative environmental impact was obtained. Application of the introduced mathematical approach results in minimizing the freshwater consumption with minimizing the wastewater discharge.