Changes have been made to the Refine metric-based mesh adaptation code, developed by NASA, to enable the metric intersection of the Spalding law-of-the-wall based metric with any metric derived from a scalar flow field. The repository contains modifications exclusively in the source file ref_subcommand.c. The major changes are detailed as follows:
1. Addition of New Command:
- Location: Line 345
- Description: A new command, 'with2matrix', has been introduced. This command performs the metric intersection between two input metrics using the ref_matrix_intersect function.
2. Modifications to Spalding Metric Function:
- Location: Line 397
- Description: The spalding_metric function has been modified to write out the metric in .solb format, based on the Spalding u+ formulation, which is created in the backend of the original code.
3. Loop Adjustment:
- Location: Line 1075
- Description: The spalding_metric function has been extracted from the loop that performs multiple iterations of adaptation near the boundary layer. This adjustment ensures consistency in the number of base meshes between the Spalding metric and the scalar metric.
Install Refine
cd src
replace original ref_subcommand.c file with the modified file given here
cd ../build
make
make install
Some initial test runs were performed to check the intersection.
2D NACA 0012:
Mesh based on mach number adaptation.
Mesh based on boundary layer adaptation (spalding metric).
Mesh based on intersected metric.
3D OneraM6 Wing:
Mesh based on mach number adaptation.
Mesh based on boundary layer adaptation (spalding metric).
Mesh based on intersected metric.
For this case, a RANS simulation was performed on a cylinder using METACOMP's ICFD++ solver. The original experimental study can be found here: HEG Cylinder Experiment. The simulation was performed considering a viscous, laminar and a chemical and thermal non-equilibrium flow. A similar simulation was performed using SU2-NEMO that can be found here.
The initial adaptations were done using a multiscale metric based on the Mach number and at an adaptation cycle where the number of nodes in the multiscale metric mesh was 65833, an intersection was performed using a metric based on the boundary layer adaptation whose mesh contained 73516 nodes. The resulting intersected mesh contained 129460 nodes. The base mesh was generated from a Mach-based metric containing 65963 nodes.
Mesh based on mach number adaptation.