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: _tutorials/design_features/Unsteady_Shape_Opt_NACA0012.md
+23-17Lines changed: 23 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,15 +18,17 @@ Consequently, the following capabilities of SU2 will be showcased in this tutori
18
18
- Windowed sensitivity calculation
19
19
- Unsteady adjoints
20
20
- Unsteady Optimization
21
-
- Code parallelism (optional)
21
+
- Code parallelism
22
22
23
-
This tutorial uses the windowing techniques explained in [here](../Unsteady_NACA0012.md), to compute meaningful optimization objectives.
23
+
This tutorial uses the windowing techniques explained in [here](../Unsteady_NACA0012), to compute meaningful optimization objectives.
24
24
Hence it is recommended to read that tutorial first.
25
25
26
26
27
27
## Resources ##
28
28
29
-
The resources for this tutorial can be found in the [Unsteady_NACA0012](https://github.com/su2code/su2code.github.io/tree/master/Unsteady_Shape_Opt_NACA0012) directory in the [project website repository](https://github.com/su2code/su2code.github.io).
29
+
The resources for this tutorial can be found in the
in the [project website repository](https://github.com/su2code/su2code.github.io).
30
32
31
33
You will need the configuration file ([unsteady_naca0012_opt.cfg](../../Unsteady_Shape_Opt_NACA0012/unsteady_naca0012_opt.cfg)) and
32
34
the mesh file ([unsteady_naca0012_FFD.su2](../../Unsteady_Shape_Opt_NACA0012/unsteady_naca0012_FFD.su2)).
@@ -58,20 +60,19 @@ This problem will solve the flow about the airfoil with these conditions:
58
60
- Reynolds number = 1E6
59
61
- Reynolds length = 1.0 m
60
62
- Number of time iterations: 2200
61
-
- Restart Iteration: 1100
62
63
- Start of the windowed time-average: 1500
63
64
64
65
These subsonic flow conditions will cause a detached flow about the airfoil, that exhibts a vortex street and is therefore periodic for the baseline geometry.
65
66
Depending on the windowing-function used to average the optimization objective, the flow about the optimized geometry will eventually be a steady state flow.
66
67
67
68
We want to solve an optimization problem with a time dependent system output, e.g. Drag. A meaningful objective and constraint function is therefore a time average over a period.
68
-
The period average is approximated by a windowed timeaverage over a finite timespan $$M$$.
69
+
The period average is approximated by a windowed time-average over a finite time-span $$M$$.
where $$C_D(\sigma, t) $$ denotes the drag coefficient. $$C_D(\sigma, t)$$ depends on time $$t$$ and the design parameters $$\sigma$$. The window-function is denoted by $$w$$.
73
-
There are different windows available. Depending on their smoothness, they have different regularizing effects on the timeaverage and its sensitivity and therefore, the windowed time
74
-
average converges with different speed to the periodaverage.
74
+
There are different windows available. Depending on their smoothness, they have different regularizing effects on the time-average and
75
+
its sensitivity and therefore, the windowed time-average converges with different speed to the period-average.
75
76
The following options are implemented:
76
77
77
78
| Window | Convergence Order | Convergence Order (sensitivity) |
@@ -82,36 +83,40 @@ The following options are implemented:
82
83
|`BUMP`| exponential | exponential |
83
84
84
85
85
-
For each optimization run, we have to compute the sensitivity of above windowed timeaverage, that reads
86
+
For each optimization run, we have to compute the sensitivity of above windowed time-average, which reads
Figure 2 shows the time dependent drag and its sensitivity. As one can see, the amplitude of the drag sensitivity grows faster than linear. This is the reason why Square-windowing
90
-
is not a viable option for many application cases.
90
+
Figure 2 shows the time dependent drag and its sensitivity. As one can see, the amplitude of the drag sensitivity grows faster than
91
+
linear. Roughly speaking, windowed time-average must converge faster than the amplitude of the oscillation grows to ensure convergence.
92
+
This is the reason why Square-windowing is not a viable option for many application cases.
91
93
92
94

93
95
Figure (2): Instantaneous drag and drag sensitivity shown. The time frame to average the drag coefficient is in between iteration $$n_{tr} = 1500 $$ and $$N=2200$$.
94
96
95
97
Using the midpoint rule for above integral, we arrive at the following constrained optimization problem
The optimization constraint is given by the windowed time-averaged lift, that should be greater than a specific value $$c$$. We choose arbitrarily as $$c=0.96$$, which is the windowed
102
-
time-averaged lift of the baseline geometry.
106
+
time-averaged lift of the baseline geometry. The time-span to average both lift and drag is given by $$M =N-n_{tr}$$.
103
107
104
108
105
109
### Configuration File Options ###
106
110
107
-
To compute the unsteady shape-optimization, we set up the unsteady simulation according to our test case above. More information about unsteady simulations can be found [here](../Unsteady_NACA0012.md)
111
+
To compute the unsteady shape-optimization, we set up the unsteady simulation according to our test case above.
112
+
More information about setting up unsteady simulations can be found [here](../Unsteady_NACA0012)
108
113
109
114
```
110
115
% -------- UNSTEADY SIMULATION -----------------%
111
116
%
112
117
TIME_DOMAIN = YES
113
118
%
114
-
% Numerical Method for Unsteady simulation(NO, TIME_STEPPING, DUAL_TIME_STEPPING-1ST_ORDER, DUAL_TIME_STEPPING-2ND_ORDER, TIME_SPECTRAL)
119
+
% Numerical Method for Unsteady simulation
115
120
TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER
116
121
%
117
122
% Time Step for dual time stepping simulations (s)
@@ -144,7 +149,7 @@ it may happen that the adjoint inner iterator needs more iterations to reach a s
144
149
correct sensitivity results.
145
150
146
151
Note, that the adjoint iterator runs backwards in time, i.e. it starts at iteration given by `UNST_ADJOINT_START_ITER` and ends at iteration 0.
147
-
We set the start iter to the final iteration of the direct run, i.e. `UNST_ADJOINT_START_ITER = TIME_ITER = 2200`.
152
+
We set the start iteration to the final iteration of the direct run, i.e. `UNST_ADJOINT_START_ITER = TIME_ITER = 2200`.
148
153
The time to average the objective and constraint function is given by the option `ITER_AVERAGE_OBJ`. Here we set `ITER_AVERAGE_OBJ=TIME_ITER-WINDOW_START_ITER=700`.
149
154
150
155
```
@@ -198,10 +203,11 @@ With each design iteration, the direct and adjoint solutions are used to compute
198
203
ITER_AVERAGE_OBJ = 250
199
204
```
200
205
201
-
Note, that this configuration will produce different designs. To best showcase the difference between the windowing function, the original configuration is recommended.
206
+
Note, that this configuration may produce different designs. To best showcase the difference between the windowing function, the original configuration is recommended.
202
207
203
208
204
209
2. The python script will drive the optimization process by executing flow solutions, adjoint solutions, gradient projection, geometry evaluations, and mesh deformation in order to drive the design toward an optimum. The optimization process will cease when certain tolerances set within the SciPy optimizer are met.
210
+
205
211
3. Solution files containing the flow and surface data will be written for each flow solution and adjoint solution and can be found in the DESIGNS directory that is created. The file named history_project.dat (or history_project.csv for ParaView) will contain the functional values of interest resulting from each evaluation during the optimization. The major iterations and function evaluations for the SLSQP optimizer will be written to the console during execution.
0 commit comments