Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr Modelica_3.1_Modelica.Fluid.Examples.Tanks.EmptyTanks.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.Tanks.EmptyTanks,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.1_Modelica.Fluid.Examples.Tanks.EmptyTanks") translateModel(Modelica.Fluid.Examples.Tanks.EmptyTanks,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="Modelica_3.1_Modelica.Fluid.Examples.Tanks.EmptyTanks") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001233/0.001234, allocations: 101.6 kB / 16.42 MB, free: 6.52 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.001177/0.001177, allocations: 186 kB / 17.35 MB, free: 5.73 MB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/package.mo): time 1.345/1.345, allocations: 205.1 MB / 223.2 MB, free: 12.23 MB / 190.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 2.316e-05/2.317e-05, allocations: 7.062 kB / 327.2 MB, free: 3.344 MB / 270.1 MB Notification: Performance of NFInst.instantiate(Modelica.Fluid.Examples.Tanks.EmptyTanks): time 0.01536/0.01539, allocations: 15.85 MB / 343 MB, free: 3.418 MB / 286.1 MB Notification: Performance of NFInst.instExpressions: time 0.008813/0.02424, allocations: 6.842 MB / 349.9 MB, free: 12.56 MB / 302.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.0005897/0.02485, allocations: 23.81 kB / 349.9 MB, free: 12.54 MB / 302.1 MB Notification: Performance of NFTyping.typeComponents: time 0.0007719/0.02563, allocations: 333.9 kB / 350.2 MB, free: 12.21 MB / 302.1 MB Notification: Performance of NFTyping.typeBindings: time 0.002203/0.02785, allocations: 1.065 MB / 351.3 MB, free: 11.14 MB / 302.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.003725/0.03158, allocations: 1.796 MB / 353.1 MB, free: 9.34 MB / 302.1 MB Notification: Performance of NFFlatten.flatten: time 0.002372/0.03396, allocations: 2.444 MB / 355.5 MB, free: 6.887 MB / 302.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0007205/0.0347, allocations: 0.6231 MB / 356.1 MB, free: 6.246 MB / 302.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.001028/0.03573, allocations: 0.9735 MB / 357.1 MB, free: 5.27 MB / 302.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.0008411/0.03659, allocations: 0.7981 MB / 357.9 MB, free: 4.469 MB / 302.1 MB Notification: Performance of NFPackage.collectConstants: time 0.0001153/0.03671, allocations: 84 kB / 358 MB, free: 4.387 MB / 302.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.001842/0.03856, allocations: 1.225 MB / 359.2 MB, free: 3.16 MB / 302.1 MB Notification: Performance of combineBinaries: time 0.001304/0.03988, allocations: 1.707 MB / 360.9 MB, free: 1.438 MB / 302.1 MB Notification: Performance of replaceArrayConstructors: time 0.0007595/0.04065, allocations: 1.035 MB / 362 MB, free: 400 kB / 302.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0001634/0.04082, allocations: 143.6 kB / 362.1 MB, free: 256 kB / 302.1 MB Notification: Performance of FrontEnd: time 0.0001373/0.04096, allocations: 23.88 kB / 362.1 MB, free: 232 kB / 302.1 MB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 138 (127) * Number of variables: 142 (130) Notification: Performance of Bindings: time 0.004323/0.04529, allocations: 4.555 MB / 366.7 MB, free: 11.51 MB / 318.1 MB Notification: Performance of FunctionAlias: time 0.0004501/0.04575, allocations: 412 kB / 367.1 MB, free: 11.1 MB / 318.1 MB Notification: Performance of Early Inline: time 0.002672/0.04843, allocations: 2.646 MB / 369.7 MB, free: 8.41 MB / 318.1 MB Notification: Performance of simplify1: time 0.0002092/0.04865, allocations: 175.8 kB / 369.9 MB, free: 8.238 MB / 318.1 MB Notification: Performance of Alias: time 0.002658/0.05132, allocations: 2.228 MB / 372.1 MB, free: 5.812 MB / 318.1 MB Notification: Performance of simplify2: time 0.0001905/0.05152, allocations: 163.8 kB / 372.3 MB, free: 5.652 MB / 318.1 MB Notification: Performance of Events: time 0.000823/0.05235, allocations: 0.6652 MB / 373 MB, free: 4.961 MB / 318.1 MB Notification: Performance of Detect States: time 0.0007697/0.05313, allocations: 0.7073 MB / 373.7 MB, free: 4.234 MB / 318.1 MB Notification: Performance of Partitioning: time 0.001142/0.05429, allocations: 0.9504 MB / 374.6 MB, free: 3.215 MB / 318.1 MB Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (136/148) **************************** (1) [ALGB] (1) Real[1] tank2.ports_H_flow (min = {-1e8 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1000.0 for $i1 in 1:1}) (2) [ALGB] (1) Real[1] tank1.ports_H_flow (min = {-1e8 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1000.0 for $i1 in 1:1}) (3) [ALGB] (1) Real[1] tank2.portInDensities (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}) (4) [ALGB] (1) Real[1] tank1.vessel_ps_static (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}) (5) [ALGB] (2) Real[2] pipe.flowModel.rhos = {Modelica.Fluid.Examples.Tanks.EmptyTanks.pipe.flowModel.Medium.density(pipe.flowModel.states[$i1]) for $i1 in 1:2} (start = {1.0 for $i1 in 1:2}, min = {0.0 for $i1 in 1:2}, max = {1e5 for $i1 in 1:2}, nominal = {1.0 for $i1 in 1:2}) (6) [DISC] (1) Boolean $SEV_26 (7) [DISC] (1) Boolean $SEV_25 (8) [ALGB] (1) Real[1] pipe.flowModel.mus_act (start = {0.001 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {0.001 for $i1 in 1:1}) (9) [DISC] (1) Boolean $SEV_24 (10) [ALGB] (1) protected Real[1] tank2.portsData_zeta_out (11) [DISC] (1) Boolean $SEV_23 (12) [ALGB] (1) protected Real[1] tank2.portsData_zeta_out_internal = tank2.portsData.zeta_out (13) [DISC] (1) Boolean $SEV_22 (14) [DISC] (1) Boolean $SEV_21 (15) [DISC] (1) Boolean $SEV_20 (16) [ALGB] (2) Real[2] pipe.flowModel.mus = {Modelica.Fluid.Examples.Tanks.EmptyTanks.pipe.flowModel.Medium.dynamicViscosity(pipe.flowModel.states[$i1]) for $i1 in 1:2} (start = {0.001 for $i1 in 1:2}, min = {0.0 for $i1 in 1:2}, max = {1e8 for $i1 in 1:2}, nominal = {0.001 for $i1 in 1:2}) (17) [DISC] (1) protected Boolean[1] tank2.regularFlow (start = {true for $i1 in 1:1}) (18) [ALGB] (1) Real[1] pipe.flowModel.m_flows (start = {0.0 for $i1 in 1:1}, min = {-1e60 for $i1 in 1:1}, max = {1e5 for $i1 in 1:1}, StateSelect = default) (19) [ALGB] (1) protected Real[1] tank2.portsData_zeta_in_internal = tank2.portsData.zeta_in (20) [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}) (21) [ALGB] (1) Real[1] pipe.flowModel.Fs_p (22) [ALGB] (2) final Real[2] pipe.flowModel.dimensions = {(4.0 * pipe.crossArea) / pipe.perimeter, (4.0 * pipe.crossArea) / pipe.perimeter} (23) [ALGB] (1) protected Real[1] tank1.portsData_zeta_out_internal = tank1.portsData.zeta_out (24) [DISC] (1) Boolean $SEV_19 (25) [DISC] (1) Boolean $SEV_18 (26) [DISC] (1) Boolean $SEV_17 (27) [DISC] (1) Boolean $SEV_16 (28) [DISC] (1) Boolean $SEV_15 (29) [DISC] (1) Boolean $SEV_10 (30) [ALGB] (1) Real[1] tank1.heatTransfer.surfaceAreas = {sqrt(3.141592653589793 * tank1.crossArea) * 2.0 * tank1.fluidLevel + tank1.crossArea} (31) [ALGB] (1) Real[1] tank2.s (start = {tank2.fluidLevel_max for $i1 in 1:1}) (32) [ALGB] (1) stream Real pipe.port_a.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (33) [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}) (34) [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}) (35) [DISC] (1) protected Boolean[1] tank1.regularFlow (start = {true for $i1 in 1:1}) (36) [ALGB] (1) Real tank2.medium.state.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (37) [ALGB] (1) Real tank2.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - tank2.medium.T_degC)) (38) [ALGB] (1) Real[1] pipe.flowModel.Fs_fg (39) [ALGB] (1) Real tank1.mb_flow (40) [ALGB] (1) protected Real[1] tank1.portsData_zeta_out (41) [ALGB] (1) protected Real[1] tank1.portsData_height_internal = tank1.portsData.height (42) [ALGB] (1) Real tank1.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - tank1.medium.T_degC)) (43) [ALGB] (1) stream Real pipe.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (44) [ALGB] (1) protected final Real tank1.fluidLevel = tank1.fluidLevel (min = 0.0) (45) [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}) (46) [ALGB] (1) flow Real[1] tank2.heatTransfer.heatPorts.Q_flow (47) [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}) (48) [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}) (49) [ALGB] (1) Real $FUN_9 (50) [ALGB] (1) final Real tank1.fluidVolume = tank1.fluidVolume (51) [ALGB] (1) Real[1] pipe.flowModel.Is (52) [ALGB] (1) Real $FUN_8 (53) [ALGB] (1) Real $FUN_7 (54) [ALGB] (1) Real tank2.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (55) [ALGB] (1) Real $FUN_6 (56) [DISC] (1) protected Boolean[1] tank1.inFlow (start = {false for $i1 in 1:1}) (57) [ALGB] (1) Real $FUN_4 (58) [ALGB] (1) protected Real[1] tank2.portsData_height_internal = tank2.portsData.height (59) [ALGB] (1) protected Real[1] tank2.portsData_diameter_internal = tank2.portsData.diameter (60) [ALGB] (1) Real $FUN_3 (61) [ALGB] (1) protected Real[1] tank2.portsData_diameter (62) [ALGB] (1) Real $FUN_2 (63) [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}) (64) [ALGB] (1) Real tank2.mb_flow (65) [ALGB] (1) Real pipe.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (66) [ALGB] (1) Real[1] pipe.flowModel.rhos_act (start = {1.0 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, max = {1e5 for $i1 in 1:1}, nominal = {1.0 for $i1 in 1:1}) (67) [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}) (68) [ALGB] (1) flow Real pipe.port_b.m_flow (min = -1e5, max = 1e60) (69) [ALGB] (1) Real[1] tank2.heatTransfer.Q_flows (70) [ALGB] (1) protected Real pipe.flowModel.dp_fric_nominal = sum({Modelica.Fluid.Examples.Tanks.EmptyTanks.pipe.flowModel.WallFriction.pressureLoss_m_flow(pipe.flowModel.m_flow_nominal / pipe.flowModel.nParallel, pipe.flowModel.rho_nominal, pipe.flowModel.rho_nominal, pipe.flowModel.mu_nominal, pipe.flowModel.mu_nominal, pipe.flowModel.pathLengths_internal[1], pipe.flowModel.diameters[1], ((pipe.flowModel.crossAreas[2:2] + pipe.flowModel.crossAreas[1:1]) / 2.0)[1], ((pipe.flowModel.roughnesses[2:2] + pipe.flowModel.roughnesses[1:1]) / 2.0)[1], pipe.flowModel.m_flow_small / pipe.flowModel.nParallel, pipe.flowModel.Res_turbulent_internal[1])}) (min = 0.0, nominal = 1e5) (71) [DER-] (1) Real $DER.tank1.U (72) [ALGB] (1) Real[1] tank2.ports.p (start = {1e5 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1e5 for $i1 in 1:1}) (73) [ALGB] (1) stream Real[1] tank2.ports.h_outflow (min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (74) [ALGB] (1) Real[1] tank1.s (start = {tank1.fluidLevel_max for $i1 in 1:1}) (75) [ALGB] (1) Real tank1.Hb_flow (76) [ALGB] (1) Real[1] pipe.flowModel.pathLengths_internal = pipe.flowModel.pathLengths (77) [ALGB] (1) protected Real[1] tank1.portsData_height (78) [ALGB] (1) final Real[1] pipe.flowModel.pathLengths = {pipe.length} (79) [ALGB] (1) final Real[1] pipe.flowModel.dheights = {pipe.height_ab} (80) [ALGB] (1) Real[1] pipe.flowModel.dps_fg (start = {pipe.flowModel.p_a_start - pipe.flowModel.p_b_start for $i1 in 1:1}) (81) [ALGB] (1) protected Real[1] tank1.portsData_zeta_in (82) [ALGB] (1) Real $FUN_11 (83) [ALGB] (1) Real[1] tank2.portVelocities (84) [ALGB] (1) protected Real[1] tank1.portsData_diameter_internal = tank1.portsData.diameter (85) [DER-] (1) Real $DER.tank1.m (86) [DISC] (1) Boolean $SEV_9 (87) [DISC] (1) Boolean $SEV_8 (88) [DISC] (1) Boolean $SEV_7 (89) [DISC] (1) Boolean $SEV_6 (90) [DISC] (1) Boolean $SEV_5 (91) [DISC] (1) Boolean $SEV_4 (92) [ALGB] (2) Real[2] pipe.flowModel.vs = {(-pipe.port_b.m_flow) / (pipe.flowModel.crossAreas[1] * Modelica.Fluid.Examples.Tanks.EmptyTanks.pipe.Medium.density(pipe.flowModel.states[1])), -pipe.port_b.m_flow / (Modelica.Fluid.Examples.Tanks.EmptyTanks.pipe.Medium.density(pipe.flowModel.states[2]) * pipe.flowModel.crossAreas[2])} / pipe.nParallel (93) [DISC] (1) Boolean $SEV_3 (94) [DISC] (1) Boolean $SEV_2 (95) [ALGB] (1) protected Real[1] tank2.portsData_height (96) [DISC] (1) Boolean $SEV_1 (97) [DISC] (1) Boolean $SEV_0 (98) [ALGB] (1) protected Real[1] tank1.portsData_diameter (99) [ALGB] (1) Real[1] tank1.heatTransfer.Ts = {Modelica.Fluid.Examples.Tanks.EmptyTanks.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}) (100) [ALGB] (1) Real tank2.Hb_flow (101) [ALGB] (1) protected Real[1] tank1.portsData_zeta_in_internal = tank1.portsData.zeta_in (102) [ALGB] (1) Real[1] pipe.flowModel.Res_turbulent_internal = pipe.flowModel.Re_turbulent * {1.0 for $i1 in 1:1} (103) [ALGB] (1) Real pipe.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (104) [ALGB] (1) Real[1] tank2.ports_E_flow (105) [ALGB] (1) Real[1] tank1.ports_E_flow (106) [ALGB] (2) final Real[2] pipe.flowModel.roughnesses = {pipe.roughness, pipe.roughness} (min = {0.0 for $i1 in 1:2}) (107) [ALGB] (1) Real[1] tank1.ports_penetration (108) [ALGB] (1) Real tank1.medium.state.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (109) [ALGB] (1) Real[1] tank1.portAreas = {tank1.portsData_diameter[1] ^ 2.0 * 0.7853981633974483} (110) [DER-] (1) Real $DER.tank2.U (111) [ALGB] (1) Real[1] tank1.m_flow_turbulent (112) [ALGB] (1) Real tank1.Qb_flow (113) [ALGB] (1) Real[1] tank2.m_flow_turbulent (114) [ALGB] (1) Real[1] tank2.portAreas = {tank2.portsData_diameter[1] ^ 2.0 * 0.7853981633974483} (115) [ALGB] (1) Real[1] tank1.heatTransfer.Q_flows (116) [DER-] (1) Real $DER.tank2.m (117) [DISC] (1) protected Boolean[1] tank2.inFlow (start = {false for $i1 in 1:1}) (118) [ALGB] (1) Real tank1.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (119) [ALGB] (1) Real[1] tank1.portInDensities (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}) (120) [ALGB] (1) Real[1] tank2.heatTransfer.Ts = {Modelica.Fluid.Examples.Tanks.EmptyTanks.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}) (121) [ALGB] (4) input Real[2, 2] pipe.flowModel.states.p (start = {1e5 for $i1 in 1:2}, min = {0.0 for $i1 in 1:2}, max = {1e8 for $i1 in 1:2}, nominal = {1e5 for $i1 in 1:2}) (122) [ALGB] (1) Real tank2.Qb_flow (123) [ALGB] (1) flow Real[1] tank1.heatTransfer.heatPorts.Q_flow (124) [ALGB] (1) flow Real[1] tank2.ports.m_flow (min = {-1e5 for $i1 in 1:1}, max = {1e5 for $i1 in 1:1}) (125) [ALGB] (1) flow Real[1] tank1.ports.m_flow (min = {-1e5 for $i1 in 1:1}, max = {1e5 for $i1 in 1:1}) (126) [ALGB] (1) Real[1] tank2.ports_penetration (127) [ALGB] (2) final Real[2] pipe.flowModel.crossAreas = {pipe.crossArea, pipe.crossArea} (128) [ALGB] (4) input Real[2, 2] pipe.flowModel.states.T (start = {288.15 for $i1 in 1:2}, min = {1.0 for $i1 in 1:2}, max = {1e4 for $i1 in 1:2}, nominal = {300.0 for $i1 in 1:2}) (129) [ALGB] (1) Real[1] tank2.heatTransfer.surfaceAreas = {sqrt(3.141592653589793 * tank2.crossArea) * 2.0 * tank2.fluidLevel + tank2.crossArea} (130) [ALGB] (1) Real[1] tank1.portVelocities (131) [ALGB] (1) final Real tank2.fluidVolume = tank2.fluidVolume (132) [ALGB] (1) protected Real[1] pipe.flowModel.diameters = 0.5 * (pipe.flowModel.dimensions[2:2] + pipe.flowModel.dimensions[1:1]) (133) [ALGB] (1) protected final Real tank2.fluidLevel = tank2.fluidLevel (min = 0.0) (134) [ALGB] (1) Real[1] pipe.flowModel.Ib_flows (135) [ALGB] (1) protected Real[1] tank2.portsData_zeta_in (136) [ALGB] (1) Real[1] tank2.vessel_ps_static (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}) System Equations (133/144) **************************** (1) [SCAL] (1) tank1.ports_H_flow[1] = smooth(0, tank1.ports[1].m_flow * (if $SEV_24 then pipe.port_a.h_outflow else tank1.ports[1].h_outflow)) ($RES_SIM_80) (2) [ARRY] (1) tank1.portsData_diameter = tank1.portsData_diameter_internal ($RES_SIM_120) (3) [SCAL] (1) tank1.m_flow_turbulent[1] = tank1.m_flow_small ($RES_SIM_81) (4) [SCAL] (1) tank1.portVelocities[1] = smooth(0, 0.0010044335697769957 * (tank1.ports[1].m_flow / tank1.portAreas[1])) ($RES_SIM_82) (5) [SCAL] (1) tank1.portInDensities[1] = 995.586 ($RES_SIM_83) (6) [SCAL] (1) tank1.Qb_flow = tank1.heatTransfer.Q_flows[1] ($RES_SIM_86) (7) [SCAL] (1) tank1.Hb_flow = $FUN_2 + $FUN_3 ($RES_SIM_87) (8) [SCAL] (1) tank1.vessel_ps_static[1] = 995.586 * system.g * max(0.0, tank1.fluidLevel - tank1.portsData_height[1]) + tank1.p_ambient ($RES_SIM_89) (9) [SCAL] (1) tank2.ports_penetration[1] = smooth(1, if $SEV_0 then 1.0 else if $SEV_1 then 0.001 else if $SEV_2 then 0.5005 - 0.24975 * ((-3.0) + ((tank2.fluidLevel - (0.1 * tank2.portsData_diameter[1] + tank2.portsData_height[1])) / (0.1 * tank2.portsData_diameter[1])) ^ 2.0) * ((10.0 * (tank2.fluidLevel - (tank2.portsData_height[1] + 0.1 * tank2.portsData_diameter[1]))) / tank2.portsData_diameter[1]) else 0.5005) ($RES_SIM_10) (10) [SCAL] (1) tank2.regularFlow[1] = $SEV_3 ($RES_SIM_11) (11) [SCAL] (1) tank2.inFlow[1] = $SEV_4 ($RES_SIM_12) (12) [-IF-] (1)if tank2.regularFlow[1] then (12) [----] [SCAL] (1) tank2.ports[1].p = tank2.vessel_ps_static[1] + (0.5 / tank2.portAreas[1] ^ 2.0) * smooth(2, if $SEV_5 then (tank2.ports_penetration[1] * ((-1.0) + tank2.portAreas[1] ^ 2.0 / tank2.vesselArea ^ 2.0 + tank2.portsData_zeta_in[1]) * tank2.ports[1].m_flow ^ 2.0) / tank2.portInDensities[1] else if $SEV_6 then -(((1.0 + tank2.portsData_zeta_out[1]) - tank2.portAreas[1] ^ 2.0 / tank2.vesselArea ^ 2.0) * tank2.ports[1].m_flow ^ 2.0) / (tank2.ports_penetration[1] * 995.586) else if $SEV_7 then Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(tank2.ports[1].m_flow, tank2.m_flow_turbulent[1], (tank2.ports_penetration[1] * ((-1.0) + tank2.portAreas[1] ^ 2.0 / tank2.vesselArea ^ 2.0 + tank2.portsData_zeta_in[1])) / tank2.portInDensities[1], ((1.0 + tank2.portsData_zeta_out[1]) - tank2.portAreas[1] ^ 2.0 / tank2.vesselArea ^ 2.0) / (tank2.ports_penetration[1] * 995.586), false, 1.0) else -Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(-tank2.ports[1].m_flow, tank2.m_flow_turbulent[1], ((1.0 + tank2.portsData_zeta_out[1]) - tank2.portAreas[1] ^ 2.0 / tank2.vesselArea ^ 2.0) / (tank2.ports_penetration[1] * 995.586), (tank2.ports_penetration[1] * ((-1.0) + tank2.portAreas[1] ^ 2.0 / tank2.vesselArea ^ 2.0 + tank2.portsData_zeta_in[1])) / tank2.portInDensities[1], false, 1.0)) ($RES_SIM_14) (12) [----] elseif tank2.inFlow[1] then (12) [----] [SCAL] (1) tank2.ports[1].p = tank2.vessel_ps_static[1] ($RES_SIM_15) (12) [----] else (12) [----] [SCAL] (1) tank2.ports[1].m_flow = 0.0 ($RES_SIM_16) (12) [----] end if; (13) [-IF-] (1)if tank2.regularFlow[1] then (13) [----] [SCAL] (1) tank2.s[1] = tank2.fluidLevel - tank2.portsData_height[1] ($RES_SIM_18) (13) [----] elseif tank2.inFlow[1] then (13) [----] [SCAL] (1) tank2.s[1] = tank2.ports[1].m_flow ($RES_SIM_19) (13) [----] else (13) [----] [SCAL] (1) tank2.s[1] = ((tank2.ports[1].p - tank2.vessel_ps_static[1]) / 101325.0) * (tank2.portsData_height[1] - tank2.fluidLevel) ($RES_SIM_20) (13) [----] end if; (14) [SCAL] (1) tank1.fluidVolume = tank1.crossArea * tank1.fluidLevel ($RES_SIM_92) (15) [ARRY] (1) tank1.heatTransfer.Q_flows = tank1.heatTransfer.heatPorts.Q_flow ($RES_SIM_93) (16) [ARRY] (1) tank1.heatTransfer.Ts = tank1.heatTransfer.heatPorts.T ($RES_SIM_94) (17) [SCAL] (1) tank1.medium.state.p = tank1.p_ambient ($RES_SIM_99) (18) [SCAL] (1) tank2.ports[1].h_outflow = 4184.0 * ((-273.15) - ((-273.15) - tank2.medium.T_degC)) ($RES_SIM_21) (19) [SCAL] (1) tank2.ports_E_flow[1] = tank2.ports[1].m_flow * (0.5 * tank2.portVelocities[1] * tank2.portVelocities[1] + system.g * tank2.portsData_height[1]) ($RES_SIM_22) (20) [SCAL] (1) tank2.ports_H_flow[1] = smooth(0, tank2.ports[1].m_flow * (if $SEV_8 then pipe.port_b.h_outflow else tank2.ports[1].h_outflow)) ($RES_SIM_23) (21) [SCAL] (1) tank2.m_flow_turbulent[1] = tank2.m_flow_small ($RES_SIM_24) (22) [SCAL] (1) tank2.portVelocities[1] = smooth(0, 0.0010044335697769957 * (tank2.ports[1].m_flow / tank2.portAreas[1])) ($RES_SIM_25) (23) [SCAL] (1) tank2.portInDensities[1] = 995.586 ($RES_SIM_26) (24) [SCAL] (1) tank2.Qb_flow = tank2.heatTransfer.Q_flows[1] ($RES_SIM_29) (25) [SCAL] (1) tank2.Hb_flow = $FUN_6 + $FUN_7 ($RES_SIM_30) (26) [SCAL] (1) tank2.vessel_ps_static[1] = 995.586 * system.g * max(0.0, tank2.fluidLevel - tank2.portsData_height[1]) + tank2.p_ambient ($RES_SIM_32) (27) [ARRY] (1) tank1.heatTransfer.surfaceAreas = {2.0 * $FUN_11 * tank1.fluidLevel + tank1.crossArea} ($RES_BND_124) (28) [ARRY] (1) tank1.heatTransfer.Ts = {tank1.heatTransfer.states.p} ($RES_BND_125) (29) [SCAL] (1) tank2.fluidVolume = tank2.crossArea * tank2.fluidLevel ($RES_SIM_35) (30) [ARRY] (1) tank1.portAreas = {0.7853981633974483 * tank1.portsData_diameter[1] ^ 2.0} ($RES_BND_126) (31) [ARRY] (1) tank2.heatTransfer.Q_flows = tank2.heatTransfer.heatPorts.Q_flow ($RES_SIM_36) (32) [ARRY] (1) tank2.heatTransfer.Ts = tank2.heatTransfer.heatPorts.T ($RES_SIM_37) (33) [ARRY] (1) tank1.portsData_diameter_internal = tank1.portsData.diameter ($RES_BND_128) (34) [ARRY] (1) tank1.portsData_height_internal = tank1.portsData.height ($RES_BND_129) (35) [SCAL] (1) tank1.mb_flow = sum(tank1.ports.m_flow) ($RES_$AUX_170) (36) [ARRY] (1) tank1.portsData_zeta_in_internal = tank1.portsData.zeta_in ($RES_BND_130) (37) [ARRY] (1) tank1.portsData_zeta_out_internal = tank1.portsData.zeta_out ($RES_BND_131) (38) [ARRY] (2) pipe.flowModel.vs = {-(0.0010044335697769957 * pipe.port_b.m_flow) / pipe.flowModel.crossAreas[1], -(0.0010044335697769957 * pipe.port_b.m_flow) / pipe.flowModel.crossAreas[2]} / pipe.nParallel ($RES_BND_132) (39) [SCAL] (1) tank2.medium.state.p = tank2.p_ambient ($RES_SIM_42) (40) [ARRY] (2) pipe.flowModel.crossAreas = {pipe.crossArea, pipe.crossArea} ($RES_BND_133) (41) [SCAL] (1) tank2.medium.state.T = -((-273.15) - tank2.medium.T_degC) ($RES_SIM_43) (42) [ARRY] (2) pipe.flowModel.dimensions = {(4.0 * pipe.crossArea) / pipe.perimeter, (4.0 * pipe.crossArea) / pipe.perimeter} ($RES_BND_134) (43) [ARRY] (2) pipe.flowModel.roughnesses = {pipe.roughness, pipe.roughness} ($RES_BND_135) (44) [SCAL] (1) $FUN_2 = sum(tank1.ports_H_flow) ($RES_$AUX_169) (45) [ARRY] (1) pipe.flowModel.dheights = {pipe.height_ab} ($RES_BND_136) (46) [SCAL] (1) $FUN_3 = sum(tank1.ports_E_flow) ($RES_$AUX_168) (47) [ARRY] (1) pipe.flowModel.pathLengths = {pipe.length} ($RES_BND_137) (48) [SCAL] (1) $FUN_4 = Modelica.Fluid.Examples.Tanks.EmptyTanks.pipe.flowModel.WallFriction.massFlowRate_dp_staticHead(pipe.flowModel.dps_fg[1], pipe.flowModel.rhos[1], pipe.flowModel.rhos[2], pipe.flowModel.mus[1], pipe.flowModel.mus[2], pipe.flowModel.pathLengths_internal[1], pipe.flowModel.diameters[1], (pipe.flowModel.g * pipe.flowModel.dheights)[1], (0.5 .* (pipe.flowModel.crossAreas[1:1] + pipe.flowModel.crossAreas[2:2]))[1], (0.5 .* (pipe.flowModel.roughnesses[1:1] + pipe.flowModel.roughnesses[2:2]))[1], pipe.flowModel.dp_small, pipe.flowModel.Res_turbulent_internal[1]) ($RES_$AUX_167) (49) [FOR-] (2) ($RES_BND_138) (49) [----] for $i1 in 1:2 loop (49) [----] [SCAL] (1) pipe.flowModel.rhos[$i1] = 995.586 ($RES_BND_139) (49) [----] end for; (50) [SCAL] (1) tank2.mb_flow = sum(tank2.ports.m_flow) ($RES_$AUX_166) (51) [SCAL] (1) $FUN_6 = sum(tank2.ports_H_flow) ($RES_$AUX_165) (52) [SCAL] (1) $FUN_7 = sum(tank2.ports_E_flow) ($RES_$AUX_164) (53) [SCAL] (1) $FUN_8 = sqrt(3.141592653589793 * tank2.crossArea) ($RES_$AUX_163) (54) [SCAL] (1) $FUN_9 = Modelica.Fluid.Examples.Tanks.EmptyTanks.pipe.flowModel.WallFriction.pressureLoss_m_flow(pipe.flowModel.m_flow_nominal / pipe.flowModel.nParallel, pipe.flowModel.rho_nominal, pipe.flowModel.rho_nominal, pipe.flowModel.mu_nominal, pipe.flowModel.mu_nominal, pipe.flowModel.pathLengths_internal[1], pipe.flowModel.diameters[1], (0.5 .* (pipe.flowModel.crossAreas[2:2] + pipe.flowModel.crossAreas[1:1]))[1], (0.5 .* (pipe.flowModel.roughnesses[2:2] + pipe.flowModel.roughnesses[1:1]))[1], pipe.flowModel.m_flow_small / pipe.flowModel.nParallel, pipe.flowModel.Res_turbulent_internal[1]) ($RES_$AUX_162) (55) [SCAL] (1) pipe.flowModel.dp_fric_nominal = sum({$FUN_9}) ($RES_$AUX_161) (56) [SCAL] (1) $FUN_11 = sqrt(3.141592653589793 * tank1.crossArea) ($RES_$AUX_160) (57) [FOR-] (2) ($RES_BND_140) (57) [----] for $i1 in 1:2 loop (57) [----] [SCAL] (1) pipe.flowModel.mus[$i1] = 0.001 ($RES_BND_141) (57) [----] end for; (58) [SCAL] (1) $SEV_0 = tank2.fluidLevel - (tank2.portsData_height[1] + 0.1 * tank2.portsData_diameter[1]) > 0.1 * tank2.portsData_diameter[1] ($RES_EVT_177) (59) [ARRY] (1) pipe.flowModel.pathLengths_internal = pipe.flowModel.pathLengths ($RES_BND_142) (60) [SCAL] (1) pipe.port_a.h_outflow = tank2.ports[1].h_outflow + system.g * pipe.height_ab ($RES_SIM_51) (61) [SCAL] (1) $SEV_1 = tank2.fluidLevel - (tank2.portsData_height[1] + 0.1 * tank2.portsData_diameter[1]) < (-0.1 * tank2.portsData_diameter[1]) ($RES_EVT_178) (62) [SCAL] (1) pipe.flowModel.Res_turbulent_internal[1] = pipe.flowModel.Re_turbulent ($RES_BND_143) (63) [SCAL] (1) pipe.port_b.h_outflow = tank1.ports[1].h_outflow - system.g * pipe.height_ab ($RES_SIM_52) (64) [SCAL] (1) $SEV_2 = 0.1 * tank2.portsData_diameter[1] > 0.0 ($RES_EVT_179) (65) [ARRY] (1) pipe.flowModel.diameters = 0.5 * (pipe.flowModel.dimensions[2:2] + pipe.flowModel.dimensions[1:1]) ($RES_BND_144) (66) [SCAL] (1) tank2.m = 995.586 * tank2.fluidVolume ($RES_SIM_9) (67) [SCAL] (1) -pipe.port_b.m_flow = pipe.flowModel.m_flows[1] ($RES_SIM_54) (68) [SCAL] (1) tank2.U = tank2.m * (4184.0 * ((-273.15) - ((-273.15) - tank2.medium.T_degC))) ($RES_SIM_8) (69) [ARRY] (1) {0.0} = pipe.flowModel.Ib_flows - (pipe.flowModel.Fs_fg + pipe.flowModel.Fs_p) ($RES_SIM_55) (70) [SCAL] (1) $DER.tank2.U = tank2.Qb_flow + tank2.Hb_flow ($RES_SIM_7) (71) [ARRY] (1) pipe.flowModel.Is = {pipe.flowModel.m_flows[1] * pipe.flowModel.pathLengths[1]} ($RES_SIM_56) (72) [SCAL] (1) $DER.tank2.m = tank2.mb_flow ($RES_SIM_6) (73) [ARRY] (1) pipe.flowModel.dps_fg = {(2.0 * (pipe.flowModel.Fs_fg[1] / pipe.flowModel.nParallel)) / (pipe.flowModel.crossAreas[1] + pipe.flowModel.crossAreas[2])} ($RES_SIM_57) (74) [ARRY] (1) pipe.flowModel.Fs_p = pipe.flowModel.nParallel * {0.5 * (pipe.flowModel.crossAreas[1] + pipe.flowModel.crossAreas[2]) * (pipe.flowModel.states.T - pipe.flowModel.states.T)} ($RES_SIM_58) (75) [ARRY] (1) tank2.heatTransfer.surfaceAreas = {2.0 * $FUN_8 * tank2.fluidLevel + tank2.crossArea} ($RES_BND_149) (76) [ARRY] (1) pipe.flowModel.Ib_flows = {0.0} ($RES_SIM_59) (77) [SCAL] (1) $SEV_3 = tank2.fluidLevel >= tank2.portsData_height[1] ($RES_EVT_180) (78) [SCAL] (1) $SEV_4 = not tank2.regularFlow[1] and (tank2.s[1] > 0.0 or tank2.portsData_height[1] >= tank2.fluidLevel_max) ($RES_EVT_181) (79) [SCAL] (1) $SEV_5 = tank2.ports[1].m_flow >= tank2.m_flow_turbulent[1] ($RES_EVT_182) (80) [SCAL] (1) $SEV_6 = tank2.ports[1].m_flow <= (-tank2.m_flow_turbulent[1]) ($RES_EVT_183) (81) [SCAL] (1) $SEV_7 = (tank2.ports_penetration[1] * ((-1.0) + tank2.portAreas[1] ^ 2.0 / tank2.vesselArea ^ 2.0 + tank2.portsData_zeta_in[1])) / tank2.portInDensities[1] >= ((1.0 + tank2.portsData_zeta_out[1]) - tank2.portAreas[1] ^ 2.0 / tank2.vesselArea ^ 2.0) / (tank2.ports_penetration[1] * 995.586) ($RES_EVT_184) (82) [SCAL] (1) $SEV_8 = tank2.ports[1].m_flow > 0.0 ($RES_EVT_185) (83) [SCAL] (1) $SEV_9 = tank2.fluidLevel > (-1e-6 * tank2.fluidLevel_max) ($RES_EVT_186) (84) [ARRY] (1) tank2.heatTransfer.Ts = {tank2.heatTransfer.states.p} ($RES_BND_150) (85) [SCAL] (1) $SEV_10 = tank2.fluidLevel <= tank2.fluidLevel_max ($RES_EVT_187) (86) [SCAL] (1) pipe.flowModel.rhos_act[1] = noEvent(if $SEV_15 then pipe.flowModel.rhos[1] else pipe.flowModel.rhos[2]) ($RES_SIM_60) (87) [ARRY] (1) tank2.portAreas = {0.7853981633974483 * tank2.portsData_diameter[1] ^ 2.0} ($RES_BND_151) (88) [SCAL] (1) tank1.medium.state.T = -((-273.15) - tank1.medium.T_degC) ($RES_SIM_100) (89) [SCAL] (1) pipe.flowModel.mus_act[1] = noEvent(if $SEV_15 then pipe.flowModel.mus[1] else pipe.flowModel.mus[2]) ($RES_SIM_61) (90) [ARRY] (1) pipe.flowModel.m_flows = {homotopy(({$FUN_4} .* pipe.flowModel.nParallel)[1], (pipe.flowModel.m_flow_nominal / pipe.flowModel.dp_nominal * (pipe.flowModel.dps_fg - (pipe.flowModel.g * pipe.flowModel.dheights) .* pipe.flowModel.rho_nominal))[1])} ($RES_SIM_62) (91) [ARRY] (1) tank2.portsData_diameter_internal = tank2.portsData.diameter ($RES_BND_153) (92) [SCAL] (1) $DER.tank1.m = tank1.mb_flow ($RES_SIM_63) (93) [ARRY] (1) tank2.portsData_height_internal = tank2.portsData.height ($RES_BND_154) (94) [SCAL] (1) $DER.tank1.U = tank1.Qb_flow + tank1.Hb_flow ($RES_SIM_64) (95) [ARRY] (1) tank2.portsData_zeta_in_internal = tank2.portsData.zeta_in ($RES_BND_155) (96) [SCAL] (1) tank1.U = tank1.m * (4184.0 * ((-273.15) - ((-273.15) - tank1.medium.T_degC))) ($RES_SIM_65) (97) [ARRY] (1) tank2.portsData_zeta_out_internal = tank2.portsData.zeta_out ($RES_BND_156) (98) [SCAL] (1) tank1.m = 995.586 * tank1.fluidVolume ($RES_SIM_66) (99) [ARRY] (2) tank1.heatTransfer.states = {tank1.medium.state} ($RES_BND_157) (100) [SCAL] (1) tank1.ports_penetration[1] = smooth(1, if $SEV_16 then 1.0 else if $SEV_17 then 0.001 else if $SEV_18 then 0.5005 - 0.24975 * ((-3.0) + ((tank1.fluidLevel - (0.1 * tank1.portsData_diameter[1] + tank1.portsData_height[1])) / (0.1 * tank1.portsData_diameter[1])) ^ 2.0) * ((10.0 * (tank1.fluidLevel - (tank1.portsData_height[1] + 0.1 * tank1.portsData_diameter[1]))) / tank1.portsData_diameter[1]) else 0.5005) ($RES_SIM_67) (101) [ARRY] (4) pipe.flowModel.states = {Modelica.Fluid.Examples.Tanks.EmptyTanks.pipe.Medium.ThermodynamicState(pipe.port_a.p, 273.15 + 2.390057361376673e-4 * tank1.ports[1].h_outflow), Modelica.Fluid.Examples.Tanks.EmptyTanks.pipe.Medium.ThermodynamicState(pipe.port_b.p, 273.15 + 2.390057361376673e-4 * tank2.ports[1].h_outflow)} ($RES_BND_158) (102) [SCAL] (1) tank2.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_107) (103) [SCAL] (1) tank1.regularFlow[1] = $SEV_19 ($RES_SIM_68) (104) [ARRY] (2) tank2.heatTransfer.states = {tank2.medium.state} ($RES_BND_159) (105) [SCAL] (1) pipe.port_b.m_flow + tank2.ports[1].m_flow = 0.0 ($RES_SIM_108) (106) [SCAL] (1) tank1.inFlow[1] = $SEV_20 ($RES_SIM_69) (107) [SCAL] (1) tank1.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_109) (108) [SCAL] (1) $SEV_15 = pipe.flowModel.m_flows[1] > 0.0 ($RES_EVT_192) (109) [SCAL] (1) $SEV_16 = tank1.fluidLevel - (tank1.portsData_height[1] + 0.1 * tank1.portsData_diameter[1]) > 0.1 * tank1.portsData_diameter[1] ($RES_EVT_193) (110) [SCAL] (1) $SEV_17 = tank1.fluidLevel - (tank1.portsData_height[1] + 0.1 * tank1.portsData_diameter[1]) < (-0.1 * tank1.portsData_diameter[1]) ($RES_EVT_194) (111) [SCAL] (1) $SEV_18 = 0.1 * tank1.portsData_diameter[1] > 0.0 ($RES_EVT_195) (112) [SCAL] (1) $SEV_19 = tank1.fluidLevel >= tank1.portsData_height[1] ($RES_EVT_196) (113) [SCAL] (1) $SEV_20 = not tank1.regularFlow[1] and (tank1.s[1] > 0.0 or tank1.portsData_height[1] >= tank1.fluidLevel_max) ($RES_EVT_197) (114) [-IF-] (1)if tank1.regularFlow[1] then (114) [----] [SCAL] (1) tank1.ports[1].p = tank1.vessel_ps_static[1] + (0.5 / tank1.portAreas[1] ^ 2.0) * smooth(2, if $SEV_21 then (tank1.ports_penetration[1] * ((-1.0) + tank1.portAreas[1] ^ 2.0 / tank1.vesselArea ^ 2.0 + tank1.portsData_zeta_in[1]) * tank1.ports[1].m_flow ^ 2.0) / tank1.portInDensities[1] else if $SEV_22 then -(((1.0 + tank1.portsData_zeta_out[1]) - tank1.portAreas[1] ^ 2.0 / tank1.vesselArea ^ 2.0) * tank1.ports[1].m_flow ^ 2.0) / (tank1.ports_penetration[1] * 995.586) else if $SEV_23 then Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(tank1.ports[1].m_flow, tank1.m_flow_turbulent[1], (tank1.ports_penetration[1] * ((-1.0) + tank1.portAreas[1] ^ 2.0 / tank1.vesselArea ^ 2.0 + tank1.portsData_zeta_in[1])) / tank1.portInDensities[1], ((1.0 + tank1.portsData_zeta_out[1]) - tank1.portAreas[1] ^ 2.0 / tank1.vesselArea ^ 2.0) / (tank1.ports_penetration[1] * 995.586), false, 1.0) else -Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(-tank1.ports[1].m_flow, tank1.m_flow_turbulent[1], ((1.0 + tank1.portsData_zeta_out[1]) - tank1.portAreas[1] ^ 2.0 / tank1.vesselArea ^ 2.0) / (tank1.ports_penetration[1] * 995.586), (tank1.ports_penetration[1] * ((-1.0) + tank1.portAreas[1] ^ 2.0 / tank1.vesselArea ^ 2.0 + tank1.portsData_zeta_in[1])) / tank1.portInDensities[1], false, 1.0)) ($RES_SIM_71) (114) [----] elseif tank1.inFlow[1] then (114) [----] [SCAL] (1) tank1.ports[1].p = tank1.vessel_ps_static[1] ($RES_SIM_72) (114) [----] else (114) [----] [SCAL] (1) tank1.ports[1].m_flow = 0.0 ($RES_SIM_73) (114) [----] end if; (115) [SCAL] (1) pipe.port_b.p = tank2.ports[1].p ($RES_SIM_110) (116) [SCAL] (1) $SEV_21 = tank1.ports[1].m_flow >= tank1.m_flow_turbulent[1] ($RES_EVT_198) (117) [SCAL] (1) tank1.ports[1].m_flow - pipe.port_b.m_flow = 0.0 ($RES_SIM_111) (118) [SCAL] (1) $SEV_22 = tank1.ports[1].m_flow <= (-tank1.m_flow_turbulent[1]) ($RES_EVT_199) (119) [SCAL] (1) tank1.ports[1].p = pipe.port_a.p ($RES_SIM_112) (120) [ARRY] (1) tank2.portsData_zeta_out = tank2.portsData_zeta_out_internal ($RES_SIM_113) (121) [-IF-] (1)if tank1.regularFlow[1] then (121) [----] [SCAL] (1) tank1.s[1] = tank1.fluidLevel - tank1.portsData_height[1] ($RES_SIM_75) (121) [----] elseif tank1.inFlow[1] then (121) [----] [SCAL] (1) tank1.s[1] = tank1.ports[1].m_flow ($RES_SIM_76) (121) [----] else (121) [----] [SCAL] (1) tank1.s[1] = ((tank1.ports[1].p - tank1.vessel_ps_static[1]) / 101325.0) * (tank1.portsData_height[1] - tank1.fluidLevel) ($RES_SIM_77) (121) [----] end if; (122) [ARRY] (1) tank2.portsData_zeta_in = tank2.portsData_zeta_in_internal ($RES_SIM_114) (123) [ARRY] (1) tank2.portsData_height = tank2.portsData_height_internal ($RES_SIM_115) (124) [ARRY] (1) tank2.portsData_diameter = tank2.portsData_diameter_internal ($RES_SIM_116) (125) [ARRY] (1) tank1.portsData_zeta_out = tank1.portsData_zeta_out_internal ($RES_SIM_117) (126) [SCAL] (1) tank1.ports[1].h_outflow = 4184.0 * ((-273.15) - ((-273.15) - tank1.medium.T_degC)) ($RES_SIM_78) (127) [ARRY] (1) tank1.portsData_zeta_in = tank1.portsData_zeta_in_internal ($RES_SIM_118) (128) [SCAL] (1) tank1.ports_E_flow[1] = tank1.ports[1].m_flow * (0.5 * tank1.portVelocities[1] * tank1.portVelocities[1] + system.g * tank1.portsData_height[1]) ($RES_SIM_79) (129) [ARRY] (1) tank1.portsData_height = tank1.portsData_height_internal ($RES_SIM_119) (130) [SCAL] (1) $SEV_23 = (tank1.ports_penetration[1] * ((-1.0) + tank1.portAreas[1] ^ 2.0 / tank1.vesselArea ^ 2.0 + tank1.portsData_zeta_in[1])) / tank1.portInDensities[1] >= ((1.0 + tank1.portsData_zeta_out[1]) - tank1.portAreas[1] ^ 2.0 / tank1.vesselArea ^ 2.0) / (tank1.ports_penetration[1] * 995.586) ($RES_EVT_200) (131) [SCAL] (1) $SEV_24 = tank1.ports[1].m_flow > 0.0 ($RES_EVT_201) (132) [SCAL] (1) $SEV_25 = tank1.fluidLevel > (-1e-6 * tank1.fluidLevel_max) ($RES_EVT_202) (133) [SCAL] (1) $SEV_26 = tank1.fluidLevel <= tank1.fluidLevel_max ($RES_EVT_203)