-
Notifications
You must be signed in to change notification settings - Fork 182
Description
While trying to solve #4424, I discovered that the pressure/flow behaviour of the Modelica.Fluid.Fittings.GenericResistances.VolumeFlowRate model when I set a = 0 and b > 0 was not
dp = b*V_flow
as claimed by the documentation, but rather dp = 1/b*V_flow, which of course caused the pressure losses to be wrong by many orders of magnitude. The issue can be traced back to this chunk of code:
ModelicaStandardLibrary/Modelica/Fluid/Dissipation.mo
Lines 4618 to 4625 in 9e8b7fb
| M_FLOW := IN_var.rho*(if a>0 and b<=0 then | |
| Modelica.Fluid.Dissipation.Utilities.Functions.General.SmoothPower( | |
| (1/a)*dp, | |
| (1/a)*dp_min, | |
| 0.5) | |
| elseif a>0 and b>0 then | |
| sign(dp)*(-b/(2*a) + sqrt((b/(2*a))^2 + (1/a)*abs(dp))) | |
| else b*dp); |
where the last line should be dp/b rather than b*dp.
Probably nobody has ever used this component in this way, i.e. to obtain a linear pressure-flow characteristic, otherwise we would have heard about that. This needs of course to be fixed in MSL 4.1.0.