function DarcyFrictionFactor import SI = Modelica.SIunits; import Modelica.Math; import Modelica.Constants.pi; input SI.MassFlowRate m_flow; input SI.Area area; input SI.Density rho; input SI.DynamicViscosity mu; input SI.Diameter diameter; input SI.Length roughness; input SI.Length length; input SI.ReynoldsNumber Re_turbulent = 4000 "Turbulent flow if Re >= Re_turbulent (dummy if use_Re_turbulent = false)"; output SI.Pressure dp "Pressure loss (dp = port_a.p - port_b.p)"; end DarcyFrictionFactor;