Lesson finished
Unlock all 54 lessons of Advanced CFD using OpenFOAMFull course ₹40,000 · paid
CFD Workflow, Solution Quality Checks and OpenFOAM Setup
A free lesson from Skill-Lync's Advanced CFD using OpenFOAM course, on Grow by Skill-Lync · Last updated 16 Nov 2026 · Session: “Week 1 Session 3”
What will you learn in this free Advanced CFD using OpenFOAM lesson?
The lesson presents the CFD flowchart and explains pre-processing, from geometry and mesh to boundary conditions and units. It covers solution properties such as boundedness, realizability and accuracy, and ends with the Linux, WSL2, OpenFOAM 7, Xming and ParaView setup.
- Pre-processing steps: domain, mesh, physics and boundary conditions
- Boundedness, realizability and accuracy of solutions
- Modeling and discretization errors
- WSL2, Ubuntu, OpenFOAM 7, Xming and ParaView requirements
What comes after lesson 3?
Later in Skill-Lync's Advanced CFD using OpenFOAM course (paid): lesson 4, Week 2 Session 1 Part 1; lesson 5, Week 2 Session 1 Part 2; lesson 6, Week 2 Session 2 Part 1. The full course has 54 lessons (18 h 30 min of video); see the course overview or its price and syllabus.
Lesson transcript
Machine transcript of the lesson audio (lightly cleaned). Technical terms may contain errors; the video is the reference.
This is a very basic flowchart of a basic CFD study. As you can see, we start with a mathematical model, then we introduce a geometry, we make the mesh, then we try to simplify or better the mesh or the geometry, then we go towards solving, and we have a sort of loop here for a grid-dependent study, which we'll discuss further. So, we introduce our initial and boundary conditions, then if we are satisfied with our results, we just end at the post-processing stage. Pre-processor. For any CFD study, pre-processing essentially means setting up our simulation and making it ready for the solving.
Pre-processing is essentially input of a flow problem to any of the CFD codes. In pre-processing, we define our geometry, which is called the computational domain. Then we generate our grid or mesh, so-called. By that, we mean the division or discretization of the domain into a number of small, non-overlapping cells or subdomains. Right after mesh generation, we have the selection of physical and chemical phenomena that we want to model, and then we define our fluid properties, and then we specify the appropriate boundary conditions at the cells on domain boundary.
During the pre-processing stage, we must always keep in our head to make our domain as simple as possible, and to reduce the complexity of that domain wherever possible. Now, it must be kept in mind that while we are trying to reduce the complexity, we are not losing essential terms or essential things that are needed in our computational domain. That is to say that we must ensure that we must ensure the solution accuracy is not impacted. One more very important thing that I want to note while you sort of go through the pre-processing stage, always make note of your units and always follow one standard system.
Try to keep it as uniform as possible. This helps in reducing errors. Here is a very simple example of a simplification of an aircraft wings cross-section, and just translating it towards a sort of simple computational domain. In pre-processer, we also choose our appropriate mathematical model. This helps in representing the physical phenomena that are happening in our domain. Before conducting any CFD study, always check for a bunch of approximations that can be made. Approximations such as whether the flow is, let's say, steady or unsteady, compressible or incompressible, turbulent or laminar.
If you really require the energy equation to be included at all, or if your flow is irrotational, or stuff like that. So, always ensure to check for the approximations that can be made. We will go through these as we go through our course and try to explain where approximations can be made. And always try to reduce the equations to be solved, the number of equations to be solved whenever possible and wherever possible. It goes without saying that the more the number of equations are involved in your solving process, the higher the complexity and hence higher computational cost.
Meshing. Any flow domain must be discretized in order to model our solution numerically. We essentially project these numerical solutions onto these very small solvable domains, subdomains, and then try to piece it all together and explain our fluid flow around the body. The solution to flow variables are defined at the nodes inside each cell. Essentially, center of the cell is where the node is situated. OpenFOAM employs the usage of finite volume approach, which is to say that discretization conservation is always ensured. And we don't really need coordinate transformation for irregular meshes.
So, with finite volume method, we are essentially integrating the governing equations across a finite volume, which ensures our discretization conservation. And also, it essentially means that we can employ unstructured meshes with any of the arbitrary polyhedral cells or polygons in two dimensions. For meshing, there is no really one correct answer. In many of the CFD areas, non-uniform meshes are employed, where we try to make the mesh as fine as possible, where we really sort of non-uniform meshes. In any of the CFD areas, we tend to lean towards non-uniform meshes.
That is to say that the areas where we expect larger variations of flow variables, in those areas, we make our mesh as fine as possible. And everywhere else, we try to make it as coarse as possible. This is to essentially reduce the number of cells that are created so as to reduce the computational time. This is a very basic example of the non-uniform mesh phenomenon that I just explained. As we can see in the flow domain on the left-hand side, we have the outer domain where we don't really expect much gradients of flow variables.
Then we have, as we move to nearer towards the body, we have a finer grid. It's just to say that we are going to expect much more gradients of flow variables around here. And then we have a much more finer mesh around the body itself. So with this process, we are essentially reducing the number of cells that are employed by just making mesh coarser around the outer regions of the domain and then making it finer at the inner domain. Solving. Solving of a CFD problem is the most time-consuming part of any CFD analysis.
By solving, we mean employment of numerical schemes which try to approximate solutions on the discretized cells. And these in itself depend on several factors. We will go through these as we advance through the course. Analytical model of the governing equations, which are written in either integral or differential form, are replaced by a set of linear algebraic equations in matrix form. These are directly dependent on the size of your mesh. These algebraic equation systems are then solved using a bunch of algorithms. We will go through these algorithms as well.
And these algorithms are developed as iterative solvers. That is to say, we are essentially reducing error from one iteration to another. The OpenFOAM frameworks provides a very wide variety of such solvers. And OpenFOAM also allows us to modify both the solver and corresponding parameters. Let's go through some properties of numerical solution methods. Any solver must consist of a bunch of properties which make it reliable and suitable for solving our fluid problems. The first property is consistency. By consistency, we mean that the discretization should become exact as the grid spacing tends to 0.
This essentially means truncation error between one iteration to another must try and tend to 0. And this reduction of truncation error must consistently decrease and it should not increase. So let's go through this again. The discretization should become exact as the grid spacing tends to 0. Now, the truncation error is defined as difference between discretized equation and the exact equation. And as this truncation error tends to reduce consistently, we can say that our numerical solution method is consistent. Next, we have stability. A numerical solution method is said to be stable if it does not magnify the errors that appear in the course of numerical solution process.
For instance, stability is really difficult to investigate in presence of boundary conditions and non-linearities which occur during solving of the problem. But that is not to say that a solution is not stable. A solution is stable if the errors which appear as the numerical solution progresses, if these errors do not magnify. To ensure that a method is stable, we tend to employ smaller time steps and under relaxation factors. We will go through these as we progress in the course. Convergence. A discretized equation is said to have converged.
If... If the difference between the discretized equation and the exact solution has an error of the order, which is specified by the user, by that we mean the residuals that we specify, most commonly in Ansys Fluent, if you have used it, convergence criteria is set by the user, and as a rule of thumb, this is what sort of explains how accurate your solution is, boundedness. By boundedness, we mean any numerical solution should lie within proper defined bounds. There are a few physically non-negative quantities, such as density or kinetic energy of turbulence.
These properties must always be positive. Other quantities, such as concentration, or we will go through this in VOF theory, alpha, these quantities must always lie between 0% and 100%. Similarly, in absence of sources, some equations require that the minimum and maximum values of that variable are found on the boundaries of the domain. So, boundedness is usually difficult to guarantee, but we must always try and ensure that a numerical solution is lying between two very proper sort of bounds. Realizability. Realizability. There are certain phenomena that are really complex to treat directly.
For instance, turbulence, combustion, multi-phase flows. By realizability, we mean that such complex processes must be designed to guarantee physically realistic solutions. This is not essentially a numerical issue, but models that are not realizable, that are not solved properly or modeled properly, may result in non-physical or unphysical solutions, and these cause our numerical methods to sort of diverge. We must always try and rely on validation from either published material or experimental data to ensure realizability. Accuracy. Any solution that we are getting by numerical solving of the fluid flow are only approximate solutions, and there are errors involved in this iterative solving of these numerical solutions.
In addition to these errors, there are a bunch of systematic errors that also occur, such as modeling errors. These are essentially differences between the actual flow and exact solution of the mathematical model. Then we have discretization errors. These are defined as the difference between exact solution of the conservation equations and exact solution of the algebraic system of equations. These occur due to the sort of discretization or mesh of our domain. Then we have iteration errors. These are the difference between the iterative and exact solutions of the algebraic equation systems.
Iteration errors are also called convergence errors, but convergence is usually used in conjunction with the error reduction in iterative solution methods. It is also associated with the convergence of numerical solutions towards a grid-independent solution, which is to say that convergence is often linked to discretization errors as well. Then post-processing. Once we have ensured the accuracy of our simulation, we are free to post-process our results and try to explain what we have done with the study. Once the simulation is successfully finished, the user usually ends up with a huge amount of data.
Data visualization techniques such as the contours of pressure, velocity, etc. are employed to better understand the physical phenomenon inside our domain. Not just contours, line graphs are really crucial for conducting comparative studies and help in making better designs so as to measure the metric with which we are measuring our accuracy of the solution. Post-processing plays a really key role for grid-independent studies for validation of our study. Right here, I want to say something. Just because we are able to make really beautiful sort of contour images of a flow around some body does not mean that our solution is accurate.
We must always rely on line graphs to sort of conduct iterative grid-independent studies and try to understand how with changing mesh flow variables are changing. And once we are satisfied with the grid we have made, we must compare it with some published material or experimental data so as to ensure the accuracy of our solution. Verification. I was talking about it briefly right now. A converged solution does not essentially mean that it is a correct solution. A converged solution essentially means that through the process of iteration you have reduced the truncation error to a degree which you have specified.
It does not really mean that your solution is physically correct. Any single mistake that we might have made in the initial steps during pre-processing might sort of result in a domino effect where that one error sort of spirals into a bunch of errors. Grid-independence study is a sort of a starting step towards ensuring an accurate solution. You must always try to verify the accuracy of our numerical study with experimental data whenever it is possible. Since experimental data is the pinnacle of accuracy as it essentially is the physical world.
Simplifying some aspects such as geometry, mesh or the initial conditions is always advised but we must always ensure that during the simplification process we must always try to keep it in mind that we are not losing essential parts of our domain that need to be modeled. In case of a failed study, it is advised to sort of simplify our geometry or make a better mesh or check our initial and boundary conditions. And in the end, as always, as I have said before as well, always check for units, always make sure that your units are uniform across the board.
That is to say you are not using one unit for length and another unit to define length in some other flow variable. It must always be uniform. OpenFOAM is an open source CFD solver package and it is owned by currently the OpenFOAM Foundation. It is distributed to the general public under the general public license. That is to say that it is open source and can be used without any costs. It is free of cost. OpenFOAM was created in 1989 by a chemical engineer called Henry Weller.
He released it in December of 2004 as an OpenFOAM project. OpenFOAM is written heavily in C and C++. That is to say it ensures high performance computing, scalability and faster execution. Over the years, OpenFOAM has stood out with its well-developed codes for a very wide range of applications. And these sort of skills using OpenFOAM are well sought after for a potential CFD developer and application engineer jobs. As with any CFD code, OpenFOAM has its advantages and disadvantages. To those of you who are comfortable with the sort of programming language syntax will feel it easy to use OpenFOAM.
OpenFOAM uses programming language syntax to sort of represent the complex mathematical equations and operators. One of the main advantages of OpenFOAM is that the source code is really well documented and is available in many places for the wide range of applications they offer. There are sort of very huge directory of tutorials that try to explain the structure of that particular solver really well. To those of you who are familiar with C and C++, memory management is sort of an issue when a linear algebra comes to play.
OpenFOAM does not have that issue. OpenFOAM manages the memory automatically. As explained before, due to its employment of finite volume method, OpenFOAM can handle unstructured meshes really well since conservation is ensured using the finite volume method. One of the main disadvantages and sort of things that put people off towards using OpenFOAM, it's very steep learning curve. There are a lot of things you need to understand. Before making your own studies in OpenFOAM. To some, it is also a bit off-footing that OpenFOAM does not have a sort of a graphic user interface where you can just select every single option you want and just choose your solver and so on and so forth.
OpenFOAM also has a very slow development of new sort of applications. Current version that we are using from OpenFOAM.org, we are using OpenFOAM 7. Every year, we have a new iteration of OpenFOAM. This year, it was OpenFOAM 8, which introduced a bunch of new features. So, development of new applications takes one entire year for OpenFOAM, but that should not be that big of a disadvantage if you are using the OpenFOAM development version, OpenFOAM dev, but otherwise, this is just a small disadvantage to have. OpenFOAM can be used in any of the major operating systems. OpenFOAM can be used in any of the major operating systems, open to Linux, any of the other Linux, OS, Mac OS, and Windows.
In this particular course, we are using Windows. We are using Windows because majority of the people use Windows and we deemed it sort of appropriate to use Windows ourselves. Strictly speaking, there is no difference between what sort of operating system you are using. Hence, so, if you are currently using any of the other operating systems, please, no need to panic. You can continue to use that particular OS. For Windows, we use a sort of application called WSL2. It's a Windows subsystem for Linux, which gives us access to a Linux terminal.
This particular Windows subsystem for Linux terminal runs as a virtual environment in Windows OS and sort of takes the competing resources through Windows machine as is required. Usually preferred environment is Ubuntu Linux, mostly because there are a bunch of sort of graphical post-processing software, which run really well in Linux, but we can also use them in Windows as well and easily. We will explain how that is done as we progress through this course. As explained, in this current course, we are using OpenFOAM 7 from OpenFOAM.org, but the most recent version was OpenFOAM 8.
This can be installed on Windows in the 18.04 LTS Linux distribution. You can get this through the Windows store and we will sort of explain how that is done. This is a very simple example of a difference between the environments of Windows and Ubuntu Linux. In the upper region, we have just a sort of terminal window where we have these folders inside the OpenFOAM 7 main folder and the same is in the Ubuntu environment. The main difference being you can see it in a sort of graphical representation as a folder in Ubuntu and you can see it as a list in the Windows.
For this particular course, we require either the Ubuntu LTS 20.04 or 18.04 installation, then the OpenFOAM 7 from OpenFOAM.org. And we also require one specific software called XMing. This is an X server software. This essentially speaks with the Linux terminal to translate the sort of graphical Linux applications to Windows. We need the application Paraview and sometimes if you are not comfortable with the Linux terminal, you may also use it for the gedit text editor. We will go through this as well and help you install it.
These are some of the additional materials that I would highly recommend for those of you who are just starting to learn CFD or those of you who have some proficiency with CFD. I would also recommend if you are stuck in some places while using OpenFOAM to go through these websites. These have vast dictionaries of sort of what exactly OpenFOAM is and how you can debug your problem. And we also have the website CFD-online.com. In this website, it's sort of a blog in which people post their questions and we can check through them and try to understand if we can debug our problem or not.
In summary, in this week's course, we were able to understand the governing equations, the basics of CFD and its individual components and a very basic introduction to how OpenFOAM looks, how we are going to install it and how we are going to use it. That's all for this week's course. I'll see you in the next week. Thank you.