| name | openfoam-51-y-verification |
| description | Sub-skill of openfoam: 5.1 y+ Verification (+5). |
| version | 1.0.0 |
| category | engineering |
| type | reference |
| scripts_exempt | true |
5.1 y+ Verification (+5)
5.1 y+ Verification
simpleFoam -postProcess -func yPlus -latestTime
Or add to controlDict:
functions { #includeFunc yPlus }
Target y+ ranges:
| Approach | y+ target | When to use |
|---|
| Wall-resolved (low-Re) | < 1 | Accurate wall heat transfer, separation |
| Wall functions (high-Re) | 30-300 | Industrial flows, coarser meshes |
| Buffer layer (avoid) | 5-30 | Neither model accurate here |
5.2 Mass Conservation
Parse continuity errors from log:
time step continuity errors : sum local = 1.23e-07, global = -2.34e-15, cumulative = -5.67e-14
| Metric | Acceptable |
|---|
| sum local | < 1e-4 (typical: 1e-6 to 1e-8) |
| global | < 1e-10 (should be near machine precision) |
| cumulative | Should not grow unbounded |
5.3 Residual Convergence Criteria
Steady-state (simpleFoam):
| Field | Typical target | Tight target |
|---|
| p | initial residual < 1e-4 | < 1e-5 |
| U | initial residual < 1e-4 | < 1e-5 |
| k, epsilon, omega | initial residual < 1e-4 | < 1e-5 |
Convergence: residuals should decrease monotonically. Oscillating residuals indicate numerical issues.
Transient: Final residuals within each time step should reach solver tolerance. Initial residuals should not grow over successive time steps.
5.4 Benchmark Cases
Available locally at /usr/lib/openfoam/openfoam2312/tutorials/:
Lid-Driven Cavity (icoFoam):
blockMesh && icoFoam
Backward-Facing Step — pitzDaily (simpleFoam):
blockMesh && simpleFoam
Dam Break (interFoam):
blockMesh && setFields && interFoam
motorBike (simpleFoam + snappyHexMesh):
5.5 Function Objects for Monitoring
Include in controlDict functions {}:
| Name | Purpose |
|---|
#includeFunc yPlus | Wall y+ field |
#includeFunc CourantNo | Courant number field |
#includeFunc fieldMinMax | Min/max of all fields |
#includeFunc solverInfo | Residual data per timestep |
#includeFunc wallShearStress | Wall shear stress |
#includeFunc vorticity | Vorticity field |
#includeFunc Q | Q criterion for vortex identification |
All function object templates at: /usr/lib/openfoam/openfoam2312/etc/caseDicts/postProcessing/
5.6 Export for ParaView
foamToVTK
foamToVTK -latestTime
foamToVTK -fields '(U p)'
foamToVTK -time '100:200'