List of tutorials

commentnote:Before you proceed

All tutorials are written assuming that you are reasonably familiar with MOOSE. If you find most of the tutorials difficult to follow, please refer to the official MOOSE website for learning resources.

Tutorial 15: Mosaic field generation (patches)

In this tutorial, we present a simpler approach to generating spatially varied perturbation fields compared to Tutorial 14.

The subapp patches.i first assigns random initial values to the Auxvariable scale (raw)

[ICs]
  [raw]
    type = RandomIC
    variable = scale
    max = 1
    min = -2
    seed = ${seed}
  []
[]

From this raw field, a material field is constructed using selected statistics (e.g., maximum, mean, minimum) within a selected range (e.g., normalized range of [0, 1] )

[Materials]
  [sigma_ts]
    type = ADParsedMaterial
    property_name = 'sigma_ts'
    constant_names = 'sigma_ts_raw'
    constant_expressions = '${sigma_ts}'
    coupled_variables = 'scale'
    expression = 'sigma_ts_raw*(10+ceil(scale))/10'
    output_properties = 'sigma_ts'
    outputs = exodus
  []
[]

This coarse field, downsampled by patchref steps

[Mesh]
  [ori]
    type = GeneratedMeshGenerator
    dim = 2
    xmin = 0
    xmax = 100
    ymin = 0
    ymax = 100
    nx = '${fparse floor(100/max(1,pow(2,patchref)))}'
    ny = '${fparse floor(100/max(1,pow(2,patchref)))}'
  []
[]

is then transferred to the fine mesh of the mainapp main.i

[Transfers]
  [from_patches]
    type = MultiAppGeneralFieldShapeEvaluationTransfer
    from_multi_app = patches
    variable = 'sigma_ts_var'
    source_variable = 'sigma_ts'
    displaced_source_mesh = false
    displaced_target_mesh = false
    execute_on = 'INITIAL'
  []
[]

The resulting fields are illustrated in the figure below.

main_sigma_ts

Fig. 1: Mainapp mosaic field .

sub_sigma_ts

Fig. 2: Subapp field .

sub_scale

Fig. 3: Subapp scale variable.

The complete input files