Predicting bed dynamics in three-phase, fluidized-bed biofilm reactors