Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr ModelicaTest_3.2.1_ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.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) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaTest 3.2.1+maint.om/package.mo", uses=false) Using package ModelicaTest with version 3.2.1 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaTest 3.2.1+maint.om/package.mo) 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(ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="ModelicaTest_3.2.1_ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank") translateModel(ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="ModelicaTest_3.2.1_ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001196/0.001196, allocations: 109.8 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.001108/0.001108, allocations: 189.5 kB / 17.35 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.186/1.186, allocations: 205.1 MB / 223.2 MB, free: 12.22 MB / 190.1 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaTest 3.2.1+maint.om/package.mo): time 0.1669/0.1669, allocations: 38.01 MB / 308.6 MB, free: 5.969 MB / 254.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 2.021e-05/2.022e-05, allocations: 6.219 kB / 433.6 MB, free: 14.48 MB / 318.1 MB Notification: Performance of NFInst.instantiate(ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank): time 0.01149/0.01152, allocations: 16.68 MB / 450.3 MB, free: 13.73 MB / 334.1 MB Notification: Performance of NFInst.instExpressions: time 0.008385/0.01993, allocations: 6.918 MB / 457.2 MB, free: 6.793 MB / 334.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.0006235/0.02058, allocations: 19.88 kB / 457.2 MB, free: 6.773 MB / 334.1 MB Notification: Performance of NFTyping.typeComponents: time 0.001189/0.02177, allocations: 385.8 kB / 457.6 MB, free: 6.395 MB / 334.1 MB Notification: Performance of NFTyping.typeBindings: time 0.002276/0.02413, allocations: 1.003 MB / 458.6 MB, free: 5.387 MB / 334.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.004201/0.02834, allocations: 1.986 MB / 460.6 MB, free: 3.41 MB / 334.1 MB Notification: Performance of NFFlatten.flatten: time 0.002251/0.0306, allocations: 2.284 MB / 462.9 MB, free: 1.117 MB / 334.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0007591/0.03137, allocations: 0.6318 MB / 463.5 MB, free: 480 kB / 334.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.001079/0.03246, allocations: 0.9425 MB / 464.4 MB, free: 15.52 MB / 350.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.0008122/0.03329, allocations: 0.7553 MB / 465.2 MB, free: 14.77 MB / 350.1 MB Notification: Performance of NFPackage.collectConstants: time 0.0001218/0.03342, allocations: 80 kB / 465.3 MB, free: 14.69 MB / 350.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.00206/0.03549, allocations: 1.303 MB / 466.6 MB, free: 13.38 MB / 350.1 MB Notification: Performance of combineBinaries: time 0.001202/0.0367, allocations: 1.564 MB / 468.1 MB, free: 11.8 MB / 350.1 MB Notification: Performance of replaceArrayConstructors: time 0.0006021/0.03731, allocations: 0.9379 MB / 469.1 MB, free: 10.86 MB / 350.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0001658/0.03749, allocations: 139.6 kB / 469.2 MB, free: 10.72 MB / 350.1 MB Notification: Performance of FrontEnd: time 0.0001088/0.0376, allocations: 23.88 kB / 469.2 MB, free: 10.7 MB / 350.1 MB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 153 (122) * Number of variables: 157 (123) Notification: Performance of Bindings: time 0.003874/0.04148, allocations: 4.209 MB / 473.5 MB, free: 6.352 MB / 350.1 MB Notification: Performance of FunctionAlias: time 0.0004292/0.04192, allocations: 418.6 kB / 473.9 MB, free: 5.918 MB / 350.1 MB Notification: Performance of Early Inline: time 0.00231/0.04424, allocations: 2.505 MB / 476.4 MB, free: 3.375 MB / 350.1 MB Notification: Performance of simplify1: time 0.0001388/0.04439, allocations: 135.8 kB / 476.5 MB, free: 3.242 MB / 350.1 MB Notification: Performance of Alias: time 0.002241/0.04664, allocations: 2.293 MB / 478.8 MB, free: 0.7305 MB / 350.1 MB Notification: Performance of simplify2: time 0.0001078/0.04676, allocations: 107.8 kB / 478.9 MB, free: 0.625 MB / 350.1 MB Notification: Performance of Events: time 0.0006138/0.04738, allocations: 0.5443 MB / 479.4 MB, free: 88 kB / 350.1 MB Notification: Performance of Detect States: time 0.0006773/0.04807, allocations: 0.7435 MB / 480.2 MB, free: 15.31 MB / 366.1 MB Notification: Performance of Partitioning: time 0.000834/0.04891, allocations: 0.8953 MB / 481.1 MB, free: 14.29 MB / 366.1 MB Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (107/152) **************************** (1) [DISC] (2) protected Boolean[2] tank.inFlow (start = {false for $i1 in 1:2}) (2) [DISC] (2) Boolean[2] $SEV_22[$i1] (3) [ALGB] (1) stream Real pipe.port_a.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (4) [ALGB] (1) Real[1] tank.heatTransfer.heatPorts.T (start = {288.15 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, nominal = {300.0 for $i1 in 1:1}) (5) [ALGB] (1) Real[1] pipe.flowModel.Ib_flows (6) [ALGB] (1) protected Real pipe.flowModel.dp_fric_nominal = sum({ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.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) (7) [ALGB] (1) Real tank.medium.T_degC = Modelica.SIunits.Conversions.to_degC(-((-273.15) - tank.medium.T_degC)) (8) [ALGB] (2) Real[2] pipe.flowModel.vs = {(-pipe.port_b.m_flow) / (pipe.flowModel.crossAreas[1] * ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.pipe.Medium.density(pipe.flowModel.states[1])), -pipe.port_b.m_flow / (ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.pipe.Medium.density(pipe.flowModel.states[2]) * pipe.flowModel.crossAreas[2])} / pipe.nParallel (9) [ALGB] (1) protected Real[1] pipe.flowModel.diameters = 0.5 * (pipe.flowModel.dimensions[2:2] + pipe.flowModel.dimensions[1:1]) (10) [ALGB] (1) Real $FUN_12 (11) [DISC] (2) Boolean[2] $SEV_18[$i1] (12) [ALGB] (1) Real $FUN_10 (13) [ALGB] (2) Real[2] pipe.flowModel.mus = {ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.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}) (14) [DISC] (2) protected Boolean[2] tank.regularFlow (start = {true for $i1 in 1:2}) (15) [ALGB] (2) protected Real[2] tank.portsData_height (16) [ALGB] (2) stream Real[2] tank.ports.h_outflow (min = {-1e10 for $i1 in 1:2}, max = {1e10 for $i1 in 1:2}, nominal = {1e6 for $i1 in 1:2}) (17) [ALGB] (1) Real tank.Hb_flow (18) [DISC] (1) protected discrete Real timeTable.nextEventScaled (fixed = true, start = 0.0) (19) [ALGB] (2) protected Real[2] tank.portsData_zeta_in_internal = tank.portsData.zeta_in (20) [ALGB] (2) flow Real[2] tank.ports.m_flow (min = {-1e5 for $i1 in 1:2}, max = {1e5 for $i1 in 1:2}) (21) [ALGB] (2) Real[2] tank.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}) (22) [DISC] (1) protected Real timeTable.a (23) [ALGB] (2) Real[2] tank.vessel_ps_static (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}) (24) [DISC] (1) protected Real timeTable.b (25) [ALGB] (1) Real pipe.port_b.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (26) [ALGB] (2) protected Real[2] tank.portsData_height_internal = tank.portsData.height (27) [DER-] (1) Real $DER.tank.U (28) [DISC] (2) Boolean[2] $SEV_14[$i1] (29) [ALGB] (1) Real tank.Qb_flow (30) [DISC] (1) Boolean $SEV_27 (31) [ALGB] (1) Real[1] pipe.flowModel.pathLengths_internal = pipe.flowModel.pathLengths (32) [DISC] (1) Boolean $SEV_26 (33) [DISC] (1) Boolean $SEV_25 (34) [DISC] (2) Boolean[2] $SEV_21[$i1] (35) [ALGB] (2) final Real[2] pipe.flowModel.dimensions = {(4.0 * pipe.crossArea) / pipe.perimeter, (4.0 * pipe.crossArea) / pipe.perimeter} (36) [DISC] (1) Integer $FUN_9 (37) [DISC] (1) Boolean $SEV_24 (38) [ALGB] (2) Real[2] tank.ports_E_flow (39) [ALGB] (2) Real[2] tank.portInDensities (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}) (40) [ALGB] (1) Real $FUN_8 (41) [ALGB] (1) Real $FUN_7 (42) [ALGB] (1) Real $FUN_6 (43) [ALGB] (1) Real $FUN_4 (44) [ALGB] (1) Real flowSource.medium.p_bar = Modelica.SIunits.Conversions.to_bar(99999.99999999999 * flowSource.medium.p_bar) (45) [ALGB] (1) Real $FUN_3 (46) [ALGB] (1) Real[1] pipe.flowModel.Fs_p (47) [ALGB] (1) Real $FUN_2 (48) [ALGB] (2) protected Real[2] tank.portsData_diameter_internal = tank.portsData.diameter (49) [DISC] (2) Boolean[2] $SEV_17[$i1] (50) [ALGB] (1) Real timeTable.y (51) [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) (52) [DISC] (1) protected discrete Real timeTable.nextEvent (fixed = true, start = 0.0) (53) [ALGB] (2) Real[2] tank.ports_H_flow (min = {-1e8 for $i1 in 1:2}, max = {1e8 for $i1 in 1:2}, nominal = {1000.0 for $i1 in 1:2}) (54) [ALGB] (1) Real[1] tank.heatTransfer.Q_flows (55) [DER-] (1) Real $DER.tank.m (56) [ALGB] (2) final Real[2] pipe.flowModel.roughnesses = {pipe.roughness, pipe.roughness} (min = {0.0 for $i1 in 1:2}) (57) [ALGB] (1) Real[1] pipe.flowModel.dps_fg (start = {pipe.flowModel.p_a_start - pipe.flowModel.p_b_start for $i1 in 1:1}) (58) [ALGB] (2) protected Real[2] tank.portsData_zeta_out (59) [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}) (60) [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}) (61) [ALGB] (1) Real[1] tank.heatTransfer.surfaceAreas = {sqrt(3.141592653589793 * tank.crossArea) * 2.0 * tank.fluidLevel + tank.crossArea} (62) [ALGB] (1) flow Real[1] ambient_fixed.ports.m_flow (min = {-1e60}, max = {1e60}) (63) [ALGB] (2) Real[2] tank.ports_penetration (64) [ALGB] (2) Real[2] tank.portAreas = {0.7853981633974483 * tank.portsData_diameter[i] ^ 2.0 for i in 1:2} (65) [ALGB] (1) Real[1] pipe.flowModel.Res_turbulent_internal = pipe.flowModel.Re_turbulent * {1.0 for $i1 in 1:1} (66) [ALGB] (1) flow Real[1] tank.heatTransfer.heatPorts.Q_flow (67) [ALGB] (1) final Real[1] pipe.flowModel.dheights = {pipe.height_ab} (68) [ALGB] (1) flow Real[1] flowSource.ports.m_flow (min = {-1e60}, max = {1e60}) (69) [DISC] (2) Boolean[2] $SEV_13[$i1] (70) [DISC] (2) Boolean[2] $SEV_20[$i1] (71) [ALGB] (1) final input Real[1, 1] tank.heatTransfer.states.T = {tank.medium.state.T} (start = {288.15 for $i1 in 1:1}, min = {1.0 for $i1 in 1:1}, max = {1e4 for $i1 in 1:1}, nominal = {300.0 for $i1 in 1:1}) (72) [ALGB] (1) final Real[1] pipe.flowModel.pathLengths = {pipe.length} (73) [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}) (74) [ALGB] (2) Real[2] tank.portVelocities (75) [ALGB] (1) stream Real pipe.port_b.h_outflow (min = -1e10, max = 1e10, nominal = 1e6) (76) [ALGB] (1) Real pipe.port_a.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (77) [ALGB] (1) Real tank.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (78) [ALGB] (1) Real[1] flowSource.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}) (79) [ALGB] (2) protected Real[2] tank.portsData_zeta_in (80) [DISC] (2) Boolean[2] $SEV_16[$i1] (81) [ALGB] (2) protected Real[2] tank.portsData_diameter (82) [ALGB] (2) Real[2] tank.s (start = {tank.fluidLevel_max for $i1 in 1:2}) (83) [DISC] (2) Boolean[2] $SEV_23[$i1] (84) [DISC] (1) Boolean $SEV_9 (85) [ALGB] (1) final Real tank.fluidVolume = tank.fluidVolume (86) [ALGB] (2) Real[2] tank.m_flow_turbulent (87) [ALGB] (1) Real[1] pipe.flowModel.Is (88) [DISC] (1) Boolean $SEV_4 (89) [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}) (90) [ALGB] (1) flow Real pipe.port_b.m_flow (min = -1e5, max = 1e60) (91) [DISC] (2) Boolean[2] $SEV_19[$i1] (92) [ALGB] (1) stream Real[1] flowSource.ports.h_outflow (min = {-1e10 for $i1 in 1:1}, max = {1e10 for $i1 in 1:1}, nominal = {1e6 for $i1 in 1:1}) (93) [ALGB] (1) Real tank.mb_flow (94) [ALGB] (1) final input Real[1, 1] tank.heatTransfer.states.p = {tank.medium.state.p} (start = {1e5 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, max = {1e8 for $i1 in 1:1}, nominal = {1e5 for $i1 in 1:1}) (95) [DISC] (1) Boolean $TEV_0 (96) [ALGB] (1) Real[1] tank.heatTransfer.Ts = {ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.tank.heatTransfer.Medium.temperature(tank.heatTransfer.states[1])} (start = {288.15 for $i1 in 1:1}, min = {0.0 for $i1 in 1:1}, nominal = {300.0 for $i1 in 1:1}) (97) [ALGB] (2) protected Real[2] tank.portsData_zeta_out_internal = tank.portsData.zeta_out (98) [ALGB] (1) protected final Real tank.fluidLevel = tank.fluidLevel (min = 0.0) (99) [ALGB] (1) Real tank.medium.state.T (start = 288.15, min = 1.0, max = 1e4, nominal = 300.0) (100) [ALGB] (1) Real[1] pipe.flowModel.Fs_fg (101) [ALGB] (2) final Real[2] pipe.flowModel.crossAreas = {pipe.crossArea, pipe.crossArea} (102) [ALGB] (2) Real[2] pipe.flowModel.rhos = {ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.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}) (103) [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}) (104) [ALGB] (1) Real flowSource.medium.state.p (start = 1e5, min = 0.0, max = 1e8, nominal = 1e5) (105) [DISC] (1) protected Integer timeTable.last (start = 1) (106) [DISC] (2) Boolean[2] $SEV_15[$i1] (107) [ALGB] (4) input Real[2, 2] pipe.flowModel.states.T (start = {288.15 for $i1 in 1:2}, min = {1.0 for $i1 in 1:2}, max = {1e4 for $i1 in 1:2}, nominal = {300.0 for $i1 in 1:2}) System Equations (103/148) **************************** (1) [ARRY] (2) pipe.flowModel.dimensions = {(4.0 * pipe.crossArea) / pipe.perimeter, (4.0 * pipe.crossArea) / pipe.perimeter} ($RES_BND_145) (2) [ARRY] (2) pipe.flowModel.roughnesses = {pipe.roughness, pipe.roughness} ($RES_BND_146) (3) [ARRY] (1) pipe.flowModel.dheights = {pipe.height_ab} ($RES_BND_147) (4) [ARRY] (1) pipe.flowModel.pathLengths = {pipe.length} ($RES_BND_148) (5) [FOR-] (2) ($RES_BND_149) (5) [----] for $i1 in 1:2 loop (5) [----] [SCAL] (1) pipe.flowModel.rhos[$i1] = 995.586 ($RES_BND_150) (5) [----] end for; (6) [SCAL] (1) flowSource.medium.state.p = 99999.99999999999 * flowSource.medium.p_bar ($RES_SIM_19) (7) [SCAL] (1) tank.portVelocities[1] = smooth(0, 0.0010044335697769957 * (tank.ports[1].m_flow / tank.portAreas[1])) ($RES_SIM_90) (8) [SCAL] (1) tank.portInDensities[1] = 995.586 ($RES_SIM_91) (9) [SCAL] (1) tank.Qb_flow = tank.heatTransfer.Q_flows[1] ($RES_SIM_94) (10) [SCAL] (1) tank.Hb_flow = $FUN_2 + $FUN_3 ($RES_SIM_95) (11) [FOR-] (2) ($RES_SIM_97) (11) [----] for $i1 in 1:2 loop (11) [----] [SCAL] (1) tank.vessel_ps_static[$i1] = system.g * max(0.0, tank.fluidLevel - tank.portsData_height[$i1]) * 995.586 + tank.p_ambient ($RES_SIM_98) (11) [----] end for; (12) [SCAL] (1) $TEV_0 = $PRE.timeTable.nextEvent ($RES_EVT_174) (13) [SCAL] (1) $SEV_4 = abs(sum({abs(flowSource.ports[1].m_flow)}) - abs(flowSource.ports[1].m_flow)) <= 1e-60 ($RES_EVT_175) (14) [SCAL] (1) tank.fluidVolume = tank.crossArea * tank.fluidLevel ($RES_SIM_101) (15) [ARRY] (1) tank.heatTransfer.Q_flows = tank.heatTransfer.heatPorts.Q_flow ($RES_SIM_102) (16) [ARRY] (1) tank.heatTransfer.Ts = tank.heatTransfer.heatPorts.T ($RES_SIM_103) (17) [FOR-] (2) ($RES_BND_151) (17) [----] for $i1 in 1:2 loop (17) [----] [SCAL] (1) pipe.flowModel.mus[$i1] = 0.001 ($RES_BND_152) (17) [----] end for; (18) [ARRY] (1) pipe.flowModel.pathLengths_internal = pipe.flowModel.pathLengths ($RES_BND_153) (19) [SCAL] (1) pipe.flowModel.Res_turbulent_internal[1] = pipe.flowModel.Re_turbulent ($RES_BND_154) (20) [SCAL] (1) $DER.tank.m = tank.mb_flow ($RES_SIM_60) (21) [ARRY] (1) pipe.flowModel.diameters = 0.5 * (pipe.flowModel.dimensions[2:2] + pipe.flowModel.dimensions[1:1]) ($RES_BND_155) (22) [SCAL] (1) $DER.tank.U = tank.Qb_flow + tank.Hb_flow ($RES_SIM_61) (23) [SCAL] (1) tank.medium.state.p = tank.p_ambient ($RES_SIM_108) (24) [SCAL] (1) tank.U = tank.m * (4184.0 * ((-273.15) - ((-273.15) - tank.medium.T_degC))) ($RES_SIM_62) (25) [SCAL] (1) tank.medium.state.T = -((-273.15) - tank.medium.T_degC) ($RES_SIM_109) (26) [SCAL] (1) tank.m = 995.586 * tank.fluidVolume ($RES_SIM_63) (27) [SCAL] (1) pipe.port_a.h_outflow = ambient_fixed.ports[1].h_outflow + system.g * pipe.height_ab ($RES_SIM_28) (28) [FOR-] (2) ($RES_SIM_64) (28) [----] for $i1 in 1:2 loop (28) [----] [SCAL] (1) tank.ports_penetration[$i1] = smooth(1, if $SEV_13[$i1] then 1.0 else if $SEV_14[$i1] then 0.001 else if $SEV_15[$i1] then 0.5005 - 0.24975 * ((-3.0) + ((tank.fluidLevel - (0.1 * tank.portsData_diameter[$i1] + tank.portsData_height[$i1])) / (0.1 * tank.portsData_diameter[$i1])) ^ 2.0) * ((10.0 * (tank.fluidLevel - (tank.portsData_height[$i1] + 0.1 * tank.portsData_diameter[$i1]))) / tank.portsData_diameter[$i1]) else 0.5005) ($RES_SIM_65) (28) [----] end for; (29) [SCAL] (1) pipe.port_b.h_outflow = tank.ports[1].h_outflow - system.g * pipe.height_ab ($RES_SIM_29) (30) [ARRY] (2) tank.heatTransfer.states = {tank.medium.state} ($RES_BND_159) (31) [FOR-] (2) ($RES_SIM_66) (31) [----] for $i1 in 1:2 loop (31) [----] [SCAL] (1) tank.regularFlow[$i1] = $SEV_16[$i1] ($RES_SIM_67) (31) [----] end for; (32) [FOR-] (2) ($RES_SIM_68) (32) [----] for $i1 in 1:2 loop (32) [----] [SCAL] (1) tank.inFlow[$i1] = $SEV_20[$i1] ($RES_SIM_69) (32) [----] end for; (33) [SCAL] (1) $SEV_9 = pipe.flowModel.m_flows[1] > 0.0 ($RES_EVT_180) (34) [FOR-] (2) ($RES_EVT_184) (34) [----] for $i1 in 1:2 loop (34) [----] [SCAL] (1) $SEV_13[$i1] = tank.fluidLevel - (tank.portsData_height[$i1] + 0.1 * tank.portsData_diameter[$i1]) > 0.1 * tank.portsData_diameter[$i1] ($RES_EVT_185) (34) [----] end for; (35) [FOR-] (2) ($RES_EVT_186) (35) [----] for $i1 in 1:2 loop (35) [----] [SCAL] (1) $SEV_14[$i1] = tank.fluidLevel - (tank.portsData_height[$i1] + 0.1 * tank.portsData_diameter[$i1]) < (-0.1 * tank.portsData_diameter[$i1]) ($RES_EVT_187) (35) [----] end for; (36) [FOR-] (2) ($RES_EVT_188) (36) [----] for $i1 in 1:2 loop (36) [----] [SCAL] (1) $SEV_15[$i1] = 0.1 * tank.portsData_diameter[$i1] > 0.0 ($RES_EVT_189) (36) [----] end for; (37) [SCAL] (1) tank.mb_flow = sum(tank.ports.m_flow) ($RES_$AUX_169) (38) [SCAL] (1) $FUN_2 = sum(tank.ports_H_flow) ($RES_$AUX_168) (39) [SCAL] (1) $FUN_3 = sum(tank.ports_E_flow) ($RES_$AUX_167) (40) [SCAL] (1) $FUN_4 = ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.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_166) (41) [SCAL] (1) -timeTable.y = sum(flowSource.ports.m_flow) ($RES_$AUX_165) (42) [ARRY] (4) pipe.flowModel.states = {ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.pipe.Medium.ThermodynamicState(pipe.port_a.p, 273.15 + 2.390057361376673e-4 * tank.ports[1].h_outflow), ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.pipe.Medium.ThermodynamicState(pipe.port_b.p, 273.15 + 2.390057361376673e-4 * ambient_fixed.ports[1].h_outflow)} ($RES_BND_160) (43) [TUPL] (4) ($FUN_6, $FUN_7, $FUN_8, $FUN_9) = ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.timeTable.getInterpolationCoefficients(timeTable.table, timeTable.offset, timeTable.startTime, time, timeTable.last, 1e-13, timeTable.shiftTime) ($RES_$AUX_164) (44) [SCAL] (1) -pipe.port_b.m_flow = pipe.flowModel.m_flows[1] ($RES_SIM_31) (45) [SCAL] (1) $FUN_10 = ModelicaTest.Fluid.TestComponents.Vessels.TestSimpleTank.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_163) (46) [ARRY] (1) {0.0} = pipe.flowModel.Ib_flows - (pipe.flowModel.Fs_fg + pipe.flowModel.Fs_p) ($RES_SIM_32) (47) [SCAL] (1) pipe.flowModel.dp_fric_nominal = sum({$FUN_10}) ($RES_$AUX_162) (48) [ARRY] (1) pipe.flowModel.Is = {pipe.flowModel.m_flows[1] * pipe.flowModel.pathLengths[1]} ($RES_SIM_33) (49) [SCAL] (1) $FUN_12 = sqrt(3.141592653589793 * tank.crossArea) ($RES_$AUX_161) (50) [SCAL] (1) tank.ports[1].m_flow - pipe.port_b.m_flow = 0.0 ($RES_SIM_116) (51) [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_34) (52) [SCAL] (1) tank.heatTransfer.heatPorts[1].Q_flow = 0.0 ($RES_SIM_117) (53) [FOR-] (2) ($RES_SIM_70) (53) [----] for $i1 in 1:2 loop (53) [----] [-IF-] (1)if tank.regularFlow[$i1] then (53) [----] [----] [SCAL] (1) tank.ports[$i1].p = tank.vessel_ps_static[$i1] + (0.5 / tank.portAreas[$i1] ^ 2.0) * smooth(2, if $SEV_21[$i1] then (tank.ports_penetration[$i1] * ((-1.0) + tank.portAreas[$i1] ^ 2.0 / tank.vesselArea ^ 2.0 + tank.portsData_zeta_in[$i1]) * tank.ports[$i1].m_flow ^ 2.0) / tank.portInDensities[$i1] else if $SEV_22[$i1] then -(((1.0 + tank.portsData_zeta_out[$i1]) - tank.portAreas[$i1] ^ 2.0 / tank.vesselArea ^ 2.0) * tank.ports[$i1].m_flow ^ 2.0) / (tank.ports_penetration[$i1] * 995.586) else if $SEV_23[$i1] then Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(tank.ports[$i1].m_flow, tank.m_flow_turbulent[$i1], (tank.ports_penetration[$i1] * ((-1.0) + tank.portAreas[$i1] ^ 2.0 / tank.vesselArea ^ 2.0 + tank.portsData_zeta_in[$i1])) / tank.portInDensities[$i1], ((1.0 + tank.portsData_zeta_out[$i1]) - tank.portAreas[$i1] ^ 2.0 / tank.vesselArea ^ 2.0) / (tank.ports_penetration[$i1] * 995.586), false, 1.0) else -Modelica.Fluid.Utilities.regSquare2.regSquare2_utility(-tank.ports[$i1].m_flow, tank.m_flow_turbulent[$i1], ((1.0 + tank.portsData_zeta_out[$i1]) - tank.portAreas[$i1] ^ 2.0 / tank.vesselArea ^ 2.0) / (tank.ports_penetration[$i1] * 995.586), (tank.ports_penetration[$i1] * ((-1.0) + tank.portAreas[$i1] ^ 2.0 / tank.vesselArea ^ 2.0 + tank.portsData_zeta_in[$i1])) / tank.portInDensities[$i1], false, 1.0)) ($RES_SIM_72) (53) [----] [----] elseif tank.inFlow[$i1] then (53) [----] [----] [SCAL] (1) tank.ports[$i1].p = tank.vessel_ps_static[$i1] ($RES_SIM_73) (53) [----] [----] else (53) [----] [----] [SCAL] (1) tank.ports[$i1].m_flow = 0.0 ($RES_SIM_74) (53) [----] [----] end if; (53) [----] end for; (54) [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_35) (55) [ARRY] (1) pipe.flowModel.Ib_flows = {0.0} ($RES_SIM_36) (56) [SCAL] (1) pipe.port_b.m_flow + ambient_fixed.ports[1].m_flow = 0.0 ($RES_SIM_119) (57) [SCAL] (1) pipe.flowModel.rhos_act[1] = noEvent(if $SEV_9 then pipe.flowModel.rhos[1] else pipe.flowModel.rhos[2]) ($RES_SIM_37) (58) [SCAL] (1) pipe.flowModel.mus_act[1] = noEvent(if $SEV_9 then pipe.flowModel.mus[1] else pipe.flowModel.mus[2]) ($RES_SIM_38) (59) [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_39) (60) [FOR-] (2) ($RES_SIM_75) (60) [----] for $i1 in 1:2 loop (60) [----] [-IF-] (1)if tank.regularFlow[$i1] then (60) [----] [----] [SCAL] (1) tank.s[$i1] = tank.fluidLevel - tank.portsData_height[$i1] ($RES_SIM_77) (60) [----] [----] elseif tank.inFlow[$i1] then (60) [----] [----] [SCAL] (1) tank.s[$i1] = tank.ports[$i1].m_flow ($RES_SIM_78) (60) [----] [----] else (60) [----] [----] [SCAL] (1) tank.s[$i1] = ((tank.ports[$i1].p - tank.vessel_ps_static[$i1]) / 101325.0) * (tank.portsData_height[$i1] - tank.fluidLevel) ($RES_SIM_79) (60) [----] [----] end if; (60) [----] end for; (61) [FOR-] (2) ($RES_EVT_190) (61) [----] for $i1 in 1:2 loop (61) [----] [SCAL] (1) $SEV_16[$i1] = tank.fluidLevel >= tank.portsData_height[$i1] ($RES_EVT_191) (61) [----] end for; (62) [FOR-] (2) ($RES_EVT_192) (62) [----] for $i1 in 1:2 loop (62) [----] [SCAL] (1) $SEV_17[$i1] = tank.s[$i1] > 0.0 ($RES_EVT_193) (62) [----] end for; (63) [FOR-] (2) ($RES_EVT_194) (63) [----] for $i1 in 1:2 loop (63) [----] [SCAL] (1) $SEV_18[$i1] = tank.portsData_height[$i1] >= tank.fluidLevel_max ($RES_EVT_195) (63) [----] end for; (64) [FOR-] (2) ($RES_EVT_196) (64) [----] for $i1 in 1:2 loop (64) [----] [SCAL] (1) $SEV_19[$i1] = $SEV_17[$i1] or $SEV_18[$i1] ($RES_EVT_197) (64) [----] end for; (65) [FOR-] (2) ($RES_EVT_198) (65) [----] for $i1 in 1:2 loop (65) [----] [SCAL] (1) $SEV_20[$i1] = not tank.regularFlow[$i1] and $SEV_19[$i1] ($RES_EVT_199) (65) [----] end for; (66) [ARRY] (1) tank.heatTransfer.surfaceAreas = {2.0 * $FUN_12 * tank.fluidLevel + tank.crossArea} ($RES_BND_132) (67) [SCAL] (1) ambient_fixed.ports[1].p = pipe.port_b.p ($RES_SIM_120) (68) [ARRY] (1) tank.heatTransfer.Ts = {tank.heatTransfer.states.p} ($RES_BND_133) (69) [SCAL] (1) tank.ports[2].m_flow + flowSource.ports[1].m_flow = 0.0 ($RES_SIM_121) (70) [FOR-] (2) ($RES_BND_134) (70) [----] for $i1 in 1:2 loop (70) [----] [SCAL] (1) tank.portAreas[$i1] = 0.7853981633974483 * tank.portsData_diameter[$i1] ^ 2.0 ($RES_BND_135) (70) [----] end for; (71) [SCAL] (1) ambient_fixed.ports[1].p = ambient_fixed.p ($RES_SIM_40) (72) [SCAL] (1) flowSource.ports[1].p = tank.ports[2].p ($RES_SIM_122) (73) [SCAL] (1) ambient_fixed.ports[1].h_outflow = 4184.0 * ((-273.15) + ambient_fixed.T) ($RES_SIM_41) (74) [SCAL] (1) pipe.port_a.p = tank.ports[1].p ($RES_SIM_123) (75) [ARRY] (2) tank.portsData_diameter_internal = tank.portsData.diameter ($RES_BND_137) (76) [ARRY] (2) tank.portsData_zeta_out = tank.portsData_zeta_out_internal ($RES_SIM_125) (77) [ARRY] (2) tank.portsData_height_internal = tank.portsData.height ($RES_BND_138) (78) [ARRY] (2) tank.portsData_zeta_in = tank.portsData_zeta_in_internal ($RES_SIM_126) (79) [ARRY] (2) tank.portsData_zeta_in_internal = tank.portsData.zeta_in ($RES_BND_139) (80) [FOR-] (2) ($RES_SIM_80) (80) [----] for $i1 in 1:2 loop (80) [----] [SCAL] (1) tank.ports[$i1].h_outflow = 4184.0 * ((-273.15) - ((-273.15) - tank.medium.T_degC)) ($RES_SIM_81) (80) [----] end for; (81) [ARRY] (2) tank.portsData_height = tank.portsData_height_internal ($RES_SIM_127) (82) [ARRY] (2) tank.portsData_diameter = tank.portsData_diameter_internal ($RES_SIM_128) (83) [FOR-] (2) ($RES_SIM_82) (83) [----] for $i1 in 1:2 loop (83) [----] [SCAL] (1) tank.ports_E_flow[$i1] = tank.ports[$i1].m_flow * (tank.portVelocities[$i1] * 0.5 * tank.portVelocities[$i1] + system.g * tank.portsData_height[$i1]) ($RES_SIM_83) (83) [----] end for; (84) [SCAL] (1) tank.ports_H_flow[2] = smooth(0, tank.ports[2].m_flow * (if $SEV_24 then flowSource.ports[1].h_outflow else tank.ports[2].h_outflow)) ($RES_SIM_84) (85) [SCAL] (1) tank.m_flow_turbulent[2] = tank.m_flow_small ($RES_SIM_85) (86) [SCAL] (1) tank.portVelocities[2] = smooth(0, 0.0010044335697769957 * (tank.ports[2].m_flow / tank.portAreas[2])) ($RES_SIM_86) (87) [SCAL] (1) tank.portInDensities[2] = 995.586 ($RES_SIM_87) (88) [SCAL] (1) tank.ports_H_flow[1] = smooth(0, tank.ports[1].m_flow * (if $SEV_25 then pipe.port_a.h_outflow else tank.ports[1].h_outflow)) ($RES_SIM_88) (89) [SCAL] (1) tank.m_flow_turbulent[1] = tank.m_flow_small ($RES_SIM_89) (90) [FOR-] (2) ($RES_EVT_200) (90) [----] for $i1 in 1:2 loop (90) [----] [SCAL] (1) $SEV_21[$i1] = tank.ports[$i1].m_flow >= tank.m_flow_turbulent[$i1] ($RES_EVT_201) (90) [----] end for; (91) [FOR-] (2) ($RES_EVT_202) (91) [----] for $i1 in 1:2 loop (91) [----] [SCAL] (1) $SEV_22[$i1] = tank.ports[$i1].m_flow <= (-tank.m_flow_turbulent[$i1]) ($RES_EVT_203) (91) [----] end for; (92) [FOR-] (2) ($RES_EVT_204) (92) [----] for $i1 in 1:2 loop (92) [----] [SCAL] (1) $SEV_23[$i1] = (tank.ports_penetration[$i1] * ((-1.0) + tank.portAreas[$i1] ^ 2.0 / tank.vesselArea ^ 2.0 + tank.portsData_zeta_in[$i1])) / tank.portInDensities[$i1] >= ((1.0 + tank.portsData_zeta_out[$i1]) - tank.portAreas[$i1] ^ 2.0 / tank.vesselArea ^ 2.0) / (tank.ports_penetration[$i1] * 995.586) ($RES_EVT_205) (92) [----] end for; (93) [SCAL] (1) flowSource.ports[1].h_outflow = 4184.0 * ((-273.15) + flowSource.T) ($RES_SIM_8) (94) [SCAL] (1) flowSource.ports[1].p = 99999.99999999999 * flowSource.medium.p_bar ($RES_SIM_7) (95) [SCAL] (1) $SEV_24 = tank.ports[2].m_flow > 0.0 ($RES_EVT_206) (96) [SCAL] (1) $SEV_25 = tank.ports[1].m_flow > 0.0 ($RES_EVT_207) (97) [SCAL] (1) timeTable.y = timeTable.a * time + timeTable.b ($RES_SIM_5) (98) [SCAL] (1) $SEV_26 = tank.fluidLevel > (-1e-6 * tank.fluidLevel_max) ($RES_EVT_208) (99) [ALGO] (5) ($RES_SIM_4) (99) [----] assert(not (timeTable.table[1, 1] > 0.0 or timeTable.table[1, 1] < 0.0), "The first point in time has to be set to 0, but is table[1,1] = " + String(timeTable.table[1, 1], 6, 0, true), AssertionLevel.error); (99) [----] when {time >= $PRE.timeTable.nextEvent, initial()} then (99) [----] (timeTable.a, timeTable.b, timeTable.nextEventScaled, timeTable.last) := ($FUN_6, $FUN_7, $FUN_8, $FUN_9); (99) [----] timeTable.nextEvent := timeTable.nextEventScaled; (99) [----] end when; (100) [SCAL] (1) $SEV_27 = tank.fluidLevel <= tank.fluidLevel_max ($RES_EVT_209) (101) [ARRY] (2) tank.portsData_zeta_out_internal = tank.portsData.zeta_out ($RES_BND_140) (102) [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_143) (103) [ARRY] (2) pipe.flowModel.crossAreas = {pipe.crossArea, pipe.crossArea} ($RES_BND_144)