|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Qi Wang
Join Date: Oct 2024
Posts: 7
Rep Power: 3 ![]() |
Dear SU2-ers,
I'm performing adjoint-based optimization for a last-step objective function (say, the -drag). I'm not sure whether the current framework is for time-averaged outputs or just the objective at the last time step. Where should I find that information and how can I make the objective function only at the last time step? |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 827
Rep Power: 23 ![]() |
Are you referring to this tutorial?
https://su2code.github.io/tutorials/..._Opt_NACA0012/ What do you want to change compared to this tutorial? |
|
|
|
|
|
|
|
|
#3 | |
|
New Member
Qi Wang
Join Date: Oct 2024
Posts: 7
Rep Power: 3 ![]() |
Quote:
One way I'm thinking about is to change the window function so that only the last time step has weight 1, and 0 for all other time steps. In CWindowingTools.cpp there is a function Code:
su2double CWindowingTools::GetWndWeight(WINDOW_FUNCTION windowId, unsigned long curTimeIter, unsigned long endTimeIter) {
switch (windowId) {
case WINDOW_FUNCTION::HANN: return HannWindow(curTimeIter, endTimeIter);
case WINDOW_FUNCTION::HANN_SQUARE: return HannSquaredWindow(curTimeIter, endTimeIter);
case WINDOW_FUNCTION::BUMP: return BumpWindow(curTimeIter, endTimeIter);
case WINDOW_FUNCTION::SQUARE: return 1.0;
}
return 1.0;
}
Code:
case WINDOW_FUNCTION::LAST_ONLY: return (curTimeIter == endTimeIter) ? 1.0 : 0.0; Another way is to change the averaging length. In Cconfig.cpp, line 5337, Code:
if (Iter_Avg_Objective == 0.0) {
Iter_Avg_Objective = nTimeIter;
}
I'm wondering whether changing this line to Iter_Avg_Objective = 1 would make the program perform optimization for objectives only at the last time step. Of course this is a very dirty fix. I'm new to SU2 and having been learning for two weeks. I'm looking for professional users that could advise me with better options. |
||
|
|
|
||
|
|
|
#4 | |
|
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 827
Rep Power: 23 ![]() |
Quote:
I still don't see how your setup differs from the tutorial, besides changing some numbers. |
||
|
|
|
||
![]() |
| Tags |
| adjoint solver, adjointoptimisation, design optimization, su2 |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| RANS shape optimization all gradients are zero | cfd-jg | SU2 Shape Design | 1 | February 28, 2025 04:11 |
| courant number increases to rather large values | 6863523 | OpenFOAM Running, Solving & CFD | 22 | July 6, 2023 00:48 |
| time step continuity problem in VAWT simulation | lpz_michele | OpenFOAM Running, Solving & CFD | 5 | February 22, 2018 20:50 |
| How to write k and epsilon before the abnormal end | xiuying | OpenFOAM Running, Solving & CFD | 8 | August 27, 2013 16:33 |
| Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 | bookie56 | OpenFOAM Installation | 8 | August 13, 2011 05:03 |