The loss factors are given for mass flow rates from port_a to port_b as:
A_a < A_b (Idelchik 1994, diagram 4-1, p. 208): zeta = dp/(rho_a*v_a^2/2) = (1 - A_a/A_b)^2 for Re_a ≥ 3.3e3 (turbulent flow) zeta = 30/Re for Re_a < 10 (laminar flow) A_a > A_b (Idelchik 1994, diagram 4-9, p. 216 and diagram 4-10, p. 217) zeta = dp/(rho_b*v_b^2/2) = 0.5*(1 - A_b/A_a)^0.75 for Re_b ≥ 1e4 (turbulent flow) zeta = 30/Re for Re_a < 10 (laminar flow)
encapsulated function suddenExpansion import Modelica.Units.SI; import Modelica.Fluid.Fittings.BaseClasses.QuadraticTurbulent.LossFactorData; input SI.Diameter diameter_a "Inner diameter of pipe at port_a" annotation( Dialog); input SI.Diameter diameter_b "Inner diameter of pipe at port_b" annotation( Dialog); output LossFactorData data "Pressure loss factors for both flow directions"; end suddenExpansion;