Combine High-fidelity Modeling with Productive Workflows Using OpenFOAM and CMB

The CMB wind tunnel application has a customized user interface (left side of this screenshot) and 3D display for input geometry, reference geometry, and solution data.

In the world of computational simulations, efficiency and flexibility are crucial. Kitware’s open source platform, Computation Model Builder (CMB), is designed to streamline every step of the simulation process, from setting up models to analyzing results. As an example, while OpenFOAM remains a powerful tool for computational fluid dynamics (CFD), integrating it with CMB elevates productivity by providing an intuitive, flexible workflow. With CMB, users can efficiently manage complex simulations, automate tasks, and make adjustments on the fly, all within a cohesive interface. This synergy allows engineers and researchers to focus more on innovation and less on the technical hurdles, ensuring that high-quality modeling doesn’t come at the cost of time or ease of use.

In this article, we are going to explore how CMB and OpenFOAM work together by walking you through a hands-on example of a wind tunnel simulation. For a broader look at how CMB is transforming simulation workflows, check out our recent article, “CMB: The Tool You Need to Efficiently Build Your Simulation Workflows.

The CMB wind tunnel application has a customized user interface (left side of this screenshot) and 3D display for input geometry, reference geometry, and solution data.
The CMB wind tunnel application has a customized user interface (left side of this screenshot) and 3D display for input geometry, reference geometry, and solution data.

The Formula for Seamless Simulation Workflows

Simulation workflows typically involve three major stages:

  • Preprocessing—Preparing a computer model for simulation, which includes creating the geometric domain, creating a computation mesh from the geometric domain, specifying the conditions at each boundary surface, defining the initial state of the system, assigning physical properties to fluids and other materials, specifying solver algorithms, and selecting the appropriate time step size.
  • Computation—Using computer processing to calculate the solution variables (pressure, velocity, etc.) through mathematical approximation of partial differential equations at each point in the discretized geometry (mesh) at each time step.
  • Postprocessing—Analyzing and visualizing the results obtained from computer processing to produce meaningful information from the raw numerical data.
Most simulation workflows are carried out in three major stages or steps: preprocessing, computation, and postprocessing. Our wind tunnel example uses CMB for pre- and postprocessing and OpenFOAM for computation.
Most simulation workflows are carried out in three major stages or steps: preprocessing, computation, and postprocessing. Our wind tunnel example uses CMB for pre- and postprocessing and OpenFOAM for computation.

Unfortunately, the commercial CFD tools that include all three of these stages in one integrated package can be expensive and result in vendor lock-in. CMB offers the best of both worlds—an integrated system without constraints.

As an example, we developed a custom interface tailored for wind tunnel simulations, simplifying the setup with form-based inputs, real-time syntax checking, and interactive widgets. This means you no longer have to wrestle with text files; CMB does the heavy lifting, generating error-free OpenFOAM input files for you.

Download our wind tunnel simulation application and follow along! Download Now

Into the Tunnel: Using CMB for Complex Simulations

A Seamless, Visual Experience

With CMB, you can organize input fields into easy-to-navigate tabs—like “model import” and “mesh refinement”—and include a 3D viewer, allowing you to visualize your geometry every step of the way. You can see the wind tunnel, mesh refinement zones, and more, giving you full control and clarity over your simulation setup.

Example of the tab-based organization of the wind tunnel workflow.
Example of the tab-based organization of the wind tunnel workflow.

When it’s time to run the simulation, CMB’s control view lets you execute OpenFOAM tasks with just one click. We’re leveraging Docker to provide a containerized version of OpenFOAM (https://hub.docker.com/u/opencfd), so there’s no need to worry about installation or version compatibility. This means you can jump straight into the action, regardless of your system setup.

From Raw Data to Informative Visuals with ParaView

When the simulation is completed, it’s time to analyze the results. CMB integrates ParaView, allowing you to visualize data in 2D and 3D, apply filters, and explore every aspect of your wind tunnel simulation. Whether you’re looking at flow paths, contours, or isosurfaces, ParaView helps transform your data into insights.

Bringing It All Together with CMB’s Flexibility

The true power of CMB is its flexibility. We were able to quickly build this wind tunnel application by defining variables in XML template files, allowing CMB to generate the entire user interface. Python scripts handle the data processing and file generation, while C++ code powers the control view for running OpenFOAM tasks. This modular approach means you can easily adapt or expand the application for different simulations—giving you full control over your workflow. The one feature we implemented with C++ code is the control view for running OpenFOAM executables and displaying the results as shown below.

With this control view, users can run OpenFOAM executables for each task making up the workflow, and display the resulting data.
With this control view, users can run OpenFOAM executables for each task making up the workflow, and display the resulting data.

We were then able to reuse this C++ component in a second CMB/OpenFOAM application, which we will describe in a future article. Make sure you subscribe to our blog so you don’t miss it!

See for Yourself!

Ready to experience this powerful combination of CMB and OpenFOAM? You can download and try our wind tunnel simulation application. While using the demo, we hope you will begin to imagine how CMB can be applied to your simulation workflows. Contact us if you would like to discuss your workflows with our team.

Leave a Reply