OpenFOAM — Tips -1

Hilaal Alam
2 min readJun 23, 2021

OpenFOAM is grabbing our attention Stealthily against its commercial counterparts. Becoming a darling of industries, Volkswagen is one of them, it is emerging as a comprehensive CFD solver.

Sample Analysis with OpenFOAM

Opensource Field Operation and Manipulation (OpenFOAM) is written in C++ language but understands REGEX syntax. While any standard text editor is sufficient for pre-processsing, my favourite is Visual Studio Code.

I have compiled the tricks and tips in brief to use OpenFOAM as listed below. (from the Source: http://www.wolfdynamics.com/wiki/tipsandtricks.pdf)

Pre-processing 1: Handling #OpenFOAM

  1. One can use different versions in different terminals at the same time. The latest is v8.
  2. The workflow goes from (i) pre-processing (geometry & meshing), (ii) starting & running solutions and (iii) post processing.
  3. Never use underscore as the first character of your filename (i.e. _filename).
  4. It is better to save solutions of big problems in binary formats for effective processing. Intensive IO may slowdown or sometimes crash your systems. It happens even with the powerful supercomputers.
  5. All the dictionary files in tutorials end with “Dict” (or “dict).
  6. Running OpenFOAM in a cluster is not different from running in your workstation.

Pre-processing 2: Geometry

  1. It is essential to have a good geometry to generate a good quality mesh.
  2. De-featuring your geometry will make your life lot easier.
  3. Have a clean & watertight geometry with no sharp edges, if possible.

Pre-processing 3: Meshing

  1. Keep the skew-ness (non-orthogonality), aspect ratio & the growth rate of the mesh as low as possible to obtain a good quality mesh.
  2. Always remember to check the mesh quality with CheckMesh utility.
  3. Topological error should be repaired (remesh) as it may affect the accuracy of the result and slowdown the simulation.
  4. It is recommended to use renumberMesh utility to make the linear solver run faster by reducing the mesh bandwidth.

Pre-processing 4: Boundary Conditions

  1. Minimise the grid skew-ness, growth rate and aspect ratio near the boundaries.
  2. Keep the boundaries far away from the incidents happening.
  3. Exercise extra cautions in case of backward flow at the inlets & outlets.

Pre-processing 5: Initial Conditions

  1. A good initial condition can improve the stability and convergence rate.
  2. It is recommended to use potentialFoam to get an initialß solution. It can give you an idea of the sensitivity of the mesh.
  3. If you are using a turbulence model, you can initialize the velocity and the pressure fields from the solution obtained from a laminar case.
  4. If you are running an unsteady simulation and if the initial transient is of no interest, you can initialize your flow using the solution obtained from a steady simulation.

(to be cont.)

--

--

Hilaal Alam

| Dreamer, Explorer, Innovator | Startups | Quantum-Information, Computing, Complexity, Error Correction, Gravity, Biomimicry | Design-Flexures, PBDL |