functionbasicFlowFunction_dp

Function that computes mass flow rate for given pressure drop

Information

Function that computes the mass flow rate of flow elements as

ṁ = sign(Δp) k √ |Δp|  

with regularization near the origin so that the function is twice continuously differentiable. Therefore, for Δp > 0, the flow coefficient is

k = ṁ ⁄ √ Δp  

The input m_flow_turbulent determines the location of the regularization.

The inverse of this function is Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_inv.

Inputs

TypeNameDefaultDescription
Modelica.Units.SI.PressureDifferencedpPressure difference between port_a and port_b (= port_a.p - port_b.p)
RealkFlow coefficient, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2)
Modelica.Units.SI.MassFlowRatem_flow_turbulentMass flow rate where transition to turbulent flow occurs

Outputs

TypeNameDefaultDescription
Modelica.Units.SI.MassFlowRatem_flowMass flow rate in design flow direction

Revisions

  • October 22, 2026, by Michael Wetter:
    Updated documentation.
    This is for Buildings, #4798.
  • October 22, 2026, by Martin Sjölund:
    Changed the inverse annotation from basicFlowFunction_m_flow, which differs from the inverse in the laminar region, to the exact inverse Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp_inv.
    This is for Buildings, #4798.
  • November 9, 2019, by Filip Jorissen:
    Added smooth(2, . ) for avoiding a warning in the check valve model.
    See #1240.
  • January 4, 2019, by Michael Wetter:
    Set `Inline=false`.
    See #1070.
  • May 1, 2017, by Filip Jorissen:
    Revised implementation such that basicFlowFunction_dp is C2 continuous. See #725.
  • March 19, 2016, by Michael Wetter:
    Added abs function for Buildings.Fluid.FixedResistances.Validation.PressureDropsExplicit to work in OpenModelica. See OpenModelica ticket 3778.
  • January 22, 2016, by Michael Wetter:
    Corrected type declaration of pressure difference. This is for #404.
  • July 28, 2015, by Michael Wetter:
    Removed double declaration of smooth(..) and smoothOrder and changed Inline=true to LateInline=true. This is for issue 301.
  • July 15, 2015, by Filip Jorissen:
    New, more efficient implementation based on regularisation using simple polynomial. Expanded common subexpressions for function inlining to be possible. Set Inline=true for inlining to occur. This is for #279.
  • January 9, 2014, by Michael Wetter:
    Correct revision section, of which there were two.
  • August 10, 2011, by Michael Wetter:
    Removed if-then optimization that set m_flow=0 if dp=0, as this causes the derivative to be discontinuous at dp=0.
  • August 4, 2011, by Michael Wetter:
    Removed option to use a linear function. The linear implementation is now done in models that call this function. With the previous implementation, the symbolic processor may not rearrange the equations, which can lead to coupled equations instead of an explicit solution.
  • March 29, 2010 by Michael Wetter:
    Changed implementation to allow k=0, which is the case for a closed valve with no leakage
  • April 13, 2009, by Michael Wetter:
    First implementation.