Closed CyprienBosserelle closed 1 year ago
There is a new test to confirm the validity of the new gradient and the speed gain. The new scheme is about 1.8x faster than original which should make the whole simulation 1.15x faster
Need to write a new test for the halo to verify where the bug is and once fixed whether this new scheme is worth it
The new halo scheme does not work and I'm not too sure why. a day of work didn't get me very far. I think I'm happy to drop that part and merge what I have done to move this along and possibly move on to more important problems.
Barycentric interpolation for the prolongation halo is necessary for checking whether neighbours are wet. Even if the halo value is re-calculated later when applying refine_linear.
All of the instabilities (when not using Conserve Elevation) are because of the wet/dry front and varying resolution don't mix well. The solution to that issue in "Conserve elevation" uses a direct injection of values from the coarse wet cell for the halo rather than what come from refine linear. while "Conserv elevation" also does other things maybe we can use that prolongation even when not requesting conserve elevation. that would in effect only affect the cells at the wet/dry interface. The only issue would be that those cells do not conserve volume. does it mater so much?
Straight injection from Prolongation when neighbouring cell is dry affects the value of h, zs and zb. Also this action doesn't affect dzbdx. is that ok? The changes to zb should probably reverted at the end of the step. no?
On the other end, appling zb and h changes only to cells with wet neighbours sounds good but is a very inefficient action (50% slower!) so that should not be implemented.
I wonder if we can reduce that so it does't try tp do anything on the GPU when blocks only have neighbour of the same level
Preformed a test to see the influence/impact of switching on/off the : dhdx[halo] = T(0.0); dzsdx[halo] = T(0.0);
in ProlongationElevationGH. This seem to have little effect.
Why is the calculation of dzbdx and dzbdy for GPU produced different result than CPU? The GPU side was replaced by a straight copy from CPU.
Once we are happy with the difference it will be ready to merge!
Waikanae topo with cst rain at 50mm/h for 1 h. using the rainbnd option and wall bnd on all side. Results are undestinguishable from each other and after 1 hr the model has 100.48% of the theoretical volume of water in both with and without the wetdryfix.
For comparison the current Dev branch has 100.19% of the theoretical volume. While this is somehow better it does not really undermine the new branch (i.e. the dev branch might get closer to the theory for the wrong raisons), the bugfixes and instability improvement of this branch are totally justified.
results | % of theoretical volume | runtime | |
---|---|---|---|
Wetdry fix | 100.48% | 97s | |
NO Wetdryfix | 100.48% | 96s | |
Development | 100.18% | 116s |
The impact of the wet/dry fix should be much more obvious in tsunami simulation but here conserve elevation should be used in most tsunami cases.
switching off the wetdryfix causes instability that really have an impact on tsunami wave. Here the instability are clearly visible in the map and in the comparison are seen as 0.01 m waves before the tsunami wave arrive.
When using the wetdryfix the instabilities disappear and the solution is smoother.
The instabilities are more obvious when we look at a transect diagonally from the plot above. These instabilities have a notable affect the height of the tsunami wave... a lot! This justifies that we should have the wetdryfix switched on by default.
When running tsunami/storm surge simulation without rivers or rain then the conserve elevation should be switched on. This doesn't make a considerable impact on the tsunami wave (see transect above the red and blue line are indistinguishable) I'm not sure why the difference is so small but there is a difference. Below is the difference between the wetdryfix and conservelevation routine. it produces a difference of O(10-5).
Optimising gradient and gradient-halo
There is a new test to confirm the validity of the new gradient and gradient halo the speed gain. The new scheme is about 1.8x faster than original which should make the whole simulation 1.15x faster
This makes the model 22% faster than the current dev branch
including speed test