BeginnerCFDEngineering

Run Your First OpenFOAM Simulation

Set up, mesh, run and post-process a laminar pipe flow case from the command line.

Estimated completion: 45 min

Illustration for Run Your First OpenFOAM Simulation

Objective

Complete a full OpenFOAM workflow end to end and post-process the result in ParaView.

Required knowledge

  • Basic fluid mechanics
  • Comfort with a Linux terminal

Software and tools

  • OpenFOAM v12
  • ParaView
  • Linux or WSL

Files and resources

  • Tutorial case folder
  • Checklist PDF

Step-by-step instructions

  1. 1

    Copy a tutorial case

    Start from an existing validated case rather than an empty folder. It gives you a working dictionary structure to modify.

  2. 2

    Define the geometry and mesh

    Edit blockMeshDict for the pipe dimensions, then run blockMesh and checkMesh. Do not continue until checkMesh reports no errors.

  3. 3

    Set boundary conditions

    Define inlet velocity, outlet pressure and no-slip walls in the 0/ directory. Keep units consistent in SI.

  4. 4

    Configure the solver

    Choose icoFoam for laminar incompressible flow and set the time step so the Courant number stays below 1.

  5. 5

    Run and monitor

    Launch the solver and watch the residuals. Falling residuals with a stable Courant number indicate a healthy run.

  6. 6

    Post-process

    Open the case in ParaView, plot the velocity profile at the outlet and compare it with the analytical parabolic profile.

Expected result

A fully developed parabolic velocity profile matching the analytical Hagen-Poiseuille solution within a few percent.

Troubleshooting

ProblemHow to fix it
Solver diverges immediatelyReduce the time step and confirm boundary condition types match the solver.
checkMesh reports high skewnessSimplify block grading or increase cell counts in the affected direction.

Final checklist

  • Mesh passes checkMesh
  • Courant number below 1
  • Residuals converged
  • Result compared with analytical profile

Related tutorials