Vertical river banks
mikilterribile opened this issue · 13 comments
Hi everyone, I'm trying to simulate a stream with vertical river banks. I've noticed that anuga does modify the Digital Terrain Model smoothing the high slopes. This may be useful for the stability of the numerical model but in my opinion it is not the perfect solution. I could try to implement riverwalls structures with anuga, but in order to do this I must have in any case the elevation with no modifications. Thanks in advance for any kind of support.
Best regards, Michele Zucchelli.
Is anybody home? I apologize for asking three questions in few days, i promise this is the last for a very long period.
Best regards, Michele Zucchelli.
ok, thank you
@mikilterribile You are correct that the default interpolation procedure does fill in (smooth) the surface (if the underlying data set is coarse).
If you have a high resolution dem (raster) then you can use that to set the elevation which might be good enough for your needs. As an extension you can use a raster the set the basic elevation and then provide more detailed elevation data say within a polygonal region defining your river. You might also like to build in breaklines into the mesh and then you can have vertical river banks.
You do need to careful to ensure the mesh is fine enough to define the river and the river banks. The use of breaklines is important here.
ok, but I already have a high resolution DEM (raster with 0.5 meter sized cells) that i use to set the elevation with "domain.set_quantity('elevation', filename=fp_dtm, location='centroids')". Furthermore, I have made the resolution of the domain very high within the river bed and banks using the interiors. Despite this facts, anuga smoothes my banks. Maybe there is some parameters that I can pass at the function "set_quantity" in order to overcome this problem, or maybe I understand from you message that if I draw breaklines in the domain anuga doesn't smooth there around anymore? Thank you for you time and patience, best regards, Michele Zucchelli.
@mikilterribile it sounds like you are doing the right thing, high resolution DEM and fine mesh. Your problem sounds more typical of low resolution DEMs.
What is the format of your DEM file? If it is a .tif
then anuga
should pick that up. What is the name of your DEM file fp_dtm
? The extension determines how the file is processed.
The anuga
algorithm is based on centroid values, but visualisation through the viewer uses derived vertex values. The calculation of vertex values do lead to visible smoothing which may be what you are observing. So it might be better for you to plot the piecewise constant centroid values (as demonstrated in anuga
documentation https://anuga.readthedocs.io/en/latest/examples/notebook_simple_example.html)
Maybe you could produce a few plots highlighting your problem.
My DEM is an ASCI file (.asc). I have tryed to increase the mesh resolution (until "7") and the situation seems to be a bit improved. Now we arrive to 40/45 slope degrees but still far from the vertical banks. Using breaklines has no influence on the elevation. Also setup "set_store_vertices_smoothly" has no effect. The 've also check the DEM and it has a high resolution (0.5 meters). For the visualization both of the depth and the elevation I use the "sww2array" function, turning the anuga .sww data in numpy arrays.
(This function was written in python 2 but I upgraded it and now works with python 3. If you are interested in, I can share my function in any moment...)
@mikilterribile could you provide some data and example script demonstrating the problem. Could send a link to my email stephen.roberts@anu.edu.au Would be useful to include the scripts used to visualise the cross section.
I sent you the data and some code lines few days ago. Hope you've received it.
@mikilterribile thanks for the heads up regarding sending your data. The message had got pulled into my junk folder.
It would also be great if you could include an output sww
file (as long as it is not too large!) with say just one timestep, so that I can see how the elevation is being smoothed.
The procedure sww2array
is fairly old (when elevation was based on vertex values and was assumed to be continuous). I tend to use the dplotter
interface, or the plot_utils
procedures (in the utilities
folder) that work with centroid values.
@mikilterribile just noticed you provided an sww file, so thanks.
Ah ok, in any case here is the link for a sww file with vertical banks and a really small mesh within the stream bed: https://drive.google.com/file/d/1VFkVTf7pYgMxpAk0QJvAGFSjtAN-XB-Q/view?usp=sharing
I have followed your indications and use the plot_utils procedures to extract the information from the sww file. As a result, now the vertical river banks are correctly represented. In particular, I have slightly modified the Make_Geotiff functions in order to retrieve a numpy array dictionary. Thank you for the help. Best regards, Michele Zucchelli.