CFD General Notation System

http://www.cgns.org

Bruce Wedan
ANSYS/ICEM CFD

Presentation Overview

What is CGNS?

History of CGNS

CGNS Steering Committee

ISO-STEP Standard

HDF5 Interface

User Base

CGNS Main Features

Current Release (Version 2.3)

Extensions (Version 2.4 beta)

CGNS Tools

ADF Core

ADF file nodes with links

ADF Node Content

Top Level Structure

Top level nodes in CGNS file

DataArray_t Node

DataArray_t node structure

Family_t Node

Family_t node structure

FlowEquationSet_t Node

FlowEquationSet_t node structure

ReferenceState_t Node

ReferenceState_t node structure

UserDefinedData_t Node

UserDefinedData_t node structure

Zone_t Node

Zone_t node structure

Elements_t Node

Elements_t node structure

FlowSolution_t Node

FlowSolution_t node structure

GridCoordinates_t Node

GridCoordinates_t node structure

ZoneBC_t Node

ZoneBC_t node structure

BCDataSet_t Node

BCDataSet_t node structure

ZoneGridConnectivity_t Node

ZoneGridConnectivity_t node structure

GridConnectivity_t Node

GridConnectivity_t node structure

GridConnectivity1to1_t Node

GridConnectivity1to1_t node structure

OversetHoles_t Node

OversetHoles_t node structure

Example

Figure showing a structured cylindrical grid attached to an unstructured cubical grid

Example - Code

   unlink("example.cgns");
   cg_open("example.cgns", MODE_WRITE, &cgfile);
   cg_base_write(cgfile, "Mismatched", CellDim, PhyDim, &cgbase);
   cg_goto(cgfile, cgbase, "end");
   cg_descriptor_write("Descriptor", "Mismatched Grid");
   cg_dataclass_write(Dimensional);
   cg_units_write(Kilogram, Meter, Second, Kelvin, Radian);
   /*----- zone 1 is unstructured cube -----*/
   cg_zone_write(cgfile, cgbase, "UnstructuredZone", size, Unstructured, &cgzone);
   /* write coordinates */
   cg_coord_write(cgfile, cgbase, cgzone, RealSingle, "CoordinateX", xcoord, &cgcoord);
   cg_coord_write(cgfile, cgbase, cgzone, RealSingle, "CoordinateY", ycoord, &cgcoord);
   cg_coord_write(cgfile, cgbase, cgzone, RealSingle, "CoordinateZ", zcoord, &cgcoord);
   /* write elements and faces */
   cg_section_write(cgfile, cgbase, cgzone, "Elements", HEXA_8, 1, num_element, 0,
      elements, &cgsect);
   cg_section_write(cgfile, cgbase, cgzone, "Faces", QUAD_4, num_element+1,
      num_element+num_face, 0, faces, &cgsect);
   cg_parent_data_write(cgfile, cgbase, cgzone, cgsect, parent);
   /* write inflow and wall BCs */
   cg_boco_write(cgfile, cgbase, cgzone, "Inlet", BCInflow, ElementRange, 2, range, &cgbc);
   cg_boco_write(cgfile, cgbase, cgzone, "Walls", BCWall, PointList, n, pts, &cgbc);
   /*----- zone 2 is structured cylinder -----*/
   cg_zone_write(cgfile, cgbase, "StructuredZone", size, Structured, &cgzone);
   /* write coordinates */
   cg_coord_write(cgfile, cgbase, cgzone, RealSingle, "CoordinateR", xcoord, &cgcoord);
   cg_coord_write(cgfile, cgbase, cgzone, RealSingle, "CoordinateTheta", ycoord, &cgcoord);
   cg_coord_write(cgfile, cgbase, cgzone, RealSingle, "CoordinateZ", zcoord, &cgcoord);
   /* write outlet and wall BCs */
   cg_boco_write(cgfile, cgbase, cgzone, "Outlet", BCOutflow, PointRange, 2, range, &cgbc);
   cg_boco_write(cgfile, cgbase, cgzone, "Walls", BCWall, PointList, n/3, pts, &cgbc);
   /* periodic 1to1 connectivity */
   cg_1to1_write(cgfile, cgbase, 2, "Periodic", "StructuredZone", range, d_range, transform,
      &cgconn);
   /*----- zone 1 > zone 2 connectivity -----*/
   cg_conn_write(cgfile, cgbase, 1, "Unstructured > Structured", Vertex, Abutting,
      PointRange, 2, pts, "StructuredZone", Structured, CellListDonor, Integer, n/3, d_pts,
      &cgconn);
   cg_goto(cgfile, cgbase, "Zone_t", 1, "ZoneGridConnectivity_t", 1, "GridConnectivity_t",
      cgconn, "end");
   cg_array_write("InterpolantsDonor", RealSingle, 2, dims, interp);
   /*----- zone 2 > zone 1 connectivity similar -----*/
   /* close file */
   cg_close(cgfile);

Example - Node Tree

ADF MotherNode
  +-CGNSLibraryVersion
  +-Mismatched
    +-Descriptor
    +-DataClass
    +-DimensionalUnits
    +-UnstructuredZone
    | +-ZoneType
    | +-GridCoordinates
    | | +-CoordinateX
    | | +-CoordinateY
    | | +-CoordinateZ
    | +-Elements
    | | +-ElementRange
    | | +-ElementConnectivity
    | +-Faces
    | | +-ElementRange
    | | +-ElementConnectivity
    | | +-ParentData
    | +-ZoneBC
    | | +-Inlet
    | | | +-ElementRange
    | | +-Walls
    | |   +-PointList
    | +-ZoneGridConnectivity
    |   +-Unstructured -> Structured
    |     +-GridConnectivityType
    |     +-PointRange
    |     +-CellListDonor
    |     +-InterpolantsDonor
    +-StructuredZone
      +-ZoneType
      +-GridCoordinates
      | +-CoordinateR
      | +-CoordinateTheta
      | +-CoordinateZ
      +-ZoneGridConnectivity
      | +-Periodic
      | | +-Transform
      | | +-PointRange
      | | +-PointRangeDonor
      | +-Structured -> Unstructured
      |   +-GridConnectivityType
      |   +-PointList
      |   +-CellListDonor
      |   +-InterpolantsDonor
      +-ZoneBC
        +-Outlet
        | +-PointRange
        +-Walls
          +-PointList

Conclusions