Membrane bioreactors (MBRs) have been used successfully in biological wastewater treatment to solve the perennial problem of effective solids–liquid separation. A common problem with MBR systems is clogging of the modules and fouling of the membrane, resulting in frequent cleaning and replacement, which makes the system less appealing for full-scale applications. It has been widely demonstrated that the filtration performances in MBRs can be greatly improved with a two-phase flow (sludge–air) or higher liquid cross-flow velocities. However, the optimization process of these systems is complex and requires knowledge of the membrane fouling, hydrodynamics and biokinetics. Modern tools such as computational fluid dynamics (CFD) can be used to diagnose and understand the two-phase flow in an MBR. Four cases of different MBR configurations are presented in this work, using CFD as a tool to develop and optimize these systems.