Modelling and pH Control in Raceway and Thin-Layer Photobioreactors for Wastewater Treatment