Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr ModelicaTest_3.2.1_ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.conf.json loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaTest 3.2.1+maint.om/package.mo", uses=false) Using package ModelicaTest with version 3.2.1 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaTest 3.2.1+maint.om/package.mo) Using package Modelica with version 3.2.3 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/package.mo) Using package Complex with version 4.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo) Using package ModelicaServices with version 4.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo) Running command: translateModel(ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="ModelicaTest_3.2.1_ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH") translateModel(ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="ModelicaTest_3.2.1_ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.0009124/0.0009124, allocations: 107.1 kB / 16.42 MB, free: 6.031 MB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo): time 0.0008714/0.0008713, allocations: 186.6 kB / 17.35 MB, free: 5.602 MB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/package.mo): time 1.216/1.216, allocations: 205.1 MB / 223.2 MB, free: 12.23 MB / 190.1 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaTest 3.2.1+maint.om/package.mo): time 0.1633/0.1633, allocations: 38 MB / 308.6 MB, free: 5.98 MB / 254.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 1.803e-05/1.804e-05, allocations: 5.375 kB / 433.6 MB, free: 14.48 MB / 318.1 MB Notification: Performance of NFInst.instantiate(ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH): time 0.03308/0.0331, allocations: 41.69 MB / 475.3 MB, free: 4.633 MB / 350.1 MB Notification: Performance of NFInst.instExpressions: time 0.02299/0.05613, allocations: 20.47 MB / 495.8 MB, free: 96 kB / 366.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.001089/0.05726, allocations: 27.75 kB / 495.8 MB, free: 68 kB / 366.1 MB Notification: Performance of NFTyping.typeComponents: time 0.001625/0.0589, allocations: 441.2 kB / 496.2 MB, free: 15.63 MB / 382.1 MB [/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/Math/package.mo:1125:3-1182:12:writable] Warning: Pure function 'Modelica.Math.Matrices.solve' contains a call to impure function 'Modelica.Math.Matrices.LAPACK.dgesv_vec'. [/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaTest 3.2.1+maint.om/Fluid/TestComponents/Machines/TestWaterPumpNPSH.mo:19:15-21:68:writable] Warning: Pure function 'ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.flowCharacteristic' contains a call to impure function 'Modelica.Math.Matrices.solve'. Notification: Performance of NFTyping.typeBindings: time 0.01334/0.07232, allocations: 5.24 MB / 0.4897 GB, free: 10.39 MB / 382.1 MB [/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/Fluid/Machines.mo:335:17-340:42:writable] Warning: Pure function 'ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.powerCharacteristic' contains a call to impure function 'Modelica.Math.Matrices.solve'. Notification: Performance of NFTyping.typeClassSections: time 0.00607/0.07841, allocations: 2.405 MB / 0.4921 GB, free: 7.973 MB / 382.1 MB Notification: Performance of NFFlatten.flatten: time 0.002243/0.08067, allocations: 1.886 MB / 0.4939 GB, free: 6.082 MB / 382.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0006333/0.08131, allocations: 469.4 kB / 0.4944 GB, free: 5.621 MB / 382.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.001195/0.08252, allocations: 0.8095 MB / 0.4951 GB, free: 4.809 MB / 382.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.007218/0.08975, allocations: 3.701 MB / 0.4988 GB, free: 1.055 MB / 382.1 MB Notification: Performance of NFPackage.collectConstants: time 0.0001437/0.08991, allocations: 64 kB / 0.4988 GB, free: 0.9922 MB / 382.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.01158/0.1015, allocations: 7.348 MB / 0.506 GB, free: 9.637 MB / 398.1 MB Notification: Performance of combineBinaries: time 0.001223/0.1027, allocations: 1.419 MB / 0.5074 GB, free: 8.203 MB / 398.1 MB Notification: Performance of replaceArrayConstructors: time 0.0005527/0.1033, allocations: 0.9061 MB / 0.5083 GB, free: 7.285 MB / 398.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0002088/0.1035, allocations: 139.6 kB / 0.5084 GB, free: 7.148 MB / 398.1 MB Notification: Performance of FrontEnd: time 0.000167/0.1037, allocations: 23.88 kB / 0.5084 GB, free: 7.125 MB / 398.1 MB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 146 (126) * Number of variables: 146 (146) Notification: Performance of Bindings: time 0.003567/0.1073, allocations: 4.129 MB / 0.5125 GB, free: 2.832 MB / 398.1 MB Notification: Performance of FunctionAlias: time 0.000258/0.1075, allocations: 227.6 kB / 0.5127 GB, free: 2.613 MB / 398.1 MB Notification: Performance of Early Inline: time 0.002629/0.1102, allocations: 2.578 MB / 0.5152 GB, free: 15.99 MB / 414.1 MB Notification: Performance of simplify1: time 0.0001554/0.1103, allocations: 167.8 kB / 0.5154 GB, free: 15.83 MB / 414.1 MB Notification: Performance of Alias: time 0.002435/0.1128, allocations: 2.381 MB / 0.5177 GB, free: 13.2 MB / 414.1 MB Notification: Performance of simplify2: time 0.0001456/0.1129, allocations: 159.8 kB / 0.5178 GB, free: 13.04 MB / 414.1 MB Notification: Performance of Events: time 0.0005202/0.1135, allocations: 439.6 kB / 0.5182 GB, free: 12.6 MB / 414.1 MB Notification: Performance of Detect States: time 0.0005361/0.114, allocations: 0.5907 MB / 0.5188 GB, free: 11.99 MB / 414.1 MB Notification: Performance of Partitioning: time 0.0008864/0.1149, allocations: 0.9116 MB / 0.5197 GB, free: 10.95 MB / 414.1 MB Error: Internal error NBSlice.fillDependencyArray failed because number of flattened indices 1 for dependency pump.heatTransfer.states.T could not be divided by the body size 5 without rest. Error: Internal error NBAdjacency.Matrix.createPseudo failed for: [ARRY] (5) pump.heatTransfer.states = {pump.medium.state} ($RES_BND_135) Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (113/113) **************************** (1) [ALGB] (1) Real pump.head = pump.dp_pump / (pump.g * pump.rho) (2) [ALGB] (1) Real Sink.medium.state.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (3) [DISC] (1) final input Integer pump.monitoring.state.phase = pump.medium.state.phase (min = 0, max = 2) (4) [ALGB] (1) Real Source.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - Source.medium.T_degC)) (5) [ALGB] (1) Real Source.medium.sat.psat (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (6) [ALGB] (1) protected Real Valve.state_b.p (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (7) [ALGB] (1) Real Sink.medium.state.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (8) [ALGB] (1) Real pump.Wb_flow (9) [ALGB] (1) Real pump.monitoring.NPDPa = Modelica.Fluid.Machines.BaseClasses.PumpMonitoring.assertPositiveDifference(ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.monitoring.Medium.pressure(pump.monitoring.state), ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.monitoring.Medium.saturationPressure(ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.monitoring.Medium.temperature(pump.monitoring.state)), "Cavitation occurs in the pump") (10) [ALGB] (1) Real Valve.port_a_T = Modelica.Fluid.Utilities.regStep(-Valve.port_b.m_flow, ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.Valve.Medium.temperature(Valve.state_a), ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.Valve.Medium.temperature(ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.Valve.Medium.setState_phX(99999.99999999999 * pump.medium.p_bar, Valve.port_a.h_outflow, {}, 0, 0)), Valve.m_flow_small) (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (11) [ALGB] (1) protected Real Valve.state_b.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (12) [ALGB] (1) Real[1] Sink.ports.p (start = {5e6 for $i1 in 1:1}, min = {611.657 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (13) [ALGB] (1) Real Sink.medium.p_bar = Modelica.SIunits.Conversions.to_bar(99999.99999999999 * Sink.medium.p_bar) (14) [ALGB] (1) Real Sink.medium.state.p (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (15) [ALGB] (1) Real Valve.port_b.p (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (16) [ALGB] (1) stream Real Valve.port_b.h_outflow (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (17) [ALGB] (1) protected Real Valve.state_b.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (18) [ALGB] (1) Real pump.medium.p_bar = Modelica.SIunits.Conversions.to_bar(99999.99999999999 * pump.medium.p_bar) (19) [ALGB] (1) Real pump.medium.state.p (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (20) [ALGB] (1) Real pump.Hb_flow (21) [DISC] (1) Integer pump.medium.state.phase (min = 0, max = 2) (22) [DISC] (1) Integer Source.medium.phase (fixed = false, start = 1, min = 0, max = 2) (23) [ALGB] (1) flow Real Valve.port_b.m_flow (min = -1e5, max = 1e60) (24) [ALGB] (1) Real pump.medium.state.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (25) [ALGB] (1) Real pump.medium.state.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (26) [ALGB] (1) Real pump.medium.sat.Tsat (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (27) [ALGB] (1) protected Real Valve.state_b.T (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (28) [ALGB] (1) Real pump.V_flow (29) [ALGB] (1) Real Source.medium.u (min = -1e8, max = 1e8, nominal = 1e6) (30) [ALGB] (1) Real pump.Qb_flow (31) [DISC] (1) Boolean $SEV_22 (32) [DISC] (1) Boolean $SEV_21 (33) [DISC] (1) Boolean $SEV_20 (34) [ALGB] (1) stream Real[1] Sink.ports.h_outflow (start = {1e5 for $i1 in 1:1}, min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {5e5 for $i1 in 1:1}) (35) [ALGB] (1) Real $FUN_1 (36) [ALGB] (1) Real Sink.medium.u (min = -1e8, max = 1e8, nominal = 1e6) (37) [ALGB] (1) Real[1] pump.heatTransfer.Ts = {ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.heatTransfer.Medium.temperature(pump.heatTransfer.states[1])} (start = {288.15 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, nominal = {300.0 for $i1 in 1:1}) (38) [ALGB] (1) Real pump.medium.sat.psat (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (39) [ALGB] (1) Real pump.rho = pump.rho (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (40) [ALGB] (1) Real Source.medium.h (StateSelect = default) (41) [ALGB] (1) Real pump.medium.state.T (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (42) [ALGB] (1) Real pump.m_flow = pump.m_flow (43) [DISC] (1) Integer Sink.medium.phase (fixed = false, start = 1, min = 0, max = 2) (44) [ALGB] (1) Real pump.m (min = 0.0) (45) [ALGB] (1) Real pump.V_flow_single (start = pump.m_flow_start / (pump.nParallel * pump.rho_nominal)) (46) [ALGB] (1) Real Source.medium.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0, StateSelect = default) (47) [ALGB] (1) flow Real[1] pump.heatTransfer.heatPorts.Q_flow (48) [DISC] (1) Integer pump.medium.phase (fixed = false, start = 1, min = 0, max = 2) (49) [ALGB] (1) Real Source.medium.state.T (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (50) [ALGB] (1) Real Sink.medium.h (StateSelect = default) (51) [ALGB] (1) Real Sink.medium.sat.Tsat (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (52) [ALGB] (1) Real pump.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - pump.medium.T_degC)) (53) [ALGB] (1) Real Sink.medium.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0, StateSelect = default) (54) [ALGB] (1) stream Real Valve.port_a.h_outflow (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (55) [DISC] (1) Boolean $SEV_19 (56) [DISC] (1) Boolean $SEV_18 (57) [ALGB] (1) Real pump.port_a.p (start = pump.p_a_start, min = 611.657, max = 1e8, nominal = 1e6) (58) [DISC] (1) Boolean $SEV_17 (59) [ALGB] (1) final input Real[1, 1] pump.heatTransfer.states.T = {pump.medium.state.T} (start = {500.0 for $i1 in 1:1}, min = {273.15 for $i1 in 1:1}, max = {2273.15 for $i1 in 1:1}, nominal = {500.0 for $i1 in 1:1}) (60) [ALGB] (1) Real Sink.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - Sink.medium.T_degC)) (61) [DISC] (1) Boolean $SEV_14 (62) [ALGB] (1) Real Source.medium.state.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (63) [DISC] (1) Boolean $SEV_11 (64) [ALGB] (1) Real Sink.medium.sat.psat (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (65) [ALGB] (1) Real Source.medium.state.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (66) [ALGB] (1) Real pump.U (67) [ALGB] (1) Real pump.monitoring.NPSHa = pump.monitoring.NPSPa / (system.g * pump.monitoring.rho_in) (68) [ALGB] (1) protected Real Valve.state_a.p (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (69) [DISC] (1) final input Integer[1, 1] pump.heatTransfer.states.phase = {pump.medium.state.phase} (min = {0 for $i1 in 1:1}, max = {2 for $i1 in 1:1}) (70) [ALGB] (1) Real Valve.port_b_T = Modelica.Fluid.Utilities.regStep(Valve.port_b.m_flow, ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.Valve.Medium.temperature(Valve.state_b), ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.Valve.Medium.temperature(ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.Valve.Medium.setState_phX(Valve.port_b.p, Valve.port_b.h_outflow, {}, 0, 0)), Valve.m_flow_small) (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (71) [ALGB] (1) Real pump.medium.u (min = -1e8, max = 1e8, nominal = 1e6) (72) [ALGB] (1) final input Real[1, 1] pump.heatTransfer.states.d = {pump.medium.state.d} (start = {150.0 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, max = {1e5 for $i1 in 1:1}, nominal = {500.0 for $i1 in 1:1}) (73) [ALGB] (1) Real pump.N (start = pump.N_nominal) (74) [ALGB] (1) Real pump.monitoring.NPSPa = Modelica.Fluid.Machines.BaseClasses.PumpMonitoring.assertPositiveDifference(ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.monitoring.Medium.pressure(pump.monitoring.state_in), ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.monitoring.Medium.saturationPressure(ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.monitoring.Medium.temperature(pump.monitoring.state_in)), "Cavitation occurs at the pump inlet") (75) [ALGB] (1) protected Real Valve.state_a.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (76) [ALGB] (1) final input Real[1, 1] pump.heatTransfer.states.h = {pump.medium.state.h} (start = {1e5 for $i1 in 1:1}, min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {5e5 for $i1 in 1:1}) (77) [ALGB] (1) flow Real[1] Source.ports.m_flow (min = {-1e60}, max = {1e60}) (78) [ALGB] (1) Real pump.W_single (79) [ALGB] (1) final input Real pump.monitoring.state.T = pump.medium.state.T (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (80) [DISC] (1) Boolean $SEV_8 (81) [ALGB] (1) protected Real Valve.state_a.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (82) [DISC] (1) Boolean $SEV_7 (83) [DISC] (1) Boolean $SEV_6 (84) [ALGB] (1) final input Real pump.monitoring.state_in.T (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (85) [DISC] (1) Boolean $SEV_4 (86) [ALGB] (1) Real pump.m_flow_single = pump.m_flow / pump.nParallel (87) [ALGB] (1) Real pump.monitoring.rho_in = ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.monitoring.Medium.density(pump.monitoring.state_in) (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (88) [DISC] (1) Boolean $SEV_3 (89) [ALGB] (1) final input Real[1, 1] pump.heatTransfer.states.p = {pump.medium.state.p} (start = {5e6 for $i1 in 1:1}, min = {611.657 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (90) [DISC] (1) Boolean $SEV_2 (91) [DISC] (1) Boolean $SEV_1 (92) [DISC] (1) Boolean $SEV_0 (93) [ALGB] (1) Real pump.dp_pump = 99999.99999999999 * pump.medium.p_bar - pump.port_a.p (94) [DISC] (1) Integer Sink.medium.state.phase (min = 0, max = 2) (95) [ALGB] (1) Real Valve.dp (start = Valve.dp_start) (96) [DISC] (1) Boolean $TEV_1 (97) [ALGB] (1) Real[1] pump.heatTransfer.Q_flows (98) [DISC] (1) Boolean $TEV_0 (99) [ALGB] (1) final input Real pump.monitoring.state.d = pump.medium.state.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (100) [ALGB] (1) protected Real Valve.state_a.T (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (101) [ALGB] (1) Real pump.eta (102) [ALGB] (1) final input Real pump.monitoring.state_in.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (103) [ALGB] (1) final input Real pump.monitoring.state.h = pump.medium.state.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (104) [DISC] (1) Integer Source.medium.state.phase (min = 0, max = 2) (105) [ALGB] (1) Real Sink.medium.state.T (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (106) [ALGB] (1) flow Real[1] Sink.ports.m_flow (min = {-1e60}, max = {1e60}) (107) [ALGB] (1) final input Real pump.monitoring.state_in.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (108) [ALGB] (1) stream Real[1] Source.ports.h_outflow (start = {1e5 for $i1 in 1:1}, min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {5e5 for $i1 in 1:1}) (109) [ALGB] (1) Real Valve.V_flow = (-Valve.port_b.m_flow) / Modelica.Fluid.Utilities.regStep(-Valve.port_b.m_flow, ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.Valve.Medium.density(Valve.state_a), ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.Valve.Medium.density(Valve.state_b), Valve.m_flow_small) (110) [ALGB] (1) Real[1] pump.heatTransfer.heatPorts.T (start = {288.15 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, nominal = {300.0 for $i1 in 1:1}) (111) [ALGB] (1) final input Real pump.monitoring.state.p = pump.medium.state.p (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (112) [ALGB] (1) Real[1] Source.ports.p (start = {5e6 for $i1 in 1:1}, min = {611.657 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (113) [ALGB] (1) final input Real pump.monitoring.state_in.p (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) System Equations (105/113) **************************** (1) [SCAL] (1) pump.U = pump.m * pump.medium.u ($RES_SIM_15) (2) [SCAL] (1) Sink.ports[1].p = 99999.99999999999 * Sink.medium.p_bar ($RES_SIM_51) (3) [SCAL] (1) pump.m = 0.0 ($RES_SIM_16) (4) [SCAL] (1) Sink.ports[1].h_outflow = Sink.medium.h ($RES_SIM_52) (5) [SCAL] (1) 0.0 = pump.m_flow + Valve.port_b.m_flow ($RES_SIM_17) (6) [SCAL] (1) Sink.medium.h = Modelica.Media.Water.IF97_Utilities.h_pT(99999.99999999999 * Sink.medium.p_bar, Sink.T, 0) ($RES_SIM_53) (7) [SCAL] (1) $FUN_1 = abs(pump.V_flow_single_init) ($RES_$AUX_140) (8) [SCAL] (1) Source.medium.h = Source.medium.state.h ($RES_SIM_91) (9) [SCAL] (1) Source.medium.u = Source.medium.h - Source.p / Source.medium.d ($RES_SIM_93) (10) [SCAL] (1) Source.medium.sat.psat = Source.p ($RES_SIM_94) (11) [SCAL] (1) -((-273.15) - Source.medium.T_degC) = Modelica.Media.Water.IF97_Utilities.T_props_ph(Source.p, Source.medium.h, Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(Source.p, Source.medium.h, Source.medium.phase, 0)) ($RES_SIM_96) (12) [SCAL] (1) Source.medium.d = Modelica.Media.Water.IF97_Utilities.rho_props_ph(Source.p, Source.medium.h, Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(Source.p, Source.medium.h, Source.medium.phase, 0)) ($RES_SIM_97) (13) [SCAL] (1) $SEV_1 = Valve.state_a.d > 0.0 ($RES_EVT_170) (14) [SCAL] (1) Source.medium.phase = if $SEV_17 then 1 else 2 ($RES_SIM_98) (15) [SCAL] (1) $SEV_2 = Valve.dp <= (-Valve.dp_small) ($RES_EVT_171) (16) [SCAL] (1) $SEV_3 = Valve.state_b.d > 0.0 ($RES_EVT_172) (17) [SCAL] (1) $SEV_4 = Valve.state_a.d >= Valve.state_b.d ($RES_EVT_173) (18) [SCAL] (1) $SEV_6 = pump.m_flow > 0.0 ($RES_EVT_175) (19) [SCAL] (1) $SEV_7 = Valve.port_b.m_flow > 0.0 ($RES_EVT_176) (20) [SCAL] (1) $SEV_8 = $FUN_1 > 0.0 ($RES_EVT_177) (21) [SCAL] (1) Valve.port_b.m_flow + Sink.ports[1].m_flow = 0.0 ($RES_SIM_100) (22) [SCAL] (1) pump.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_102) (23) [SCAL] (1) pump.monitoring.NPDPa = Modelica.Fluid.Machines.BaseClasses.PumpMonitoring.assertPositiveDifference(pump.monitoring.state.p, Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.psat(pump.monitoring.state.T), "Cavitation occurs in the pump") ($RES_$AUX_139) (24) [SCAL] (1) pump.Hb_flow = smooth(0, pump.m_flow * (if $SEV_6 then Source.ports[1].h_outflow else Valve.port_b.h_outflow)) + smooth(0, Valve.port_b.m_flow * (if $SEV_7 then Valve.port_a.h_outflow else Valve.port_b.h_outflow)) ($RES_SIM_21) (25) [SCAL] (1) pump.m_flow + Source.ports[1].m_flow = 0.0 ($RES_SIM_103) (26) [SCAL] (1) pump.monitoring.NPSPa = Modelica.Fluid.Machines.BaseClasses.PumpMonitoring.assertPositiveDifference(pump.monitoring.state_in.p, Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.psat(pump.monitoring.state_in.T), "Cavitation occurs at the pump inlet") ($RES_$AUX_138) (27) [SCAL] (1) pump.Qb_flow = pump.heatTransfer.Q_flows[1] ($RES_SIM_22) (28) [SCAL] (1) pump.W_single = homotopy((pump.V_flow_single * pump.dp_pump) / pump.eta, (pump.V_flow_single_init * pump.dp_pump) / pump.eta) ($RES_SIM_24) (29) [SCAL] (1) pump.port_a.p = Source.ports[1].p ($RES_SIM_106) (30) [SCAL] (1) pump.eta = homotopy(0.8, 0.8) ($RES_SIM_25) (31) [SCAL] (1) Valve.port_b.p = Sink.ports[1].p ($RES_SIM_108) (32) [SCAL] (1) Valve.state_a.h = Valve.port_b.h_outflow ($RES_SIM_143) (33) [SCAL] (1) Sink.medium.phase = Sink.medium.state.phase ($RES_SIM_62) (34) [SCAL] (1) pump.head = homotopy((pump.N / pump.N_nominal) ^ 2.0 * ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.flowCharacteristic((pump.N_nominal * pump.V_flow_single) / pump.N, {0.0, 0.001, 0.0015}, {100.0, 50.0, 0.0}), (pump.N / pump.N_nominal) * (ModelicaTest.Fluid.TestComponents.Machines.TestWaterPumpNPSH.pump.flowCharacteristic(pump.V_flow_single_init, {0.0, 0.001, 0.0015}, {100.0, 50.0, 0.0}) + (pump.V_flow_single - pump.V_flow_single_init) * noEvent(if $SEV_8 then (10.0 * pump.delta_head_init) / pump.V_flow_single_init else 0.0))) ($RES_SIM_27) (35) [SCAL] (1) Valve.state_a.d = Modelica.Media.Water.IF97_Utilities.rho_ph(99999.99999999999 * pump.medium.p_bar, Valve.port_b.h_outflow, 0, 0) ($RES_SIM_144) (36) [SCAL] (1) Sink.medium.d = Sink.medium.state.d ($RES_SIM_63) (37) [SCAL] (1) pump.V_flow_single = pump.V_flow / pump.nParallel ($RES_SIM_28) (38) [SCAL] (1) Valve.state_a.T = Modelica.Media.Water.IF97_Utilities.T_ph(99999.99999999999 * pump.medium.p_bar, Valve.port_b.h_outflow, 0, 0) ($RES_SIM_145) (39) [SCAL] (1) -((-273.15) - Sink.medium.T_degC) = Sink.medium.state.T ($RES_SIM_64) (40) [SCAL] (1) pump.V_flow = homotopy(pump.m_flow / pump.rho, pump.m_flow / pump.rho_nominal) ($RES_SIM_29) (41) [SCAL] (1) Valve.state_a.p = 99999.99999999999 * pump.medium.p_bar ($RES_SIM_146) (42) [SCAL] (1) 99999.99999999999 * Sink.medium.p_bar = Sink.medium.state.p ($RES_SIM_65) (43) [SCAL] (1) Sink.medium.h = Sink.medium.state.h ($RES_SIM_66) (44) [SCAL] (1) Valve.state_b.h = Sink.ports[1].h_outflow ($RES_SIM_148) (45) [SCAL] (1) Valve.state_b.d = Modelica.Media.Water.IF97_Utilities.rho_ph(Valve.port_b.p, Sink.ports[1].h_outflow, 0, 0) ($RES_SIM_149) (46) [SCAL] (1) Sink.medium.u = Sink.medium.h - (99999.99999999999 * Sink.medium.p_bar) / Sink.medium.d ($RES_SIM_68) (47) [SCAL] (1) Sink.medium.sat.psat = 99999.99999999999 * Sink.medium.p_bar ($RES_SIM_69) (48) [SCAL] (1) $SEV_11 = (Valve.port_b.h_outflow < Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.hvl_p(pump.medium.sat.psat, Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.boilingcurve_p(pump.medium.sat.psat)) or Valve.port_b.h_outflow > Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.hvl_p(pump.medium.sat.psat, Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.dewcurve_p(pump.medium.sat.psat))) or 99999.99999999999 * pump.medium.p_bar > 2.2064e7 ($RES_EVT_180) (49) [SCAL] (1) $SEV_14 = (Sink.medium.h < Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.hvl_p(Sink.medium.sat.psat, Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.boilingcurve_p(Sink.medium.sat.psat)) or Sink.medium.h > Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.hvl_p(Sink.medium.sat.psat, Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.dewcurve_p(Sink.medium.sat.psat))) or 99999.99999999999 * Sink.medium.p_bar > 2.2064e7 ($RES_EVT_183) (50) [SCAL] (1) $SEV_17 = (Source.medium.h < Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.hvl_p(Source.medium.sat.psat, Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.boilingcurve_p(Source.medium.sat.psat)) or Source.medium.h > Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.hvl_p(Source.medium.sat.psat, Modelica.Media.Water.IF97_Utilities.BaseIF97.Regions.dewcurve_p(Source.medium.sat.psat))) or Source.p > 2.2064e7 ($RES_EVT_186) (51) [SCAL] (1) $SEV_18 = Valve.port_b.m_flow > Valve.m_flow_small ($RES_EVT_187) (52) [SCAL] (1) $SEV_19 = Valve.port_b.m_flow < (-Valve.m_flow_small) ($RES_EVT_188) (53) [SCAL] (1) $SEV_20 = Valve.m_flow_small > 0.0 ($RES_EVT_189) (54) [ARRY] (1) pump.heatTransfer.Ts = {pump.heatTransfer.states.h} ($RES_BND_120) (55) [SCAL] (1) pump.dp_pump = 99999.99999999999 * pump.medium.p_bar - pump.port_a.p ($RES_BND_122) (56) [SCAL] (1) pump.head = pump.dp_pump / (pump.g * pump.rho) ($RES_BND_123) (57) [SCAL] (1) pump.N = max(pump.N_const, 0.001) ($RES_SIM_30) (58) [SCAL] (1) pump.m_flow_single = pump.m_flow / pump.nParallel ($RES_BND_125) (59) [SCAL] (1) pump.Wb_flow = pump.W_single * pump.nParallel ($RES_BND_126) (60) [ARRY] (1) pump.heatTransfer.Q_flows = pump.heatTransfer.heatPorts.Q_flow ($RES_SIM_32) (61) [SCAL] (1) pump.monitoring.rho_in = pump.monitoring.state_in.d ($RES_BND_127) (62) [ARRY] (1) pump.heatTransfer.Ts = pump.heatTransfer.heatPorts.T ($RES_SIM_33) (63) [SCAL] (1) pump.monitoring.NPSHa = pump.monitoring.NPSPa / (system.g * pump.monitoring.rho_in) ($RES_BND_128) (64) [SCAL] (1) Valve.state_b.T = Modelica.Media.Water.IF97_Utilities.T_ph(Valve.port_b.p, Sink.ports[1].h_outflow, 0, 0) ($RES_SIM_150) (65) [SCAL] (1) Valve.state_b.p = Valve.port_b.p ($RES_SIM_151) (66) [SCAL] (1) Sink.medium.sat.Tsat = Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.tsat(99999.99999999999 * Sink.medium.p_bar) ($RES_SIM_70) (67) [SCAL] (1) -((-273.15) - Sink.medium.T_degC) = Modelica.Media.Water.IF97_Utilities.T_props_ph(99999.99999999999 * Sink.medium.p_bar, Sink.medium.h, Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(99999.99999999999 * Sink.medium.p_bar, Sink.medium.h, Sink.medium.phase, 0)) ($RES_SIM_71) (68) [SCAL] (1) pump.monitoring.state_in.h = Source.ports[1].h_outflow ($RES_SIM_153) (69) [SCAL] (1) Sink.medium.d = Modelica.Media.Water.IF97_Utilities.rho_props_ph(99999.99999999999 * Sink.medium.p_bar, Sink.medium.h, Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(99999.99999999999 * Sink.medium.p_bar, Sink.medium.h, Sink.medium.phase, 0)) ($RES_SIM_72) (70) [SCAL] (1) pump.monitoring.state_in.d = Modelica.Media.Water.IF97_Utilities.rho_ph(pump.port_a.p, Source.ports[1].h_outflow, 0, 0) ($RES_SIM_154) (71) [SCAL] (1) Sink.medium.phase = if $SEV_14 then 1 else 2 ($RES_SIM_73) (72) [SCAL] (1) pump.medium.phase = pump.medium.state.phase ($RES_SIM_38) (73) [SCAL] (1) pump.monitoring.state_in.T = Modelica.Media.Water.IF97_Utilities.T_ph(pump.port_a.p, Source.ports[1].h_outflow, 0, 0) ($RES_SIM_155) (74) [SCAL] (1) pump.rho = pump.medium.state.d ($RES_SIM_39) (75) [SCAL] (1) pump.monitoring.state_in.p = pump.port_a.p ($RES_SIM_156) (76) [SCAL] (1) Source.ports[1].p = Source.p ($RES_SIM_75) (77) [SCAL] (1) Source.ports[1].h_outflow = Source.medium.h ($RES_SIM_76) (78) [SCAL] (1) Source.medium.h = Modelica.Media.Water.IF97_Utilities.h_pT(Source.p, Source.T, 0) ($RES_SIM_77) (79) [SCAL] (1) $SEV_21 = (-Valve.port_b.m_flow) > Valve.m_flow_small ($RES_EVT_190) (80) [SCAL] (1) $SEV_22 = (-Valve.port_b.m_flow) < (-Valve.m_flow_small) ($RES_EVT_191) (81) [SCAL] (1) Valve.V_flow = -Valve.port_b.m_flow / smooth(1, if $SEV_21 then Valve.state_a.d else if $SEV_22 then Valve.state_b.d else if $SEV_20 then 0.5 * (Valve.state_a.d + Valve.state_b.d) - 0.25 * (Valve.state_b.d - Valve.state_a.d) * ((-3.0) + (Valve.port_b.m_flow / (-Valve.m_flow_small)) ^ 2.0) * (Valve.port_b.m_flow / Valve.m_flow_small) else 0.5 * (Valve.state_a.d + Valve.state_b.d)) ($RES_BND_131) (82) [SCAL] (1) Valve.port_a_T = smooth(1, if $SEV_21 then Valve.state_a.T else if $SEV_22 then Modelica.Media.Water.IF97_Utilities.T_ph(99999.99999999999 * pump.medium.p_bar, Valve.port_a.h_outflow, 0, 0) else if $SEV_20 then 0.5 * (Valve.state_a.T + Modelica.Media.Water.IF97_Utilities.T_ph(99999.99999999999 * pump.medium.p_bar, Valve.port_a.h_outflow, 0, 0)) - 0.25 * (Modelica.Media.Water.IF97_Utilities.T_ph(99999.99999999999 * pump.medium.p_bar, Valve.port_a.h_outflow, 0, 0) - Valve.state_a.T) * ((-3.0) + (Valve.port_b.m_flow / (-Valve.m_flow_small)) ^ 2.0) * (Valve.port_b.m_flow / Valve.m_flow_small) else 0.5 * (Valve.state_a.T + Modelica.Media.Water.IF97_Utilities.T_ph(99999.99999999999 * pump.medium.p_bar, Valve.port_a.h_outflow, 0, 0))) ($RES_BND_132) (83) [SCAL] (1) Valve.port_b_T = smooth(1, if $SEV_18 then Valve.state_b.T else if $SEV_19 then Modelica.Media.Water.IF97_Utilities.T_ph(Valve.port_b.p, Valve.port_b.h_outflow, 0, 0) else if $SEV_20 then 0.25 * (Modelica.Media.Water.IF97_Utilities.T_ph(Valve.port_b.p, Valve.port_b.h_outflow, 0, 0) - Valve.state_b.T) * ((-3.0) + (Valve.port_b.m_flow / Valve.m_flow_small) ^ 2.0) * (Valve.port_b.m_flow / Valve.m_flow_small) + 0.5 * (Valve.state_b.T + Modelica.Media.Water.IF97_Utilities.T_ph(Valve.port_b.p, Valve.port_b.h_outflow, 0, 0)) else 0.5 * (Valve.state_b.T + Modelica.Media.Water.IF97_Utilities.T_ph(Valve.port_b.p, Valve.port_b.h_outflow, 0, 0))) ($RES_BND_133) (84) [SCAL] (1) -((-273.15) - pump.medium.T_degC) = pump.medium.state.T ($RES_SIM_40) (85) [ARRY] (5) pump.heatTransfer.states = {pump.medium.state} ($RES_BND_135) (86) [SCAL] (1) 99999.99999999999 * pump.medium.p_bar = pump.medium.state.p ($RES_SIM_41) (87) [SCAL] (1) Valve.port_b.h_outflow = pump.medium.state.h ($RES_SIM_42) (88) [RECD] (5) pump.monitoring.state = pump.medium.state ($RES_BND_137) (89) [SCAL] (1) pump.medium.u = Valve.port_b.h_outflow - (99999.99999999999 * pump.medium.p_bar) / pump.rho ($RES_SIM_44) (90) [SCAL] (1) pump.medium.sat.psat = 99999.99999999999 * pump.medium.p_bar ($RES_SIM_45) (91) [SCAL] (1) pump.medium.sat.Tsat = Modelica.Media.Water.IF97_Utilities.BaseIF97.Basic.tsat(99999.99999999999 * pump.medium.p_bar) ($RES_SIM_46) (92) [SCAL] (1) -((-273.15) - pump.medium.T_degC) = Modelica.Media.Water.IF97_Utilities.T_props_ph(99999.99999999999 * pump.medium.p_bar, Valve.port_b.h_outflow, Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(99999.99999999999 * pump.medium.p_bar, Valve.port_b.h_outflow, pump.medium.phase, 0)) ($RES_SIM_47) (93) [SCAL] (1) pump.rho = Modelica.Media.Water.IF97_Utilities.rho_props_ph(99999.99999999999 * pump.medium.p_bar, Valve.port_b.h_outflow, Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(99999.99999999999 * pump.medium.p_bar, Valve.port_b.h_outflow, pump.medium.phase, 0)) ($RES_SIM_48) (94) [SCAL] (1) pump.medium.phase = if $SEV_11 then 1 else 2 ($RES_SIM_49) (95) [SCAL] (1) Source.medium.phase = Source.medium.state.phase ($RES_SIM_87) (96) [SCAL] (1) Source.medium.d = Source.medium.state.d ($RES_SIM_88) (97) [SCAL] (1) -((-273.15) - Source.medium.T_degC) = Source.medium.state.T ($RES_SIM_89) (98) [SCAL] (1) -Valve.port_b.m_flow = homotopy(Valve.Av * valveOpening.k * smooth(2, if $SEV_0 then (if $SEV_1 then sqrt(Valve.state_a.d) else 0.0) * sqrt(Valve.dp) else if $SEV_2 then -(if $SEV_3 then sqrt(Valve.state_b.d) else 0.0) * sqrt(abs(Valve.dp)) else if $SEV_4 then Modelica.Fluid.Utilities.regRoot2.regRoot2_utility(Valve.dp, Valve.dp_small, Valve.state_a.d, Valve.state_b.d, false, 1.0) else -Modelica.Fluid.Utilities.regRoot2.regRoot2_utility(-Valve.dp, Valve.dp_small, Valve.state_b.d, Valve.state_a.d, false, 1.0)), (Valve.dp * Valve.m_flow_nominal * valveOpening.k) / Valve.dp_nominal) ($RES_SIM_9) (99) [SCAL] (1) Valve.port_a.h_outflow = Sink.ports[1].h_outflow ($RES_SIM_8) (100) [SCAL] (1) $TEV_0 = time < downstreamPressure.startTime ($RES_EVT_167) (101) [SCAL] (1) $TEV_1 = time < (downstreamPressure.startTime + downstreamPressure.duration) ($RES_EVT_168) (102) [SCAL] (1) $SEV_0 = Valve.dp >= Valve.dp_small ($RES_EVT_169) (103) [SCAL] (1) Valve.dp = 99999.99999999999 * pump.medium.p_bar - Valve.port_b.p ($RES_SIM_4) (104) [SCAL] (1) 99999.99999999999 * Sink.medium.p_bar = downstreamPressure.offset + (if $TEV_0 then 0.0 else if $TEV_1 then (downstreamPressure.height * (time - downstreamPressure.startTime)) / downstreamPressure.duration else downstreamPressure.height) ($RES_SIM_1) (105) [SCAL] (1) 0.0 = pump.Qb_flow + pump.Hb_flow + pump.Wb_flow ($RES_SIM_14)