How smoothed particle hydrodynamics compares to other CFD methods.
Gears might be one of the most important inventions ever made. But they have a problem. Without proper lubrication or with too much force you will turn that gear into a wheel. As a result, a lot of computational fluid dynamics (CFD) simulations end up testing gear boxes for how well they lubricate themselves in a bath of oil.
Unfortunately, the moving gears are hard to simulate in CFD. It traditionally needs the use of complex overlapping and rotating meshes that take a considerable amount of time to create. To simplify this method, engineers can use smoothed particle hydrodynamics (SPH) to eliminate the need of that pesky mesh.
Gear lubrication simulations. (Image courtesy of FluiDyna.)
FluiDyna is a german-based company that provides a wide range of research and development services, particularly in the area of CFD consulting, software and GPU-accelerated computing. Altair has recently invested in FluiDyna by acquiring shares. Users of the Altair product HyperWorks have access to nanoFluidX by using their token-based license, HyperWorks Units (HWU).
Solving CFD without a Mesh? How nanoFluidX Works.
Eulerian’s static frame.
Lagrangian moving frame.
NanofluidX is a particle-based simulation solver that uses the SPH method. What makes the solver stand out is that it doesn’t need a mesh to solve a CFD problem. This makes the solver ideal for complex flows or designs with arbitrary geometries, such as gears in an oil bath.
“SPH is a Lagrangian numerical method, the main difference to Eulerian methods [is that] instead of selecting a finite volume or finite element and tracking what goes in and out, we rather discretize a part of the fluid as particles and track its movements in time,” said Miloš Stanić, product manager of SPH software at FluiDyna. “This gets rid of the convection term in the Navier-Stokes equation and makes it easier to calculate numerically.”
In other words, the fluid and all the solids are replaced with particles. The movements of these particles interact with each other and help to define the properties and motions of the particles around them. The mesh is therefore replaced with particles.
“The main idea is to approximate and reconstruct any property in a continuum by integrating it over a volume and multiplying it by an interpolation function called the kernel function,” Stanić elaborated. “You interpolate through the kernel function the influence of the neighboring particles on the owner particle and advance that in time. We can reconstruct the property of the owner particle from an arbitrary distribution of its surrounding neighboring particles. Because of that, the particles are free to move around and a static mesh is obsolete.”
Traditionally, creating a CFD mesh is one of the most complicated parts of simulation pre-processing. As a result, cutting out this process gives nanoFluidX an advantage to newcomers to the CFD world.
Another benefit of nanoFluidX is that it is optimized to run off of a graphics processing unit (GPU). The solver can also run off of a cluster of GPU machines and on the cloud through the HyperWorks Unlimited Virtual Appliance.
These computational options over GPU machines will help to hasten the computational processes behind the CFD solver. As a result, engineers can receive the results faster, allowing for more simulations in a given development cycle.
“All of our code is optimized to operate on GPU devices,” explained Stanić. “This allows us to minimize simulation times and simulate things that would otherwise take weeks or months in classic CFD codes.”
Stanić mentioned that nanoFluidX is able to simulate complex flows of incompressible fluids with moving geometries, moving rigid bodies with variable body force and multiphase flows with high density or viscosity. Users that are looking to simulate problems with compressible fluids or chemical reactions will need to use another CFD tool to meet their needs.
There are some other things to consider when working with SPH. Namely, SPH makes it difficult to handle wall boundary conditions. To assess this issue, Stanić explained that nanoFluidX uses a method by Stefan Adami (Journal of Computational Physics, 2012) to simulate walls and objects using SPH.
Stanić said, “[This method] requires solids [walls] to be represented by at least a three-particle layer. This method has been acknowledged by the scientific SPH community as one of the best methods there is for wall boundary treatment in SPH, as it produces physical results irrespective of the geometry of the walls, is easy to implement and is allowing for straightforward extension of the code to heat transfer and FSI [fluid structure interaction] applications.”
However, one advantage to SPH is that with the use of GPUs, the method can become faster than finite volume in some situations while maintaining or improving accuracy. “In terms of accuracy, SPH is comparable to FV [finite volume], although its numerical accuracy is limited to about a 1.5-order. This is not to say that it is better or worse, but that there are certain areas where SPH is more suitable than FV and vice versa,” said Stanić.
“SPH perfectly conserves mass and energy and does convection without an error by default,” he added. “These are known problems for the FV methods, and so it is true that for high-deformation flows, such as the ones encountered in powertrain components and general sloshing problems, the SPH method does have an edge over the FV methods.”
The Workflow to Perform a CFD Simulation with nanoFluidX
The nanoFluidX workflow. (Image courtesy of FluiDyna and Altair.)
A lot of the preprocessing for a nanoFluidX simulation happens in HyperMesh or SimLab. Users just need to import a CAD or surface mesh to start working on their geometry.
Within the current HyperMesh release, SPH generation is done using one menu. As no formal volume mesh is created, there is no need for mesh refinements.
Reducing the need of meshing your system can work to significantly reduce the time to preprocess. In fact, Stanić demonstrated that with HyperMesh he was able to preprocess a four-cylinder engine in about 14 minutes. “Most of that time,” he said, “was spent waiting on the computer to generate the particles.”
As for SimLab, that tool can also be used to preprocess an SPH simulation. Traditionally, SimLab has been used by engineers working on power train applications, to ensure engineers don’t grind their gears. SimLab is different from HyperMesh in that:
- Simlab users can create oil and gas phases in one step
- Simlab users can define particle layers for solids to reduce particle counts
- Simlab users can create housing particles based on defining wetted surfaces
Once preprocessed, the engineer will need to work with the solver. The nanoFluidX solver is a fully explicit SPH solver, which allows for the use of GPUs. Stanić also reports that the solver has good scaling when working with multiple GPUs.
Setting up the solver can be done using an ASCII file, which typically has 200 to 500 lines of code. This file has all the simulation motions, phases and options set out for the solver. Stanić explained that, down the road, this would be a process that will be done within HyperMesh or SimLab, making the ASCII file obsolete.
This multi-gear, 2000-rpm, 5.8-million-particle simulation took 32 hours to simulate one second of physical time using one GPU. (Image courtesy of FluiDyna and Altair.)
The next question is how does the SPH solver perform? With only one GPU, the solver was able to process a one-second simulation of a multi-gear housing, turning 2,000 rpm, with 5.8 million particles in about 32 hours.
As for Stanić’s four-cylinder engine simulation, that took four days to simulate one second of physical time on four GPUs. The simulation has 4.8 million particles and was running at 3,000 rpm.
Finally, the post-processing is done using ParaView. The post-processing software is able to produce visualizations, charts and animations for:
- Torque and force measurements
- Flow-rate measurements
- Volume rendering of the flow
- Velocity vector plots
- Streamlines
- Flow fields on a cut section
Altair is also working with Intelligent Light to enable SPH post processing in their Fieldview post processor.
To learn more about nanoFluidX, HyperMesh and SimLab, watch “The Three-Click Workflow of nanoFluidX, HyperMesh, and SimLab.”
For customers interested in testing out their SPH solutions on GPU hardware, Altair and FluiDyna have partnered with Nvidia and Amazon Web Services to offer a free 48-hour test drive via this link.
Altair has sponsored this post. They have no editorial input. All opinions are mine. —Shawn Wasserman