CFD tutorial no. 2 — OpenFOAM propeller
Lifting the hood on the case folder

This OpenFOAM propeller tutorial opens the folder written by Heliciel and shows which interface setting each file corresponds to.

Start with tutorial no. 1

OpenFOAM propeller: tutorial for reading the case folder

CFD tutorial no. 2 of 20. The steps described here are those of the HELICIEL CFD Tool window, opened from Heliciel: they assume the PRO CFD/BEM upgrade is active. The preset values quoted are those of the catalogue shipped with the software; the numerical results depend on your geometry and your operating point, and should be read from the software.

Heliciel PRO CFD/BEM doesn't ask anyone to know how to write an OpenFOAM dictionary. But an OpenFOAM propeller case folder is still written to your disk, in plain text, and knowing how to read it changes the way you run a calculation : you stop guessing what the software is doing, and start checking it.

This tutorial is aimed at two audiences. Those who know OpenFOAM and want to see what's being generated on their behalf. And those who don't know it, but want to understand what the checkboxes they tick actually correspond to.

  1. Finding the case folder
  2. The three folders of an OpenFOAM case
  3. heliciel_benchmark.txt: the source of truth
  4. The tool chain run on your behalf
  5. Finding each step in the logs
  6. What you can do with this reading

1: Finding the case folder

File > Save CFD case as… menu shows you where the case is stored, and lets you place it wherever you want. The path also appears in the Logs tab as soon as meshing starts.

A methodological point : if your working folder is on a network drive, Heliciel copies the case locally before calculating, then brings the results back. OpenFOAM writes an enormous number of small files, and a network share turns that writing into a bottleneck. Don't fight this behaviour, it protects you.

folder tree of an OpenFOAM case generated by Heliciel with the 0, constant and system folders
A real case folder : the three OpenFOAM folders, and the four files Heliciel adds there for its own purposes. The content of constant/polyMesh is summarized — that's the mesh.

2: The three folders of an OpenFOAM case

An OpenFOAM propeller case always fits the same folder tree, and Heliciel follows it scrupulously :

Open system/fvSolution : you'll find the algorithm, the linear solvers and the relaxation factors. None of this was ever asked of you. It's the solver preset chosen in the Parameters tab that writes this file, all at once, in an already-proven combination. Reading it is instructive ; editing it by hand means stepping outside the preset and losing the benefit of its validation.

3: heliciel_benchmark.txt, the case's source of truth

Alongside the three OpenFOAM folders, Heliciel writes its own state files. The most important one is called heliciel_benchmark.txt : it is the single source of truth for the case's physical parameters — velocity, rotation speed, density, viscosity, fluid type, and for a liquid the immersion depth and the saturated vapour pressure.

This file has a property you need to know about : it is written by appending, and the first occurrence of a key wins. The immersion depth read is therefore that of the first meshing run, frozen for the life of the case. Changing the immersion in the project and re-running only the solver does not update it : you have to remesh.

One more file deserves a glance : constant/hybridPhase1.done, an empty marker whose mere presence means Phase 1 is finished and the Phase 2 button can take over. You'll also come across a heliciel_cfd_state.txt, but only on an interrupted case : Heliciel writes it when stopping, so it knows where to resume. On a case run to completion, it doesn't exist.

heliciel_benchmark.txt file open in a text editor above the Flow tab
At the top, the case's heliciel_benchmark.txt; at the bottom, the Flow tab that filled it : 2,4 m/s, ρ 1028 kg/m3, μ 1,384·10−3 Pa·s — the same quantities on both sides. The file also carries what you never had to enter : the mesh preset, the solver preset, and the fifteen settings those two lines set on their own.

4: The tool chain run on your behalf

When you click Mesh, Heliciel launches a sequence of OpenFOAM executables, in this order :

  1. blockMesh — builds the background grid. A hexahedral box in most cases ; a five-block O-grid cylinder for a propeller in a closed duct ;
  2. surfaceFeatures — extracts the sharp edges from the blade's STL, so the mesh knows where the leading edge and trailing edge are ;
  3. decomposePar — splits the domain into as many sub-domains as the number of processes requested ;
  4. snappyHexMesh, in parallel under MPI — castellates, snaps to the STL, then stacks the boundary layers ;
  5. reconstructParMesh — glues the sub-domains back into a single mesh ;
  6. checkMesh — checks quality and writes its report.

The solver itself is foamRun with incompressibleFluid. In Phase 1 it runs steady-state SIMPLEC with the MRF zone ; in Phase 2, transient PIMPLE with the mesh actually rotating.

Logs tab showing the blockMesh surfaceFeatures decomposePar snappyHexMesh checkMesh sequence
The Logs tab during meshing: each OpenFOAM tool announces its start and its finish there

5: Finding each step in the logs

The Save logs checkbox, at the bottom of the Logs tab, is checked by default : Heliciel keeps the output of each tool in a file inside the case folder — blockMesh_stdout.txt, snappyHexMesh_stdout.txt, and so on.

Careful : after a successful run, the end-of-cycle cleanup deletes these files. If you're comparing two configurations, or investigating a failure, copy them elsewhere before relaunching.

The checkMesh report is the one to learn to read first. It tells you, boundary by boundary, whether the surface is sound. A line reading ok (non-closed singly connected) is normal for an open boundary. A multiply connected (shared edge) mention on the rotor flags a mesh flaw on the blade, and the run that follows will be fragile at best.

6: What you can do with this reading

Three concrete uses, once you've tamed the case folder :

OpenFOAM is distributed under the GPL licence and its engine costs nobody a thing ; what the PRO CFD/BEM upgrade brings is the chain that feeds it from your Heliciel project, and brings its results back into the 3D view. The logical next step from this tutorial is no. 3, on meshing.

OpenFOAM results displayed in the DirectX 11 3D view of the Heliciel CFD bench
The fields calculated by OpenFOAM, read back and displayed in Heliciel's 3D viewer : no external post-processor. Here, a two-blade tidal turbine at the end of Phase 2 — the pressure on the skin, the flow lines coloured by axial velocity, and the two scales that go with them.

The collection of twenty CFD tutorials

« Previous: First CFD propeller simulation  |  Next: Choosing the mesh preset »

  1. First CFD propeller simulation
  2. Reading the OpenFOAM case folder (you are here)
  3. Choosing the mesh preset
  4. The MRF zone and Phase 1
  5. Phase 2 with sliding mesh
  6. Comparing BEM and CFD
  7. Reading the convergence of a run
  8. Turbulence models
  9. Boundary layer and y+
  10. Reading a pressure map
  11. Where the forces come from
  12. Checking an airfoil polar
  13. Marine propeller and cavitation
  14. Wind turbine and tidal turbine
  15. Fan in a closed duct
  16. Aircraft propeller, cruise and static thrust
  17. The optimisation loop
  18. Calibrating on a reference
  19. From the hull to the propeller
  20. The deliverable calculation file

This series accompanies the Heliciel design tutorials, which cover the BEM side: blade design, choosing the rotation speed, performance curves. CFD comes after them, to verify and to see.