CGNS (CFD General Notation System) — CAE Glossary

Category: Glossary | 2026-03-28
CAE visualization for cgns - technical simulation diagram

About CGNS

🙋

What kind of format is CGNS? Is it different from ordinary text files?


🎓

CGNS stands for "CFD General Notation System," a format for standardly storing CFD data. Its content is based on HDF5, a binary format, so it is fundamentally different from text files. Even with large-scale meshes containing millions of cells, data can be handled efficiently, and read/write operations are extremely fast.


🙋

I see, it's binary. So why was CGNS created as a standard in the first place? Couldn't each solver just save in its own format?


🎓

That was exactly the problem. In the 1990s CFD industry, each solver saved in its own format, making the routine workflow—creating a mesh with mesher A, passing it to solver B, and visualizing results in post-processing tool C—extremely tedious. NASA and Boeing led the effort to create a "format independent of any single solver," which is how CGNS began.


HDF5 Backend

🙋

Since HDF5 is the backend, can't you view the contents with a regular text editor? Isn't that a problem for debugging?


🎓

That's correct—you cannot open it with a text editor. However, with specialized GUI tools like cgnsview or HDFView, you can graphically browse the tree structure. With Python, you can read and write using pyCGNS or h5py, making automated processing via scripts easy. For example, you can retrieve a node list like this:

import CGNS.MAP as CGM
(tree, links, paths) = CGM.load("flow.cgns")

🙋

Since HDF5 is the base, can you also do parallel I/O? I've heard that file read/write becomes a bottleneck in large-scale analyses.


🎓

Good question. CGNS can directly utilize HDF5's parallel I/O capabilities (MPI-IO). This means that even when distributed computing uses thousands of processes, each process can simultaneously write to its assigned region of a single CGNS file. Without this, you would have to aggregate all data on rank 0 before writing, causing memory and time to explode exponentially. For billion-cell-scale analyses, parallel CGNS is virtually mandatory.


File Structure and Data Model

🙋

What is the structure inside a CGNS file? Does it have folder-like hierarchies?


🎓

It has a tree structure where each node stores a "name," "label (type)," and "data." Roughly speaking, the hierarchy looks like this:

For example, in an aircraft wing analysis, the Base's PhysicalDimension would be 3, zones would be divided into wing surface and far field, and each zone would contain mesh coordinates and solutions.


🙋

Are structured and unstructured grids handled differently in CGNS?


🎓

Yes, they are. For structured grids, specifying the IJK size in Zone_t (e.g., 129×65×33) implicitly determines element connectivity, so Elements_t is not required. Conversely, for unstructured grids, Elements_t must explicitly store the vertex connectivity list for all elements. In practice, unstructured grids are far more common, so familiarity with handling Elements_t is essential. For mixed elements (tetrahedra + prisms, etc.), connectivity is stored by separating sections by element type.


Solver Interoperability

🙋

I've heard that using CGNS allows you to exchange data between different solvers. Does it really work smoothly?


🎓

That is CGNS's greatest advantage. For example, when creating a mesh with Pointwise or ICEM CFD and passing it to different solvers like ANSYS Fluent, OpenFOAM, FUN3D, or elsA, CGNS minimizes conversion effort. Since you can carry not just the mesh but also boundary conditions and solution data together, smooth handoff to post-processing tools (ParaView, Tecplot) is also achievable.


🙋

But in practice, doesn't solver A's CGNS output sometimes fail to be read by solver B?


🎓

To be honest, it's not entirely seamless. The CGNS specification (SIDS: Standard Interface Data Structures) is quite broad, and the range supported by each solver can differ subtly. For example, one solver might write a special boundary condition type as a custom extension node, which another solver simply ignores. However, mesh coordinates and fundamental flow field data (pressure, velocity, temperature) have very high compatibility, so 80-90% of cases work without issues.


Mesh and Solution Data Storage

🙋

You mentioned storing solution data in FlowSolution_t. Does it support both node-based and cell-center-based data?


🎓

Yes, it does. Within FlowSolution_t, there is a GridLocation_t node that specifies either Vertex (nodes) or CellCenter (cell centers). Finite element-based solvers typically use node values, while finite volume-based solvers like Fluent, OpenFOAM, and FUN3D naturally work with cell-center values. Failing to check which representation is used can cause value shifts in post-processing, so be careful.


🙋

Can you also save time-step results for unsteady analyses? Wouldn't the file become enormous?


🎓

Yes, you can. There are nodes called BaseIterativeData_t and ZoneIterativeData_t that manage pointers to solution data for each time step. You can store all time steps in a single CGNS file or split them into separate files per step. In practice, for thousands of steps in unsteady LES, a single file can reach hundreds of GB, so splitting by step or saving sampled data is more realistic.


CGNS in Practice

🙋

In real-world projects, where is CGNS most commonly used?


🎓

The aerospace industry is the most prolific user. At NASA and AIAA-related workshops, benchmark test cases are routinely distributed in CGNS format as a standard. In turbomachinery, CGNS facilitates data exchange between elsA, TURBO, and CFX. Recently, CGNS adoption has grown in automotive CFD, and many people use the Python meshio library to inter-convert between CGNS, STL, and VTK.


🙋

Can you use CGNS with OpenFOAM? OpenFOAM seems to have its own directory structure.


🎓

OpenFOAM has standard conversion utilities like ccm26ToFoam or cgnsToFoam (availability varies by version). The Foundation version may not have them, but the ESI (OpenCFD) version often includes CGNS support. Even without built-in support, you can write a Python script using pyCGNS to read the mesh and convert it to OpenFOAM's polyMesh format. Conversely, exporting OpenFOAM results to CGNS and visualizing with Tecplot is also a common workflow.


🙋

Is there anything I should do first when starting to use CGNS?


🎓

First, install cgnsview and browse a sample CGNS file. The tree structure becomes visually intuitive. Next, read the official CGNS documentation (SIDS), focusing on just three sections: GridCoordinates_t, Elements_t, and FlowSolution_t—that covers 80% of practical use. If you want to read and write in Python, install pyCGNS with pip install pyCGNS and experiment with a small mesh. That's the fastest path to proficiency.


Accurate understanding of CAE terminology is the foundation of team communication. — Project NovaSolver also supports practitioner learning.

Share Your CGNS Challenges

Project NovaSolver aims to solve real-world CAE challenges—data conversion complexity, solver interoperability, large-scale I/O bottlenecks. Your practical experience drives better tool development.

Contact (Coming Soon)
Rate this article
Thank you for your response!
Helpful
More
Details
Report
Error
Helpful
0
More Details
0
Report Error
0
Written by NovaSolver Contributors
Anonymous Engineers & AI — Sitemap
View Profile