Knowing the depth of the water flowing through a stream is great for knowing when it may flood or how the banks may erode over time, but in order to predict how other bodies will interact with a stream, its often useful know the actual volume of water flowing through it.
In order to calculate the flow rate, you need to know the cross sectional area of the stream which can be found with the live depth of water and a profile of the stream's bed. We found this stream profile using an old fashioned measuring tape and meter stick. At 2 feet increments across the width of the stream, we measured the height of the water. From those measurements, you can generate a graph for a cross section of the stream's bed.
To find the area from the profile, we use the height of water in the stream reported from our sensor to offset this line so that the x-axis represents the water's height. From there, we use a riemann sum to estimate the area. We have it working in a spreadsheet right now, but eventually we plan to incorporate it with our server to do live flow calculations.
Unfortunately, knowing the area of water isn't very useful without also knowing the velocity of water flowing through that cross section. The issue is that the velocity is highly dependent on the height of water in the stream. The most reasonable way to solve this is by simply measuring the velocity of the water across a wide range of different stream stages. After enough data was collected, a look-up table could be used to estimate the velocity for a given stage.
The issue with this approach is that it doesn't make for useful predictions of flow when the stream reaches a height that is out of the bounds that you measured previously. Using a sensor to measure the velocity live could work, but it would likely involve moving parts which would make it prone to debris build up.