diff --git a/_data/docs_v7.yml b/_data/docs_v7.yml index dc8e3404..ba74044e 100644 --- a/_data/docs_v7.yml +++ b/_data/docs_v7.yml @@ -33,6 +33,7 @@ - Theory - Streamwise-Periodicity - Thermochemical-Nonequilibrium + - Metric-Based-Mesh-Adaptation - title: Users Guide docs_v7: @@ -47,6 +48,7 @@ - Custom-Output - Linear-Solvers-and-Preconditioners - Multizone + - Adaptive-Metric - Execution - title: Physical Models diff --git a/_data/tutorials.yml b/_data/tutorials.yml index 9695585f..31a2fc1a 100644 --- a/_data/tutorials.yml +++ b/_data/tutorials.yml @@ -65,6 +65,11 @@ - Species_Transport - Inc_Turbulent_Bend_Opt +- title: Mesh Adaptation + tutorials: + - Adaptive_Metric_Builtin_Sensors + - Adaptive_Metric_Custom_Sensor + - title: Workflow Setup tutorials: - paraview_live diff --git a/_docs_v7/Adaptive-Metric.md b/_docs_v7/Adaptive-Metric.md new file mode 100644 index 00000000..b42f5a98 --- /dev/null +++ b/_docs_v7/Adaptive-Metric.md @@ -0,0 +1,168 @@ +--- +title: Adaptive Metric +permalink: /docs_v7/Adaptive-Metric/ +--- + +This page explains how to compute the adaptive metric for anisotropic mesh adaptation: the options, the sensors and the output fields. For the theory, see [Metric-Based Anisotropic Mesh Adaptation](../Metric-Based-Mesh-Adaptation/). 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/). + +--- + +- [Limitations](#limitations) +- [Workflow](#workflow) +- [Options](#options) +- [Sensors](#sensors) + - [Built-In Sensors](#built-in-sensors) + - [Custom Sensors](#custom-sensors) +- [Choosing the Norm](#choosing-the-norm) +- [Size and Aspect Ratio Limits](#size-and-aspect-ratio-limits) +- [Steady and Unsteady Flows](#steady-and-unsteady-flows) +- [Output Fields](#output-fields) + +--- + +## Limitations + +- SU2 computes the metric field only. Generating the adapted mesh (remeshing) and the adaptation loop are not yet supported. +- 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. +- Only the Green-Gauss Hessian is available (`NUM_METHOD_HESS= GREEN_GAUSS`). +- Each sensor gets its own metric; metric intersection (to combine several sensors) and size gradation are not available. +- Only feature-based metrics are available; goal-oriented (adjoint-based) metrics are not, and the `GOAL` sensor is rejected. +- For unsteady flows, SU2 computes a single metric over the entire time series; adaptation over several time sub-intervals is not yet supported. + +## Workflow + +1. Choose one or more *sensors*, the scalar fields whose interpolation error the adapted mesh should control, for example the pressure and the Mach number. +2. Set `COMPUTE_ADAPTIVE_METRIC= YES` and list the sensors in `ADAPTIVE_METRIC_SENSOR`. +3. Set the target complexity (approximately the number of vertices of the adapted mesh), the norm and the size limits. +4. Add `ADAPTIVE_METRIC` to `VOLUME_OUTPUT` and run `SU2_CFD` (or the Python wrapper for custom sensors). +5. Pass the metric of the volume or restart output to a remesher. + +For example: + +``` +COMPUTE_ADAPTIVE_METRIC= YES +ADAPTIVE_METRIC_SENSOR= ( PRESSURE, MACH ) +ADAPTIVE_METRIC_NORM= 2 +ADAPTIVE_METRIC_COMPLEXITY= 10000 +ADAPTIVE_METRIC_HMIN= 1e-6 +ADAPTIVE_METRIC_HMAX= 10.0 +% +VOLUME_OUTPUT= ( COORDINATES, SOLUTION, PRIMITIVE, ADAPTIVE_METRIC ) +``` + +## Options + +The options are listed in the [Option Reference](../Option-Reference-adaptation-options/), with their defaults. The main ones are: + +| Option | Meaning | Default | +| --- | --- | --- | +| `COMPUTE_ADAPTIVE_METRIC` | Compute the adaptive metric of each sensor. | `NO` | +| `ADAPTIVE_METRIC_SENSOR` | List of sensors (case-insensitive), see [Sensors](#sensors). | none, at least one is required | +| `ADAPTIVE_METRIC_CUSTOM_SENSOR` | Sensors of `ADAPTIVE_METRIC_SENSOR` filled through the Python wrapper. | `NONE` | +| `NORMALIZE_ADAPTIVE_METRIC` | Perform the $$L^p$$-norm normalization. With `NO`, the metric is the absolute value of the Hessian (integrated in time for unsteady flows). | `YES` | +| `ADAPTIVE_METRIC_NORM` | Norm p of the normalization, see [Choosing the Norm](#choosing-the-norm). | `2` | +| `ADAPTIVE_METRIC_COMPLEXITY` | Target complexity N. | `10000` | +| `ADAPTIVE_METRIC_HMIN` | Minimum cell size, one value or one per sensor. | `1e-8` | +| `ADAPTIVE_METRIC_HMAX` | Maximum cell size, one value or one per sensor. | `100` | +| `ADAPTIVE_METRIC_ARMAX` | Maximum cell aspect ratio, one value or one per sensor. | `1e6` | + +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`. + +## Sensors + +Each sensor in `ADAPTIVE_METRIC_SENSOR` gets its own metric, normalized with the same norm and complexity. SU2 does not combine the metrics of several sensors into one (metric intersection) yet. + +### Built-In Sensors + +SU2 matches each sensor name, case-insensitively, against these fields, in this order: + +1. a custom sensor listed in `ADAPTIVE_METRIC_CUSTOM_SENSOR` (see below); +2. a primitive variable of the flow solver, for example `PRESSURE`, `DENSITY`, `TEMPERATURE`, `VELOCITY_X`, `VELOCITY_Y`, `VELOCITY_Z`, `LAMINAR_VISCOSITY` or `EDDY_VISCOSITY`; +3. a computed quantity: `VELOCITY` (velocity magnitude) or `MACH` (compressible solvers only); +4. a solution variable of another solver: `NU_TILDE` (SA), `TKE` and `DISSIPATION` (SST), `INTERMITTENCY` and `RE_THETA_T` (LM transition), `SPECIES_` (species transport). + +An unknown name stops SU2 with an error that lists the available sensors. At startup, SU2 prints how it resolved each sensor, for example for the 2D compressible solver: + +``` + Sensor 'PRESSURE': primitive variable 3. + Sensor 'MACH': computed. +``` + +### Custom Sensors + +Any other scalar field can be used as a sensor through the Python wrapper. List it in both `ADAPTIVE_METRIC_SENSOR` and `ADAPTIVE_METRIC_CUSTOM_SENSOR`: + +``` +ADAPTIVE_METRIC_SENSOR= ( TOTAL_PRESSURE, MACH ) +ADAPTIVE_METRIC_CUSTOM_SENSOR= ( TOTAL_PRESSURE ) +``` + +Then register a function that returns the sensor value at each node with `CustomSensorRegistry` (from `SU2.adaptive_metric`), and call `populate` after the flow solution and before `Postprocess`, where SU2 computes the metric: + +```python +from mpi4py import MPI +import pysu2 +from SU2.adaptive_metric import CustomSensorRegistry + +comm = MPI.COMM_WORLD +driver = pysu2.CSinglezoneDriver("config.cfg", 1, comm) +custom_sensors = CustomSensorRegistry({"TOTAL_PRESSURE": total_pressure}) +custom_sensors.initialize(driver) + +driver.Preprocess(0) +driver.Run() +custom_sensors.populate(driver) +driver.Postprocess() +driver.Update() +driver.Monitor(0) +driver.FinalizeAdaptiveMetric() +driver.Output(0) +driver.Finalize() +``` + +Each function takes the driver and returns the sensor values at the owned nodes of the current MPI rank. The [custom sensor tutorial](/tutorials/Adaptive_Metric_Custom_Sensor/) shows a complete example. + +## Choosing the Norm + +The norm p sets how the vertices are distributed (see [Optimal Metric](../Metric-Based-Mesh-Adaptation/#optimal-metric)). A larger p concentrates them in the regions of strongest curvature of the sensor, such as shocks and boundary layers, while a smaller p spreads them more evenly and also resolves weaker features. Recommended values: + +- **Inviscid flows:** p = 1 or 2. +- **Viscous (RANS) flows:** p = 4. Both Park, Balan et al. (2019) and Alauzet and Frazza (2021) found that p = 4 converges faster than p = 2 for RANS, since p = 2 under-refines the boundary layers on coarse adapted meshes: + - M. A. Park, A. Balan et al., "Verification of unstructured grid adaptation components", AIAA 2019-1723, 2019. [doi:10.2514/6.2019-1723](https://doi.org/10.2514/6.2019-1723) + - F. Alauzet, L. Frazza, "Feature-based and goal-oriented anisotropic mesh adaptation for RANS applications in aeronautics and aerospace", *J. Comput. Phys.* 439, 110340, 2021. [doi:10.1016/j.jcp.2021.110340](https://doi.org/10.1016/j.jcp.2021.110340) + +## Size and Aspect Ratio Limits + +After the normalization, SU2 clips each metric so that the requested cell sizes lie between `ADAPTIVE_METRIC_HMIN` and `ADAPTIVE_METRIC_HMAX`, and the requested aspect ratio is at most `ADAPTIVE_METRIC_ARMAX`. Each limit takes either one value for all sensors, or one value per sensor of `ADAPTIVE_METRIC_SENSOR`, in the same order: + +``` +ADAPTIVE_METRIC_SENSOR= ( PRESSURE, MACH ) +ADAPTIVE_METRIC_HMIN= ( 1e-4, 1e-3 ) +ADAPTIVE_METRIC_HMAX= 10.0 +``` + +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 sizes, for example at discontinuities. They affect the complexity whenever they are active. + +## Steady and Unsteady Flows + +- **Steady flows.** SU2 computes the metric once, from the final solution. +- **Unsteady flows.** SU2 integrates the absolute value of the Hessians in time with the trapezoidal rule, using the time step that the solver actually takes (which may vary, for example with `UNST_CFL_NUMBER`). The first sample is the solution after the first time step, or the restart solution of an unsteady restart. SU2 normalizes the metric when the run stops (at `TIME_ITER`, `MAX_TIME` or time convergence), so only the last volume output holds the final metric; earlier outputs hold the running time integral. With the Python wrapper, call `driver.FinalizeAdaptiveMetric()` before the last `driver.Output()`. + +SU2 prints the global integral used by the $$L^p$$-norm normalization for each sensor (even when normalization is disabled): + +``` +Global adaptive metric normalization integral for sensor PRESSURE: 18523.8 +``` + +## Output Fields + +With `COMPUTE_ADAPTIVE_METRIC= YES`, the following volume output groups are available. In the field names, `` is the sensor name with only its first letter capitalized, for example `Pressure` or `Total_pressure`. + +| Group | Fields | Content | +| --- | --- | --- | +| `SENSOR_VALUE` | `Sensor_` | Sensor value | +| `SENSOR_GRADIENT` | `Gradient__x`, `_y` (, `_z`) | Green-Gauss gradient of the sensor | +| `SENSOR_HESSIAN` | `Hessian__xx`, `_xy`, `_yy` (, `_xz`, `_yz`, `_zz`) | Green-Gauss Hessian of the sensor | +| `ADAPTIVE_METRIC` | `AdaptiveMetric__xx`, `_xy`, `_yy` (, `_xz`, `_yz`, `_zz`) | Adaptive metric of the sensor | + +The ParaView writers (`PARAVIEW`, `PARAVIEW_ASCII`, `PARAVIEW_LEGACY`) group the gradients as vectors and the Hessians and metrics as symmetric tensors, named `Gradient_`, `Hessian_` and `AdaptiveMetric_`. 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. diff --git a/_docs_v7/Metric-Based-Mesh-Adaptation.md b/_docs_v7/Metric-Based-Mesh-Adaptation.md new file mode 100644 index 00000000..66f94a28 --- /dev/null +++ b/_docs_v7/Metric-Based-Mesh-Adaptation.md @@ -0,0 +1,98 @@ +--- +title: Metric-Based Anisotropic Mesh Adaptation +permalink: /docs_v7/Metric-Based-Mesh-Adaptation/ +--- + +| Solver | Version | +| --- | --- | +| `EULER`, `NAVIER_STOKES`, `RANS`, `INC_EULER`, `INC_NAVIER_STOKES`, `INC_RANS` | develop | + +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/). + +--- + +- [Limitations](#limitations) +- [Metric Fields](#metric-fields) +- [Optimal Metric](#optimal-metric) +- [Hessian Recovery](#hessian-recovery) +- [Unsteady Flows](#unsteady-flows) +- [Implementation in SU2](#implementation-in-su2) +- [References](#references) + +--- + +## Limitations + +See [Limitations](../Adaptive-Metric/#limitations) in the user guide for the supported solvers and features. + +## Metric Fields + +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 + +$$\ell_\mathcal{M}(\mathbf{ab}) = \int_0^1 \sqrt{\mathbf{ab}^T \, \mathcal{M}(\mathbf{a} + t\,\mathbf{ab}) \, \mathbf{ab}} \; dt .$$ + +Since $$\mathcal{M}$$ is symmetric positive definite, it can be diagonalized in an orthonormal basis: + +$$\mathcal{M} = \mathcal{Q} \Lambda \mathcal{Q}^T, \qquad \Lambda = \mathrm{diag}(\lambda_1, \dots, \lambda_d), \qquad h_i = \lambda_i^{-1/2} .$$ + +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. + +The integral of the mesh density $$\sqrt{\det \mathcal{M}}$$ over the domain is known as the *complexity* + +$$\mathcal{C}(\mathbf{M}) = \int_\Omega \sqrt{\det \mathcal{M}(\mathbf{x})} \; d\mathbf{x},$$ + +the continuous analog of the number of vertices: the number of vertices of a unit mesh is approximately proportional to $$\mathcal{C}(\mathbf{M})$$. + +## Optimal Metric + +The metric is chosen to control the linear interpolation error of a scalar *sensor* $$u$$ with Hessian $$\mathcal{H}$$, e.g. the pressure or the Mach number. For a mesh that is unit in $$\mathbf{M}$$, the local interpolation error is modeled by the continuous interpolation error (Loseille and Alauzet, 2011a) + +$$e_\mathbf{M}(\mathbf{x}) = c_d \, \mathrm{tr}\!\left( \mathcal{M}^{-1/2}(\mathbf{x}) \, \lvert \mathcal{H}(\mathbf{x}) \rvert \, \mathcal{M}^{-1/2}(\mathbf{x}) \right),$$ + +with $$c_2 = 1/8$$ and $$c_3 = 1/10$$. Here, $$\lvert \mathcal{H} \rvert$$ is the matrix absolute value of the Hessian, which has the eigenvectors of $$\mathcal{H}$$ and the absolute values of its eigenvalues (see [Hessian Recovery](#hessian-recovery)). Using $$\lvert \mathcal{H} \rvert$$ instead of $$\mathcal{H}$$ overestimates the error where the Hessian is indefinite. + +The optimal metric minimizes the $$L^p$$-norm of this error for a target complexity $$\mathcal{N}$$: + +$$\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} .$$ + +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) + +$$\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} .$$ + +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. + +## Hessian Recovery + +SU2 computes the Hessian by applying the Green-Gauss approximation twice on the dual control volumes $$\Omega_i$$. First, the nodal gradient $$\nabla u$$ is computed from the nodal values of $$u$$. The Green-Gauss approximation is then applied to each component of $$\nabla u$$, with face values equal to the arithmetic mean of the nodal gradients, and the result is symmetrized: + +$$\mathcal{H}_{kl} = \frac{1}{2 \lvert \Omega_i \rvert} \sum_f \left[ \left( \frac{\partial u}{\partial x_k} \right)_f n_{f,l} + \left( \frac{\partial u}{\partial x_l} \right)_f n_{f,k} \right],$$ + +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$$: + +$$\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),$$ + +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. + +## Unsteady Flows + +For unsteady flows, the simulation $$[0, t_f]$$ is divided into $$T$$ sub-intervals $$\mathcal{S}^i = [t^i, t^{i+1}]$$, with one mesh per sub-interval (Alauzet, Loseille and Olivier, 2018). The mesh of a sub-interval must control the error over the whole sub-interval, so the Hessian in the optimal metric is replaced by the time integral of its absolute value, the *Hessian-metric* + +$$\mathcal{H}^i(\mathbf{x}) = \int_{\mathcal{S}^i} \lvert \mathcal{H}(\mathbf{x}, t) \rvert \; dt \approx \sum_k \frac{\Delta t_k}{2} \left( \lvert \mathcal{H}(\mathbf{x}, t^{k-1}) \rvert + \lvert \mathcal{H}(\mathbf{x}, t^k) \rvert \right),$$ + +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 + +$$\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} .$$ + +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. + +## Implementation in SU2 + +- **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. +- **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`. +- **Unsteady flows.** SU2 accumulates the Hessian-metric over the whole run, as a single sub-interval, and normalizes it when the run stops. + +## References + +- A. Loseille, F. Alauzet, "Continuous mesh framework part I: well-posed continuous interpolation error", *SIAM J. Numer. Anal.* 49(1), 38–60, 2011 (2011a). [doi:10.1137/090754078](https://doi.org/10.1137/090754078) +- A. Loseille, F. Alauzet, "Continuous mesh framework part II: validations and applications", *SIAM J. Numer. Anal.* 49(1), 61–86, 2011 (2011b). [doi:10.1137/10078654X](https://doi.org/10.1137/10078654X) +- F. Alauzet, A. Loseille, G. Olivier, "Time-accurate multi-scale anisotropic mesh adaptation for unsteady flows in CFD", *J. Comput. Phys.* 373, 28–63, 2018. [doi:10.1016/j.jcp.2018.06.043](https://doi.org/10.1016/j.jcp.2018.06.043) diff --git a/_tutorials/index.md b/_tutorials/index.md index c48a2a8f..87e8431d 100644 --- a/_tutorials/index.md +++ b/_tutorials/index.md @@ -132,3 +132,10 @@ Shape optimization of an 2D airfoil in unsteady flow conditions. Optimization of internal, turbulent, incompressible flow through a mixing channel. * [Optimizing pressure drop of a pipe bend](/tutorials/Inc_Turbulent_Bend_Opt/) Optimization of the pressure drop (also known as head loss), of a pipe bend. + +#### Mesh Adaptation + +* [Adaptive Metric with Built-In Sensors](/tutorials/Adaptive_Metric_Builtin_Sensors/) +Compute the adaptive metric of a transonic inviscid airfoil for anisotropic mesh adaptation, and visualize the requested cell sizes in ParaView. +* [Adaptive Metric with a Custom Sensor](/tutorials/Adaptive_Metric_Custom_Sensor/) +Define a sensor in Python with the Python wrapper and compute its adaptive metric for a turbulent airfoil. diff --git a/_tutorials/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/Adaptive_Metric_Builtin_Sensors.md b/_tutorials/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/Adaptive_Metric_Builtin_Sensors.md new file mode 100644 index 00000000..80b6c152 --- /dev/null +++ b/_tutorials/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/Adaptive_Metric_Builtin_Sensors.md @@ -0,0 +1,175 @@ +--- +title: Adaptive Metric with Built-In Sensors +permalink: /tutorials/Adaptive_Metric_Builtin_Sensors/ +written_by: bmunguia +for_version: 8.6.0 +solver: Euler +requires: SU2_CFD, ParaView +complexity: basic +follows: +--- + +![Size tensor glyphs](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/size_glyphs_pressure.png) + +Figure (1): Cell sizes and stretching requested by the pressure metric around the NACA0012, drawn as ellipses colored by the Mach number over the initial mesh. + +## Goals + +This tutorial computes the adaptive metric of a transonic, inviscid flow around the NACA0012 airfoil, and shows how to visualize it in ParaView. The following capabilities of SU2 are showcased: + +- Computation of the adaptive metric for anisotropic mesh adaptation +- Built-in sensors (a primitive variable and a computed quantity) +- $$L^p$$-norm normalization with size limits +- Tensor output for ParaView, and visualization of the requested cell sizes + +SU2 computes the metric only; it does not generate the adapted mesh. The adaptation loop with a remesher is WIP. + +## Resources + +The resources for this tutorial can be found in the [mesh_adaptation/Adaptive_Metric_Builtin_Sensors](https://github.com/su2code/Tutorials/tree/master/mesh_adaptation/Adaptive_Metric_Builtin_Sensors) directory in the [tutorial repository](https://github.com/su2code/Tutorials). You will need the configuration file [inv_naca0012.cfg](https://github.com/su2code/Tutorials/tree/master/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/inv_naca0012.cfg) and the mesh file [mesh_NACA0012_inv.su2](https://github.com/su2code/Tutorials/tree/master/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/mesh_NACA0012_inv.su2). The ParaView script [size_ellipses_2d.py](https://github.com/su2code/Tutorials/tree/master/mesh_adaptation/size_ellipses_2d.py), shared by the mesh adaptation tutorials, is in the parent directory [mesh_adaptation](https://github.com/su2code/Tutorials/tree/master/mesh_adaptation). + +## Tutorial + +The following sections explain the configuration, run the case and visualize the metric. It is assumed that SU2_CFD has been compiled and is in your path. If not, see the [Download](/docs_v7/Download/) and [Installation](/docs_v7/Installation/) pages. + +### Background + +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): + +$$\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},$$ + +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. + +### Problem Setup + +The flow is the transonic case of the [QuickStart](/docs_v7/Quick-Start/) tutorial: + +- Freestream Mach number = 0.8 +- Angle of attack (AoA) = 1.25 deg + +It has a strong shock on the upper surface and a weaker one on the lower surface, which the metric should resolve with cells stretched along the shocks. + +### Mesh Description + +The mesh is the unstructured triangular mesh of the QuickStart tutorial, with 5233 vertices and 10216 triangles, an Euler wall on the airfoil and a far-field boundary. + +### Configuration File Options + +The flow options are those of an inviscid steady case. The adaptive metric is set up by: + +``` +% MESH ADAPTATION +% +COMPUTE_ADAPTIVE_METRIC= YES +NORMALIZE_ADAPTIVE_METRIC= YES +ADAPTIVE_METRIC_SENSOR= PRESSURE, MACH +ADAPTIVE_METRIC_NORM= 2 +ADAPTIVE_METRIC_HMAX= 10.0 +ADAPTIVE_METRIC_HMIN= 1.0e-6 +% ADAPTIVE_METRIC_ARMAX= 10.0 +ADAPTIVE_METRIC_COMPLEXITY= 10000 +NUM_METHOD_HESS= GREEN_GAUSS +ADAP_TIME_SUBINTERVAL= 1 +``` + +- `ADAPTIVE_METRIC_SENSOR` lists two sensors: the pressure, a primitive variable, and the Mach number, which SU2 computes. Each sensor gets its own metric. +- `ADAPTIVE_METRIC_NORM= 2` and `ADAPTIVE_METRIC_COMPLEXITY= 10000` select the $$L^2$$-norm of the interpolation error and a target of about 10000 vertices, about twice the current mesh. +- `ADAPTIVE_METRIC_HMIN` and `ADAPTIVE_METRIC_HMAX` bound the requested cell sizes, in mesh units (the chord is 1). The far field is about 20 chords away, so `ADAPTIVE_METRIC_HMAX= 10.0` lets the metric coarsen there. The maximum aspect ratio is left at its default, 106. + +The metric and the fields it is computed from are written with the volume output groups `SENSOR_VALUE`, `SENSOR_GRADIENT`, `SENSOR_HESSIAN` and `ADAPTIVE_METRIC`: + +``` +VOLUME_OUTPUT= ( COORDINATES, SOLUTION, PRIMITIVE, SENSOR_VALUE, SENSOR_GRADIENT, SENSOR_HESSIAN, ADAPTIVE_METRIC, VOLUME, TOTAL_VOLUME ) +OUTPUT_FILES= ( RESTART, PARAVIEW ) +WRT_RESTART_COMPACT= NO +``` + +### Running SU2 + +Run the case from the tutorial directory: + +```bash +SU2_CFD inv_naca0012.cfg +``` + +or in parallel, for example with 4 ranks: + +```bash +mpirun -n 4 SU2_CFD inv_naca0012.cfg +``` + +At startup, SU2 reports how it resolved the sensors: + +``` +Resolving adaptive metric sensor indices. + Sensor 'PRESSURE': primitive variable 3. + Sensor 'MACH': computed. +Successfully resolved 2 adaptive metric sensors. +``` + +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: + +``` +------------------------ Compute Adaptive Metric ------------------------ +Storing sensor values needed for the adaptive metric. +Computing Hessians using Green-Gauss. +Computing feature-based adaptive metric tensor. +Global adaptive metric normalization integral for sensor PRESSURE: 18523.8 +Global adaptive metric normalization integral for sensor MACH: 9.5526 +``` + +The volume file `flow.vtu` contains: + +- `Sensor_Pressure` and `Sensor_Mach`, the sensor values; +- `Gradient_Pressure` and `Gradient_Mach`, the Green-Gauss gradients (vectors); +- `Hessian_Pressure` and `Hessian_Mach`, the Green-Gauss Hessians (symmetric tensors); +- `AdaptiveMetric_Pressure` and `AdaptiveMetric_Mach`, the metrics (symmetric tensors). + +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`, ...). + +### Visualizing the Metric in ParaView + +The metric eigenvalues are $$1/h^2$$, so the metric is largest where the mesh should be finest and spans many orders of magnitude. Two derived quantities are easier to read: + +- the **requested vertex density** $$\sqrt{\det \mathcal{M}} = 1/(h_1 h_2)$$, whose integral over the domain is the complexity; +- the **requested cell sizes**, drawn as ellipses whose axes are the eigenvectors of the metric and whose diameters are the requested sizes $$h_i$$. + +The steps below were checked with ParaView 6.0. Open `flow.vtu`, click **Apply**, switch the view to 2D (the **2D/3D** button at the top left of the render view) and zoom to the airfoil. + +#### Requested vertex density + +1. Select `flow.vtu`, then **Filters → Alphabetical → Calculator**. +2. Set **Result Array Name** to `Density_Pressure` and the expression to `sqrt(AdaptiveMetric_Pressure_XX*AdaptiveMetric_Pressure_YY-AdaptiveMetric_Pressure_XY^2)`, the square root of the determinant of the 2D metric, and click **Apply**. +3. Color the Calculator output by `Density_Pressure`. In the **Color Map Editor**, enable **Use log scale when mapping data to colors**, since the density varies over several orders of magnitude. + +Repeat with `AdaptiveMetric_Mach` for the Mach metric. + +![Vertex density of the pressure metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/metric_density_pressure.png) + +Figure (2): Requested vertex density of the pressure metric (log scale). + +![Vertex density of the Mach metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/metric_density_mach.png) + +Figure (3): Requested vertex density of the Mach metric (log scale, same range as Figure 2). + +Both metrics request the highest vertex density at the leading and trailing edges, as well as across the upper- and lower-surface shocks. + +#### Requested cell sizes and stretching + +The script `size_ellipses_2d.py` draws the metric of one sensor as an unfilled ellipse at every vertex. The axes of each ellipse are the eigenvectors of the metric, and its diameters are the requested cell sizes. + +1. Select `flow.vtu`, set its **Representation** to *Wireframe* and its color to a light gray, so the current mesh is shown behind the ellipses. +2. Select `flow.vtu`, then **Filters → Alphabetical → Programmable Filter**. Paste the contents of `size_ellipses_2d.py` into **Script**, and click **Apply**. The sensor is set by `SENSOR = "Pressure"` at the top of the script. + + If the filter fails with `module 'numpy' has no attribute 'in1d'` (ParaView builds that use NumPy 2.4 or later, such as some Linux distribution packages), run `import numpy; numpy.in1d = numpy.isin` in **View → Python Shell**, then delete the filter and add it again. +3. Color the ellipses by `Mach`. All point arrays of `flow.vtu` are copied to the ellipses, so any field can be used. + +Setting `SCALE = 1` in the script draws the unit ball of the metric instead, whose semi-axes are the requested sizes. + +![Size tensor glyphs at the shock](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/size_glyphs_shock.png) + +Figure (4): requested cell sizes of the pressure metric at the upper-surface shock. + +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. + +To compute the metric of a sensor that is not built in, see [Adaptive Metric with a Custom Sensor](/tutorials/Adaptive_Metric_Custom_Sensor/). diff --git a/_tutorials/mesh_adaptation/Adaptive_Metric_Custom_Sensor/Adaptive_Metric_Custom_Sensor.md b/_tutorials/mesh_adaptation/Adaptive_Metric_Custom_Sensor/Adaptive_Metric_Custom_Sensor.md new file mode 100644 index 00000000..9787e78d --- /dev/null +++ b/_tutorials/mesh_adaptation/Adaptive_Metric_Custom_Sensor/Adaptive_Metric_Custom_Sensor.md @@ -0,0 +1,194 @@ +--- +title: Adaptive Metric with a Custom Sensor +permalink: /tutorials/Adaptive_Metric_Custom_Sensor/ +written_by: bmunguia +for_version: 8.6.0 +solver: RANS +requires: SU2_CFD, Python wrapper, mpi4py, ParaView +complexity: intermediate +follows: Adaptive_Metric_Builtin_Sensors +--- + +![Total pressure sensor](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/sensor_total_pressure.png) + +Figure (1): Total pressure around the NACA0012, computed in Python and used as a custom sensor (`Sensor_Total_pressure`). + +## Goals + +This tutorial computes the adaptive metric of a sensor that is not built into SU2, the total pressure, by defining it in Python. The following capabilities of SU2 are showcased: + +- Custom sensors for the adaptive metric through the Python wrapper (`CustomSensorRegistry`) +- Built-in and custom sensors in the same run +- Adaptive metric of a turbulent (RANS) flow + +It follows [Adaptive Metric with Built-In Sensors](/tutorials/Adaptive_Metric_Builtin_Sensors/), which explains the metric options and the visualization in ParaView. + +## Resources + +The resources for this tutorial can be found in the [mesh_adaptation/Adaptive_Metric_Custom_Sensor](https://github.com/su2code/Tutorials/tree/master/mesh_adaptation/Adaptive_Metric_Custom_Sensor) directory in the [tutorial repository](https://github.com/su2code/Tutorials). You will need the configuration file [rans_naca0012.cfg](https://github.com/su2code/Tutorials/tree/master/mesh_adaptation/Adaptive_Metric_Custom_Sensor/rans_naca0012.cfg), the mesh file [mesh_NACA0012_inv.su2](https://github.com/su2code/Tutorials/tree/master/mesh_adaptation/Adaptive_Metric_Custom_Sensor/mesh_NACA0012_inv.su2) and the Python script [metric.py](https://github.com/su2code/Tutorials/tree/master/mesh_adaptation/Adaptive_Metric_Custom_Sensor/metric.py). The ParaView script [size_ellipses_2d.py](https://github.com/su2code/Tutorials/tree/master/mesh_adaptation/size_ellipses_2d.py) is in the parent directory. + +## Tutorial + +It is assumed that SU2 has been compiled with the Python wrapper (`-Denable-pywrapper=true`, see the [build instructions](/docs_v7/Build-SU2-Linux-MacOS/)), that `mpi4py` is installed, and that the SU2 install directory is in your `PYTHONPATH`, so that both `pysu2` and the `SU2` Python package can be imported. + +### Background + +The built-in sensors of the adaptive metric are the primitive variables of the flow solver, the velocity magnitude, the Mach number and the solution variables of the turbulence, transition and species solvers (see [Adaptive Metric](/docs_v7/Adaptive-Metric/#sensors)). Any other scalar field can be used as a sensor by computing it in Python and passing it to SU2 before SU2 computes the metric. + +The Mach number is the usual sensor for RANS adaptation, and it is built in. This tutorial uses the total pressure instead, to show how to define a custom sensor, and compares the two metrics. The total pressure is constant in the inviscid part of the flow outside of shocks, and drops in the boundary layers, the wake and across shocks. + +### Problem Setup + +The flow is the turbulent counterpart of the built-in sensor tutorial: + +- Freestream Mach number = 0.8 +- Angle of attack (AoA) = 1.25 deg +- Reynolds number = 6 × 106, based on the chord +- Spalart-Allmaras turbulence model + +### Mesh Description + +The mesh is the inviscid mesh of the built-in sensor tutorial, with no boundary-layer cells. This is on purpose: the flow solution on this mesh is not accurate, but it is the starting point of an adaptation. The Hessian recovery is sensitive to highly stretched boundary-layer meshes, so RANS adaptations commonly start from a mesh like this one and let the adaptation create the boundary-layer resolution. + +### Configuration File Options + +``` +% MESH ADAPTATION +% +COMPUTE_ADAPTIVE_METRIC= YES +NORMALIZE_ADAPTIVE_METRIC= YES +ADAPTIVE_METRIC_SENSOR= TOTAL_PRESSURE, MACH +ADAPTIVE_METRIC_CUSTOM_SENSOR= TOTAL_PRESSURE +ADAPTIVE_METRIC_NORM= 4 +ADAPTIVE_METRIC_HMAX= 10.0 +ADAPTIVE_METRIC_HMIN= 1.0e-6 +ADAPTIVE_METRIC_COMPLEXITY= 10000 +NUM_METHOD_HESS= GREEN_GAUSS +ADAP_TIME_SUBINTERVAL= 1 +``` + +- `ADAPTIVE_METRIC_SENSOR` lists all sensors: the custom `TOTAL_PRESSURE` and the built-in `MACH`. +- `ADAPTIVE_METRIC_CUSTOM_SENSOR` marks `TOTAL_PRESSURE` as filled through the Python wrapper. Without it, SU2 would stop with an error, since `TOTAL_PRESSURE` is not a built-in sensor. +- `ADAPTIVE_METRIC_NORM= 4` concentrates the vertices more at the strongest features (the shock, the wake and the boundary layers) than the $$L^2$$-norm of the built-in sensor tutorial. + +### The Python Script + +`metric.py` defines the sensor as a function of the driver, which returns the sensor value at each domain node. It uses the primitive variables of the flow solver: + +```python +def total_pressure(driver) -> list[float]: + """Compute local total pressure at all nodes for compressible flow.""" + prim_idx = driver.GetPrimitiveIndices() + nDim = driver.GetNumberDimensions() + primVars = driver.Primitives() + nNodes = driver.GetNumberNodes() - driver.GetNumberHaloNodes() + + gamma = 1.4 + coeff = 0.5 * (gamma - 1.0) + exp_fac = gamma / (gamma - 1.0) + press_col = prim_idx["PRESSURE"] + vel_cols = [prim_idx["VELOCITY_X"], prim_idx["VELOCITY_Y"]] + a_col = prim_idx["SOUND_SPEED"] + if nDim == 3: + vel_cols.append(prim_idx["VELOCITY_Z"]) + + p_tot = [0.0] * nNodes + for iNode in range(nNodes): + row = primVars(iNode) + p = row[press_col] + a = row[a_col] + vel2 = sum(row[k] ** 2 for k in vel_cols) + mach2 = vel2 / (a * a) + + p_tot[iNode] = p * pow(1.0 + coeff * mach2, exp_fac) + return p_tot +``` + +The main function registers the sensor with `CustomSensorRegistry`, runs the flow solver, and passes the sensor values to SU2 before the post-processing step, in which SU2 computes the Hessians and the metrics: + +```python +def main(): + driver = pysu2.CSinglezoneDriver("rans_naca0012.cfg", 1, comm) + + custom_sensors = CustomSensorRegistry({"TOTAL_PRESSURE": total_pressure}) + custom_sensors.initialize(driver) + + driver.Preprocess(0) + driver.Run() + + custom_sensors.populate(driver) + + driver.Postprocess() + driver.Update() + driver.Monitor(0) + driver.FinalizeAdaptiveMetric() + driver.Output(0) + + driver.Finalize() +``` + +- `initialize` checks that each registered sensor is listed in `ADAPTIVE_METRIC_SENSOR`, and finds its index. +- `populate` evaluates each sensor function and passes the values to SU2. It must be called after the flow solution and before `Postprocess`. +- `FinalizeAdaptiveMetric` does nothing for a steady run. For an unsteady run, it normalizes the time-integrated metric and must be called after the last time step, before the last `Output`; `populate` must then be called at every time step. + +### Running SU2 + +Run the script from the tutorial directory: + +```bash +python metric.py +``` + +or in parallel, for example with 4 ranks: + +```bash +mpirun -n 4 python metric.py +``` + +At startup, SU2 reports the custom sensor: + +``` +Resolving adaptive metric sensor indices. + Sensor 'TOTAL_PRESSURE': custom (Python wrapper). + Sensor 'MACH': computed. +Successfully resolved 2 adaptive metric sensors. +``` + +After the flow solution, SU2 computes the metrics from the sensor values passed by `populate`, and prints the normalization integral of each sensor: + +``` +Global adaptive metric normalization integral for sensor TOTAL_PRESSURE: 25985.7 +Global adaptive metric normalization integral for sensor MACH: 13.7329 +``` + +The volume file `flow.vtu` contains `Sensor_Total_pressure`, `Gradient_Total_pressure`, `Hessian_Total_pressure` and `AdaptiveMetric_Total_pressure`, and the same fields for the Mach number. + +### Visualizing the Metric + +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. + +#### Requested vertex density + +![Vertex density of the total pressure metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/metric_density_total_pressure.png) + +Figure (2): Requested vertex density of the total pressure metric (log scale). + +![Vertex density of the Mach metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/metric_density_mach.png) + +Figure (3): Requested vertex density of the Mach metric of the same run (log scale, same range as Figure 2). + +#### Requested cell sizes and stretching + +![Ellipses of the total pressure metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_total_pressure.png) + +Figure (4): Cell sizes and stretching requested by the total pressure metric, drawn as ellipses colored by the Mach number over the initial mesh. + +![Ellipses of the Mach metric](../../tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_mach.png) + +Figure (5): Cell sizes and stretching requested by the Mach metric of the same run, in the same view as Figure 4. + +#### Comparison + +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. + +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. \ No newline at end of file diff --git a/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/metric_density_mach.png b/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/metric_density_mach.png new file mode 100644 index 00000000..2a9c232d Binary files /dev/null and b/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/metric_density_mach.png differ diff --git a/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/metric_density_pressure.png b/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/metric_density_pressure.png new file mode 100644 index 00000000..8fe30b93 Binary files /dev/null and b/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/metric_density_pressure.png differ diff --git a/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/size_glyphs_pressure.png b/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/size_glyphs_pressure.png new file mode 100644 index 00000000..2703eeb3 Binary files /dev/null and b/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/size_glyphs_pressure.png differ diff --git a/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/size_glyphs_shock.png b/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/size_glyphs_shock.png new file mode 100644 index 00000000..8b4e7d8b Binary files /dev/null and b/tutorials_files/mesh_adaptation/Adaptive_Metric_Builtin_Sensors/images/size_glyphs_shock.png differ diff --git a/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/metric_density_mach.png b/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/metric_density_mach.png new file mode 100644 index 00000000..6337569b Binary files /dev/null and b/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/metric_density_mach.png differ diff --git a/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/metric_density_total_pressure.png b/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/metric_density_total_pressure.png new file mode 100644 index 00000000..0a893fe6 Binary files /dev/null and b/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/metric_density_total_pressure.png differ diff --git a/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/sensor_total_pressure.png b/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/sensor_total_pressure.png new file mode 100644 index 00000000..fc2d32c7 Binary files /dev/null and b/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/sensor_total_pressure.png differ diff --git a/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_mach.png b/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_mach.png new file mode 100644 index 00000000..704599e6 Binary files /dev/null and b/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_mach.png differ diff --git a/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_total_pressure.png b/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_total_pressure.png new file mode 100644 index 00000000..647d71b5 Binary files /dev/null and b/tutorials_files/mesh_adaptation/Adaptive_Metric_Custom_Sensor/images/size_glyphs_total_pressure.png differ