Writing the terrain generation and erosion simulation program TerrainGen requires computing how water flows downhill.

Among the forces acting on an element of water in a streambed are the viscous friction forces and the gravity force. The gravity force pulls the water downhill, and the viscous friction force slows the descent. Without viscous friction forces, water would 'flow' downhill kind of like a metal ball would roll down a surface - it would get faster and faster in a very unrealistic way.

So the viscous friction force is important for computing how to accelerate an element of water. But what is a good expression for this force? After browsing around a bit I found the Manning Formula, which gives the velocity of water flowing down a channel in terms of the channel slope etc. With a little bit of maths this can be turned into a force (or rather an acceleration):

The Manning Formula is $$V = {k \over n} R_h^{2/3} S^{1/2} $$ Where \( V \) is the average velocity, \(n\) is the Gauckler–Manning coefficient, \(R_h\) is the hydraulic radius, \(S\) is the stream slope, and \(k\) is a conversion factor.

As the wikipedia article notes, for a wide rectangular channel, the hydraulic radius is approximated by the flow depth. So lets assume our channel is a wide rectangular channel with flow depth \(d\). $$R_h \approx d$$ We will assume we have an infinitely long channel of constant slope \(\frac{\partial h}{\partial x}\) and constant cross sectional shape, with a constant water depth. We will try and solve for a steady state constant average velocity of the stream. Now consider the gravitational acceleration acting upon an element of water in the channel. If the channel has height h(x), the gravitational acceleration component along the channel is $$ a_g = -g \frac { \frac{\partial h}{\partial x} }{ \sqrt{\frac{\partial h}{\partial x} + 1} } $$ Assuming the slope is relatively small, e.g. \( \frac{\partial h}{\partial x} \ll 1 \) then $$ a_g = -g \frac{\partial h}{\partial x} $$ For a steady state slow which we are assuming, the gravitational acceleration must balance the friction acceleration: $$ a_g + a_f = 0 $$ So we are looking for some expression for the frictional acceleration \(a_f(v, d)\), a function of velocity and stream depth, that satisfies $$ -g \frac{\partial h}{\partial x} + a_f(v, d) = 0 $$ (Note that the friction force is just the friction acceleration multiplied by the element mass by \(F = ma\), but it's cleaner to work with accelerations.) What works is $$ a_f = \frac{g v^2} { (\frac{k}{n})^2 d^{4/3} } $$ Checking by substituting into \( a_g + a_f = 0 \): $$ a_g + a_f = 0 $$ $$ (-g \frac{\partial h}{\partial x}) + (\frac{g v^2} { (\frac{k}{n})^2 d^{4/3} }) = 0 $$ And then substituting in the right hand side of the Manning formula for v: $$ -g \frac{\partial h}{\partial x} + (\frac{g [{k \over n} R_h^{2/3} S^{1/2}]^2} { (\frac{k}{n})^2 d^{4/3} }) = 0 $$ $$ -g \frac{\partial h}{\partial x} + (\frac{g {k \over n}^2 R_h^{4/3} S} { (\frac{k}{n})^2 d^{4/3} }) = 0 $$ But S is just our channel slope: \(S = \frac{\partial h}{\partial x} \) and using the hydraulic radius = stream depth assumption \(R_h = d\): $$ -g \frac{\partial h}{\partial x} + \frac{g {k \over n}^2 d^{4/3} \frac{\partial h}{\partial x}} { (\frac{k}{n})^2 d^{4/3} } = 0 $$ $$ -g \frac{\partial h}{\partial x} + g \frac{\partial h}{\partial x} = 0 $$ So our equation is satisfied, and we have confirmed the friction acceleration that satisfies the steady-state equation is $$ a_f = \frac{g v^2} { (\frac{k}{n})^2 d^{4/3} } $$ We can combine the constant factors into a single factor \(K_f = \frac {g}{(\frac{k}{n})^2} \): $$ a_f = K_f \frac{v^2}{d^{4/3}} $$ So the friction acceleration (and force) is proportional to the square of the stream velocity. This is what we expect from turbulent fluid drag.

The friction acceleration also decreases as the stream depth increases. This make sense if you read about viscosity, in particular Dynamic viscosity and planar Couette flow: the friction force decreases as the fluid depth increases.

The dependence on stream depth should also be familiar from real life: imagine a deep river flowing down hill, with e.g. 2 metre depth. It will flow rapidly. Now imagine the same stream bed but with 2 milimetre depth. The water will travel much more slowly! This is because the viscous friction has increased in accordance with our \(\frac{1}{d^{4/3}} \) factor.

For the purposes of TerrainGen I will probably use \( \frac {1} {d} \) instead of \( \frac {1} {d^{4/3}} \). Close enough and should capture the main phenomena.

I should also add that I am far from an expert in fluid dynamics and engineering, so corrections or clarifications are welcome!

Here's a demo using the friction acceleration derived above: