Misconceptions about OpenFOAM, Open Source CFD
In fields like artificial intelligence and big data, there are numerous open-source codes and they are widely utilized. However, despite the abundance of open-source resources in the field of computational fluid dynamics (CFD), most industries in Korea still use commercial programs. Why is this? CFD, which involves computing the Navier-Stokes equations, the governing equations of fluid dynamics, using the finite volume method, is a long-established field of study that doesn’t require the continuous adoption of cutting-edge technologies. (Of course, many academic challenges remain, and cutting-edge technologies are being developed, but this is a key issue in industrial applications.) Despite this, I believe the lack of open-source code adoption stems from misunderstandings about it. Therefore, I’d like to focus on OpenFOAM, a representative open-source code.
Open Source CFD Toolbox?
The OpenFOAM Foundation and ESI’s websites introduce themselves as “OpenFOAM is free, open source software for CFD.” Previously, they often used logos that included the term “CFD Toolbox,” as shown below, but this term seems to be less common these days. “Toolbox” connotes a tool for users to create the solvers they need, while “solftware,” while comprehensive, emphasizes the idea of a “solution.” I think the Foundation and ESI are trying to shed some of the “toolbox” connotation.
OpenFOAM has two aspects: toolbox and solution.
Industry organizations often view OpenFOAM solely as a solution, feeling it lacks certain features. Key issues include the instability of some solvers and the lack of a CLI (Command-Line Interface). However, as a toolbox, it allows users to customize solvers, interfaces, and other components as needed. This can be done through in-house development, collaboration with specialized organizations, or even by adopting publicly available tools. They should assess whether OpenFOAM is a sufficient solution for their intended application and plan how to address any shortcomings.
Misconceptions about cost
The most obvious benefit of open source software is that it’s free. This seems obvious and requires no further explanation, but I believe it’s important to address a common misunderstanding.
There’s a difference between open source and freeware. “Free” in “open source” means “free,” while “free” in “freeware” means “free of charge.” Open source software is about being open, not about being free. Most open source software is free to use, though. However, switching from paid commercial software to open source software doesn’t save you as much as the cost of the commercial software.
The price of a commercial program (the annual rental price) is not only the cost of the right to use the program, but can be seen as consisting of four major components, and no one knows how much each of them costs.
- Cost of using the program – per number of concurrent users and per CPU core for parallel computing
- Maintenance – Service costs for support for program installation and troubleshooting in case of problems.
- Technical Support – Service fees for training on how to use the product and assistance with technical issues.
- Program Upgrade – It seems like they just upgrade during the contract period, but it is included in the price.
These four are all necessary for efficient use of industrial or CFD programs. However, many people mistakenly believe that the first one is all they need, leading to the misconception that open-source software is free. The subscription contract for an open-source program can be seen as a cost excluding the first one. Misunderstanding this can lead to the adoption of open-source software actually incurring higher costs. While licensing costs may be reduced slightly, the time required by engineers significantly increases, resulting in a loss.
Open source software isn’t always free. While downloading and using a version published on GitHub or the web is free, there are cases where modified versions must be purchased or project development costs must be incurred. However, even with paid licenses, you still receive access to the source code, so there are no restrictions on the number of concurrent users or cores for parallel computing. This provides a cost advantage over commercial software, and for large-scale HPC applications with large user bases or computational demands, the cost advantage becomes significant.
In conclusion, effective utilization of open source software can significantly reduce costs. However, poor strategy can also lead to losses, so it’s essential to consider a certain level of initial investment (employee time investment or collaboration with external organizations).
Misconceptions about performance
Along with cost, a common misconception is performance. When open-source programs are considered free, the common adage “cheap is expensive” often leads to the assumption that performance will be inferior. To be clear, open-source programs are not inherently less performant than commercial programs.
When considering performance, the first thing to consider is the available physics models. From the perspective of its ability to analyze diverse physical phenomena, such as turbulence, multiphase flow, chemical reactions, and noise, OpenFOAM offers a wealth of functionality over commercial codes. Considering not only the versions of OpenFOAM released by ESI, the OpenFOAM Foundation, the Extend group, and Nextfoam, but also the source code developed and released by organizations and individuals, the overall functionality is far greater.
The next issue to consider is code accuracy and stability. These are not separate issues, but rather a complex one, intertwined with the quality of the grid. Most codes produce reliably accurate results on high-quality grids. The moment you add something to the code for stability, you introduce the possibility of accuracy issues, so the decision to use them is a matter of user choice. Commercial codes are said to be able to compute even on very low-quality grids. However, in these cases, it’s often faster to simply re-mesh to obtain results, as numerous additional tests are required to determine if the results are satisfactory. On the other hand, some OpenFOAM solvers have stability issues, likely due to their design failures. In these cases, the solvers need to be improved. NextFOAM solvers are designed with greater consideration for stability than the standard OpenFOAM solvers.
The next question is how fast the code is. The time it takes for one iteration and the number of iterations required to converge determine the computational time. While this varies slightly depending on the grid conditions and solver, it doesn’t seem to make a significant difference. However, OpenFOAM has the advantage of not having license-based core count restrictions for parallel computing, allowing for much faster calculations on a good computer.
Ease of use
OpenFOAM’s biggest issue is likely its usability. C++, Linux, and the Text User Interface (TUI) are the most common complaints. While C++ is acceptable for non-code developers, Linux is not widely used, and the TUI is certainly inconvenient. To address the Linux and TUI issues, many OpenFOAM-based solutions, including Nextform’s BARAM, exist. While some argue that these solutions lack the usability of commercial programs, this is often a matter of familiarity, not convenience. Nothing is more convenient than a program you’re already familiar with. You can’t start something new without abandoning what you’re used to.
Most commercial programs are designed to be general-purpose, capable of solving any problem. However, industrial companies often only need to solve their own products, so their usage can be unnecessarily complex. Developing product-specific interfaces and processes can make them much easier to use, making them accessible even to non-CFD experts.
Is it difficult to learn?
Many people say OpenFOAM is difficult to learn. Even familiar commercial programs weren’t always easy when you first learned them. After a while, things that happened before often seem easy. Still, OpenFOAM can feel quite daunting at first, and I think the source code is a contributing factor. Even with GUI-based programs like BARAM, you still feel like you need to know the source code, which makes it seem like there’s still a long way to go. While commercial programs can be used to write code using user-defined functions, learning these functions in commercial programs can be just as challenging as OpenFOAM. There’s also a misconception that commercial code can receive technical support from vendors, while open-source programs can’t. OpenFOAM also offers technical support for a fee.
Time required to utilize it for work
The significant time required to fully utilize open source software in your work should be understood as a reflection of the initial investment discussed in the “Cost Misconceptions” section above. Depending on your strategy, subsequent work efficiency can be significantly improved. Furthermore, considering the effort and time required to secure a budget for commercial software purchases, this timeframe may actually be shorter.
I hope that you’ll develop a good strategy in the CFD field and increase the use of open source. Thank you.