Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr Modelica_3.2.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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.TanksWithEmptyingPipe2,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.2.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2") translateModel(Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.2.1_Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001216/0.001216, allocations: 108 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.001223/0.001223, allocations: 190 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.269/1.269, allocations: 205.1 MB / 223.2 MB, free: 12.25 MB / 190.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 1.49e-05/1.49e-05, allocations: 2.281 kB / 327.2 MB, free: 3.336 MB / 270.1 MB Notification: Performance of NFInst.instantiate(Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2): time 0.03134/0.03136, allocations: 36.77 MB / 364 MB, free: 14.43 MB / 318.1 MB Notification: Performance of NFInst.instExpressions: time 0.176/0.2074, allocations: 15.13 MB / 379.1 MB, free: 9.785 MB / 318.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.002473/0.21, allocations: 47.72 kB / 379.1 MB, free: 9.785 MB / 318.1 MB Notification: Performance of NFTyping.typeComponents: time 0.001651/0.2116, allocations: 0.6899 MB / 379.8 MB, free: 9.785 MB / 318.1 MB Notification: Performance of NFTyping.typeBindings: time 0.006639/0.2183, allocations: 2.515 MB / 382.3 MB, free: 9.734 MB / 318.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.009349/0.2276, allocations: 3.764 MB / 386.1 MB, free: 9.621 MB / 318.1 MB Notification: Performance of NFFlatten.flatten: time 0.007662/0.2353, allocations: 4.905 MB / 391 MB, free: 9.551 MB / 318.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.001982/0.2373, allocations: 1.249 MB / 392.3 MB, free: 9.434 MB / 318.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.003563/0.2409, allocations: 1.968 MB / 394.2 MB, free: 9.363 MB / 318.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.001953/0.2428, allocations: 1.664 MB / 395.9 MB, free: 9.168 MB / 318.1 MB Notification: Performance of NFPackage.collectConstants: time 0.0002398/0.2431, allocations: 162.7 kB / 396 MB, free: 9.168 MB / 318.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.004635/0.2477, allocations: 2.428 MB / 398.5 MB, free: 9.141 MB / 318.1 MB Notification: Performance of combineBinaries: time 0.002/0.2497, allocations: 3.433 MB / 401.9 MB, free: 7.691 MB / 318.1 MB Notification: Performance of replaceArrayConstructors: time 0.001016/0.2508, allocations: 2.056 MB / 404 MB, free: 6.457 MB / 318.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0004135/0.2512, allocations: 287.2 kB / 404.2 MB, free: 6.402 MB / 318.1 MB Notification: Performance of FrontEnd: time 0.0002271/0.2514, allocations: 45.5 kB / 404.3 MB, free: 6.391 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: 315 (247) * Number of variables: 327 (249) Notification: Performance of Bindings: time 0.00629/0.2577, allocations: 8.95 MB / 413.2 MB, free: 1.719 MB / 318.1 MB Notification: Performance of FunctionAlias: time 0.0009052/0.2586, allocations: 1.255 MB / 414.5 MB, free: 0.5977 MB / 318.1 MB Notification: Performance of Early Inline: time 0.005101/0.2638, allocations: 5.412 MB / 419.9 MB, free: 11.23 MB / 334.1 MB Notification: Performance of simplify1: time 0.0004223/0.2642, allocations: 369.3 kB / 420.3 MB, free: 10.89 MB / 334.1 MB Notification: Performance of Alias: time 0.00477/0.269, allocations: 4.434 MB / 424.7 MB, free: 6.164 MB / 334.1 MB Notification: Performance of simplify2: time 0.0003732/0.2693, allocations: 334.2 kB / 425 MB, free: 5.852 MB / 334.1 MB Notification: Performance of Events: time 0.00149/0.2708, allocations: 1.425 MB / 426.5 MB, free: 4.398 MB / 334.1 MB Notification: Performance of Detect States: time 0.001317/0.2722, allocations: 1.339 MB / 427.8 MB, free: 3.062 MB / 334.1 MB Notification: Performance of Partitioning: time 0.001978/0.2742, allocations: 1.843 MB / 429.6 MB, free: 1.047 MB / 334.1 MB Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (252/351) **************************** (1) [DISC] (1) Boolean $SEV_29 (2) [DISC] (1) Boolean $SEV_28 (3) [DISC] (1) Boolean $SEV_27 (4) [DISC] (1) Boolean $SEV_26 (5) [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}) (6) [DISC] (1) Boolean $SEV_25 (7) [DISC] (1) Boolean $SEV_24 (8) [ALGB] (2) protected Real[2] tank3.portsData_height2 (9) [DISC] (1) Boolean $SEV_20 (10) [ALGB] (1) Real valveDiscrete.port_b_T = Modelica.Fluid.Utilities.regStep(-995.586 * valveDiscrete.V_flow, Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.valveDiscrete.Medium.temperature(valveDiscrete.state_b), Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.valveDiscrete.Medium.temperature(Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.valveDiscrete.Medium.setState_phX(valveDiscrete.port_b.p, valveDiscrete.port_b.h_outflow, {})), valveDiscrete.m_flow_small) (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (11) [ALGB] (1) Real pipe2.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (12) [DISC] (1) Boolean $TEV_2 (13) [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}) (14) [DISC] (1) Boolean $TEV_1 (15) [DISC] (1) Boolean $TEV_0 (16) [ALGB] (3) Real[3] tank2.port_b_H_flow_bottom (min = {-1e8 for $i1 in 1:3}, max = {1e8 for $i1 in 1:3}, nominal = {1000.0 for $i1 in 1:3}) (17) [ALGB] (1) Real tank3.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (18) [ALGB] (1) Real[1] pipe2.flowModel.Fs_p (19) [ALGB] (1) protected Real valveDiscrete.state_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (20) [ALGB] (1) Real[1] pipe3.flowModel.Res_turbulent_internal = pipe3.flowModel.Re_turbulent * {1.0 for $i1 in 1:1} (21) [ALGB] (2) Real[2] pipe1.flowModel.mus = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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}) (22) [ALGB] (2) Real[2] pipe3.flowModel.mus = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe3.flowModel.Medium.dynamicViscosity(pipe3.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}) (23) [DISC] (1) Boolean $SEV_19 (24) [DISC] (2) Boolean[2] $SEV_36[$i1] (25) [DISC] (1) Boolean $SEV_18 (26) [ALGB] (2) final Real[2] pipe2.flowModel.roughnesses = {pipe2.roughness, pipe2.roughness} (min = {0.0 for $i1 in 1:2}) (27) [ALGB] (1) Real[1] pipe3.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) (28) [DISC] (1) Boolean $SEV_17 (29) [ALGB] (2) protected Real[2] tank3.portsData_diameter2 (30) [DISC] (1) Boolean $SEV_16 (31) [ALGB] (3) protected Real[3] tank2.ports_emptyPipeHysteresis (min = {0.0 for $i1 in 1:3}) (32) [ALGB] (3) protected Real[3] tank2.levelAbovePort (33) [ALGB] (1) Real tank2.level (start = tank2.level_start, StateSelect = prefer) (34) [DISC] (3) Boolean[3] $SEV_14[$i1] (35) [ALGB] (1) protected Real[1] tank1.portsData_diameter2 (36) [ALGB] (1) Real[1] pipe3.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}) (37) [ALGB] (1) Real[1] tank1.heatTransfer.surfaceAreas = {sqrt(3.141592653589793 * tank1.crossArea) * 2.0 * tank1.level + tank1.crossArea} (38) [ALGB] (2) Real[2] pipe2.flowModel.rhos = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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}) (39) [ALGB] (1) Real pipe3.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (40) [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}) (41) [ALGB] (1) Real[1] pipe3.flowModel.Ib_flows (42) [ALGB] (1) Real[1] pipe1.flowModel.pathLengths_internal = pipe1.flowModel.pathLengths (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 tank3.medium.state.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (45) [ALGB] (1) final Real tank3.fluidVolume = tank3.fluidVolume (46) [ALGB] (1) Real tank2.medium.state.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (47) [DISC] (1) protected Boolean[1] tank1.aboveLevel (48) [ALGB] (1) protected Real valveDiscrete.state_b.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (49) [ALGB] (3) protected Real[3] tank2.portsData_diameter2 (50) [ALGB] (1) Real tank2.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - tank2.medium.T_degC)) (51) [ALGB] (1) Real tank1.mb_flow (52) [ALGB] (2) protected Real[2] tank3.ports_emptyPipeHysteresis (min = {0.0 for $i1 in 1:2}) (53) [DISC] (3) Boolean[3] $SEV_0[$i1] (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) [ALGB] (1) Real tank3.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - tank3.medium.T_degC)) (56) [ALGB] (1) Real tank1.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - tank1.medium.T_degC)) (57) [ALGB] (1) flow Real[1] tank3.heatTransfer.heatPorts.Q_flow (58) [ALGB] (2) final Real[2] pipe3.flowModel.dimensions = {(4.0 * pipe3.crossArea) / pipe3.perimeter, (4.0 * pipe3.crossArea) / pipe3.perimeter} (59) [ALGB] (4) input Real[2, 2] pipe3.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}) (60) [ALGB] (1) flow Real[1] tank3.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}) (61) [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}) (62) [ALGB] (1) flow Real[1] tank2.heatTransfer.heatPorts.Q_flow (63) [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}) (64) [ALGB] (1) stream Real pipe1.port_a.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (65) [ALGB] (3) protected Real[3] tank2.bottomArea (66) [ALGB] (1) Real[1] pipe1.flowModel.Fs_fg (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) [ALGB] (1) Real[1] pipe1.flowModel.Res_turbulent_internal = pipe1.flowModel.Re_turbulent * {1.0 for $i1 in 1:1} (69) [ALGB] (1) Real $FUN_9 (70) [ALGB] (1) final Real tank1.fluidVolume = tank1.fluidVolume (71) [ALGB] (1) Real $FUN_8 (72) [ALGB] (1) Real tank2.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (73) [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}) (74) [ALGB] (1) Real $FUN_7 (75) [ALGB] (1) Real $FUN_6 (76) [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}) (77) [ALGB] (1) Real $FUN_4 (78) [ALGB] (1) protected Real valveDiscrete.state_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (79) [ALGB] (1) Real $FUN_3 (80) [ALGB] (3) protected Real[3] tank2.portsData_diameter = tank2.portsData.diameter (81) [ALGB] (1) Real $FUN_2 (82) [DISC] (2) Boolean[2] $SEV_35[$i1] (83) [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}) (84) [ALGB] (1) Real tank3.level (start = tank3.level_start, StateSelect = prefer) (85) [ALGB] (1) Real $FUN_1 (86) [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) (87) [ALGB] (1) final Real[1] pipe1.flowModel.dheights = {pipe1.height_ab} (88) [ALGB] (1) stream Real pipe1.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (89) [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) (90) [ALGB] (2) protected Real[2] tank3.portsData_diameter = tank3.portsData.diameter (91) [ALGB] (1) Real $FUN_21 (92) [ALGB] (1) Real tank2.mb_flow (93) [ALGB] (1) Real $FUN_20 (94) [ALGB] (2) Real[2] pipe2.flowModel.mus = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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}) (95) [DISC] (3) Boolean[3] $SEV_13[$i1] (96) [ALGB] (4) input Real[2, 2] pipe3.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}) (97) [DISC] (3) Boolean[3] $SEV_9[$i1] (98) [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}) (99) [ALGB] (1) Real[1] pipe2.flowModel.pathLengths_internal = pipe2.flowModel.pathLengths (100) [ALGB] (1) Real[1] tank2.heatTransfer.Q_flows (101) [ALGB] (1) Real valveDiscrete.dp (start = valveDiscrete.dp_start) (102) [DER-] (1) Real $DER.tank1.U (103) [ALGB] (1) Real[1] pipe2.flowModel.Ib_flows (104) [ALGB] (1) Real[1] pipe3.flowModel.dps_fg (start = {pipe3.flowModel.p_a_start - pipe3.flowModel.p_b_start for $i1 in 1:1}) (105) [ALGB] (3) Real[3] tank2.ports.p (start = {1e5 for $i1 in 1:3}, min = {0.0 for $i1 in 1:3}, max = {1e8 for $i1 in 1:3}, nominal = {1e5 for $i1 in 1:3}) (106) [ALGB] (3) stream Real[3] tank2.ports.h_outflow (min = {-1e10 for $i1 in 1:3}, max = {1e10 for $i1 in 1:3}, nominal = {1e6 for $i1 in 1:3}) (107) [ALGB] (1) Real tank1.Hb_flow (108) [ALGB] (1) Real pipe3.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (109) [ALGB] (3) protected Real[3] tank2.portsData_height2 (110) [ALGB] (1) protected Real[1] tank1.portsData_height = tank1.portsData.height (111) [ALGB] (2) final Real[2] pipe3.flowModel.roughnesses = {pipe3.roughness, pipe3.roughness} (min = {0.0 for $i1 in 1:2}) (112) [ALGB] (1) Real $FUN_19 (113) [ALGB] (1) Real pipe1.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (114) [ALGB] (1) Real $FUN_17 (115) [ALGB] (1) protected Real[1] pipe3.flowModel.diameters = 0.5 * (pipe3.flowModel.dimensions[2:2] + pipe3.flowModel.dimensions[1:1]) (116) [ALGB] (1) Real[1] tank3.heatTransfer.Ts = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.tank3.heatTransfer.Medium.temperature(tank3.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}) (117) [ALGB] (1) Real $FUN_15 (118) [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}) (119) [ALGB] (2) final Real[2] pipe1.flowModel.dimensions = {(4.0 * pipe1.crossArea) / pipe1.perimeter, (4.0 * pipe1.crossArea) / pipe1.perimeter} (120) [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}) (121) [ALGB] (1) Real $FUN_13 (122) [ALGB] (1) Real $FUN_12 (123) [ALGB] (2) final Real[2] pipe3.flowModel.crossAreas = {pipe3.crossArea, pipe3.crossArea} (124) [ALGB] (1) Real[1] pipe3.flowModel.pathLengths_internal = pipe3.flowModel.pathLengths (125) [ALGB] (1) Real $FUN_11 (126) [ALGB] (1) final input Real[1, 1] tank3.heatTransfer.states.p = {tank3.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}) (127) [ALGB] (1) Real $FUN_10 (128) [ALGB] (1) Real tank3.mb_flow (129) [DER-] (1) Real $DER.tank1.m (130) [ALGB] (1) stream Real valveDiscrete.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (131) [DISC] (2) Boolean[2] $SEV_39[$i1] (132) [ALGB] (1) Real[1] tank3.heatTransfer.surfaceAreas = {sqrt(3.141592653589793 * tank3.crossArea) * 2.0 * tank3.level + tank3.crossArea} (133) [DISC] (1) Boolean $SEV_8 (134) [ALGB] (1) Real[1] pipe1.flowModel.Fs_p (135) [ALGB] (1) Real[1] pipe2.flowModel.Fs_fg (136) [DISC] (1) Boolean $SEV_6 (137) [ALGB] (1) Real[1] tank3.heatTransfer.Q_flows (138) [DISC] (1) Boolean $SEV_4 (139) [ALGB] (1) protected Real[1] tank1.ports_emptyPipeHysteresis (min = {0.0 for $i1 in 1:1}) (140) [ALGB] (2) Real[2] tank3.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}) (141) [ALGB] (3) protected Real[3] tank2.portsData_height = tank2.portsData.height (142) [DISC] (2) Boolean[2] $SEV_34[$i1] (143) [DISC] (1) Boolean $SEV_1 (144) [ALGB] (2) Real[2] tank3.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}) (145) [ALGB] (1) protected Real pipe2.flowModel.dp_fric_nominal = sum({Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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) (146) [ALGB] (1) protected Real[1] tank1.portsData_diameter = tank1.portsData.diameter (147) [ALGB] (1) Real[1] tank1.heatTransfer.Ts = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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}) (148) [ALGB] (1) Real tank2.Hb_flow (149) [ALGB] (2) protected Real[2] tank3.portsData_height = tank3.portsData.height (150) [DISC] (2) Boolean[2] $SEV_40[$i1] (151) [DISC] (3) Boolean[3] $SEV_12[$i1] (152) [ALGB] (1) stream Real[1] tank3.topPorts.h_outflow (min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (153) [ALGB] (2) protected Real[2] tank3.levelAbovePort (154) [ALGB] (1) stream Real valveDiscrete.port_a.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (155) [ALGB] (1) Real[1] pipe1.flowModel.Is (156) [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}) (157) [ALGB] (1) Real[1] pipe2.flowModel.Is (158) [ALGB] (1) Real[1] pipe2.flowModel.dps_fg (start = {pipe2.flowModel.p_a_start - pipe2.flowModel.p_b_start for $i1 in 1:1}) (159) [ALGB] (1) Real[1] pipe3.flowModel.Is (160) [ALGB] (1) final input Real[1, 1] tank3.heatTransfer.states.T = {tank3.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}) (161) [DISC] (2) protected Boolean[2] tank3.aboveLevel (162) [ALGB] (1) Real[1] pipe1.flowModel.dps_fg (start = {pipe1.flowModel.p_a_start - pipe1.flowModel.p_b_start for $i1 in 1:1}) (163) [ALGB] (1) protected Real[1] tank1.bottomArea (164) [ALGB] (1) final Real[1] pipe3.flowModel.pathLengths = {pipe3.length} (165) [ALGB] (2) Real[2] pipe1.flowModel.rhos = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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}) (166) [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}) (167) [DISC] (1) Boolean $SEV_56 (168) [DISC] (1) Boolean $SEV_55 (169) [ALGB] (2) final Real[2] pipe2.flowModel.crossAreas = {pipe2.crossArea, pipe2.crossArea} (170) [DISC] (1) Boolean $SEV_54 (171) [ALGB] (1) Real valveDiscrete.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (172) [ALGB] (1) stream Real pipe2.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (173) [DISC] (1) Boolean $SEV_53 (174) [ALGB] (1) Real tank1.medium.state.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (175) [DISC] (1) Boolean $SEV_52 (176) [DER-] (1) Real $DER.tank2.U (177) [ALGB] (1) stream Real pipe3.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (178) [ALGB] (1) Real tank1.Qb_flow (179) [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}) (180) [ALGB] (1) Real tank3.Hb_flow (181) [ALGB] (1) Real pipe1.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (182) [ALGB] (1) final Real[1] pipe3.flowModel.dheights = {pipe3.height_ab} (183) [ALGB] (2) final Real[2] pipe1.flowModel.crossAreas = {pipe1.crossArea, pipe1.crossArea} (184) [ALGB] (1) stream Real pipe2.port_a.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (185) [ALGB] (1) flow Real pipe2.port_b.m_flow (min = -1e5, max = 1e60) (186) [DISC] (2) Boolean[2] $SEV_38[$i1] (187) [ALGB] (1) Real[1] tank1.heatTransfer.Q_flows (188) [ALGB] (1) stream Real pipe3.port_a.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (189) [ALGB] (1) Real[1] pipe3.flowModel.Fs_fg (190) [ALGB] (2) Real[2] pipe3.flowModel.rhos = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe3.flowModel.Medium.density(pipe3.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}) (191) [ALGB] (2) final Real[2] pipe1.flowModel.roughnesses = {pipe1.roughness, pipe1.roughness} (min = {0.0 for $i1 in 1:2}) (192) [DER-] (1) Real $DER.tank2.m (193) [ALGB] (1) Real tank1.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (194) [ALGB] (1) Real[1] tank3.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}) (195) [ALGB] (1) flow Real pipe1.port_b.m_flow (min = -1e5, max = 1e60) (196) [ALGB] (1) protected Real[1] tank1.levelAbovePort (197) [ALGB] (1) flow Real pipe3.port_b.m_flow (min = -1e5, max = 1e60) (198) [DISC] (1) Boolean $SEV_45 (199) [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}) (200) [DISC] (1) Boolean $SEV_44 (201) [DISC] (1) Boolean $SEV_43 (202) [DISC] (1) Boolean $SEV_42 (203) [DISC] (1) Boolean $SEV_41 (204) [DISC] (3) Boolean[3] $SEV_11[$i1] (205) [ALGB] (1) Real[1] tank2.heatTransfer.Ts = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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}) (206) [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}) (207) [ALGB] (1) Real[1] tank3.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}) (208) [ALGB] (1) Real[1] pipe3.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}) (209) [ALGB] (2) Real[2] pipe1.flowModel.vs = {(-pipe1.port_b.m_flow) / (pipe1.flowModel.crossAreas[1] * Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe1.Medium.density(pipe1.flowModel.states[1])), -pipe1.port_b.m_flow / (Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe1.Medium.density(pipe1.flowModel.states[2]) * pipe1.flowModel.crossAreas[2])} / pipe1.nParallel (210) [ALGB] (1) Real tank2.Qb_flow (211) [ALGB] (1) flow Real[1] tank1.heatTransfer.heatPorts.Q_flow (212) [ALGB] (1) protected Real[1] tank1.zetas_out (213) [ALGB] (2) Real[2] pipe2.flowModel.vs = {(-pipe2.port_b.m_flow) / (pipe2.flowModel.crossAreas[1] * Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe2.Medium.density(pipe2.flowModel.states[1])), -pipe2.port_b.m_flow / (Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe2.Medium.density(pipe2.flowModel.states[2]) * pipe2.flowModel.crossAreas[2])} / pipe2.nParallel (214) [ALGB] (2) Real[2] pipe3.flowModel.vs = {(-pipe3.port_b.m_flow) / (pipe3.flowModel.crossAreas[1] * Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe3.Medium.density(pipe3.flowModel.states[1])), -pipe3.port_b.m_flow / (Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe3.Medium.density(pipe3.flowModel.states[2]) * pipe3.flowModel.crossAreas[2])} / pipe3.nParallel (215) [ALGB] (1) Real[1] tank3.topPorts.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}) (216) [ALGB] (1) Real[1] pipe3.flowModel.Fs_p (217) [ALGB] (1) Real valveDiscrete.port_a_T = Modelica.Fluid.Utilities.regStep(995.586 * valveDiscrete.V_flow, Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.valveDiscrete.Medium.temperature(valveDiscrete.state_a), Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.valveDiscrete.Medium.temperature(Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.valveDiscrete.Medium.setState_phX(valveDiscrete.port_a.p, valveDiscrete.port_a.h_outflow, {})), valveDiscrete.m_flow_small) (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (218) [ALGB] (1) protected Real pipe1.flowModel.dp_fric_nominal = sum({Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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) (219) [ALGB] (1) Real pipe2.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (220) [DISC] (2) Boolean[2] $SEV_2[$i1] (221) [ALGB] (3) flow Real[3] tank2.ports.m_flow (start = {0.0 for $i1 in 1:3}, min = {-1e5 for $i1 in 1:3}, max = {1e5 for $i1 in 1:3}) (222) [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}) (223) [ALGB] (2) flow Real[2] tank3.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}) (224) [ALGB] (2) stream Real[2] tank3.ports.h_outflow (min = {-1e10 for $i1 in 1:2}, max = {1e10 for $i1 in 1:2}, nominal = {1e6 for $i1 in 1:2}) (225) [ALGB] (1) protected Real[1] pipe1.flowModel.diameters = 0.5 * (pipe1.flowModel.dimensions[2:2] + pipe1.flowModel.dimensions[1:1]) (226) [ALGB] (1) Real[1] pipe2.flowModel.Res_turbulent_internal = pipe2.flowModel.Re_turbulent * {1.0 for $i1 in 1:1} (227) [ALGB] (1) Real[1] pipe1.flowModel.Ib_flows (228) [ALGB] (2) final Real[2] pipe2.flowModel.dimensions = {(4.0 * pipe2.crossArea) / pipe2.perimeter, (4.0 * pipe2.crossArea) / pipe2.perimeter} (229) [ALGB] (1) Real valveDiscrete.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (230) [ALGB] (3) protected Real[3] tank2.zetas_out (231) [DER-] (1) Real $DER.tank3.U (232) [ALGB] (1) final Real[1] pipe1.flowModel.pathLengths = {pipe1.length} (233) [ALGB] (1) flow Real[1] ambient_fixed.ports.m_flow (min = {-1e60}, max = {1e60}) (234) [DISC] (3) protected Boolean[3] tank2.aboveLevel (235) [DISC] (1) Boolean $SEV_30 (236) [ALGB] (1) Real[1] tank2.heatTransfer.surfaceAreas = {sqrt(3.141592653589793 * tank2.crossArea) * 2.0 * tank2.level + tank2.crossArea} (237) [ALGB] (1) final Real[1] pipe2.flowModel.dheights = {pipe2.height_ab} (238) [ALGB] (1) protected Real[1] pipe2.flowModel.diameters = 0.5 * (pipe2.flowModel.dimensions[2:2] + pipe2.flowModel.dimensions[1:1]) (239) [DISC] (2) Boolean[2] $SEV_37[$i1] (240) [ALGB] (1) protected Real[1] tank1.portsData_height2 (241) [ALGB] (1) final Real tank2.fluidVolume = tank2.fluidVolume (242) [ALGB] (1) Real tank3.Qb_flow (243) [ALGB] (1) protected Real pipe3.flowModel.dp_fric_nominal = sum({Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe3.flowModel.WallFriction.pressureLoss_m_flow(pipe3.flowModel.m_flow_nominal / pipe3.flowModel.nParallel, pipe3.flowModel.rho_nominal, pipe3.flowModel.rho_nominal, pipe3.flowModel.mu_nominal, pipe3.flowModel.mu_nominal, pipe3.flowModel.pathLengths_internal[1], pipe3.flowModel.diameters[1], ((pipe3.flowModel.crossAreas[2:2] + pipe3.flowModel.crossAreas[1:1]) / 2.0)[1], ((pipe3.flowModel.roughnesses[2:2] + pipe3.flowModel.roughnesses[1:1]) / 2.0)[1], pipe3.flowModel.m_flow_small / pipe3.flowModel.nParallel, pipe3.flowModel.Res_turbulent_internal[1])}) (min = 0.0, nominal = 1e5) (244) [ALGB] (2) protected Real[2] tank3.zetas_out (245) [DISC] (3) Boolean[3] $SEV_15[$i1] (246) [ALGB] (1) Real tank1.level (start = tank1.level_start, StateSelect = prefer) (247) [ALGB] (1) Real valveDiscrete.V_flow = (995.586 * valveDiscrete.V_flow) / Modelica.Fluid.Utilities.regStep(995.586 * valveDiscrete.V_flow, Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.valveDiscrete.Medium.density(valveDiscrete.state_a), Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.valveDiscrete.Medium.density(valveDiscrete.state_b), valveDiscrete.m_flow_small) (248) [DER-] (1) Real $DER.tank3.m (249) [ALGB] (1) final Real[1] pipe2.flowModel.pathLengths = {pipe2.length} (250) [DISC] (3) Boolean[3] $SEV_10[$i1] (251) [ALGB] (2) protected Real[2] tank3.bottomArea (252) [ALGB] (1) protected Real valveDiscrete.state_a.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) System Equations (252/339) **************************** (1) [ARRY] (1) tank1.portsData_diameter = tank1.portsData.diameter ($RES_BND_255) (2) [ARRY] (1) tank1.portsData_height = tank1.portsData.height ($RES_BND_256) (3) [FOR-] (3) ($RES_SIM_81) (3) [----] for $i1 in 1:3 loop (3) [----] [SCAL] (1) tank2.bottomArea[$i1] = 3.141592653589793 * (tank2.portsData_diameter2[$i1] / 2.0) ^ 2.0 ($RES_SIM_82) (3) [----] end for; (4) [ARRY] (1) tank1.heatTransfer.Q_flows = tank1.heatTransfer.heatPorts.Q_flow ($RES_SIM_122) (5) [FOR-] (3) ($RES_SIM_83) (5) [----] for $i1 in 1:3 loop (5) [----] [SCAL] (1) tank2.ports_emptyPipeHysteresis[$i1] = tank2.portsData_diameter2[$i1] * tank2.hysteresisFactor ($RES_SIM_84) (5) [----] end for; (6) [ARRY] (1) tank1.heatTransfer.Ts = tank1.heatTransfer.heatPorts.T ($RES_SIM_123) (7) [ARRY] (1) tank2.heatTransfer.Q_flows = tank2.heatTransfer.heatPorts.Q_flow ($RES_SIM_87) (8) [ARRY] (1) tank2.heatTransfer.Ts = tank2.heatTransfer.heatPorts.T ($RES_SIM_88) (9) [SCAL] (1) tank1.medium.state.p = tank1.p_ambient ($RES_SIM_128) (10) [SCAL] (1) tank1.medium.state.T = -((-273.15) - tank1.medium.T_degC) ($RES_SIM_129) (11) [FOR-] (3) ($RES_EVT_371) (11) [----] for $i1 in 1:3 loop (11) [----] [SCAL] (1) $SEV_13[$i1] = tank2.ports[$i1].m_flow >= tank2.m_flow_small ($RES_EVT_372) (11) [----] end for; (12) [FOR-] (3) ($RES_EVT_373) (12) [----] for $i1 in 1:3 loop (12) [----] [SCAL] (1) $SEV_14[$i1] = tank2.ports[$i1].m_flow <= (-tank2.m_flow_small) ($RES_EVT_374) (12) [----] end for; (13) [FOR-] (3) ($RES_EVT_375) (13) [----] for $i1 in 1:3 loop (13) [----] [SCAL] (1) $SEV_15[$i1] = 0.008105694691387022 / (995.586 * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1]) >= (0.8105694691387022 * tank2.zetas_out[$i1]) / (995.586 * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1]) ($RES_EVT_376) (13) [----] end for; (14) [SCAL] (1) $SEV_16 = tank2.ports[3].m_flow > 0.0 ($RES_EVT_377) (15) [SCAL] (1) $SEV_17 = tank2.ports[2].m_flow > 0.0 ($RES_EVT_378) (16) [SCAL] (1) $SEV_18 = tank2.ports[1].m_flow > 0.0 ($RES_EVT_379) (17) [ARRY] (1) tank2.heatTransfer.surfaceAreas = {2.0 * $FUN_19 * tank2.level + tank2.crossArea} ($RES_BND_260) (18) [ARRY] (1) tank2.heatTransfer.Ts = {tank2.heatTransfer.states.p} ($RES_BND_261) (19) [ARRY] (3) tank2.portsData_diameter = tank2.portsData.diameter ($RES_BND_262) (20) [SCAL] (1) pipe3.port_b.m_flow + tank2.ports[1].m_flow = 0.0 ($RES_SIM_212) (21) [ARRY] (3) tank2.portsData_height = tank2.portsData.height ($RES_BND_263) (22) [SCAL] (1) tank3.topPorts[1].m_flow - pipe3.port_b.m_flow = 0.0 ($RES_SIM_213) (23) [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_264) (24) [SCAL] (1) pipe2.port_b.m_flow + tank2.ports[2].m_flow = 0.0 ($RES_SIM_214) (25) [ARRY] (2) pipe1.flowModel.crossAreas = {pipe1.crossArea, pipe1.crossArea} ($RES_BND_265) (26) [SCAL] (1) tank3.ports[2].m_flow - pipe2.port_b.m_flow = 0.0 ($RES_SIM_215) (27) [ARRY] (2) pipe1.flowModel.dimensions = {(4.0 * pipe1.crossArea) / pipe1.perimeter, (4.0 * pipe1.crossArea) / pipe1.perimeter} ($RES_BND_266) (28) [SCAL] (1) pipe1.port_b.m_flow + tank1.ports[1].m_flow = 0.0 ($RES_SIM_216) (29) [SCAL] (1) pipe3.port_a.h_outflow = tank2.ports[1].h_outflow + system.g * pipe3.height_ab ($RES_SIM_18) (30) [ARRY] (2) pipe1.flowModel.roughnesses = {pipe1.roughness, pipe1.roughness} ($RES_BND_267) (31) [SCAL] (1) tank2.ports[3].m_flow - pipe1.port_b.m_flow = 0.0 ($RES_SIM_217) (32) [SCAL] (1) pipe3.port_b.h_outflow = tank3.topPorts[1].h_outflow - system.g * pipe3.height_ab ($RES_SIM_19) (33) [ARRY] (1) pipe1.flowModel.dheights = {pipe1.height_ab} ($RES_BND_268) (34) [SCAL] (1) tank2.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_218) (35) [SCAL] (1) tank2.medium.state.p = tank2.p_ambient ($RES_SIM_93) (36) [ARRY] (1) pipe1.flowModel.pathLengths = {pipe1.length} ($RES_BND_269) (37) [SCAL] (1) tank1.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_219) (38) [SCAL] (1) tank2.medium.state.T = -((-273.15) - tank2.medium.T_degC) ($RES_SIM_94) (39) [SCAL] (1) $DER.tank3.m = tank3.mb_flow ($RES_SIM_136) (40) [SCAL] (1) $DER.tank3.U = tank3.Qb_flow + tank3.Hb_flow ($RES_SIM_137) (41) [SCAL] (1) tank3.U = tank3.m * (4184.0 * ((-273.15) - ((-273.15) - tank3.medium.T_degC))) ($RES_SIM_138) (42) [SCAL] (1) tank3.m = 995.586 * tank3.fluidVolume ($RES_SIM_139) (43) [SCAL] (1) $SEV_19 = tank2.m >= 0.0 ($RES_EVT_380) (44) [SCAL] (1) $SEV_20 = tank2.level <= tank2.height ($RES_EVT_381) (45) [SCAL] (1) $SEV_24 = 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_385) (46) [SCAL] (1) $SEV_25 = tank1.ports[1].m_flow >= tank1.m_flow_small ($RES_EVT_386) (47) [SCAL] (1) $SEV_26 = tank1.ports[1].m_flow <= (-tank1.m_flow_small) ($RES_EVT_387) (48) [SCAL] (1) $SEV_27 = 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_388) (49) [SCAL] (1) $SEV_28 = tank1.ports[1].m_flow > 0.0 ($RES_EVT_389) (50) [SCAL] (1) -pipe3.port_b.m_flow = pipe3.flowModel.m_flows[1] ($RES_SIM_21) (51) [FOR-] (2) ($RES_BND_270) (51) [----] for $i1 in 1:2 loop (51) [----] [SCAL] (1) pipe1.flowModel.rhos[$i1] = 995.586 ($RES_BND_271) (51) [----] end for; (52) [SCAL] (1) tank3.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_220) (53) [ARRY] (1) {0.0} = pipe3.flowModel.Ib_flows - (pipe3.flowModel.Fs_fg + pipe3.flowModel.Fs_p) ($RES_SIM_22) (54) [SCAL] (1) tank3.ports[1].m_flow - 995.586 * valveDiscrete.V_flow = 0.0 ($RES_SIM_221) (55) [ARRY] (1) pipe3.flowModel.Is = {pipe3.flowModel.m_flows[1] * pipe3.flowModel.pathLengths[1]} ($RES_SIM_23) (56) [FOR-] (2) ($RES_BND_272) (56) [----] for $i1 in 1:2 loop (56) [----] [SCAL] (1) pipe1.flowModel.mus[$i1] = 0.001 ($RES_BND_273) (56) [----] end for; (57) [SCAL] (1) pipe2.port_b.p = tank2.ports[2].p ($RES_SIM_222) (58) [ARRY] (1) pipe3.flowModel.dps_fg = {(2.0 * (pipe3.flowModel.Fs_fg[1] / pipe3.flowModel.nParallel)) / (pipe3.flowModel.crossAreas[1] + pipe3.flowModel.crossAreas[2])} ($RES_SIM_24) (59) [SCAL] (1) pipe1.port_a.p = tank2.ports[3].p ($RES_SIM_223) (60) [ARRY] (1) pipe3.flowModel.Fs_p = pipe3.flowModel.nParallel * {0.5 * (pipe3.flowModel.crossAreas[1] + pipe3.flowModel.crossAreas[2]) * (pipe3.flowModel.states.T - pipe3.flowModel.states.T)} ($RES_SIM_25) (61) [ARRY] (1) pipe1.flowModel.pathLengths_internal = pipe1.flowModel.pathLengths ($RES_BND_274) (62) [SCAL] (1) pipe3.port_b.p = tank2.ports[1].p ($RES_SIM_224) (63) [ARRY] (1) pipe3.flowModel.Ib_flows = {0.0} ($RES_SIM_26) (64) [SCAL] (1) pipe1.flowModel.Res_turbulent_internal[1] = pipe1.flowModel.Re_turbulent ($RES_BND_275) (65) [SCAL] (1) pipe3.port_a.p = tank3.topPorts[1].p ($RES_SIM_225) (66) [SCAL] (1) pipe3.flowModel.rhos_act[1] = noEvent(if $SEV_4 then pipe3.flowModel.rhos[1] else pipe3.flowModel.rhos[2]) ($RES_SIM_27) (67) [FOR-] (2) ($RES_SIM_140) (67) [----] for $i1 in 1:2 loop (67) [----] [SCAL] (1) tank3.aboveLevel[$i1] = $SEV_37[$i1] ($RES_SIM_141) (67) [----] end for; (68) [ARRY] (1) pipe1.flowModel.diameters = 0.5 * (pipe1.flowModel.dimensions[2:2] + pipe1.flowModel.dimensions[1:1]) ($RES_BND_276) (69) [SCAL] (1) pipe2.port_a.p = tank3.ports[2].p ($RES_SIM_226) (70) [SCAL] (1) pipe3.flowModel.mus_act[1] = noEvent(if $SEV_4 then pipe3.flowModel.mus[1] else pipe3.flowModel.mus[2]) ($RES_SIM_28) (71) [SCAL] (1) pipe1.port_b.p = tank1.ports[1].p ($RES_SIM_227) (72) [ARRY] (1) pipe3.flowModel.m_flows = {homotopy(({$FUN_12} .* pipe3.flowModel.nParallel)[1], (pipe3.flowModel.m_flow_nominal / pipe3.flowModel.dp_nominal * (pipe3.flowModel.dps_fg - (pipe3.flowModel.g * pipe3.flowModel.dheights) .* pipe3.flowModel.rho_nominal))[1])} ($RES_SIM_29) (73) [FOR-] (2) ($RES_SIM_142) (73) [----] for $i1 in 1:2 loop (73) [----] [SCAL] (1) tank3.levelAbovePort[$i1] = if tank3.aboveLevel[$i1] then tank3.level - tank3.portsData_height2[$i1] else 0.0 ($RES_SIM_143) (73) [----] end for; (74) [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_278) (75) [SCAL] (1) valveDiscrete.port_b.p = tank3.ports[1].p ($RES_SIM_228) (76) [ARRY] (2) pipe2.flowModel.crossAreas = {pipe2.crossArea, pipe2.crossArea} ($RES_BND_279) (77) [FOR-] (2) ($RES_SIM_144) (77) [----] for $i1 in 1:2 loop (77) [----] [SCAL] (1) tank3.ports[$i1].h_outflow = 4184.0 * ((-273.15) - ((-273.15) - tank3.medium.T_degC)) ($RES_SIM_145) (77) [----] end for; (78) [FOR-] (2) ($RES_SIM_146) (78) [----] for $i1 in 1:2 loop (78) [----] [SCAL] (1) tank3.zetas_out[$i1] = 1.0 + (if tank3.aboveLevel[$i1] then 0.0 else tank3.zetaLarge) ($RES_SIM_147) (78) [----] end for; (79) [FOR-] (2) ($RES_SIM_148) (79) [----] for $i1 in 1:2 loop (79) [----] [SCAL] (1) tank3.ports[$i1].p = system.g * tank3.levelAbovePort[$i1] * 995.586 + tank3.p_ambient + smooth(2, if $SEV_38[$i1] then (0.008105694691387022 * tank3.ports[$i1].m_flow ^ 2.0) / (995.586 * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1]) else if $SEV_39[$i1] then -(0.8105694691387022 * tank3.zetas_out[$i1] * tank3.ports[$i1].m_flow ^ 2.0) / (995.586 * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1]) else if $SEV_40[$i1] then Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(tank3.ports[$i1].m_flow, tank3.m_flow_small, 0.008105694691387022 / (995.586 * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1]), (0.8105694691387022 * tank3.zetas_out[$i1]) / (995.586 * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1]), false, 1.0) else -Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(-tank3.ports[$i1].m_flow, tank3.m_flow_small, (0.8105694691387022 * tank3.zetas_out[$i1]) / (995.586 * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1]), 0.008105694691387022 / (995.586 * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1]), false, 1.0)) ($RES_SIM_149) (79) [----] end for; (80) [SCAL] (1) $SEV_29 = tank1.m >= 0.0 ($RES_EVT_390) (81) [SCAL] (1) $SEV_30 = tank1.level <= tank1.height ($RES_EVT_391) (82) [FOR-] (2) ($RES_EVT_395) (82) [----] for $i1 in 1:2 loop (82) [----] [SCAL] (1) $SEV_34[$i1] = tank3.level >= (tank3.portsData_height2[$i1] + tank3.ports_emptyPipeHysteresis[$i1]) ($RES_EVT_396) (82) [----] end for; (83) [FOR-] (2) ($RES_EVT_397) (83) [----] for $i1 in 1:2 loop (83) [----] [SCAL] (1) $SEV_35[$i1] = tank3.level >= (tank3.portsData_height2[$i1] - tank3.ports_emptyPipeHysteresis[$i1]) ($RES_EVT_398) (83) [----] end for; (84) [FOR-] (2) ($RES_EVT_399) (84) [----] for $i1 in 1:2 loop (84) [----] [SCAL] (1) $SEV_36[$i1] = $TEV_2 and $SEV_35[$i1] ($RES_EVT_400) (84) [----] end for; (85) [SCAL] (1) pipe2.port_a.h_outflow = tank2.ports[2].h_outflow + system.g * pipe2.height_ab ($RES_SIM_31) (86) [ARRY] (2) pipe2.flowModel.dimensions = {(4.0 * pipe2.crossArea) / pipe2.perimeter, (4.0 * pipe2.crossArea) / pipe2.perimeter} ($RES_BND_280) (87) [SCAL] (1) 995.586 * valveDiscrete.V_flow + ambient_fixed.ports[1].m_flow = 0.0 ($RES_SIM_230) (88) [SCAL] (1) pipe2.port_b.h_outflow = tank3.ports[2].h_outflow - system.g * pipe2.height_ab ($RES_SIM_32) (89) [ARRY] (2) pipe2.flowModel.roughnesses = {pipe2.roughness, pipe2.roughness} ($RES_BND_281) (90) [SCAL] (1) ambient_fixed.ports[1].p = valveDiscrete.port_a.p ($RES_SIM_231) (91) [ARRY] (1) pipe2.flowModel.dheights = {pipe2.height_ab} ($RES_BND_282) (92) [ARRY] (3) tank2.portsData_height = tank2.portsData_height2 ($RES_SIM_232) (93) [SCAL] (1) -pipe2.port_b.m_flow = pipe2.flowModel.m_flows[1] ($RES_SIM_34) (94) [ARRY] (1) pipe2.flowModel.pathLengths = {pipe2.length} ($RES_BND_283) (95) [ARRY] (3) tank2.portsData_diameter = tank2.portsData_diameter2 ($RES_SIM_233) (96) [ARRY] (1) {0.0} = pipe2.flowModel.Ib_flows - (pipe2.flowModel.Fs_fg + pipe2.flowModel.Fs_p) ($RES_SIM_35) (97) [FOR-] (2) ($RES_BND_284) (97) [----] for $i1 in 1:2 loop (97) [----] [SCAL] (1) pipe2.flowModel.rhos[$i1] = 995.586 ($RES_BND_285) (97) [----] end for; (98) [ARRY] (1) tank1.portsData_height = tank1.portsData_height2 ($RES_SIM_234) (99) [ARRY] (1) pipe2.flowModel.Is = {pipe2.flowModel.m_flows[1] * pipe2.flowModel.pathLengths[1]} ($RES_SIM_36) (100) [ARRY] (1) tank1.portsData_diameter = tank1.portsData_diameter2 ($RES_SIM_235) (101) [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_37) (102) [FOR-] (2) ($RES_BND_286) (102) [----] for $i1 in 1:2 loop (102) [----] [SCAL] (1) pipe2.flowModel.mus[$i1] = 0.001 ($RES_BND_287) (102) [----] end for; (103) [ARRY] (2) tank3.portsData_height = tank3.portsData_height2 ($RES_SIM_236) (104) [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_38) (105) [ARRY] (2) tank3.portsData_diameter = tank3.portsData_diameter2 ($RES_SIM_237) (106) [ARRY] (1) pipe2.flowModel.Ib_flows = {0.0} ($RES_SIM_39) (107) [SCAL] (1) tank3.port_b_H_flow_bottom[2] = smooth(0, tank3.ports[2].m_flow * (if $SEV_41 then pipe2.port_a.h_outflow else tank3.ports[2].h_outflow)) ($RES_SIM_152) (108) [ARRY] (1) pipe2.flowModel.pathLengths_internal = pipe2.flowModel.pathLengths ($RES_BND_288) (109) [SCAL] (1) tank3.port_b_H_flow_bottom[1] = smooth(0, tank3.ports[1].m_flow * (if $SEV_42 then valveDiscrete.port_b.h_outflow else tank3.ports[1].h_outflow)) ($RES_SIM_153) (110) [SCAL] (1) pipe2.flowModel.Res_turbulent_internal[1] = pipe2.flowModel.Re_turbulent ($RES_BND_289) (111) [SCAL] (1) tank3.topPorts[1].p = tank3.p_ambient ($RES_SIM_154) (112) [SCAL] (1) tank3.topPorts[1].h_outflow = tank3.h_start ($RES_SIM_155) (113) [FOR-] (2) ($RES_EVT_401) (113) [----] for $i1 in 1:2 loop (113) [----] [SCAL] (1) $SEV_37[$i1] = $SEV_34[$i1] or $SEV_36[$i1] ($RES_EVT_402) (113) [----] end for; (114) [SCAL] (1) tank3.H_flow_top[1] = smooth(0, tank3.topPorts[1].m_flow * (if $SEV_43 then pipe3.port_a.h_outflow else tank3.topPorts[1].h_outflow)) ($RES_SIM_156) (115) [FOR-] (2) ($RES_EVT_403) (115) [----] for $i1 in 1:2 loop (115) [----] [SCAL] (1) $SEV_38[$i1] = tank3.ports[$i1].m_flow >= tank3.m_flow_small ($RES_EVT_404) (115) [----] end for; (116) [SCAL] (1) tank3.Qb_flow = tank3.heatTransfer.Q_flows[1] ($RES_SIM_158) (117) [SCAL] (1) tank3.Hb_flow = $FUN_3 + $FUN_4 ($RES_SIM_159) (118) [FOR-] (2) ($RES_EVT_405) (118) [----] for $i1 in 1:2 loop (118) [----] [SCAL] (1) $SEV_39[$i1] = tank3.ports[$i1].m_flow <= (-tank3.m_flow_small) ($RES_EVT_406) (118) [----] end for; (119) [FOR-] (2) ($RES_EVT_407) (119) [----] for $i1 in 1:2 loop (119) [----] [SCAL] (1) $SEV_40[$i1] = 0.008105694691387022 / (995.586 * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1]) >= (0.8105694691387022 * tank3.zetas_out[$i1]) / (995.586 * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1] * tank3.portsData_diameter2[$i1]) ($RES_EVT_408) (119) [----] end for; (120) [SCAL] (1) $SEV_41 = tank3.ports[2].m_flow > 0.0 ($RES_EVT_409) (121) [SCAL] (1) $FUN_1 = sum(tank3.topPorts.m_flow) ($RES_$AUX_332) (122) [SCAL] (1) $FUN_2 = sum(tank3.ports.m_flow) ($RES_$AUX_331) (123) [SCAL] (1) $FUN_3 = sum(tank3.H_flow_top) ($RES_$AUX_330) (124) [SCAL] (1) pipe2.flowModel.rhos_act[1] = noEvent(if $SEV_6 then pipe2.flowModel.rhos[1] else pipe2.flowModel.rhos[2]) ($RES_SIM_40) (125) [SCAL] (1) pipe2.flowModel.mus_act[1] = noEvent(if $SEV_6 then pipe2.flowModel.mus[1] else pipe2.flowModel.mus[2]) ($RES_SIM_41) (126) [ARRY] (1) pipe2.flowModel.diameters = 0.5 * (pipe2.flowModel.dimensions[2:2] + pipe2.flowModel.dimensions[1:1]) ($RES_BND_290) (127) [ARRY] (1) pipe2.flowModel.m_flows = {homotopy(({$FUN_11} .* 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_42) (128) [ARRY] (2) pipe3.flowModel.vs = {-(0.0010044335697769957 * pipe3.port_b.m_flow) / pipe3.flowModel.crossAreas[1], -(0.0010044335697769957 * pipe3.port_b.m_flow) / pipe3.flowModel.crossAreas[2]} / pipe3.nParallel ($RES_BND_292) (129) [SCAL] (1) pipe1.port_a.h_outflow = tank1.ports[1].h_outflow + system.g * pipe1.height_ab ($RES_SIM_44) (130) [ARRY] (2) pipe3.flowModel.crossAreas = {pipe3.crossArea, pipe3.crossArea} ($RES_BND_293) (131) [SCAL] (1) pipe1.port_b.h_outflow = tank2.ports[3].h_outflow - system.g * pipe1.height_ab ($RES_SIM_45) (132) [ARRY] (2) pipe3.flowModel.dimensions = {(4.0 * pipe3.crossArea) / pipe3.perimeter, (4.0 * pipe3.crossArea) / pipe3.perimeter} ($RES_BND_294) (133) [ARRY] (2) pipe3.flowModel.roughnesses = {pipe3.roughness, pipe3.roughness} ($RES_BND_295) (134) [SCAL] (1) -pipe1.port_b.m_flow = pipe1.flowModel.m_flows[1] ($RES_SIM_47) (135) [SCAL] (1) tank3.mb_flow = $FUN_1 + $FUN_2 ($RES_SIM_160) (136) [ARRY] (1) pipe3.flowModel.dheights = {pipe3.height_ab} ($RES_BND_296) (137) [ARRY] (1) {0.0} = pipe1.flowModel.Ib_flows - (pipe1.flowModel.Fs_fg + pipe1.flowModel.Fs_p) ($RES_SIM_48) (138) [SCAL] (1) tank3.fluidVolume = tank3.crossArea * tank3.level + tank3.V0 ($RES_SIM_161) (139) [ARRY] (1) pipe3.flowModel.pathLengths = {pipe3.length} ($RES_BND_297) (140) [ARRY] (1) pipe1.flowModel.Is = {pipe1.flowModel.m_flows[1] * pipe1.flowModel.pathLengths[1]} ($RES_SIM_49) (141) [FOR-] (2) ($RES_BND_298) (141) [----] for $i1 in 1:2 loop (141) [----] [SCAL] (1) pipe3.flowModel.rhos[$i1] = 995.586 ($RES_BND_299) (141) [----] end for; (142) [FOR-] (2) ($RES_SIM_163) (142) [----] for $i1 in 1:2 loop (142) [----] [SCAL] (1) tank3.bottomArea[$i1] = 3.141592653589793 * (tank3.portsData_diameter2[$i1] / 2.0) ^ 2.0 ($RES_SIM_164) (142) [----] end for; (143) [SCAL] (1) $SEV_42 = tank3.ports[1].m_flow > 0.0 ($RES_EVT_410) (144) [FOR-] (2) ($RES_SIM_165) (144) [----] for $i1 in 1:2 loop (144) [----] [SCAL] (1) tank3.ports_emptyPipeHysteresis[$i1] = tank3.portsData_diameter2[$i1] * tank3.hysteresisFactor ($RES_SIM_166) (144) [----] end for; (145) [SCAL] (1) $SEV_43 = tank3.topPorts[1].m_flow > 0.0 ($RES_EVT_411) (146) [SCAL] (1) $SEV_44 = tank3.m >= 0.0 ($RES_EVT_412) (147) [SCAL] (1) $FUN_4 = sum(tank3.port_b_H_flow_bottom) ($RES_$AUX_329) (148) [SCAL] (1) $SEV_45 = tank3.level <= tank3.height ($RES_EVT_413) (149) [ARRY] (1) tank3.heatTransfer.Q_flows = tank3.heatTransfer.heatPorts.Q_flow ($RES_SIM_169) (150) [SCAL] (1) $FUN_6 = sum(tank1.ports.m_flow) ($RES_$AUX_327) (151) [SCAL] (1) $FUN_7 = sum(tank1.port_b_H_flow_bottom) ($RES_$AUX_326) (152) [SCAL] (1) $FUN_8 = sum(tank2.ports.m_flow) ($RES_$AUX_325) (153) [SCAL] (1) $FUN_9 = sum(tank2.port_b_H_flow_bottom) ($RES_$AUX_324) (154) [SCAL] (1) $FUN_10 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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_323) (155) [SCAL] (1) $FUN_11 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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_322) (156) [FOR-] (2) ($RES_BND_300) (156) [----] for $i1 in 1:2 loop (156) [----] [SCAL] (1) pipe3.flowModel.mus[$i1] = 0.001 ($RES_BND_301) (156) [----] end for; (157) [SCAL] (1) $FUN_12 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe3.flowModel.WallFriction.massFlowRate_dp_staticHead(pipe3.flowModel.dps_fg[1], pipe3.flowModel.rhos[1], pipe3.flowModel.rhos[2], pipe3.flowModel.mus[1], pipe3.flowModel.mus[2], pipe3.flowModel.pathLengths_internal[1], pipe3.flowModel.diameters[1], (pipe3.flowModel.g * pipe3.flowModel.dheights)[1], (0.5 .* (pipe3.flowModel.crossAreas[1:1] + pipe3.flowModel.crossAreas[2:2]))[1], (0.5 .* (pipe3.flowModel.roughnesses[1:1] + pipe3.flowModel.roughnesses[2:2]))[1], pipe3.flowModel.dp_small, pipe3.flowModel.Res_turbulent_internal[1]) ($RES_$AUX_321) (158) [SCAL] (1) $FUN_13 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe3.flowModel.WallFriction.pressureLoss_m_flow(pipe3.flowModel.m_flow_nominal / pipe3.flowModel.nParallel, pipe3.flowModel.rho_nominal, pipe3.flowModel.rho_nominal, pipe3.flowModel.mu_nominal, pipe3.flowModel.mu_nominal, pipe3.flowModel.pathLengths_internal[1], pipe3.flowModel.diameters[1], (0.5 .* (pipe3.flowModel.crossAreas[2:2] + pipe3.flowModel.crossAreas[1:1]))[1], (0.5 .* (pipe3.flowModel.roughnesses[2:2] + pipe3.flowModel.roughnesses[1:1]))[1], pipe3.flowModel.m_flow_small / pipe3.flowModel.nParallel, pipe3.flowModel.Res_turbulent_internal[1]) ($RES_$AUX_320) (159) [ARRY] (1) pipe3.flowModel.pathLengths_internal = pipe3.flowModel.pathLengths ($RES_BND_302) (160) [SCAL] (1) pipe3.flowModel.Res_turbulent_internal[1] = pipe3.flowModel.Re_turbulent ($RES_BND_303) (161) [ARRY] (1) pipe3.flowModel.diameters = 0.5 * (pipe3.flowModel.dimensions[2:2] + pipe3.flowModel.dimensions[1:1]) ($RES_BND_304) (162) [ARRY] (2) tank3.heatTransfer.states = {tank3.medium.state} ($RES_BND_306) (163) [ARRY] (2) tank1.heatTransfer.states = {tank1.medium.state} ($RES_BND_307) (164) [ARRY] (2) tank2.heatTransfer.states = {tank2.medium.state} ($RES_BND_308) (165) [ARRY] (4) pipe1.flowModel.states = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe1.Medium.ThermodynamicState(pipe1.port_a.p, 273.15 + 2.390057361376673e-4 * tank2.ports[3].h_outflow), Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe1.Medium.ThermodynamicState(pipe1.port_b.p, 273.15 + 2.390057361376673e-4 * tank1.ports[1].h_outflow)} ($RES_BND_309) (166) [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_50) (167) [SCAL] (1) valveDiscrete.state_a.p = valveDiscrete.port_a.p ($RES_SIM_333) (168) [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_51) (169) [SCAL] (1) valveDiscrete.state_a.T = 273.15 + 2.390057361376673e-4 * ambient_fixed.ports[1].h_outflow ($RES_SIM_334) (170) [ARRY] (1) pipe1.flowModel.Ib_flows = {0.0} ($RES_SIM_52) (171) [SCAL] (1) valveDiscrete.state_b.p = valveDiscrete.port_b.p ($RES_SIM_335) (172) [SCAL] (1) pipe1.flowModel.rhos_act[1] = noEvent(if $SEV_8 then pipe1.flowModel.rhos[1] else pipe1.flowModel.rhos[2]) ($RES_SIM_53) (173) [SCAL] (1) valveDiscrete.state_b.T = 273.15 + 2.390057361376673e-4 * tank3.ports[1].h_outflow ($RES_SIM_336) (174) [SCAL] (1) pipe1.flowModel.mus_act[1] = noEvent(if $SEV_8 then pipe1.flowModel.mus[1] else pipe1.flowModel.mus[2]) ($RES_SIM_54) (175) [ARRY] (1) pipe1.flowModel.m_flows = {homotopy(({$FUN_10} .* 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_55) (176) [SCAL] (1) $DER.tank2.m = tank2.mb_flow ($RES_SIM_56) (177) [SCAL] (1) $DER.tank2.U = tank2.Qb_flow + tank2.Hb_flow ($RES_SIM_57) (178) [ARRY] (1) tank3.heatTransfer.Ts = tank3.heatTransfer.heatPorts.T ($RES_SIM_170) (179) [SCAL] (1) tank2.U = tank2.m * (4184.0 * ((-273.15) - ((-273.15) - tank2.medium.T_degC))) ($RES_SIM_58) (180) [SCAL] (1) tank2.m = 995.586 * tank2.fluidVolume ($RES_SIM_59) (181) [SCAL] (1) $SEV_52 = (-995.586 * valveDiscrete.V_flow) > valveDiscrete.m_flow_small ($RES_EVT_420) (182) [SCAL] (1) tank3.medium.state.p = tank3.p_ambient ($RES_SIM_175) (183) [SCAL] (1) $SEV_53 = (-995.586 * valveDiscrete.V_flow) < (-valveDiscrete.m_flow_small) ($RES_EVT_421) (184) [SCAL] (1) tank3.medium.state.T = -((-273.15) - tank3.medium.T_degC) ($RES_SIM_176) (185) [SCAL] (1) $SEV_54 = valveDiscrete.m_flow_small > 0.0 ($RES_EVT_422) (186) [SCAL] (1) pipe3.flowModel.dp_fric_nominal = sum({$FUN_13}) ($RES_$AUX_319) (187) [SCAL] (1) $SEV_55 = 995.586 * valveDiscrete.V_flow > valveDiscrete.m_flow_small ($RES_EVT_423) (188) [SCAL] (1) $FUN_15 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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_318) (189) [SCAL] (1) $SEV_56 = 995.586 * valveDiscrete.V_flow < (-valveDiscrete.m_flow_small) ($RES_EVT_424) (190) [SCAL] (1) pipe2.flowModel.dp_fric_nominal = sum({$FUN_15}) ($RES_$AUX_317) (191) [SCAL] (1) $FUN_17 = Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.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_316) (192) [SCAL] (1) pipe1.flowModel.dp_fric_nominal = sum({$FUN_17}) ($RES_$AUX_315) (193) [SCAL] (1) $FUN_19 = sqrt(3.141592653589793 * tank2.crossArea) ($RES_$AUX_314) (194) [SCAL] (1) $FUN_20 = sqrt(3.141592653589793 * tank1.crossArea) ($RES_$AUX_313) (195) [SCAL] (1) $FUN_21 = sqrt(3.141592653589793 * tank3.crossArea) ($RES_$AUX_312) (196) [ARRY] (4) pipe2.flowModel.states = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe2.Medium.ThermodynamicState(pipe2.port_a.p, 273.15 + 2.390057361376673e-4 * tank3.ports[2].h_outflow), Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe2.Medium.ThermodynamicState(pipe2.port_b.p, 273.15 + 2.390057361376673e-4 * tank2.ports[2].h_outflow)} ($RES_BND_310) (197) [ARRY] (4) pipe3.flowModel.states = {Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe3.Medium.ThermodynamicState(pipe3.port_a.p, 273.15 + 2.390057361376673e-4 * tank3.topPorts[1].h_outflow), Modelica.Fluid.Examples.AST_BatchPlant.Test.TanksWithEmptyingPipe2.pipe3.Medium.ThermodynamicState(pipe3.port_b.p, 273.15 + 2.390057361376673e-4 * tank2.ports[1].h_outflow)} ($RES_BND_311) (198) [SCAL] (1) $TEV_0 = $PRE.tank2.aboveLevel[$i1] ($RES_EVT_349) (199) [FOR-] (3) ($RES_SIM_60) (199) [----] for $i1 in 1:3 loop (199) [----] [SCAL] (1) tank2.aboveLevel[$i1] = $SEV_12[$i1] ($RES_SIM_61) (199) [----] end for; (200) [SCAL] (1) $DER.tank1.m = tank1.mb_flow ($RES_SIM_101) (201) [FOR-] (3) ($RES_SIM_62) (201) [----] for $i1 in 1:3 loop (201) [----] [SCAL] (1) tank2.levelAbovePort[$i1] = if tank2.aboveLevel[$i1] then tank2.level - tank2.portsData_height2[$i1] else 0.0 ($RES_SIM_63) (201) [----] end for; (202) [SCAL] (1) $DER.tank1.U = tank1.Qb_flow + tank1.Hb_flow ($RES_SIM_102) (203) [SCAL] (1) tank1.U = tank1.m * (4184.0 * ((-273.15) - ((-273.15) - tank1.medium.T_degC))) ($RES_SIM_103) (204) [FOR-] (3) ($RES_SIM_64) (204) [----] for $i1 in 1:3 loop (204) [----] [SCAL] (1) tank2.ports[$i1].h_outflow = 4184.0 * ((-273.15) - ((-273.15) - tank2.medium.T_degC)) ($RES_SIM_65) (204) [----] end for; (205) [SCAL] (1) tank1.m = 995.586 * tank1.fluidVolume ($RES_SIM_104) (206) [SCAL] (1) tank1.aboveLevel[1] = $SEV_24 ($RES_SIM_105) (207) [FOR-] (3) ($RES_SIM_66) (207) [----] for $i1 in 1:3 loop (207) [----] [SCAL] (1) tank2.zetas_out[$i1] = 1.0 + (if tank2.aboveLevel[$i1] then 0.0 else tank2.zetaLarge) ($RES_SIM_67) (207) [----] end for; (208) [SCAL] (1) tank1.levelAbovePort[1] = if tank1.aboveLevel[1] then tank1.level - tank1.portsData_height2[1] else 0.0 ($RES_SIM_106) (209) [SCAL] (1) tank1.ports[1].h_outflow = 4184.0 * ((-273.15) - ((-273.15) - tank1.medium.T_degC)) ($RES_SIM_107) (210) [FOR-] (3) ($RES_SIM_68) (210) [----] for $i1 in 1:3 loop (210) [----] [SCAL] (1) tank2.ports[$i1].p = system.g * tank2.levelAbovePort[$i1] * 995.586 + tank2.p_ambient + smooth(2, if $SEV_13[$i1] then (0.008105694691387022 * tank2.ports[$i1].m_flow ^ 2.0) / (995.586 * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1]) else if $SEV_14[$i1] then -(0.8105694691387022 * tank2.zetas_out[$i1] * tank2.ports[$i1].m_flow ^ 2.0) / (995.586 * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1]) else if $SEV_15[$i1] then Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(tank2.ports[$i1].m_flow, tank2.m_flow_small, 0.008105694691387022 / (995.586 * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1]), (0.8105694691387022 * tank2.zetas_out[$i1]) / (995.586 * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1]), false, 1.0) else -Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(-tank2.ports[$i1].m_flow, tank2.m_flow_small, (0.8105694691387022 * tank2.zetas_out[$i1]) / (995.586 * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1]), 0.008105694691387022 / (995.586 * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1] * tank2.portsData_diameter2[$i1]), false, 1.0)) ($RES_SIM_69) (210) [----] end for; (211) [SCAL] (1) tank1.zetas_out[1] = 1.0 + (if tank1.aboveLevel[1] then 0.0 else tank1.zetaLarge) ($RES_SIM_108) (212) [SCAL] (1) tank1.ports[1].p = 995.586 * system.g * tank1.levelAbovePort[1] + tank1.p_ambient + smooth(2, if $SEV_25 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_26 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_27 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_109) (213) [SCAL] (1) valveDiscrete.dp = valveDiscrete.port_a.p - valveDiscrete.port_b.p ($RES_SIM_186) (214) [SCAL] (1) valveDiscrete.port_b.h_outflow = ambient_fixed.ports[1].h_outflow ($RES_SIM_189) (215) [SCAL] (1) $TEV_1 = $PRE.tank1.aboveLevel ($RES_EVT_350) (216) [SCAL] (1) $TEV_2 = $PRE.tank3.aboveLevel[$i1] ($RES_EVT_351) (217) [FOR-] (3) ($RES_EVT_352) (217) [----] for $i1 in 1:3 loop (217) [----] [SCAL] (1) $SEV_0[$i1] = tank2.level_start >= tank2.portsData_height2[$i1] ($RES_EVT_353) (217) [----] end for; (218) [SCAL] (1) $SEV_1 = tank1.level_start >= tank1.portsData_height2[1] ($RES_EVT_354) (219) [FOR-] (2) ($RES_EVT_355) (219) [----] for $i1 in 1:2 loop (219) [----] [SCAL] (1) $SEV_2[$i1] = tank3.level_start >= tank3.portsData_height2[$i1] ($RES_EVT_356) (219) [----] end for; (220) [SCAL] (1) $SEV_4 = pipe3.flowModel.m_flows[1] > 0.0 ($RES_EVT_358) (221) [SCAL] (1) valveDiscrete.port_a_T = smooth(1, if $SEV_55 then valveDiscrete.state_a.T else if $SEV_56 then 273.15 + 2.390057361376673e-4 * valveDiscrete.port_a.h_outflow else if $SEV_54 then 0.25 * ((273.15 + 2.390057361376673e-4 * valveDiscrete.port_a.h_outflow) - valveDiscrete.state_a.T) * ((-3.0) + (995.586 * valveDiscrete.V_flow / valveDiscrete.m_flow_small) ^ 2.0) * ((995.586 * valveDiscrete.V_flow) / valveDiscrete.m_flow_small) + 0.5 * (273.15 + valveDiscrete.state_a.T + 2.390057361376673e-4 * valveDiscrete.port_a.h_outflow) else 0.5 * (273.15 + valveDiscrete.state_a.T + 2.390057361376673e-4 * valveDiscrete.port_a.h_outflow)) ($RES_BND_241) (222) [SCAL] (1) valveDiscrete.port_b_T = smooth(1, if $SEV_52 then valveDiscrete.state_b.T else if $SEV_53 then 273.15 + 2.390057361376673e-4 * valveDiscrete.port_b.h_outflow else if $SEV_54 then 0.5 * (273.15 + valveDiscrete.state_b.T + 2.390057361376673e-4 * valveDiscrete.port_b.h_outflow) - 0.25 * ((273.15 + 2.390057361376673e-4 * valveDiscrete.port_b.h_outflow) - valveDiscrete.state_b.T) * ((-3.0) + (995.586 * valveDiscrete.V_flow / (-valveDiscrete.m_flow_small)) ^ 2.0) * ((995.586 * valveDiscrete.V_flow) / valveDiscrete.m_flow_small) else 0.5 * (273.15 + valveDiscrete.state_b.T + 2.390057361376673e-4 * valveDiscrete.port_b.h_outflow)) ($RES_BND_242) (223) [ARRY] (1) tank3.heatTransfer.surfaceAreas = {2.0 * $FUN_21 * tank3.level + tank3.crossArea} ($RES_BND_246) (224) [SCAL] (1) tank1.port_b_H_flow_bottom[1] = smooth(0, tank1.ports[1].m_flow * (if $SEV_28 then pipe1.port_b.h_outflow else tank1.ports[1].h_outflow)) ($RES_SIM_111) (225) [ARRY] (1) tank3.heatTransfer.Ts = {tank3.heatTransfer.states.p} ($RES_BND_247) (226) [SCAL] (1) tank2.port_b_H_flow_bottom[3] = smooth(0, tank2.ports[3].m_flow * (if $SEV_16 then pipe1.port_a.h_outflow else tank2.ports[3].h_outflow)) ($RES_SIM_72) (227) [ARRY] (2) tank3.portsData_diameter = tank3.portsData.diameter ($RES_BND_248) (228) [SCAL] (1) tank2.port_b_H_flow_bottom[2] = smooth(0, tank2.ports[2].m_flow * (if $SEV_17 then pipe2.port_b.h_outflow else tank2.ports[2].h_outflow)) ($RES_SIM_73) (229) [SCAL] (1) tank1.Qb_flow = tank1.heatTransfer.Q_flows[1] ($RES_SIM_113) (230) [ARRY] (2) tank3.portsData_height = tank3.portsData.height ($RES_BND_249) (231) [SCAL] (1) tank2.port_b_H_flow_bottom[1] = smooth(0, tank2.ports[1].m_flow * (if $SEV_18 then pipe3.port_b.h_outflow else tank2.ports[1].h_outflow)) ($RES_SIM_74) (232) [SCAL] (1) tank1.Hb_flow = $FUN_7 ($RES_SIM_114) (233) [SCAL] (1) tank1.mb_flow = $FUN_6 ($RES_SIM_115) (234) [SCAL] (1) tank2.Qb_flow = tank2.heatTransfer.Q_flows[1] ($RES_SIM_76) (235) [SCAL] (1) tank1.fluidVolume = tank1.crossArea * tank1.level + tank1.V0 ($RES_SIM_116) (236) [SCAL] (1) tank2.Hb_flow = $FUN_9 ($RES_SIM_77) (237) [SCAL] (1) valveDiscrete.port_a.h_outflow = tank3.ports[1].h_outflow ($RES_SIM_190) (238) [SCAL] (1) tank2.mb_flow = $FUN_8 ($RES_SIM_78) (239) [SCAL] (1) 995.586 * valveDiscrete.V_flow = if open.k then valveDiscrete.k * valveDiscrete.dp else valveDiscrete.k * valveDiscrete.opening_min * valveDiscrete.dp ($RES_SIM_191) (240) [SCAL] (1) tank1.bottomArea[1] = 3.141592653589793 * (tank1.portsData_diameter2[1] / 2.0) ^ 2.0 ($RES_SIM_118) (241) [SCAL] (1) tank2.fluidVolume = tank2.crossArea * tank2.level + tank2.V0 ($RES_SIM_79) (242) [SCAL] (1) ambient_fixed.ports[1].p = ambient_fixed.p ($RES_SIM_192) (243) [SCAL] (1) tank1.ports_emptyPipeHysteresis[1] = tank1.portsData_diameter2[1] * tank1.hysteresisFactor ($RES_SIM_119) (244) [SCAL] (1) ambient_fixed.ports[1].h_outflow = 4184.0 * ((-273.15) + ambient_fixed.T) ($RES_SIM_193) (245) [SCAL] (1) $SEV_6 = pipe2.flowModel.m_flows[1] > 0.0 ($RES_EVT_360) (246) [SCAL] (1) $SEV_8 = pipe1.flowModel.m_flows[1] > 0.0 ($RES_EVT_362) (247) [FOR-] (3) ($RES_EVT_363) (247) [----] for $i1 in 1:3 loop (247) [----] [SCAL] (1) $SEV_9[$i1] = tank2.level >= (tank2.portsData_height2[$i1] + tank2.ports_emptyPipeHysteresis[$i1]) ($RES_EVT_364) (247) [----] end for; (248) [FOR-] (3) ($RES_EVT_365) (248) [----] for $i1 in 1:3 loop (248) [----] [SCAL] (1) $SEV_10[$i1] = tank2.level >= (tank2.portsData_height2[$i1] - tank2.ports_emptyPipeHysteresis[$i1]) ($RES_EVT_366) (248) [----] end for; (249) [FOR-] (3) ($RES_EVT_367) (249) [----] for $i1 in 1:3 loop (249) [----] [SCAL] (1) $SEV_11[$i1] = $TEV_0 and $SEV_10[$i1] ($RES_EVT_368) (249) [----] end for; (250) [FOR-] (3) ($RES_EVT_369) (250) [----] for $i1 in 1:3 loop (250) [----] [SCAL] (1) $SEV_12[$i1] = $SEV_9[$i1] or $SEV_11[$i1] ($RES_EVT_370) (250) [----] end for; (251) [ARRY] (1) tank1.heatTransfer.surfaceAreas = {2.0 * $FUN_20 * tank1.level + tank1.crossArea} ($RES_BND_253) (252) [ARRY] (1) tank1.heatTransfer.Ts = {tank1.heatTransfer.states.p} ($RES_BND_254)