Foam injection is an effective method for modifying gas mobility in subsurface flow applications making it ideal for environmental remediation applications. Remediation of contaminated soils/aquifers of nonaqueous phase liquids using foamed surfactant solutions is a viable option but a predictive foam model is needed that is flexible to the addition of more accurate physical descriptions. Such a model is essential to ensure successful operations in soil remediation applications. The objective of this paper is to develop a full-physics, mechanistic transient foam flow model and integrate it into the multiphysics, modular AD-GPRS framework (Automatic Differentiation–General Purpose Research Simulator). We chose AD-GPRS because it allows rapid prototyping and addition of complex physics and modeling strategies. We develop the model ground-up from pore-scale observations and implement a new flowing foam fraction constitutive relation that depends on the local pressure gradient, local permeability, and flowing bubble density. Our model predicts the two flow regimes commonly observed in steady-state pressure gradient measurements: the low-quality regime and the high-quality regime. Additionally, the model is used to match transient experimental results of homogeneous and slightly heterogeneous cores with a wide range of permeability values. The implementation of this model within AD-GPRS allows testing of ideas and modeling strategies as well as inclusion of more complex physics or foam generation kinetics.