Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr Modelica_3.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.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.TankWithEmptyingPipe2,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2")
translateModel(Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2")
Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001309/0.001309, allocations: 106.5 kB / 16.42 MB, free: 6.469 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.001173/0.001173, allocations: 192.3 kB / 17.36 MB, free: 5.707 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.388/1.388, allocations: 205.1 MB / 223.2 MB, free: 12.25 MB / 190.1 MB
Notification: Performance of FrontEnd - Absyn->SCode: time 2.279e-05/2.28e-05, allocations: 2.281 kB / 327.2 MB, free: 3.34 MB / 270.1 MB
Notification: Performance of NFInst.instantiate(Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2): time 0.02108/0.02111, allocations: 21.78 MB / 349 MB, free: 13.46 MB / 302.1 MB
Notification: Performance of NFInst.instExpressions: time 0.01302/0.03418, allocations: 9.962 MB / 358.9 MB, free: 3.473 MB / 302.1 MB
Notification: Performance of NFInst.updateImplicitVariability: time 0.001128/0.03535, allocations: 27.81 kB / 359 MB, free: 3.445 MB / 302.1 MB
Notification: Performance of NFTyping.typeComponents: time 0.001082/0.03644, allocations: 405.4 kB / 359.3 MB, free: 3.047 MB / 302.1 MB
Notification: Performance of NFTyping.typeBindings: time 0.003488/0.03994, allocations: 1.415 MB / 360.8 MB, free: 1.625 MB / 302.1 MB
Notification: Performance of NFTyping.typeClassSections: time 0.005937/0.04589, allocations: 2.633 MB / 363.4 MB, free: 14.98 MB / 318.1 MB
Notification: Performance of NFFlatten.flatten: time 0.00354/0.04944, allocations: 2.739 MB / 366.1 MB, free: 12.23 MB / 318.1 MB
Notification: Performance of NFFlatten.resolveConnections: time 0.001045/0.0505, allocations: 0.6628 MB / 366.8 MB, free: 11.56 MB / 318.1 MB
Notification: Performance of NFEvalConstants.evaluate: time 0.00183/0.05234, allocations: 1.098 MB / 367.9 MB, free: 10.46 MB / 318.1 MB
Notification: Performance of NFSimplifyModel.simplify: time 0.001186/0.05354, allocations: 0.9109 MB / 368.8 MB, free: 9.547 MB / 318.1 MB
Notification: Performance of NFPackage.collectConstants: time 0.0001451/0.0537, allocations: 91.94 kB / 368.9 MB, free: 9.457 MB / 318.1 MB
Notification: Performance of NFFlatten.collectFunctions: time 0.00318/0.05688, allocations: 1.712 MB / 370.6 MB, free: 7.742 MB / 318.1 MB
Notification: Performance of combineBinaries: time 0.00153/0.05843, allocations: 1.889 MB / 372.5 MB, free: 5.836 MB / 318.1 MB
Notification: Performance of replaceArrayConstructors: time 0.0007704/0.05921, allocations: 1.145 MB / 373.6 MB, free: 4.68 MB / 318.1 MB
Notification: Performance of NFVerifyModel.verify: time 0.0002398/0.05946, allocations: 155.6 kB / 373.8 MB, free: 4.527 MB / 318.1 MB
Notification: Performance of FrontEnd: time 0.000237/0.0597, allocations: 35.8 kB / 373.8 MB, free: 4.492 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: 164 (133)
 * Number of variables: 172 (134)
Notification: Performance of Bindings: time 0.1825/0.2422, allocations: 4.869 MB / 378.7 MB, free: 18.87 MB / 318.1 MB
Notification: Performance of FunctionAlias: time 0.0007494/0.243, allocations: 499.8 kB / 379.2 MB, free: 18.82 MB / 318.1 MB
Notification: Performance of Early Inline: time 0.003008/0.246, allocations: 2.641 MB / 381.8 MB, free: 18.66 MB / 318.1 MB
Notification: Performance of simplify1: time 0.0002968/0.2463, allocations: 181.3 kB / 382 MB, free: 18.66 MB / 318.1 MB
Notification: Performance of Alias: time 0.002915/0.2492, allocations: 2.466 MB / 384.5 MB, free: 17.96 MB / 318.1 MB
Notification: Performance of simplify2: time 0.0001903/0.2494, allocations: 152.3 kB / 384.6 MB, free: 17.96 MB / 318.1 MB
Notification: Performance of Events: time 0.000679/0.2501, allocations: 0.5822 MB / 385.2 MB, free: 17.84 MB / 318.1 MB
Notification: Performance of Detect States: time 0.0007207/0.2508, allocations: 0.6583 MB / 385.9 MB, free: 17.76 MB / 318.1 MB
Notification: Performance of Partitioning: time 0.001041/0.2519, allocations: 0.9745 MB / 386.8 MB, free: 17.39 MB / 318.1 MB
Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system:
System Variables (112/157)
****************************
(1)       [ALGB] (1) Real[1] tank1.heatTransfer.surfaceAreas = {sqrt(3.141592653589793 * tank1.crossArea) * 2.0 * tank1.level + tank1.crossArea}
(2)       [ALGB] (1) protected Real[1] pipe2.flowModel.diameters = 0.5 * (pipe2.flowModel.dimensions[2:2] + pipe2.flowModel.dimensions[1:1])
(3)       [ALGB] (2) final Real[2] pipe1.flowModel.roughnesses = {pipe1.roughness, pipe1.roughness} (min = {0.0 for $i1 in 1:2})
(4)       [ALGB] (1) flow Real pipe1.port_b.m_flow (min = -1e5, max = 1e60)
(5)       [ALGB] (2) protected Real[2] tank1.portsData_height = tank1.portsData.height
(6)       [ALGB] (1) Real tank1.medium.state.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0)
(7)       [ALGB] (1) Real $FUN_10
(8)       [DISC] (2) Boolean[2] $SEV_0[$i1]
(9)       [ALGB] (1) Real[1] tank1.heatTransfer.Q_flows
(10)      [ALGB] (1) Real[1] pipe2.flowModel.Is
(11)      [ALGB] (2) final Real[2] pipe2.flowModel.roughnesses = {pipe2.roughness, pipe2.roughness} (min = {0.0 for $i1 in 1:2})
(12)      [ALGB] (1) Real tank1.mb_flow
(13)      [ALGB] (2) final Real[2] pipe1.flowModel.dimensions = {(4.0 * pipe1.crossArea) / pipe1.perimeter, (4.0 * pipe1.crossArea) / pipe1.perimeter}
(14)      [ALGB] (2) protected Real[2] tank1.zetas_out
(15)      [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})
(16)      [ALGB] (1) final Real[1] pipe1.flowModel.dheights = {pipe1.height_ab}
(17)      [ALGB] (1) Real pipe2.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5)
(18)      [DISC] (2) Boolean[2] $SEV_11[$i1]
(19)      [DER-] (1) Real $DER.tank1.U
(20)      [ALGB] (1) Real[1] pipe2.flowModel.Fs_p
(21)      [ALGB] (1) Real tank1.level (start = tank1.level_start, StateSelect = prefer)
(22)      [ALGB] (1) Real pipe1.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5)
(23)      [ALGB] (1) Real[1] pipe2.flowModel.Fs_fg
(24)      [ALGB] (1) flow Real[1] tank1.heatTransfer.heatPorts.Q_flow
(25)      [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})
(26)      [DISC] (2) Boolean[2] $SEV_14[$i1]
(27)      [ALGB] (1) Real[1] pipe2.flowModel.pathLengths_internal = pipe2.flowModel.pathLengths
(28)      [ALGB] (1) stream Real pipe2.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6)
(29)      [ALGB] (1) stream Real pipe1.port_a.h_outflow (min = -1e10, max = 1e10, nominal = 1e6)
(30)      [ALGB] (1) Real tank1.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5)
(31)      [ALGB] (1) final Real[1] pipe2.flowModel.pathLengths = {pipe2.length}
(32)      [ALGB] (1) Real $FUN_8
(33)      [DISC] (2) protected Boolean[2] tank1.aboveLevel
(34)      [ALGB] (1) flow Real pipe2.port_b.m_flow (min = -1e5, max = 1e60)
(35)      [ALGB] (2) final Real[2] pipe2.flowModel.dimensions = {(4.0 * pipe2.crossArea) / pipe2.perimeter, (4.0 * pipe2.crossArea) / pipe2.perimeter}
(36)      [ALGB] (1) Real $FUN_6
(37)      [ALGB] (1) Real $FUN_5
(38)      [ALGB] (4) input Real[2, 2] pipe1.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})
(39)      [ALGB] (1) Real $FUN_4
(40)      [ALGB] (1) protected Real[1] pipe1.flowModel.diameters = 0.5 * (pipe1.flowModel.dimensions[2:2] + pipe1.flowModel.dimensions[1:1])
(41)      [ALGB] (1) Real $FUN_3
(42)      [ALGB] (2) protected Real[2] tank1.portsData_diameter2
(43)      [ALGB] (1) Real $FUN_2
(44)      [ALGB] (2) protected Real[2] tank1.bottomArea
(45)      [DER-] (1) Real $DER.tank1.m
(46)      [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})
(47)      [DISC] (2) Boolean[2] $SEV_9[$i1]
(48)      [ALGB] (2) Real[2] pipe2.flowModel.vs = {(-pipe2.port_b.m_flow) / (pipe2.flowModel.crossAreas[1] * Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe2.Medium.density(pipe2.flowModel.states[1])), -pipe2.port_b.m_flow / (Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe2.Medium.density(pipe2.flowModel.states[2]) * pipe2.flowModel.crossAreas[2])} / pipe2.nParallel
(49)      [ALGB] (1) Real[1] pipe1.flowModel.Fs_p
(50)      [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})
(51)      [DISC] (2) Boolean[2] $SEV_10[$i1]
(52)      [ALGB] (1) flow Real[1] ambient_fixed.ports.m_flow (min = {-1e60}, max = {1e60})
(53)      [ALGB] (1) Real[1] pipe2.flowModel.Ib_flows
(54)      [ALGB] (1) Real[1] pipe1.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})
(55)      [DISC] (1) Boolean $SEV_18
(56)      [ALGB] (2) protected Real[2] tank1.portsData_diameter = tank1.portsData.diameter
(57)      [ALGB] (4) input Real[2, 2] pipe2.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})
(58)      [DISC] (1) Boolean $SEV_17
(59)      [DISC] (1) Boolean $SEV_16
(60)      [ALGB] (2) protected Real[2] tank1.levelAbovePort
(61)      [DISC] (1) Boolean $SEV_15
(62)      [ALGB] (2) final Real[2] pipe1.flowModel.crossAreas = {pipe1.crossArea, pipe1.crossArea}
(63)      [ALGB] (1) Real[1] pipe1.flowModel.Fs_fg
(64)      [ALGB] (4) input Real[2, 2] pipe1.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})
(65)      [ALGB] (1) Real[1] pipe2.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)
(66)      [ALGB] (1) flow Real[1] ambient_fixed1.ports.m_flow (min = {-1e60}, max = {1e60})
(67)      [DISC] (2) Boolean[2] $SEV_13[$i1]
(68)      [ALGB] (1) Real[1] pipe1.flowModel.Is
(69)      [ALGB] (1) Real[1] pipe2.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})
(70)      [ALGB] (1) Real[1] pipe1.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)
(71)      [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})
(72)      [ALGB] (1) Real[1] pipe2.flowModel.dps_fg (start = {pipe2.flowModel.p_a_start - pipe2.flowModel.p_b_start for $i1 in 1:1})
(73)      [ALGB] (1) stream Real[1] ambient_fixed1.ports.h_outflow (min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1})
(74)      [ALGB] (1) Real[1] pipe1.flowModel.Ib_flows
(75)      [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})
(76)      [ALGB] (1) Real[1] pipe2.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})
(77)      [ALGB] (2) protected Real[2] tank1.portsData_height2
(78)      [ALGB] (2) Real[2] pipe2.flowModel.rhos = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe2.flowModel.Medium.density(pipe2.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})
(79)      [ALGB] (1) Real tank1.Qb_flow
(80)      [ALGB] (1) Real pipe1.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5)
(81)      [ALGB] (1) Real[1] pipe1.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})
(82)      [ALGB] (2) Real[2] pipe2.flowModel.mus = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe2.flowModel.Medium.dynamicViscosity(pipe2.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})
(83)      [ALGB] (1) Real tank1.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - tank1.medium.T_degC))
(84)      [ALGB] (1) Real[1] tank1.heatTransfer.Ts = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.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})
(85)      [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})
(86)      [DISC] (2) Boolean[2] $SEV_8[$i1]
(87)      [ALGB] (2) Real[2] pipe1.flowModel.mus = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe1.flowModel.Medium.dynamicViscosity(pipe1.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})
(88)      [DISC] (1) Boolean $SEV_7
(89)      [ALGB] (1) Real pipe2.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5)
(90)      [DISC] (1) Boolean $SEV_5
(91)      [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})
(92)      [ALGB] (4) input Real[2, 2] pipe2.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)      [ALGB] (2) protected Real[2] tank1.ports_emptyPipeHysteresis (min = {0.0 for $i1 in 1:2})
(94)      [ALGB] (1) Real tank1.Hb_flow
(95)      [DISC] (1) Boolean $TEV_0
(96)      [ALGB] (1) Real[1] pipe1.flowModel.dps_fg (start = {pipe1.flowModel.p_a_start - pipe1.flowModel.p_b_start for $i1 in 1:1})
(97)      [ALGB] (1) final Real[1] pipe1.flowModel.pathLengths = {pipe1.length}
(98)      [ALGB] (1) Real[1] ambient_fixed1.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})
(99)      [DISC] (2) Boolean[2] $SEV_12[$i1]
(100)     [ALGB] (1) final Real tank1.fluidVolume = tank1.fluidVolume
(101)     [ALGB] (1) Real[1] pipe1.flowModel.Res_turbulent_internal = pipe1.flowModel.Re_turbulent * {1.0 for $i1 in 1:1}
(102)     [ALGB] (2) Real[2] pipe1.flowModel.vs = {(-pipe1.port_b.m_flow) / (pipe1.flowModel.crossAreas[1] * Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe1.Medium.density(pipe1.flowModel.states[1])), -pipe1.port_b.m_flow / (Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe1.Medium.density(pipe1.flowModel.states[2]) * pipe1.flowModel.crossAreas[2])} / pipe1.nParallel
(103)     [ALGB] (2) Real[2] pipe1.flowModel.rhos = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe1.flowModel.Medium.density(pipe1.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})
(104)     [ALGB] (2) final Real[2] pipe2.flowModel.crossAreas = {pipe2.crossArea, pipe2.crossArea}
(105)     [ALGB] (1) stream Real pipe2.port_a.h_outflow (min = -1e10, max = 1e10, nominal = 1e6)
(106)     [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})
(107)     [ALGB] (1) stream Real pipe1.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6)
(108)     [ALGB] (1) protected Real pipe1.flowModel.dp_fric_nominal = sum({Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe1.flowModel.WallFriction.pressureLoss_m_flow(pipe1.flowModel.m_flow_nominal / pipe1.flowModel.nParallel, pipe1.flowModel.rho_nominal, pipe1.flowModel.rho_nominal, pipe1.flowModel.mu_nominal, pipe1.flowModel.mu_nominal, pipe1.flowModel.pathLengths_internal[1], pipe1.flowModel.diameters[1], ((pipe1.flowModel.crossAreas[2:2] + pipe1.flowModel.crossAreas[1:1]) / 2.0)[1], ((pipe1.flowModel.roughnesses[2:2] + pipe1.flowModel.roughnesses[1:1]) / 2.0)[1], pipe1.flowModel.m_flow_small / pipe1.flowModel.nParallel, pipe1.flowModel.Res_turbulent_internal[1])}) (min = 0.0, nominal = 1e5)
(109)     [ALGB] (1) final Real[1] pipe2.flowModel.dheights = {pipe2.height_ab}
(110)     [ALGB] (1) protected Real pipe2.flowModel.dp_fric_nominal = sum({Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe2.flowModel.WallFriction.pressureLoss_m_flow(pipe2.flowModel.m_flow_nominal / pipe2.flowModel.nParallel, pipe2.flowModel.rho_nominal, pipe2.flowModel.rho_nominal, pipe2.flowModel.mu_nominal, pipe2.flowModel.mu_nominal, pipe2.flowModel.pathLengths_internal[1], pipe2.flowModel.diameters[1], ((pipe2.flowModel.crossAreas[2:2] + pipe2.flowModel.crossAreas[1:1]) / 2.0)[1], ((pipe2.flowModel.roughnesses[2:2] + pipe2.flowModel.roughnesses[1:1]) / 2.0)[1], pipe2.flowModel.m_flow_small / pipe2.flowModel.nParallel, pipe2.flowModel.Res_turbulent_internal[1])}) (min = 0.0, nominal = 1e5)
(111)     [ALGB] (1) Real[1] pipe1.flowModel.pathLengths_internal = pipe1.flowModel.pathLengths
(112)     [ALGB] (1) Real[1] pipe2.flowModel.Res_turbulent_internal = pipe2.flowModel.Re_turbulent * {1.0 for $i1 in 1:1}


System Equations (111/149)
****************************
(1)       [ARRY] (1) pipe1.flowModel.Ib_flows = {0.0} ($RES_SIM_50)
(2)       [SCAL] (1) pipe1.flowModel.rhos_act[1] = noEvent(if $SEV_7 then pipe1.flowModel.rhos[1] else pipe1.flowModel.rhos[2]) ($RES_SIM_51)
(3)       [FOR-] (2) ($RES_BND_146)
(3)       [----] for $i1 in 1:2 loop
(3)       [----]   [SCAL] (1) pipe1.flowModel.mus[$i1] = 0.001 ($RES_BND_147)
(3)       [----] end for;
(4)       [SCAL] (1) pipe1.flowModel.mus_act[1] = noEvent(if $SEV_7 then pipe1.flowModel.mus[1] else pipe1.flowModel.mus[2]) ($RES_SIM_52)
(5)       [ARRY] (1) pipe1.flowModel.m_flows = {homotopy(({$FUN_4} .* pipe1.flowModel.nParallel)[1], (pipe1.flowModel.m_flow_nominal / pipe1.flowModel.dp_nominal * (pipe1.flowModel.dps_fg - (pipe1.flowModel.g * pipe1.flowModel.dheights) .* pipe1.flowModel.rho_nominal))[1])} ($RES_SIM_53)
(6)       [ARRY] (1) pipe1.flowModel.pathLengths_internal = pipe1.flowModel.pathLengths ($RES_BND_148)
(7)       [SCAL] (1) $DER.tank1.m = tank1.mb_flow ($RES_SIM_54)
(8)       [SCAL] (1) pipe1.flowModel.Res_turbulent_internal[1] = pipe1.flowModel.Re_turbulent ($RES_BND_149)
(9)       [SCAL] (1) tank1.medium.state.p = tank1.p_ambient ($RES_SIM_90)
(10)      [SCAL] (1) $DER.tank1.U = tank1.Qb_flow + tank1.Hb_flow ($RES_SIM_55)
(11)      [SCAL] (1) tank1.medium.state.T = -((-273.15) - tank1.medium.T_degC) ($RES_SIM_91)
(12)      [SCAL] (1) tank1.U = tank1.m * (4184.0 * ((-273.15) - ((-273.15) - tank1.medium.T_degC))) ($RES_SIM_56)
(13)      [SCAL] (1) tank1.m = 995.586 * tank1.fluidVolume ($RES_SIM_57)
(14)      [FOR-] (2) ($RES_SIM_58)
(14)      [----] for $i1 in 1:2 loop
(14)      [----]   [SCAL] (1) tank1.aboveLevel[$i1] = $SEV_11[$i1] ($RES_SIM_59)
(14)      [----] end for;
(15)      [SCAL] (1) ambient_fixed.ports[1].p = ambient_fixed.p ($RES_SIM_98)
(16)      [SCAL] (1) ambient_fixed.ports[1].h_outflow = 4184.0 * ((-273.15) + ambient_fixed.T) ($RES_SIM_99)
(17)      [SCAL] (1) $SEV_17 = tank1.m >= 0.0 ($RES_EVT_210)
(18)      [SCAL] (1) $SEV_18 = tank1.level <= tank1.height ($RES_EVT_211)
(19)      [SCAL] (1) $FUN_2 = sum(tank1.ports.m_flow) ($RES_$AUX_179)
(20)      [SCAL] (1) $FUN_3 = sum(tank1.port_b_H_flow_bottom) ($RES_$AUX_178)
(21)      [SCAL] (1) $FUN_4 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe1.flowModel.WallFriction.massFlowRate_dp_staticHead(pipe1.flowModel.dps_fg[1], pipe1.flowModel.rhos[1], pipe1.flowModel.rhos[2], pipe1.flowModel.mus[1], pipe1.flowModel.mus[2], pipe1.flowModel.pathLengths_internal[1], pipe1.flowModel.diameters[1], (pipe1.flowModel.g * pipe1.flowModel.dheights)[1], (0.5 .* (pipe1.flowModel.crossAreas[1:1] + pipe1.flowModel.crossAreas[2:2]))[1], (0.5 .* (pipe1.flowModel.roughnesses[1:1] + pipe1.flowModel.roughnesses[2:2]))[1], pipe1.flowModel.dp_small, pipe1.flowModel.Res_turbulent_internal[1]) ($RES_$AUX_177)
(22)      [SCAL] (1) $FUN_5 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe2.flowModel.WallFriction.massFlowRate_dp_staticHead(pipe2.flowModel.dps_fg[1], pipe2.flowModel.rhos[1], pipe2.flowModel.rhos[2], pipe2.flowModel.mus[1], pipe2.flowModel.mus[2], pipe2.flowModel.pathLengths_internal[1], pipe2.flowModel.diameters[1], (pipe2.flowModel.g * pipe2.flowModel.dheights)[1], (0.5 .* (pipe2.flowModel.crossAreas[1:1] + pipe2.flowModel.crossAreas[2:2]))[1], (0.5 .* (pipe2.flowModel.roughnesses[1:1] + pipe2.flowModel.roughnesses[2:2]))[1], pipe2.flowModel.dp_small, pipe2.flowModel.Res_turbulent_internal[1]) ($RES_$AUX_176)
(23)      [SCAL] (1) $FUN_6 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe2.flowModel.WallFriction.pressureLoss_m_flow(pipe2.flowModel.m_flow_nominal / pipe2.flowModel.nParallel, pipe2.flowModel.rho_nominal, pipe2.flowModel.rho_nominal, pipe2.flowModel.mu_nominal, pipe2.flowModel.mu_nominal, pipe2.flowModel.pathLengths_internal[1], pipe2.flowModel.diameters[1], (0.5 .* (pipe2.flowModel.crossAreas[2:2] + pipe2.flowModel.crossAreas[1:1]))[1], (0.5 .* (pipe2.flowModel.roughnesses[2:2] + pipe2.flowModel.roughnesses[1:1]))[1], pipe2.flowModel.m_flow_small / pipe2.flowModel.nParallel, pipe2.flowModel.Res_turbulent_internal[1]) ($RES_$AUX_175)
(24)      [ARRY] (1) pipe1.flowModel.diameters = 0.5 * (pipe1.flowModel.dimensions[2:2] + pipe1.flowModel.dimensions[1:1]) ($RES_BND_150)
(25)      [SCAL] (1) pipe2.flowModel.dp_fric_nominal = sum({$FUN_6}) ($RES_$AUX_174)
(26)      [SCAL] (1) $FUN_8 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe1.flowModel.WallFriction.pressureLoss_m_flow(pipe1.flowModel.m_flow_nominal / pipe1.flowModel.nParallel, pipe1.flowModel.rho_nominal, pipe1.flowModel.rho_nominal, pipe1.flowModel.mu_nominal, pipe1.flowModel.mu_nominal, pipe1.flowModel.pathLengths_internal[1], pipe1.flowModel.diameters[1], (0.5 .* (pipe1.flowModel.crossAreas[2:2] + pipe1.flowModel.crossAreas[1:1]))[1], (0.5 .* (pipe1.flowModel.roughnesses[2:2] + pipe1.flowModel.roughnesses[1:1]))[1], pipe1.flowModel.m_flow_small / pipe1.flowModel.nParallel, pipe1.flowModel.Res_turbulent_internal[1]) ($RES_$AUX_173)
(27)      [ARRY] (2) pipe2.flowModel.vs = {-(0.0010044335697769957 * pipe2.port_b.m_flow) / pipe2.flowModel.crossAreas[1], -(0.0010044335697769957 * pipe2.port_b.m_flow) / pipe2.flowModel.crossAreas[2]} / pipe2.nParallel ($RES_BND_152)
(28)      [SCAL] (1) pipe1.flowModel.dp_fric_nominal = sum({$FUN_8}) ($RES_$AUX_172)
(29)      [ARRY] (2) pipe2.flowModel.crossAreas = {pipe2.crossArea, pipe2.crossArea} ($RES_BND_153)
(30)      [SCAL] (1) $FUN_10 = sqrt(3.141592653589793 * tank1.crossArea) ($RES_$AUX_171)
(31)      [ARRY] (2) pipe2.flowModel.dimensions = {(4.0 * pipe2.crossArea) / pipe2.perimeter, (4.0 * pipe2.crossArea) / pipe2.perimeter} ($RES_BND_154)
(32)      [FOR-] (2) ($RES_SIM_60)
(32)      [----] for $i1 in 1:2 loop
(32)      [----]   [SCAL] (1) tank1.levelAbovePort[$i1] = if tank1.aboveLevel[$i1] then tank1.level - tank1.portsData_height2[$i1] else 0.0 ($RES_SIM_61)
(32)      [----] end for;
(33)      [ARRY] (2) pipe2.flowModel.roughnesses = {pipe2.roughness, pipe2.roughness} ($RES_BND_155)
(34)      [ARRY] (1) pipe2.flowModel.dheights = {pipe2.height_ab} ($RES_BND_156)
(35)      [FOR-] (2) ($RES_SIM_62)
(35)      [----] for $i1 in 1:2 loop
(35)      [----]   [SCAL] (1) tank1.ports[$i1].h_outflow = 4184.0 * ((-273.15) - ((-273.15) - tank1.medium.T_degC)) ($RES_SIM_63)
(35)      [----] end for;
(36)      [ARRY] (1) pipe2.flowModel.pathLengths = {pipe2.length} ($RES_BND_157)
(37)      [FOR-] (2) ($RES_BND_158)
(37)      [----] for $i1 in 1:2 loop
(37)      [----]   [SCAL] (1) pipe2.flowModel.rhos[$i1] = 995.586 ($RES_BND_159)
(37)      [----] end for;
(38)      [FOR-] (2) ($RES_SIM_64)
(38)      [----] for $i1 in 1:2 loop
(38)      [----]   [SCAL] (1) tank1.zetas_out[$i1] = 1.0 + (if tank1.aboveLevel[$i1] then 0.0 else tank1.zetaLarge) ($RES_SIM_65)
(38)      [----] end for;
(39)      [SCAL] (1) pipe2.port_a.h_outflow = tank1.ports[2].h_outflow + system.g * pipe2.height_ab ($RES_SIM_29)
(40)      [FOR-] (2) ($RES_SIM_66)
(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_12[$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_13[$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_14[$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_67)
(40)      [----] end for;
(41)      [SCAL] (1) $TEV_0 = $PRE.tank1.aboveLevel[$i1] ($RES_EVT_184)
(42)      [FOR-] (2) ($RES_EVT_185)
(42)      [----] for $i1 in 1:2 loop
(42)      [----]   [SCAL] (1) $SEV_0[$i1] = tank1.level_start >= tank1.portsData_height2[$i1] ($RES_EVT_186)
(42)      [----] end for;
(43)      [FOR-] (2) ($RES_BND_160)
(43)      [----] for $i1 in 1:2 loop
(43)      [----]   [SCAL] (1) pipe2.flowModel.mus[$i1] = 0.001 ($RES_BND_161)
(43)      [----] end for;
(44)      [SCAL] (1) pipe2.port_b.h_outflow = ambient_fixed1.ports[1].h_outflow - system.g * pipe2.height_ab ($RES_SIM_30)
(45)      [ARRY] (1) pipe2.flowModel.pathLengths_internal = pipe2.flowModel.pathLengths ($RES_BND_162)
(46)      [SCAL] (1) -pipe2.port_b.m_flow = pipe2.flowModel.m_flows[1] ($RES_SIM_32)
(47)      [SCAL] (1) pipe2.flowModel.Res_turbulent_internal[1] = pipe2.flowModel.Re_turbulent ($RES_BND_163)
(48)      [ARRY] (1) {0.0} = pipe2.flowModel.Ib_flows - (pipe2.flowModel.Fs_fg + pipe2.flowModel.Fs_p) ($RES_SIM_33)
(49)      [ARRY] (1) pipe2.flowModel.diameters = 0.5 * (pipe2.flowModel.dimensions[2:2] + pipe2.flowModel.dimensions[1:1]) ($RES_BND_164)
(50)      [ARRY] (1) pipe2.flowModel.Is = {pipe2.flowModel.m_flows[1] * pipe2.flowModel.pathLengths[1]} ($RES_SIM_34)
(51)      [SCAL] (1) tank1.port_b_H_flow_bottom[2] = smooth(0, tank1.ports[2].m_flow * (if $SEV_15 then pipe2.port_b.h_outflow else tank1.ports[2].h_outflow)) ($RES_SIM_70)
(52)      [ARRY] (1) pipe2.flowModel.dps_fg = {(2.0 * (pipe2.flowModel.Fs_fg[1] / pipe2.flowModel.nParallel)) / (pipe2.flowModel.crossAreas[1] + pipe2.flowModel.crossAreas[2])} ($RES_SIM_35)
(53)      [SCAL] (1) tank1.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_118)
(54)      [SCAL] (1) tank1.port_b_H_flow_bottom[1] = smooth(0, tank1.ports[1].m_flow * (if $SEV_16 then pipe1.port_b.h_outflow else tank1.ports[1].h_outflow)) ($RES_SIM_71)
(55)      [ARRY] (1) pipe2.flowModel.Fs_p = pipe2.flowModel.nParallel * {0.5 * (pipe2.flowModel.crossAreas[1] + pipe2.flowModel.crossAreas[2]) * (pipe2.flowModel.states.T - pipe2.flowModel.states.T)} ($RES_SIM_36)
(56)      [SCAL] (1) pipe2.port_b.m_flow + tank1.ports[2].m_flow = 0.0 ($RES_SIM_119)
(57)      [ARRY] (1) pipe2.flowModel.Ib_flows = {0.0} ($RES_SIM_37)
(58)      [SCAL] (1) tank1.Qb_flow = tank1.heatTransfer.Q_flows[1] ($RES_SIM_73)
(59)      [SCAL] (1) pipe2.flowModel.rhos_act[1] = noEvent(if $SEV_5 then pipe2.flowModel.rhos[1] else pipe2.flowModel.rhos[2]) ($RES_SIM_38)
(60)      [ARRY] (2) tank1.heatTransfer.states = {tank1.medium.state} ($RES_BND_168)
(61)      [SCAL] (1) tank1.Hb_flow = $FUN_3 ($RES_SIM_74)
(62)      [SCAL] (1) pipe2.flowModel.mus_act[1] = noEvent(if $SEV_5 then pipe2.flowModel.mus[1] else pipe2.flowModel.mus[2]) ($RES_SIM_39)
(63)      [ARRY] (4) pipe1.flowModel.states = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe1.Medium.ThermodynamicState(pipe1.port_a.p, 273.15 + 2.390057361376673e-4 * ambient_fixed.ports[1].h_outflow), Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe1.Medium.ThermodynamicState(pipe1.port_b.p, 273.15 + 2.390057361376673e-4 * tank1.ports[1].h_outflow)} ($RES_BND_169)
(64)      [SCAL] (1) tank1.mb_flow = $FUN_2 ($RES_SIM_75)
(65)      [SCAL] (1) tank1.fluidVolume = tank1.crossArea * tank1.level + tank1.V0 ($RES_SIM_76)
(66)      [FOR-] (2) ($RES_SIM_78)
(66)      [----] for $i1 in 1:2 loop
(66)      [----]   [SCAL] (1) tank1.bottomArea[$i1] = 3.141592653589793 * (tank1.portsData_diameter2[$i1] / 2.0) ^ 2.0 ($RES_SIM_79)
(66)      [----] end for;
(67)      [SCAL] (1) $SEV_5 = pipe2.flowModel.m_flows[1] > 0.0 ($RES_EVT_191)
(68)      [SCAL] (1) $SEV_7 = pipe1.flowModel.m_flows[1] > 0.0 ($RES_EVT_193)
(69)      [FOR-] (2) ($RES_EVT_194)
(69)      [----] for $i1 in 1:2 loop
(69)      [----]   [SCAL] (1) $SEV_8[$i1] = tank1.level >= (tank1.portsData_height2[$i1] + tank1.ports_emptyPipeHysteresis[$i1]) ($RES_EVT_195)
(69)      [----] end for;
(70)      [FOR-] (2) ($RES_EVT_196)
(70)      [----] for $i1 in 1:2 loop
(70)      [----]   [SCAL] (1) $SEV_9[$i1] = tank1.level >= (tank1.portsData_height2[$i1] - tank1.ports_emptyPipeHysteresis[$i1]) ($RES_EVT_197)
(70)      [----] end for;
(71)      [FOR-] (2) ($RES_EVT_198)
(71)      [----] for $i1 in 1:2 loop
(71)      [----]   [SCAL] (1) $SEV_10[$i1] = $TEV_0 and $SEV_9[$i1] ($RES_EVT_199)
(71)      [----] end for;
(72)      [SCAL] (1) pipe1.port_b.m_flow + tank1.ports[1].m_flow = 0.0 ($RES_SIM_120)
(73)      [SCAL] (1) ambient_fixed1.ports[1].m_flow - pipe2.port_b.m_flow = 0.0 ($RES_SIM_121)
(74)      [ARRY] (1) tank1.heatTransfer.surfaceAreas = {2.0 * $FUN_10 * tank1.level + tank1.crossArea} ($RES_BND_134)
(75)      [ARRY] (1) pipe2.flowModel.m_flows = {homotopy(({$FUN_5} .* pipe2.flowModel.nParallel)[1], (pipe2.flowModel.m_flow_nominal / pipe2.flowModel.dp_nominal * (pipe2.flowModel.dps_fg - (pipe2.flowModel.g * pipe2.flowModel.dheights) .* pipe2.flowModel.rho_nominal))[1])} ($RES_SIM_40)
(76)      [SCAL] (1) ambient_fixed1.ports[1].p = pipe2.port_a.p ($RES_SIM_122)
(77)      [ARRY] (1) tank1.heatTransfer.Ts = {tank1.heatTransfer.states.p} ($RES_BND_135)
(78)      [ARRY] (4) pipe2.flowModel.states = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe2.Medium.ThermodynamicState(pipe2.port_a.p, 273.15 + 2.390057361376673e-4 * ambient_fixed1.ports[1].h_outflow), Modelica.Fluid.Examples.AST_BatchPlant.Test.TankWithEmptyingPipe2.pipe2.Medium.ThermodynamicState(pipe2.port_b.p, 273.15 + 2.390057361376673e-4 * tank1.ports[2].h_outflow)} ($RES_BND_170)
(79)      [SCAL] (1) tank1.ports[2].p = pipe2.port_b.p ($RES_SIM_123)
(80)      [ARRY] (2) tank1.portsData_diameter = tank1.portsData.diameter ($RES_BND_136)
(81)      [SCAL] (1) pipe1.port_a.h_outflow = tank1.ports[1].h_outflow + system.g * pipe1.height_ab ($RES_SIM_42)
(82)      [SCAL] (1) ambient_fixed.ports[1].m_flow - pipe1.port_b.m_flow = 0.0 ($RES_SIM_124)
(83)      [ARRY] (2) tank1.portsData_height = tank1.portsData.height ($RES_BND_137)
(84)      [SCAL] (1) pipe1.port_b.h_outflow = ambient_fixed.ports[1].h_outflow - system.g * pipe1.height_ab ($RES_SIM_43)
(85)      [SCAL] (1) ambient_fixed.ports[1].p = pipe1.port_a.p ($RES_SIM_125)
(86)      [ARRY] (2) pipe1.flowModel.vs = {-(0.0010044335697769957 * pipe1.port_b.m_flow) / pipe1.flowModel.crossAreas[1], -(0.0010044335697769957 * pipe1.port_b.m_flow) / pipe1.flowModel.crossAreas[2]} / pipe1.nParallel ($RES_BND_138)
(87)      [SCAL] (1) tank1.ports[1].p = pipe1.port_b.p ($RES_SIM_126)
(88)      [ARRY] (2) pipe1.flowModel.crossAreas = {pipe1.crossArea, pipe1.crossArea} ($RES_BND_139)
(89)      [FOR-] (2) ($RES_SIM_80)
(89)      [----] for $i1 in 1:2 loop
(89)      [----]   [SCAL] (1) tank1.ports_emptyPipeHysteresis[$i1] = tank1.portsData_diameter2[$i1] * tank1.hysteresisFactor ($RES_SIM_81)
(89)      [----] end for;
(90)      [SCAL] (1) -pipe1.port_b.m_flow = pipe1.flowModel.m_flows[1] ($RES_SIM_45)
(91)      [ARRY] (2) tank1.portsData_height = tank1.portsData_height2 ($RES_SIM_127)
(92)      [ARRY] (1) {0.0} = pipe1.flowModel.Ib_flows - (pipe1.flowModel.Fs_fg + pipe1.flowModel.Fs_p) ($RES_SIM_46)
(93)      [ARRY] (2) tank1.portsData_diameter = tank1.portsData_diameter2 ($RES_SIM_128)
(94)      [ARRY] (1) pipe1.flowModel.Is = {pipe1.flowModel.m_flows[1] * pipe1.flowModel.pathLengths[1]} ($RES_SIM_47)
(95)      [ARRY] (1) pipe1.flowModel.dps_fg = {(2.0 * (pipe1.flowModel.Fs_fg[1] / pipe1.flowModel.nParallel)) / (pipe1.flowModel.crossAreas[1] + pipe1.flowModel.crossAreas[2])} ($RES_SIM_48)
(96)      [ARRY] (1) tank1.heatTransfer.Q_flows = tank1.heatTransfer.heatPorts.Q_flow ($RES_SIM_84)
(97)      [ARRY] (1) pipe1.flowModel.Fs_p = pipe1.flowModel.nParallel * {0.5 * (pipe1.flowModel.crossAreas[1] + pipe1.flowModel.crossAreas[2]) * (pipe1.flowModel.states.T - pipe1.flowModel.states.T)} ($RES_SIM_49)
(98)      [ARRY] (1) tank1.heatTransfer.Ts = tank1.heatTransfer.heatPorts.T ($RES_SIM_85)
(99)      [FOR-] (2) ($RES_EVT_200)
(99)      [----] for $i1 in 1:2 loop
(99)      [----]   [SCAL] (1) $SEV_11[$i1] = $SEV_8[$i1] or $SEV_10[$i1] ($RES_EVT_201)
(99)      [----] end for;
(100)     [FOR-] (2) ($RES_EVT_202)
(100)     [----] for $i1 in 1:2 loop
(100)     [----]   [SCAL] (1) $SEV_12[$i1] = tank1.ports[$i1].m_flow >= tank1.m_flow_small ($RES_EVT_203)
(100)     [----] end for;
(101)     [SCAL] (1) ambient_fixed1.ports[1].h_outflow = 4184.0 * ((-273.15) + ambient_fixed1.T) ($RES_SIM_9)
(102)     [FOR-] (2) ($RES_EVT_204)
(102)     [----] for $i1 in 1:2 loop
(102)     [----]   [SCAL] (1) $SEV_13[$i1] = tank1.ports[$i1].m_flow <= (-tank1.m_flow_small) ($RES_EVT_205)
(102)     [----] end for;
(103)     [SCAL] (1) ambient_fixed1.ports[1].p = ambient_fixed1.p ($RES_SIM_8)
(104)     [FOR-] (2) ($RES_EVT_206)
(104)     [----] for $i1 in 1:2 loop
(104)     [----]   [SCAL] (1) $SEV_14[$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_207)
(104)     [----] end for;
(105)     [SCAL] (1) $SEV_15 = tank1.ports[2].m_flow > 0.0 ($RES_EVT_208)
(106)     [SCAL] (1) $SEV_16 = tank1.ports[1].m_flow > 0.0 ($RES_EVT_209)
(107)     [ARRY] (2) pipe1.flowModel.dimensions = {(4.0 * pipe1.crossArea) / pipe1.perimeter, (4.0 * pipe1.crossArea) / pipe1.perimeter} ($RES_BND_140)
(108)     [ARRY] (2) pipe1.flowModel.roughnesses = {pipe1.roughness, pipe1.roughness} ($RES_BND_141)
(109)     [ARRY] (1) pipe1.flowModel.dheights = {pipe1.height_ab} ($RES_BND_142)
(110)     [ARRY] (1) pipe1.flowModel.pathLengths = {pipe1.length} ($RES_BND_143)
(111)     [FOR-] (2) ($RES_BND_144)
(111)     [----] for $i1 in 1:2 loop
(111)     [----]   [SCAL] (1) pipe1.flowModel.rhos[$i1] = 995.586 ($RES_BND_145)
(111)     [----] end for;