Computational Fluid Dynamics Modeling: Use the Right Algorithm for Your Application.
The field of computational fluid dynamics modeling has a lot of jargon associated with it, and with new developments coming along every year, that's not going to change any time soon. Making sense of it all can be a challenge, even for experienced CFD practitioners. One issue that I think is often overlooked by less experienced engineers is the influence of the discretization method used by your solver on your results.
What is a discretization method?
The vast majority of the computational fluid dynamics modeling applications that I'm aware of can safely assume that the flow being modeled takes place in a continuum and that the Navier-Stokes equations apply. We don't actually solve on a continuum, however. Instead we break it up (i.e. discretize it) into small chunks (via a computational grid) and solve on that instead. Then, instead of solving the continuous governing partial differential equations, we create approximate, discretized versions, and solve those.
There are many different ways to discretize the governing equations. The jargon can get pretty thick.
- There are the different approaches to discretizing spatial volumes: finite difference, finite volume, and finite element.
- There are the different approaches to grid topology: structured, generalized unstructured, unstructured Cartesian, etc.
- Then there are the various tactics used to discretize the inviscid terms: central schemes, upwinding, flux vector splitting, flux-difference splitting, ENO, WENO, etc.
- And then there is the “order” of the scheme: typically second order, but I've seen as high as sixth used in production codes.
The goal of all the different methods is the same, however: we want to turn a calculus problem (that we can't solve) into an algebra problem (which we can solve). Inevitably, in the process, some error is introduced. But how much? Does it matter?
Does order of accuracy matter?
Most production solvers these days for general purpose CFD (especially steady state RANS applications) use a second order scheme of some sort. From what I've seen, most engineers, unless they've really dug into numerical methods, just use the default method, take the results, and write the report. Code developers pick default methods to be as generally applicable as possible, so the approach works a lot of the time.
But the computational fluid dynamics modeling approach you use can have a huge impact on your solution. To illustrate this, I've run the same unsteady axi-symmetric jet problem with the same code (Wind-US), using the same HLLC approximate Riemann solver, and using the same time-marching algorithm, turbulence model, boundary conditions, etc. The only difference between the solutions is the order of interpolation used to compute the fluxes at cell faces.
First Order Results
Below is a snapshot of (non-dimensional) temperature in the flow at 5 milliseconds after the start of the simulation. The low-temperature fluid in the jet is at the bottom of the plot (the bottom of the plot corresponds to the centerline of the jet). This first plot is from the simulation which used a first order method in space. Even though the code is being run in time-accurate mode, you can see that not a lot of unsteadiness is present in this run. But should there be?
If you didn't know that this configuration was specifically designed to pulse, you might take these results and show them off to the boss...and then have the experimentalists laugh at you when the tunnel data comes back. Okay, maybe they wouldn't laugh out loud, but don't you just hate that smug look? Better try something different first.
Second Order Results
In this next plot you can see the results from a run with a second order scheme. Obviously, a lot more is happening in this simulation. If the frequency content of the oscillations checked out against the design conditions, this might be good enough to work with. But what is the effect of using an even higher order computational fluid dynamics modeling approach?
Third Order Results
When the same case is rerun with a third order spatial scheme, we get still a different result. In this case, there isn't such a dramatic difference in the character of the solution (as between the first and second order results), but the temperature peaks that are showing up where vortices are entraining the co-flow into the jet look a little suspicious. Just because a computational fluid dynamics modeling algorithm is “higher-order” doesn't mean it's always more accurate. In this case, the second order scheme takes into account the stretching in the computational grid, but the third order scheme does not. Maybe that gives it an advantage that “higher order” alone can't overcome.
Fifth Order Results
The final plot shows the results from a fifth order scheme. Compared to the lower order results, this method is obviously resolving a lot more unsteadiness in the flow. Those bothersome temperature spikes are still present, but they are smaller, and depending on what you are looking for, maybe the added details that are being captured elsewhere make up for it.
Keep in mind that the above examples were just some quick simulations I threw together to illustrate the point that the algorithms your CFD code uses can have a huge impact on the solution. The plots show that, depending on the problem and your choice of numerical methods, you can wind up with radically different results.
That does not mean, however, that CFD is hopelessly unreliable. Nor should you conclude that because there were some anomalies in the higher order results, that you should never use any higher order scheme. For one thing, there are many different ways of doing “higher order”...the computational fluid dynamics modeling approaches used here are just one possibility.
The Bottom Line
You have to make sure that you are using an appropriate method for the particular configuration you are investigating. Used properly, modern CFD solvers (using a wide variety of methods) can yield remarkably accurate predictions. The more you know about the strengths and limitations about the computational fluid dynamics modeling methods at your disposal, the better your ability to get good results.
If you have specific questions about CFD modeling and how it might help address your needs,
When you are ready, you can explore
more tips on computational fluid dynamics modeling at the CFD tips and tricks page
Or, return to the
Innovative CFD home page