Bugfix spheri3d + new example to test spherical coordinates in TELEMAC-3D
this fixes issue #971 (closed) the problem was that a routine was called twice in 3d, thus changing the coordinates twice, leading to weird numerical values. There was also an issue (pwithout influenc eon the results) for the case that the characteristic method was switch off.
A test case was added to show that this feature now works correctly. the test case is basically a 3d version of the existing m2wave tets case in telemac-2d. The tets was set up in such a way to stick as much as possible to the 2d case (so they do not necessary represent optimal settings). However a few changes were made: -user_fortran routines to adapt bathymetry and friction were not included. instead the mesh of the 2d case with those corrcetions was taken (because that was less work than adapting the userFortran) -wetting-drying was switch on, because of some issue with negative depths, which leads to negative layer thickness and crashes.
EDIT update before merge:
- 2 bug fixes were merged before in 2 different MR in !187 (merged) and !188 (merged),
- 1 change of default value was changed in #994 (closed)
This MR only contains a new example to test spherical coordinates in TELEMAC-3D, based on m2wave TELEMAC-2D example.
Merge request reports
Activity
added module:telemac-3d type:bug labels
requested review from @chi-tuan.pham
- Resolved by Alexander BREUGEM
By the way, when making the test, I found that the default values for LATITUDE OF ORIGIN POINT are different in Telemac2d and telemac-3d. I found this quite confusing, so maybe we should consider changing this.
Hello Alexander,
Thanks for you work, it seems that you have succeeded in fixing the bug.
There are a few things that should be separated in your MR:
- I will think of how to homogenize the two default choice if possible for T2D and T3D (probably the one from T2D),
- thanks for you fix when using characteristics, it makes sense, but should be validated at least empirically on the test case database,
- thanks for you example base on m2wave, I have also started in the same way when I tried to debug following post, but I have not succeeded in: http://www.opentelemac.org/index.php/kunena/21-telemac-3d/14427-tidal-propogation-issues-in-the-gulf-of-st-lawrence
- what you suggest seems to solve the issue but it does not totally satisfy me: it works because INBIEF is called twice, 1st time with 2D mesh then 2nd time with 3D mesh and also giving 2D mesh. The thing is if you only call INBIEF for 3D mesh (with 2D mesh) without calling INBIEF on 2D mesh, you need to call LONGITU once which is not the case with your implementation). I think you have found the key issue, but the implementation should be improved.
Anyway, I think your MR should be split into 4 MR:
- change of default value for LATITUDE OF ORIGIN POINT in 2D or 3D (I will do it later, not urgent),
- fix for characteristics and spherical coordinates in 3D: I let you do (maybe prior to the main issue),
- fix for spherical coordinates in 3D when a more elegant solution is found,
- after the 3rd MR, adding your new example which will be useful as no 3D example is available to check spherical coordinates in T3D at the moment.
Thanks for what you have already done.
Chi-Tuân
- Resolved by Alexander BREUGEM
Hi Chi-Tuân,
I shall make three sperate branches and MRs
1.) bugfix characteristics
2.) bugfix spherical (taking into account you comment, so I will need to redo something there). I need to have a look how to do that exactly
3.) new 3d sherical test case
Kr
Alexander
FYI, currently, the results of the Manche example (for TOMAWAC) sligthly differ with your fix. Spheric example is OK. In addition to commenting the previous lines as you suggest, I think you should at a comment line telling that INBIEF is supposed to have been called once before with the 2D mesh so that special treatments for MESH2D (if present) have already been done previously.
OK. I will add the comment.
I think the reason for the difference might have been that I used previously the option --fast-math when compiling. I think I really should not do that when generating reference files.
Edited by Alexander BREUGEMI will ask @thierry.fouquet to investigate if this fix is acceptable for TOMAWAC.
- Resolved by Alexander BREUGEM
Hello @alexander.breugem, Your 2nd fix is OK with TOMAWAC. With my suggested changes (keeping the old code but commented + adding the comment), it is OK for me to push to a separate MR (after a rebase main as INBIEF subroutine has changed in the main + message in the NEWS.txt file). Once ready, I will be able to accept this fix, in addition to the other one for characteristics in spherical coordinates.
added 1 commit
- 472fba9f - updated comment in bugfix for spherical coordinates in TELEMAC-3D
- Resolved by Alexander BREUGEM
- Resolved by Alexander BREUGEM
- Resolved by Alexander BREUGEM
- Resolved by Alexander BREUGEM
- Resolved by Alexander BREUGEM
- Resolved by Alexander BREUGEM
- Resolved by Alexander BREUGEM
- Resolved by Alexander BREUGEM