Want a Top-Notch Free CFD Solver?

It seems a lot of people are looking for free CFD solvers these days. Whether it's a business looking to cut costs or an individual looking to develop new skills without having to take out a second mortgage, quality CFD packages that are freely available are sought after commodities.

Velocity magnitude in a cross-section of the OpenFOAM throttle3D demo

For residents of the United States, there are often quality government-sponsored free CFD solvers available. Likewise, I understand that similar codes are available for European organizations. Such software is “free” in the sense that it does not cost the users any money (if they are eligible to use it at all), but there are typically restrictions on its use.

There are a few CFD codes, however, which are both free (as in no cost) and also open (as in, anyone can use it, and you can give it to anyone else). Of these, OpenFOAM is, in my opinion, the most advanced. With an active and growing community of users and developers, this free CFD tool seems well on its way to giving the commercial vendors a serious run for their money.

A Library of Building Blocks for CFD

As the OpenFOAM User Guide puts it: "OpenFOAM is first and foremost a C++ library, used primarily to create executables, known as applications." The distribution comes with numerous pre-built solvers for a huge variety of physics. It also comes with the tools needed to assemble your own, customized solver.

In addition to the solvers, the distribution includes a wide array of utilities for pre- and post-processing. With these free CFD tools, it is possible to conduct a full analysis from beginning to end using only the tools provided by the OpenFOAM distribution.

Grid Generation and Handling

OpenFOAM solves partial differential equations on an unstructured mesh. Included in the distribution are two tools which allow you to generate your own meshes: blockMesh and the newer snappyHexMesh.

blockMesh is useful for creating meshes for simple configurations, but was limited in its ability to address more complex geometries. The snappyHexMesh utility, which was introduced with version 1.5 (July 2008) adds significantly more capability.

For those who already have a mesh generation capability (or if someone else is building meshes for you), OpenFOAM comes with numerous utilities to convert existing meshes to its native format:

  • ansysToFoam Converts an ANSYS input mesh file, exported from I-DEAS, to OPENFOAM format
  • ccm26ToFoam CCM mesh converter using CCM version 2.6 library
  • cfxToFoam Converts a CFX mesh to OPENFOAM format
  • fluentMeshToFoam Converts a Fluent mesh to OPENFOAM format including multiple region and region boundary handling
  • gambitToFoam Converts a GAMBIT mesh to OPENFOAM format
  • gmshToFoam Reads .msh file as written by Gmsh
  • ideasUnvToFoam Converts meshes from I-DEAS .unv format to OPENFOAM format
  • kivaToFoam Converts a KIVA3v grid to OPENFOAM format
  • mshToFoam Reads .msh format generated by the Adventure system
  • netgenNeutralToFoam read Neutral file format as written by Netgen4.4
  • plot3dToFoam Plot3d mesh (ascii format) converter
  • sammToFoam Converts a STAR-CD SAMM mesh to OPENFOAM®format
  • starToFoam Converts a STAR-CD PROSTAR mesh into OPENFOAM format
  • tetgenToFoam Reads .ele and .node and .face files as written by tetgen

As you can see, there are a lot of ways to get a grid set up for OpenFOAM

Post-Processing Made Easier

For post-processing, the distribution comes with a version of ParaView. This visualization package was orignally developed by Kitware, Sandia National Laboratories, Los Alamos National Laboratories, and others. The version that comes with OpenFOAM has been slightly modified to enable it to read the native OpenFOAM files.

ParaView is a very capable visualization package, but I'm so used to using FieldView that I usually make use of the handy conversion utility to create FieldView unstructured format files. Other utility codes can convert the results to Fluent, Ensight, GMV, or VTK formats.

Solve Almost Anything

The 50+ pre-built applications that are shipped with OpenFOAM version 1.5 cover a vast range of applications. At the low end, there is “laplacianFoam” which solves a simple Laplacian equation. At the other end, there are application like “PDRFoam,” which is described as a “compressible premixed/partially-premixed turbulent combustion solver that includes porosity/distributed resistance(PDR) modeling to handle regions containing solid blockages that cannot be resolved by the mesh.”

Out of the box, this free CFD solver provides applications which address fluids applications of all sorts: incompressible flow, compressible flow, multiphase flows (compressible and incompressible), steady-state Reynolds-averaged Navier-Stokes (RANS) solvers, Large Eddy Simulation (LES), Direct Numerical Simulation (DNS), combustion, and heat transfer. It doesn't stop there, however. Because OpenFOAM is a library of routines for solving partial differential equations, various people have contributed applications which address all sorts of physics. There is, for example, an electrostatics solver. There are several flavors of code for the stress analysis of solids. There are molecular dynamics simulators and even a solver for the Black-Scholes equations for commodity pricing.

And, if you can't find a pre-built solver to meet your needs, you have the source code and all the required tools for building your own, customized application. Compared to writing your own code from scratch, the OpenFOAM library functions make it remarkably simple to create a solver. That's not to say there is no learning curve, but I would estimate an order of magnitude speed-up in application time for most situations.

One thing to note is that, for the moment, OpenFOAM is somewhat better suited for incompressible and lower speed flows. That is changing however, as various groups are adding the technology to enable more efficient solution of compressible flow.

Free and Open Source Software

One of the best things about OpenFOAM is that it is released under the GNU Public License. Many readers of this page will already know about "Free" and "Open Source" software, but for those that don't, here are the core issues:

  • You must be given access to the source code
  • You can take the software anywhere and do whatever you like with it
  • You can pass it on to anyone
  • The people you give it to have the same rights as you were given

A Growing User Community

The OpenFOAM community is active and growing by leaps and bounds. I recently attended the 3rd Annual OpenFOAM Workshop in Milan, Italy. There were over 200 attendees from all around the world representing industries and applications from concrete to automotive to biomedical to high speed aerospace.

If your organization could use high-quality open and free CFD tools, then it is well worth your while to investigate OpenFOAM.

If you are finished reading about OpenFOAM, you can return to the free CFD solver reviews page

Alternatively, you can return to the Innovative CFD home page and browse the other topics.

As always, if you have any questions, comments, suggestions, or corrections about OpenFOAM or any other free cfd solver, please contact me and let me know.

New! Comments

Have your say about what you just read! Leave a comment in the box below.