Page 1 of 1

Problems reading DEMs/Internally extruding the mesh

Posted: 06 Nov 2018, 19:51
by martim
Hi,

I have been trying to adapt the Tete Rousse example to my region of study, just to make sure the Grid2DInterpolator solver is being able to properly read my DEMs and I can extrude my mesh. Sadly, I have been getting a series of errors that suggest that it is not being able to properly read them.

I first tried to adapt the simplest Tete Rousse example, and although it runs, the mesh was never vertically extruded and I end up with a flat surface only. I have my surface and bedrock DEMs as variables in the VTU file, but they show all zeros (see picture for an example).
example_bad_reading.png
(13.53 KiB) Not downloaded yet
When trying to add a second body for my free surface, I get the following error:

ListParseStrToVars: Parsed variable 1 of zsdem
ListParseStrToVars: Parse counters: 1, 5, 5
ERROR:: ListParseStrToVars: Can't find independent variable:[zsdem] for dependent variable:[zs]

I suspect something is wrong with how I am writing the Solver to read the DEMs or with how the DEM is structured (I have checked it multiple times, but I guess something can always slip through...), so I attached my .sif file and the two DEMs.

Thanks in advance for the help!

Martim

Re: Problems reading DEMs/Internally extruding the mesh

Posted: 07 Nov 2018, 09:42
by gagliar
Dear Martim,

If you want me to test your example, I need the mesh to do it. Just the two DEMs and the sif is not enough.

Regards,
Olivier

Re: Problems reading DEMs/Internally extruding the mesh

Posted: 07 Nov 2018, 11:28
by martim
Hi Olivier,

Sorry for letting that slip through

I'm attaching the mesh to this post

many thanks!

Martim

Re: Problems reading DEMs/Internally extruding the mesh

Posted: 07 Nov 2018, 14:59
by gagliar
Hi Martim,

I can see different errors already:
- the DEM should be ordered so that y0 < y1 < ... < yn (see the wiki: http://elmerfem.org/elmerice/wiki/doku. ... terpolator) and this is not the case in your file for the y component
- Variable 1 lx = Real XX and Variable 1 ly = REal YY are not the dx and dy but the length covered by the domain in the x and y directions
- ZsDEM and ZbDEM have to be exported variables, e.g. in the Stokes solver:

Code: Select all

Exported Variable 3 = -dofs 1 "ZbDEM"
Exported Variable 4 = -dofs 1 "ZsDEM" 
To test if it is working after these modification, you should only execute the two first solver (add an Exec Solver = Never in all the other solver sections) and set in the boundary conditions

Code: Select all

! bed BC
Boundary Condition 3
  Bottom Surface = Equals ZbDEM
End
! upper surface BC
Boundary Condition 4
  Body Id = 2
  Top Surface = Equals ZsDEM
End
Also, if you want to execute the Free surface solver then you have to move to a transient problem. It will not work in steady.

Regards,
Olivier

Re: Problems reading DEMs/Internally extruding the mesh

Posted: 07 Nov 2018, 17:26
by martim
Hi Olivier,


Thanks for the tips! I have reordered the DEMs, calculated the lx and ly values (measuring the X and Y lengths in the original raster in QGIS) and made the suggested changes to the .sif file. However, I still do not get an extruded mesh. I am attaching the DEMs and the .sif file

Many thanks once again!

Martim

Re: Problems reading DEMs/Internally extruding the mesh

Posted: 07 Nov 2018, 18:33
by gagliar
Hi Martim,

I found the error (and few smaller ones) in your sif file. The problem is that you have written

Code: Select all

Variable 1 String "ZbDEM"
instead of

Code: Select all

Variable 1 = String "ZbDEM"
(missing "=" sign after variable 1). The Grid2dInterpolator which is looking for "Variable 1 = something" cannot then found any variable and just exit without reading the DEM files, with the consequence that ZsDEM=0 and ZbDEM=0.

I found also that the lx and ly value are not correct. It should be for the bed DEM:

Code: Select all

Variable 1 lx = Real  1377015.381  
  Variable 1 ly = Real  1231361.493
and for the surface DEM:

Code: Select all

Variable 2 lx = Real  1377015.38 
  Variable 2 ly = Real  1231361.493
Also Variable 1 (2) fill should be set to false (even if it should not change anything). Should be true if you have missing grid points in the DEM.

With that it is working but it seems that you have some nodes outside the DEM limits for which the elevations are then extrapolated. It is better to have a mesh contour strictly included in the DEM limits.

Regards,
Olivier

Re: Problems reading DEMs/Internally extruding the mesh

Posted: 08 Nov 2018, 00:27
by martim
Hi Olivier,

Many thanks for the responses and the patience to fix this problem! I had still misinterpreted what lx and ly were, but by looking at your values I can see what they mean now. As for the nodes being outside the DEMs, it is probably because I have downgraded the resolution of the images I extracted the data from, since they were originally clipped using the same mask used for generating the mesh. I will keep that in mind in the future when going through the data extraction process.

Best regards and thank you once again,

Martim