# Simulate water runoff to get water height over each pixel of DEM

Here is my problem that I am trying to deal with.

I have given a height map of around 512X512 resolution(It is Geo-referenced and I have the meta-data for this). And I have given that this area receives some x mm/hr rainfall for an hour(so I know the total volume of water that fell). Now I am assuming that the surface is concrete, so there is water loss to the ground, and all the water will reside inside this area(assume that the area is enclosed by infinity walls). Further there is no loss of water from evaporation(atmosphere has 100% humidity).

Now I want to find out at 5 or 10 minutes time interval, how much of water will each pixel on the height map will have. It's like snapshots of water levels(height of water), at various time intervals.

I have looked into GRASS r.topmodel[1], but could really understand if what I want is actually achievable from this function. Further there is a topmodel implementation in R, and I am not sure about this as well, if this can help me, in achieving what I want(all I see is a lot of parameters of flowing water).

Can someone help me figuring out how can I use these above functions to help my cause. If not, help by pointing out some (easy to implement) algorithm or some other implementation or library that I can use.

• I took liberty to change the link to the current r.topmodel manual page. At bottom there is a reference to a more detailed manual, see idea.isnew.info/grass_gis/r.topmodel | As an alternative, see also grass.osgeo.org/grass70/manuals/r.sim.water.html Jun 3 '15 at 18:55
• For an general overview, see grass.osgeo.org/grass70/manuals/topic_hydrology.html Jun 3 '15 at 18:57
• Hi mark, thanks for the reply, I looked into the r.sim.water and looks like generating the water depth map at various time intervals should solve my problem. But as instructed, I need to generate the partial derivatives, but r.slope.aspect is giving me nan value for dx, dy and slope as well. The Elevation data is in meters, as mentioned in its manual. Might know what might be the cause of the problem? or what I should be looking into? Jun 4 '15 at 11:41
• The r.slope.aspect output should not be empty, please see grasswiki.osgeo.org/wiki/Computational_region#FAQs for setting the computational region properly. Jun 4 '15 at 18:45
• Thanks markus, setting the region property fixed the problem. Jun 4 '15 at 19:29