Open chooron opened 1 year ago
@chooron, strange that we don't have set_quantity
with polygon implemented properly. Must add that to our todo list.
With your simple example try:
domain.set_quantity('stage', numeric=1900, polygon=river_polygon)
I will try to provide a work around for your problem. Should be easy to code.
@chooron The following should work, though a bit low level.
region = anuga.Region(domain, polygon=river_polygon, expand_polygon=True)
tids = region.indices # ids of triangles intersecting region defined by river polygon
stage_c = domain.quantities['stage'].centroid_values
elev_c = domain.quantities['elevation'].centroid_values
stage_c[tids] = elev_c[tids] + 3.0
@chooron The following should work, though a bit low level.
region = anuga.Region(domain, polygon=river_polygon, expand_polygon=True) tids = region.indices # ids of triangles intersecting region defined by river polygon stage_c = domain.quantities['stage'].centroid_values elev_c = domain.quantities['elevation'].centroid_values stage_c[tids] = elev_c[tids] + 3.0
Thanks ! I have solved the problem by preparing the stage file by using Arcgis, and run the code:
stage = domain.quantities['stage']
stage.set_values(filename=join(file_path, 'level3m.asc'))
Hi @stoiver , I'm not sure if the watershed is too large, the inflow is too small, etc. My flood evolution is not very effective, and the river depths no longer change significantly after one time period of calculation.
@chooron what do you mean by "one time period of calculation"?
Setting up the mesh, the elevation and stage can take a bit of work. The interaction of the elevation and the mesh can lead to some interesting artefacts, in particular artificial numerical dams.
One trick is to add a large amount of water to the domain (via rate_operator) to fill up all these dams and change the centroid elevation to match. This can be unsatisfying as the elevation does not match your original DEM.
Refining the mesh should help, but you might end up with an unnecessarily large number of triangles and so a slow simulation.
You can adapt your mesh to refine along rivers so that triangulation follows the river as opposed to crossing the river. If you have a look at the anuga-community/anuga_core issues list, in particular https://github.com/anuga-community/anuga_core/issues/12 then there are some links to producing good meshes, which are finer along the river courses. You may still need to have a burn-in procedure of rain over the catchment to "fill" up the rivers
I have prepared the elevation data for the basin and the river polygon. However, when I run this code:
domain.set_quantity('stage', expression='elevation + %f' % 3, polygon=river_polygon)
I encounter the following error:
Therefore, I want to know how to initialize the water level of the river using a polygon. When I run the code:
domain.set_quantity('stage', 1900, polygon=river_polygon)
It seems to run without errors, but the river stages are definitely inconsistent."