Skip to content
Snippets Groups Projects

Bugfix spheri3d + new example to test spherical coordinates in TELEMAC-3D

Merged Alexander BREUGEM requested to merge bugfixSpheri3d into main

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:

This MR only contains a new example to test spherical coordinates in TELEMAC-3D, based on m2wave TELEMAC-2D example.

Edited by Chi-Tuân Pham

Merge request reports

Approval is optional

Merged by Chi-Tuân PhamChi-Tuân Pham 9 months ago (Jul 9, 2024 10:07pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • requested review from @chi-tuan.pham

  • 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

  • How do you want to proceed for the fix when using characteristics? It is OK with the rest of the test cases database and can be pushed to main. Do you prefer to create a separated MR that I can review and approve or do you prefer to let me do directly on the main?

    • 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 BREUGEM
  • I will ask @thierry.fouquet to investigate if this fix is acceptable for TOMAWAC.

  • 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.

  • ok. thx for checking. I will make the two new MR's asap (well actually 3, the third is the 3d tets case). Hopefully I manage next week

  • added 1 commit

    • 472fba9f - updated comment in bugfix for spherical coordinates in TELEMAC-3D

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading