As a Simulation engineer you always compromise between computational power, mesh size and accuracy. Thankfully we have the Adaptive mesh refinement (AMR) as a dynamic method to refines or coarsens cells based on adaptive mesh criteria as they query the flow solution. Such that we can have a fine mesh only where we need it, at the point in time we need it. This feature was introduced to Simcenter STAR-CCM+ already 2020. But still there are some deployments of AMR to discover. Let’s find out how you can spatially restrict the VOF model driven AMR to resolve only specific flow feature in this week’s blog post.
Adaptive Mesh Refinement
AMR refines the computational mesh dynamically only in areas where needed i.e., to capture the relevant flow features while recovering coarser cells elsewhere. The model-driven AMR refines the mesh automatically with minimal user intervention until the final accuracy levels are met. Two general types of adaptive mesh criteria are available:- Model-Driven Mesh Adaptions, where the adaption criteria are provided automatically from the Simcenter STAR-CCM+ models. Currently the following options are available:
- VOF
- LSI
- Overset Mesh
- Reacting Flows
- User-Defined Mesh Adaption, where you provide a field function or a table that prescribe how the AMR solver is to drive mesh adaption.
Local AMR restriction
Let´s take the example of yacht that develops a significant bow wave. The setup is taken from the Marine Self-propulsion tutorial and is essentially indicating a typical calm water resistance simulation with refinements for the waves (see image further above), yet no mesh adaption. We will now try to resolve the bow wave with AMR in a region around the bow (see below). The VOF Model-Driven Adaption would refine the interface in the whole domain. Therefore we use User-Defined Mesh Adaption and define a Field Function that is only returning a value inside the desired area (see below).The restrictions in three-dimensions can be defined in Field Functions with the help of $${Position} vector and a condition. Please refer to https://volupe.com/blog-volupe/star-ccm-field-function-syntax-part-1/ for detailed description on Field Function syntax.For a two-dimensional case we can easily restrict the refinement between -50 and 50 m in x-direction with the help of the syntax above.The volume fraction suggests itself to be a valid field to trigger mesh adaption. However, in most cases the volume fraction is too sharp to trigger the mesh adaption. Better distribution can be obtained for the adaptive refinement based on second gradient of volume fraction. The final Field Function to define the region around the backboard side of the yachts bow reckons as:($${Position}[0]>10 && $${Position}[0] < 14 && $${Position}[1]>0 && $${Position}[1] < 3 && $${Position}[2]>-0.5 && $${Position}[2] < 0.5) ? div(grad(${VolumeFractionwater}))*${AdaptionCellSize}:0Together with the adaption properties as follows. The Range [-1.0, 1.0] where to keep the original mesh may vary depending on the ${AdaptionCellSize}.With those settings we finally get the simulation which only refines waves only at the backboard side of the yacht. Yet, only in vicinity of the VOF interface. The plot of the wave-cut on backboard and starboard clarifies the effect of the local wave refinement. We hope the topic of this article is interesting and may help you reach your goals with Simcenter STAR-CCM+ faster. Please find attached an example implementation of a User-Defined Mesh Adaption for VOF interfaces. If you have any questions or comments, please feel free to reach out to us on support@volupe.com
Template_Waves_restrictedAMR
1 file(s) 1,007.42 KB