Step 3: Upper Loop

Complete input file for this step: 03_upper_loop.i

Figure 1: Model diagram

In this step, we will add the flow channels corresponding to the upper part of the loop and the primary side of the heat exchanger. We will explain how to connect flow channels together using junction components and how to specify a convective heat transfer using a specified wall temperature.

Junctions

Junctions are 0-D components that can connect 2 or more flow channels.

In this tutorial we will use so-called volume junctions to connect flow channels to build up the primary loop.

Let's look at an example of a volume junction:

[Components]
  [jct1]
    type = JunctionParallelChannels1Phase
    position = '0 0 0.5'
    connections = 'up_pipe_1:out core_chan:in'
    volume = 1e-5
    use_scalar_variables = false
  []
[]

In a volume junction component, users have to specify its location (via the position parameter), its volume via the volume parameter, and list the connected flow channels via the connections parameter.

If the channels are parallel and the cross-sectional area is changing, the type of the junction should be JunctionParallelChannels1Phase.

If the cross-sectional area is the same or the channels are not parallel, the type should be VolumeJunction1Phase.

We also need to specify the initial conditions. Besides the pressure p and temperature T, we need specify velocity initial condition, which has 3 components corresponding to x-, y- and z-dimension.

initial_vel_x = 0
initial_vel_y = 0
initial_vel_z = 0

Since all the junctions will start from the same initial conditions, we can specify those in the [GlobalParams] block, like we did earlier for the flow channels.

Top Part of the Loop

To build the upper part of the loop, we define a global parameter for the pipe diameter.

# pipe parameters
pipe_dia = ${units 10. cm -> m}
A_pipe = '${fparse 0.25 * pi * pipe_dia^2}'

This dimension is shared by all the pipes. If we needed to change it later, we can do so just in one place.

The following part of the input file defines all the flow channels and junctions that build up the upper part of the loop

[jct1]
  type = JunctionParallelChannels1Phase
  position = '0 0 0.5'
  connections = 'up_pipe_1:out core_chan:in'
  volume = 1e-5
  use_scalar_variables = false
[]
[core_chan]
  type = FlowChannel1Phase
  position = '0 0 0.5'
  orientation = '0 0 1'
  length = ${core_length}
  n_elems = ${core_n_elems}
  roughness = .0001
  A = '${A_core}'
  D_h = ${Dh_core}
[]

[core_hs]
  type = HeatStructureCylindrical
  position = '0 0 0.5'
  orientation = '0 0 1'
  length = ${core_length}
  n_elems = ${core_n_elems}
  names = 'block'
  widths = '${fparse core_dia / 2.}'
  solid_properties = 'steel'
  solid_properties_T_ref = '300'
  n_part_elems = 3
[]

[core_heating]
  type = HeatSourceFromTotalPower
  hs = core_hs
  regions = block
  power = total_power
[]

[core_ht]
  type = HeatTransferFromHeatStructure1Phase
  flow_channel = core_chan
  hs = core_hs
  hs_side = outer
  P_hf = '${fparse pi * core_dia}'
[]

[jct2]
  type = JunctionParallelChannels1Phase
  position = '0 0 1.5'
  connections = 'core_chan:out up_pipe_2:in'
  volume = 1e-5
  use_scalar_variables = false
[]

[up_pipe_2]
  type = FlowChannel1Phase
  position = '0 0 1.5'
  orientation = '0 0 1'
  length = 0.5
  n_elems = 10
  A = ${A_pipe}
  D_h = ${pipe_dia}
[]

[jct3]
  type = JunctionOneToOne1Phase
  connections = 'up_pipe_2:out top_pipe:in'
[]

[top_pipe]
  type = FlowChannel1Phase
  position = '0 0 2'
  orientation = '1 0 0'
  length = 1
  n_elems = 10
  A = ${A_pipe}
  D_h = ${pipe_dia}
[]

In the heat exchanger section, we only build the primary side and connect it to HeatTransferFromSpecifiedTemperature1Phase. This component requires the T_wall parameter. The heat transfer coefficient will be calculated by the closure set using the correlation provided in the wall_htc_closure in the closure set object. Using a simplified secondary side is a good first step when building a heat exchanger model.

Notes

THM also provides components like pumps and valves, which behave like junctions. However, they may have some limitations on the number of connected channels. For example, a pump component might have only a single inlet and a single outlet.

The single-phase flow model does not support mixing of fluids. This means you cannot bring 2 different fluids into a junction and have their mixture produced at the junction outlet. The code will detect this problem and report an error, if you do so.