OpenFOAM — Tips -1
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.
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
- One can use different versions in different terminals at the same time. The latest is v8.
- The workflow goes from (i) pre-processing (geometry & meshing), (ii) starting & running solutions and (iii) post processing.
- Never use underscore as the first character of your filename (i.e. _filename).
- 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.
- All the dictionary files in tutorials end with “Dict” (or “dict).
- Running OpenFOAM in a cluster is not different from running in your workstation.
Pre-processing 2: Geometry
- It is essential to have a good geometry to generate a good quality mesh.
- De-featuring your geometry will make your life lot easier.
- Have a clean & watertight geometry with no sharp edges, if possible.
Pre-processing 3: Meshing
- Keep the skew-ness (non-orthogonality), aspect ratio & the growth rate of the mesh as low as possible to obtain a good quality mesh.
- Always remember to check the mesh quality with CheckMesh utility.
- Topological error should be repaired (remesh) as it may affect the accuracy of the result and slowdown the simulation.
- It is recommended to use renumberMesh utility to make the linear solver run faster by reducing the mesh bandwidth.
Pre-processing 4: Boundary Conditions
- Minimise the grid skew-ness, growth rate and aspect ratio near the boundaries.
- Keep the boundaries far away from the incidents happening.
- Exercise extra cautions in case of backward flow at the inlets & outlets.
Pre-processing 5: Initial Conditions
- A good initial condition can improve the stability and convergence rate.
- It is recommended to use potentialFoam to get an initialß solution. It can give you an idea of the sensitivity of the mesh.
- If you are using a turbulence model, you can initialize the velocity and the pressure fields from the solution obtained from a laminar case.
- 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.)