Skip to content

Flat Plates(T3A and T3A-) VandV and Tutorial for LM model #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions _docs_v7/Custom-Output.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ It is now possible to individually define what you want to have in your output.
- [Screen Output](#screen-output)
- [History Output](#history-output)
- [Example](#example-1)
- [User Defined Functions ](#user-defined-functions)

---

Expand All @@ -29,7 +30,7 @@ Let's define some terminology first.
- **Output group**: A collection of output fields.


**Note**: You can print all available output fields and groups available for the current solver (set with the `SOLVER` option) by calling `SU2_CFD` with the `-d` flag, i.e.
**Note**: You can print all available output fields and groups available for the current solver (set with the `SOLVER` option) by calling `SU2_CFD` with the `-d` flag (dry-run mode), i.e.
```
SU2_CFD -d <your_config_file.cfg>
```
Expand Down Expand Up @@ -165,7 +166,6 @@ Fields available depend on the solver you are using. Fields available for **all
- `WALL_TIME`: Current average wall-clock time for one iteration



If you run a multizone problem, the convergence history of the individual zones (i.e. the convergence of the inner iteration) is disabled by default and only the convergence of the outer iteration is shown. That means `SCREEN_OUTPUT` in the sub-config files is ignored. You can still print fields from individual zones by using the field name and the zone index. For example in an Fluid-Structure interaction problem the drag in zone 0 and the von-Mises stress in zone 1 can be used as fields by adding `DRAG[0]` and/or `VMS[1]` to the screen output in the main config file. It is possible to force the output of the full inner convergence history per zone by setting `WRT_ZONE_CONV` to `YES`.

You can also customize the frequency when the convergence history should be written to screen by using `SCREEN_WRT_FREQ_INNER`, `SCREEN_WRT_FREQ_OUTER` and `SCREEN_WRT_FREQ_TIME`.
Expand All @@ -183,7 +183,7 @@ You can also customize the frequency when the convergence history should be writ

For the compressible Navier-Stokes solver (i.e. `SOLVER=NAVIER_STOKES`), a **non-exhaustive list** of possible fields/groups is the following:

| Field Name (for screen output) | Description | Group Name (for history output) |
| Field Name | Description | Group Name |
|---|---|---|
| `TIME_ITER` | Time iteration index | `ITER` |
| `OUTER_ITER` | Outer (coupling) iteration index. | `ITER` |
Expand All @@ -207,3 +207,34 @@ For the compressible Navier-Stokes solver (i.e. `SOLVER=NAVIER_STOKES`), a **non
| `FORCE_Z` | Total Force in z direction.| `AERO_COEFF` |
| `EFFICIENCY` | Total Lift-to-drag ratio. | `AERO_COEFF` |

### User Defined Functions ###

From version 7.4.0 it is possible for users to create custom outputs via math expressions of solver variables and built-in outputs.
All custom outputs are specified via the config option `CUSTOM_OUTPUTS`, in general the syntax to define a custom output is `name : type{expression}[markers];` (note the use of ; to separate different outputs).
Where 'name' is the identifier that can be used to request output to screen or history file, and also to reference the output in other custom outputs (he group name for all custom outputs is `CUSTOM`).

The available types are:
- `Macro`: Introduces a new field that can only be used in other expressions, it is not an output by itself (note the "$" symbol to reference macros in the example below).
- `Function`: Introduces a new scalar output that is a function of other scalar outputs, it cannot reference fields (e.g. velocity).
- `AreaAvg` and `AreaInt`: Computes an area average or integral of a field (the expression) over the list of markers.
- `MassFlowAvg` and `MassFlowInt`: Computes a mass flow average or integral.

**Note:** Each custom output can only use one type, e.g. it is not possible to write `p_drop : AreaAvg{PRESSURE}[inlet] - AreaAvg{PRESSURE}[outlet]`. This would need to be separated into two `AreaAvg` outputs and one `Function` to compute their difference.

**Example:**
```
CUSTOM_OUTPUTS= 'velocity : Macro{sqrt(pow(VELOCITY_X, 2) + pow(VELOCITY_Y, 2) + pow(VELOCITY_Z, 2))};\
avg_vel : AreaAvg{$velocity}[z_minus, z_plus];\
var_vel : AreaAvg{pow($velocity - avg_vel, 2)}[z_minus, z_plus];\
dev_vel : Function{sqrt(var_vel) / avg_vel}'
```

To obtain the list of solver variables that can be used, write an invalid expression (e.g. 'x : AreaAvg{INVALID}[]') and run SU2.

To use a custom output as the objective function of the discrete adjoint solver, use `OBJECTIVE_FUNCTION= CUSTOM_OBJFUNC` and set `CUSTOM_OBJFUNC` appropriately, for example:
```
CUSTOM_OBJFUNC= 'LIFT + dev_vel'
```

For more details see the [example test case](https://github.com/su2code/SU2/blob/master/TestCases/user_defined_functions/lam_flatplate.cfg).

36 changes: 36 additions & 0 deletions _docs_v7/Markers-and-BC.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ The term *Marker* refers to a named entity in your mesh file. Boundary condition
- [Heat Transfer or Convection (no-slip) Wall](#heat-transfer-or-convection-no-slip-wall)
- [Isothermal (no-slip) Wall](#isothermal-no-slip-wall)
- [Farfield Boundary Condition](#farfield-boundary-condition)
- [Turbulence Boundary Condition](#turbulence-boundary-condition)
- [Wall functions](#wall-functions)
- [Inlet Boundary Condition](#inlet-boundary-condition)
- [Total Conditions](#total-conditions)
- [Mass Flow Inlet](#mass-flow-inlet)
Expand Down Expand Up @@ -121,6 +123,40 @@ A marker can be defined as a Farfield boundary by addings its name to the `MARKE
MARKER_FAR= (farfield)
```

## Turbulence Boundary Condition ##

| Solver | Version |
| --- | --- |
| `RANS`, `INC_RANS`, | 7.3.0 |

The turbulence boundary conditions do not have a `MARKER_` keyword but can instead be set for inlet and freestream boundaries using the keywords:

For the SA turbulence model:
```
FREESTREAM_NU_FACTOR= 3
```

For the SST turbulence model:
```
FREESTREAM_TURBULENCEINTENSITY= 0.05
FREESTREAM_TURB2LAMVISCRATIO= 10
```

### Wall functions ###
Accurately resolving the turbulence close to walls requires very fine meshes and can be quite expensive. When the vertices of the first cell neighboring the wall have on average a normalized distance $$y^+ >1$$, wall functions can be used. For example to activate wall functions on the markers `wall1` and `wall2`, we write:
```
MARKER_WALL_FUNCTIONS=(wall1,STANDARD_WALL_FUNCTION,wall2,STANDARD_WALL_FUNCTION)
```
The wall functions will now be used automatically. all functions have 5 additional expert parameters:
```
WALLMODEL_KAPPA= 0.41
WALLMODEL_B= 5.5
WALLMODEL_MINYPLUS= 5.0
WALLMODEL_MAXITER= 200
WALLMODEL_RELFAC= 0.5
```
The constant `WALLMODEL_KAPPA` is the von Karman constant, and `WALLMODEL_B` is an additional constant describing the universal 'law of the wall'. The constants are supposed to be universal, and do not change. The setting `WALLMODEL_MINYPLUS= 5` will activate the wall model only when the local value of $$y^+$$ is higher than the value given (default: 5). Note that in principle, this implementation is valid for any $$y^+ < 100-500$$ and will also work correctly for very small values of $$y^+$$. the upper limit that can be used depends on (and increases with) the Reynolds number. The universal law of the wall is an implicit function and a Newton iterator is used to determine $$u^+(y^+)$$. The maximum number of iterations can be set by `WALLMODEL_MAXITER` and the relaxation factor can be set with `WALLMODEL_RELFAC`. When the Newton solver does not converge within the maximum number of iterations given, a warning message will appear during the computation. When these warning messages do not disappear, you might consider increasing `WALLMODEL_MAXITER` or decreasing `WALLMODEL_RELFAC`.

## Inlet Boundary Condition ##
Inlet boundary conditions are set using the option `MARKER_INLET`.

Expand Down
6 changes: 6 additions & 0 deletions _docs_v7/Theory.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ For information on how to use turbulence models in SU2 see the [users guide](htt

The edge-based finite volume discretization of flow solvers is also used in turbulence solvers. Convective fluxes are evaluated using a scalar upwind scheme (1st or 2nd order).

## Wall functions

Available for `RANS`, `INC_RANS`.

The wall function model of Nichols and Nelson (2004) has been implemented in the compressible and the incompressible solver, for the SA as well as the SST models. For the compressible solver, the wall function model takes into account the frictional heating of the wall according to the Crocco-Busemann relation when the wall boundary conditions is not isothermal. When the wall model is active, the value of the dimensional distance of the first node from the wall can be $$ y^+ > 5$$. When the wall model is not active, $$y^+ < 5 $$ and in addition a fine mesh is necessary close to the wall to resolve the near wall boundary layer.

---

# Species Transport #
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
title: Transitional Flat Plate for T3A and T3A-
permalink: /tutorials/Transitional_Flat_Plate/
written_by: Sunoh Kang
for_version: 7.4.0
revised_by: -
revision_date: -
revised_version: -
solver: RANS
requires: SU2_CFD
complexity: basic
follows:
---

## Goals

Upon completing this tutorial, the user will be familiar with performing an external, transitional flow over a flat plate. The flow over the flat plate will be laminar until it reaches a point where a transition correlation depending on local flow variables is activated. The results can be compared to the zero pressure gradient natural transition experiment of T3A & T3A-[ERCOFTAC](http://cfd.mace.manchester.ac.uk/ercoftac/doku.php). The following capabilities of SU2 will be showcased in this tutorial:

- Steady, 2D, incompressible RANS equations
- k-w SST-2003m turbulence model with Langtry and Menter 2009 ([LM2009](https://turbmodels.larc.nasa.gov/langtrymenter_4eqn.html)) transition model
- L2Roe convective scheme in space (2nd-order, upwind)
- Corrected average-of-gradients viscous scheme
- Euler implicit time integration
- farfield, Outlet, Symmetry and No-Slip Wall boundary conditions

## Resources

The resources for this tutorial can be found in the [compressible_flow/Transitional_Flat_Plate/LM](https://github.com/su2code/Tutorials/tree/master/compressible_flow/Transitional_Flat_Plate/LM) directory in the [tutorial repository](https://github.com/su2code/Tutorials).

## Tutorial

The following tutorial will walk you through the steps required when solving for the transitional flow over a flat plate using SU2. It is assumed you have already obtained and compiled the SU2_CFD code for a serial or parallel computation. If you have yet to complete these requirements, please see the [Download](/docs_v7/Download/) and [Installation](/docs_v7/Installation/) pages.

### Background

Practically, most CFD analyses are carried out using fully turbulent fields that do not account for boundary layer transition. Given that the flow is everywhere turbulent, no separation bubbles or other complex flow phenomena evolve. A transition model can be introduced, however, such that the flow begins as laminar by damping the production term of the turbulence model until a point where a transition correlation is activated. Currently, Langtry and Menter transition model ([LM](https://turbmodels.larc.nasa.gov/langtrymenter_4eqn.html)) that uses k-w SST-2003m as the baseline turbulence model is implemented in SU2.

For verification, we will be comparing SU2 results against the results of natural transition flat plate experiment of [ERCOFTAC](http://cfd.mace.manchester.ac.uk/ercoftac/doku.php). The experimental data include skin friction coefficient distribution versus the local Reynolds number over the flat plate.

### Problem Setup

The length of the flat plate is 20 meters, and it is represented by an adiabatic no-slip wall boundary condition. There is a symmetry plane located before the leading edge of the flat plate. far boundary condition is used on the left and top boundary of the domain, and outlet boundary condition is applied to the right boundaries of the domain. Flow condition, you can reference from https://doi.org/10.2514/6.2022-3679.

### Mesh Description

The mesh used for T3A tutorial, which provided by [AIAA Transition modeling workshop-I](https://transitionmodeling.larc.nasa.gov).
The mesh used for T3A- tutorial, which consists of 122,880 quadrilaterals.
Both T3A and T3A- boundary conditions are shown below.

![Flat Plate](../../../tutorials_files/compressible_flow/Transitional_Flat_Plate/images/LM_flat_plate/Boundary_conditions.png)

Figure (1): Mesh with boundary conditions (red: far, blue:out, orange:symmetry, green:wall)

### Configuration File Options

Several of the key configuration file options for this simulation are highlighted here.

```
% Physical governing equations (EULER, NAVIER_STOKES,
% WAVE_EQUATION, HEAT_EQUATION,
% LINEAR_ELASTICITY, POISSON_EQUATION)
SOLVER= RANS
%
% Specify turbulent model (NONE, SA, SST)
KIND_TURB_MODEL= SST
%
% Specify versions/corrections of the SST model (V2003m, V1994m, VORTICITY, KATO_LAUNDER, UQ, SUSTAINING)
SST_OPTIONS= NONE
%
% Transition model (NONE, LM)
KIND_TRANS_MODEL= LM

...

%
% Free-stream turbulence intensity
FREESTREAM_TURBULENCEINTENSITY = 0.01

```

In the LM model, transition onset location is affected by freestream turbulence intensity.

### Running SU2

To run this test case, follow these steps at a terminal command line:

1. Copy the ([config file](https://github.com/su2code/Tutorials/tree/master/compressible_flow/Transitional_Flat_Plate/LM/)) and ([mesh file](https://github.com/su2code/Tutorials/tree/master/compressible_flow/Transitional_Flat_Plate/LM/)) so that they are in the same directory. Move to the directory containing the config file and the mesh file. Make sure that the SU2 tools were compiled, installed, and that their install location was added to your path.

2. Run the executable by entering

```
$ SU2_CFD transitional_LM_model_ConfigFile.cfg
```

at the command line.

3. SU2 will print residual updates for each iteration of the flow solver, and the simulation will finish upon reaching the specified convergence criteria.

4. Files containing the results will be written upon exiting SU2. The flow solution can be visualized in Tecplot or ParaView.

### Results

The figure below compares the skin friction results obtained by the LM transition model to the result of another solver(=Fluent 19.0) and experimental data.

![T3A_Cf_Rex](../../../tutorials_files/compressible_flow/Transitional_Flat_Plate/images/LM_flat_plate/Cf_T3A.png)
Figure (2): Comparison of the skin friction coefficients for the T3A case.
![T3A-_Cf_Rex](../../../tutorials_files/compressible_flow/Transitional_Flat_Plate/images/LM_flat_plate/Cf_T3A-.png)
Figure (3): Comparison of the skin friction coefficients for the T3A- case.


## Notes

The [LM model](https://turbmodels.larc.nasa.gov/langtrymenter_4eqn.html) is designed using general subsonic transition experiment results(T-S wave, bypass transition, and separation-induced transition). So, This LM model can't provide appropriate simulation results for crossflow, supersonic, and hypersonic flow transition(= crossflow instability, 1st mode, Mack 2nd mode).
4 changes: 3 additions & 1 deletion _tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ Simulation of external, laminar flow over a flat plate (classical Navier-Stokes
Simulation of external, laminar flow around a 2D cylinder.
* [Turbulent Flat Plate](/tutorials/Turbulent_Flat_Plate/)
Simulation of external, turbulent flow over a flat plate (classical RANS validation).
* [Transitional Flat Plate](/tutorials/Transitional_Flat_Plate/)
* [Transitional Flat Plate(BC transition model)](/tutorials/Transitional_Flat_Plate/)
Simulation of external, transitional flow over a flat plate (transitional latminar-turbulent case).
* [Transitional Flat Plate(LM transition model)](/tutorials/Transitional_Flat_Plate/)
Simulation of external, transitional flow over a flat plate(T3A & T3A-) (transitional latminar-turbulent case).
* [Turbulent ONERAM6](/tutorials/Turbulent_ONERAM6/)
Simulation of external, viscous flow around a 3D geometry (isolated wing) using a turbulence model.
* [Unsteady NACA0012](/tutorials/Unsteady_NACA0012/)
Expand Down
Loading