Compute mass flow rate from constant loss factor and pressure drop (m_flow = f(dp)). If the Reynolds-number Re ≥ data.Re_turbulent, the flow is treated as a turbulent flow with constant loss factor zeta. If the Reynolds-number Re < data.Re_turbulent, the flow is laminar and/or in a transition region between laminar and turbulent. This region is approximated by two polynomials of third order, one polynomial for m_flow ≥ 0 and one for m_flow < 0. The common derivative of the two polynomials at Re = 0 is computed from the equation "data.c0/Re".
If no data for c0 is available, the derivative at Re = 0 is computed in such a way, that the second derivatives of the two polynomials are identical at Re = 0. The polynomials are constructed, such that they smoothly touch the characteristic curves in the turbulent regions. The whole characteristic is therefore continuous and has a finite, continuous first derivative everywhere. In some cases, the constructed polynomials would "vibrate". This is avoided by reducing the derivative at Re=0 in such a way that the polynomials are guaranteed to be monotonically increasing. The used sufficient criteria for monotonicity follows from:
function massFlowRate_dp_and_Re extends Modelica.Icons.Function; import Modelica.Constants.pi; input SI.Pressure dp "Pressure drop (dp = port_a.p - port_b.p)"; input SI.Density rho_a "Density at port_a"; input SI.Density rho_b "Density at port_b"; input SI.DynamicViscosity mu_a "Dynamic viscosity at port_a"; input SI.DynamicViscosity mu_b "Dynamic viscosity at port_b"; input LossFactorData data "Constant loss factors for both flow directions" annotation( choices(choice = Modelica.Fluid.Fittings.BaseClasses.QuadraticTurbulent.LossFactorData.wallFriction(), choice = Modelica.Fluid.Fittings.BaseClasses.QuadraticTurbulent.LossFactorData.suddenExpansion(), choice = Modelica.Fluid.Fittings.BaseClasses.QuadraticTurbulent.LossFactorData.sharpEdgedOrifice())); output SI.MassFlowRate m_flow "Mass flow rate from port_a to port_b"; end massFlowRate_dp_and_Re;