MOOSE Newsletter (July 2022)

MOOSE Improvements

Coordinate transformation system

Different applications may use different setups. For example a neutronics simulation may be performed in Cartesian 3D space whereas a fuel performance calculation may be performed using a 2D axisymmetric coordinate system. Communicating information between these different configurations can be difficult. One mechanism MOOSE provides for making this communication simpler is the MooseAppCoordTransform class. Each MooseApp instance holds a coordinate transformation object in its MooseMesh object. Users may specify transformation information about their simulation setup on a per-application basis in the input file Mesh block.

Let's consider an example. The below listing shows coordinate transformation given in the Mesh block of a sub-application:

[Mesh<<<{"href": "../../syntax/Mesh/index.html"}>>>]
  type = GeneratedMesh
  dim = 2
  xmin = -5
  xmax = 0
  ymin = 0
  ymax = 10
  nx = 10
  ny = 20
  alpha_rotation = -90
  length_unit = '20*cm'
[]
(test/tests/transfers/coord_transform/sub-app.i)

Here, the user is stating that a -90 degree alpha rotation (e.g. a point on the y-axis becomes a point on the x-axis) should be applied to the sub-application's domain in order to map to the reference domain (which the user has chosen to correspond to the main application domain). Additionally, the user wishes for the coordinate transformation object to know that one unit of mesh length corresponds to 20 centimeters. This information from the sub-application's Mesh block combined with the translation vector described by the positions parameter in the main application MultiApp block

[MultiApps<<<{"href": "../../syntax/MultiApps/index.html"}>>>]
  [sub]
    type = FullSolveMultiApp<<<{"description": "Performs a complete simulation during each execution.", "href": "../../source/multiapps/FullSolveMultiApp.html"}>>>
    app_type<<<{"description": "The type of application to build (applications not registered can be loaded with dynamic libraries. Parent application type will be used if not provided."}>>> = MooseTestApp
    positions<<<{"description": "The positions of the App locations.  Each set of 3 values will represent a Point.  This and 'positions_file' cannot be both supplied. If this and 'positions_file'/'_objects' are not supplied, a single position (0,0,0) will be used"}>>> = '1 0 0'
    input_files<<<{"description": "The input file for each App.  If this parameter only contains one input file it will be used for all of the Apps.  When using 'positions_from_file' it is also admissable to provide one input_file per file."}>>> = 'sub-app.i'
    execute_on<<<{"description": "The list of flag(s) indicating when this object should be executed. For a description of each flag, see https://mooseframework.inl.gov/source/interfaces/SetupInterface.html."}>>> = 'timestep_begin'
  []
[]
(test/tests/transfers/coord_transform/main-app.i)

allows MOOSE to directly map information between the disparate application domains. The figure below shows the variable field v, which is a nonlinear variable in the sub-application and an auxiliary source variable in the main application, in both domains, indicating a successful transfer of data after applying the transformation order outlined above (rotation, scale, translation).

Figure 1: Example of rotation, scaling, and translation transformations between multiapps

Further documentation about the coordinate transformation system may be found at Coordinate transformations.