A mechanistic model for electrochemical nutrient recovery systems.