I'm looking for a grid-based numerical method that allows simulating water over a grid-based terrain, presumably something like shallow water equations. I have a square grid of terrain elevation values, and I want a numerical method that evolves water level (values of height of water layer on the same grid) in real-time. I don't mind if the method is inaccurate in some respects, but I want it to be mass-conserving and be able to deal with absence of water (i.e. dry land) without any artifacts.
The methods I've found that are closest to what I mean but don't suit all my needs:
- Stable Fluids by Jos Stam - doesn't seem to incorporate both water height & terrain height, seems to only consider density of some solvent
- Real-Time Erosion Using Shallow Water Simulation by Bedrich Beneš - the best I've found so far, but it lacks mass conservation, and it is not entirely clear how to restore it in a reasonable way