Forward and inverse modeling of near-well flow using discrete edge-based vector potentials