An integrated model for biological and physical processes in membrane bioreactors