The diffusion boundary layer is the very thin layer of liquid that forms against the rock face once the acid–rock heterogeneous reaction has taken place, and in which the ion concentration gradient normal to the rock face is not zero.
What sets this layer apart is its concentration gradient. In the bulk solution a little away from the rock face, the ion concentration normal to the rock face is essentially uniform; in the thin layer next to the rock face, the Ca2+, Mg2+, and CO2 bubbles produced by the surface reaction accumulate, the H+ concentration decreases toward the rock face, and the concentration of the products increases toward it. Driven by these gradients, H+ moves toward the rock face and the products move away from it, in opposite directions; this is called ionic diffusion.
The H+ in the acid must pass through this layer to reach the rock face, and this mass transfer is much slower than the surface reaction at the rock face, so the rate of reaction between hydrochloric acid and carbonate rock is governed by mass transfer in the boundary layer. Other conditions being equal, the higher the flow velocity of the acid, the thinner the boundary layer and the faster the reaction.