Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr Modelica_3.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.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) 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(Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1") translateModel(Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001262/0.001262, allocations: 109.9 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.001204/0.001204, allocations: 193.1 kB / 17.35 MB, free: 5.625 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.377/1.377, allocations: 205.1 MB / 223.2 MB, free: 12.25 MB / 190.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 1.482e-05/1.483e-05, allocations: 3.547 kB / 327.2 MB, free: 3.352 MB / 270.1 MB Notification: Performance of NFInst.instantiate(Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1): time 0.01909/0.01912, allocations: 20.6 MB / 347.8 MB, free: 14.66 MB / 302.1 MB Notification: Performance of NFInst.instExpressions: time 0.008628/0.02778, allocations: 6.984 MB / 354.8 MB, free: 7.656 MB / 302.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.0004686/0.02827, allocations: 23.81 kB / 354.8 MB, free: 7.633 MB / 302.1 MB Notification: Performance of NFTyping.typeComponents: time 0.0008595/0.02914, allocations: 373.6 kB / 355.2 MB, free: 7.266 MB / 302.1 MB Notification: Performance of NFTyping.typeBindings: time 0.002009/0.03115, allocations: 1.084 MB / 356.2 MB, free: 6.176 MB / 302.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.003506/0.03467, allocations: 1.862 MB / 358.1 MB, free: 4.309 MB / 302.1 MB Notification: Performance of NFFlatten.flatten: time 0.002119/0.0368, allocations: 2.26 MB / 360.4 MB, free: 2.043 MB / 302.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0007065/0.03752, allocations: 0.6007 MB / 361 MB, free: 1.434 MB / 302.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.001082/0.03861, allocations: 0.9346 MB / 361.9 MB, free: 0.4961 MB / 302.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.0007926/0.03942, allocations: 0.7241 MB / 362.6 MB, free: 15.77 MB / 318.1 MB Notification: Performance of NFPackage.collectConstants: time 0.0001078/0.03954, allocations: 72 kB / 362.7 MB, free: 15.7 MB / 318.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.001836/0.04138, allocations: 1.256 MB / 363.9 MB, free: 14.44 MB / 318.1 MB Notification: Performance of combineBinaries: time 0.001212/0.0426, allocations: 1.571 MB / 365.5 MB, free: 12.86 MB / 318.1 MB Notification: Performance of replaceArrayConstructors: time 0.0006244/0.04324, allocations: 0.9577 MB / 366.5 MB, free: 11.89 MB / 318.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0001497/0.04339, allocations: 143.6 kB / 366.6 MB, free: 11.75 MB / 318.1 MB Notification: Performance of FrontEnd: time 0.0001306/0.04353, allocations: 27.88 kB / 366.6 MB, free: 11.72 MB / 318.1 MB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 145 (121) * Number of variables: 149 (123) Notification: Performance of Bindings: time 0.003813/0.04735, allocations: 4.135 MB / 370.8 MB, free: 7.434 MB / 318.1 MB Notification: Performance of FunctionAlias: time 0.0004283/0.04779, allocations: 392.7 kB / 371.2 MB, free: 7.039 MB / 318.1 MB Notification: Performance of Early Inline: time 0.002405/0.0502, allocations: 2.455 MB / 373.6 MB, free: 4.543 MB / 318.1 MB Notification: Performance of simplify1: time 0.0001983/0.05041, allocations: 151.8 kB / 373.8 MB, free: 4.395 MB / 318.1 MB Notification: Performance of Alias: time 0.00256/0.05298, allocations: 2.34 MB / 376.1 MB, free: 1.836 MB / 318.1 MB Notification: Performance of simplify2: time 0.0001491/0.05314, allocations: 139.8 kB / 376.2 MB, free: 1.699 MB / 318.1 MB Notification: Performance of Events: time 0.0006732/0.05382, allocations: 0.5644 MB / 376.8 MB, free: 1.113 MB / 318.1 MB Notification: Performance of Detect States: time 0.0006401/0.05447, allocations: 0.6007 MB / 377.4 MB, free: 0.5 MB / 318.1 MB Notification: Performance of Partitioning: time 0.1658/0.2203, allocations: 0.869 MB / 378.3 MB, free: 22.75 MB / 318.1 MB Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (102/135) **************************** (1) [ALGB] (1) stream Real pipe.port_a.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (2) [ALGB] (1) Real[1] tank1.heatTransfer.surfaceAreas = {sqrt(3.141592653589793 * tank1.crossArea) * 2.0 * tank1.level + tank1.crossArea} (3) [ALGB] (1) Real[1] pipe.flowModel.Ib_flows (4) [ALGB] (1) protected Real pipe.flowModel.dp_fric_nominal = sum({Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.pipe.flowModel.WallFriction.pressureLoss_m_flow(pipe.flowModel.m_flow_nominal / pipe.flowModel.nParallel, pipe.flowModel.rho_nominal, pipe.flowModel.rho_nominal, pipe.flowModel.mu_nominal, pipe.flowModel.mu_nominal, pipe.flowModel.pathLengths_internal[1], pipe.flowModel.diameters[1], ((pipe.flowModel.crossAreas[2:2] + pipe.flowModel.crossAreas[1:1]) / 2.0)[1], ((pipe.flowModel.roughnesses[2:2] + pipe.flowModel.roughnesses[1:1]) / 2.0)[1], pipe.flowModel.m_flow_small / pipe.flowModel.nParallel, pipe.flowModel.Res_turbulent_internal[1])}) (min = 0.0, nominal = 1e5) (5) [ALGB] (2) Real[2] pipe.flowModel.vs = {(-pipe.port_b.m_flow) / (pipe.flowModel.crossAreas[1] * Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.pipe.Medium.density(pipe.flowModel.states[1])), -pipe.port_b.m_flow / (Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.pipe.Medium.density(pipe.flowModel.states[2]) * pipe.flowModel.crossAreas[2])} / pipe.nParallel (6) [ALGB] (1) protected Real[1] pipe.flowModel.diameters = 0.5 * (pipe.flowModel.dimensions[2:2] + pipe.flowModel.dimensions[1:1]) (7) [ALGB] (1) stream Real valveDiscrete.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (8) [ALGB] (2) protected Real[2] tank1.portsData_height = tank1.portsData.height (9) [ALGB] (1) Real tank1.medium.state.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (10) [DISC] (2) Boolean[2] $SEV_0[$i1] (11) [ALGB] (1) Real[1] tank1.heatTransfer.Q_flows (12) [ALGB] (2) Real[2] pipe.flowModel.mus = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.pipe.flowModel.Medium.dynamicViscosity(pipe.flowModel.states[$i1]) for $i1 in 1:2} (start = {0.001 for $i1 in 1:2}, min = {0.0 for $i1 in 1:2}, max = {1e8 for $i1 in 1:2}, nominal = {0.001 for $i1 in 1:2}) (13) [ALGB] (1) Real valveDiscrete.V_flow = (995.586 * valveDiscrete.V_flow) / Modelica.Fluid.Utilities.regStep(995.586 * valveDiscrete.V_flow, Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.valveDiscrete.Medium.density(valveDiscrete.state_a), Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.valveDiscrete.Medium.density(valveDiscrete.state_b), valveDiscrete.m_flow_small) (14) [ALGB] (1) Real tank1.mb_flow (15) [ALGB] (2) protected Real[2] tank1.zetas_out (16) [ALGB] (2) flow Real[2] tank1.ports.m_flow (start = {0.0 for $i1 in 1:2}, min = {-1e5 for $i1 in 1:2}, max = {1e5 for $i1 in 1:2}) (17) [DER-] (1) Real $DER.tank1.U (18) [DISC] (2) Boolean[2] $SEV_3[$i1] (19) [ALGB] (1) protected Real valveDiscrete.state_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (20) [ALGB] (1) Real tank1.level (start = tank1.level_start, StateSelect = prefer) (21) [ALGB] (1) Real pipe.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (22) [ALGB] (1) Real valveDiscrete.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (23) [ALGB] (1) flow Real[1] tank1.heatTransfer.heatPorts.Q_flow (24) [ALGB] (2) Real[2] tank1.port_b_H_flow_bottom (min = {-1e8 for $i1 in 1:2}, max = {1e8 for $i1 in 1:2}, nominal = {1000.0 for $i1 in 1:2}) (25) [DISC] (1) Boolean $SEV_28 (26) [DISC] (1) Boolean $SEV_27 (27) [ALGB] (1) Real[1] pipe.flowModel.pathLengths_internal = pipe.flowModel.pathLengths (28) [DISC] (1) Boolean $SEV_26 (29) [DISC] (2) Boolean[2] $SEV_6[$i1] (30) [DISC] (1) Boolean $SEV_25 (31) [ALGB] (2) final Real[2] pipe.flowModel.dimensions = {(4.0 * pipe.crossArea) / pipe.perimeter, (4.0 * pipe.crossArea) / pipe.perimeter} (32) [ALGB] (1) Real tank1.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (33) [ALGB] (1) Real valveDiscrete.port_b_T = Modelica.Fluid.Utilities.regStep(-995.586 * valveDiscrete.V_flow, Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.valveDiscrete.Medium.temperature(valveDiscrete.state_b), Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.valveDiscrete.Medium.temperature(Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.valveDiscrete.Medium.setState_phX(valveDiscrete.port_b.p, valveDiscrete.port_b.h_outflow, {})), valveDiscrete.m_flow_small) (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (34) [DISC] (1) Boolean $SEV_24 (35) [ALGB] (1) Real $FUN_8 (36) [DISC] (2) protected Boolean[2] tank1.aboveLevel (37) [ALGB] (1) Real $FUN_6 (38) [ALGB] (1) Real $FUN_5 (39) [DISC] (1) Boolean $SEV_20 (40) [ALGB] (1) Real $FUN_4 (41) [ALGB] (1) Real flowSource.medium.p_bar = Modelica.SIunits.Conversions.to_bar(99999.99999999999 * flowSource.medium.p_bar) (42) [ALGB] (1) Real $FUN_3 (43) [ALGB] (2) protected Real[2] tank1.portsData_diameter2 (44) [ALGB] (1) Real[1] pipe.flowModel.Fs_p (45) [ALGB] (2) protected Real[2] tank1.bottomArea (46) [DER-] (1) Real $DER.tank1.m (47) [ALGB] (1) final input Real[1, 1] tank1.heatTransfer.states.p = {tank1.medium.state.p} (start = {1e5 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1e5 for $i1 in 1:1}) (48) [DISC] (2) Boolean[2] $SEV_9[$i1] (49) [ALGB] (1) protected Real valveDiscrete.state_a.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (50) [ALGB] (1) Real[1] pipe.flowModel.m_flows (start = {0.0 for $i1 in 1:1}, min = {-1e60 for $i1 in 1:1}, max = {1e5 for $i1 in 1:1}, StateSelect = default) (51) [ALGB] (2) final Real[2] pipe.flowModel.roughnesses = {pipe.roughness, pipe.roughness} (min = {0.0 for $i1 in 1:2}) (52) [ALGB] (1) Real[1] pipe.flowModel.dps_fg (start = {pipe.flowModel.p_a_start - pipe.flowModel.p_b_start for $i1 in 1:1}) (53) [ALGB] (1) Real[1] ambient_fixed.ports.p (start = {1e5 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1e5 for $i1 in 1:1}) (54) [ALGB] (1) Real[1] pipe.flowModel.mus_act (start = {0.001 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {0.001 for $i1 in 1:1}) (55) [ALGB] (1) flow Real[1] ambient_fixed.ports.m_flow (min = {-1e60}, max = {1e60}) (56) [ALGB] (2) protected Real[2] tank1.portsData_diameter = tank1.portsData.diameter (57) [ALGB] (2) protected Real[2] tank1.levelAbovePort (58) [ALGB] (1) Real[1] pipe.flowModel.Res_turbulent_internal = pipe.flowModel.Re_turbulent * {1.0 for $i1 in 1:1} (59) [ALGB] (1) flow Real[1] flowSource.ports.m_flow (min = {-1e60}, max = {1e60}) (60) [ALGB] (1) final Real[1] pipe.flowModel.dheights = {pipe.height_ab} (61) [DISC] (1) Boolean $SEV_13 (62) [DISC] (1) Boolean $SEV_12 (63) [DISC] (1) Boolean $SEV_11 (64) [DISC] (2) Boolean[2] $SEV_5[$i1] (65) [ALGB] (1) final input Real[1, 1] tank1.heatTransfer.states.T = {tank1.medium.state.T} (start = {288.15 for $i1 in 1:1}, min = {1.0 for $i1 in 1:1}, max = {1e4 for $i1 in 1:1}, nominal = {300.0 for $i1 in 1:1}) (66) [DISC] (1) Boolean $SEV_10 (67) [ALGB] (1) final Real[1] pipe.flowModel.pathLengths = {pipe.length} (68) [ALGB] (1) protected Real valveDiscrete.state_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (69) [ALGB] (1) stream Real[1] ambient_fixed.ports.h_outflow (min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (70) [ALGB] (1) stream Real pipe.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (71) [ALGB] (1) Real pipe.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (72) [ALGB] (2) protected Real[2] tank1.portsData_height2 (73) [ALGB] (1) Real[1] flowSource.ports.p (start = {1e5 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1e5 for $i1 in 1:1}) (74) [ALGB] (1) Real tank1.Qb_flow (75) [ALGB] (1) Real tank1.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - tank1.medium.T_degC)) (76) [ALGB] (1) Real[1] tank1.heatTransfer.Ts = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.tank1.heatTransfer.Medium.temperature(tank1.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}) (77) [ALGB] (2) stream Real[2] tank1.ports.h_outflow (min = {-1e10 for $i1 in 1:2}, max = {1e10 for $i1 in 1:2}, nominal = {1e6 for $i1 in 1:2}) (78) [DISC] (2) Boolean[2] $SEV_8[$i1] (79) [ALGB] (1) stream Real valveDiscrete.port_a.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (80) [ALGB] (1) Real valveDiscrete.port_a_T = Modelica.Fluid.Utilities.regStep(995.586 * valveDiscrete.V_flow, Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.valveDiscrete.Medium.temperature(valveDiscrete.state_a), Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.valveDiscrete.Medium.temperature(Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.valveDiscrete.Medium.setState_phX(valveDiscrete.port_a.p, valveDiscrete.port_a.h_outflow, {})), valveDiscrete.m_flow_small) (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (81) [ALGB] (1) Real[1] pipe.flowModel.Is (82) [ALGB] (2) Real[2] tank1.ports.p (start = {1e5 for $i1 in 1:2}, min = {0.0 for $i1 in 1:2}, max = {1e8 for $i1 in 1:2}, nominal = {1e5 for $i1 in 1:2}) (83) [ALGB] (4) input Real[2, 2] pipe.flowModel.states.p (start = {1e5 for $i1 in 1:2}, min = {0.0 for $i1 in 1:2}, max = {1e8 for $i1 in 1:2}, nominal = {1e5 for $i1 in 1:2}) (84) [ALGB] (1) flow Real pipe.port_b.m_flow (min = -1e5, max = 1e60) (85) [DISC] (1) Boolean $SEV_2 (86) [ALGB] (2) protected Real[2] tank1.ports_emptyPipeHysteresis (min = {0.0 for $i1 in 1:2}) (87) [ALGB] (1) stream Real[1] flowSource.ports.h_outflow (min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (88) [ALGB] (1) Real valveDiscrete.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (89) [ALGB] (1) Real tank1.Hb_flow (90) [DISC] (1) Boolean $TEV_0 (91) [ALGB] (1) final Real tank1.fluidVolume = tank1.fluidVolume (92) [ALGB] (1) Real[1] pipe.flowModel.Fs_fg (93) [ALGB] (2) final Real[2] pipe.flowModel.crossAreas = {pipe.crossArea, pipe.crossArea} (94) [ALGB] (2) Real[2] pipe.flowModel.rhos = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.pipe.flowModel.Medium.density(pipe.flowModel.states[$i1]) for $i1 in 1:2} (start = {1.0 for $i1 in 1:2}, min = {0.0 for $i1 in 1:2}, max = {1e5 for $i1 in 1:2}, nominal = {1.0 for $i1 in 1:2}) (95) [DISC] (2) Boolean[2] $SEV_4[$i1] (96) [ALGB] (1) Real[1] tank1.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}) (97) [ALGB] (1) Real flowSource.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (98) [ALGB] (1) Real[1] pipe.flowModel.rhos_act (start = {1.0 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, max = {1e5 for $i1 in 1:1}, nominal = {1.0 for $i1 in 1:1}) (99) [ALGB] (1) protected Real valveDiscrete.state_b.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (100) [ALGB] (4) input Real[2, 2] pipe.flowModel.states.T (start = {288.15 for $i1 in 1:2}, min = {1.0 for $i1 in 1:2}, max = {1e4 for $i1 in 1:2}, nominal = {300.0 for $i1 in 1:2}) (101) [ALGB] (1) Real valveDiscrete.dp (start = valveDiscrete.dp_start) (102) [DISC] (2) Boolean[2] $SEV_7[$i1] System Equations (102/131) **************************** (1) [FOR-] (2) ($RES_BND_145) (1) [----] for $i1 in 1:2 loop (1) [----] [SCAL] (1) pipe.flowModel.rhos[$i1] = 995.586 ($RES_BND_146) (1) [----] end for; (2) [ARRY] (1) tank1.heatTransfer.Ts = tank1.heatTransfer.heatPorts.T ($RES_SIM_50) (3) [ARRY] (1) pipe.flowModel.Ib_flows = {0.0} ($RES_SIM_15) (4) [SCAL] (1) pipe.flowModel.rhos_act[1] = noEvent(if $SEV_2 then pipe.flowModel.rhos[1] else pipe.flowModel.rhos[2]) ($RES_SIM_16) (5) [FOR-] (2) ($RES_BND_147) (5) [----] for $i1 in 1:2 loop (5) [----] [SCAL] (1) pipe.flowModel.mus[$i1] = 0.001 ($RES_BND_148) (5) [----] end for; (6) [SCAL] (1) pipe.flowModel.mus_act[1] = noEvent(if $SEV_2 then pipe.flowModel.mus[1] else pipe.flowModel.mus[2]) ($RES_SIM_17) (7) [ARRY] (1) pipe.flowModel.m_flows = {homotopy(({$FUN_5} .* pipe.flowModel.nParallel)[1], (pipe.flowModel.m_flow_nominal / pipe.flowModel.dp_nominal * (pipe.flowModel.dps_fg - (pipe.flowModel.g * pipe.flowModel.dheights) .* pipe.flowModel.rho_nominal))[1])} ($RES_SIM_18) (8) [ARRY] (1) pipe.flowModel.pathLengths_internal = pipe.flowModel.pathLengths ($RES_BND_149) (9) [SCAL] (1) $DER.tank1.m = tank1.mb_flow ($RES_SIM_19) (10) [SCAL] (1) tank1.medium.state.p = tank1.p_ambient ($RES_SIM_55) (11) [SCAL] (1) tank1.medium.state.T = -((-273.15) - tank1.medium.T_degC) ($RES_SIM_56) (12) [SCAL] (1) flowSource.ports[1].p = 99999.99999999999 * flowSource.medium.p_bar ($RES_SIM_92) (13) [SCAL] (1) flowSource.ports[1].h_outflow = 4184.0 * ((-273.15) + flowSource.T) ($RES_SIM_93) (14) [SCAL] (1) $SEV_27 = 995.586 * valveDiscrete.V_flow > valveDiscrete.m_flow_small ($RES_EVT_210) (15) [SCAL] (1) $SEV_28 = 995.586 * valveDiscrete.V_flow < (-valveDiscrete.m_flow_small) ($RES_EVT_211) (16) [SCAL] (1) $TEV_0 = $PRE.tank1.aboveLevel[$i1] ($RES_EVT_174) (17) [FOR-] (2) ($RES_EVT_175) (17) [----] for $i1 in 1:2 loop (17) [----] [SCAL] (1) $SEV_0[$i1] = tank1.level_start >= tank1.portsData_height2[$i1] ($RES_EVT_176) (17) [----] end for; (18) [SCAL] (1) $SEV_2 = pipe.flowModel.m_flows[1] > 0.0 ($RES_EVT_178) (19) [FOR-] (2) ($RES_EVT_179) (19) [----] for $i1 in 1:2 loop (19) [----] [SCAL] (1) $SEV_3[$i1] = tank1.level >= (tank1.portsData_height2[$i1] + tank1.ports_emptyPipeHysteresis[$i1]) ($RES_EVT_180) (19) [----] end for; (20) [SCAL] (1) $DER.tank1.U = tank1.Qb_flow + tank1.Hb_flow ($RES_SIM_20) (21) [SCAL] (1) pipe.flowModel.Res_turbulent_internal[1] = pipe.flowModel.Re_turbulent ($RES_BND_150) (22) [SCAL] (1) tank1.U = tank1.m * (4184.0 * ((-273.15) - ((-273.15) - tank1.medium.T_degC))) ($RES_SIM_21) (23) [ARRY] (1) pipe.flowModel.diameters = 0.5 * (pipe.flowModel.dimensions[2:2] + pipe.flowModel.dimensions[1:1]) ($RES_BND_151) (24) [SCAL] (1) tank1.m = 995.586 * tank1.fluidVolume ($RES_SIM_22) (25) [FOR-] (2) ($RES_SIM_23) (25) [----] for $i1 in 1:2 loop (25) [----] [SCAL] (1) tank1.aboveLevel[$i1] = $SEV_6[$i1] ($RES_SIM_24) (25) [----] end for; (26) [SCAL] (1) flowSource.medium.state.p = 99999.99999999999 * flowSource.medium.p_bar ($RES_SIM_105) (27) [ARRY] (2) tank1.heatTransfer.states = {tank1.medium.state} ($RES_BND_153) (28) [ARRY] (4) pipe.flowModel.states = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.pipe.Medium.ThermodynamicState(pipe.port_a.p, 273.15 + 2.390057361376673e-4 * tank1.ports[2].h_outflow), Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.pipe.Medium.ThermodynamicState(pipe.port_b.p, 273.15 + 2.390057361376673e-4 * flowSource.ports[1].h_outflow)} ($RES_BND_154) (29) [FOR-] (2) ($RES_SIM_25) (29) [----] for $i1 in 1:2 loop (29) [----] [SCAL] (1) tank1.levelAbovePort[$i1] = if tank1.aboveLevel[$i1] then tank1.level - tank1.portsData_height2[$i1] else 0.0 ($RES_SIM_26) (29) [----] end for; (30) [FOR-] (2) ($RES_SIM_27) (30) [----] for $i1 in 1:2 loop (30) [----] [SCAL] (1) tank1.ports[$i1].h_outflow = 4184.0 * ((-273.15) - ((-273.15) - tank1.medium.T_degC)) ($RES_SIM_28) (30) [----] end for; (31) [FOR-] (2) ($RES_SIM_29) (31) [----] for $i1 in 1:2 loop (31) [----] [SCAL] (1) tank1.zetas_out[$i1] = 1.0 + (if tank1.aboveLevel[$i1] then 0.0 else tank1.zetaLarge) ($RES_SIM_30) (31) [----] end for; (32) [SCAL] (1) valveDiscrete.dp = valveDiscrete.port_a.p - valveDiscrete.port_b.p ($RES_SIM_66) (33) [SCAL] (1) valveDiscrete.port_b.h_outflow = ambient_fixed.ports[1].h_outflow ($RES_SIM_69) (34) [FOR-] (2) ($RES_EVT_181) (34) [----] for $i1 in 1:2 loop (34) [----] [SCAL] (1) $SEV_4[$i1] = tank1.level >= (tank1.portsData_height2[$i1] - tank1.ports_emptyPipeHysteresis[$i1]) ($RES_EVT_182) (34) [----] end for; (35) [FOR-] (2) ($RES_EVT_183) (35) [----] for $i1 in 1:2 loop (35) [----] [SCAL] (1) $SEV_5[$i1] = $TEV_0 and $SEV_4[$i1] ($RES_EVT_184) (35) [----] end for; (36) [FOR-] (2) ($RES_EVT_185) (36) [----] for $i1 in 1:2 loop (36) [----] [SCAL] (1) $SEV_6[$i1] = $SEV_3[$i1] or $SEV_5[$i1] ($RES_EVT_186) (36) [----] end for; (37) [FOR-] (2) ($RES_EVT_187) (37) [----] for $i1 in 1:2 loop (37) [----] [SCAL] (1) $SEV_7[$i1] = tank1.ports[$i1].m_flow >= tank1.m_flow_small ($RES_EVT_188) (37) [----] end for; (38) [FOR-] (2) ($RES_EVT_189) (38) [----] for $i1 in 1:2 loop (38) [----] [SCAL] (1) $SEV_8[$i1] = tank1.ports[$i1].m_flow <= (-tank1.m_flow_small) ($RES_EVT_190) (38) [----] end for; (39) [SCAL] (1) tank1.ports[2].m_flow - pipe.port_b.m_flow = 0.0 ($RES_SIM_113) (40) [FOR-] (2) ($RES_SIM_31) (40) [----] for $i1 in 1:2 loop (40) [----] [SCAL] (1) tank1.ports[$i1].p = system.g * tank1.levelAbovePort[$i1] * 995.586 + tank1.p_ambient + smooth(2, if $SEV_7[$i1] then (0.008105694691387022 * tank1.ports[$i1].m_flow ^ 2.0) / (995.586 * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1]) else if $SEV_8[$i1] then -(0.8105694691387022 * tank1.zetas_out[$i1] * tank1.ports[$i1].m_flow ^ 2.0) / (995.586 * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1]) else if $SEV_9[$i1] then Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(tank1.ports[$i1].m_flow, tank1.m_flow_small, 0.008105694691387022 / (995.586 * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1]), (0.8105694691387022 * tank1.zetas_out[$i1]) / (995.586 * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1]), false, 1.0) else -Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(-tank1.ports[$i1].m_flow, tank1.m_flow_small, (0.8105694691387022 * tank1.zetas_out[$i1]) / (995.586 * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1]), 0.008105694691387022 / (995.586 * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1]), false, 1.0)) ($RES_SIM_32) (40) [----] end for; (41) [SCAL] (1) tank1.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_114) (42) [SCAL] (1) -flowSource.m_flow = sum(flowSource.ports.m_flow) ($RES_$AUX_162) (43) [SCAL] (1) tank1.ports[1].m_flow - 995.586 * valveDiscrete.V_flow = 0.0 ($RES_SIM_115) (44) [SCAL] (1) pipe.port_a.p = tank1.ports[2].p ($RES_SIM_116) (45) [SCAL] (1) $FUN_3 = sum(tank1.ports.m_flow) ($RES_$AUX_160) (46) [SCAL] (1) valveDiscrete.port_b.p = tank1.ports[1].p ($RES_SIM_117) (47) [SCAL] (1) valveDiscrete.port_a.h_outflow = tank1.ports[1].h_outflow ($RES_SIM_70) (48) [SCAL] (1) tank1.port_b_H_flow_bottom[2] = smooth(0, tank1.ports[2].m_flow * (if $SEV_10 then pipe.port_a.h_outflow else tank1.ports[2].h_outflow)) ($RES_SIM_35) (49) [SCAL] (1) pipe.port_b.m_flow + flowSource.ports[1].m_flow = 0.0 ($RES_SIM_118) (50) [SCAL] (1) 995.586 * valveDiscrete.V_flow = if open.k then valveDiscrete.k * valveDiscrete.dp else valveDiscrete.k * valveDiscrete.opening_min * valveDiscrete.dp ($RES_SIM_71) (51) [SCAL] (1) tank1.port_b_H_flow_bottom[1] = smooth(0, tank1.ports[1].m_flow * (if $SEV_11 then valveDiscrete.port_b.h_outflow else tank1.ports[1].h_outflow)) ($RES_SIM_36) (52) [SCAL] (1) flowSource.ports[1].p = pipe.port_b.p ($RES_SIM_119) (53) [SCAL] (1) ambient_fixed.ports[1].p = ambient_fixed.p ($RES_SIM_72) (54) [SCAL] (1) ambient_fixed.ports[1].h_outflow = 4184.0 * ((-273.15) + ambient_fixed.T) ($RES_SIM_73) (55) [SCAL] (1) tank1.Qb_flow = tank1.heatTransfer.Q_flows[1] ($RES_SIM_38) (56) [SCAL] (1) tank1.Hb_flow = $FUN_4 ($RES_SIM_39) (57) [FOR-] (2) ($RES_EVT_191) (57) [----] for $i1 in 1:2 loop (57) [----] [SCAL] (1) $SEV_9[$i1] = 0.008105694691387022 / (995.586 * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1]) >= (0.8105694691387022 * tank1.zetas_out[$i1]) / (995.586 * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1] * tank1.portsData_diameter2[$i1]) ($RES_EVT_192) (57) [----] end for; (58) [SCAL] (1) $SEV_10 = tank1.ports[2].m_flow > 0.0 ($RES_EVT_193) (59) [SCAL] (1) $SEV_11 = tank1.ports[1].m_flow > 0.0 ($RES_EVT_194) (60) [SCAL] (1) $SEV_12 = tank1.m >= 0.0 ($RES_EVT_195) (61) [SCAL] (1) $SEV_13 = tank1.level <= tank1.height ($RES_EVT_196) (62) [SCAL] (1) valveDiscrete.port_a_T = smooth(1, if $SEV_27 then valveDiscrete.state_a.T else if $SEV_28 then 273.15 + 2.390057361376673e-4 * valveDiscrete.port_a.h_outflow else if $SEV_26 then 0.25 * ((273.15 + 2.390057361376673e-4 * valveDiscrete.port_a.h_outflow) - valveDiscrete.state_a.T) * ((-3.0) + (995.586 * valveDiscrete.V_flow / valveDiscrete.m_flow_small) ^ 2.0) * ((995.586 * valveDiscrete.V_flow) / valveDiscrete.m_flow_small) + 0.5 * (273.15 + valveDiscrete.state_a.T + 2.390057361376673e-4 * valveDiscrete.port_a.h_outflow) else 0.5 * (273.15 + valveDiscrete.state_a.T + 2.390057361376673e-4 * valveDiscrete.port_a.h_outflow)) ($RES_BND_130) (63) [SCAL] (1) $FUN_4 = sum(tank1.port_b_H_flow_bottom) ($RES_$AUX_159) (64) [SCAL] (1) valveDiscrete.port_b_T = smooth(1, if $SEV_24 then valveDiscrete.state_b.T else if $SEV_25 then 273.15 + 2.390057361376673e-4 * valveDiscrete.port_b.h_outflow else if $SEV_26 then 0.5 * (273.15 + valveDiscrete.state_b.T + 2.390057361376673e-4 * valveDiscrete.port_b.h_outflow) - 0.25 * ((273.15 + 2.390057361376673e-4 * valveDiscrete.port_b.h_outflow) - valveDiscrete.state_b.T) * ((-3.0) + (995.586 * valveDiscrete.V_flow / (-valveDiscrete.m_flow_small)) ^ 2.0) * ((995.586 * valveDiscrete.V_flow) / valveDiscrete.m_flow_small) else 0.5 * (273.15 + valveDiscrete.state_b.T + 2.390057361376673e-4 * valveDiscrete.port_b.h_outflow)) ($RES_BND_131) (65) [SCAL] (1) $FUN_5 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.pipe.flowModel.WallFriction.massFlowRate_dp_staticHead(pipe.flowModel.dps_fg[1], pipe.flowModel.rhos[1], pipe.flowModel.rhos[2], pipe.flowModel.mus[1], pipe.flowModel.mus[2], pipe.flowModel.pathLengths_internal[1], pipe.flowModel.diameters[1], (pipe.flowModel.g * pipe.flowModel.dheights)[1], (0.5 .* (pipe.flowModel.crossAreas[1:1] + pipe.flowModel.crossAreas[2:2]))[1], (0.5 .* (pipe.flowModel.roughnesses[1:1] + pipe.flowModel.roughnesses[2:2]))[1], pipe.flowModel.dp_small, pipe.flowModel.Res_turbulent_internal[1]) ($RES_$AUX_158) (66) [SCAL] (1) $FUN_6 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe1.pipe.flowModel.WallFriction.pressureLoss_m_flow(pipe.flowModel.m_flow_nominal / pipe.flowModel.nParallel, pipe.flowModel.rho_nominal, pipe.flowModel.rho_nominal, pipe.flowModel.mu_nominal, pipe.flowModel.mu_nominal, pipe.flowModel.pathLengths_internal[1], pipe.flowModel.diameters[1], (0.5 .* (pipe.flowModel.crossAreas[2:2] + pipe.flowModel.crossAreas[1:1]))[1], (0.5 .* (pipe.flowModel.roughnesses[2:2] + pipe.flowModel.roughnesses[1:1]))[1], pipe.flowModel.m_flow_small / pipe.flowModel.nParallel, pipe.flowModel.Res_turbulent_internal[1]) ($RES_$AUX_157) (67) [SCAL] (1) pipe.flowModel.dp_fric_nominal = sum({$FUN_6}) ($RES_$AUX_156) (68) [SCAL] (1) 995.586 * valveDiscrete.V_flow + ambient_fixed.ports[1].m_flow = 0.0 ($RES_SIM_121) (69) [SCAL] (1) $FUN_8 = sqrt(3.141592653589793 * tank1.crossArea) ($RES_$AUX_155) (70) [SCAL] (1) tank1.mb_flow = $FUN_3 ($RES_SIM_40) (71) [SCAL] (1) ambient_fixed.ports[1].p = valveDiscrete.port_a.p ($RES_SIM_122) (72) [ARRY] (1) tank1.heatTransfer.surfaceAreas = {2.0 * $FUN_8 * tank1.level + tank1.crossArea} ($RES_BND_135) (73) [SCAL] (1) tank1.fluidVolume = tank1.crossArea * tank1.level + tank1.V0 ($RES_SIM_41) (74) [ARRY] (2) tank1.portsData_height = tank1.portsData_height2 ($RES_SIM_123) (75) [ARRY] (1) tank1.heatTransfer.Ts = {tank1.heatTransfer.states.p} ($RES_BND_136) (76) [ARRY] (2) tank1.portsData_diameter = tank1.portsData_diameter2 ($RES_SIM_124) (77) [ARRY] (2) tank1.portsData_diameter = tank1.portsData.diameter ($RES_BND_137) (78) [FOR-] (2) ($RES_SIM_43) (78) [----] for $i1 in 1:2 loop (78) [----] [SCAL] (1) tank1.bottomArea[$i1] = 3.141592653589793 * (tank1.portsData_diameter2[$i1] / 2.0) ^ 2.0 ($RES_SIM_44) (78) [----] end for; (79) [ARRY] (2) tank1.portsData_height = tank1.portsData.height ($RES_BND_138) (80) [ARRY] (2) pipe.flowModel.vs = {-(0.0010044335697769957 * pipe.port_b.m_flow) / pipe.flowModel.crossAreas[1], -(0.0010044335697769957 * pipe.port_b.m_flow) / pipe.flowModel.crossAreas[2]} / pipe.nParallel ($RES_BND_139) (81) [FOR-] (2) ($RES_SIM_45) (81) [----] for $i1 in 1:2 loop (81) [----] [SCAL] (1) tank1.ports_emptyPipeHysteresis[$i1] = tank1.portsData_diameter2[$i1] * tank1.hysteresisFactor ($RES_SIM_46) (81) [----] end for; (82) [SCAL] (1) valveDiscrete.state_a.p = valveDiscrete.port_a.p ($RES_SIM_163) (83) [SCAL] (1) valveDiscrete.state_a.T = 273.15 + 2.390057361376673e-4 * ambient_fixed.ports[1].h_outflow ($RES_SIM_164) (84) [SCAL] (1) valveDiscrete.state_b.p = valveDiscrete.port_b.p ($RES_SIM_165) (85) [ARRY] (1) tank1.heatTransfer.Q_flows = tank1.heatTransfer.heatPorts.Q_flow ($RES_SIM_49) (86) [SCAL] (1) valveDiscrete.state_b.T = 273.15 + 2.390057361376673e-4 * tank1.ports[1].h_outflow ($RES_SIM_166) (87) [SCAL] (1) $SEV_20 = abs(sum({abs(flowSource.ports[1].m_flow)}) - abs(flowSource.ports[1].m_flow)) <= 1e-60 ($RES_EVT_203) (88) [SCAL] (1) pipe.port_b.h_outflow = tank1.ports[2].h_outflow - system.g * pipe.height_ab ($RES_SIM_8) (89) [SCAL] (1) pipe.port_a.h_outflow = flowSource.ports[1].h_outflow + system.g * pipe.height_ab ($RES_SIM_7) (90) [SCAL] (1) $SEV_24 = (-995.586 * valveDiscrete.V_flow) > valveDiscrete.m_flow_small ($RES_EVT_207) (91) [SCAL] (1) $SEV_25 = (-995.586 * valveDiscrete.V_flow) < (-valveDiscrete.m_flow_small) ($RES_EVT_208) (92) [SCAL] (1) $SEV_26 = valveDiscrete.m_flow_small > 0.0 ($RES_EVT_209) (93) [ARRY] (2) pipe.flowModel.crossAreas = {pipe.crossArea, pipe.crossArea} ($RES_BND_140) (94) [SCAL] (1) -pipe.port_b.m_flow = pipe.flowModel.m_flows[1] ($RES_SIM_10) (95) [ARRY] (2) pipe.flowModel.dimensions = {(4.0 * pipe.crossArea) / pipe.perimeter, (4.0 * pipe.crossArea) / pipe.perimeter} ($RES_BND_141) (96) [ARRY] (1) {0.0} = pipe.flowModel.Ib_flows - (pipe.flowModel.Fs_fg + pipe.flowModel.Fs_p) ($RES_SIM_11) (97) [ARRY] (2) pipe.flowModel.roughnesses = {pipe.roughness, pipe.roughness} ($RES_BND_142) (98) [ARRY] (1) pipe.flowModel.Is = {pipe.flowModel.m_flows[1] * pipe.flowModel.pathLengths[1]} ($RES_SIM_12) (99) [ARRY] (1) pipe.flowModel.dheights = {pipe.height_ab} ($RES_BND_143) (100) [ARRY] (1) pipe.flowModel.dps_fg = {(2.0 * (pipe.flowModel.Fs_fg[1] / pipe.flowModel.nParallel)) / (pipe.flowModel.crossAreas[1] + pipe.flowModel.crossAreas[2])} ($RES_SIM_13) (101) [ARRY] (1) pipe.flowModel.pathLengths = {pipe.length} ($RES_BND_144) (102) [ARRY] (1) pipe.flowModel.Fs_p = pipe.flowModel.nParallel * {0.5 * (pipe.flowModel.crossAreas[1] + pipe.flowModel.crossAreas[2]) * (pipe.flowModel.states.T - pipe.flowModel.states.T)} ($RES_SIM_14)