Skip to content

Commit 32b12c0

Browse files
committed
Split multi-part metric equations over several lines and regenerate the ellipse figures
- Write the eigendecomposition, the optimization problem, the optimal metric, the Hessian absolute value and the unsteady metric as aligned equations, one definition per line - Integrate G over x-hat in the steady and unsteady metrics, as in the thesis notation - Note that Figures 4 and 5 of the custom sensor tutorial use MIN_DENSITY = 100 to hide the large, randomly oriented ellipses far from the airfoil - Regenerate the ellipse figures of both tutorials with a line width of 1.5, and the custom sensor ones with MIN_DENSITY = 100
1 parent 76d4cb7 commit 32b12c0

7 files changed

Lines changed: 31 additions & 11 deletions

File tree

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

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ permalink: /docs_v7/Metric-Based-Mesh-Adaptation/
55

66
| Solver | Version |
77
| --- | --- |
8-
| `EULER`, `NAVIER_STOKES`, `RANS`, `INC_EULER`, `INC_NAVIER_STOKES`, `INC_RANS` | develop |
8+
| `EULER`, `NAVIER_STOKES`, `RANS`, `INC_EULER`, `INC_NAVIER_STOKES`, `INC_RANS` | 8.6.0 |
99

1010
This page summarizes the theory behind the adaptive metric that SU2 computes for anisotropic mesh adaptation. For the options and output fields, see the [Adaptive Metric](../Adaptive-Metric/) user guide. For worked examples, see the tutorials [Adaptive Metric with Built-In Sensors](/tutorials/Adaptive_Metric_Builtin_Sensors/) and [Adaptive Metric with a Custom Sensor](/tutorials/Adaptive_Metric_Custom_Sensor/).
1111

