Making 3D mesh from 2D outline and Calculating the flow

Update: June 1, 2017
OpenFOAM 4.x

Case directory



First, we create 2D meshes from outline geometry with foamyQuadMesh, and then extrude the meshes vertically to create 3D meshes with extrude2DMesh. After mesh creation, compressible fluid analysis will be done.

The outline geometry is defined in opencfd_text.stl and opencfd_box.stl in the constant/triSurface directory. The 2D mesh creation settings are specified in the file system/foamyQuadMeshDict, and the extrusion settings are specified in the file system/extrude2DMeshDict.

Outline geometry Outline geometry

The fluid flows in from the minimum X plane with a velocity of (3, 0, 0) m/s and out from the maximum X plane.

The meshes are as follows, and the number of mesh is 109069.

2D meshes 2D meshes
2D meshes (zoomed) 2D meshes (zoomed)
3D meshes 3D meshes
3D meshes (zoomed) 3D meshes (zoomed)

The calculation result is as follows.

Flow velocity (U) Flow velocity (U)


cp -r $FOAM_TUTORIALS/mesh/foamyQuadMesh/OpenCFD OpenCFD
cd OpenCFD

# Making meshes
cp system/controlDict.mesher system/controlDict
foamyQuadMesh -overwrite
extrude2DMesh -overwrite polyMesh2D
checkMesh -allGeometry -allTopology -constant -noZero

# Calculating
cp system/controlDict.rhoCentralFoam system/controlDict
cp -r 0.orig 0
mpirun -np 8 rhoCentralFoam -parallel


Calculation time

  • Making meshes: 7 minutes and 21.28 seconds. *Single
  • Calculating: 10 minutes and 7.5 seconds. *8 parallel

※Inter(R) Core(TM) i7-2600 CPU @ 3.40GHz 3.40GHz