Flux-weighted residence time in a porous layer (source code)

= Flux-weighted residence time in a porous layer
{title2=$\langle\tau\rangle_Q=V_{\rm pore}/Q$}

For steady incompressible flow with no stagnant volume, partition the layer into streamtubes of <volume flux> $dQ$. The pore volume in a streamtube is $\tau\,dQ$, so $\int\tau\,dQ=V_{\rm pore}$. This gives the mean residence time $V_{\rm pore}/Q$ even when individual path times vary widely. <Streamfunction> labels measure flux in two-dimensional flow, so they supply the correct weighting.