CFD General Notation System (CGNS)
Tutorial Session

Agenda

7:00-7:30    Introduction, overview, and basic usage
C. Rumsey (NASA Langley)
7:30-7:50    Usage for structured grids
B. Wedan (ANSYS - ICEM)
7:50-8:10    Usage for unstructured grids
E. van der Weide (Stanford University)
8:20-8:40    HDF5 usage and parallel implementation
T. Hauser (Utah State University)
8:40-9:00    Python and in-memory CGNS trees
M. Poinot (ONERA)
9:00-9:30    Discussion and question/answer period

CFD General Notation System (CGNS)
Introduction, overview, and basic usage

Christopher L. Rumsey
NASA Langley Research Center
Chair, CGNS Steering Committee

Outline

Introduction

What is CGNS?

History

Steering committee

CGNS main features

CGNS File Layout

CGNS file layout

Makeup of CGNS

How CGNS works

Typical view of CGNS file using ADFviewer

ADFviewer window

Typical CGNS file

Layout of typical CGNS file

Cons and Pros

How CGNS can help you

Status/where CGNS is headed

Getting CGNS

Basics of using CGNS

Opening/closing file & writing Base

What the file looks like ...

CGNS file with root, CGNSLibraryVersion_t, and CGNSBase_t nodes

Notes: icelldim = dimensionality of cell (2 for face, 3 for volume), iphysdim = no. of coordinates required to define a node position (1 for 1-D, 2 for 2-D, 3 for 3-D)

What the file looks like in adfviewer ...

ADFviewer window with root, CGNSLibraryVersion_t, and CGNSBase_t nodes

Reading the Base

Aspects for data longevity

boundary conditions

ADFviewer window with boundary condition node

convergence history

ADFviewer window with convergence history node

descriptor nodes

ADFviewer window with descriptor node for flow solution

ADFviewer window with descriptor node containing input file

data & equation descriptions

ADFviewer window with DataClass node

ADFviewer window with Reynolds number node

ADFviewer window with governing equations node

flowfield variables

Some final comments

Conclusions

Picture of sliced bread

Auxiliary slides

Writing structured grids

   double x[kdim][kdim][idim], y[kdim][jdim][idim], z[kdim][jdim][idim];
   int isize[3][3];
   strcpy(zonename,"Zone 1");
   /* vertex size (structured grid example) */
   isize[0][0]=idim;
   isize[0][1]=jdim;
   isize[0][2]=kdim;
   /* cell size (structured grid example) */
   isize[1][0]=isize[0][0]-1;
   isize[1][1]=isize[0][1]-1;
   isize[1][2]=isize[0][2]-1;
   /* boundary vertex size (always zero for structured) */
   isize[2][0]=0;
   isize[2][1]=0;
   isize[2][2]=0;
   /* create zone */
   cg_zone_write(indexf, indexb, zonename, isize[0], Structured, &indexz);
   /* write grid coordinates */
   cg_coord_write(indexf, indexb, indexz, RealDouble, "CoordinateX", x, &indexcx);
   cg_coord_write(indexf, indexb, indexz, RealDouble, "CoordinateY", y, &indexcy);
   cg_coord_write(indexf, indexb, indexz, RealDouble, "CoordinateZ", z, &indexcz);

What the file looks like ...

CGNS file with zone and grid coordinates nodes

What the file looks like in adfviewer ...

ADFviewer window with zone and grid coordinates nodes

Writing unstructured grids

   /* this is an example for HEXA_8 (cube-like) elements
   double x[maxnodes], y[maxnodes], z[maxnodes];
   int isize[3], ielem[maxelem][8];
   strcpy(zonename,"Zone 1");
   /* vertex size (unstructured grid example) */
   isize[0]=inodedim;
   /* cell size (unstructured grid example) */
   isize[1]=icelldim;
   /* boundary vertex size (zero if elements not sorted) */
   isize[2]=ivbdy;
   /* create zone */
   cg_zone_write(indexf, indexb, zonename, isize, Unstructured, &indexz);
   /* write grid coordinates */
   cg_coord_write(indexf, indexb, indexz, RealDouble, "CoordinateX", x, &indexcx);
   cg_coord_write(indexf, indexb, indexz, RealDouble, "CoordinateY", y, &indexcy);
   cg_coord_write(indexf, indexb, indexz, RealDouble, "CoordinateZ", z, &indexcz);
   /* write element connectivity */
   cg_section_write(indexf, indexb, indexz, "Elem", HEXA_8, nelem_start, nelem_end,
      nbdyelem, ielem[0], &indexe);

Element connectivity for HEXA_8

Figure showing node numbers for HEXA_8 element

What the file looks like ... (below Base)

CGNS file with zone, grid coordinates, and element nodes

What the file looks like in adfviewer ...

ADFviewer window with zone, grid coordinates, and element nodes