Skip to content

Allow specification of flow exponent for pressure drop element#2144

Open
mwetter wants to merge 6 commits into
masterfrom
issue2131_partiallyTurbulentPressureDrop
Open

Allow specification of flow exponent for pressure drop element#2144
mwetter wants to merge 6 commits into
masterfrom
issue2131_partiallyTurbulentPressureDrop

Conversation

@mwetter

@mwetter mwetter commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This closes #2131
See lbl-srg/modelica-buildings#4620 for the changes and rationale.

@mwetter
mwetter requested a review from jelgerjansen June 26, 2026 16:44
@mwetter

mwetter commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@jelgerjansen : Can you please review this PR.

@jelgerjansen

Copy link
Copy Markdown
Contributor

@mwetter please check with @LoneMeertens or @annadellisola if they can do a KU Leuven review (as I left the university 2 months ago)

@LoneMeertens
LoneMeertens self-requested a review June 29, 2026 08:11

@LoneMeertens LoneMeertens left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this valuable contribution. I have carefully reviewed both the implementation and the associated validation models. Overall, this appears to be a very strong and well-structured addition, supported by thorough validation efforts. In particular, the inclusion of inverse-function consistency and derivative verification is highly appreciated and adds significant confidence in the robustness of the implementation.
I only have a few minor suggestions.

However, inside the turbulent region, the results differ slightly because
<a href=\"modelica://IBPSA.Fluid.BaseClasses.FlowModels.powerLaw_dp\">
IBPSA.Fluid.BaseClasses.FlowModels.powerLaw_dp</a>
uses a 5th order polynominal to ensure C2 continuity, while

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small typo: change "polynominal" to "polynomial".

and
<a href=\"modelica://IBPSA.Fluid.BaseClasses.FlowModels.powerLaw_m_flow\">
IBPSA.Fluid.BaseClasses.FlowModels.powerLaw_m_flow</a>
are not invertible.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be worth briefly explaining why the functions are not invertible around the origin (i.e., because of the regularization used to ensure smoothness). This would make the documentation a bit more informative for readers unfamiliar with the implementation.

"Pressure difference between input and output to the functions";
Modelica.Units.SI.Time dTime=2;
parameter Real k = 0.5;
parameter Real n(min=1, max=2) = 1/0.8

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have the limiting cases n = 1 and n = 2 also been tested? Since these are the bounds of the supported interval, it would be good to know whether they have been verified as well

Modelica.Units.SI.Pressure deltaDp(displayUnit="Pa")
"Pressure difference between input and output to the functions";
Modelica.Units.SI.Time dTime=2;
parameter Real k = 0.5;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some spacing for alignment?

Modelica.Fluid</a>
can be used and combined with models from the
<code>IBPSA</code> library.
<code>Buildings</code> library.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IBPSA?

InvertingBasicFlowFunction_m_flow
InvertingPowerLaw_dp
InvertingPowerLaw_m_flow
PowerLaw_dp

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add a validation test model for PowerLaw_m_flow, analogous to PowerLaw_dp?

Comment on lines +112 to +116
</html>", revisions="<html>
<ul>
<li>
December 19, 2025, by Michael Wetter:<br/>
First implementation.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clarify why the revision here differs from the revisions used in the other models? Just want to check whether this is intentional or if it should be aligned.

</li>
</ul>
</html>"),
Icon(graphics={ Line(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove obsolete whitespace.

</li>
</ul>
</html>"),
Icon(graphics={ Line(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove obsolete whitespace.

</li>
</ul>
</html>"),
Icon(graphics={ Line(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove obsolete whitespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a pressure drop element for partially turbulent flow

3 participants