Skip to content

Introduction

refine is a structured curvilinear overset mesh refinement utility. The algorithm is OpenMP parallel and enables the following key features:

  • Non-integer refinement factors
  • Global refinement
  • Direction-specific refinement
  • Zone-specific refinement
  • Smoothing
  • Refined surface extraction by boundary condition (BC) names

Input Options

refine uses the YAML file format for specifying the information required to run the solver. The documentation below lists the name and type of each option. If an option is flagged as required then it must be included when the parent block is present. The default values and lower/upper bounds are also included for variables that have them. If an option is flagged as mutable then it can be modified on a solver restart. Each tab level in the YAML file should be 2 spaces. Blocks which can take multiple sub-blocks of an entry argument are prefaced by a -. Keywords in the YAML input file are case-insensitive.

refine

Grid refinement options


refine:
  factor:
  coarseGridFile: <required>
  coarseGridFiletype:
  tileSize:
  refineGridFile:
  bcFile:
  writerecordmarkersingrids:
  refinedirection:
  smoothdirection:
  nsmooth:
  zoneSpecific:
    -
      zones:
      refinedirection:
      smoothdirection:
      nsmooth:
  • factor (float, lower bound=1.000, default=2.000)

    • Grid refinement factor to be applied to all blocks. A refinement factor cannot mathematically be guaranteed, however, non-integer factors are supported.
  • coarseGridFile (string(fileName), required)

    • The coarse grid file name.
  • coarseGridFiletype (string, default="plot3d")

    • Accepted Values: ["plot3d"]
    • Coarse grid file type. Only plot3d is currently supported.
  • tileSize ([integer , integer , integer], lower bound=4, default=18)

    • The size of the tiles, including one level of halos. The optimum tilesize is a primarily a function of the computer architecture, not the grid. The default size should give near optimum performance on modern computers.
  • refineGridFile (string, default="refine.x")

    • The refined grid output file name.
  • bcFile (string(fileName), default="")

    • Coarse grid BC file. This is used for extracting surfaces.
  • writerecordmarkersingrids (boolean, default=True)

    • Write Fortran record markers in the refined Plot3D grid file.
  • refinedirection (string, default="all")

    • Accepted Values: ["j", "k", "l", "jk", "jl", "kl", "all"]
    • Block index directions to refine, applied to all zones not listed in zoneSpecific. Two-direction values refine both directions. A direction with 3 nodes is treated as a finite span and is never refined.
  • smoothdirection (string, default="all")

    • Accepted Values: ["j", "k", "l", "all"]
    • Block index directions in which nsmooth smoothing iterations are applied, for all zones not listed in zoneSpecific.
  • nsmooth (integer, lower bound=0, default=5)

    • Number of smoothing iterations for each zone. Smoothing is only applied for each block direction that has a non-unity stretching ratio. If refinement introduces a non-unity stretching ratio (mesh is uniform) in a given direction, then smoothing will be applied.
  • zoneSpecific

    • Entries override refinedirection, smoothdirection and nsmooth for the listed zones. Options not given in an entry use the global value.
    • zones ([string, ...], default=["default"])

      • The zones to apply the zone-specific options to.
    • refinedirection (string, default="all")

      • Accepted Values: ["j", "k", "l", "jk", "jl", "kl", "all"]
      • Block index directions to refine for the specified zones.
    • smoothdirection (string, default="all")

      • Accepted Values: ["j", "k", "l", "all"]
      • Block index directions to smooth for the specified zones.
    • nsmooth (integer, lower bound=0, default=5)

      • Number of smoothing iterations for specified zones.

surface

Refined surface extraction options:


surface:
  extract:
  surfaceGridFile:
  bcFile:
  surfaceBCNames:
  zoneSpecific:
    -
      zones:
      faces:
  • extract (boolean, default=False)

    • Flag specifying whether to output the refine surfaces.
  • surfaceGridFile (string, default="surface.x")

    • Name of the output refined surface file.
  • bcFile (string(fileName), default="")

    • The boundary condition file used for surface extraction.
  • surfaceBCNames ([string, ...], default=[""])

    • The name of the boundary conditions to extract to the surface file.
  • zoneSpecific

    • Entries extract the listed block faces of the listed zones, in addition to the faces selected by surfaceBCNames.
    • zones ([string, ...], default=["default"])

      • The zones containing non-physical BCs to extract.
    • faces ([string, ...], default=["lLow"])

      • The faces to extract for each specified zone. Options are: 'jLow', 'jHigh', 'kLow', 'kHigh', 'lLow', 'lHigh'

Example YAML Input Files

Uniformly refine grid.in with a global factor of 2.0:

refine:
  factor : 2.0  
  coarseGridFile : grid.in
  refineGridFile : refine.x
  refineDirection : all

Refine all zones in every direction with a factor of 2.0, except zones 1-3 and 10, which are refined only in j and l:

refine:
  factor : 2.0
  coarseGridFile : grid.in
  refineGridFile : refine.x
  refineDirection : all
  zoneSpecific:
    -
      zones: [1-3, 10]
      refinedirection : jl

Comprehensive configuration with zone-specific smoothing and surface extraction:

refine:
  factor : 1.4
  tileSize : [18,10,10]
  coarseGridFile : grid.in
  refineGridFile : refine.x
  refinedirection : all
  smoothdirection : all
  nsmooth : 10
  writerecordmarkersingrids : false
  zonespecific :
    -
      zones: [1-10]
      nsmooth : 10
      refinedirection : j
      smoothdirection : j  
surface:
  extract: True
  surfaceGridFile: surface.x
  bcFile: grid.bc.in
  surfaceBCNames: [wing,fuse,tail,fin]

Execution

Run the utility with an input configuration file (input.yaml):

refine.GNU input.yaml |tee refine.out

With thread binding utilities (e.g., mbind.x):

mbind.x -t <number_of_threads> refine.GNU | tee refine.out