Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries/ --ompython_omhome=/usr ThermoPower_ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_B.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/ThermoPower 3.1.0-master/package.mo", uses=false) Using package ThermoPower with version 3.1 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermoPower 3.1.0-master/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(ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_B,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="ThermoPower_ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_B") translateModel(ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_B,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="ThermoPower_ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_B") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001251/0.001251, allocations: 102.7 kB / 17.63 MB, free: 5.527 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.001338/0.001338, allocations: 193.9 kB / 18.56 MB, free: 4.602 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.407/1.407, allocations: 205.1 MB / 224.4 MB, free: 12.3 MB / 190.1 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermoPower 3.1.0-master/package.mo): time 0.2917/0.2917, allocations: 48.85 MB / 320.6 MB, free: 11.08 MB / 270.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 2.994e-05/2.995e-05, allocations: 4.359 kB / 390.8 MB, free: 48.89 MB / 318.1 MB Notification: Performance of NFInst.instantiate(ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_B): time 0.03742/0.03747, allocations: 51.93 MB / 442.7 MB, free: 0.7305 MB / 318.1 MB Notification: Performance of NFInst.instExpressions: time 0.01816/0.05569, allocations: 15.66 MB / 458.3 MB, free: 1.051 MB / 334.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.0007852/0.0565, allocations: 15.88 kB / 458.4 MB, free: 1.035 MB / 334.1 MB Notification: Performance of NFTyping.typeComponents: time 0.0009853/0.0575, allocations: 329.9 kB / 458.7 MB, free: 0.7109 MB / 334.1 MB Notification: Performance of NFTyping.typeBindings: time 0.01397/0.07159, allocations: 4.652 MB / 463.3 MB, free: 12.07 MB / 350.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.004456/0.07606, allocations: 1.449 MB / 464.8 MB, free: 10.62 MB / 350.1 MB Notification: Performance of NFFlatten.flatten: time 0.002329/0.07841, allocations: 1.761 MB / 466.5 MB, free: 8.852 MB / 350.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.000609/0.07903, allocations: 397.8 kB / 466.9 MB, free: 8.465 MB / 350.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.0007662/0.0798, allocations: 0.5609 MB / 467.5 MB, free: 7.902 MB / 350.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.0005482/0.08036, allocations: 0.5022 MB / 468 MB, free: 7.398 MB / 350.1 MB Notification: Performance of NFPackage.collectConstants: time 7.25e-05/0.08044, allocations: 48 kB / 468 MB, free: 7.352 MB / 350.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.01047/0.09092, allocations: 5.775 MB / 473.8 MB, free: 1.57 MB / 350.1 MB Notification: Performance of combineBinaries: time 0.001136/0.09209, allocations: 1.246 MB / 475.1 MB, free: 320 kB / 350.1 MB Notification: Performance of replaceArrayConstructors: time 0.0005268/0.09263, allocations: 0.7847 MB / 475.8 MB, free: 15.52 MB / 366.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0002308/0.09286, allocations: 111.7 kB / 476 MB, free: 15.41 MB / 366.1 MB Notification: Performance of FrontEnd: time 0.0002142/0.09309, allocations: 19.78 kB / 476 MB, free: 15.39 MB / 366.1 MB Notification: Could not parse annotation "Evaluate" in the backend. Notification: Could not parse annotation "choices" in the backend. Notification: Could not parse annotation "Evaluate" in the backend. Notification: Could not parse annotation "choices" in the backend. Notification: Could not parse annotation "Evaluate" in the backend. Notification: Could not parse annotation "choices" in the backend. Notification: Could not parse annotation "Evaluate" in the backend. Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 430 (104) * Number of variables: 420 (114) Notification: Performance of Bindings: time 0.003094/0.09619, allocations: 3.478 MB / 479.5 MB, free: 11.79 MB / 366.1 MB Notification: Performance of FunctionAlias: time 0.0003035/0.0965, allocations: 233.5 kB / 479.7 MB, free: 11.58 MB / 366.1 MB Notification: Performance of Early Inline: time 0.0008291/0.09734, allocations: 0.5945 MB / 480.3 MB, free: 10.94 MB / 366.1 MB Notification: Performance of simplify1: time 0.0001009/0.09745, allocations: 107.8 kB / 480.4 MB, free: 10.84 MB / 366.1 MB Notification: Performance of Alias: time 0.002278/0.09973, allocations: 2.058 MB / 482.4 MB, free: 8.543 MB / 366.1 MB Notification: Performance of simplify2: time 7.072e-05/0.09982, allocations: 71.89 kB / 482.5 MB, free: 8.473 MB / 366.1 MB Notification: Performance of Events: time 0.0002327/0.1001, allocations: 187.6 kB / 482.7 MB, free: 8.289 MB / 366.1 MB Notification: Performance of Detect States: time 0.0004326/0.1005, allocations: 388.6 kB / 483.1 MB, free: 7.898 MB / 366.1 MB Notification: Performance of Partitioning: time 0.000586/0.1011, allocations: 0.5413 MB / 483.6 MB, free: 7.32 MB / 366.1 MB Error: Internal error NBAdjacency.Matrix.createPseudo failed for [FOR-] (9) ($RES_$AUX_132) [----] for j in 1:9 loop [----] [SCAL] (1) $FUN_9[integer(1.0 + ((-1.0) + j))] = sum(hex.dMdt[1:j - 1]) ($RES_$AUX_133) [----] end for; Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (74/388) *************************** (1) [ALGB] (1) Real T_out.fluidState.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (2) [ALGB] (1) Real T_out.fluidState.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (3) [ALGB] (10) Real[10] hex.fluidState.p (start = {5e6 for $i1 in 1:10}, min = {611.657 for $i1 in 1:10}, max = {1e8 for $i1 in 1:10}, nominal = {1e6 for $i1 in 1:10}) (4) [ALGB] (1) Real $FUN_10 (5) [ALGB] (1) Real hex.omega_hyd (6) [ALGB] (10) protected Real[10] hex.drdp (7) [ALGB] (1) Real alpha = 1.0 - exp(-NTU) (8) [ALGB] (1) Real hex.Dpfric1 (9) [ALGB] (10) Real[10] hex.fluidState.h (start = {1e5 for $i1 in 1:10}, min = {-1e10 for $i1 in 1:10}, max = {1e10 for $i1 in 1:10}, nominal = {5e5 for $i1 in 1:10}) (10) [ALGB] (1) Real NTU = (gamma * Dihex * Nt * 2.0 * 3.1415) / (ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_B.Medium.specificHeatCapacityCp(hex.fluidState[1]) * whex) (11) [ALGB] (9) Real[9] hex.heatTransfer.Qvol (12) [ALGB] (1) stream Real T_in.inlet.h_outflow (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (13) [ALGB] (1) stream Real T_out.outlet.h_outflow (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (14) [ALGB] (10) Real[10] hex.fluidState.d (start = {150.0 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, max = {1e5 for $i1 in 1:10}, nominal = {500.0 for $i1 in 1:10}) (15) [ALGB] (10) protected Real[10] hex.drdh (16) [ALGB] (9) Real[9] hex.heatTransfer.wall.T (start = {288.15 for $i1 in 1:9}, min = {0.0 for $i1 in 1:9}, nominal = {300.0 for $i1 in 1:9}) (17) [ALGB] (1) Real T_out.T (18) [ALGB] (1) Real hex.Kf (19) [ALGB] (9) flow Real[9] hex.heatTransfer.wall.Q (20) [ALGB] (1) Real hex.heatTransfer.w_wnom (21) [ALGB] (9) Real[9] hex.heatTransfer.Tvol (start = {500.0 for $i1 in 1:9}, min = {273.15 for $i1 in 1:9}, max = {2273.15 for $i1 in 1:9}, nominal = {500.0 for $i1 in 1:9}) (22) [ALGB] (10) Real[10] hex.heatTransfer.T (start = {500.0 for $i1 in 1:10}, min = {273.15 for $i1 in 1:10}, max = {2273.15 for $i1 in 1:10}, nominal = {500.0 for $i1 in 1:10}) (23) [ALGB] (9) protected Real[9] hex.drbdp (24) [ALGB] (10) Real[10] hex.fluidState.T (start = {500.0 for $i1 in 1:10}, min = {273.15 for $i1 in 1:10}, max = {2273.15 for $i1 in 1:10}, nominal = {500.0 for $i1 in 1:10}) (25) [ALGB] (1) Real hex.Cf (26) [DER-] (9) Real[9] $DER.hex.htilde (27) [ALGB] (10) final input Real[10] hex.heatTransfer.fluidState.p = {hex.fluidState[1].p, hex.fluidState[2].p, hex.fluidState[3].p, hex.fluidState[4].p, hex.fluidState[5].p, hex.fluidState[6].p, hex.fluidState[7].p, hex.fluidState[8].p, hex.fluidState[9].p, hex.fluidState[10].p} (start = {5e6 for $i1 in 1:10}, min = {611.657 for $i1 in 1:10}, max = {1e8 for $i1 in 1:10}, nominal = {1e6 for $i1 in 1:10}) (28) [ALGB] (9) Real[9] $FUN_9 (29) [ALGB] (1) Real $FUN_7 (30) [ALGB] (1) Real $FUN_6 (31) [ALGB] (9) protected Real[9] hex.drbdh (32) [ALGB] (9) Real[9] hex.dMdt (33) [ALGB] (1) Real hex.Mtot (min = 0.0) (34) [ALGB] (1) Real $FUN_4 (35) [ALGB] (1) Real $FUN_3 (36) [ALGB] (10) final input Real[10] hex.heatTransfer.fluidState.h = {hex.fluidState[1].h, hex.fluidState[2].h, hex.fluidState[3].h, hex.fluidState[4].h, hex.fluidState[5].h, hex.fluidState[6].h, hex.fluidState[7].h, hex.fluidState[8].h, hex.fluidState[9].h, hex.fluidState[10].h} (start = {1e5 for $i1 in 1:10}, min = {-1e10 for $i1 in 1:10}, max = {1e10 for $i1 in 1:10}, nominal = {5e5 for $i1 in 1:10}) (37) [ALGB] (1) Real cp = ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_B.Medium.specificHeatCapacityCp(hex.fluidState[1]) (38) [ALGB] (10) final input Real[10] hex.heatTransfer.fluidState.d = {hex.fluidState[1].d, hex.fluidState[2].d, hex.fluidState[3].d, hex.fluidState[4].d, hex.fluidState[5].d, hex.fluidState[6].d, hex.fluidState[7].d, hex.fluidState[8].d, hex.fluidState[9].d, hex.fluidState[10].d} (start = {150.0 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, max = {1e5 for $i1 in 1:10}, nominal = {500.0 for $i1 in 1:10}) (39) [DER-] (1) Real $DER.hex.p (40) [ALGB] (1) Real T_in.T (41) [ALGB] (10) Real[10] hex.rho (start = {150.0 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, max = {1e5 for $i1 in 1:10}, nominal = {500.0 for $i1 in 1:10}) (42) [ALGB] (1) Real hex.w (start = hex.wnom / hex.Nt, min = -1e5, max = 1e5) (43) [ALGB] (10) Real[10] hex.u (44) [ALGB] (10) final input Real[10] hex.heatTransfer.fluidState.T = {hex.fluidState[1].T, hex.fluidState[2].T, hex.fluidState[3].T, hex.fluidState[4].T, hex.fluidState[5].T, hex.fluidState[6].T, hex.fluidState[7].T, hex.fluidState[8].T, hex.fluidState[9].T, hex.fluidState[10].T} (start = {500.0 for $i1 in 1:10}, min = {273.15 for $i1 in 1:10}, max = {2273.15 for $i1 in 1:10}, nominal = {500.0 for $i1 in 1:10}) (45) [ALGB] (10) final Real[10] hex.heatTransfer.w (min = {-1e5 for $i1 in 1:10}, max = {1e5 for $i1 in 1:10}) (46) [ALGB] (9) flow Real[9] tempSource.wall.Q (47) [ALGB] (9) Real[9] tempSource.wall.T (start = {288.15 for $i1 in 1:9}, min = {0.0 for $i1 in 1:9}, nominal = {300.0 for $i1 in 1:9}) (48) [ALGB] (9) Real[9] hex.wall.T (start = {288.15 for $i1 in 1:9}, min = {0.0 for $i1 in 1:9}, nominal = {300.0 for $i1 in 1:9}) (49) [ALGB] (10) Real[10] hex.h (start = {hex.hstart[$h1] for $h1 in 1:10}, min = {-1e10 for $i1 in 1:10}, max = {1e10 for $i1 in 1:10}, nominal = {5e5 for $i1 in 1:10}) (50) [ALGB] (9) flow Real[9] hex.wall.Q (51) [ALGB] (9) protected Real[9] hex.vbar (min = {0.0 for $i1 in 1:9}) (52) [ALGB] (9) Real[9] hex.heatTransfer.Qw (53) [ALGB] (9) Real[9] hex.wbar (start = {hex.wnom / hex.Nt for $wbar1 in 1:9}, min = {-1e5 for $i1 in 1:9}, max = {1e5 for $i1 in 1:9}) (54) [DISC] (10) Integer[10] hex.fluidState.phase (min = {0 for $i1 in 1:10}, max = {2 for $i1 in 1:10}) (55) [ALGB] (9) protected Real[9] hex.rhobar (start = {150.0 for $i1 in 1:9}, min = {0.0 for $i1 in 1:9}, max = {1e5 for $i1 in 1:9}, nominal = {500.0 for $i1 in 1:9}) (56) [ALGB] (1) Real Temperature.y (57) [ALGB] (10) Real[10] hex.T (start = {500.0 for $i1 in 1:10}, min = {273.15 for $i1 in 1:10}, max = {2273.15 for $i1 in 1:10}, nominal = {500.0 for $i1 in 1:10}) (58) [DISC] (1) Boolean $SEV_6 (59) [DISC] (1) Boolean $SEV_5 (60) [DISC] (1) Boolean $SEV_4 (61) [ALGB] (1) Real hex.Q (62) [DISC] (1) Boolean $SEV_3 (63) [ALGB] (1) Real valve.w (min = -1e5, max = 1e5) (64) [ALGB] (1) Real hex.Tr (65) [ALGB] (1) Real hex.M (min = 0.0) (66) [ALGB] (1) Real hex.Dpfric (67) [DISC] (1) Boolean $TEV_0 (68) [ALGB] (1) Real T_in.fluidState.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (69) [ALGB] (1) Real T_in.fluidState.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (70) [ALGB] (9) Real[9] hex.heatTransfer.Tw (start = {500.0 for $i1 in 1:9}, min = {273.15 for $i1 in 1:9}, max = {2273.15 for $i1 in 1:9}, nominal = {500.0 for $i1 in 1:9}) (71) [ALGB] (9) Real[9] hex.Q_single (72) [DISC] (10) final input Integer[10] hex.heatTransfer.fluidState.phase = {hex.fluidState[1].phase, hex.fluidState[2].phase, hex.fluidState[3].phase, hex.fluidState[4].phase, hex.fluidState[5].phase, hex.fluidState[6].phase, hex.fluidState[7].phase, hex.fluidState[8].phase, hex.fluidState[9].phase, hex.fluidState[10].phase} (min = {0 for $i1 in 1:10}, max = {2 for $i1 in 1:10}) (73) [ALGB] (1) Real T_in.fluidState.p (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (74) [ALGB] (1) Real hex.wout (min = -1e5, max = 1e5) System Equations (76/353) *************************** (1) [SCAL] (1) hex.wout = valve.w / hex.Nt ($RES_SIM_16) (2) [SCAL] (1) hex.Kf = (hex.omega_hyd * hex.Cf) / hex.A ^ 3.0 ($RES_SIM_52) (3) [SCAL] (1) hex.w = fluidSource.w0 / hex.Nt ($RES_SIM_17) (4) [SCAL] (1) hex.Cf = hex.Cfnom * hex.Kfc ($RES_SIM_53) (5) [SCAL] (1) T_in.fluidState.h = homotopy(if $SEV_5 then fluidSource.h else T_in.inlet.h_outflow, fluidSource.h) ($RES_$AUX_141) (6) [SCAL] (1) hex.omega_hyd = (4.0 * hex.A) / hex.Dhyd ($RES_SIM_54) (7) [SCAL] (1) T_out.fluidState.h = homotopy(if $SEV_6 then T_out.outlet.h_outflow else fluidSink.h, T_out.outlet.h_outflow) ($RES_$AUX_140) (8) [SCAL] (1) hex.heatTransfer.Qw = hex.heatTransfer.wall.Q ($RES_SIM_56) (9) [SCAL] (1) hex.heatTransfer.Tw = hex.heatTransfer.wall.T ($RES_SIM_57) (10) [FOR-] (10) ($RES_SIM_58) (10) [----] for j in 1:10 loop (10) [----] [SCAL] (1) hex.heatTransfer.T[j] = hex.heatTransfer.fluidState.h ($RES_SIM_59) (10) [----] end for; (11) [SCAL] (1) $FUN_3 = abs(hex.heatTransfer.w[1]) ($RES_$AUX_139) (12) [FOR-] (10) ($RES_SIM_20) (12) [----] for j in 1:10 loop (12) [----] [SCAL] (1) hex.T[j] = hex.fluidState.h ($RES_SIM_21) (12) [----] end for; (13) [SCAL] (1) valve.w = Constant1.k * valve.Kv * (hex.p - fluidSink.p0) ($RES_SIM_102) (14) [SCAL] (1) $FUN_4 = exp(-hex.heatTransfer.w_wnom / hex.heatTransfer.sigma) ($RES_$AUX_138) (15) [SCAL] (1) hex.Q = sum(hex.heatTransfer.wall.Q) ($RES_$AUX_137) (16) [FOR-] (10) ($RES_SIM_22) (16) [----] for j in 1:10 loop (16) [----] [SCAL] (1) hex.rho[j] = hex.fluidState.d ($RES_SIM_23) (16) [----] end for; (17) [SCAL] (1) $FUN_6 = sum(hex.dMdt) ($RES_$AUX_136) (18) [SCAL] (1) $FUN_7 = sum(hex.vbar) ($RES_$AUX_135) (19) [FOR-] (10) ($RES_SIM_24) (19) [----] for j in 1:10 loop (19) [----] [SCAL] (1) hex.drdp[j] = Modelica.Media.Water.IF97_Utilities.ddph_props(hex.fluidState.phase, hex.fluidState.T, Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(hex.fluidState.phase, hex.fluidState.T, hex.fluidState.p, 0)) ($RES_SIM_25) (19) [----] end for; (20) [FOR-] (9) ($RES_SIM_60) (20) [----] for j in 1:9 loop (20) [----] [SCAL] (1) hex.heatTransfer.Tvol[j] = if not hex.heatTransfer.useAverageTemperature then hex.heatTransfer.T[j + 1] else if not hex.heatTransfer.adaptiveAverageTemperature then (hex.heatTransfer.T[j] + hex.heatTransfer.T[j + 1]) / 2.0 else (hex.heatTransfer.T[j] + hex.heatTransfer.T[j + 1]) / 2.0 + ((hex.heatTransfer.T[j + 1] - hex.heatTransfer.T[j]) / 2.0) * $FUN_4 ($RES_SIM_61) (20) [----] end for; (21) [SCAL] (1) hex.Dpfric1 = homotopy(0.1111111111111111 * $FUN_7 * (hex.w * sqrt(hex.w * hex.w + (hex.wnom / hex.Nt) * hex.wnf * ((hex.wnom / hex.Nt) * hex.wnf))) * hex.Kf, (hex.dpnom / (hex.wnom / hex.Nt)) * hex.w) ($RES_$AUX_134) (22) [FOR-] (10) ($RES_SIM_26) (22) [----] for j in 1:10 loop (22) [----] [SCAL] (1) hex.drdh[j] = Modelica.Media.Water.IF97_Utilities.ddhp_props(hex.fluidState.phase, hex.fluidState.T, Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(hex.fluidState.phase, hex.fluidState.T, hex.fluidState.p, 0)) ($RES_SIM_27) (22) [----] end for; (23) [FOR-] (9) ($RES_SIM_62) (23) [----] for j in 1:9 loop (23) [----] [SCAL] (1) hex.heatTransfer.Qw[j] = hex.heatTransfer.gamma * hex.heatTransfer.kc * hex.heatTransfer.l * hex.heatTransfer.omega * (hex.heatTransfer.Tw[j] - hex.heatTransfer.Tvol[j]) * hex.heatTransfer.Nt ($RES_SIM_63) (23) [----] end for; (24) [FOR-] (9) ($RES_$AUX_132) (24) [----] for j in 1:9 loop (24) [----] [SCAL] (1) $FUN_9[integer(1.0 + ((-1.0) + j))] = sum(hex.dMdt[1:j - 1]) ($RES_$AUX_133) (24) [----] end for; (25) [SCAL] (1) T_in.fluidState.d = Modelica.Media.Water.IF97_Utilities.rho_ph(T_in.fluidState.p, T_in.fluidState.h, 0, 0) ($RES_SIM_144) (26) [SCAL] (1) $FUN_10 = sum(hex.rhobar) ($RES_$AUX_131) (27) [FOR-] (10) ($RES_SIM_28) (27) [----] for j in 1:10 loop (27) [----] [SCAL] (1) hex.u[j] = hex.w / (hex.A * hex.rho[j]) ($RES_SIM_29) (27) [----] end for; (28) [SCAL] (1) T_in.T = Modelica.Media.Water.IF97_Utilities.T_ph(T_in.fluidState.p, T_in.fluidState.h, 0, 0) ($RES_SIM_145) (29) [SCAL] (1) hex.heatTransfer.w_wnom = $FUN_3 / hex.heatTransfer.wnom ($RES_SIM_64) (30) [SCAL] (1) 1.0 - alpha = exp(-NTU) ($RES_$AUX_130) (31) [ARRY] (9) hex.heatTransfer.Qvol = hex.heatTransfer.Qw ($RES_SIM_65) (32) [ARRY] (10) hex.heatTransfer.w = hex.w * fill(1.0, 10) ($RES_SIM_66) (33) [ARRY] (50) hex.heatTransfer.fluidState = hex.fluidState ($RES_SIM_67) (34) [SCAL] (1) T_out.fluidState.d = Modelica.Media.Water.IF97_Utilities.rho_ph(fluidSink.p0, T_out.fluidState.h, 0, 0) ($RES_SIM_149) (35) [ARRY] (9) hex.Q_single = hex.heatTransfer.Qvol / hex.Nt ($RES_SIM_68) (36) [FOR-] (9) ($RES_SIM_69) (36) [----] for i in 1:9 loop (36) [----] [SCAL] (1) tempSource.wall.T[i] = Temperature.y ($RES_SIM_70) (36) [----] end for; (37) [SCAL] (1) cp = Modelica.Media.Water.IF97_Utilities.cp_props_ph(hex.fluidState.phase, hex.fluidState.T, Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(hex.fluidState.phase, hex.fluidState.T, 0, 0)) ($RES_BND_122) (38) [FOR-] (9) ($RES_SIM_110) (38) [----] for $i1 in 1:9 loop (38) [----] [SCAL] (1) tempSource.wall.Q[$i1] + hex.wall.Q[$i1] = 0.0 ($RES_SIM_111) (38) [----] end for; (39) [SCAL] (1) NTU = (6.283 * gamma * Dihex * Nt) / (Modelica.Media.Water.IF97_Utilities.cp_props_ph(hex.fluidState.phase, hex.fluidState.T, Modelica.Media.Water.IF97_Utilities.waterBaseProp_ph(hex.fluidState.phase, hex.fluidState.T, 0, 0)) * whex) ($RES_BND_123) (40) [SCAL] (1) tempSource.wall.T = hex.wall.T ($RES_SIM_112) (41) [ARRY] (10) hex.heatTransfer.fluidState.phase = {hex.fluidState[1].phase, hex.fluidState[2].phase, hex.fluidState[3].phase, hex.fluidState[4].phase, hex.fluidState[5].phase, hex.fluidState[6].phase, hex.fluidState[7].phase, hex.fluidState[8].phase, hex.fluidState[9].phase, hex.fluidState[10].phase} ($RES_BND_125) (42) [FOR-] (9) ($RES_SIM_30) (42) [----] for j in 1:9 loop (42) [----] [SCAL] (1) (hex.wbar[j] * (hex.h[j + 1] - hex.h[j]) + hex.rhobar[j] * hex.l * hex.A * $DER.hex.htilde[j]) - hex.l * hex.A * $DER.hex.p = hex.Q_single[j] ($RES_SIM_31) (42) [----] end for; (43) [ARRY] (10) hex.heatTransfer.fluidState.h = {hex.fluidState[1].h, hex.fluidState[2].h, hex.fluidState[3].h, hex.fluidState[4].h, hex.fluidState[5].h, hex.fluidState[6].h, hex.fluidState[7].h, hex.fluidState[8].h, hex.fluidState[9].h, hex.fluidState[10].h} ($RES_BND_126) (44) [ARRY] (10) hex.heatTransfer.fluidState.d = {hex.fluidState[1].d, hex.fluidState[2].d, hex.fluidState[3].d, hex.fluidState[4].d, hex.fluidState[5].d, hex.fluidState[6].d, hex.fluidState[7].d, hex.fluidState[8].d, hex.fluidState[9].d, hex.fluidState[10].d} ($RES_BND_127) (45) [FOR-] (9) ($RES_SIM_32) (45) [----] for j in 1:9 loop (45) [----] [SCAL] (1) hex.dMdt[j] = hex.l * hex.A * (hex.drbdh[j] * $DER.hex.htilde[j] + hex.drbdp[j] * $DER.hex.p) ($RES_SIM_33) (45) [----] end for; (46) [ARRY] (10) hex.heatTransfer.fluidState.T = {hex.fluidState[1].T, hex.fluidState[2].T, hex.fluidState[3].T, hex.fluidState[4].T, hex.fluidState[5].T, hex.fluidState[6].T, hex.fluidState[7].T, hex.fluidState[8].T, hex.fluidState[9].T, hex.fluidState[10].T} ($RES_BND_128) (47) [SCAL] (1) T_out.T = Modelica.Media.Water.IF97_Utilities.T_ph(fluidSink.p0, T_out.fluidState.h, 0, 0) ($RES_SIM_150) (48) [ARRY] (10) hex.heatTransfer.fluidState.p = {hex.fluidState[1].p, hex.fluidState[2].p, hex.fluidState[3].p, hex.fluidState[4].p, hex.fluidState[5].p, hex.fluidState[6].p, hex.fluidState[7].p, hex.fluidState[8].p, hex.fluidState[9].p, hex.fluidState[10].p} ($RES_BND_129) (49) [FOR-] (9) ($RES_SIM_34) (49) [----] for j in 1:9 loop (49) [----] [SCAL] (1) hex.rhobar[j] = (hex.rho[j] + hex.rho[j + 1]) / 2.0 ($RES_SIM_35) (49) [----] end for; (50) [SCAL] (1) hex.fluidState[j].phase = 0 ($RES_SIM_152) (51) [FOR-] (9) ($RES_SIM_36) (51) [----] for j in 1:9 loop (51) [----] [SCAL] (1) hex.drbdp[j] = (hex.drdp[j] + hex.drdp[j + 1]) / 2.0 ($RES_SIM_37) (51) [----] end for; (52) [SCAL] (1) hex.fluidState[j].h = hex.h[j] ($RES_SIM_153) (53) [FOR-] (9) ($RES_SIM_119) (53) [----] for $i1 in 1:9 loop (53) [----] [SCAL] (1) (-hex.wall.Q[$i1]) + hex.heatTransfer.wall.Q[$i1] = 0.0 ($RES_SIM_120) (53) [----] end for; (54) [SCAL] (1) hex.fluidState[j].d = Modelica.Media.Water.IF97_Utilities.rho_ph(hex.p, hex.h[j], 0, 0) ($RES_SIM_154) (55) [FOR-] (9) ($RES_SIM_38) (55) [----] for j in 1:9 loop (55) [----] [SCAL] (1) hex.drbdh[j] = (hex.drdh[j] + hex.drdh[j + 1]) / 2.0 ($RES_SIM_39) (55) [----] end for; (56) [SCAL] (1) hex.fluidState[j].T = Modelica.Media.Water.IF97_Utilities.T_ph(hex.p, hex.h[j], 0, 0) ($RES_SIM_155) (57) [SCAL] (1) hex.fluidState[j].p = hex.p ($RES_SIM_156) (58) [SCAL] (1) $TEV_0 = time < Temperature.startTime ($RES_EVT_158) (59) [SCAL] (1) hex.wall.T = hex.heatTransfer.wall.T ($RES_SIM_121) (60) [FOR-] (9) ($RES_SIM_40) (60) [----] for j in 1:9 loop (60) [----] [SCAL] (1) hex.vbar[j] = 1.0 / hex.rhobar[j] ($RES_SIM_41) (60) [----] end for; (61) [FOR-] (9) ($RES_SIM_42) (61) [----] for j in 1:9 loop (61) [----] [SCAL] (1) hex.wbar[j] = fluidSource.w0 / hex.Nt - (hex.dMdt[j] / 2.0 + $FUN_9[integer(1.0 + ((-1.0) + j))]) ($RES_SIM_43) (61) [----] end for; (62) [SCAL] (1) hex.Dpfric = hex.Dpfric1 ($RES_SIM_47) (63) [SCAL] (1) (hex.p + hex.Dpfric) - T_in.fluidState.p = 0.0 ($RES_SIM_48) (64) [SCAL] (1) $FUN_6 = (fluidSource.w0 - valve.w) / hex.Nt ($RES_SIM_49) (65) [SCAL] (1) Temperature.y = Temperature.offset + (if $TEV_0 then 0.0 else Temperature.height) ($RES_SIM_86) (66) [SCAL] (1) $SEV_3 = hex.w > (-hex.wnom * hex.wnm) ($RES_EVT_162) (67) [SCAL] (1) $SEV_4 = hex.Kf >= 0.0 ($RES_EVT_163) (68) [SCAL] (1) $SEV_5 = fluidSource.w0 > 0.0 ($RES_EVT_164) (69) [SCAL] (1) $SEV_6 = valve.w > 0.0 ($RES_EVT_165) (70) [SCAL] (1) hex.M = hex.A * $FUN_10 * hex.l ($RES_SIM_8) (71) [SCAL] (1) hex.Mtot = hex.M * hex.Nt ($RES_SIM_7) (72) [SCAL] (1) hex.Tr = noEvent(hex.M / max(hex.w, 1e-15)) ($RES_SIM_6) (73) [SCAL] (1) hex.h[2:10] = hex.htilde ($RES_SIM_10) (74) [SCAL] (1) hex.h[1] = fluidSource.h ($RES_SIM_11) (75) [SCAL] (1) T_out.outlet.h_outflow = hex.htilde[9] ($RES_SIM_12) (76) [SCAL] (1) T_in.inlet.h_outflow = hex.h[1] ($RES_SIM_13)