A pH-control model for heterotrophic and hydrogen-based autotrophic denitrification.