Skip to content

Commit

Permalink
Add JunctionN to realize inner loops between array elements in diagra…
Browse files Browse the repository at this point in the history
…m layer
  • Loading branch information
tobolar committed Jan 17, 2024
1 parent c2bb062 commit f758136
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions ThermofluidStream/HeatExchangers/DiscretizedCrossFlowHEX.mo
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ model DiscretizedCrossFlowHEX "Discretized heat exchanger for single- or two-pha
rotation=180,
origin={50,-80})));

Topology.JunctionN loopThermalElementB[nCells - 1](
redeclare package Medium = MediumB, each N=1) annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=180,
origin={20,60})));
initial equation

if initializeMassFlow then
Expand All @@ -39,9 +44,12 @@ equation
//Connecting equations (to interconnect pipes)
//Fluid Side B
connect(inletB, thermalElementB[1].inlet) annotation (Line(points={{-100,80},{-10,80}}, color={28,108,200}));
for i in 1:nCells - 1 loop
connect(thermalElementB[i].outlet, thermalElementB[i + 1].inlet);
end for;
connect(thermalElementB[1:nCells-1].outlet, loopThermalElementB[1:nCells-1].inlets[1]) annotation (Line(
points={{10,80},{10,78},{40,78},{40,60},{30,60}},
color={28,108,200}));
connect(thermalElementB[2:nCells].inlet, loopThermalElementB[1:nCells-1].outlet) annotation (Line(
points={{-10,80},{-10,78},{-20,78},{-20,60},{10,60}},
color={28,108,200}));
connect(thermalElementB[nCells].outlet, outletB) annotation (Line(points={{10,80},{100,80}}, color={28,108,200}));
connect(thermalElementB.heatPort, thermalConductor.port_b) annotation (Line(points={{0,70.2},{0,14},{-1.77636e-15,14},{-1.77636e-15,10},{0,10}}, color={191,0,0}));
connect(thermalElementA.heatPort, thermalConductor.port_a) annotation (Line(points={{0,-70.2},{0,-42},{0,-42},{0,-10},{0,-10}}, color={191,0,0}));
Expand Down

0 comments on commit f758136

Please sign in to comment.