Skip to content

Commit 5f62cb0

Browse files
authored
Merge pull request #96 from su2code/master
update develop
2 parents c06ef2c + f013351 commit 5f62cb0

File tree

5 files changed

+81
-11
lines changed

5 files changed

+81
-11
lines changed

_docs_v7/Custom-Output.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ It is now possible to individually define what you want to have in your output.
1616
- [Screen Output](#screen-output)
1717
- [History Output](#history-output)
1818
- [Example](#example-1)
19+
- [User Defined Functions ](#user-defined-functions)
1920

2021
---
2122

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

3132

32-
**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.
33+
**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.
3334
```
3435
SU2_CFD -d <your_config_file.cfg>
3536
```
@@ -165,7 +166,6 @@ Fields available depend on the solver you are using. Fields available for **all
165166
- `WALL_TIME`: Current average wall-clock time for one iteration
166167

167168

168-
169169
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`.
170170

171171
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`.
@@ -183,7 +183,7 @@ You can also customize the frequency when the convergence history should be writ
183183

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

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

210+
### User Defined Functions ###
211+
212+
From version 7.4.0 it is possible for users to create custom outputs via math expressions of solver variables and built-in outputs.
213+
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).
214+
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`).
215+
216+
The available types are:
217+
- `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).
218+
- `Function`: Introduces a new scalar output that is a function of other scalar outputs, it cannot reference fields (e.g. velocity).
219+
- `AreaAvg` and `AreaInt`: Computes an area average or integral of a field (the expression) over the list of markers.
220+
- `MassFlowAvg` and `MassFlowInt`: Computes a mass flow average or integral.
221+
222+
**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.
223+
224+
**Example:**
225+
```
226+
CUSTOM_OUTPUTS= 'velocity : Macro{sqrt(pow(VELOCITY_X, 2) + pow(VELOCITY_Y, 2) + pow(VELOCITY_Z, 2))};\
227+
avg_vel : AreaAvg{$velocity}[z_minus, z_plus];\
228+
var_vel : AreaAvg{pow($velocity - avg_vel, 2)}[z_minus, z_plus];\
229+
dev_vel : Function{sqrt(var_vel) / avg_vel}'
230+
```
231+
232+
To obtain the list of solver variables that can be used, write an invalid expression (e.g. 'x : AreaAvg{INVALID}[]') and run SU2.
233+
234+
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:
235+
```
236+
CUSTOM_OBJFUNC= 'LIFT + dev_vel'
237+
```
238+
239+
For more details see the [example test case](https://github.com/su2code/SU2/blob/master/TestCases/user_defined_functions/lam_flatplate.cfg).
240+

_docs_v7/Markers-and-BC.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ The term *Marker* refers to a named entity in your mesh file. Boundary condition
1313
- [Heat Transfer or Convection (no-slip) Wall](#heat-transfer-or-convection-no-slip-wall)
1414
- [Isothermal (no-slip) Wall](#isothermal-no-slip-wall)
1515
- [Farfield Boundary Condition](#farfield-boundary-condition)
16+
- [Turbulence Boundary Condition](#turbulence-boundary-condition)
17+
- [Wall functions](#wall-functions)
1618
- [Inlet Boundary Condition](#inlet-boundary-condition)
1719
- [Total Conditions](#total-conditions)
1820
- [Mass Flow Inlet](#mass-flow-inlet)
@@ -121,6 +123,40 @@ A marker can be defined as a Farfield boundary by addings its name to the `MARKE
121123
MARKER_FAR= (farfield)
122124
```
123125

126+
## Turbulence Boundary Condition ##
127+
128+
| Solver | Version |
129+
| --- | --- |
130+
| `RANS`, `INC_RANS`, | 7.3.0 |
131+
132+
The turbulence boundary conditions do not have a `MARKER_` keyword but can instead be set for inlet and freestream boundaries using the keywords:
133+
134+
For the SA turbulence model:
135+
```
136+
FREESTREAM_NU_FACTOR= 3
137+
```
138+
139+
For the SST turbulence model:
140+
```
141+
FREESTREAM_TURBULENCEINTENSITY= 0.05
142+
FREESTREAM_TURB2LAMVISCRATIO= 10
143+
```
144+
145+
### Wall functions ###
146+
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:
147+
```
148+
MARKER_WALL_FUNCTIONS=(wall1,STANDARD_WALL_FUNCTION,wall2,STANDARD_WALL_FUNCTION)
149+
```
150+
The wall functions will now be used automatically. all functions have 5 additional expert parameters:
151+
```
152+
WALLMODEL_KAPPA= 0.41
153+
WALLMODEL_B= 5.5
154+
WALLMODEL_MINYPLUS= 5.0
155+
WALLMODEL_MAXITER= 200
156+
WALLMODEL_RELFAC= 0.5
157+
```
158+
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`.
159+
124160
## Inlet Boundary Condition ##
125161
Inlet boundary conditions are set using the option `MARKER_INLET`.
126162

_docs_v7/Theory.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ For information on how to use turbulence models in SU2 see the [users guide](htt
173173

174174
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).
175175

176+
## Wall functions
177+
178+
Available for `RANS`, `INC_RANS`.
179+
180+
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.
181+
176182
---
177183

178184
# Species Transport #

_tutorials/incompressible_flow/Inc_Species_Transport/Inc_Species_Transport.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The material properties specific to the species transport equations are:
5555

5656
All available options concerning species transport are listed below as they occur in the [config_template.cfg](https://github.com/su2code/SU2/blob/master/config_template.cfg).
5757

58-
The options as of now are fairly limited. Species transport is switched on by setting `KIND_SCALAR_MODEL= PASSIVE_SCALAR`. The `DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY` is currently the only available therefore the only additional choice the value of `DIFFUSIVITY_CONSTANT`. For the `SCHMIDT_NUMBER_TURBULENT` please consult [the respective theory](/docs_v7/Theory/#species-transport).
58+
The options as of now are fairly limited. Species transport is switched on by setting `KIND_SCALAR_MODEL= SPECIES_TRANSPORT`. The `DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY` is currently the only available therefore the only additional choice the value of `DIFFUSIVITY_CONSTANT`. For the `SCHMIDT_NUMBER_TURBULENT` please consult [the respective theory](/docs_v7/Theory/#species-transport).
5959

6060
The number of species transport equations is not set individually but deduced from the number of values given in the respective lists for species options. SU2 checks whether the same amount of values is given in each option and solves the appropriate amount of equations. `MARKER_INLET_SPECIES` is one of these options and has to be used alongside a usual `MARKER_INLET`. For outlets, symmetries or walls this is not necessary.
6161

@@ -72,8 +72,8 @@ The inital species mass fractions are given by the list `SPECIES_INIT= 1.0, ...`
7272
```
7373
% --------------------- SPECIES TRANSPORT SIMULATION --------------------------%
7474
%
75-
% Specify scalar transport model (NONE, PASSIVE_SCALAR)
76-
KIND_SCALAR_MODEL= NONE
75+
% Specify scalar transport model (NONE, SPECIES_TRANSPORT)
76+
KIND_SCALAR_MODEL= SPECIES_TRANSPORT
7777
%
7878
% Mass diffusivity model (CONSTANT_DIFFUSIVITY)
7979
DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY
@@ -166,4 +166,4 @@ Figure (4): Velocity Magnitude in the domain.
166166

167167
## Additional remarks
168168

169-
An in depth optimization of this case with addition of the FFD-box, gradient validation and some more steps can found [here](/tutorials/Species_Transport/).
169+
An in depth optimization of this case with addition of the FFD-box, gradient validation and some more steps can found [here](/tutorials/Species_Transport/).

index.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ <h2 style="font-weight:700">Powerful. Fast. Free.</h2>
3939
<hr>
4040
<center>
4141
<h1>3rd Annual SU2 Conference</h1>
42-
<h3><a href="https://www.eventbrite.com/e/3rd-annual-su2-conference-tickets-375147244507?aff=ebdsoporgprofile">Registration</a> and <a href="https://su2foundation.org/su2conference2022/">Abstract Submission</a> Open!</h3>
43-
<h3>Combined In-Person (<a href="https://www.google.com/maps/search/villa+monastero/@46.0084623,9.284619,17z/data=!3m1!4b1">Varenna/Italy</a>) and Virtual Event,
44-
September 5 - 7, 2022</h3>
45-
<h3>More information on abstract submission, registration etc. are posted on the <a href="https://su2foundation.org/su2conference2022/">conference website</a> and will always contain the latest updates.</h3>
42+
<h3>Presentation slides and recordings will be available on the <a href="https://su2foundation.org/su2conference2022/">conference website</a>.</h3>
4643
</center>
4744
<hr>
4845
</div>

0 commit comments

Comments
 (0)