Skip to content

Bug in dp_volumeFlowRate_MFLOW function #4552

@casella

Description

@casella

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:

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.

Metadata

Metadata

Assignees

Labels

L: Fluid.DissipationIssue addresses Modelica.Fluid.DissipationbugCritical/severe issue

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions