You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _docs_v7/Custom-Output.md
+34-3Lines changed: 34 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ It is now possible to individually define what you want to have in your output.
16
16
-[Screen Output](#screen-output)
17
17
-[History Output](#history-output)
18
18
-[Example](#example-1)
19
+
-[User Defined Functions ](#user-defined-functions)
19
20
20
21
---
21
22
@@ -29,7 +30,7 @@ Let's define some terminology first.
29
30
-**Output group**: A collection of output fields.
30
31
31
32
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.
33
34
```
34
35
SU2_CFD -d <your_config_file.cfg>
35
36
```
@@ -165,7 +166,6 @@ Fields available depend on the solver you are using. Fields available for **all
165
166
-`WALL_TIME`: Current average wall-clock time for one iteration
166
167
167
168
168
-
169
169
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`.
170
170
171
171
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
183
183
184
184
For the compressible Navier-Stokes solver (i.e. `SOLVER=NAVIER_STOKES`), a **non-exhaustive list** of possible fields/groups is the following:
185
185
186
-
| Field Name (for screen output) | Description | Group Name (for history output)|
@@ -207,3 +207,34 @@ For the compressible Navier-Stokes solver (i.e. `SOLVER=NAVIER_STOKES`), a **non
207
207
|`FORCE_Z`| Total Force in z direction.|`AERO_COEFF`|
208
208
|`EFFICIENCY`| Total Lift-to-drag ratio. |`AERO_COEFF`|
209
209
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.
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).
0 commit comments