This issue was created automatically from an original CUE issue. Further discussion may take place here.
The joined example illustrate a problem in buse.f causing NaN
In this case the crash occur at line 261 of buse.f but it could also occur on line 300 for the opposite flow.
There is no verification that S1-(RD2+H2) is positive...
By the way, in the formula, is this really S1-(RD2+H2) that we should have in this case?
Happy New Year and best wishes for 2021, it is my first cue message this year! :),
Sorry for the delay, after the release of tag v8p2r0 at the beginning of December, lots of work to do before my holidays mid December and this bug seemed to need relevant time to be solved as I am not so familiar with this feature (Agnes used to deal with it a few years ago).
Anyway, you are right, S1-(RD2+H2) can be negative in some cases. Looking at the TELEMAC-3D theory guide, in that configuration, it is not exactly the same formula implemented in the code. It seems that the modification was done when deleting siphon formulation and changing it in a culvert feature in 2017.
What about adding a new test if S1-(RD2+H2) is negative and then give a flowrate formula with S1-S2 rather than S1-(RD2+H2), the remaining source code still unchanged?
My knowledge of culverts is quite limited, I do not know which one would be the best (my first idea would be to choose the 2nd one). Perhaps you may have a better opinion?