abl_mesh – Block HEX Mesh Generation

The abl_mesh executable can be used to generate structured mesh with HEX-8 elements in Exodus-II format. It can generate meshes from scratch or convert from other formats to Exodus-II format.

Command line invocation

bash$ abl_mesh -i abl_mesh.yaml

Nalu ABL Mesh Generation Utility
Input file: abl_mesh.yaml
HexBlockMesh: Registering parts to meta data
     Mesh block: fluid_part
Num. nodes = 1331; Num elements = 1000
     Generating node IDs...
     Creating nodes... 10% 20% 30% 40% 50% 60% 70% 80% 90%
     Generating element IDs...
     Creating elements... 10% 20% 30% 40% 50% 60% 70% 80% 90%
     Finalizing bulk modifications...
     Generating X Sideset: west
     Generating X Sideset: east
     Generating Y Sideset: south
     Generating Y Sideset: north
     Generating Z Sideset: terrain
     Generating Z Sideset: top
     Generating coordinates...
Writing mesh to file: ablmesh.exo
-i, --input-file

YAML input file to be processed for mesh generation details. Default: nalu_abl_mesh.yaml.

Common Input File Parameters

The input file must contain a nalu_abl_mesh section that contains the input parameters.

mesh_type

This variable can take the following options:

  • generate_ablmesh - Will generate a structured HEX mesh, and is the default for mesh_type if not present in the input file. See Structured Mesh Generation for more details.

  • convert_plot3d - Converts a Plot3D binary file to Exodus-II format for use with Nalu. See Converting Plot3D to Exodus-II for more details.

output_db [nalu_abl_mesh]

The Exodus-II filename where the mesh is output. No default, must be provided by the user.

fluid_part_name

Name of the element block created with HEX-8 elements. Default value: fluid_part.

ioss_8bit_ints

Boolean flag that enables output of 8-bit ints when writing Exodus mesh. Default value: false.

Boundary names

The user has the option to provide custom boundary names through the input file. Use the boundary name input parameters to change the default parameters. If these are not provided the default boundary names are described below:

Boundary

Default sideset name

xmin_boundary_name

west

xmax_boundary_name

east

ymin_boundary_name

south

ymax_boundary_name

north

zmin_boundary_name

terrain

zmax_boundary_name

top

Structured Mesh Generation

The interface is similar to OpenFOAM’s blockMesh utility and can be used to generate simple meshes for ABL simulations on flat terrain without resorting to commercial mesh generation software, e.g., Pointwise.

A sample input file is shown below

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
nalu_abl_mesh:
  mesh_type: generate_ablmesh
  output_db: ablmesh.exo

  spec_type: bounding_box

  vertices:
    - [0.0, 0.0, 0.0]
    - [10.0, 10.0, 10.0]

  mesh_dimensions: [10, 10, 10]
spec_type

Specification type used to define the extents of the structured HEX mesh. This option is used to interpret the vertices read from the input file. Currently, two options are supported:

Type

Description

bounding_box

Use axis aligned bounding box as domain boundaries

vertices

Use user provided vertices to define extents

vertices

The coordinates specifying the extents of the computational domain. This entry is interpreted differently depending on the spec_type. If type is set to bounding_box then the code expects a list of two 3-D coordinate points describing bounding box to generate an axis aligned mesh. Otherwise, the code expects a list of 8 points describing the vertices of the trapezoidal prism.

mesh_dimensions

Mesh resolution for the resulting structured HEX mesh along each direction. For a trapezoidal prism, the code will interpret the major axis along 1-2, 1-4, and 1-5 edges respectively.

Mesh spacing

Users can specify the mesh spacing to be applied in each direction by adding additional sections (x_spacing, y_spacing, and z_spacing respectively) to the input file. If no option is specified then a constant mesh spacing is used in that direction.

Available options

Implementation

constant_spacing

ConstantSpacing

geometric_stretching

GeometricStretching

Example input file

# Specifiy constant spacing in x direction (this is the default)
x_spacing:
  spacing_type: constant_spacing

# y direction has a mesh stretching factor
y_spacing:
  spacing_type: geometric_stretching
  stretching_factor: 1.1

# z direction has a mesh stretching factor in both directions
z_spacing:
  spacing_type: geometric_stretching
  stretching_factor: 1.1
  bidirectional: true

Limitations

  1. Does not support the ability to generate multiple blocks

  2. Must be run on a single processor, running with multiple MPI ranks is currently unsupported.

Converting Plot3D to Exodus-II

An example input block is shown below:

nalu_abl_mesh:
  mesh_type: convert_plot3d
  plot3d_file: grid.p3d
  output_db: p3d_grid.exo
plot3d_file

Path to the Plot3D grid file in binary format.