It is quite often users wonder about debugging OpenFOAM solvers. There are a few different approaches to get more information about simulations while they are running, with a varying amount of effort required.
This post provides a brief summary of those options:
- o Override debug switches in the case controlDict
- o Add Info statements to the solver code and re-compile
- o Run the solver using a debugger such as gdb, ddt etc.
- o Compile entire OpenFOAM with the debug flag
Each method above has its own advantages and disadvantages like repeatibility, complexity or speed. I personally use debug switches whenever I can. Also, I don't hesitate to add a few Info statements to the strategic places in the solver code. Compiling entire OpenFOAM using debug flags usually is too time consuming and requires a lot more space, but it is a good pratice to have at least of debug version available in your worktstaions.
Please contact us at firstname.lastname@example.org if you have any questions about Debugging OpenFOAM Aplications.