Function that computes pressure drop for given mass flow rate
Function that computes the pressure drop of flow elements as
Δp = sign(ṁ) (ṁ ⁄ k)2
with regularization near the origin.
Therefore, the flow coefficient is
k = ṁ ⁄ √ Δp
The input m_flow_turbulent
determines the location of the regularization.
function basicFlowFunction_m_flow
input Modelica.Units.SI.MassFlowRate m_flow "Mass flow rate in design flow direction";
input Real k(unit = "") "Flow coefficient, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2)";
input Modelica.Units.SI.MassFlowRate m_flow_turbulent(min = 0) "Mass flow rate where transition to turbulent flow occurs";
output Modelica.Units.SI.PressureDifference dp(displayUnit = "Pa") "Pressure difference between port_a and port_b (= port_a.p - port_b.p)";
end basicFlowFunction_m_flow;
-
December 9, 2019, by Michael Wetter:
Added smooth(2, . )
, similar to
IBPSA.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp.
See #1240.
-
January 4, 2019, by Michael Wetter:
Set `Inline=false`.
See #1070.
-
May 1, 2017, by Filip Jorissen:
Revised implementation such that
IBPSA.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow
is C2 continuous.
See #725.
-
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.
-
August 10, 2011, by Michael Wetter:
Removed if-then
optimization that set dp=0
if m_flow=0
,
as this causes the derivative to be discontinuous at m_flow=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.
-
April 13, 2009, by Michael Wetter:
First implementation.
Generated at 2025-03-09T19:25:01Z
by OpenModelicaOpenModelica 1.24.5 using GenerateDoc.mos