@@ -27,21 +27,25 @@ See [Limitations](../Adaptive-Metric/#limitations) in the user guide for the sup
2727

2828
## Metric Fields
2929

30-
Anisotropic mesh adaptation uses a continuous analog of the mesh: a Riemannian metric field $$\mathbf{M} = (\mathcal{M}(\mathbf{x}))_{\mathbf{x} \in \Omega}$$, which defines a symmetric positive definite $$d \times d$$ tensor $$\mathcal{M}(\mathbf{x})$$ at every point of the domain $$\Omega$$, with $$d = 2$$ or $$3$$ (Loseille and Alauzet, 2011a). A metric-based remesher generates a mesh that is *unit* in this metric, i.e. all its edges have unit length, and all its elements unit volume, when measured with $$\mathcal{M}$$. The length of an edge $$\mathbf{ab}$$ is
30+
Anisotropic mesh adaptation uses a continuous analog of the mesh: a Riemannian metric field $$\mathbf{M} = (\mathcal{M}(\mathbf{x}))_{\mathbf{x} \in \Omega}$$, which defines a symmetric positive definite $$d \times d$$ tensor $$\mathcal{M}(\mathbf{x})$$ at every point of the domain $$\Omega$$, with $$d = 2$$ or $$3$$. A metric-based remesher generates a mesh that is *unit* in this metric, i.e. all its edges have unit length, and all its elements unit volume, when measured with $$\mathcal{M}$$. The length of an edge $$\mathbf{ab}$$ is
3131

3232
$$\ell_\mathcal{M}(\mathbf{ab}) = \int_0^1 \sqrt{\mathbf{ab}^T \, \mathcal{M}(\mathbf{a} + t\,\mathbf{ab}) \, \mathbf{ab}} \; dt .$$
3333

3434
Since $$\mathcal{M}$$ is symmetric positive definite, it can be diagonalized in an orthonormal basis:
3535

36-
$$\mathcal{M} = \mathcal{Q} \Lambda \mathcal{Q}^T, \qquad \Lambda = \mathrm{diag}(\lambda_1, \dots, \lambda_d), \qquad h_i = \lambda_i^{-1/2} .$$
36+
$$\begin{aligned}
37+
\mathcal{M} &= \mathcal{Q} \Lambda \mathcal{Q}^T, \\
38+
\Lambda &= \mathrm{diag}(\lambda_1, \dots, \lambda_d), \\
39+
h_i &= \lambda_i^{-1/2} .
40+
\end{aligned}$$
3741

3842
The eigenvectors (the columns of $$\mathcal{Q}$$) are the directions of the requested elements, and $$h_i$$ are the requested element sizes along them. The metric is therefore inversely proportional to the square of the sizing field: the size tensor $$\mathcal{M}^{-1/2} = \mathcal{Q} \Lambda^{-1/2} \mathcal{Q}^T$$ maps the unit ball of the Euclidean space onto the unit ball of $$\mathcal{M}$$, an ellipse (ellipsoid in 3D) with semi-axes $$h_i$$. A unit mesh in the metric space is thus an anisotropic mesh with these sizes and directions in the physical space.
3943

4044
The integral of the mesh density $$\sqrt{\det \mathcal{M}}$$ over the domain is known as the *complexity*
4145

4246
$$\mathcal{C}(\mathbf{M}) = \int_\Omega \sqrt{\det \mathcal{M}(\mathbf{x})} \; d\mathbf{x},$$
4347

44-
the continuous analog of the number of vertices: the number of vertices of a unit mesh is approximately proportional to $$\mathcal{C}(\mathbf{M})$$.
48+
the continuous analog of the number of vertices. In a unit mesh, the number of vertices is approximately proportional to $$\mathcal{C}(\mathbf{M})$$.
4549

4650
## Optimal Metric
4751

@@ -53,11 +57,18 @@ with $$c_2 = 1/8$$ and $$c_3 = 1/10$$. Here, $$\lvert \mathcal{H} \rvert$$ is th
5357

5458
The optimal metric minimizes the $$L^p$$-norm of this error for a target complexity $$\mathcal{N}$$:
5559

56-
$$\mathbf{M}_{L^p} = \underset{\mathbf{M}}{\mathrm{argmin}} \; E_{L^p}(\mathbf{M}) = \left( \int_\Omega e_\mathbf{M}(\mathbf{x})^p \, d\mathbf{x} \right)^{1/p} \qquad \text{subject to} \qquad \mathcal{C}(\mathbf{M}) = \mathcal{N} .$$
60+
$$\begin{aligned}
61+
\mathbf{M}_{L^p} = \underset{\mathbf{M}}{\mathrm{argmin}} \; & E_{L^p}(\mathbf{M}) = \left( \int_\Omega e_\mathbf{M}(\mathbf{x})^p \, d\mathbf{x} \right)^{1/p} \\
62+
\text{subject to} \; & \mathcal{C}(\mathbf{M}) = \mathcal{N} .
63+
\end{aligned}$$
5764

5865
The complexity constraint prevents the trivial solution of vanishing element sizes, and prescribes the target number of vertices of the adapted mesh. The problem is solved by a calculus of variations, and its unique solution is given by (Loseille and Alauzet, 2011b)
5966

60-
$$\mathcal{M}_{L^p}(\mathbf{x}) = \left( \frac{\mathcal{N}}{G} \right)^{2/d} D(\mathbf{x}) \, \lvert \mathcal{H}(\mathbf{x}) \rvert, \qquad D(\mathbf{x}) = \left( \det \lvert \mathcal{H}(\mathbf{x}) \rvert \right)^{-\frac{1}{2p+d}}, \qquad G = \int_\Omega \left( \det \lvert \mathcal{H}(\mathbf{x}) \rvert \right)^{\frac{p}{2p+d}} d\mathbf{x} .$$
67+
$$\begin{aligned}
68+
\mathcal{M}_{L^p}(\mathbf{x}) &= \left( \frac{\mathcal{N}}{G} \right)^{2/d} D(\mathbf{x}) \, \lvert \mathcal{H}(\mathbf{x}) \rvert, \\
69+
D(\mathbf{x}) &= \left( \det \lvert \mathcal{H}(\mathbf{x}) \rvert \right)^{-\frac{1}{2p+d}}, \\
70+
G &= \int_\Omega \left( \det \lvert \mathcal{H}(\hat{\mathbf{x}}) \rvert \right)^{\frac{p}{2p+d}} d\hat{\mathbf{x}} .
71+
\end{aligned}$$
6172

6273
The optimal metric is aligned with the eigenvectors of $$\lvert \mathcal{H} \rvert$$ and has the same anisotropy. The local term $$D$$ accounts for the sensitivity of the $$L^p$$-norm, and the global term $$G$$ enforces the complexity constraint. The corresponding error converges at second order with respect to the complexity, $$E_{L^p}(\mathbf{M}_{L^p}) \leq C \mathcal{N}^{-2/d}$$. As $$p \to \infty$$, the metric tends to the one that controls the error in the $$L^\infty$$ norm, which equidistributes the error and focuses on the largest scales of the solution; smaller values of $$p$$ also capture its weaker features.
6374

@@ -69,7 +80,10 @@ $$\mathcal{H}_{kl} = \frac{1}{2 \lvert \Omega_i \rvert} \sum_f \left[ \left( \fr
6980

7081
where $$\mathbf{n}_f$$ is the area-weighted normal of face $$f$$. The absolute value is obtained from the eigendecomposition $$\mathcal{H} = \mathcal{Q} \Lambda \mathcal{Q}^T$$:
7182

72-
$$\lvert \mathcal{H} \rvert = \mathcal{Q} \, \lvert \Lambda \rvert \, \mathcal{Q}^T, \qquad \lvert \Lambda \rvert = \mathrm{diag}\left( \max(\lvert \lambda_1 \rvert, \epsilon), \dots, \max(\lvert \lambda_d \rvert, \epsilon) \right),$$
83+
$$\begin{aligned}
84+
\lvert \mathcal{H} \rvert &= \mathcal{Q} \, \lvert \Lambda \rvert \, \mathcal{Q}^T, \\
85+
\lvert \Lambda \rvert &= \mathrm{diag}\left( \max(\lvert \lambda_1 \rvert, \epsilon), \dots, \max(\lvert \lambda_d \rvert, \epsilon) \right),
86+
\end{aligned}$$
7387

7488
where $$\epsilon$$ is a small lower bound on the eigenvalues, so that $$\lvert \mathcal{H} \rvert$$, and therefore the metric, is symmetric positive definite by construction.
7589

@@ -81,7 +95,10 @@ $$\mathcal{H}^i(\mathbf{x}) = \int_{\mathcal{S}^i} \lvert \mathcal{H}(\mathbf{x}
8195

8296
which is approximated with the trapezoidal rule over the time steps of the sub-interval. With a constant time step and sub-intervals of equal length, minimizing the space-time interpolation error for an average spatial complexity $$\mathcal{N}$$ per sub-interval gives
8397

84-
$$\mathcal{M}^i(\mathbf{x}) = \left( \frac{T \mathcal{N}}{G} \right)^{2/d} \left( \det \mathcal{H}^i(\mathbf{x}) \right)^{-\frac{1}{2p+d}} \mathcal{H}^i(\mathbf{x}), \qquad G = \sum_{j=0}^{T-1} \int_\Omega \left( \det \mathcal{H}^j(\mathbf{x}) \right)^{\frac{p}{2p+d}} d\mathbf{x} .$$
98+
$$\begin{aligned}
99+
\mathcal{M}^i(\mathbf{x}) &= \left( \frac{T \mathcal{N}}{G} \right)^{2/d} \left( \det \mathcal{H}^i(\mathbf{x}) \right)^{-\frac{1}{2p+d}} \mathcal{H}^i(\mathbf{x}), \\
100+
G &= \sum_{j=0}^{T-1} \int_\Omega \left( \det \mathcal{H}^j(\hat{\mathbf{x}}) \right)^{\frac{p}{2p+d}} d\hat{\mathbf{x}} .
101+
\end{aligned}$$
85102

86103
The global term now involves all sub-intervals, so the metric of any sub-interval can only be normalized once the whole simulation has been computed. The complexity allocated to each sub-interval is proportional to its contribution to G, so sub-intervals whose solution is harder to resolve get more vertices. For T = 1, this is the optimal metric of the previous section, applied to the time-integrated Hessian.
87104

‎_tutorials/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/Adaptive_Metric_Builtin_Sensors.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ The following sections explain the configuration, run the case and visualize the
3636

3737
A metric field is a symmetric positive definite tensor $$\mathcal{M}$$ at every point. It prescribes the mesh that a remesher should build, a mesh that is unit in the metric: its eigenvectors are the directions of the cells, and its eigenvalues $$\lambda_i$$ give the requested cell sizes $$h_i = \lambda_i^{-1/2}$$ along them. SU2 computes, for each *sensor* field $$u$$, the metric that minimizes the $$L^p$$-norm of the interpolation error of $$u$$ for a target complexity $$\mathcal{N}$$ (approximately the number of vertices):
3838

39-
$$\mathcal{M}(\mathbf{x}) = \left( \frac{\mathcal{N}}{G} \right)^{2/d} \left( \det \lvert \mathcal{H}(\mathbf{x}) \rvert \right)^{-\frac{1}{2p+d}} \lvert \mathcal{H}(\mathbf{x}) \rvert, \qquad G = \int_\Omega \left( \det \lvert \mathcal{H}(\mathbf{x}) \rvert \right)^{\frac{p}{2p+d}} d\mathbf{x},$$
39+
$$\begin{aligned}
40+
\mathcal{M}(\mathbf{x}) &= \left( \frac{\mathcal{N}}{G} \right)^{2/d} \left( \det \lvert \mathcal{H}(\mathbf{x}) \rvert \right)^{-\frac{1}{2p+d}} \lvert \mathcal{H}(\mathbf{x}) \rvert, \\
41+
G &= \int_\Omega \left( \det \lvert \mathcal{H}(\hat{\mathbf{x}}) \rvert \right)^{\frac{p}{2p+d}} d\hat{\mathbf{x}},
42+
\end{aligned}$$
4043

4144
where $$\lvert \mathcal{H} \rvert$$ is the absolute value of the Hessian of the sensor and $$d$$ the number of dimensions. See [Metric-Based Anisotropic Mesh Adaptation](/docs_v7/Metric-Based-Mesh-Adaptation/) for the theory and [Adaptive Metric](/docs_v7/Adaptive-Metric/) for all options.
4245

‎_tutorials/mesh_adaptation/Adaptive_Metric_Custom_Sensor/Adaptive_Metric_Custom_Sensor.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ The volume file `flow.vtu` contains `Sensor_Total_pressure`, `Gradient_Total_pre
165165

166166
### Visualizing the Metric
167167

168-
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.
168+
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. Figures 4 and 5 also use `MIN_DENSITY = 100` in the script, which skips the vertices whose requested vertex density is below 100, i.e. the large, randomly oriented ellipses far from the airfoil.
169169

170170
#### Requested vertex density
171171

@@ -189,6 +189,6 @@ Figure (5): Cell sizes and stretching requested by the Mach metric of the same r
189189

190190
#### Comparison
191191

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.
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, resulting in a requested density that is low but irregular, and ellipses that are large and randomly oriented.
193193

194194
The Mach metric (Figures 3 and 5) also refines the wall and the wake, with sizing tensors stretched along the flow, as well as in the vicinity of the shocks.
62.3 KB
Loading
-5.67 KB
Loading
-67.1 KB
Loading
-791 KB
Loading

0 commit comments

Comments
 (0)