A wetting/defending fluid fills a 3D lattice of pore sites; a non-wetting fluid is injected from the left face. Whether the advancing front stays flat, breaks into a few wide fingers, or degenerates into thin fractal channels depends on the competition between capillary forces (pore-to-pore disorder) and viscous forces (the pressure gradient driving flow), summarised by two dimensionless numbers:
Ca = μ_def·v / σ (capillary number: viscous vs. capillary force)
M = μ_inv / μ_def (mobility / viscosity ratio)
Each pore site carries a fixed random capillary entry threshold (its "disorder"). At every step the model scores every empty site adjacent to the invaded cluster:
score = threshold + Ca_eff · M_bias · progress
where progress is how far a site already sits ahead of the inlet. The lowest-score site invades next. When Ca is small the random threshold dominates and the front advances chaotically wherever it is locally easiest — capillary fingering. When Ca is large and M < 1 (a low-viscosity fluid pushing a high-viscosity one), sites that are already ahead get an even lower score, so the leading tips run away with the flow — viscous fingering. When Ca is large and M > 1 (a favourable, more-viscous invader), protruding sites are penalised instead, so the front self-corrects and stays broad — stable displacement. This three-way competition is the qualitative content of Lenormand's (1988) phase diagram for immiscible displacement in porous media; this simulator reproduces its structure with a simplified scoring rule rather than a full multiphase Navier–Stokes/Darcy solve.
- Capillary number / Viscosity ratio — move between the three Lenormand regimes.
- Pore-throat disorder — how heterogeneous the pore sizes are; 0 gives a near-uniform medium.
- Injection rate — simulation speed (invasion events per second), purely for visualisation.
- Breakthrough — the first moment the invading fluid reaches the outlet face, the point real coreflood experiments use to measure sweep efficiency.