liminfo

OpenFOAM Reference

Free reference guide: OpenFOAM Reference

28 results

About OpenFOAM Reference

The OpenFOAM Reference is a comprehensive, searchable guide to OpenFOAM CFD simulation setup. It covers seven solvers: simpleFoam (steady-state incompressible SIMPLE), pisoFoam (transient incompressible PISO), interFoam (two-phase VOF), pimpleFoam (PISO+SIMPLE hybrid), rhoSimpleFoam (compressible steady-state), buoyantSimpleFoam (buoyancy-driven natural convection), and reactingFoam (combustion/chemistry) with complete controlDict configuration examples.

Boundary conditions documented include fixedValue (Dirichlet), zeroGradient (Neumann), noSlip, inletOutlet, totalPressure, turbulentIntensityKineticEnergyInlet, and wall functions (nutUSpaldingWallFunction, kqRWallFunction, epsilonWallFunction, omegaWallFunction). Turbulence models covered are k-epsilon, k-omega SST, Spalart-Allmaras, and LES Smagorinsky with initial condition estimation formulas.

Mesh generation includes blockMeshDict structured mesh setup and snappyHexMeshDict for complex geometries with castellatedMesh, snap, and addLayers controls. Numerical schemes cover ddtSchemes, divSchemes, laplacianSchemes, and SIMPLE/PIMPLE solver settings. Post-processing utilities include force/forceCoeffs monitoring, fieldAverage for LES statistics, and decomposePar for parallel computation. Ideal for CFD engineers and researchers.

Key Features

  • Seven OpenFOAM solver references with controlDict examples: simpleFoam, pisoFoam, interFoam, pimpleFoam, rhoSimpleFoam, buoyantSimpleFoam, reactingFoam
  • Boundary condition guide: fixedValue, zeroGradient, noSlip, inletOutlet, totalPressure, turbulent inlet, and wall functions with code snippets
  • Turbulence model setup: k-epsilon, k-omega SST, Spalart-Allmaras, and LES Smagorinsky with initial condition estimation (k, epsilon, omega, nuTilda)
  • Mesh generation reference: blockMeshDict structured grids and snappyHexMeshDict unstructured mesh with refinement surfaces, regions, and prism layers
  • Numerical schemes documentation: ddtSchemes (Euler, CrankNicolson, backward), divSchemes (upwind, linearUpwind, TVD), laplacianSchemes, and interpolation
  • SIMPLE/PIMPLE solver settings with relaxation factors, residual controls, GAMG/smoothSolver configurations, and non-orthogonal correctors
  • Post-processing: forces/forceCoeffs for lift/drag monitoring, fieldAverage for Reynolds stress computation, and decomposePar for MPI parallel runs
  • Complete dictionary syntax for system/controlDict, system/fvSchemes, system/fvSolution, and constant/turbulenceProperties

Frequently Asked Questions

What is the difference between simpleFoam, pisoFoam, and pimpleFoam?

simpleFoam uses the SIMPLE algorithm for steady-state incompressible flows with pseudo time-stepping (deltaT=1). pisoFoam uses the PISO algorithm for truly transient incompressible flows with small time steps (controlled by Courant number). pimpleFoam combines both: it uses SIMPLE outer corrections with PISO inner corrections, allowing larger time steps than pure PISO while maintaining transient accuracy. Use simpleFoam for steady cases, pisoFoam for fine-resolution transient, and pimpleFoam for most transient simulations.

How do I choose between k-epsilon and k-omega SST turbulence models?

k-epsilon is robust and economical for fully turbulent flows away from walls, but requires wall functions (y+ = 30-300). k-omega SST blends k-omega near walls with k-epsilon in the freestream, providing accurate boundary layer resolution when y+ approximately 1. Use k-omega SST for flows with adverse pressure gradients, separation, or when accurate wall shear stress is needed. Spalart-Allmaras is a simpler one-equation alternative for external aerodynamics.

How do I set up snappyHexMesh for complex geometries?

In snappyHexMeshDict, enable castellatedMesh, snap, and addLayers. Define geometry using STL files (type triSurfaceMesh) and optional refinement boxes (searchableBox). Set castellatedMeshControls with maxGlobalCells, resolveFeatureAngle (30 degrees typical), refinementSurfaces levels, and locationInMesh outside the body. For boundary layers, configure addLayersControls with nSurfaceLayers, expansionRatio (1.2 typical), and finalLayerThickness.

What boundary conditions should I use for a typical internal flow simulation?

For inlet: fixedValue for U (velocity), zeroGradient for p, turbulentIntensityKineticEnergyInlet for k. For outlet: zeroGradient for U, fixedValue for p (usually 0). For walls: noSlip for U, zeroGradient for p, and appropriate wall functions (nutUSpaldingWallFunction for nut, epsilonWallFunction or omegaWallFunction depending on the turbulence model). This setup ensures well-posed boundary conditions for pressure-velocity coupling.

How do I configure parallel computation in OpenFOAM?

Create system/decomposeParDict with numberOfSubdomains (e.g., 8) and method (scotch is recommended for automatic decomposition). Run "decomposePar" to split the domain, then "mpirun -np 8 simpleFoam -parallel" to execute in parallel. After completion, run "reconstructPar" to merge results. The scotch method automatically balances cell counts and minimizes inter-processor communication.

What are the recommended fvSchemes for a stable simulation?

For stability: use Euler for ddtSchemes, bounded Gauss upwind for divSchemes (1st order, most stable), and Gauss linear corrected for laplacianSchemes. For accuracy: switch to CrankNicolson 0.9 for time, bounded Gauss linearUpwind grad(U) for convection (2nd order), and use limited corrected for non-orthogonal meshes. Always use bounded for turbulence variables (k, epsilon, omega) with upwind schemes.

How do I monitor lift and drag forces during a simulation?

Add a forceCoeffs function object in system/controlDict. Set patches to the body surface, specify rhoInf (1.225 for air), liftDir/dragDir vectors, pitchAxis, magUInf (freestream velocity), lRef (reference length), and Aref (reference area). OpenFOAM writes Cl, Cd, and Cm values every writeInterval. For dimensional forces, use the "forces" function object instead of forceCoeffs.

Is this OpenFOAM reference free?

Yes, this reference is completely free with no usage limits, no account required, and no software installation needed. It covers 7 solvers, 7 boundary conditions, 4 turbulence models, 3 mesh tools, 4 numerical scheme categories, and 3 post-processing utilities. All data is processed locally in your browser. It is part of liminfo.com's free online CFD and engineering tool collection.