Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr Modelica_3.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.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.TwoTanks,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks") translateModel(Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001066/0.001066, allocations: 105.8 kB / 16.42 MB, free: 6.461 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.001105/0.001105, allocations: 189.9 kB / 17.36 MB, free: 5.73 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.365/1.365, allocations: 205.1 MB / 223.2 MB, free: 12.25 MB / 190.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 2.517e-05/2.518e-05, allocations: 2.281 kB / 327.2 MB, free: 3.344 MB / 270.1 MB Notification: Performance of NFInst.instantiate(Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks): time 0.01741/0.01744, allocations: 17.53 MB / 344.7 MB, free: 1.734 MB / 286.1 MB Notification: Performance of NFInst.instExpressions: time 0.009115/0.02661, allocations: 5.98 MB / 350.7 MB, free: 11.74 MB / 302.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.001143/0.02781, allocations: 19.88 kB / 350.7 MB, free: 11.72 MB / 302.1 MB Notification: Performance of NFTyping.typeComponents: time 0.001032/0.02885, allocations: 325.9 kB / 351 MB, free: 11.4 MB / 302.1 MB Notification: Performance of NFTyping.typeBindings: time 0.002958/0.03194, allocations: 1.026 MB / 352.1 MB, free: 10.37 MB / 302.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.004335/0.03629, allocations: 1.66 MB / 353.7 MB, free: 8.707 MB / 302.1 MB Notification: Performance of NFFlatten.flatten: time 0.003215/0.03952, allocations: 2.225 MB / 355.9 MB, free: 6.473 MB / 302.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0007741/0.04031, allocations: 0.5171 MB / 356.5 MB, free: 5.941 MB / 302.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.001428/0.04174, allocations: 0.9074 MB / 357.4 MB, free: 5.031 MB / 302.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.0009153/0.04267, allocations: 0.7514 MB / 358.1 MB, free: 4.277 MB / 302.1 MB Notification: Performance of NFPackage.collectConstants: time 0.0001084/0.04279, allocations: 68 kB / 358.2 MB, free: 4.211 MB / 302.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.002274/0.04508, allocations: 1.116 MB / 359.3 MB, free: 3.094 MB / 302.1 MB Notification: Performance of combineBinaries: time 0.001323/0.04641, allocations: 1.552 MB / 360.9 MB, free: 1.527 MB / 302.1 MB Notification: Performance of replaceArrayConstructors: time 0.0006537/0.04707, allocations: 0.9303 MB / 361.8 MB, free: 0.5859 MB / 302.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0002082/0.04729, allocations: 127.6 kB / 361.9 MB, free: 472 kB / 302.1 MB Notification: Performance of FrontEnd: time 0.0001878/0.04748, allocations: 23.88 kB / 361.9 MB, free: 448 kB / 302.1 MB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 120 (109) * Number of variables: 124 (112) Notification: Performance of Bindings: time 0.004024/0.05152, allocations: 4.022 MB / 365.9 MB, free: 12.29 MB / 318.1 MB Notification: Performance of FunctionAlias: time 0.0003792/0.0519, allocations: 292.6 kB / 366.2 MB, free: 11.99 MB / 318.1 MB Notification: Performance of Early Inline: time 0.002186/0.0541, allocations: 2.174 MB / 368.4 MB, free: 9.781 MB / 318.1 MB Notification: Performance of simplify1: time 0.0002604/0.05437, allocations: 187.7 kB / 368.6 MB, free: 9.598 MB / 318.1 MB Notification: Performance of Alias: time 0.002158/0.05654, allocations: 1.92 MB / 370.5 MB, free: 7.5 MB / 318.1 MB Notification: Performance of simplify2: time 0.0001976/0.05675, allocations: 171.8 kB / 370.7 MB, free: 7.332 MB / 318.1 MB Notification: Performance of Events: time 0.0006041/0.05736, allocations: 0.4991 MB / 371.2 MB, free: 6.816 MB / 318.1 MB Notification: Performance of Detect States: time 0.0008634/0.05824, allocations: 0.5851 MB / 371.8 MB, free: 6.207 MB / 318.1 MB Notification: Performance of Partitioning: time 0.0008485/0.0591, allocations: 0.797 MB / 372.6 MB, free: 5.332 MB / 318.1 MB Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (114/126) **************************** (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) Real[1] tank2.heatTransfer.surfaceAreas = {sqrt(3.141592653589793 * tank2.crossArea) * 2.0 * tank2.level + tank2.crossArea} (5) [ALGB] (1) protected Real pipe.flowModel.dp_fric_nominal = sum({Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.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] (2) Real[2] pipe.flowModel.vs = {(-pipe.port_b.m_flow) / (pipe.flowModel.crossAreas[1] * Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.pipe.Medium.density(pipe.flowModel.states[1])), -pipe.port_b.m_flow / (Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.pipe.Medium.density(pipe.flowModel.states[2]) * pipe.flowModel.crossAreas[2])} / pipe.nParallel (7) [ALGB] (1) protected Real[1] pipe.flowModel.diameters = 0.5 * (pipe.flowModel.dimensions[2:2] + pipe.flowModel.dimensions[1:1]) (8) [ALGB] (1) Real tank2.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (9) [ALGB] (1) protected Real[1] tank1.portsData_height = tank1.portsData.height (10) [ALGB] (1) final Real tank2.fluidVolume = tank2.fluidVolume (11) [ALGB] (1) Real tank1.medium.state.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (12) [ALGB] (1) Real $FUN_10 (13) [ALGB] (1) Real[1] tank1.heatTransfer.Q_flows (14) [ALGB] (2) Real[2] pipe.flowModel.mus = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.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}) (15) [ALGB] (1) Real tank1.mb_flow (16) [ALGB] (1) protected Real[1] tank2.portsData_height = tank2.portsData.height (17) [ALGB] (1) protected Real[1] tank1.zetas_out (18) [ALGB] (1) flow Real[1] tank1.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) [DER-] (1) Real $DER.tank1.U (20) [ALGB] (1) Real[1] tank2.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}) (21) [ALGB] (1) Real tank1.level (start = tank1.level_start, StateSelect = prefer) (22) [ALGB] (1) final input Real[1, 1] tank2.heatTransfer.states.T = {tank2.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}) (23) [ALGB] (1) Real pipe.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (24) [ALGB] (1) flow Real[1] tank1.heatTransfer.heatPorts.Q_flow (25) [ALGB] (1) Real[1] tank1.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}) (26) [ALGB] (1) Real[1] pipe.flowModel.pathLengths_internal = pipe.flowModel.pathLengths (27) [ALGB] (1) Real tank1.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (28) [ALGB] (2) final Real[2] pipe.flowModel.dimensions = {(4.0 * pipe.crossArea) / pipe.perimeter, (4.0 * pipe.crossArea) / pipe.perimeter} (29) [ALGB] (1) Real $FUN_9 (30) [DISC] (1) protected Boolean[1] tank1.aboveLevel (31) [ALGB] (1) Real tank2.level (start = tank2.level_start, StateSelect = prefer) (32) [ALGB] (1) Real $FUN_7 (33) [ALGB] (1) Real $FUN_6 (34) [ALGB] (1) Real $FUN_5 (35) [DISC] (1) Boolean $SEV_20 (36) [ALGB] (1) Real $FUN_4 (37) [ALGB] (1) Real $FUN_3 (38) [ALGB] (1) protected Real[1] tank1.portsData_diameter2 (39) [ALGB] (1) Real[1] pipe.flowModel.Fs_p (40) [ALGB] (1) Real $FUN_2 (41) [ALGB] (1) protected Real[1] tank1.bottomArea (42) [DER-] (1) Real $DER.tank1.m (43) [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}) (44) [ALGB] (1) Real[1] tank2.heatTransfer.Ts = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.tank2.heatTransfer.Medium.temperature(tank2.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}) (45) [ALGB] (1) stream Real[1] tank2.ports.h_outflow (min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (46) [ALGB] (1) Real[1] tank2.heatTransfer.Q_flows (47) [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) (48) [ALGB] (1) final input Real[1, 1] tank2.heatTransfer.states.p = {tank2.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}) (49) [ALGB] (2) final Real[2] pipe.flowModel.roughnesses = {pipe.roughness, pipe.roughness} (min = {0.0 for $i1 in 1:2}) (50) [ALGB] (1) Real[1] tank2.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}) (51) [ALGB] (1) Real[1] pipe.flowModel.dps_fg (start = {pipe.flowModel.p_a_start - pipe.flowModel.p_b_start for $i1 in 1:1}) (52) [ALGB] (1) Real tank2.Qb_flow (53) [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}) (54) [DISC] (1) Boolean $SEV_19 (55) [DISC] (1) protected Boolean[1] tank2.aboveLevel (56) [DISC] (1) Boolean $SEV_18 (57) [ALGB] (1) protected Real[1] tank1.portsData_diameter = tank1.portsData.diameter (58) [DISC] (1) Boolean $SEV_17 (59) [DISC] (1) Boolean $SEV_16 (60) [ALGB] (1) protected Real[1] tank1.levelAbovePort (61) [ALGB] (1) Real[1] pipe.flowModel.Res_turbulent_internal = pipe.flowModel.Re_turbulent * {1.0 for $i1 in 1:1} (62) [DISC] (1) Boolean $SEV_15 (63) [ALGB] (1) Real[1] tank2.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}) (64) [DISC] (1) Boolean $SEV_14 (65) [ALGB] (1) final Real[1] pipe.flowModel.dheights = {pipe.height_ab} (66) [ALGB] (1) protected Real[1] tank2.bottomArea (67) [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}) (68) [DISC] (1) Boolean $SEV_10 (69) [ALGB] (1) Real tank2.Hb_flow (70) [ALGB] (1) final Real[1] pipe.flowModel.pathLengths = {pipe.length} (71) [ALGB] (1) flow Real[1] tank2.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}) (72) [ALGB] (1) stream Real pipe.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (73) [ALGB] (1) Real pipe.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (74) [ALGB] (1) protected Real[1] tank2.levelAbovePort (75) [ALGB] (1) protected Real[1] tank1.portsData_height2 (76) [ALGB] (1) Real tank1.Qb_flow (77) [ALGB] (1) protected Real[1] tank2.portsData_diameter = tank2.portsData.diameter (78) [ALGB] (1) protected Real[1] tank2.portsData_height2 (79) [ALGB] (1) flow Real[1] tank2.heatTransfer.heatPorts.Q_flow (80) [ALGB] (1) Real tank1.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - tank1.medium.T_degC)) (81) [ALGB] (1) Real[1] tank1.heatTransfer.Ts = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.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}) (82) [ALGB] (1) stream Real[1] tank1.ports.h_outflow (min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (83) [DISC] (1) Boolean $SEV_9 (84) [DISC] (1) Boolean $SEV_8 (85) [DISC] (1) Boolean $SEV_7 (86) [DISC] (1) Boolean $SEV_6 (87) [DISC] (1) Boolean $SEV_5 (88) [ALGB] (1) Real[1] pipe.flowModel.Is (89) [DISC] (1) Boolean $SEV_4 (90) [DER-] (1) Real $DER.tank2.U (91) [ALGB] (1) Real[1] tank1.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}) (92) [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}) (93) [DISC] (1) Boolean $SEV_3 (94) [ALGB] (1) flow Real pipe.port_b.m_flow (min = -1e5, max = 1e60) (95) [ALGB] (1) protected Real[1] tank2.zetas_out (96) [DISC] (1) Boolean $SEV_1 (97) [ALGB] (1) protected Real[1] tank1.ports_emptyPipeHysteresis (min = {0.0 for $i1 in 1:1}) (98) [DISC] (1) Boolean $SEV_0 (99) [ALGB] (1) Real tank1.Hb_flow (100) [DISC] (1) Boolean $TEV_1 (101) [DISC] (1) Boolean $TEV_0 (102) [ALGB] (1) Real tank2.medium.state.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (103) [ALGB] (1) protected Real[1] tank2.ports_emptyPipeHysteresis (min = {0.0 for $i1 in 1:1}) (104) [ALGB] (1) final Real tank1.fluidVolume = tank1.fluidVolume (105) [ALGB] (1) Real[1] pipe.flowModel.Fs_fg (106) [ALGB] (1) Real tank2.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - tank2.medium.T_degC)) (107) [ALGB] (2) final Real[2] pipe.flowModel.crossAreas = {pipe.crossArea, pipe.crossArea} (108) [ALGB] (2) Real[2] pipe.flowModel.rhos = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.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}) (109) [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}) (110) [ALGB] (1) protected Real[1] tank2.portsData_diameter2 (111) [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}) (112) [ALGB] (1) Real tank2.mb_flow (113) [DER-] (1) Real $DER.tank2.m (114) [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 (111/122) **************************** (1) [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_15) (2) [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_16) (3) [ARRY] (1) pipe.flowModel.Ib_flows = {0.0} ($RES_SIM_17) (4) [SCAL] (1) pipe.flowModel.rhos_act[1] = noEvent(if $SEV_3 then pipe.flowModel.rhos[1] else pipe.flowModel.rhos[2]) ($RES_SIM_18) (5) [SCAL] (1) pipe.flowModel.mus_act[1] = noEvent(if $SEV_3 then pipe.flowModel.mus[1] else pipe.flowModel.mus[2]) ($RES_SIM_19) (6) [SCAL] (1) $FUN_2 = sum(tank1.ports.m_flow) ($RES_$AUX_140) (7) [SCAL] (1) pipe.port_b.m_flow + tank2.ports[1].m_flow = 0.0 ($RES_SIM_91) (8) [SCAL] (1) $DER.tank1.m = tank1.mb_flow ($RES_SIM_56) (9) [SCAL] (1) tank2.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_92) (10) [SCAL] (1) $DER.tank1.U = tank1.Qb_flow + tank1.Hb_flow ($RES_SIM_57) (11) [SCAL] (1) tank1.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_93) (12) [SCAL] (1) tank1.U = tank1.m * (4184.0 * ((-273.15) - ((-273.15) - tank1.medium.T_degC))) ($RES_SIM_58) (13) [SCAL] (1) pipe.port_b.p = tank2.ports[1].p ($RES_SIM_94) (14) [SCAL] (1) tank1.m = 995.586 * tank1.fluidVolume ($RES_SIM_59) (15) [SCAL] (1) tank1.ports[1].m_flow - pipe.port_b.m_flow = 0.0 ($RES_SIM_95) (16) [SCAL] (1) tank1.ports[1].p = pipe.port_a.p ($RES_SIM_96) (17) [ARRY] (1) tank2.portsData_height = tank2.portsData_height2 ($RES_SIM_97) (18) [SCAL] (1) $SEV_20 = tank1.level <= tank1.height ($RES_EVT_170) (19) [ARRY] (1) tank2.portsData_diameter = tank2.portsData_diameter2 ($RES_SIM_98) (20) [ARRY] (1) tank1.portsData_height = tank1.portsData_height2 ($RES_SIM_99) (21) [ARRY] (1) tank2.heatTransfer.surfaceAreas = {2.0 * $FUN_9 * tank2.level + tank2.crossArea} ($RES_BND_111) (22) [ARRY] (1) tank2.heatTransfer.Ts = {tank2.heatTransfer.states.p} ($RES_BND_112) (23) [ARRY] (1) tank1.portsData_diameter = tank1.portsData_diameter2 ($RES_SIM_100) (24) [ARRY] (1) tank2.portsData_diameter = tank2.portsData.diameter ($RES_BND_113) (25) [ARRY] (1) tank2.portsData_height = tank2.portsData.height ($RES_BND_114) (26) [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_20) (27) [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_115) (28) [SCAL] (1) $FUN_3 = sum(tank1.port_b_H_flow_bottom) ($RES_$AUX_139) (29) [SCAL] (1) $DER.tank2.m = tank2.mb_flow ($RES_SIM_21) (30) [ARRY] (2) pipe.flowModel.crossAreas = {pipe.crossArea, pipe.crossArea} ($RES_BND_116) (31) [SCAL] (1) $FUN_4 = sum(tank2.ports.m_flow) ($RES_$AUX_138) (32) [SCAL] (1) $DER.tank2.U = tank2.Qb_flow + tank2.Hb_flow ($RES_SIM_22) (33) [ARRY] (2) pipe.flowModel.dimensions = {(4.0 * pipe.crossArea) / pipe.perimeter, (4.0 * pipe.crossArea) / pipe.perimeter} ($RES_BND_117) (34) [SCAL] (1) $FUN_5 = sum(tank2.port_b_H_flow_bottom) ($RES_$AUX_137) (35) [SCAL] (1) tank2.U = tank2.m * (4184.0 * ((-273.15) - ((-273.15) - tank2.medium.T_degC))) ($RES_SIM_23) (36) [ARRY] (2) pipe.flowModel.roughnesses = {pipe.roughness, pipe.roughness} ($RES_BND_118) (37) [SCAL] (1) $FUN_6 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.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_136) (38) [SCAL] (1) tank2.m = 995.586 * tank2.fluidVolume ($RES_SIM_24) (39) [ARRY] (1) pipe.flowModel.dheights = {pipe.height_ab} ($RES_BND_119) (40) [SCAL] (1) $FUN_7 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.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_135) (41) [SCAL] (1) tank1.aboveLevel[1] = $SEV_14 ($RES_SIM_60) (42) [SCAL] (1) tank2.aboveLevel[1] = $SEV_4 ($RES_SIM_25) (43) [SCAL] (1) pipe.flowModel.dp_fric_nominal = sum({$FUN_7}) ($RES_$AUX_134) (44) [SCAL] (1) tank1.levelAbovePort[1] = if tank1.aboveLevel[1] then tank1.level - tank1.portsData_height2[1] else 0.0 ($RES_SIM_61) (45) [SCAL] (1) tank2.levelAbovePort[1] = if tank2.aboveLevel[1] then tank2.level - tank2.portsData_height2[1] else 0.0 ($RES_SIM_26) (46) [SCAL] (1) $FUN_9 = sqrt(3.141592653589793 * tank2.crossArea) ($RES_$AUX_133) (47) [SCAL] (1) tank1.ports[1].h_outflow = 4184.0 * ((-273.15) - ((-273.15) - tank1.medium.T_degC)) ($RES_SIM_62) (48) [SCAL] (1) tank2.ports[1].h_outflow = 4184.0 * ((-273.15) - ((-273.15) - tank2.medium.T_degC)) ($RES_SIM_27) (49) [SCAL] (1) $FUN_10 = sqrt(3.141592653589793 * tank1.crossArea) ($RES_$AUX_132) (50) [SCAL] (1) tank1.zetas_out[1] = 1.0 + (if tank1.aboveLevel[1] then 0.0 else tank1.zetaLarge) ($RES_SIM_63) (51) [SCAL] (1) tank2.zetas_out[1] = 1.0 + (if tank2.aboveLevel[1] then 0.0 else tank2.zetaLarge) ($RES_SIM_28) (52) [SCAL] (1) tank1.ports[1].p = 995.586 * system.g * tank1.levelAbovePort[1] + tank1.p_ambient + smooth(2, if $SEV_15 then (8.14163185439231e-6 * tank1.ports[1].m_flow ^ 2.0) / (tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1]) else if $SEV_16 then -(8.141631854392309e-4 * tank1.zetas_out[1] * tank1.ports[1].m_flow ^ 2.0) / (tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1]) else if $SEV_17 then Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(tank1.ports[1].m_flow, tank1.m_flow_small, 8.14163185439231e-6 / (tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1]), (8.141631854392309e-4 * tank1.zetas_out[1]) / (tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1]), false, 1.0) else -Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(-tank1.ports[1].m_flow, tank1.m_flow_small, (8.141631854392309e-4 * tank1.zetas_out[1]) / (tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1]), 8.14163185439231e-6 / (tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1]), false, 1.0)) ($RES_SIM_64) (53) [SCAL] (1) tank2.ports[1].p = 995.586 * system.g * tank2.levelAbovePort[1] + tank2.p_ambient + smooth(2, if $SEV_5 then (8.14163185439231e-6 * tank2.ports[1].m_flow ^ 2.0) / (tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1]) else if $SEV_6 then -(8.141631854392309e-4 * tank2.zetas_out[1] * tank2.ports[1].m_flow ^ 2.0) / (tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1]) else if $SEV_7 then Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(tank2.ports[1].m_flow, tank2.m_flow_small, 8.14163185439231e-6 / (tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1]), (8.141631854392309e-4 * tank2.zetas_out[1]) / (tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1]), false, 1.0) else -Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(-tank2.ports[1].m_flow, tank2.m_flow_small, (8.141631854392309e-4 * tank2.zetas_out[1]) / (tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1]), 8.14163185439231e-6 / (tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1]), false, 1.0)) ($RES_SIM_29) (54) [SCAL] (1) tank1.port_b_H_flow_bottom[1] = smooth(0, tank1.ports[1].m_flow * (if $SEV_18 then pipe.port_a.h_outflow else tank1.ports[1].h_outflow)) ($RES_SIM_66) (55) [SCAL] (1) tank1.Qb_flow = tank1.heatTransfer.Q_flows[1] ($RES_SIM_68) (56) [SCAL] (1) tank1.Hb_flow = $FUN_3 ($RES_SIM_69) (57) [SCAL] (1) $TEV_0 = $PRE.tank2.aboveLevel ($RES_EVT_148) (58) [SCAL] (1) $TEV_1 = $PRE.tank1.aboveLevel ($RES_EVT_149) (59) [ARRY] (1) pipe.flowModel.pathLengths = {pipe.length} ($RES_BND_120) (60) [FOR-] (2) ($RES_BND_121) (60) [----] for $i1 in 1:2 loop (60) [----] [SCAL] (1) pipe.flowModel.rhos[$i1] = 995.586 ($RES_BND_122) (60) [----] end for; (61) [FOR-] (2) ($RES_BND_123) (61) [----] for $i1 in 1:2 loop (61) [----] [SCAL] (1) pipe.flowModel.mus[$i1] = 0.001 ($RES_BND_124) (61) [----] end for; (62) [ARRY] (1) pipe.flowModel.pathLengths_internal = pipe.flowModel.pathLengths ($RES_BND_125) (63) [SCAL] (1) tank2.port_b_H_flow_bottom[1] = smooth(0, tank2.ports[1].m_flow * (if $SEV_8 then pipe.port_b.h_outflow else tank2.ports[1].h_outflow)) ($RES_SIM_31) (64) [SCAL] (1) pipe.flowModel.Res_turbulent_internal[1] = pipe.flowModel.Re_turbulent ($RES_BND_126) (65) [ARRY] (1) pipe.flowModel.diameters = 0.5 * (pipe.flowModel.dimensions[2:2] + pipe.flowModel.dimensions[1:1]) ($RES_BND_127) (66) [SCAL] (1) tank2.Qb_flow = tank2.heatTransfer.Q_flows[1] ($RES_SIM_33) (67) [SCAL] (1) tank2.Hb_flow = $FUN_5 ($RES_SIM_34) (68) [ARRY] (2) tank1.heatTransfer.states = {tank1.medium.state} ($RES_BND_129) (69) [SCAL] (1) tank1.mb_flow = $FUN_2 ($RES_SIM_70) (70) [SCAL] (1) tank2.mb_flow = $FUN_4 ($RES_SIM_35) (71) [SCAL] (1) tank1.fluidVolume = tank1.crossArea * tank1.level + tank1.V0 ($RES_SIM_71) (72) [SCAL] (1) tank2.fluidVolume = tank2.crossArea * tank2.level + tank2.V0 ($RES_SIM_36) (73) [SCAL] (1) tank1.bottomArea[1] = 3.141592653589793 * (tank1.portsData_diameter2[1] / 2.0) ^ 2.0 ($RES_SIM_73) (74) [SCAL] (1) tank2.bottomArea[1] = 3.141592653589793 * (tank2.portsData_diameter2[1] / 2.0) ^ 2.0 ($RES_SIM_38) (75) [SCAL] (1) tank1.ports_emptyPipeHysteresis[1] = tank1.portsData_diameter2[1] * tank1.hysteresisFactor ($RES_SIM_74) (76) [SCAL] (1) tank2.ports_emptyPipeHysteresis[1] = tank2.portsData_diameter2[1] * tank2.hysteresisFactor ($RES_SIM_39) (77) [ARRY] (1) tank1.heatTransfer.Q_flows = tank1.heatTransfer.heatPorts.Q_flow ($RES_SIM_77) (78) [SCAL] (1) $SEV_0 = tank2.level_start >= tank2.portsData_height2[1] ($RES_EVT_150) (79) [ARRY] (1) tank1.heatTransfer.Ts = tank1.heatTransfer.heatPorts.T ($RES_SIM_78) (80) [SCAL] (1) $SEV_1 = tank1.level_start >= tank1.portsData_height2[1] ($RES_EVT_151) (81) [SCAL] (1) $SEV_3 = pipe.flowModel.m_flows[1] > 0.0 ($RES_EVT_153) (82) [SCAL] (1) $SEV_4 = tank2.level >= (tank2.portsData_height2[1] + tank2.ports_emptyPipeHysteresis[1]) or $PRE.tank2.aboveLevel[1] and tank2.level >= (tank2.portsData_height2[1] - tank2.ports_emptyPipeHysteresis[1]) ($RES_EVT_154) (83) [SCAL] (1) $SEV_5 = tank2.ports[1].m_flow >= tank2.m_flow_small ($RES_EVT_155) (84) [SCAL] (1) $SEV_6 = tank2.ports[1].m_flow <= (-tank2.m_flow_small) ($RES_EVT_156) (85) [SCAL] (1) $SEV_7 = 8.14163185439231e-6 / (tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1]) >= (8.141631854392309e-4 * tank2.zetas_out[1]) / (tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1] * tank2.portsData_diameter2[1]) ($RES_EVT_157) (86) [SCAL] (1) $SEV_8 = tank2.ports[1].m_flow > 0.0 ($RES_EVT_158) (87) [SCAL] (1) $SEV_9 = tank2.m >= 0.0 ($RES_EVT_159) (88) [ARRY] (2) tank2.heatTransfer.states = {tank2.medium.state} ($RES_BND_130) (89) [ARRY] (4) pipe.flowModel.states = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.pipe.Medium.ThermodynamicState(pipe.port_a.p, 273.15 + 2.390057361376673e-4 * tank1.ports[1].h_outflow), Modelica.Fluid.Examples.AST_BatchPlant.Test.TwoTanks.pipe.Medium.ThermodynamicState(pipe.port_b.p, 273.15 + 2.390057361376673e-4 * tank2.ports[1].h_outflow)} ($RES_BND_131) (90) [ARRY] (1) tank2.heatTransfer.Q_flows = tank2.heatTransfer.heatPorts.Q_flow ($RES_SIM_42) (91) [ARRY] (1) tank2.heatTransfer.Ts = tank2.heatTransfer.heatPorts.T ($RES_SIM_43) (92) [SCAL] (1) tank1.medium.state.p = tank1.p_ambient ($RES_SIM_83) (93) [SCAL] (1) tank2.medium.state.p = tank2.p_ambient ($RES_SIM_48) (94) [SCAL] (1) tank1.medium.state.T = -((-273.15) - tank1.medium.T_degC) ($RES_SIM_84) (95) [SCAL] (1) tank2.medium.state.T = -((-273.15) - tank2.medium.T_degC) ($RES_SIM_49) (96) [SCAL] (1) $SEV_10 = tank2.level <= tank2.height ($RES_EVT_160) (97) [SCAL] (1) $SEV_14 = tank1.level >= (tank1.portsData_height2[1] + tank1.ports_emptyPipeHysteresis[1]) or $PRE.tank1.aboveLevel[1] and tank1.level >= (tank1.portsData_height2[1] - tank1.ports_emptyPipeHysteresis[1]) ($RES_EVT_164) (98) [SCAL] (1) $SEV_15 = tank1.ports[1].m_flow >= tank1.m_flow_small ($RES_EVT_165) (99) [SCAL] (1) pipe.port_a.h_outflow = tank2.ports[1].h_outflow + system.g * pipe.height_ab ($RES_SIM_9) (100) [SCAL] (1) $SEV_16 = tank1.ports[1].m_flow <= (-tank1.m_flow_small) ($RES_EVT_166) (101) [SCAL] (1) $SEV_17 = 8.14163185439231e-6 / (tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1]) >= (8.141631854392309e-4 * tank1.zetas_out[1]) / (tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1] * tank1.portsData_diameter2[1]) ($RES_EVT_167) (102) [SCAL] (1) $SEV_18 = tank1.ports[1].m_flow > 0.0 ($RES_EVT_168) (103) [SCAL] (1) $SEV_19 = tank1.m >= 0.0 ($RES_EVT_169) (104) [ARRY] (1) tank1.heatTransfer.surfaceAreas = {2.0 * $FUN_10 * tank1.level + tank1.crossArea} ($RES_BND_104) (105) [SCAL] (1) pipe.port_b.h_outflow = tank1.ports[1].h_outflow - system.g * pipe.height_ab ($RES_SIM_10) (106) [ARRY] (1) tank1.heatTransfer.Ts = {tank1.heatTransfer.states.p} ($RES_BND_105) (107) [ARRY] (1) tank1.portsData_diameter = tank1.portsData.diameter ($RES_BND_106) (108) [SCAL] (1) -pipe.port_b.m_flow = pipe.flowModel.m_flows[1] ($RES_SIM_12) (109) [ARRY] (1) tank1.portsData_height = tank1.portsData.height ($RES_BND_107) (110) [ARRY] (1) {0.0} = pipe.flowModel.Ib_flows - (pipe.flowModel.Fs_fg + pipe.flowModel.Fs_p) ($RES_SIM_13) (111) [ARRY] (1) pipe.flowModel.Is = {pipe.flowModel.m_flows[1] * pipe.flowModel.pathLengths[1]} ($RES_SIM_14)