Francesco Casella
Francesco Casella
@sjoelund, @rfranke, @HansOlsson I need two last positive reviews to merge this into 4.1.0 Deadline: 02 Feb 2024. Thanks!
I'll have a look at it ASAP. The issue is non-trivial, and I did not write the original code myself.
This is kind of odd. The proposed test case sets the [8th input of massFlowRate_dp_staticHead](https://github.com/modelica/ModelicaStandardLibrary/blob/7d2e8d7a7e2738f9eaa0fe45ca21af54eb1e6ac9/Modelica/Fluid/Pipes.mo#L1814) `g_times_height_ab = 0`, i.e., the pipe is horizontal. This simplifies the analysis of [massFlowRate_dp_staticHead](https://github.com/modelica/ModelicaStandardLibrary/blob/7d2e8d7a7e2738f9eaa0fe45ca21af54eb1e6ac9/Modelica/Fluid/Pipes.mo#L2525) considerably,...
OK, I made some more enquiries using the very nice OMC [algorithmic debugger](https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/debugger.html#the-algorithmic-debugger). This MWE replicates the problem with `regFun3()` at the point were the mass flow rate function jumps:...
> Since this issue originates from the test model ModelicaTest.Fluid.TestPipesAndValves.BranchingPipes18 this models needs to be adapated as well (either by avoiding horizontal tubes or by fixing the calls of rgularization...
> We agree that `ModelicaTest.Fluid.TestPipesAndValves.BranchingPipes18` would have to be adapted to have a non-zero static-head value. Again, unless I am missing some point (this issue is quite intricate) I don't...
If (as suggested in [#3758 comment](https://github.com/modelica/ModelicaStandardLibrary/issues/3758)) changing some thresholds allows to handle the horizontal tube case successfully, I am definitely in favour of that.
IMHO the right approach here is to make sure that regFun3 always produces the expected results, as stated in its [documentation](https://build.openmodelica.org/Documentation/Modelica.Fluid.Utilities.regFun3.html). If it doesn't, there is a hole in the...
> I didn't understand offhand the algorithm in Modelica.Fluid.Utilities.regFun3. Me neither 😅 >Therefore, I don't know what the problem is with the discontinuity at the edges and whether this can...
The original problem was with a certain model. The root cause is regFun3 not behaving, but this ticket remains valid IMHO.