The hollow-fiber membrane biofilm reactor (MBfR) is based on gas-supplying membranes that passively deliver a gaseous substrate to biofilm formed on the membrane exterior. MBfR biofilms exhibit unique behavior due to substrate counter-diffusion, where the electron donor and acceptor enter the biofilm from opposing sides. This research used mathematical modeling to study the behavior of a denitrifying, hydrogen-based MBfR. A number of numerical counter-diffusional biofilm models were developed, including a one-dimensional, pH-dependent, multi-species model and a more sophisticated two-dimensional, particle-based model coupled to solution of fluid dynamics and mass transport. On a fundamental level, the models predicted the unique response of counter-diffusional biofilms and revealed the mechanisms responsible for their behavior. In terms of application, the results identified best practices for maintaining high rates of denitrification. This dissertation explored three topics important to MBfR success: spiral-wound MBfR spacer design, competition for hydrogen among denitrifying (DNB), sulfate-reducing (SRB), and methanogens(MET), and gas back-diffusion in MBfR membranes. For complex substratum geometries, such as that used in a spiral-wound MBfR flow channel, complex fluid dynamics led to non-uniform biofilm development. Biofilms grew in low-shear regions behind inert plastic spacers, which may be strategically designed to manage biofilm growth. Modeling results showed faster-growing DNB outcompete SRB and MET, but when given adequate substrate and space, SRB and MET proliferate and lower the activity of the DNB. When established, SRB and MET consume hydrogen and decrease denitrification fluxes. Due to counter-diffusion, sufficiently thick biofilms can also decrease denitrification fluxes, though with frequent sloughing events denitrifying bacteria were favored. The two-dimensional model predicted greater proliferation of SRB and MET than the one-dimensional model due to their dominance in the crevices between hollow-fibers. Back-diffusion of inert gases from the bulk liquid and biofilm into the lumen of the membrane can be detrimental to MBfR performance, though the extent of gas back-diffusion and its effect on denitrification is highly interdependent upon substrate concentrations, membrane properties, and biofilm thickness. Applying similar modeling techniques to a membrane filtration application, the effect of fouling layer roughness on permeate flux was also evaluated.