functionpowerLaw_dp_inv
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
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.MassFlowRate | m_flow | Mass flow rate | |
| Real | k | Flow coefficient, k = m_flow/ dp^(1/n) | |
| Real | n | Flow exponent, n=1 for laminar, n=2 for turbulent | |
| Modelica.Units.SI.MassFlowRate | m_flow_turbulent | Mass flow rate where transition to turbulent flow occurs | |
| Modelica.Units.SI.PressureDifference | dp_turbulent | Pressure difference where turbulent flow occurs | |
| Real | m | Flow exponent for the pressure drop | |
| Real | a1 | Polynomial coefficient for regularized implementation of flow resistance | |
| Real | a3 | Polynomial coefficient for regularized implementation of flow resistance | |
| Real | a5 | Polynomial coefficient for regularized implementation of flow resistance | |
| Real | C | Coefficient 1/k^n, based on the definition k = m_flow / dp^(1/n) | |
| Real | b1 | Polynomial coefficient for regularized implementation of flow resistance | |
| Real | b3 | Polynomial coefficient for regularized implementation of flow resistance | |
| Real | b5 | Polynomial coefficient for regularized implementation of flow resistance |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.PressureDifference | dp | Pressure difference |
Revisions
-
October 22, 2026, by Martin Sjölund:
First implementation.
This is for Buildings, #4798.