diff --git a/_docs_v7/Solver-Setup.md b/_docs_v7/Solver-Setup.md index baf046a3..d6402bf8 100644 --- a/_docs_v7/Solver-Setup.md +++ b/_docs_v7/Solver-Setup.md @@ -5,6 +5,13 @@ permalink: /docs_v7/Solver-Setup/ This is a basic introduction on how to set up a simulation using SU2. We distinguish between single-zone computations and multi-zone computations. The following considers a single zone only. For an explanation on multi-zone problems, continue with [Basics of Multi-Zone Computations](/docs_v7/Multizone). +Three different types of mathematical problem can be solved in SU2. The type is specified via the `MATH_PROBLEM` config option. The options are: +`DIRECT`: Also referred to as primal, this is the default when SU2_CFD or SU2_DEF are used. +`DISCRETE_ADJOINT`: A discrete adjoint methodology based on Automatic Differentiation, available for most solvers. This is the default for SU2_CFD_AD and SU2_DOT_AD +`CONTINUOUS_ADJOINT`: A hand-derived continuous adjoint methodology available only for compressible flows. + +See the [Software Components](/docs_v7/Software-Components/) documentation to determine which software module is required for each problem. + --- - [Defining the Problem](#defining-the-problem) @@ -22,9 +29,11 @@ This is a basic introduction on how to set up a simulation using SU2. We disting | Solver | Version | | --- | --- | -| `ALL`| 7.0.0 | +| `ALL`| 7.3.1 | + +## Direct ## -SU2 is capable of dealing with different kinds of physical problems. The kind of problem is defined by choosing a solver using the `SOLVER` option. A list of possible values and a description can be found in the following table: +SU2 is capable of dealing with different kinds of physical problems. The kind of problem is defined by choosing a solver using the `SOLVER` option. The list of possible values and a description can be found in the following table: | Option Value | Problem | Type | |---|---|---| @@ -40,15 +49,111 @@ SU2 is capable of dealing with different kinds of physical problems. The kind of |`FEM_NAVIER_STOKES`| **Navier-Stokes' equation** | Discontinuous Galerkin FEM | |`MULTIPHYSICS` | Multi-zone problem with different solvers in each zone | - | +### Turbulence modeling ### + +This section describes how to define the turbulence model in SU2 to be coupled to RANS or INC_RANS. The selected model must be specified in the config file by the `KIND_TURB_MODEL` option. The current available turbulence models are the: + - `NONE`: No turbulence model. + - `SST`: Mentor Shear Stress Transport. + - `SA`: Spalart-Allmaras. + +Different corrections and variations are implemented for each turbulence model. These are specified accordingly either in `SST_OPTIONS` or in `SA_OPTIONS`. The folowing options are available: +- `SST_OPTIONS`: + - `NONE`: No SST turbulence model (default). + - `V1994m`: refers to the "Standard" Menter SST model from 1994 with the modified constant $\sigma_{k1}$ and the redefinition of the turbulent eddy viscosity. + - `V2003m`: refers to the Menter SST model from 2003 ignoring the $\tau_{ij}$ in the momentum and energy equations and the production term is approximated by $P = \mu_t S^2$. + - `VORTICITY`: refers to the vorticity source term correction. + - `KATO_LAUNDER`: refers to the Kato-Launder correction. + - `UQ`: refers to the V1994m version with uncertainty quantification modifications.?? + - `SUSTAINING`: refers to the controlled decay correction. + +- `SA_OPTIONS`: + - `NONE`: refers to the modification where the $f_{t2}$ term is set to zero, i.e., $c_{t3} = 0$ (default). + - `NEGATIVE`: refers to the negative Spalart-Allmaras modification. + - `EDWARDS`: refers to the so-called Edwards modification. + - `WITHFT2`: refers to the standalone version. + - `QCR2000`: refers to the Quadratic Constitutive Relation modification, 2000 version. + - `COMPRESSIBILITY`: refers to the Mixing Layer Compressibility modification. + - `ROTATION`: refers to the rotation and curvature effects correction. + - `BCM`: refers to the SA-BCM transitional turbulence model. + - `EXPERIMENTAL`: Allow experimental combinations of options (according to [NASA TMR](https://turbmodels.larc.nasa.gov/)). + +We refer for example to [NASA TMR](https://turbmodels.larc.nasa.gov/) for a detailed explanation and definition of each correction and variation. + +#### Spalart-Allamaras #### +The single transported Spalart-Allmaras variable $\tilde{\nu}$ is initialized with the value at the farfield or inlet boundary. As suggested in the literature, the value there is computed as $\tilde{\nu}/\nu=\text{turb2lam}$. In SU2 the free-stream Spalart-Allmaras variable to kinematic laminar viscosity ratio, $\text{turb2lam}$, is defined by the `FREESTREAM_NU_FACTOR` config file field. The default value is $\tilde{\nu}/\nu = 3.0$ avoiding laminar solutions. + +An extension of SU2 includes an hybrid turbulence model: the Spalart-Allmaras original model with Detached-Eddy Simulation (DES) modification. Refer to Eduardo Moina's thesis?. The use of the hybrid RANS/LES model is specified in the cofig file with the field `HYBRID_RANSLES`. Four different techniques are currently implemented: + +- `SA_DES` Detached-Eddy Simulation +- `SA_DDES` Delayed Detached-Eddy Simulation +- `SA_ZDES` Zonal Detached-Eddy Simulation +- `SA_EDDES` Enhanced Detached-Eddy Simulation + +The DES constant can be controlledd by the field `DES_CONST`, with 0.65 as default. + +#### Menter’s k-omega SST Model #### +As initial conditions, the values of are initialized at all grid point with the farfield values. The farfield conditions for the turbulent kinetic energy $k$ is computed as: $k = \frac{3}{2}(UI)$, whereby $U$ is the freestream velocity magnitude and $I$ is the turbulence intensity. This latter value can be specified in the config file by the `FREESTREAM_TURBULENCEINTENSITY` field, with defaul value to 0.05 which corresponds to a $5\%$. The freestream value of the turbulent frequency $\omega$ is computed as: $\omega = \frac{\rho k}{\mu}(\frac{\mu_t}{\mu})^{-1}$, where $\rho$ and $\mu$ are the freestream density and laminar viscosity respectively and $\frac{\mu_t}{\mu}$ is the turbulent viscosity ratio, also known as freestream dissipation. Its value can be specified in the `FREESTREAM_TURB2LAMVISCRATIO` field, defaulting to $10$. + +##### Limitations of k and omega ##### +To increase robustness and prevent negative values, a hard-coded upper and lower limit are set for each turbulent variable: +``` +// turbulence kinetic energy +lowerlimit = 1.0e-10; +upperlimit = 1.0e10; + +// +lowerlimit = 1.0e-4; +upperlimit = 1.0e15; +``` +Further, by the model definition in the farfield region there is no production of $k$ nor $\omega$ while destruction still takes place. Consequently the turbulence quantities typically decay on their way from the farfield boundary to the airfoil. In order to prevent the non-physical decay in SU2 there are implemented to two approaches: +- Sustaining terms: it consists on the introduction of additional source terms in the turbulence model equations compensating the destruction terms in the farfield flow. This approach is activated by using the modified version of the SST moodel, `SST-sust`. +- Floor values: this approach is equivalent to setting the lowerlimit to the farfield values in the upstream region of an airfoil. The floor values are implemented in the form of fixed values. This correction can be activated with the following parameters in the config file: +`TURB_FIXED_VALUES= YES` +`TURB_FIXED_VALUES_DOMAIN= -1.0` +To determine those grid points where the correction should be applied, we compare the dot product of the normalized freestream velocity vector and the grid point coordinates. For those points which dot product result is lower than the specified `TURB_FIXED_VALUES_DOMAIN` value, the turbulence quantities are just set to the farfield values there. Note that although the Spalart-Allmaras turbulence model does not suffer from a decaying turbulence variable, the floor values limitation can also be employed. + +### Foward mode of AD ### +The forward mode of AD capability allows to compute the forward derivatives (see [Advanced AD Techniques](/docs_v7/Advanced-AD-Techniques)) of an specified function with respect to a registered variable/s. If multiple design variables are registered as input, the output will consist on the accumulation. The function to be differentiated can be any of the variables specified as `COEFFICIENT` in the `SetHistoryOutputFields` functions of the flow output classes. To get the derivative, one just needs to write D_< string group name > in the `HISTORY_OUTPUT` field from the config file. Addioiniallty, the field `DIRECT_DIFF` specifies the variable to be registered as an input. In SU2 it is possible to register almost any variable. Currently SU2 has implemented the following variables: + +`D_MACH` Freestream Mach number +`D_AOA` angle of attack +`D_PRESSURE` freestream pressure +`D_TEMPERATURE` freestream temperature +`D_DENSITY` freestream density +`D_TURB2LAM` freestream ratio of turbulent to laminar viscosity +`D_SIDESLIP` sideslip angle +`D_VISCOSITY` freestream laminar viscosity +`D_REYNOLDS` freestream Reynolds number +`D_DESIGN` design?? +`D_YOUNG` Young's modulus +`D_POISSON` Poisson's ratio +`D_RHO` solid density (inertial) +`D_RHO_DL` density for dead loads +`D_EFIELD` electric field + +The execution of this capability is done by the module `SU2_CFD_DIRECTDIFF`. See the [Software Components](/docs_v7/Software-Components/) for further details. + +## Adjoint Formulations ## + +### Discrete adjoint ### + +SU2 can compute the sensitivities of an objective function with respect to the control points defining the shape of the design surface. For the detailed list of available objective functions in SU2 we address to the enumeration declaration ['ENUM_OBJECTIVE'](https://github.com/su2code/SU2/blob/42d157143f6d11fc7393c17fd4b6bb8ade30ce6b/Common/include/option_structure.hpp#L1536). The associated nomenclature for the configuration file is specified in ['Objective_Map'](https://github.com/su2code/SU2/blob/42d157143f6d11fc7393c17fd4b6bb8ade30ce6b/Common/include/option_structure.hpp#L1581) + +The objective function value can be scaled by a weighting factor. This value can be specified in the `OBJECTIVE_WEIGHT` field on the config file. + +### Continuous adjoint ### + +Same as the discrete adjoint but using the continuous adjoint approach :) + Every solver has its specific options and we refer to the tutorial cases for more information. However, the basic controls detailed in the remainder of this page are the same for all problems. ## Restarting the simulation ## | Solver | Version | | --- | --- | -| `ALL`| 7.0.0 | +| `ALL`| 7.3.1 | -A simulation can be restarted from a previous computation by setting `RESTART_SOL=YES`. If it is a time-dependent problem, additionally `RESTART_ITER` must be set to the time iteration index you want to restart from: +A simulation can be restarted from a previous computation by setting `RESTART_SOL=YES`. The field data is imported from the restart file `SOLUTION_FILENAME` and must be located in the same directory. The solution file can be either a `.csv` or `.dat` file. The number of points must be the same as that for the simulation. If it is a time-dependent problem, additionally `RESTART_ITER` must be set to the time iteration index you want to restart from. For example, the following code will restart an unsteady problem from iteration number 2: ``` % ------------------------- Solver definition -------------------------------% @@ -57,13 +162,15 @@ A simulation can be restarted from a previous computation by setting `RESTART_SO SOLVER= EULER % % Restart solution (NO, YES) -RESTART_SOL= NO +RESTART_SOL= YES % % Iteration number to begin unsteady restarts (used if RESTART_SOL= YES) -RESTART_ITER= 0 +RESTART_ITER= 2 % ``` +Additionally the solution files solution_flow_00000 and solution_flow_00001, corresponding to steps or iteration 0 and 1 respectively, will be used for restarting the simulation. +