dp_tau_centrifugal bug fix Reynolds number#269
dp_tau_centrifugal bug fix Reynolds number#269RaphaelGebhart wants to merge 7 commits intoDLR-SR:mainfrom
Conversation
…est models that use the pump, 3) Adapted the control gain in SimpleCoolingCycle, 4) Changed the initialization of the pump test model
|
Sure. A mistake should be corrected. |
|
I (with support of my trusted AI tool) suggest the following migration strategy: v1.3
v1.4
v2.0
@dzimmer do you approve this approach? |
|
I would also fix the bug. You may also want to display the warning on the icon layer to make sure it is properly identified by the users |
|
I would suggest to fix it. If we want to add the "legacy-flag", I'd only suggest it if the next release is no major release. If we do a major release, we will put it to the release notes and then it should be fine. As long as we don't create a new release it is up to the user to use the latest release or the latest main. So my suggestion: fix it and prepare a major release. |
…corrected version of dp_tau_centrifugal 2) Implemented a minor release compatible warning during simulation if useLegacyReynolds that does gets only triggered a few times (during initialisation), 2) Changed all examples and test models to useLegacyReynolds = false, 4) Included 2 test models, one for the characteristics and one for the design point
… but added figure to the documentation
Thanks for the suggestion. Unfortunately, I don’t think this is feasible in this case. The bug is located inside a function that is used by the pump model, and the proposed fix is also entirely contained within that function. The pump model itself can be configured to use different characteristic functions. Displaying a warning on the icon layer would require the model to receive information from the selected function. This, in turn, would require introducing an additional output to the function interface. Adding such an output would be a breaking API change and therefore only acceptable in a major release. (If I'm not mistaken) |
The reason I prefer the intermediate step is that it allows us to update all models already in v1.3 and ensure that they run correctly with the fix, while still retaining the option to fall back to the old behavior. If we apply the fix only in v2.0, we lose access to the legacy formulation entirely, which makes migration harder. Without an explicit warning, users may experience failing models without a clear indication of the root cause, which could significantly increase debugging time. The intermediate step provides a controlled migration path and makes the transition much more transparent for users. |
|
I suggest going with option 1.3 first, than update with a major release to 2.0. Keeping backward compatibility is important. We will break models with a direct fix. |
…cy versions of Dymola (2024x and older) that do not follow the Modelica Guidelines in this point.
|
Ready for review @CorentinLepais. We also have to update the reference files for regression testing in this case. |
There was a problem hiding this comment.
Optional
Since you have already made some changes to the test model, can you maybe improve the layout (extending the size of the white area, add proper names and maybe two showValue block for the two outputs).
CorentinLepais
left a comment
There was a problem hiding this comment.
Maybe the documentation of the pump model can be updated to mention the legacy Reynold option (e.g. "- Centrifugal pump, which implements the equations of a scalable centrifugal pump. Warning the function uses by default a deprecated Reynold formulation which can lead to errors. Please see dp_tau_centrifugal documentation for more information")
There was a problem hiding this comment.
- Icon display in package browser not homogenous (icon layer size is currently based on graphic layer)
- Documentation missing (at least explain the purpose of the model)
- Short description next to model name missing
- Mirror horizontally conduction element
The controller does not allow to reach the setpoints (maybe because the heat source is too small) and when simulated on a longer time the loop starts to oscillate.
There was a problem hiding this comment.
- Icon display in package browser not homogenous (icon layer size is currently based on graphic layer)
- Documentation missing (at least explain the purpose of the model)
- Short description next to model name missing
- Mirror horizontally conduction element
Controller does not allow to reach the setpoint (maybe heat load to small). But maybe it is intended or at least not an issue
There was a problem hiding this comment.
- Icon display in package browser not homogenous (icon layer size is currently based on graphic layer)
- Documentation missing (at least explain the purpose of the model)
- Short description next to model name missing
- Mirror horizontally conduction element
- inlet_temp block not connected
There was a problem hiding this comment.
- Icon display in package browser not homogenous (icon layer size is currently based on graphic layer)
- Documentation missing (at least explain the purpose of the model)
- Short description next to model name missing
- Mirror horizontally conduction element
- Clean connection lines
- inlet_temp block not connected
There was a problem hiding this comment.
- Icon display in package browser not homogenous (icon layer size is currently based on graphic layer)
- Documentation missing (at least explain the purpose of the model)
- Short description next to model name missing
- Mirror horizontally conduction element
- inlet_temp block not connected
Continues #168.
In the centrifugal pump model used in
ThermofluidStream.Processes.Internal.TurboComponent.dp_tau_centrifugal,the Reynolds number was calculated incorrectly.
The Reynolds number was overestimated by a factor equal to the density in kg/m³
(e.g. a factor of ~1000 for water). This led to overly strong viscosity effects in the
pump model and therefore incorrect results.
All test models and examples were checked and updated accordingly.
The bug fix has a major impact for open-loop systems, but only a minor impact for
closed-loop systems, when considering the input output behaviour.
Please vote on how to proceed:
If you vote for 2), please indicate which option you prefer:
2.1)
First step: mark the function as obsolete
Second step: remove it from the choices of
replaceable function dp_tau_pumpinThermofluidStream.Processes.PumpThird step: remove the function completely
2.2)
Do nothing
Results for old vs new (bug fixed) correlation:
