I am looking for an algorithm that describes the transient behavior of a fluid as it spreads over the surface of a height map. My initial conditions at t = 0:
- Two-dimensional matrix of values โโof height (H) of size [x, y]
- Two-dimensional matrix of liquid height (F) values โโof size [x, y]
- The metric of the area of โโeach point in the matrix (a), that is, each place is 1 cm ^ 2
- The viscosity value for the liquid (u)
What I want is an algorithm that can calculate a new value for the fluid height matrix F at t '= t + 1. At any point, I could calculate the fluid volume at a given point via v = a * (F (x, y ) - H (x, y)). The desirable properties of this algorithm would be:
- There is no need to consider the โslopeโ or โshapeโ of the top or bottom of the liquid column at each point. those. he can consider each value in hieghtmap as a description of a flat square of a certain height, and each value of the fluid height map as a rectangular column of water with a flat top
- If a โleakโ (ie a very low point on the height map) occurs, fluid from all parts of the map can be affected when it reaches for it.
A simple example of what I'm looking for would be the following:
- 5x5 DEM matrix, where all values โโare 0
- The matrix of the map is 5x5 in height, where all values โโare 0, except [2, 2], which is 10.
- Area per point 1 m ^ 2
- Viscosity u
"" , 5 ร 5 . 10/25 , , .
, , , , , . - - , , , .