
Creating Scalar Form
In this project, you will create a solver using OpenFOAM. You will learn to customize it and its attributed cases.
Black FridayUpgrade your career this Black Friday. Get up to ₹60,000 Scholarship on IIT programsUp to ₹60K Black Friday Scholarship52 seats leftOffer ends Fri, 27 Nov, 11:59 pm IST.

This 3 month course offers the student a chance to learn in-depth about the development of a CFD solver in OpenFOAM. Enroll in the course to become an OpenFOAM developer
Introduction to OpenFOAM Development is an online course from Skill-Lync: 12 weeks, 18 hours of content and 4 industry projects.
54 min of this course's own recorded sessions, with transcripts, on Grow by Skill-Lync:
Compare all 20 Skill-Lync CFD courses · Compare all 9 Skill-Lync OpenFOAM courses · Best OpenFOAM course in India: other providers compared
Our projects are designed by experts in the industry to reflect industry standards. By working through our projects, Learners will gain a practical understanding of what they will take on at a larger-scale in the industry. In total, there are 4 Projects that are available in this program.

In this project, you will create a solver using OpenFOAM. You will learn to customize it and its attributed cases.

In this project, you will simulate cases such as diffusion and convection by varying the diffusion coefficient or velocity.

In this project, you will add an equation of temperature in the icoFoam solver, customize it and its cases. You will be asked to solve the incompressible flow equations for mass an…

