Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries/ --ompython_omhome=/usr ThermoPower_ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_AdaptiveAverageTemp.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_AdaptiveAverageTemp,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="ThermoPower_ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_AdaptiveAverageTemp") translateModel(ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_AdaptiveAverageTemp,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="ThermoPower_ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_AdaptiveAverageTemp") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.000993/0.0009931, allocations: 109.6 kB / 17.69 MB, free: 5.523 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.001049/0.001049, allocations: 192.7 kB / 18.63 MB, free: 4.59 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.156/1.156, allocations: 205.1 MB / 224.5 MB, free: 12.28 MB / 190.1 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ThermoPower 3.1.0-master/package.mo): time 0.2416/0.2416, allocations: 48.84 MB / 320.7 MB, free: 11.05 MB / 270.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 1.671e-05/1.673e-05, allocations: 4.078 kB / 391.5 MB, free: 48.58 MB / 318.1 MB Notification: Performance of NFInst.instantiate(ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_AdaptiveAverageTemp): time 0.03068/0.03071, allocations: 52.02 MB / 443.5 MB, free: 15.95 MB / 334.1 MB Notification: Performance of NFInst.instExpressions: time 0.0154/0.04614, allocations: 15.74 MB / 459.2 MB, free: 188 kB / 334.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.0003758/0.04654, allocations: 11.94 kB / 459.2 MB, free: 176 kB / 334.1 MB Notification: Performance of NFTyping.typeComponents: time 0.0007506/0.0473, allocations: 325.8 kB / 459.6 MB, free: 15.85 MB / 350.1 MB Notification: Performance of NFTyping.typeBindings: time 0.01098/0.05828, allocations: 4.738 MB / 464.3 MB, free: 11.12 MB / 350.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.003306/0.06161, allocations: 1.407 MB / 465.7 MB, free: 9.715 MB / 350.1 MB Notification: Performance of NFFlatten.flatten: time 0.001484/0.0631, allocations: 1.452 MB / 467.1 MB, free: 8.262 MB / 350.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0004592/0.06357, allocations: 416.8 kB / 467.6 MB, free: 7.855 MB / 350.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.0005417/0.06412, allocations: 0.5708 MB / 468.1 MB, free: 7.285 MB / 350.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.0004609/0.06459, allocations: 0.5135 MB / 468.6 MB, free: 6.77 MB / 350.1 MB Notification: Performance of NFPackage.collectConstants: time 8.148e-05/0.06468, allocations: 55.98 kB / 468.7 MB, free: 6.715 MB / 350.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.008927/0.07362, allocations: 6.735 MB / 475.4 MB, free: 15.97 MB / 366.1 MB Notification: Performance of combineBinaries: time 0.0008947/0.07453, allocations: 1.273 MB / 476.7 MB, free: 14.69 MB / 366.1 MB Notification: Performance of replaceArrayConstructors: time 0.0004457/0.07498, allocations: 0.8179 MB / 477.5 MB, free: 13.86 MB / 366.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0001225/0.07511, allocations: 115.6 kB / 477.6 MB, free: 13.75 MB / 366.1 MB Notification: Performance of FrontEnd: time 9.496e-05/0.07521, allocations: 12 kB / 477.6 MB, free: 13.73 MB / 366.1 MB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 208 (103) * Number of variables: 328 (118) Notification: Performance of Bindings: time 0.002991/0.07821, allocations: 3.663 MB / 481.3 MB, free: 9.941 MB / 366.1 MB Notification: Performance of FunctionAlias: time 0.0002277/0.07844, allocations: 203.2 kB / 481.5 MB, free: 9.746 MB / 366.1 MB Notification: Performance of Early Inline: time 0.002131/0.08058, allocations: 2.175 MB / 483.7 MB, free: 7.535 MB / 366.1 MB Notification: Performance of simplify1: time 9.722e-05/0.08069, allocations: 103.9 kB / 483.8 MB, free: 7.434 MB / 366.1 MB Notification: Performance of Alias: time 0.002152/0.08285, allocations: 2.084 MB / 485.9 MB, free: 5.16 MB / 366.1 MB Notification: Performance of simplify2: time 6.425e-05/0.08292, allocations: 63.91 kB / 485.9 MB, free: 5.098 MB / 366.1 MB Notification: Performance of Events: time 0.0002223/0.08315, allocations: 210.4 kB / 486.1 MB, free: 4.895 MB / 366.1 MB Notification: Performance of Detect States: time 0.0004456/0.08361, allocations: 411.3 kB / 486.5 MB, free: 4.484 MB / 366.1 MB Notification: Performance of Partitioning: time 0.0005442/0.08416, allocations: 0.5787 MB / 487.1 MB, free: 3.852 MB / 366.1 MB Error: Internal error NBAdjacency.Matrix.createPseudo failed for: [FOR-] (3) ($RES_$AUX_132) [----] for $i1 in 1:3 loop [----] [SCAL] (1) $FUN_6[$i1] = sum(hex.dMdt[1:$i1 - 1]) ($RES_$AUX_133) [----] end for; Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (84/296) *************************** (1) [ALGB] (1) Real T_out.fluidState.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (2) [ALGB] (1) Real T_out.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (3) [ALGB] (1) Real T_out.fluidState.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (4) [ALGB] (16) Real[4, 4] hex.fluidState.p (start = {5e6 for $i1 in 1:4}, min = {611.657 for $i1 in 1:4}, max = {1e8 for $i1 in 1:4}, nominal = {1e6 for $i1 in 1:4}) (5) [ALGB] (1) Real hex.omega_hyd (6) [ALGB] (1) Real alpha = 1.0 - exp(-NTU) (7) [ALGB] (4) protected Real[4] hex.drdp (8) [ALGB] (1) Real hex.Dpfric1 (9) [ALGB] (16) Real[4, 4] hex.fluidState.h (start = {1e5 for $i1 in 1:4}, min = {-1e10 for $i1 in 1:4}, max = {1e10 for $i1 in 1:4}, nominal = {5e5 for $i1 in 1:4}) (10) [ALGB] (1) Real NTU = (gamma * Dihex * Nt * 2.0 * 3.1415) / (ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_AdaptiveAverageTemp.Medium.specificHeatCapacityCp(hex.fluidState[1]) * whex) (11) [ALGB] (3) Real[3] hex.heatTransfer.Qvol = hex.heatTransfer.Qw (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] (16) Real[4, 4] hex.fluidState.d (start = {150.0 for $i1 in 1:4}, min = {0.0 for $i1 in 1:4}, max = {1e5 for $i1 in 1:4}, nominal = {500.0 for $i1 in 1:4}) (15) [ALGB] (1) Real T_out.fluidState.T (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (16) [ALGB] (4) protected Real[4] hex.drdh (17) [ALGB] (3) Real[3] hex.heatTransfer.wall.T (start = {288.15 for $i1 in 1:3}, min = {0.0 for $i1 in 1:3}, nominal = {300.0 for $i1 in 1:3}) (18) [ALGB] (1) Real T_out.T (19) [ALGB] (1) Real hex.Kf (20) [ALGB] (1) Real hex.heatTransfer.w_wnom_reg (21) [ALGB] (3) flow Real[3] hex.heatTransfer.wall.Q (22) [ALGB] (1) Real hex.heatTransfer.w_wnom (start = 1.0) (23) [ALGB] (3) Real[3] hex.heatTransfer.Tvol (start = {500.0 for $i1 in 1:3}, min = {273.15 for $i1 in 1:3}, max = {2273.15 for $i1 in 1:3}, nominal = {500.0 for $i1 in 1:3}) (24) [ALGB] (1) Real T_in.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (25) [ALGB] (4) Real[4] hex.heatTransfer.T (start = {500.0 for $i1 in 1:4}, min = {273.15 for $i1 in 1:4}, max = {2273.15 for $i1 in 1:4}, nominal = {500.0 for $i1 in 1:4}) (26) [ALGB] (3) protected Real[3] hex.drbdp (27) [ALGB] (16) Real[4, 4] hex.fluidState.T (start = {500.0 for $i1 in 1:4}, min = {273.15 for $i1 in 1:4}, max = {2273.15 for $i1 in 1:4}, nominal = {500.0 for $i1 in 1:4}) (28) [ALGB] (1) Real hex.Cf (29) [DER-] (3) Real[3] $DER.hex.htilde (30) [ALGB] (16) final input Real[4, 4] hex.heatTransfer.fluidState.p = {hex.fluidState[1].p, hex.fluidState[2].p, hex.fluidState[3].p, hex.fluidState[4].p} (start = {5e6 for $i1 in 1:4}, min = {611.657 for $i1 in 1:4}, max = {1e8 for $i1 in 1:4}, nominal = {1e6 for $i1 in 1:4}) (31) [ALGB] (1) Real $FUN_7 (32) [ALGB] (3) Real[3] $FUN_6 (33) [ALGB] (3) protected Real[3] hex.drbdh (34) [ALGB] (1) Real $FUN_5 (35) [ALGB] (3) Real[3] hex.dMdt (36) [ALGB] (1) Real hex.Mtot (min = 0.0) (37) [ALGB] (1) Real $FUN_4 (38) [ALGB] (16) final input Real[4, 4] hex.heatTransfer.fluidState.h = {hex.fluidState[1].h, hex.fluidState[2].h, hex.fluidState[3].h, hex.fluidState[4].h} (start = {1e5 for $i1 in 1:4}, min = {-1e10 for $i1 in 1:4}, max = {1e10 for $i1 in 1:4}, nominal = {5e5 for $i1 in 1:4}) (39) [ALGB] (1) Real $FUN_2 (40) [ALGB] (1) Real cp = ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFV_AdaptiveAverageTemp.Medium.specificHeatCapacityCp(hex.fluidState[1]) (41) [ALGB] (1) Real $FUN_1 (42) [ALGB] (16) final input Real[4, 4] hex.heatTransfer.fluidState.d = {hex.fluidState[1].d, hex.fluidState[2].d, hex.fluidState[3].d, hex.fluidState[4].d} (start = {150.0 for $i1 in 1:4}, min = {0.0 for $i1 in 1:4}, max = {1e5 for $i1 in 1:4}, nominal = {500.0 for $i1 in 1:4}) (43) [DER-] (1) Real $DER.hex.p (44) [ALGB] (1) Real T_in.T (45) [ALGB] (4) Real[4] hex.rho (start = {150.0 for $i1 in 1:4}, min = {0.0 for $i1 in 1:4}, max = {1e5 for $i1 in 1:4}, nominal = {500.0 for $i1 in 1:4}) (46) [ALGB] (1) Real hex.w (start = hex.wnom / hex.Nt, min = -1e5, max = 1e5) (47) [ALGB] (4) Real[4] hex.u (48) [ALGB] (16) final input Real[4, 4] hex.heatTransfer.fluidState.T = {hex.fluidState[1].T, hex.fluidState[2].T, hex.fluidState[3].T, hex.fluidState[4].T} (start = {500.0 for $i1 in 1:4}, min = {273.15 for $i1 in 1:4}, max = {2273.15 for $i1 in 1:4}, nominal = {500.0 for $i1 in 1:4}) (49) [ALGB] (1) Real massFlowRate.y (50) [ALGB] (4) final Real[4] hex.heatTransfer.w = hex.w * {1.0 for $i1 in 1:4} (min = {-1e5 for $i1 in 1:4}, max = {1e5 for $i1 in 1:4}) (51) [ALGB] (3) flow Real[3] tempSource.wall.Q (52) [ALGB] (3) Real[3] tempSource.wall.T (start = {288.15 for $i1 in 1:3}, min = {0.0 for $i1 in 1:3}, nominal = {300.0 for $i1 in 1:3}) (53) [ALGB] (3) Real[3] hex.wall.T (start = {288.15 for $i1 in 1:3}, min = {0.0 for $i1 in 1:3}, nominal = {300.0 for $i1 in 1:3}) (54) [ALGB] (4) Real[4] hex.h (start = hex.hstart, min = {-1e10 for $i1 in 1:4}, max = {1e10 for $i1 in 1:4}, nominal = {5e5 for $i1 in 1:4}) (55) [ALGB] (3) flow Real[3] hex.wall.Q (56) [ALGB] (3) protected Real[3] hex.vbar (min = {0.0 for $i1 in 1:3}) (57) [ALGB] (1) Real hex.heatTransfer.gamma (start = hex.heatTransfer.gamma_nom) (58) [ALGB] (3) Real[3] hex.heatTransfer.Qw (59) [ALGB] (3) Real[3] hex.wbar (start = {hex.wnom / hex.Nt for $i1 in 1:3}, min = {-1e5 for $i1 in 1:3}, max = {1e5 for $i1 in 1:3}) (60) [DISC] (16) Integer[4, 4] hex.fluidState.phase (min = {0 for $i1 in 1:4}, max = {2 for $i1 in 1:4}) (61) [ALGB] (3) protected Real[3] hex.rhobar (start = {150.0 for $i1 in 1:3}, min = {0.0 for $i1 in 1:3}, max = {1e5 for $i1 in 1:3}, nominal = {500.0 for $i1 in 1:3}) (62) [ALGB] (1) Real T_in.fluidState.T (start = 500.0, min = 273.15, max = 2273.15, nominal = 500.0) (63) [DISC] (1) Boolean $SEV_8 (64) [DISC] (1) Boolean $SEV_7 (65) [ALGB] (4) Real[4] hex.T (start = {500.0 for $i1 in 1:4}, min = {273.15 for $i1 in 1:4}, max = {2273.15 for $i1 in 1:4}, nominal = {500.0 for $i1 in 1:4}) (66) [DISC] (1) Boolean $SEV_6 (67) [DISC] (1) Boolean $SEV_5 (68) [DISC] (1) Boolean $SEV_4 (69) [ALGB] (1) Real hex.Q (70) [DISC] (1) Boolean $SEV_3 (71) [ALGB] (1) Real valve.w (min = -1e5, max = 1e5) (72) [ALGB] (1) Real hex.Tr (73) [ALGB] (1) Real hex.M (min = 0.0) (74) [ALGB] (1) Real hex.Dpfric (75) [DISC] (1) Boolean $TEV_1 (76) [DISC] (1) Boolean $TEV_0 (77) [ALGB] (1) Real T_in.fluidState.d (start = 150.0, min = 0.0, max = 1e5, nominal = 500.0) (78) [ALGB] (1) Real T_in.fluidState.h (start = 1e5, min = -1e10, max = 1e10, nominal = 5e5) (79) [ALGB] (3) Real[3] hex.heatTransfer.Tw (start = {500.0 for $i1 in 1:3}, min = {273.15 for $i1 in 1:3}, max = {2273.15 for $i1 in 1:3}, nominal = {500.0 for $i1 in 1:3}) (80) [ALGB] (3) Real[3] hex.Q_single = hex.heatTransfer.Qvol / hex.Nt (81) [DISC] (16) final input Integer[4, 4] hex.heatTransfer.fluidState.phase = {hex.fluidState[1].phase, hex.fluidState[2].phase, hex.fluidState[3].phase, hex.fluidState[4].phase} (min = {0 for $i1 in 1:4}, max = {2 for $i1 in 1:4}) (82) [ALGB] (1) Real T_in.fluidState.p (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (83) [ALGB] (1) Real T_in.outlet.p (start = 5e6, min = 611.657, max = 1e8, nominal = 1e6) (84) [ALGB] (1) Real hex.wout (min = -1e5, max = 1e5) System Equations (81/176) *************************** (1) [SCAL] (1) $FUN_4 = (massFlowRate.y - valve.w) / hex.Nt ($RES_SIM_50) (2) [SCAL] (1) hex.wout = valve.w / hex.Nt ($RES_SIM_17) (3) [SCAL] (1) hex.Kf = (hex.omega_hyd * hex.Cf) / hex.A ^ 3.0 ($RES_SIM_53) (4) [SCAL] (1) hex.w = massFlowRate.y / hex.Nt ($RES_SIM_18) (5) [SCAL] (1) hex.Cf = hex.Cfnom * hex.Kfc ($RES_SIM_54) (6) [SCAL] (1) hex.omega_hyd = (4.0 * hex.A) / hex.Dhyd ($RES_SIM_55) (7) [ARRY] (3) hex.heatTransfer.Qw = hex.heatTransfer.wall.Q ($RES_SIM_57) (8) [ARRY] (3) hex.heatTransfer.Tw = hex.heatTransfer.wall.T ($RES_SIM_58) (9) [FOR-] (4) ($RES_SIM_59) (9) [----] for $i1 in 1:4 loop (9) [----] [SCAL] (1) hex.heatTransfer.T[$i1] = hex.heatTransfer.fluidState.h ($RES_SIM_60) (9) [----] end for; (10) [SCAL] (1) $SEV_8 = massFlowRate.y > 0.0 ($RES_EVT_170) (11) [SCAL] (1) valve.w = valveOpening.k * valve.Kv * (hex.p - fluidSink.p0) ($RES_SIM_100) (12) [SCAL] (1) $FUN_1 = abs(hex.heatTransfer.w[1]) ($RES_$AUX_138) (13) [FOR-] (4) ($RES_SIM_21) (13) [----] for $i1 in 1:4 loop (13) [----] [SCAL] (1) hex.T[$i1] = hex.fluidState.h ($RES_SIM_22) (13) [----] end for; (14) [SCAL] (1) $FUN_2 = exp(-hex.heatTransfer.w_wnom / hex.heatTransfer.sigma) ($RES_$AUX_137) (15) [SCAL] (1) hex.Q = sum(hex.heatTransfer.wall.Q) ($RES_$AUX_136) (16) [FOR-] (4) ($RES_SIM_23) (16) [----] for $i1 in 1:4 loop (16) [----] [SCAL] (1) hex.rho[$i1] = hex.fluidState.d ($RES_SIM_24) (16) [----] end for; (17) [SCAL] (1) T_in.fluidState.h = T_in.h ($RES_SIM_140) (18) [SCAL] (1) $FUN_4 = sum(hex.dMdt) ($RES_$AUX_135) (19) [SCAL] (1) T_in.fluidState.d = Modelica.Media.Water.IF97_Utilities.rho_ph(T_in.outlet.p, T_in.h, 0, 0) ($RES_SIM_141) (20) [SCAL] (1) $FUN_5 = sum(hex.vbar) ($RES_$AUX_134) (21) [FOR-] (4) ($RES_SIM_25) (21) [----] for $i1 in 1:4 loop (21) [----] [SCAL] (1) hex.drdp[$i1] = 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_26) (21) [----] end for; (22) [SCAL] (1) T_in.fluidState.T = Modelica.Media.Water.IF97_Utilities.T_ph(T_in.outlet.p, T_in.h, 0, 0) ($RES_SIM_142) (23) [FOR-] (3) ($RES_SIM_61) (23) [----] for $i1 in 1:3 loop (23) [----] [SCAL] (1) hex.heatTransfer.Tvol[$i1] = if not hex.heatTransfer.useAverageTemperature then hex.heatTransfer.T[$i1 + 1] else if not hex.heatTransfer.adaptiveAverageTemperature then (hex.heatTransfer.T[$i1] + hex.heatTransfer.T[$i1 + 1]) / 2.0 else (hex.heatTransfer.T[$i1] + hex.heatTransfer.T[$i1 + 1]) / 2.0 + ((hex.heatTransfer.T[$i1 + 1] - hex.heatTransfer.T[$i1]) / 2.0) * $FUN_2 ($RES_SIM_62) (23) [----] end for; (24) [SCAL] (1) T_in.fluidState.p = T_in.outlet.p ($RES_SIM_143) (25) [FOR-] (3) ($RES_$AUX_132) (25) [----] for $i1 in 1:3 loop (25) [----] [SCAL] (1) $FUN_6[$i1] = sum(hex.dMdt[1:$i1 - 1]) ($RES_$AUX_133) (25) [----] end for; (26) [FOR-] (4) ($RES_SIM_27) (26) [----] for $i1 in 1:4 loop (26) [----] [SCAL] (1) hex.drdh[$i1] = 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_28) (26) [----] end for; (27) [FOR-] (3) ($RES_SIM_109) (27) [----] for $i1 in 1:3 loop (27) [----] [SCAL] (1) tempSource.wall.Q[$i1] + hex.wall.Q[$i1] = 0.0 ($RES_SIM_110) (27) [----] end for; (28) [FOR-] (3) ($RES_SIM_63) (28) [----] for $i1 in 1:3 loop (28) [----] [SCAL] (1) hex.heatTransfer.Qw[$i1] = hex.heatTransfer.l * hex.heatTransfer.omega * hex.heatTransfer.gamma * hex.heatTransfer.kc * (hex.heatTransfer.Tw[$i1] - hex.heatTransfer.Tvol[$i1]) * hex.heatTransfer.Nt ($RES_SIM_64) (28) [----] end for; (29) [SCAL] (1) $FUN_7 = sum(hex.rhobar) ($RES_$AUX_131) (30) [SCAL] (1) T_out.fluidState.h = T_out.h ($RES_SIM_145) (31) [SCAL] (1) 1.0 - alpha = exp(-NTU) ($RES_$AUX_130) (32) [FOR-] (4) ($RES_SIM_29) (32) [----] for $i1 in 1:4 loop (32) [----] [SCAL] (1) hex.u[$i1] = hex.w / (hex.A * hex.rho[$i1]) ($RES_SIM_30) (32) [----] end for; (33) [SCAL] (1) T_out.fluidState.d = Modelica.Media.Water.IF97_Utilities.rho_ph(fluidSink.p0, T_out.h, 0, 0) ($RES_SIM_146) (34) [SCAL] (1) hex.heatTransfer.gamma = homotopy(hex.heatTransfer.gamma_nom * hex.heatTransfer.w_wnom_reg ^ hex.heatTransfer.alpha, hex.heatTransfer.gamma_nom) ($RES_SIM_65) (35) [SCAL] (1) T_out.fluidState.T = Modelica.Media.Water.IF97_Utilities.T_ph(fluidSink.p0, T_out.h, 0, 0) ($RES_SIM_147) (36) [SCAL] (1) hex.heatTransfer.w_wnom_reg = if $SEV_5 then (0.5 * hex.heatTransfer.beta + hex.heatTransfer.beta) - (0.5 * ((0.5 * hex.heatTransfer.beta + hex.heatTransfer.beta) - hex.heatTransfer.w_wnom) * hex.heatTransfer.beta) / ((0.5 * hex.heatTransfer.beta) ^ 4.0 + (hex.heatTransfer.beta + 0.5 * hex.heatTransfer.beta - hex.heatTransfer.w_wnom) ^ 4.0) ^ 0.25 else if $SEV_6 then (1e9 + (0.5 * ((-1e9) + hex.heatTransfer.w_wnom + 0.5 * hex.heatTransfer.beta) * hex.heatTransfer.beta) / ((0.5 * hex.heatTransfer.beta) ^ 4.0 + (hex.heatTransfer.w_wnom - 1e9 + 0.5 * hex.heatTransfer.beta) ^ 4.0) ^ 0.25) - 0.5 * hex.heatTransfer.beta else hex.heatTransfer.w_wnom ($RES_SIM_66) (37) [SCAL] (1) hex.heatTransfer.w_wnom = $FUN_1 / hex.heatTransfer.wnom_ht ($RES_SIM_67) (38) [FOR-] (4) ($RES_SIM_149) (38) [----] for $i1 in 1:4 loop (38) [----] [SCAL] (1) hex.fluidState[$i1].phase = 0 ($RES_SIM_150) (38) [----] end for; (39) [FOR-] (3) ($RES_SIM_68) (39) [----] for $i1 in 1:3 loop (39) [----] [SCAL] (1) tempSource.wall.T[$i1] = temperature.k ($RES_SIM_69) (39) [----] end for; (40) [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) (41) [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) (42) [ARRY] (3) tempSource.wall.T = hex.wall.T ($RES_SIM_111) (43) [ARRY] (3) hex.Q_single = hex.heatTransfer.Qvol / hex.Nt ($RES_BND_125) (44) [FOR-] (4) ($RES_BND_126) (44) [----] for $i1 in 1:4 loop (44) [----] [SCAL] (1) hex.heatTransfer.w[$i1] = hex.w ($RES_BND_127) (44) [----] end for; (45) [FOR-] (3) ($RES_SIM_31) (45) [----] for $i1 in 1:3 loop (45) [----] [SCAL] (1) (hex.wbar[$i1] * (hex.h[$i1 + 1] - hex.h[$i1]) + hex.rhobar[$i1] * hex.l * hex.A * $DER.hex.htilde[$i1]) - hex.l * hex.A * $DER.hex.p = hex.Q_single[$i1] ($RES_SIM_32) (45) [----] end for; (46) [ARRY] (3) hex.heatTransfer.Qvol = hex.heatTransfer.Qw ($RES_BND_128) (47) [FOR-] (3) ($RES_SIM_33) (47) [----] for $i1 in 1:3 loop (47) [----] [SCAL] (1) hex.dMdt[$i1] = hex.l * hex.A * (hex.drbdh[$i1] * $DER.hex.htilde[$i1] + hex.drbdp[$i1] * $DER.hex.p) ($RES_SIM_34) (47) [----] end for; (48) [ARRY] (20) hex.heatTransfer.fluidState = hex.fluidState ($RES_BND_129) (49) [FOR-] (4) ($RES_SIM_151) (49) [----] for $i1 in 1:4 loop (49) [----] [SCAL] (1) hex.fluidState[$i1].h = hex.h[$i1] ($RES_SIM_152) (49) [----] end for; (50) [FOR-] (3) ($RES_SIM_35) (50) [----] for $i1 in 1:3 loop (50) [----] [SCAL] (1) hex.rhobar[$i1] = (hex.rho[$i1] + hex.rho[$i1 + 1]) / 2.0 ($RES_SIM_36) (50) [----] end for; (51) [FOR-] (3) ($RES_SIM_118) (51) [----] for $i1 in 1:3 loop (51) [----] [SCAL] (1) hex.heatTransfer.wall.Q[$i1] - hex.wall.Q[$i1] = 0.0 ($RES_SIM_119) (51) [----] end for; (52) [FOR-] (4) ($RES_SIM_153) (52) [----] for $i1 in 1:4 loop (52) [----] [SCAL] (1) hex.fluidState[$i1].d = Modelica.Media.Water.IF97_Utilities.rho_ph(hex.p, hex.h[$i1], 0, 0) ($RES_SIM_154) (52) [----] end for; (53) [SCAL] (1) T_out.T = T_out.fluidState.T ($RES_SIM_72) (54) [FOR-] (3) ($RES_SIM_37) (54) [----] for $i1 in 1:3 loop (54) [----] [SCAL] (1) hex.drbdp[$i1] = (hex.drdp[$i1] + hex.drdp[$i1 + 1]) / 2.0 ($RES_SIM_38) (54) [----] end for; (55) [FOR-] (4) ($RES_SIM_155) (55) [----] for $i1 in 1:4 loop (55) [----] [SCAL] (1) hex.fluidState[$i1].T = Modelica.Media.Water.IF97_Utilities.T_ph(hex.p, hex.h[$i1], 0, 0) ($RES_SIM_156) (55) [----] end for; (56) [SCAL] (1) T_out.h = homotopy(if $SEV_7 then T_out.outlet.h_outflow else fluidSink.h, T_out.outlet.h_outflow) ($RES_SIM_74) (57) [FOR-] (3) ($RES_SIM_39) (57) [----] for $i1 in 1:3 loop (57) [----] [SCAL] (1) hex.drbdh[$i1] = (hex.drdh[$i1] + hex.drdh[$i1 + 1]) / 2.0 ($RES_SIM_40) (57) [----] end for; (58) [FOR-] (4) ($RES_SIM_157) (58) [----] for $i1 in 1:4 loop (58) [----] [SCAL] (1) hex.fluidState[$i1].p = hex.p ($RES_SIM_158) (58) [----] end for; (59) [SCAL] (1) T_in.T = T_in.fluidState.T ($RES_SIM_79) (60) [ARRY] (3) hex.wall.T = hex.heatTransfer.wall.T ($RES_SIM_120) (61) [FOR-] (3) ($RES_SIM_41) (61) [----] for $i1 in 1:3 loop (61) [----] [SCAL] (1) hex.vbar[$i1] = 1.0 / hex.rhobar[$i1] ($RES_SIM_42) (61) [----] end for; (62) [FOR-] (3) ($RES_SIM_43) (62) [----] for $i1 in 1:3 loop (62) [----] [SCAL] (1) hex.wbar[$i1] = massFlowRate.y / hex.Nt - (hex.dMdt[$i1] / 2.0 + $FUN_6[$i1]) ($RES_SIM_44) (62) [----] end for; (63) [SCAL] (1) T_in.h = homotopy(if $SEV_8 then fluidSource.h else T_in.inlet.h_outflow, fluidSource.h) ($RES_SIM_81) (64) [SCAL] (1) hex.Dpfric1 = homotopy(0.3333333333333333 * $FUN_5 * (hex.w * sqrt(hex.w * hex.w + (hex.wnf * hex.wnom * hex.wnf * hex.wnom) / (hex.Nt * hex.Nt))) * hex.Kf, (hex.dpnom / (hex.wnom / hex.Nt)) * hex.w) ($RES_SIM_47) (65) [SCAL] (1) hex.Dpfric = hex.Dpfric1 ($RES_SIM_48) (66) [SCAL] (1) (hex.p + hex.Dpfric) - T_in.outlet.p = 0.0 ($RES_SIM_49) (67) [SCAL] (1) $TEV_0 = time < massFlowRate.startTime ($RES_EVT_160) (68) [SCAL] (1) $TEV_1 = time < (massFlowRate.startTime + massFlowRate.duration) ($RES_EVT_161) (69) [SCAL] (1) $SEV_3 = hex.w > (-hex.wnom * hex.wnm) ($RES_EVT_165) (70) [SCAL] (1) hex.M = hex.A * $FUN_7 * hex.l ($RES_SIM_9) (71) [SCAL] (1) $SEV_4 = hex.Kf >= 0.0 ($RES_EVT_166) (72) [SCAL] (1) hex.Mtot = hex.M * hex.Nt ($RES_SIM_8) (73) [SCAL] (1) $SEV_5 = hex.heatTransfer.w_wnom < (hex.heatTransfer.beta + 0.5 * hex.heatTransfer.beta) ($RES_EVT_167) (74) [SCAL] (1) hex.Tr = noEvent(hex.M / max(hex.w, 1e-15)) ($RES_SIM_7) (75) [SCAL] (1) $SEV_6 = hex.heatTransfer.w_wnom > (1e9 - 0.5 * hex.heatTransfer.beta) ($RES_EVT_168) (76) [SCAL] (1) $SEV_7 = valve.w > 0.0 ($RES_EVT_169) (77) [SCAL] (1) massFlowRate.y = massFlowRate.offset + (if $TEV_0 then 0.0 else if $TEV_1 then (massFlowRate.height * (time - massFlowRate.startTime)) / massFlowRate.duration else massFlowRate.height) ($RES_SIM_5) (78) [ARRY] (3) hex.h[2:4] = hex.htilde ($RES_SIM_11) (79) [SCAL] (1) hex.h[1] = fluidSource.h ($RES_SIM_12) (80) [SCAL] (1) T_out.outlet.h_outflow = hex.htilde[3] ($RES_SIM_13) (81) [SCAL] (1) T_in.inlet.h_outflow = hex.h[1] ($RES_SIM_14)