foamToNeko converts an OpenFOAM mesh to Neko's binary .nmsh format.
Build inside an OpenFOAM environment, for example:
source /path/to/OpenFOAM-v2506/etc/bashrc
wclean
wmakeThis produces the foamToNeko executable in the usual OpenFOAM user bin
directory.
Run the converter in an OpenFOAM case directory after the mesh has been created:
foamToNekoThis writes mesh.nmsh in the current case directory.
- only pure hexahedral meshes are supported,
- periodic
cyclicpatches are exported as periodic Neko zones, - ordinary boundary patches are exported as labeled boundary zones.
Cases with non-hex cells such as prisms, wedges, pyramids, tetrahedra, or general polyhedra should be rejected before conversion.
The repository contains a small validation suite of known-good blockMeshDict
files under tests/valid_meshes/. They are intended to be used with the shared
OpenFOAM scaffold in tests/case/.
Typical validation flow:
blockMesh -case tests/case -dict tests/valid_meshes/periodicCubeArgon.blockMeshDict
checkMesh -case tests/case -constant
cd tests/case
foamToNeko
mesh_checker mesh.nmshexamples/tjunction/ contains a runnable Neko example built on a validated
OpenFOAM T-junction mesh. It demonstrates the intended workflow:
cd examples/tjunction
blockMesh
foamToNeko
mesh_checker mesh.nmsh
neko tjunction.case'