11%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22% %
33% SU2 configuration file %
4- % Case description: Test custom objective function. %
4+ % Case description: Test custom outputs and objective function. %
55% Author: P. Gomes %
66% Date: 5th Jan 2022 %
77% File Version 7.3.1 " Blackbird" %
@@ -12,11 +12,32 @@ SOLVER= NAVIER_STOKES
1212KIND_TURB_MODEL = NONE
1313RESTART_SOL = NO
1414%
15+ % User defined expressions of solver variables and other history outputs.
16+ % The syntax to define a custom output is ' name : type{expression}[markers]' .
17+ % NOTE: To obtain the list of available solver variables write an invalid
18+ % expression (e.g. ' x : AreaAvg{INVALID}[]' ) and run SU2.
19+ % Different outputs need to be separated by " ;" . The available types are:
20+ % - Macro: Introduces a new field that can only be used in other expressions,
21+ % it is not an output by itself (note the " $" symbol to reference macros).
22+ % - Function: Introduces a new scalar output that is a function of other scalar
23+ % outputs, it cannot reference fields (e.g. velocity).
24+ % - AreaAvg and AreaInt: Computes an area average or integral of a field (the
25+ % expression) over the list of markers.
26+ % - MassFlowAvg and MassFlowInt: Computes a mass flow average or integral.
27+ % NOTE: Each custom output can only use one type, e.g. it is not possible to
28+ % write ' p_drop : AreaAvg{PRESSURE}[inlet] - AreaAvg{PRESSURE}[outlet]' . This
29+ % would need to be separated into two AreaAvg outputs and one Function to
30+ % compute their difference.
31+ CUSTOM_OUTPUTS = ' velocity : Macro{sqrt(pow(VELOCITY_X, 2) + pow(VELOCITY_Y, 2) + pow(VELOCITY_Z, 2))};\
32+ avg_vel : AreaAvg{$velocity}[z_minus, z_plus];\
33+ var_vel : AreaAvg{pow($velocity - avg_vel, 2)}[z_minus, z_plus];\
34+ dev_vel : Function{sqrt(var_vel) / avg_vel}'
35+ %
1536% " COMBO" is the name and group of the output for the objective function
16- % (regardless of definition).
37+ % (regardless of definition). " CUSTOM " is the group for all custom outpus.
1738SCREEN_OUTPUT = INNER_ITER, RMS_DENSITY, RMS_ENERGY, LINSOL_RESIDUAL, FORCE_Z,\
18- SURFACE_MASSFLOW, SURFACE_TOTAL_TEMPERATURE, COMBO
19- HISTORY_OUTPUT = ITER, AERO_COEFF, FLOW_COEFF, FLOW_COEFF_SURF, COMBO
39+ SURFACE_MASSFLOW, SURFACE_TOTAL_TEMPERATURE, avg_vel, dev_vel, COMBO
40+ HISTORY_OUTPUT = ITER, AERO_COEFF, FLOW_COEFF, FLOW_COEFF_SURF, CUSTOM, COMBO
2041OBJECTIVE_FUNCTION = CUSTOM_OBJFUNC
2142% Here we define how the custom objective is computed from other outputs. For
2243% example, force in the z direction (computed for all MARKER_MONITORING and part
@@ -27,7 +48,7 @@ OBJECTIVE_FUNCTION= CUSTOM_OBJFUNC
2748% For multizone problems the CUSTOM_OBJFUNC should be defined for each zone
2849% individually (with the outputs of that zone), the total for the problem is
2950% the sum over zones, see disc_adj_fsi/Airfoil_2d.
30- CUSTOM_OBJFUNC = ' 1e3 * (FORCE_Z + fabs(SURFACE_MASSFLOW[1]))'
51+ CUSTOM_OBJFUNC = ' 1e3 * (FORCE_Z + fabs(SURFACE_MASSFLOW[1])) + dev_vel '
3152
3253% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------%
3354%
0 commit comments