Solution (source code)

= Solution

The mobile fluid volume per unit well length includes the <porosity>:
$$
V(t)=\phi\int_0^{ut/\phi}h(x,t)\,dx.
$$
Integrating the <residual-trapping attenuation of a porous current> gives, for $0\leq s<1$,
$$
\boxed{V(t)=\frac{Q\tau}{1-s}\left(e^{-st/\tau}-e^{-t/\tau}\right).}
$$
This is mobile volume in the current; retained fluid outside its mobile thickness is not counted. Since $h_t=-h/\tau$ in the thinning region, the rate of accumulation of immobile retained volume is $\dot V_r=sV/\tau$. Direct differentiation verifies $\dot V+\dot V_r=Qe^{-t/\tau}$, so the mobile-volume expression obeys the overall injection balance.

Without <capillary residual trapping>, $s=0$ gives $V=Q\tau(1-e^{-t/\tau})$. The limiting expression as $s\to1$ is $V=Qt e^{-t/\tau}$, though the local thinning equation degenerates at exactly $s=1$. Both limits provide useful consistency checks.