I know, OpenFOAM comes with a ridiculous number of solvers (approximately 80 on my last count!).
It’s mainly due to the separation of the physics they are each designed to solve.
Whilst this means mental-overload for me and you, it’s not all bad.
Especially when you get to grips with how a solver like simpleFoam actually works.
Finally understand what happens with your initial values during calculation
Resolve and trouble-shoot solver crashes and errors
Control the computation per time step
Customise the solver and edit the equations
Understand what your simulation is actually doing rather than simply following a tutorial
That last one is the big one for me.
It was the big unlock that I needed to be able to get around OpenFOAM and actually setup cases with confidence.
That’s why I’m sharing this with you.
What exactly is simpleFoam?
Yes, it’s a solver but let’s go to the fundamental level here…
It’s a loop of code that applies the mathematical model to the numerical representation of the physical problem.
Why is this important then? I hear you ask…
Well, when you type simpleFoam into the Linux CLI and press Enter, you’re actually starting a program and setting off a chain of events…
Read the current state / values (pressure and velocity fields)
Construct the equations for these fields
Solve and apply corrections to them
Update the fluid variables
Write the results to disk
Check convergence / error
Repeat
And the actual loop in code looks like this:
simpleFoam is doing this for a particular class of fluid problems - steady-state, incompressible flows.
Problems where the values at a certain location in space don’t change with time.
Now those countless solvers don’t seem so overwhelming, in fact you can ignore most of them and only focus on the ones that are relevant to your problem case!
What happens to your initial values under the /0 folder?
Suppose you have U and p values, typically representing the velocity and pressure field.
You’ve just set the initial conditions for the iterative calculations that begin once the solver is executed!
This is what you see when you look at your residuals, hopefully dropping, from Left to Right. Nice.
But hang on Nasser, what is it actually calculating during each iteration?
This is where I slow myself (and you) down on purpose.
You see, we’ve just discovered there is a larger loop being being carried out that surround the actual calculation.
I will be delving deeper into the code and sharing what I find useful for you to know. The goal is to use OpenFOAM with clarity and intent.
I hope you subscribe here to follow along on this journey.
One last thing, If you didn’t know, I’ve been creating more videos lately on my YouTube channel (OneDigitalEngineer), so be sure to check in regularly and subscribe to help it grow!
See you next week.
Nasser




