Mesh refinement

Update: June 1, 2017
OpenFOAM 4.x
To run this tutorial, you need to install "make", which can be installed on Ubuntu with the command "sudo apt install make".

Case directory

$FOAM_TUTORIALS/mesh/refineMesh/refineFieldDirs

Summary

We will use the utility refineMesh to refine an existing mesh.

First, we use blockMesh to create an initial mesh as shown below. After that, the mesh is redivided 6 times in the Z direction and 3 times in the cylindrical coordinate system.

The initial mesh - the number of meshes is 1880 The initial mesh - the number of meshes is 1880

The meshes are as follows.

The mesh refined in the Z direction - the number of meshes is 50400 The mesh refined in the Z direction - the number of meshes is 50400
Finished mesh - the number of meshes is 197120 Finished mesh - the number of meshes is 197120

Commands

cp -r $FOAM_TUTORIALS/mesh/refineMesh/refineFieldDirs refineFieldDirs
cd refineFieldDirs

# Build and install calcRadiusField into the system
wmake calcRadiusField
wclean calcRadiusField

# Create initial mesh
blockMesh

mkdir 0

# Refine the mesh 6 times in the Z direction
calcRadiusField
topoSet -dict system/topoSetDict.tier1
refineMesh -dict system/refineMeshDict.tier1 -overwrite
rm -r 0/*

calcRadiusField
topoSet -dict system/topoSetDict.tier2
refineMesh -dict system/refineMeshDict.tier2 -overwrite
rm -r 0/*

calcRadiusField
topoSet -dict system/topoSetDict.tier3
refineMesh -dict system/refineMeshDict.tier3 -overwrite
rm -r 0/*

calcRadiusField
topoSet -dict system/topoSetDict.tier4
refineMesh -dict system/refineMeshDict.tier4 -overwrite
rm -r 0/*

calcRadiusField
topoSet -dict system/topoSetDict.tier5
refineMesh -dict system/refineMeshDict.tier5 -overwrite
rm -r 0/*

calcRadiusField
topoSet -dict system/topoSetDict.tier6
refineMesh -dict system/refineMeshDict.tier6 -overwrite
rm -r 0/*

# Refine the mesh 3 times in the cylindrical coordinate system
calcRadiusField -calcDirections
topoSet -dict system/topoSetDict.range1
refineMesh -dict system/refineMeshDict.range1 -overwrite
rm -r 0/*

calcRadiusField -calcDirections
topoSet -dict system/topoSetDict.range2
refineMesh -dict system/refineMeshDict.range2 -overwrite
rm -r 0/*

calcRadiusField -calcDirections
topoSet -dict system/topoSetDict.range3
refineMesh -dict system/refineMeshDict.range3 -overwrite
rm -r 0/*

paraFoam

Calculation time

22 seconds *Single, Inter(R) Core(TM) i7-2600 CPU @ 3.40GHz 3.40GHz