Function that computes the pressure drop of flow elements as
ṁ = sign(Δp) k √ Δp
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_dp input Modelica.Units.SI.PressureDifference dp(displayUnit = "Pa") "Pressure difference between port_a and port_b (= port_a.p - port_b.p)"; input Real k(min = 0, 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.MassFlowRate m_flow "Mass flow rate in design flow direction"; end basicFlowFunction_dp;
smooth(2, . )
for avoiding
a warning in the check valve model.abs
function for
AixLib.Fluid.FixedResistances.Validation.PressureDropsExplicit
to work in OpenModelica.
See
OpenModelica ticket 3778.
smooth(..)
and smoothOrder
and changed Inline=true
to LateInline=true
.
This is for
issue 301.
Inline=true
for inlining to occur.
This is for
#279.
if-then
optimization that set m_flow=0
if dp=0
,
as this causes the derivative to be discontinuous at dp=0
.
k=0
, which is
the case for a closed valve with no leakage