The main objective of the article was to optimize the facilities used to distribute flows in inlet galleries, which are used not only in water treatment plants, but also in wastewater treatment plants (WWTP). While working in the field of WWTP, it was found that there are no optimized facilities in the Czech Republic or globally for uniform distribution of flows to any number of inlet branches into reservoirs of the same flow rate. Currently, in most unregulated facilities, there are significant differences between the various inlet branches to the reservoirs. In regulated facilities, the outlets must be regulated at each change in flow rate and, for changes in the number of inlets to the reservoir (e.g., due to reservoir shutdown), each outlet must be manually adjusted (e.g., using a sluice gate) so that all inlets to reservoirs have the same flow rate. In more modern cases, the sluice is equipped with an electric motor for changing the position and a probe sensing the level. The central unit then calculates the flow rate in the individual reservoir inlets and adjusts the position of the sluice gates so that the same flow rate is achieved everywhere. The objective of the research was to optimize the distribution facility so that the inlets to the reservoirs reach similar values for the flow rate when both the inflow to the distribution facility and the number of inlet branches to the reservoirs are changed, without significant regulation at the distribution facility. In order to make the research easily applicable to as many distribution facility as possible, the most commonly used flow distribution facilities (fountain spillway, flume with outlets fitted with a sluice gate and probe for level monitoring, etc.) were selected to address the issue. Different flow conditions were simulated on the selected facilities (in different variants and shapes); after their analysis the facilities were optimized in order to achieve the most similar flows at the inlets to the individual reservoirs.