Skip to content

Commit 716af8e

Browse files
committed
Clean up, and re-arrange figures
1 parent acbbfb1 commit 716af8e

4 files changed

Lines changed: 30 additions & 37 deletions

File tree

‎_docs_v7/Adaptive-Metric.md‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ This page explains how to compute the adaptive metric for anisotropic mesh adapt
2222

2323
## Limitations
2424

25-
- SU2 computes the metric field only. Generating the adapted mesh (remeshing) and the adaptation loop are not part of SU2 yet.
25+
- SU2 computes the metric field only. Generating the adapted mesh (remeshing) and the adaptation loop are not yet supported.
2626
- The metric is available for single-zone flow problems only. SU2 stops with an error for periodic boundaries, multizone problems, harmonic balance and the discrete adjoint.
2727
- Only the Green-Gauss Hessian is available (`NUM_METHOD_HESS= GREEN_GAUSS`).
2828
- Each sensor gets its own metric; metric intersection (to combine several sensors) and size gradation are not available.
2929
- Only feature-based metrics are available; goal-oriented (adjoint-based) metrics are not, and the `GOAL` sensor is rejected.
30-
- An unsteady run computes the metric of one time sub-interval. Several sub-intervals need a sequence of runs, with the solution interpolated between the meshes and the metrics normalized outside of SU2.
30+
- For unsteady flows, SU2 computes a single metric over the entire time series; adaptation over several time sub-intervals is not yet supported.
3131

3232
## Workflow
3333

