Step 6: Custom Closures

Complete input file for this step: 06_custom_closures.i

Closure System

The closure system is another powerful system provided by THM. It allows users to either use pre-defined closure sets or entirely define their own ones.

Flow channels have the closures parameter, which corresponds to the name of a Closures object. This parameter can be specified globally in [GlobalParams] block or on per-component basis. Note that not all components require the closure parameter (for example heat structures have no concept of closure correlations).

Custom closure correlations are provided via MOOSE material system. Users can use any pre-built material objects that come with MOOSE and provide the required value. The most notable and useful material is ADParsedMaterial which allows users to provide the closure formula on the input file level.

commentnote

Tip: THM provides convenient materials for computing Reynolds and Prandtl number, named ADReynoldsNumberMaterial and ADPrandtlNumberMaterial, respectively.

In single-phase flow, the Darcy wall friction factor f_D and the convective wall heat transfer coefficient Hw need to be supplied.

Add Custom Closure Correlations

commentnote

Note: Heat transfer is optional, so defining a wall heat transfer coefficient on blocks that do not have wall heat transfer linked to them makes no sense.

In our tutorial we will define the custom closures on the primary side of the heat exchanger.

To use the custom closure set, we create a closures object of the class Closures1PhaseNone, which does not create any of its own Materials:

[Closures]
  [thm_closures]
    type = Closures1PhaseTHM
  []
  [none_closures]
    type = Closures1PhaseNone
  []
[]

Then the name we gave this closures object (none_closures) is passed to the closures parameter in the hx/pri component. This will overwrite the closures parameter set in the GlobalParams block.

[Components]
  [hx]
    [pri]
      type = FlowChannel1Phase
      position = '1 0 1.75'
      orientation = '0 0 -1'
      length = ${hx_length}
      n_elems = ${hx_n_elems}
      roughness = 1e-5
      A = '${fparse pi * hx_dia_inner * hx_dia_inner / 4.}'
      D_h = ${hx_dia_inner}
      closures = none_closures
    []
  []
[]

Materials

For our custom closure set, we choose the following expression for the friction factor:

fD=a+bRecf_D = a + b Re^c

where fDf_D is the Darcy friction factor, ReRe is the Reynolds number, and aa, bb, and cc are constant coefficients with a=1a = 1, b=0.1b = 0.1, and c=0.5c = -0.5.

The first step is to define the Reynolds number using an ADReynoldsNumberMaterial, and then the expression for the friction factor is implemented using an ADParsedMaterial. Note that these materials are defined only on the block where the custom closures are used. They are defined by the other closure set on the other components.

[Re_mat]
  type = ADReynoldsNumberMaterial
  Re = Re
  rho = rho
  vel = vel
  D_h = D_h
  mu = mu
  block = hx/pri
[]
[f_mat]
  type = ADParsedMaterial
  property_name = f_D
  constant_names = 'a b c'
  constant_expressions = '1 0.1 -0.5'
  material_property_names = 'Re'
  expression = 'a + b * Re^c'
  block = hx/pri
[]

For the heat transfer, the following expression for Nusselt number is used:

Nu=0.03Re0.9Pr0.5.Nu = 0.03 Re^{0.9} Pr^{0.5}.

To accomplish this, we define the Prandtl number using an ADPrandtlNumberMaterial block. The Nusselt number is defined using an ADParsedMaterial, and the heat transfer coefficient is set using an ADConvectiveHeatTransferCoefficientMaterial block. Again, the block is restricted to the hx/pri block to avoid conflicting with the other closure set.

[Pr_mat]
    type = ADPrandtlNumberMaterial
    Pr = Pr
    cp = cp
    mu = mu
    k = k
    block = hx/pri
  []
  [Nu_mat]
    type = ADParsedMaterial
    property_name = 'Nu'
    constant_names = 'a b c'
    constant_expressions = '0.03 0.9 0.5'
    material_property_names = 'Re Pr'
    expression = 'a * Re ^b * Pr^c'
    block = hx/pri
  []
  [Hw_mat]
    type = ADConvectiveHeatTransferCoefficientMaterial
    D_h = D_h
    k = k
    Nu = Nu
    Hw = Hw
    block = hx/pri
  []
[]