I am trying to create a flood modelling system. The system consists of two parts mainly a river flooding simulation and rainfall simulation. To do this I am running the latest version of GRASS 6.4. Also I am using the SRTM obtained from CGIAR as my DEM.
I would like to ask what are the most appropriate commands to run a simulation. Ex. Terraflow
Also since we are modelling flooding based on a river, is it advisable to use HEC-RAS? It was created by the same folks who made GRASS. :)
I am more of a programmer rather than an engineer. It is my first venture into simulation systems as part of my degree.
As of now Here is our plan for the rainfall (pseudocode):
int i = 0, j = 0;
int passes, numberOfmesh;
double rainAmount;
double store1[][];
double store2[][];
numberOfmesh = getTotalMeshCells();
passes = computePasses(numberOfmesh());
rainAmount = getRainAmount();
/* rainAmount corresponds to the input of the user in the textfield.
store1 contains the elevation and the number of times an amount of water
has been passed to it (per pixel)
store2 contains the elevation and the total accumulated water (per pixel)
Both store1 and store2 have 'n' number of rows and 2 columns;
ASSUME THAT THE ARRAY HAS ALREADY BEEN POPULATED */
while(i != passes)
{
while(j != numberOfmesh)
{
direct = getDirection(store[j][0]);
/* direct corresponds to the direction of a mesh cell;
I don't know what id the datatype for direct; */
store2[j][6] += rainAmount;
gotoDirection(direct);
}
}
computeAccumulated();
//Here is what gotoDirect is supposed to do:
gotoDirect(direct)
{
/* How can we determine the elevation of the mesh cell to where the
'direct' points to?
In the following code, j refers to the elevation of the mesh cell where
the 'direct' point to.
*/
store1[j][7] += 1;
/* increases the number of times that an amount of water
was passed to it */
}
//Here is what computeAccumulated is supposed to do:
computeAccumulated()
{
while(j != numberOfmesh)
{
store2[j][8] += store1[j][9] * rainAmount;
}
}