We consider the flow and transport of chemically reactive substances (precursors) in a channel over substrates having complex geometry. In particular, these substrates are in the form of trenches forming oscillating boundaries. The precursors react at the boundaries and get deposited. The deposited layers lead to changes in the geometry and are explicitly taken into account. Consequently, the system forms a free boundary problem. Using formal asymptotic techniques, we obtain the upscaled equations for the system where these equations are defined on a domain with flat boundaries. This provides a huge gain in computational time. Numerical experiments show the effectiveness of the upscaling process.