1. External Meshes without Curved Boundaries

This tutorial shows how to read in externally generated unstructured and structured meshes with straight-edged elements.

The parameter file can be found in

tutorials/2-01-external_mesh_CGNS_sphere/parameter.ini

1.1. External Mesh

The external mesh file that is to be used has to be available in the directory of the executed parameter file as a CGNS format file. This file is read-in by introducing the parameter filename. As one can see from the parameter.ini’s excerpt and Fig. 1.1, the parameters of the parameter file have to be adapted to the definitions in the CGNS mesh file. This means that the parameters Mode, nZones, BoundaryName and BoundaryType cannot be set freely anymore because the structure of the external mesh must be retained. In this case, the external mesh spheremesh02 is available as CGNS file and consists of three zones. Therefore, the settings of the parameters are Mode=3, nZones=3, filename=spheremesh02.cgns.

Another important fact is that for external meshes no BCIndex parameter is needed which normally assigns the boundary conditions to the surfaces of the mesh. The reason for this is that the boundary conditions are assigned to their belonging surfaces by their names. The boundary condition, for example, of Zone_1 of the CGNS file (BC_sphere) has to be defined as BoundaryName=sphere in the parameter file.

!================================================================= !
! MESH
!================================================================= !
Mode    =3                  ! 1 Cartesian 3 CGNS 4 STAR-CD V3
nZones  =3                  ! number of zones
filename=spheremesh02.cgns  ! name of mesh file
...
...

!================================================================= !
! CURVED
!================================================================= !
useCurveds=F                ! T to generate curved boundaries


!================================================================= !
! BOUNDARY CONDITIONS
!================================================================= !
BoundaryName=sphere         ! BC_Name must be defined in mesh file
BoundaryType=(/4,1,0,0/)
BoundaryName=inflow
BoundaryType=(/2,0,0,0/)
BoundaryName=outflow
BoundaryType=(/2,0,0,0/)
BoundaryName=mantel
BoundaryType=(/2,0,0,0/)
../CGNSviewer_spheremesh04.png

Fig. 1.1 Screenshot of the folder structure of a CGNS mesh.

Furthermore, the BoundaryType parameter has to be adapted to the definitions in the CGNS mesh file. If a boundary of the external mesh is curved, the curveIndex component (2nd component) of the BoundaryType parameter has to be a value unequal to zero. Whether curved boundaries are generated or not is controlled by the parameter useCurveds. In this tutorial, useCurveds=F. The case useCurveds=T is the topic of the next tutorial which explains how to use mesh curving techniques to generate curved boundaries.

All new parameters of the parameter file of this tutorial are explained below.

Table 1.7 External Mesh Parameters.

Parameters

Setting

Description

filename

spheremesh.cgns

The name of the external mesh file. The necessary files have to be available in the directory of the executed parameter file as CGNS files.

meshscale

0.001

Scales all input mesh coordinates by a fixed factor

SpaceQuandt

1000

Characteristic length of the mesh

useCurveds

T

T (True): If curved boundaries are defined
F (False): If no curved boundaries are defined .

A description of all parameters of the parameter file can be found in List of Parameters.

1.2. Output Visualization

If there is a need for assistance of visualizing the HOPR output visit Visualization.

The figures below show the visualizations of the SPHERE_Debugmesh.vtu file. In addition, a visualization of the surfaces the first boundary condition sphere was assigned to (the curveIndex of the BoundaryType parameter is set to 1) of the SPHERE_Debugmesh_BC.vtu file is shown for each external mesh (see Fig. 1.4, Fig. 1.7, Fig. 1.10).

spheremesh01

../Exmeshwo_spheremesh01_surfaces.jpg

Fig. 1.2 HOPR output of spheremesh01.cgns

../Exmeshwo_spheremesh01_mesh.jpg

Fig. 1.3 HOPR output of spheremesh01.cgns with extracted edges.

../Exmeshwo_spheremesh01_innerbc.jpg

Fig. 1.4 Element surfaces (6) of spheremesh01.cgns the boundary condition sphere was assigned to.

spheremesh02

../Exmeshwo_spheremesh02_surfaces.jpg

Fig. 1.5 HOPR output of spheremesh02.cgns

../Exmeshwo_spheremesh02_mesh.jpg

Fig. 1.6 HOPR output of spheremesh02.cgns with extracted edges.

../Exmeshwo_spheremesh02_innerbc.jpg

Fig. 1.7 Element surfaces (24) of spheremesh02.cgns the boundary condition sphere was assigned to.

spheremesh04

../Exmeshwo_spheremesh04_surfaces.jpg

Fig. 1.8 HOPR output of spheremesh04.cgns

../Exmeshwo_spheremesh04_mesh.jpg

Fig. 1.9 HOPR output of spheremesh04.cgns with extracted edges.

../Exmeshwo_spheremesh04_innerbc.jpg

Fig. 1.10 Element surfaces (64) of spheremesh04.cgns the boundary condition sphere was assigned to.