Skip to content

Commit cf4c2e3

Browse files
authored
Fixes #4554 (#4555)
* Addresses the first part of #4554 * Addresses second part of #4554
1 parent e1040f2 commit cf4c2e3

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

ModelicaTest/Fluid/TestComponents/Machines/TestLinearPower.mo

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ model TestLinearPower
44
Modelica.Units.SI.Power p;
55
equation
66
p = Modelica.Fluid.Machines.BaseClasses.PumpCharacteristics.linearPower(V_flow_nominal={1,2}, W_nominal={3,5}, V_flow=11);
7-
assert(p >= 23 and p <= 23, "Error in linearPower");
7+
assert(Modelica.Math.isEqual(p, 23.0, 1e-9), "Error in linearPower");
88
annotation(experiment(StopTime=1));
99
end TestLinearPower;

ModelicaTest/Fluid/TestComponents/Pipes/DynamicPipeEnergyConservationCheck2.mo

+7-4
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,13 @@ equation
133133
total_AV_VB_b = pipeAV_VB.H_flows[end] + pipeAV_VB.m_flows[end]*pipeAV_VB.flowModel.vs[end]^2/2;
134134
total_A_V_B_a = pipeA_V_B.H_flows[1] + pipeA_V_B.m_flows[1]*pipeA_V_B.flowModel.vs[1]^2/2;
135135
total_A_V_B_b = pipeA_V_B.H_flows[end] + pipeA_V_B.m_flows[end]*pipeA_V_B.flowModel.vs[end]^2/2;
136-
assert(time < 500 or Modelica.Math.isEqual(total_AV_B_a, total_AV_B_b, 1), "Energy not conserved!");
137-
assert(time < 500 or Modelica.Math.isEqual(total_A_VB_a, total_A_VB_b, 1), "Energy not conserved!");
138-
assert(time < 500 or Modelica.Math.isEqual(total_AV_VB_a, total_AV_VB_b, 1), "Energy not conserved!");
139-
assert(time < 500 or Modelica.Math.isEqual(total_A_V_B_a, total_A_V_B_b, 1), "Energy not conserved!");
136+
when terminal() then
137+
assert(time > 495, "Steady state was not yet reached at StopTime");
138+
assert(Modelica.Math.isEqual(total_AV_B_a, total_AV_B_b, 1), "Energy not conserved!");
139+
assert(Modelica.Math.isEqual(total_A_VB_a, total_A_VB_b, 1), "Energy not conserved!");
140+
assert(Modelica.Math.isEqual(total_AV_VB_a, total_AV_VB_b, 1), "Energy not conserved!");
141+
assert(Modelica.Math.isEqual(total_A_V_B_a, total_A_V_B_b, 1), "Energy not conserved!");
142+
end when;
140143
connect(boundary.ports[1], pipeAV_B.port_a)
141144
annotation (Line(points={{-20,50},{-10,50}}, color={0,127,255}));
142145
connect(pipeAV_B.port_b, boundary1.ports[1])

0 commit comments

Comments
 (0)