Fundamentals of Simulation CFD Meshing for AEC
The Finite Element Mesh
Simulation CFD uses the finite element method to calculate fluid flow results. This numerical method requires the model geometry to be divided into many smaller regions called elements, where each corner of the element is a node. The process of division is known as meshing or discretization.
The primary element type for meshing solid geometry is the 4-node tetrahedral (pyramid) element. For volumes defined as fluid materials, layers of 6-node prism (wedge) elements, depicted to the right below, are automatically placed at the walls of the fluid domain.
A wall is anywhere the surface fluid velocity would be 0 (e.g. floor, ceiling, table top). These special layers of elements at the walls are known as mesh enhancement and are used to accurately solve for results in this critical area where the velocity suddenly drops to 0 at the surface.
The Meshing Quandary
The classic dilemma with meshing is that for each and every simulation, a certain number of elements will be required to adequately capture the flow and thermal characteristics. However, as the element count increases, so does the solver run time and hardware requirements (i.e., RAM and hard drive space). Too many elements is also not an ideal situation since the run can take considerably longer to complete with only marginal accuracy gains.
This fundamental meshing concept is analogous to drawing a circle with only straight line segments. As the number of line segments increase, a true circle is represented to the point where adding more lines has a diminishing impact on accuracy.
Consider the classic example of developed laminar pipe flow which is depicted in just about any fluid mechanics textbook. Because of the friction at the walls of the pipe, the developed velocity profile takes on a parabolic shape as depicted below.
|1||Developed laminar flow profile with highest fluid velocities in the middle.|
|2||Inaccurate results; flow profile is constant velocity (same color). Not enough elements to capture fluid characteristics.|
|3||Optimal mesh captures the parabolic profile and minimizes run time.|
|4||Adding significantly more elements has minimal impact on results but increases solution solve time.|
The finite element method relies upon the mesh quality (i.e., the quantity and shapes of the elements) to be able to accurately predict fluid flow results. In the results above, for Case 2, the mesh has poor quality (not enough elements) and the subsequent results are misleading. Improving the quality of the mesh, by adding more elements, enables the solver to produce results that closely match the known flow profile.
Achieving Mesh Independent Solutions
Ultimately, how many elements will be required? The optimal answer is “just enough” to achieve a mesh independent solution (i.e., the mesh quality is sufficient so that it does not adversely impact the results). Depending on the size and complexity of an AEC application, this can vary from 1 million to more than 10 million elements.
TIP: The software could use up to 2 GB of RAM for every 1 million elements in a model.
The optimal mesh is one that maximizes accuracy and also minimizes the solver run time. Developing this mesh requires a series of solutions where the mesh density (i.e., element count) is increased incrementally for each run. This iterative process of approaching a mesh independent solution is known as mesh convergence and has the following general work flow:
1. Obtain initial results
2. Clone scenario
3. Refine mesh (add more elements)
5. Compare results with previous run
a. If results differ greatly, go to Step 2
b. If results are nearly the same, go to Step 6
6. Mesh convergence complete.
The progression to mesh convergence is depicted in the diagram below, where the optimal mesh is #3 since it provides the best balance between accuracy and solution speed. Although it can be tempting, jumping directly from mesh #1 to mesh #4 is not ideal. While mesh #4 is very accurate, it can take much longer to solve, which for AEC applications can equate to hours and days of run time. This loss of time could prevent the presentation of results for a critical design review meeting.
|1||Initial mesh. Least amount of elements and fastest run.|
|2||First incremental mesh refinement. Results have changed from mesh 1 so repeat process.|
|3||Second incremental mesh refinement. Results have changed from mesh 2 so repeat process.|
|4||Third incremental mesh refinement. Results have NOT changed considerably from mesh 3, but runs take much longer. Optimal version is mesh 3.|
TIP: If there is any doubt at all about the mesh quality and its impact on results, then refine the mesh and run the solution again to make absolutely certain.
There is a feature available in Simulation CFD which can automate the mesh convergence process known as mesh adaptation. Mesh adaption follows the same process of solving a series of runs with increasingly refined mesh for each iteration. The difference is that it interprets the results on its own, decides what regions need to be refined and generates a new mesh with no user interaction required.
|1||Initial default automatic mesh|
|2||Mesh after 1st cycle of mesh adaptation|
|3||Mesh after 2nd cycle of mesh adaptation|
Mesh adaptation is very powerful and promising technology, but it is still evolving and has not entirely replaced standard meshing tools. A fundamental understanding of the manual mesh convergence process should be considered as a prerequisite for using it correctly. Users are encouraged to investigate mesh adaptation and compare it against the “classic” meshing workflow.