The study describes a systematic numerical optimization of a Venturi tube for wastewater treatment under cavitation conditions. The numerical approach employs computational fluid dynamics methodologies in a Reynolds-Averaged Navier-Stokes framework combined with an optimization algorithm to enhance a baseline Venturi geometry. A robust meshing technique is provided in order to define the numerical model associated with the baseline solution. The process compares alternative mesh sizes and turbulence closure to discover the optimal accuracy and processing time balance. Then the model is used as a starting point for the optimization. An optimal configuration is found to be able to improve the tube mean vapor quality by around 130% compared to the starting geometry.