We consider a time optimal control problem arisen from the optimal
management of a bioreactor devoted to the treatment of
eutrophicated water. We formulate this realistic problem as a
state-control constrained time optimal control problem. After
analyzing the state system (a complex system of coupled partial
differential equations with non-smooth coefficients for
advection-diffusion-reaction with Michaelis-Menten kinetics,
modelling the eutrophication processes) we demonstrate the
existence of, at least, an optimal solution. Then we present a
detailed derivation of a first order optimality condition
(involving the corresponding adjoint systems) characterizing these
optimal solutions. Finally, a numerical example is shown.