Skip to content

Commit

Permalink
Fix dimension error of PumpCharacteristics.linearPower (modelica#4259)
Browse files Browse the repository at this point in the history
  • Loading branch information
beutlich committed Jan 18, 2024
1 parent da81bb7 commit 43e203e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Modelica/Fluid/Machines.mo
Expand Up @@ -739,7 +739,7 @@ provided a two-phase medium model is used (see Advanced tab).
W_nominal[2] = c[1] + V_flow_nominal[2]*c[2];
*/
protected
Real c[2] = Modelica.Math.Matrices.solve([ones(3),V_flow_nominal],W_nominal)
Real c[2] = Modelica.Math.Matrices.solve([ones(2),V_flow_nominal],W_nominal)
"Coefficients of linear power consumption curve";
algorithm
consumption := c[1] + V_flow*c[2];
Expand Down
9 changes: 9 additions & 0 deletions ModelicaTest/Fluid/TestComponents/Machines/TestLinearPower.mo
@@ -0,0 +1,9 @@
within ModelicaTest.Fluid.TestComponents.Machines;
model TestLinearPower
extends Modelica.Icons.Example;
Modelica.Units.SI.Power p;
equation
p = Modelica.Fluid.Machines.BaseClasses.PumpCharacteristics.linearPower(V_flow_nominal={1,2}, W_nominal={3,5}, V_flow=11);
assert(p >= 23 and p <= 23, "Error in linearPower");
annotation(experiment(StopTime=1));
end TestLinearPower;
1 change: 1 addition & 0 deletions ModelicaTest/Fluid/TestComponents/Machines/package.order
Expand Up @@ -12,3 +12,4 @@ TestWaterPumpNPSH
TestWaterPumpPowerCharacteristic
TestWaterPumpRecirculation
TestWaterPumpVariableSpeed
TestLinearPower
@@ -0,0 +1,2 @@
time
p

0 comments on commit 43e203e

Please sign in to comment.