The objective of this project is to calculate the total pressure using a coded function object. You will also write a short report including the code you used in LATEX.
Video stories from learners of related mechanical programs, from Skill-Lync's YouTube channel.
by the Skill-Lync team
Using OpenFOAM means editing text files to run a solver that someone else wrote. Developing means writing or changing the C++ that the solvers are built from: a new equation, a boundary condition or a turbulence model. OpenFOAM is a toolbox of C++ libraries, solvers and utilities, not one program.
The free first lesson, What OpenFOAM Is and How an OpenFOAM Case Is Structured, makes the same point and compares the ESI OpenCFD, OpenFOAM Foundation and foam-extend versions. In the second free lesson the instructor says the lessons use the ESI OpenCFD version unless said otherwise. The lesson also lists what you should bring: some fluid mechanics, a little C++ and basic Linux.
A case is a folder. The OpenFOAM v12 user guide describes three parts. constant holds the mesh (in polyMesh) and property files such as physicalProperties and momentumTransport. system holds controlDict (start, end and time step), fvSchemes (which discretisation schemes) and fvSolution (equation solvers and tolerances). The time folders, starting at 0, hold the fields with their initial values and boundary conditions. Using OpenFOAM is mostly editing these. Developing starts where they stop.
To change the C++ you compile it. wmake is OpenFOAM's own compile script, built on the standard make tool. A solver folder has a Make/files that lists the source files and the name of the program, and a Make/options that lists include folders and libraries. User-built programs go to the folder named by the FOAM_USER_APPBIN variable. Week 4 of the syllabus covers make files and CMake, library and class organisation, and compiling a solver.
Forks differ. The code on this page comes from the OpenFOAM Foundation source on GitHub (v10 and v12), read 24 Nov 2026, and details change between forks and versions. Learn the idea first, then check your own install.
fvm:: builds a term for an unknown field implicitly, and gives a matrix of coefficients that a linear solver must then solve. fvc:: calculates a term explicitly from the values the field has now, and gives plain numbers. Week 5 of the syllabus lists these as the implicit and explicit namespaces.
Think of a row of cells that pass heat to each other. The explicit way is to look at today's temperatures and step forward one small notch. It is cheap, but the step must be small. The implicit way is to write one equation per cell saying that tomorrow's temperature depends on tomorrow's neighbours, then solve all the equations together. It costs a solve per step, but it can take a bigger step. OpenFOAM's own source describes fvm as the namespace of functions that calculate implicit derivatives and return a matrix, and fvc as the one for explicit derivatives.
The classic example is a passive scalar, a quantity such as temperature that is carried by a flow without changing it. The equation says the change in time, plus what the flow carries, equals what spreads out, plus any source:
Here is the flux through each cell face and is the diffusion coefficient. In OpenFOAM-10 the solver scalarTransportFoam writes it almost the same way:
fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(DT, T)
==
fvModels.source(T)
);
TEqn.solve();ddt is the change in time, div(phi, T) is the carrying, and laplacian(DT, T) is the spreading out. Every term is fvm, so the whole equation becomes one matrix and TEqn.solve() hands it to a linear solver. The free second lesson shows the same three terms. How the face values inside div are chosen is the interpolation scheme, and our interpolation schemes calculator works through that.
One version note. In OpenFOAM Foundation v12 this program is only a script that tells you it was replaced by foamRun -solver functions. The equation did not change, but where it lives did, so check your own version. The course's third project, Creating icoTempFoam, asks you to add a temperature equation to the icoFoam solver.
An explicit diffusion step is stable only while the diffusion number is at most 0.5. Above that limit, errors grow on every step until the answer is garbage, while an implicit step, which solves all the nodes together, has no such limit. The code below shows both on 9 nodes.
is the diffusivity, how fast heat spreads, in m²/s. is the share of the gap to the neighbours that closes in one step. The explicit update is . The coefficient on is . Past it turns negative, so a node overshoots its neighbours instead of settling between them. The fastest zig-zag pattern is multiplied each step by : at , at and at . Anything with size above 1 grows.
Start with a spike of 100 in the middle node and both ends held at 0. This pure-Python code runs 10 steps:
def explicit(T, r): # use the current numbers only: this is the fvc idea
return [0] + [T[i] + r * (T[i-1] - 2*T[i] + T[i+1]) for i in range(1, len(T) - 1)] + [0]
def implicit(T, r): # solve all nodes together: this is the fvm idea (Thomas algorithm)
n = len(T) - 2 # (1+2r) Tnew_i - r Tnew_(i-1) - r Tnew_(i+1) = T_i
c, d = [0.0] * n, [0.0] * n
for i in range(n): # forward sweep
m = (1 + 2*r) + (r * c[i-1] if i else 0)
c[i] = -r / m
d[i] = (T[i+1] + (r * d[i-1] if i else 0)) / m
x = [0.0] * n
for i in reversed(range(n)): # back substitution
x[i] = d[i] - (c[i] * x[i+1] if i < n - 1 else 0)
return [0] + x + [0]
for scheme, step, r in [("explicit", explicit, 0.4), ("explicit", explicit, 0.5), ("explicit", explicit, 0.6), ("implicit", implicit, 0.6), ("implicit", implicit, 5.0)]:
T = [0, 0, 0, 0, 100, 0, 0, 0, 0] # 9 nodes, both ends held at 0, a spike of 100 in the middle
for _ in range(10):
T = step(T, r)
print(f"{scheme} r={r}: max {max(T):.2f}, min {min(T):.2f}")It prints:
explicit r=0.4: max 13.42, min 0.00
explicit r=0.5: max 22.66, min 0.00
explicit r=0.6: max 378.27, min -331.54
implicit r=0.6: max 10.53, min 0.00
implicit r=5.0: max 0.09, min 0.00At the spike spreads smoothly. At the zig-zag no longer fades, and the peak is 22.66 against 13.42 at . At the answer swings between 378.27 and −331.54 after only 10 steps, from a start of 100. Heat cannot go negative, so that is the scheme failing. The implicit step at behaves like the smooth case (10.53), and at , ten times the step, it still gives a sensible 0.09. Stable does not mean accurate. A huge implicit step is safe, but it smears detail.
Turn it into units with assumed values: m²/s (a round number, not a material) and m. Then s. Halve the spacing to 0.005 m and the limit falls to 0.125 s, 4 times smaller. In 1D you also have twice the nodes, so 8 times the work for the same end time. In 3D it is 8 times the cells and 4 times the steps, 32 times the work.
This is why Weeks 6 and 12 matter. Week 6 covers the CFL stability condition, and Week 12 covers forward and backward Euler and Crank-Nicolson. Skill-Lync already has this limit worked in 2D in the 2D heat conduction solver, and the transient diffusion chapter of the Computational Fluid Dynamics book compares the three schemes.
Every OpenFOAM field carries seven exponents, one each for kg, m, s, K, mol, A and cd. Adding two fields whose exponents differ is a run-time error, so a mistyped equation stops instead of giving a wrong answer. You can run the same check by hand on the transport equation.
It is the unit check from physics class, done by the program. You cannot add metres to seconds, and OpenFOAM will not add a rate of change to a velocity. In the OpenFOAM v12 source the exponents are stored in the order mass, length, time, temperature, moles, current, luminous intensity. A temperature file therefore says [0 0 0 1 0 0 0]. The shipped etc/controlDict sets the dimensionSet debug switch to 1, and with it on, adding mismatched sets aborts with the message "LHS and RHS of + have different dimensions".
Check that the ddt and laplacian terms agree, and look at pressure:
# exponents of [kg, m, s, K, mol, A, cd]: the order of OpenFOAM's dimensionSet
def mul(a, b): return tuple(x + y for x, y in zip(a, b))
def div(a, b): return tuple(x - y for x, y in zip(a, b))
T, t, L = (0,0,0,1,0,0,0), (0,0,1,0,0,0,0), (0,1,0,0,0,0,0)
DT = (0,2,-1,0,0,0,0) # diffusion coefficient, m^2/s
ddt_T = div(T, t) # dT/dt
lap_T = mul(DT, div(T, mul(L, L))) # DT * laplacian(T)
print(ddt_T, lap_T, ddt_T == lap_T)
p, rho = (1,-1,-2,0,0,0,0), (1,-3,0,0,0,0,0) # pressure in Pa, density in kg/m^3
print(div(p, rho)) # kinematic pressure, as in the cavity 0/p file
print(f"100 Pa in air (assumed 1.2 kg/m3) = {100 / 1.2:.2f} m2/s2")
print(f"lid dynamic pressure 0.5 U^2 = {0.5 * 1.0**2} m2/s2 = {0.5 * 1.0**2 * 1.2:.1f} Pa")It prints:
(0, 0, -1, 1, 0, 0, 0) (0, 0, -1, 1, 0, 0, 0) True
(0, 2, -2, 0, 0, 0, 0)
100 Pa in air (assumed 1.2 kg/m3) = 83.33 m2/s2
lid dynamic pressure 0.5 U^2 = 0.5 m2/s2 = 0.6 PaBoth terms come out as K/s, [0 0 -1 1 0 0 0], so they can be added. The pressure line shows a quirk. Pressure in pascals has exponents for kg, m and s. Dividing by density leaves , which is m²/s². That is exactly what the cavity tutorial's 0/p file declares. Incompressible solvers work with kinematic pressure, pressure divided by density, so the number in the file is not in pascals. The source even has a named set for it, dimKinematicPressure.
The 100 Pa and the air density of 1.2 kg/m³ are assumed values for illustration. The practical lesson is that a kinematic pressure of 83.33 m²/s² and a pressure of 100 Pa describe the same pressure in different units. Mixing the two in one equation is the bug that the dimension check exists to catch. The syllabus covers scalars, vectors and tensors in Week 5, and one lesson title in the course is "OpenFoam Development Session on Fields and Dimensions". We describe it by its title only.
The OpenFOAM v12 cavity tutorial is a 0.1 m box with a 1 m/s lid, a 20 × 20 mesh and a 0.005 s time step. Its Reynolds number is 10,000, its diffusion number is 0.002 and its convective Courant number is 1, so convection sets the step.
The Reynolds number is , the push of the flow against the drag of the fluid. The Courant number is , the number of cells a signal crosses in one step. The diffusion number is the from the last answer, with in place of . The values below are read from the v12 tutorial files: the vertices in blockMesh scaled by 0.1, 0/U with a lid of (1 0 0), nu of 1e-05 in physicalProperties and deltaT 0.005 in controlDict.
L, U, nu, n, dt = 0.1, 1.0, 1e-5, 20, 0.005 # cavity tutorial, OpenFOAM-12
dx = L / n
print(f"Re = {U * L / nu:,.0f}, dx = {dx} m, cells = {n * n}")
print(f"convective number U dt/dx = {U * dt / dx:.3f}")
print(f"diffusion number nu dt/dx^2 = {nu * dt / dx**2:.4f}")
print(f"explicit diffusion limit dt = {0.5 * dx**2 / nu:.2f} s")
print(f"explicit convection limit dt = {dx / U:.4f} s")It prints:
Re = 10,000, dx = 0.005 m, cells = 400
convective number U dt/dx = 1.000
diffusion number nu dt/dx^2 = 0.0020
explicit diffusion limit dt = 1.25 s
explicit convection limit dt = 0.0050 sIf this case were solved explicitly, diffusion would allow a step of 1.25 s, 250 times the tutorial's, while convection would allow only 0.005 s. The tutorial uses exactly that. Convection is the tighter limit here, because the viscosity is small compared with .
Two cautions. The Courant number of 1 uses the lid speed, the fastest speed in the box, so real cells sit below it. And the time scheme in the case is Euler, which OpenFOAM's source describes as Euler-implicit, so 1 is a guide for accuracy, not a cliff edge like for the explicit step. v12 also runs this case with the k-epsilon model switched on, so a Reynolds number of 10,000 does not mean it is run as laminar. The older laminar icoFoam cavity, still shipped in v12 under tutorials/legacy, uses the same box and step with nu 0.01, so its Reynolds number is 10 and its diffusion number is 2: there the diffusion limit is the tighter one for an explicit step. Our Courant number calculator does these sums for other cells and can read the maximum Courant number from a solver log.
It is 12 weeks of C++ and finite volume theory for OpenFOAM, recorded as 52 sessions of about 18 hours, with 4 projects. The tools are OpenFOAM, Paraview and Visual Studio Code. It goes from installing OpenFOAM, through C++ and OpenFOAM's classes, to the finite volume method, linear solvers and turbulence models.
The 4 projects are Creating Scalar Form (build a solver and its cases), Discretization Schemes (diffusion and convection cases with changing diffusion coefficient or velocity), Creating icoTempFoam (add a temperature equation to icoFoam) and Function Objects (total pressure from a coded function object, written up in LaTeX).
Only lessons 1 to 3 are free, on the free lesson page. We describe the other lessons by their titles, such as "Understanding Object Registry in OpenFOAM" and "Constructing a Custom Turbulence Model in OpenFOAM". The course is part of the Post Graduate Programs in CFD and in CFD Solver Development. The OpenFOAM hub lists the related courses, and the table at the end compares them.
Our records cannot show it for this course. As of 24 Nov 2026, none of Skill-Lync's 3,905 placement records names this course or an OpenFOAM or solver-development program, and none has OpenFOAM in the job title. The nearest signal is CFD job titles.
These are CFD roles, not OpenFOAM developer roles, and they are not outcomes of this course. Our data cannot say how many of those jobs use OpenFOAM or involve writing solver code. The sample is self-reported by learners, covers 2019 to 2026, and is mostly 2021 to 2023 starting offers (136 of the 157).
So read this course as a skill. A solver you wrote and a project report in LaTeX are things you can show, and the four projects are the portfolio pieces. The fees and the wider program are on the course pages in the table below.
| Course | Length | Projects | Tools | Fee |
|---|---|---|---|---|
| Introduction to OpenFOAM Development (this page)C++ solver development inside OpenFOAM | 12 weeks, 18 h | 4 | OpenFOAM, Paraview, Visual Studio | ₹40,000 |
| Introduction to CFD using MATLAB and OpenFOAMCFD basics in MATLAB, then OpenFOAM | 12 weeks, 13 h | 4 | MATLAB, OpenFOAM, Octave | ₹40,000 |
| Advanced CFD using OpenFOAMRunning CHT, VOF, combustion cases in OpenFOAM | 12 weeks, 18 h | 2 | OpenFOAM | ₹40,000 |
| PG Program in CFD Solver DevelopmentPG program that includes this course | 12 weeks, 119 h | 21 | Python, Cantera, OpenFOAM, CONVERGE, Paraview, MATLAB, Octave, Visual Studio, ANSYS Fluent | ₹2,75,000 |
| PG Program in Computational Fluid DynamicsPG CFD with Python, CONVERGE and Fluent | 48 weeks, 125 h | 28 | ANSYS Fluent, SpaceClaim, CFD Post, CONVERGE, Paraview, MATLAB, OpenFOAM, Octave, GT POWER, GT-SUITE, ANSA, ICEM CFD, Visual Studio | ₹2,75,000 |
| Turbulence and RANS ModellingTurbulence and RANS models in depth | 12 weeks, 20 h | 2 | ANSYS Fluent, Python | ₹40,000 |
Lengths, projects and fees are taken from each course page on 24 Nov 2026; fees are the Premium plan in INR, including all charges.
Become job ready with our comprehensive industry focused curriculum for freshers & early career professionals
A counsellor will walk you through the syllabus, projects and fee options — and tell you honestly if another course suits you better.