You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 716af8e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: _docs_v7/Adaptive-Metric.md
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,12 +22,12 @@ This page explains how to compute the adaptive metric for anisotropic mesh adapt
22
22
23
23
## Limitations
24
24
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.
26
26
- 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.
27
27
- Only the Green-Gauss Hessian is available (`NUM_METHOD_HESS= GREEN_GAUSS`).
28
28
- Each sensor gets its own metric; metric intersection (to combine several sensors) and size gradation are not available.
29
29
- 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.
31
31
32
32
## Workflow
33
33
@@ -65,8 +65,6 @@ The options are listed in the [Option Reference](../Option-Reference-adaptation-
65
65
|`ADAPTIVE_METRIC_HMIN`| Minimum cell size, one value or one per sensor. |`1e-8`|
66
66
|`ADAPTIVE_METRIC_HMAX`| Maximum cell size, one value or one per sensor. |`100`|
67
67
|`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`|
70
68
71
69
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`.
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.
147
145
148
146
## Steady and Unsteady Flows
149
147
@@ -153,14 +151,12 @@ The limits change the complexity of the metric when they are active. They also s
153
151
For each sensor, SU2 prints the global integral used by the normalization:
154
152
155
153
```
156
-
Global adaptive metric normalization integral for sensor PRESSURE: 1.234e+02
154
+
Global adaptive metric normalization integral for sensor PRESSURE: 18523.8
157
155
```
158
156
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
-
161
157
## Output Fields
162
158
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`.
164
160
165
161
| Group | Fields | Content |
166
162
| --- | --- | --- |
@@ -169,4 +165,4 @@ With `COMPUTE_ADAPTIVE_METRIC= YES`, these volume output groups are available. `
169
165
|`SENSOR_HESSIAN`|`Hessian_<Sensor>_xx`, `_xy`, `_yy` (, `_xz`, `_yz`, `_zz`) | Green-Gauss Hessian of the sensor |
170
166
|`ADAPTIVE_METRIC`|`AdaptiveMetric_<Sensor>_xx`, `_xy`, `_yy` (, `_xz`, `_yz`, `_zz`) | Adaptive metric of the sensor |
171
167
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.
Copy file name to clipboardExpand all lines: _docs_v7/Metric-Based-Mesh-Adaptation.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,10 +87,9 @@ The global term now involves all sub-intervals, so the metric of any sub-interva
87
87
88
88
## Implementation in SU2
89
89
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.
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:
@@ -125,7 +125,7 @@ The volume file `flow.vtu` contains:
125
125
-`Hessian_Pressure` and `Hessian_Mach`, the Green-Gauss Hessians (symmetric tensors);
126
126
-`AdaptiveMetric_Pressure` and `AdaptiveMetric_Mach`, the metrics (symmetric tensors).
127
127
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`, ...).
129
129
130
130
### Visualizing the Metric in ParaView
131
131
@@ -152,7 +152,7 @@ Figure (2): Requested vertex density of the pressure metric (log scale).
152
152
153
153
Figure (3): Requested vertex density of the Mach metric (log scale, same range as Figure 2).
154
154
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 lowersurface. 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-surfaceshocks.
156
156
157
157
#### Requested cell sizes and stretching
158
158
@@ -170,14 +170,6 @@ Setting `SCALE = 1` in the script draws the unit ball of the metric instead, who
170
170
171
171
Figure (4): requested cell sizes of the pressure metric at the upper-surface shock.
172
172
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.
182
174
183
175
To compute the metric of a sensor that is not built in, see [Adaptive Metric with a Custom Sensor](/tutorials/Adaptive_Metric_Custom_Sensor/).
Copy file name to clipboardExpand all lines: _tutorials/mesh_adaptation/Adaptive_Metric_Custom_Sensor/Adaptive_Metric_Custom_Sensor.md
+17-11Lines changed: 17 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,9 @@ complexity: intermediate
9
9
follows: Adaptive_Metric_Builtin_Sensors
10
10
---
11
11
12
-

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`).
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.
Figure (2): Total pressure computed in Python (`Sensor_Total_pressure`).
170
+
#### Requested vertex density
173
171
174
172

175
173
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).
177
175
178
176

179
177
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
+

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
+

181
187
182
-

188
+
Figure (5): Cell sizes and stretching requested by the Mach metric of the same run, in the same view as Figure 4.
183
189
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
185
191
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.
187
193
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.
0 commit comments