For specific components (armatures, fittings, pipe sections, grids, ...), the pressure loss coefficient is often given in the data sheet.
Together with a given (or calculated) reference area A, the pressure drop can be calculated:
dp := zeta * rho/2 * v^2 = zeta/(2*rho) * m_flow^2/A^2
The square of the mass-flow is regularized using the Modelica.Fluid.Utilities.regSquare function.
function zetaPressureLoss extends Internal.FlowResistance.partialPressureLoss; input Real zeta(unit = "1") "Pressure loss coefficient (dp = zeta*rho/2*v^2)" annotation( Dialog(enable = true)); input Boolean fromGeometry = true "= true, if cross-sectional area if calculated from geometry" annotation( Dialog(enable = true, group = "Cross-sectional area"), Evaluate = true, HideResult = true, choices(checkBox = true)); input SI.Area A = Modelica.Constants.pi*r*r "Cross-sectional area" annotation( Dialog(group = "Cross-sectional area", enable = not fromGeometry)); end zetaPressureLoss;