Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr Modelica_3.2.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.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.OneTank,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.2.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank") translateModel(Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.2.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.00113/0.00113, allocations: 107.3 kB / 16.42 MB, free: 5.973 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.001086/0.001086, allocations: 191.3 kB / 17.36 MB, free: 5.566 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.233/1.233, allocations: 205.1 MB / 223.2 MB, free: 12.25 MB / 190.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 1.836e-05/1.837e-05, allocations: 3.547 kB / 327.2 MB, free: 3.34 MB / 270.1 MB Notification: Performance of NFInst.instantiate(Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank): time 0.01691/0.01694, allocations: 17.49 MB / 344.7 MB, free: 1.773 MB / 286.1 MB Notification: Performance of NFInst.instExpressions: time 0.009243/0.02626, allocations: 6.59 MB / 351.3 MB, free: 11.17 MB / 302.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.0007735/0.02706, allocations: 19.88 kB / 351.3 MB, free: 11.15 MB / 302.1 MB Notification: Performance of NFTyping.typeComponents: time 0.0009213/0.02799, allocations: 385.8 kB / 351.7 MB, free: 10.77 MB / 302.1 MB Notification: Performance of NFTyping.typeBindings: time 0.001995/0.03, allocations: 0.9991 MB / 352.7 MB, free: 9.766 MB / 302.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.004137/0.03421, allocations: 1.901 MB / 354.6 MB, free: 7.859 MB / 302.1 MB Notification: Performance of NFFlatten.flatten: time 0.002347/0.03656, allocations: 2.194 MB / 356.7 MB, free: 5.656 MB / 302.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0007949/0.03737, allocations: 0.5491 MB / 357.3 MB, free: 5.094 MB / 302.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.001344/0.03872, allocations: 0.9191 MB / 358.2 MB, free: 4.172 MB / 302.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.0008717/0.03961, allocations: 0.7592 MB / 359 MB, free: 3.41 MB / 302.1 MB Notification: Performance of NFPackage.collectConstants: time 0.000119/0.03974, allocations: 68 kB / 359 MB, free: 3.344 MB / 302.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.001907/0.04165, allocations: 1.119 MB / 360.2 MB, free: 2.223 MB / 302.1 MB Notification: Performance of combineBinaries: time 0.001222/0.04289, allocations: 1.51 MB / 361.7 MB, free: 0.6992 MB / 302.1 MB Notification: Performance of replaceArrayConstructors: time 0.0006414/0.04354, allocations: 0.9302 MB / 362.6 MB, free: 15.76 MB / 318.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0001626/0.04371, allocations: 127.6 kB / 362.7 MB, free: 15.63 MB / 318.1 MB Notification: Performance of FrontEnd: time 0.0001579/0.04387, allocations: 31.86 kB / 362.8 MB, free: 15.6 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: 126 (112) * Number of variables: 130 (118) Notification: Performance of Bindings: time 0.003629/0.04751, allocations: 3.909 MB / 366.7 MB, free: 11.56 MB / 318.1 MB Notification: Performance of FunctionAlias: time 0.0004371/0.04795, allocations: 398.5 kB / 367.1 MB, free: 11.15 MB / 318.1 MB Notification: Performance of Early Inline: time 0.001683/0.04964, allocations: 1.729 MB / 368.8 MB, free: 9.387 MB / 318.1 MB Notification: Performance of simplify1: time 0.0001691/0.04982, allocations: 139.8 kB / 368.9 MB, free: 9.25 MB / 318.1 MB Notification: Performance of Alias: time 0.002288/0.05212, allocations: 2.039 MB / 371 MB, free: 7.004 MB / 318.1 MB Notification: Performance of simplify2: time 0.0001234/0.05225, allocations: 115.8 kB / 371.1 MB, free: 6.891 MB / 318.1 MB Notification: Performance of Events: time 0.0004824/0.05274, allocations: 367.2 kB / 371.4 MB, free: 6.531 MB / 318.1 MB Notification: Performance of Detect States: time 0.0006052/0.05336, allocations: 0.5188 MB / 372 MB, free: 5.996 MB / 318.1 MB Notification: Performance of Partitioning: time 0.0008153/0.05418, allocations: 0.7902 MB / 372.7 MB, free: 5.066 MB / 318.1 MB Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (95/107) *************************** (1) [ALGB] (1) stream Real pipe.port_a.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (2) [ALGB] (1) Real[1] tank.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}) (3) [ALGB] (1) Real[1] pipe.flowModel.Ib_flows (4) [ALGB] (1) Real[1] tank.port_b_H_flow_bottom (min = {-1e8 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1000.0 for $i1 in 1:1}) (5) [ALGB] (1) protected Real pipe.flowModel.dp_fric_nominal = sum({Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.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) (6) [ALGB] (1) Real tank.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - tank.medium.T_degC)) (7) [ALGB] (1) protected Real[1] pipe.flowModel.diameters = 0.5 * (pipe.flowModel.dimensions[2:2] + pipe.flowModel.dimensions[1:1]) (8) [ALGB] (2) Real[2] pipe.flowModel.vs = {(-pipe.port_b.m_flow) / (pipe.flowModel.crossAreas[1] * Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.pipe.Medium.density(pipe.flowModel.states[1])), -pipe.port_b.m_flow / (Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.pipe.Medium.density(pipe.flowModel.states[2]) * pipe.flowModel.crossAreas[2])} / pipe.nParallel (9) [ALGB] (1) Real $FUN_13 (10) [ALGB] (1) Real $FUN_11 (11) [DISC] (1) Integer $FUN_10 (12) [ALGB] (2) Real[2] pipe.flowModel.mus = {Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.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) protected Real[1] tank.portsData_height = tank.portsData.height (14) [ALGB] (1) protected Real[1] tank.portsData_height2 (15) [ALGB] (1) stream Real[1] tank.ports.h_outflow (min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (16) [ALGB] (1) Real tank.Hb_flow (17) [DISC] (1) protected discrete Real timeTable.nextEventScaled (fixed = true, start = 0.0) (18) [ALGB] (1) flow Real[1] tank.ports.m_flow (start = {0.0 for $i1 in 1:1}, min = {-1e5 for $i1 in 1:1}, max = {1e5 for $i1 in 1:1}) (19) [ALGB] (1) Real[1] tank.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}) (20) [DISC] (1) protected Real timeTable.a (21) [DISC] (1) protected Real timeTable.b (22) [ALGB] (1) Real pipe.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (23) [DER-] (1) Real $DER.tank.U (24) [ALGB] (1) Real tank.Qb_flow (25) [ALGB] (1) Real[1] pipe.flowModel.pathLengths_internal = pipe.flowModel.pathLengths (26) [ALGB] (2) final Real[2] pipe.flowModel.dimensions = {(4.0 * pipe.crossArea) / pipe.perimeter, (4.0 * pipe.crossArea) / pipe.perimeter} (27) [ALGB] (1) Real $FUN_9 (28) [ALGB] (1) Real $FUN_8 (29) [ALGB] (1) Real $FUN_7 (30) [ALGB] (1) flow Real[1] tank.topPorts.m_flow (start = {0.0 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, max = {1e5 for $i1 in 1:1}) (31) [ALGB] (1) Real $FUN_6 (32) [DISC] (1) Boolean $SEV_20 (33) [ALGB] (1) Real $FUN_4 (34) [ALGB] (1) Real $FUN_3 (35) [ALGB] (1) Real[1] pipe.flowModel.Fs_p (36) [ALGB] (1) Real $FUN_2 (37) [ALGB] (1) Real $FUN_1 (38) [ALGB] (1) Real timeTable.y (39) [ALGB] (1) protected Real[1] tank.levelAbovePort (40) [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) (41) [DISC] (1) protected Boolean[1] tank.ports_m_flow_out (fixed = {true for $i1 in 1:1}, start = {true for $i1 in 1:1}) (42) [DISC] (1) protected discrete Real timeTable.nextEvent (fixed = true, start = 0.0) (43) [ALGB] (1) Real[1] tank.heatTransfer.Q_flows (44) [DER-] (1) Real $DER.tank.m (45) [ALGB] (2) final Real[2] pipe.flowModel.roughnesses = {pipe.roughness, pipe.roughness} (min = {0.0 for $i1 in 1:2}) (46) [ALGB] (1) Real[1] pipe.flowModel.dps_fg (start = {pipe.flowModel.p_a_start - pipe.flowModel.p_b_start for $i1 in 1:1}) (47) [ALGB] (1) Real tank.level (start = tank.level_start, StateSelect = prefer) (48) [ALGB] (1) protected Real[1] tank.portsData_diameter2 (49) [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}) (50) [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}) (51) [ALGB] (1) Real[1] tank.heatTransfer.surfaceAreas = {sqrt(3.141592653589793 * tank.crossArea) * 2.0 * tank.level + tank.crossArea} (52) [ALGB] (1) flow Real[1] ambient_fixed.ports.m_flow (min = {-1e60}, max = {1e60}) (53) [DISC] (1) Boolean $SEV_19 (54) [DISC] (1) Boolean $SEV_18 (55) [DISC] (1) Boolean $SEV_17 (56) [DISC] (1) Boolean $SEV_16 (57) [ALGB] (1) Real[1] pipe.flowModel.Res_turbulent_internal = pipe.flowModel.Re_turbulent * {1.0 for $i1 in 1:1} (58) [DISC] (1) Boolean $SEV_15 (59) [ALGB] (1) flow Real[1] tank.heatTransfer.heatPorts.Q_flow (60) [DISC] (1) Boolean $SEV_14 (61) [ALGB] (1) flow Real[1] flowSource.ports.m_flow (min = {-1e60}, max = {1e60}) (62) [ALGB] (1) final Real[1] pipe.flowModel.dheights = {pipe.height_ab} (63) [ALGB] (1) Real[1] tank.H_flow_top (min = {-1e8 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1000.0 for $i1 in 1:1}) (64) [DISC] (1) Boolean $SEV_10 (65) [ALGB] (1) final input Real[1, 1] tank.heatTransfer.states.T = {tank.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) [ALGB] (1) final Real[1] pipe.flowModel.pathLengths = {pipe.length} (67) [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}) (68) [ALGB] (1) stream Real pipe.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (69) [ALGB] (1) Real pipe.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (70) [ALGB] (1) Real tank.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (71) [ALGB] (1) protected Real[1] tank.ports_emptyPipeHysteresis (min = {0.0 for $i1 in 1:1}) (72) [ALGB] (1) protected Real[1] tank.portsData_diameter = tank.portsData.diameter (73) [ALGB] (1) final Real tank.fluidVolume = tank.fluidVolume (74) [DISC] (1) Boolean $SEV_6 (75) [ALGB] (1) Real[1] pipe.flowModel.Is (76) [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}) (77) [ALGB] (1) flow Real pipe.port_b.m_flow (min = -1e5, max = 1e60) (78) [DISC] (1) Boolean $SEV_0 (79) [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}) (80) [ALGB] (1) stream Real[1] tank.topPorts.h_outflow (min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (81) [ALGB] (1) Real tank.mb_flow (82) [DISC] (1) Boolean $TEV_2 (83) [DISC] (1) Boolean $TEV_1 (84) [ALGB] (1) final input Real[1, 1] tank.heatTransfer.states.p = {tank.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}) (85) [DISC] (1) Boolean $TEV_0 (86) [ALGB] (1) Real[1] tank.heatTransfer.Ts = {Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.tank.heatTransfer.Medium.temperature(tank.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}) (87) [ALGB] (1) protected Real[1] tank.bottomArea (88) [ALGB] (1) Real tank.medium.state.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (89) [ALGB] (1) Real[1] pipe.flowModel.Fs_fg (90) [ALGB] (2) final Real[2] pipe.flowModel.crossAreas = {pipe.crossArea, pipe.crossArea} (91) [ALGB] (2) Real[2] pipe.flowModel.rhos = {Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.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}) (92) [DISC] (1) protected Boolean[1] tank.aboveLevel (93) [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}) (94) [DISC] (1) protected Integer timeTable.last (start = 1) (95) [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}) System Equations (86/103) *************************** (1) [ARRY] (1) pipe.flowModel.Ib_flows = {0.0} ($RES_SIM_15) (2) [SCAL] (1) -timeTable.y = sum(flowSource.ports.m_flow) ($RES_$AUX_144) (3) [SCAL] (1) pipe.flowModel.rhos_act[1] = noEvent(if $SEV_6 then pipe.flowModel.rhos[1] else pipe.flowModel.rhos[2]) ($RES_SIM_16) (4) [SCAL] (1) $FUN_6 = Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.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_143) (5) [SCAL] (1) pipe.flowModel.mus_act[1] = noEvent(if $SEV_6 then pipe.flowModel.mus[1] else pipe.flowModel.mus[2]) ($RES_SIM_17) (6) [TUPL] (4) ($FUN_7, $FUN_8, $FUN_9, $FUN_10) = Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.timeTable.getInterpolationCoefficients(timeTable.table, timeTable.offset, timeTable.startTime, time, timeTable.last, 1e-13, timeTable.shiftTime) ($RES_$AUX_142) (7) [ARRY] (1) pipe.flowModel.m_flows = {homotopy(({$FUN_6} .* 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) [SCAL] (1) $FUN_11 = Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.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_141) (9) [SCAL] (1) ambient_fixed.ports[1].p = ambient_fixed.p ($RES_SIM_19) (10) [SCAL] (1) pipe.flowModel.dp_fric_nominal = sum({$FUN_11}) ($RES_$AUX_140) (11) [SCAL] (1) tank.medium.state.p = tank.p_ambient ($RES_SIM_93) (12) [SCAL] (1) tank.medium.state.T = -((-273.15) - tank.medium.T_degC) ($RES_SIM_94) (13) [SCAL] (1) $DER.tank.m = tank.mb_flow ($RES_SIM_59) (14) [SCAL] (1) $SEV_18 = tank.topPorts[1].m_flow > 0.0 ($RES_EVT_170) (15) [SCAL] (1) $SEV_19 = tank.m >= 0.0 ($RES_EVT_171) (16) [SCAL] (1) $SEV_20 = tank.level <= tank.height ($RES_EVT_172) (17) [SCAL] (1) pipe.port_b.m_flow + ambient_fixed.ports[1].m_flow = 0.0 ($RES_SIM_101) (18) [SCAL] (1) ambient_fixed.ports[1].h_outflow = 4184.0 * ((-273.15) + ambient_fixed.T) ($RES_SIM_20) (19) [SCAL] (1) tank.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_102) (20) [ARRY] (1) tank.heatTransfer.surfaceAreas = {2.0 * $FUN_13 * tank.level + tank.crossArea} ($RES_BND_115) (21) [SCAL] (1) $FUN_13 = sqrt(3.141592653589793 * tank.crossArea) ($RES_$AUX_139) (22) [ARRY] (1) tank.heatTransfer.Ts = {tank.heatTransfer.states.p} ($RES_BND_116) (23) [SCAL] (1) pipe.port_b.p = ambient_fixed.ports[1].p ($RES_SIM_104) (24) [ARRY] (1) tank.portsData_diameter = tank.portsData.diameter ($RES_BND_117) (25) [SCAL] (1) tank.ports[1].m_flow - pipe.port_b.m_flow = 0.0 ($RES_SIM_105) (26) [ARRY] (1) tank.portsData_height = tank.portsData.height ($RES_BND_118) (27) [SCAL] (1) tank.ports[1].p = pipe.port_a.p ($RES_SIM_106) (28) [SCAL] (1) $DER.tank.U = tank.Qb_flow + tank.Hb_flow ($RES_SIM_60) (29) [SCAL] (1) flowSource.ports[1].m_flow + tank.topPorts[1].m_flow = 0.0 ($RES_SIM_107) (30) [SCAL] (1) tank.U = tank.m * (4184.0 * ((-273.15) - ((-273.15) - tank.medium.T_degC))) ($RES_SIM_61) (31) [SCAL] (1) tank.m = 995.586 * tank.fluidVolume ($RES_SIM_62) (32) [SCAL] (1) tank.aboveLevel[1] = $SEV_14 ($RES_SIM_63) (33) [SCAL] (1) tank.levelAbovePort[1] = if tank.aboveLevel[1] then tank.level - tank.portsData_height2[1] else 0.0 ($RES_SIM_64) (34) [SCAL] (1) tank.ports[1].h_outflow = 4184.0 * ((-273.15) - ((-273.15) - tank.medium.T_degC)) ($RES_SIM_65) (35) [SCAL] (1) tank.ports_m_flow_out[1] = $SEV_15 ($RES_SIM_66) (36) [-IF-] (1)if tank.aboveLevel[1] then (36) [----] [SCAL] (1) tank.ports[1].p = (system.g * tank.levelAbovePort[1] * 995.586 + tank.p_ambient) - smooth(2, noEvent(if $SEV_16 then tank.ports[1].m_flow ^ 2.0 / (tank.bottomArea[1] ^ 2.0 * 995.586 * 2.0) else 0.0)) ($RES_SIM_68) (36) [----] else (36) [----] [-IF-] (1)if $TEV_2 then (36) [----] [----] [SCAL] (1) tank.ports[1].m_flow = 0.0 ($RES_SIM_70) (36) [----] [----] else (36) [----] [----] [SCAL] (1) tank.ports[1].p = tank.p_ambient ($RES_SIM_71) (36) [----] [----] end if; (36) [----] end if; (37) [ARRY] (1) tank.portsData_height = tank.portsData_height2 ($RES_SIM_110) (38) [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_123) (39) [ARRY] (1) tank.portsData_diameter = tank.portsData_diameter2 ($RES_SIM_111) (40) [ARRY] (2) pipe.flowModel.crossAreas = {pipe.crossArea, pipe.crossArea} ($RES_BND_124) (41) [ARRY] (2) pipe.flowModel.dimensions = {(4.0 * pipe.crossArea) / pipe.perimeter, (4.0 * pipe.crossArea) / pipe.perimeter} ($RES_BND_125) (42) [ARRY] (2) pipe.flowModel.roughnesses = {pipe.roughness, pipe.roughness} ($RES_BND_126) (43) [ARRY] (1) pipe.flowModel.dheights = {pipe.height_ab} ($RES_BND_127) (44) [ARRY] (1) pipe.flowModel.pathLengths = {pipe.length} ($RES_BND_128) (45) [FOR-] (2) ($RES_BND_129) (45) [----] for $i1 in 1:2 loop (45) [----] [SCAL] (1) pipe.flowModel.rhos[$i1] = 995.586 ($RES_BND_130) (45) [----] end for; (46) [SCAL] (1) tank.port_b_H_flow_bottom[1] = smooth(0, tank.ports[1].m_flow * (if $SEV_17 then pipe.port_a.h_outflow else tank.ports[1].h_outflow)) ($RES_SIM_73) (47) [SCAL] (1) tank.topPorts[1].h_outflow = tank.h_start ($RES_SIM_75) (48) [SCAL] (1) tank.H_flow_top[1] = smooth(0, tank.topPorts[1].m_flow * (if $SEV_18 then flowSource.ports[1].h_outflow else tank.topPorts[1].h_outflow)) ($RES_SIM_76) (49) [SCAL] (1) tank.Qb_flow = tank.heatTransfer.Q_flows[1] ($RES_SIM_78) (50) [SCAL] (1) tank.Hb_flow = $FUN_3 + $FUN_4 ($RES_SIM_79) (51) [SCAL] (1) $TEV_0 = $PRE.tank.aboveLevel ($RES_EVT_153) (52) [SCAL] (1) $TEV_1 = $PRE.timeTable.nextEvent ($RES_EVT_154) (53) [SCAL] (1) $TEV_2 = $PRE.tank.ports_m_flow_out ($RES_EVT_155) (54) [SCAL] (1) $SEV_0 = tank.level_start >= tank.portsData_height2[1] ($RES_EVT_156) (55) [SCAL] (1) $SEV_6 = pipe.flowModel.m_flows[1] > 0.0 ($RES_EVT_158) (56) [FOR-] (2) ($RES_BND_131) (56) [----] for $i1 in 1:2 loop (56) [----] [SCAL] (1) pipe.flowModel.mus[$i1] = 0.001 ($RES_BND_132) (56) [----] end for; (57) [ARRY] (1) pipe.flowModel.pathLengths_internal = pipe.flowModel.pathLengths ($RES_BND_133) (58) [SCAL] (1) pipe.flowModel.Res_turbulent_internal[1] = pipe.flowModel.Re_turbulent ($RES_BND_134) (59) [SCAL] (1) flowSource.ports[1].h_outflow = 4184.0 * ((-273.15) + flowSource.T) ($RES_SIM_40) (60) [ARRY] (1) pipe.flowModel.diameters = 0.5 * (pipe.flowModel.dimensions[2:2] + pipe.flowModel.dimensions[1:1]) ($RES_BND_135) (61) [ARRY] (2) tank.heatTransfer.states = {tank.medium.state} ($RES_BND_137) (62) [ARRY] (4) pipe.flowModel.states = {Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.pipe.Medium.ThermodynamicState(pipe.port_a.p, 273.15 + 2.390057361376673e-4 * tank.ports[1].h_outflow), Modelica.Fluid.Examples.AST_BatchPlant.Test.OneTank.pipe.Medium.ThermodynamicState(pipe.port_b.p, 273.15 + 2.390057361376673e-4 * ambient_fixed.ports[1].h_outflow)} ($RES_BND_138) (63) [SCAL] (1) tank.mb_flow = $FUN_1 + $FUN_2 ($RES_SIM_80) (64) [SCAL] (1) tank.fluidVolume = tank.crossArea * tank.level + tank.V0 ($RES_SIM_81) (65) [SCAL] (1) tank.bottomArea[1] = 3.141592653589793 * (tank.portsData_diameter2[1] / 2.0) ^ 2.0 ($RES_SIM_83) (66) [SCAL] (1) tank.ports_emptyPipeHysteresis[1] = tank.portsData_diameter2[1] * tank.hysteresisFactor ($RES_SIM_84) (67) [ARRY] (1) tank.heatTransfer.Q_flows = tank.heatTransfer.heatPorts.Q_flow ($RES_SIM_87) (68) [ARRY] (1) tank.heatTransfer.Ts = tank.heatTransfer.heatPorts.T ($RES_SIM_88) (69) [SCAL] (1) $SEV_10 = abs(sum({abs(flowSource.ports[1].m_flow)}) - abs(flowSource.ports[1].m_flow)) <= 1e-60 ($RES_EVT_162) (70) [SCAL] (1) $SEV_14 = tank.level >= (tank.portsData_height2[1] + tank.ports_emptyPipeHysteresis[1]) or $PRE.tank.aboveLevel[1] and tank.level >= (tank.portsData_height2[1] - tank.ports_emptyPipeHysteresis[1]) ($RES_EVT_166) (71) [SCAL] (1) pipe.port_b.h_outflow = tank.ports[1].h_outflow - system.g * pipe.height_ab ($RES_SIM_8) (72) [SCAL] (1) $SEV_15 = $PRE.tank.ports_m_flow_out[1] and not tank.ports[1].p > tank.p_ambient or tank.ports[1].m_flow < (-1e-6) ($RES_EVT_167) (73) [SCAL] (1) pipe.port_a.h_outflow = ambient_fixed.ports[1].h_outflow + system.g * pipe.height_ab ($RES_SIM_7) (74) [SCAL] (1) $SEV_16 = tank.ports[1].m_flow < 0.0 ($RES_EVT_168) (75) [SCAL] (1) $SEV_17 = tank.ports[1].m_flow > 0.0 ($RES_EVT_169) (76) [SCAL] (1) timeTable.y = timeTable.a * time + timeTable.b ($RES_SIM_4) (77) [ALGO] (5) ($RES_SIM_3) (77) [----] assert(not (timeTable.table[1, 1] > 0.0 or timeTable.table[1, 1] < 0.0), "The first point in time has to be set to 0, but is table[1,1] = " + String(timeTable.table[1, 1], 6, 0, true), AssertionLevel.error); (77) [----] when {time >= $PRE.timeTable.nextEvent, initial()} then (77) [----] (timeTable.a, timeTable.b, timeTable.nextEventScaled, timeTable.last) := ($FUN_7, $FUN_8, $FUN_9, $FUN_10); (77) [----] timeTable.nextEvent := timeTable.nextEventScaled; (77) [----] end when; (78) [SCAL] (1) -pipe.port_b.m_flow = pipe.flowModel.m_flows[1] ($RES_SIM_10) (79) [ARRY] (1) {0.0} = pipe.flowModel.Ib_flows - (pipe.flowModel.Fs_fg + pipe.flowModel.Fs_p) ($RES_SIM_11) (80) [SCAL] (1) $FUN_1 = sum(tank.topPorts.m_flow) ($RES_$AUX_148) (81) [ARRY] (1) pipe.flowModel.Is = {pipe.flowModel.m_flows[1] * pipe.flowModel.pathLengths[1]} ($RES_SIM_12) (82) [SCAL] (1) $FUN_2 = sum(tank.ports.m_flow) ($RES_$AUX_147) (83) [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) (84) [SCAL] (1) $FUN_3 = sum(tank.H_flow_top) ($RES_$AUX_146) (85) [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) (86) [SCAL] (1) $FUN_4 = sum(tank.port_b_H_flow_bottom) ($RES_$AUX_145)