What do you do when you don’t know how to do something in OpenFOAM?
What parameter names OpenFOAM expects for a certain dictionary?
What model / solver limitations there are in the latest version?
Do you type into the Google search or ChatGPT?
Only to find out you have to deal with hallucinations and out-dated answers?
Do you perhaps scramble to the online help guide or wiki links?
Only to find it’s a little behind…
Or maybe you head over to the CFD Online forum?
Only to find more people guessing, unsure or using out-dated information?
Whilst each of these have their place and have helped me resolve some issues over the years, I still default to my first choice.
And that’s to use the source code itself.
That’s right – the actual implementation / version of OpenFOAM that’s living and breathing on my machine (if you didn’t already know, it’s open-source!).
A single source of truth (better than multiple conflicting ones…)
The developers of OpenFOAM wrote the code.
They also added notes to each source code file.
And it’s literally GOLD.
It has:
-
Verbose descriptions of what a Class or Object does
-
In-line code statements that explain how the function works
-
Usage hints scattered throughout
And it works both ways – helping core and community maintain and improve the vast code base but also allow users to trouble-shoot with confidence.
This is why this is the coolest, most effective way I know of getting answers to your OpenFOAM problems!
That sounds great Nasser, but where exactly do I look?
The source code is provided, typically under the following directory:
You’ll find all the header and definition files in C++ here…
All of the Solver code, meshing utilities, sampling, visualisation and anything else you can ask for.
Like I said, pure GOLD.
On my YouTube channel this week:
What I’ve been listening to this week:
Until next week. 👋
Nasser
