CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

The adjoint equation in the discrete adjoint solver

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 16, 2021, 05:47
Default The adjoint equation in the discrete adjoint solver
  #1
Member
 
Zhen ZHANG
Join Date: Jun 2018
Location: Beijing, China
Posts: 56
Rep Power: 8
Zhen ZHANG is on a distinguished road
Hi all,
I recently studied the discrete adjoint solver because I want to add some space varying design variables. I also learned the CoDi package. Here are my
understanding and questions.
Assuming f is the objective function, g is the control equation, p is the design variable, and x is the flow variable.
In an adjoint problem, we want to get df/dp. Let f_p be the partial derivative (f_p=partial f/partial p). We get

df/dp=f_p+lambda^T*g_p

where lambda is the adjoint variable and satisfies

(g_x)^T*lambda=-(f_x)^T

But in the solver, after starting recording, we register the solution and variables as the input, set dependencies, direct run, register the solution and the objective function as the output, and stop recording.

Q1: why do we need to register the solution of the direct solver as the output? Now they are both input and output.

And then in CDiscAdjSinglezoneDriver::Run(), we initialize the adjoint of the direct solver using the adjoint solver solution of the last step, set the derivative of the objective function as 1.0, compute the adjoint, extract derivatives of the solution and variables.

Q2: What are the derivatives of the solution and variables here? In the reverse mode and with the obj func derivative set to 1.0, they should be partial f/partial(). Is that right?

Q3: What does this iteration do? How does it solve the above adjoint equation?

Maybe there are some mistakes in the statement due to my limited understanding. I am grateful if you point them out.
Thank you!
Zhen ZHANG is offline   Reply With Quote

Old   July 16, 2021, 06:24
Default
  #2
Member
 
Zhen ZHANG
Join Date: Jun 2018
Location: Beijing, China
Posts: 56
Rep Power: 8
Zhen ZHANG is on a distinguished road
Add a question:

What is the calculated derivative of the direct solver's solution, i.e. the solution of the discrete adjoint solver?
Why does it differ from what we set to it in the function iteration->InitializeAdjoint() of CDiscAdjSinglezoneDriver::Run()?
Zhen ZHANG is offline   Reply With Quote

Old   July 16, 2021, 07:04
Default
  #3
pcg
Senior Member
 
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 13
pcg is on a distinguished road
Your description is based on g being a residual function, i.e. that converges to zero.
However, in SU2 g is a fixed-point iterator for the solution variables (hence both input and output).
The entire process was very well explained just 2 days ago here
https://su2foundation.org/su2conference2021/
https://drive.google.com/file/d/18Kq...deB4pzfqR/view
There will be a recording of Tobias' presentation at some point.
See also the initial implementation paper https://bibbase.org/network/publicat...thodinsu2-2016
pcg is offline   Reply With Quote

Old   July 16, 2021, 08:59
Default
  #4
Member
 
Zhen ZHANG
Join Date: Jun 2018
Location: Beijing, China
Posts: 56
Rep Power: 8
Zhen ZHANG is on a distinguished road
Thank you! I will read these materials.
Zhen ZHANG is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fail to converge when solving with a fabricated solution zizhou FLUENT 0 March 22, 2021 07:33
RANS discrete adjoint oscillating pgdelaserna SU2 3 August 25, 2019 05:32
[ANSYS Meshing] Help with element size sandri_92 ANSYS Meshing & Geometry 14 November 14, 2018 08:54
Star cd es-ice solver error ernarasimman STAR-CD 2 September 12, 2014 01:01
A question about discrete adjoint method Thomas Main CFD Forum 3 August 9, 2006 13:37


All times are GMT -4. The time now is 01:18.