By Kelly Senecal
If you run computational fluid dynamics (CFD) simulations, I’m guessing your workflow goes something like this: You make a mesh, run the calculation, look at the results, and then wonder whether the results would change if the mesh were modified. With project deadlines looming, it is impractical to consider recreating the mesh to examine how the solution would differ with resolution.
Does this sound familiar? If so, you may be at the mercy of the mesh.
My first experience making a complicated mesh was in graduate school. I remember spending hours, days, even weeks structuring cells such that the overall mesh conformed to the strict rules of the CFD solver. When I finally finished, I felt an enormous sense of accomplishment — and relief. With this relief, however, came big uncertainty: Did I have resolution in the correct places? Was I anywhere near the point of grid convergence? Admittedly, I didn’t know the answer to these questions. I was at the mercy of the mesh.
There’s a school of thought that it’s necessary to be this way, that making a mesh by hand is essential to achieving an accurate solution. Think about that for a moment. If you know where the mesh resolution should go ahead of time, then you must already know what the flow solution looks like. But if you already know what the solution looks like, why do you need to run the simulation?
The truth is that guessing where resolution should go ahead of time is quite challenging, even impossible for most cases. In a 2004 Stanford workshop, Professor Wagdi Habashi of McGill University stated that to achieve mesh independence, we “cannot let the user decide where to generate and concentrate points.” He also indicated that “a mesh that is good for a flow condition can be shown not to be as good for a different condition, for the same geometry.” (Author’s Note: For more details on Habashi’s presentation, do an online search for the phrase “meshing by guessing.”)
My graduate school meshes took a long time to generate and had no guarantee that they would correctly resolve the flow for the cases that I threw at them. Unfortunately, similar meshes still show up today, particularly in the combustion community.
How do we escape being held at the mercy of the mesh? We stop making meshes. New technologies make it easier than ever to simulate complicated flows with CFD.
For example, mesh-free methods remove the requirement of connecting points to represent a simulated volume. One of the oldest mesh-free methods, smoothed-particle hydrodynamics (SPH), predicts a flow field by calculating the motion of a set of particles. In some cases, mesh-free methods have been successfully applied, but fortunately it’s also now possible to use the concept of a traditional mesh without having to make it ahead of time. This is what I refer to here as “automated meshing.”
Automated meshing means different things to different people. Some automatic mesh generators literally cut corners and sacrifice accuracy for gains in efficiency. Other approaches aren’t really fully automated or suffer from conservation issues. Such techniques may be adequate for running quick and dirty CFD, but the automated meshing to which I’m referring represents the geometry exactly, is truly automated, and conserves perfectly.
This is accomplished by intimately connecting the mesh and the flow solver. The connection is so tight, the solver actually creates the mesh at runtime. Just imagine how much time you would save if you didn’t have to create meshes!
As if that wasn’t enough, runtime grid generation typically gives you a better mesh than what you would have gridded by hand. This is made possible through a process called adaptive mesh refinement (AMR), in which the mesh responds to feedback from the flow. As a result, the mesh is optimal at every time-step, in every portion of the flow domain.
Runtime mesh generation with AMR is a fundamental change in how CFD is done — a paradigm shift that has been successfully used in applications ranging from internal combustion engines to curveballs, from gas turbines to wind turbines. It’s a shift that is giving engineers more time to focus on the task at hand.
Kelly Senecal is a co-founder and owner of Convergent Science, Inc., developers of the CONVERGE CFD solver.