@@ -65,8 +65,6 @@ The options are listed in the [Option Reference](../Option-Reference-adaptation-
6565
| `ADAPTIVE_METRIC_HMIN` | Minimum cell size, one value or one per sensor. | `1e-8` |
6666
| `ADAPTIVE_METRIC_HMAX` | Maximum cell size, one value or one per sensor. | `100` |
6767
| `ADAPTIVE_METRIC_ARMAX` | Maximum cell aspect ratio, one value or one per sensor. | `1e6` |
68-
| `NUM_METHOD_HESS` | Hessian method; only `GREEN_GAUSS` is available. | `GREEN_GAUSS` |
69-
| `ADAP_TIME_SUBINTERVAL` | Number of time sub-intervals T of an unsteady adaptation; the normalization uses the complexity T × N. A run computes the metric of one sub-interval, see [Steady and Unsteady Flows](#steady-and-unsteady-flows). | `1` |
7068

7169
The sizes are in mesh units. `ADAPTIVE_METRIC_HGRAD`, `ADAP_ITER` and `ADAP_COMPLEXITIES` are read only by the Python tools of the adaptation loop, not by `SU2_CFD`.
7270

@@ -143,7 +141,7 @@ ADAPTIVE_METRIC_HMIN= ( 1e-4, 1e-3 )
143141
ADAPTIVE_METRIC_HMAX= 10.0
144142
```
145143

146-
The limits change the complexity of the metric when they are active. They also set the requested sizes where a sensor is constant in some direction, since the Hessian gives no size there.
144+
The limits keep the metric well defined: `ADAPTIVE_METRIC_HMAX` and `ADAPTIVE_METRIC_ARMAX` bound the sizes where the Hessian is singular, for example in regions of nearly constant flow, and `ADAPTIVE_METRIC_HMIN` prevents null volume sizes, for example at discontinuities. They affect the complexity when they are active.
147145

148146
## Steady and Unsteady Flows
149147

@@ -153,14 +151,12 @@ The limits change the complexity of the metric when they are active. They also s
153151
For each sensor, SU2 prints the global integral used by the normalization:
154152

155153
```
156-
Global adaptive metric normalization integral for sensor PRESSURE: 1.234e+02
154+
Global adaptive metric normalization integral for sensor PRESSURE: 18523.8
157155
```
158156

159-
It is printed with `NORMALIZE_ADAPTIVE_METRIC= NO` too. With several time sub-intervals, the normalization of each sub-interval's metric needs the integrals of all sub-intervals (see [Unsteady Flows](../Metric-Based-Mesh-Adaptation/#unsteady-flows)), so run each sub-interval with `NORMALIZE_ADAPTIVE_METRIC= NO` and normalize the metrics outside of SU2 with these integrals.
160-
161157
## Output Fields
162158

163-
With `COMPUTE_ADAPTIVE_METRIC= YES`, these volume output groups are available. `<Sensor>` is the sensor name with only its first letter in upper case, for example `Pressure` or `Total_pressure`.
159+
With `COMPUTE_ADAPTIVE_METRIC= YES`, the following volume output groups are available. In the field names, `<Sensor>` is the sensor name with only its first letter capitalized, for example `Pressure` or `Total_pressure`.
164160

165161
| Group | Fields | Content |
166162
| --- | --- | --- |
@@ -169,4 +165,4 @@ With `COMPUTE_ADAPTIVE_METRIC= YES`, these volume output groups are available. `
169165
| `SENSOR_HESSIAN` | `Hessian_<Sensor>_xx`, `_xy`, `_yy` (, `_xz`, `_yz`, `_zz`) | Green-Gauss Hessian of the sensor |
170166
| `ADAPTIVE_METRIC` | `AdaptiveMetric_<Sensor>_xx`, `_xy`, `_yy` (, `_xz`, `_yz`, `_zz`) | Adaptive metric of the sensor |
171167

172-
The ParaView writers (`PARAVIEW`, `PARAVIEW_ASCII`, `PARAVIEW_LEGACY`) group the gradients as vectors and the Hessians and metrics as symmetric tensors, named `Gradient_<Sensor>`, `Hessian_<Sensor>` and `AdaptiveMetric_<Sensor>`. In 2D, the z components of the tensors are written as zero. The restart file contains the same fields as separate columns when `WRT_RESTART_COMPACT= NO`. The [built-in sensor tutorial](/tutorials/Adaptive_Metric_Builtin_Sensors/) shows how to visualize the metric in ParaView.
168+
The ParaView writers (`PARAVIEW`, `PARAVIEW_ASCII`, `PARAVIEW_LEGACY`) group the gradients as vectors and the Hessians and metrics as symmetric tensors, named `Gradient_<Sensor>`, `Hessian_<Sensor>` and `AdaptiveMetric_<Sensor>`. In 2D, the z components of the tensors are written as zero. By default, the restart file only contains the variables needed to restart the solver; with `WRT_RESTART_COMPACT= NO`, it also contains these fields, one column per component. The [built-in sensor tutorial](/tutorials/Adaptive_Metric_Builtin_Sensors/) shows how to visualize the metric in ParaView.

‎_docs_v7/Metric-Based-Mesh-Adaptation.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ The global term now involves all sub-intervals, so the metric of any sub-interva
8787

8888
## Implementation in SU2
8989

90-
- **Sensors and options.** Each sensor in `ADAPTIVE_METRIC_SENSOR` gets its own metric. The target complexity $$\mathcal{N}$$ is `ADAPTIVE_METRIC_COMPLEXITY`, the norm $$p$$ is `ADAPTIVE_METRIC_NORM`, and $$T$$ is `ADAP_TIME_SUBINTERVAL`. The integral $$G$$ is computed as a sum over the vertices, weighted by the volumes $$\lvert \Omega_i \rvert$$ of their dual control volumes, and is printed for each sensor.
91-
- **Eigenvalue floor.** SU2 uses $$\epsilon = 10^{-20}$$. It applies the floor only when it integrates and normalizes the metric, and never stores the floored eigenvalues.
92-
- **Size and aspect ratio limits.** After the normalization, SU2 clips the eigenvalues of each metric to $$[1/h_{max}^2, 1/h_{min}^2]$$, then raises the smallest ones to at least $$\lambda_{max}/AR_{max}^2$$, with $$h_{min}$$, $$h_{max}$$ and $$AR_{max}$$ set by `ADAPTIVE_METRIC_HMIN`, `ADAPTIVE_METRIC_HMAX` and `ADAPTIVE_METRIC_ARMAX`. The limits change the complexity of the metric where they are active.
93-
- **Unsteady flows.** SU2 accumulates the Hessian-metric of one sub-interval during the run, using the time step that the solver actually takes, and normalizes it when the run stops. Since G needs every sub-interval, a run with several sub-intervals uses `NORMALIZE_ADAPTIVE_METRIC= NO`, and the metrics are normalized outside of SU2 with the integrals printed by each run.
90+
- **Sensors and options.** Each sensor in `ADAPTIVE_METRIC_SENSOR` gets its own metric. The target complexity $$\mathcal{N}$$ is `ADAPTIVE_METRIC_COMPLEXITY`, the norm $$p$$ is `ADAPTIVE_METRIC_NORM`, and $$T$$ is `ADAP_TIME_SUBINTERVAL` (currently always 1 in SU2). The integral $$G$$ is computed as a sum over the vertices, weighted by the volumes $$\lvert \Omega_i \rvert$$ of their dual control volumes, and is printed for each sensor.
91+
- **Size and aspect ratio limits.** After the normalization, SU2 clips the eigenvalues of each metric to $$[1/h_{max}^2, 1/h_{min}^2]$$, then raises the smallest ones to at least $$\lambda_{max}/AR_{max}^2$$, with $$h_{min}$$, $$h_{max}$$ and $$AR_{max}$$ set by `ADAPTIVE_METRIC_HMIN`, `ADAPTIVE_METRIC_HMAX` and `ADAPTIVE_METRIC_ARMAX`.
92+
- **Unsteady flows.** SU2 accumulates the Hessian-metric over the whole run, as a single sub-interval, and normalizes it when the run stops.
9493

9594
## References
9695

‎_tutorials/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/Adaptive_Metric_Builtin_Sensors.md‎

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Resolving adaptive metric sensor indices.
107107
Successfully resolved 2 adaptive metric sensors.
108108
```
109109

110-
The flow solver runs until the density residual has dropped by three orders of magnitude. SU2 then computes the Hessians and the metrics, and prints the normalization integral of each sensor:
110+
The flow solver runs until the density residual has dropped by six orders of magnitude. SU2 then computes the Hessians and the metrics, and prints the normalization integral of each sensor:
111111

112112
```
113113
------------------------ Compute Adaptive Metric ------------------------
@@ -125,7 +125,7 @@ The volume file `flow.vtu` contains:
125125
- `Hessian_Pressure` and `Hessian_Mach`, the Green-Gauss Hessians (symmetric tensors);
126126
- `AdaptiveMetric_Pressure` and `AdaptiveMetric_Mach`, the metrics (symmetric tensors).
127127

128-
The restart file `restart_flow.dat` has the same fields as separate columns (`AdaptiveMetric_Pressure_xx`, `_xy`, `_yy`, ...), which is the form a remeshing script would read.
128+
Since the configuration sets `WRT_RESTART_COMPACT= NO`, the restart file `restart_flow.dat` also contains these fields, one column per component (`AdaptiveMetric_Pressure_xx`, `_xy`, `_yy`, ...).
129129

130130
### Visualizing the Metric in ParaView
131131

@@ -152,7 +152,7 @@ Figure (2): Requested vertex density of the pressure metric (log scale).
152152

153153
Figure (3): Requested vertex density of the Mach metric (log scale, same range as Figure 2).
154154

155-
Both metrics request the highest vertex density at the leading and trailing edges, and a higher density in a band across the upper-surface shock and around the weaker shock on the lower surface. The density increases only moderately at the shocks, since the metric refines them anisotropically: it asks for small cells across the shock only. The Mach metric also refines the region above the upper surface and the wake behind the trailing edge more than the pressure metric.
155+
Both metrics request the highest vertex density at the leading and trailing edges, as well as across the upper- and lower-surface shocks.
156156

157157
#### Requested cell sizes and stretching
158158

@@ -170,14 +170,6 @@ Setting `SCALE = 1` in the script draws the unit ball of the metric instead, who
170170

171171
Figure (4): requested cell sizes of the pressure metric at the upper-surface shock.
172172

173-
At the upper-surface shock, the ellipses are thin across the shock and long along it: the metric asks for small cells only in the direction in which the pressure jumps. Near the wall, they are stretched along the surface, and far from the airfoil they are nearly round. Near the weaker shock on the lower surface, the ellipses are less regular. There, the shock is spread over a few cells of the initial mesh, and the recovered Hessian is noisy; converging the flow solution further does not change this. The metric of a coarse initial mesh is only the first step of an adaptation, and it becomes more regular as the mesh is adapted.
174-
175-
### Things to Try
176-
177-
- Change `ADAPTIVE_METRIC_NORM`. A larger norm concentrates the vertices more at the shocks, a smaller one spreads them more evenly.
178-
- Change `ADAPTIVE_METRIC_COMPLEXITY`. The requested sizes scale as $$\mathcal{N}^{-1/2}$$ in 2D; the shape of the metric does not change.
179-
- Set `ADAPTIVE_METRIC_ARMAX= 10.0` (uncomment it in the configuration). Without it, the requested aspect ratio is below 10 at 99% of the vertices, but reaches about 130 at the shocks, so the limit mainly shortens the ellipses there.
180-
- Set limits per sensor, for example `ADAPTIVE_METRIC_HMIN= ( 1.0e-4, 1.0e-3 )` for the pressure and Mach metrics.
181-
- Set `NORMALIZE_ADAPTIVE_METRIC= NO` to write the absolute value of the Hessians instead of the normalized metrics.
173+
At the upper-surface shock, the ellipses are thin across the shock and long along it: the metric requests small element sizes only in the direction of the pressure jump. Far from the airfoil, the requested sizes are large and nearly isotropic.
182174

183175
To compute the metric of a sensor that is not built in, see [Adaptive Metric with a Custom Sensor](/tutorials/Adaptive_Metric_Custom_Sensor/).

‎_tutorials/mesh_adaptation/Adaptive_Metric_Custom_Sensor/Adaptive_Metric_Custom_Sensor.md‎

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ complexity: intermediate
99
follows: Adaptive_Metric_Builtin_Sensors
1010
---
1111

12-
![Size tensor glyphs of the total pressure metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_total_pressure.png)
12+
![Total pressure sensor](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/sensor_total_pressure.png)
1313

14-
Figure (1): Cell sizes and stretching requested by the total pressure metric around the NACA0012, drawn as ellipses colored by the Mach number over the initial mesh.
14+
Figure (1): Total pressure around the NACA0012, computed in Python and used as a custom sensor (`Sensor_Total_pressure`).
1515

1616
## Goals
1717

@@ -167,25 +167,31 @@ The volume file `flow.vtu` contains `Sensor_Total_pressure`, `Gradient_Total_pre
167167

168168
Follow the [ParaView steps of the built-in sensor tutorial](/tutorials/Adaptive_Metric_Builtin_Sensors/#visualizing-the-metric-in-paraview), with `AdaptiveMetric_Total_pressure` or `AdaptiveMetric_Mach` in the Calculator expression for the vertex density, and `SENSOR = "Total_pressure"` in `size_ellipses_2d.py` for the ellipses.
169169

170-
![Total pressure sensor](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/sensor_total_pressure.png)
171-
172-
Figure (2): Total pressure computed in Python (`Sensor_Total_pressure`).
170+
#### Requested vertex density
173171

174172
![Vertex density of the total pressure metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/metric_density_total_pressure.png)
175173

176-
Figure (3): Requested vertex density of the total pressure metric (log scale).
174+
Figure (2): Requested vertex density of the total pressure metric (log scale).
177175

178176
![Vertex density of the Mach metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/metric_density_mach.png)
179177

180-
Figure (4): Requested vertex density of the Mach metric of the same run (log scale, same range as Figure 3).
178+
Figure (3): Requested vertex density of the Mach metric of the same run (log scale, same range as Figure 2).
179+
180+
#### Requested cell sizes and stretching
181+
182+
![Ellipses of the total pressure metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_total_pressure.png)
183+
184+
Figure (4): Cell sizes and stretching requested by the total pressure metric, drawn as ellipses colored by the Mach number over the initial mesh.
185+
186+
![Ellipses of the Mach metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_mach.png)
181187

182-
![Size tensor glyphs of the Mach metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_mach.png)
188+
Figure (5): Cell sizes and stretching requested by the Mach metric of the same run, in the same view as Figure 4.
183189

184-
Figure (5): Cell sizes and stretching requested by the Mach metric of the same run, in the same view as Figure 1.
190+
#### Comparison
185191

186-
The total pressure is constant outside of the boundary layers and the wake (Figure 2), so the total pressure metric requests the highest vertex density along the wall, especially near the leading edge, and in the wake (Figure 3). There, the ellipses are strongly stretched along the flow (Figure 1). Away from the airfoil, the total pressure is nearly constant, so its recovered Hessian is small and noisy: the requested density is low but irregular, and the ellipses are large and randomly oriented.
192+
The total pressure is constant outside of the boundary layers and the wake (Figure 1), so the total pressure metric requests the highest vertex density along the wall, especially near the leading edge, and in the wake (Figure 2). There, the ellipses are strongly stretched along the flow (Figure 4). Away from the airfoil, the total pressure is nearly constant, so its recovered Hessian is small and noisy: the requested density is low but irregular, and the ellipses are large and randomly oriented.
187193

188-
The Mach metric (Figures 4 and 5) also refines the wall and the wake, with ellipses stretched along the flow, but in addition the shock on the upper surface and, more weakly, the flow below the airfoil. Upstream and around the leading edge, its ellipses are small and regular, and only the far wake is noisy. This is why the Mach number is the usual choice for RANS, while a custom sensor such as the total pressure can target a specific feature, here the viscous losses.
194+
The Mach metric (Figures 3 and 5) also refines the wall and the wake, with ellipses stretched along the flow, but in addition the shock on the upper surface and, more weakly, the flow below the airfoil. Upstream and around the leading edge, its ellipses are small and regular, and only the far wake is noisy. This is why the Mach number is the usual choice for RANS, while a custom sensor such as the total pressure can target a specific feature, here the viscous losses.
189195

190196
### Things to Try
191197

0 commit comments

Comments
 (0)