Biofilms form inside water distribution systems as a result of biofouling. Biofouling makes it difficult to provide microbiologically and chemically safe water. Furthermore, it is the cause of enormous financial losses and poses challenges to public health. In this thesis, we prepared several model water distribution systems on a mesoscale with all the key elements. We have optimized a method that, under stagnant conditions, allows for the formation of large quantities of differently mature biofilms on PMMA slides. This allowed us to study (i) the effectiveness of different flow regimes in preventing biofouling, (ii) the effectiveness of different flow regimes in removing already established biofilms, and (iii) the effectiveness of various forms of hydrodynamic cavitation in destroying planktonic bacteria of a model microorganism E. coli. We have found that industrially relevant flow regimes are insufficient for the removal of already established biofilms or for biofouling prevention. We have also observed that it is practically impossible to completely remove biofilms in water distribution systems with increased volumetric flow rates. We have used a logistic model to describe the structuring and removal of biofilms as a response to the local flow conditions. Furthermore, we have observed that phenotypic adaptation to local hydrodynamic conditions significantly contributes to the mechanical stability of biofilms. We have also observed that fluid flow past dead-ends increases the mass transfer and accumulation of planktonic bacteria into the dead-end. Once established within dead-ends, it is impossible to remove biofilms with increased flow in the main channel. Such biofilms present a chronic source for colonization of the rest of the water distribution system. Hydrodynamic cavitation did not efficiently kill planktonic bacteria.