Two common causes of filamentous bulking of activated sludge are low dissolved oxygen (DO) concentration and low food to microorganism (F/M) ratio in the activated sludge system. A dynamic mathematical model was developed to simulate the population dynamics of two groups of bacteria, floc-formers and filaments within the microenvironment of the activated sludge floc. An arbitrary grid of 50 by 50 elements was applied to a hypothetical floc of maximum 100 μm in diameter. The concentration of DO and soluble substrate was calculated inside the floc core under different bulk concentration conditions in order to simulate the effect of heterogeneous, gradient-governed microenvironments on dual species composition. Dynamic simulation runs were performed to calculate the growth of the two morphological types of microorganisms inside the floc under diffusion governed conditions. The results indicate that the method accurately predicts the onset of excessive filamentous growth (directly linked to bulking) even when traditional models neglecting diffusion limitation fail to do so. The positive feedback effect of the non-random (unidirectional) growth on the selective enrichment of filamentous organisms under electron acceptor (DO) or soluble substrate (F/M) limited conditions is demonstrated.