functionpowerLaw_dp_inv

Inverse of powerLaw_dp, which computes pressure drop for given mass flow rate

Information

Function that computes the pressure difference for a given mass flow rate as the inverse of Buildings.Fluid.BaseClasses.FlowModels.powerLaw_dp. Hence, powerLaw_dp evaluated at the pressure difference computed by this function is equal to m_flow up to rounding errors.

This function is the inverse of Buildings.Fluid.BaseClasses.FlowModels.powerLaw_dp. It differs from Buildings.Fluid.BaseClasses.FlowModels.powerLaw_m_flow in the laminar region because the two functions use different polynomials for the regularization. It takes the same arguments as powerLaw_dp, except that the first argument is the mass flow rate. The coefficients are computed by the function Buildings.Fluid.BaseClasses.FlowModels.powerLawData.

Implementation

For |ṁ| ≥ ṁt, the function is

Δp = C sign(ṁ) |ṁ|n,

which is the exact inverse of the turbulent branch of powerLaw_dp. Otherwise, the normalized mass flow rate x = ṁ ⁄ ṁt and the normalized pressure difference d = Δp ⁄ Δpt are related by the polynomial x = d (c1 + c3 d2 + c5 d4), with c1 = (m-3)(m-5)/8, c3 = (m-1)(5-m)/4 and c5 = (m-1)(m-3)/8. Its inverse is approximated by the rational function

d = x (8 + 2 (7m - m2 - 4) x2) ⁄ ((m-3)(m-5) + (22m - 3m2 - 15) x2),

which has the slope of the inverse at x=0 and its value and slope at x=1. Its denominator is positive for 0 < m < 3. For m between 0.5 and 1, its relative error is below 1.4 ⋅ 10-2. Two steps of Halley's method on the polynomial reduce the relative error to the order of the machine precision.

Inputs

TypeNameDefaultDescription
Modelica.Units.SI.MassFlowRatem_flowMass flow rate
RealkFlow coefficient, k = m_flow/ dp^(1/n)
RealnFlow exponent, n=1 for laminar, n=2 for turbulent
Modelica.Units.SI.MassFlowRatem_flow_turbulentMass flow rate where transition to turbulent flow occurs
Modelica.Units.SI.PressureDifferencedp_turbulentPressure difference where turbulent flow occurs
RealmFlow exponent for the pressure drop
Reala1Polynomial coefficient for regularized implementation of flow resistance
Reala3Polynomial coefficient for regularized implementation of flow resistance
Reala5Polynomial coefficient for regularized implementation of flow resistance
RealCCoefficient 1/k^n, based on the definition k = m_flow / dp^(1/n)
Realb1Polynomial coefficient for regularized implementation of flow resistance
Realb3Polynomial coefficient for regularized implementation of flow resistance
Realb5Polynomial coefficient for regularized implementation of flow resistance

Outputs

TypeNameDefaultDescription
Modelica.Units.SI.PressureDifferencedpPressure difference

Revisions

  • October 22, 2026, by Martin Sjölund:
    First implementation.
    This is for Buildings, #4798.