CGNS 格式简介及下载安装
CGNS 格式简介
CGNS (CFD General Notation System) 提供了通用、可移植、可扩展的标准, 用于存储和检索 CFD 分析数据. 该系统包含两部分:
-
用于记录数据的标准格式
-
读取、写入和修改数据的软件
CGNS 起源于1994年波音和 NASA 相关项目, 后于1999年移交给 CGNS Steering Committee. 其主要目标是可压缩粘性流动相关的数据,但也用于子集比如 Euler 流动、势流等.
| Type | Content |
|---|---|
| Grids | Structured, unstructured, hybrid |
| Solution Data | nodal, cell-centered, face-centered, edge-centered |
| Multizone Interface | abutting, overset |
| Boundary condition | |
| Equation | flow equation, physical models |
| Time-Dependent Flow | moving and deforming grids |
| unit | dimensional or nondimensionalization |
| reference states | |
| convergence history | |
| cad geometry | |
| user-defined data |
CGNS 库通过 C 语言编写,不提供面向对象接口,更改后的源码必须明确标记
CGNS 库最初由 ADF (Advanced Data Format) 格式构建,但其缺少并行 IO 和数据压缩功能,因此后续转向 HDF5 并作为默认数据存储格式
CGNS 使用方法参考 CFD General Notation System Getting Started
CGNS 库下载安装
安装方法参考 (https://github.com/CGNS/CGNS)
- 下载源码包并解压
1 | wget https://github.com/CGNS/CGNS/archive/refs/tags/v4.4.0.tar.gz |
- 检查
HDF5是否已经安装,文档 (https://cgns.github.io/download.html) 中建议通过最新 HDF5 发行版编译 CGNS 库,不建议使用1.10.0-patch1, 1.10.1 or 1.10.2版本
1 | $ apt list --installed | grep hdf5 |
- 编译 CGNS 包
1 | cd CGNS-4.4.0 |
- 配置环境变量
1 | #%Module |
Utilities
以下是安装的 CGNS 工具
| Tool | Description |
|---|---|
| cgnscheck | a CGNS file validator |
| cgnscompress | compress (remove extra space) from a CGNS file |
| cgnsdiff | compare 2 CGNS files |
| cgnslist | list the contents of a CGNS file |
| cgnsnames | display all the standard data-name identifiers |
| cgnsupdate | script to update a CGNS file to the current version |
| cgnsconvert | convert a CGNS file to/from ADF/HDF5 format |
| adf2hdf | script to convert a CGNS file from ADF to HDF5 |
| hdf2adf | script to convert a CGNS file from HDF5 to ADF |