CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 Shape Design (https://www.cfd-online.com/Forums/su2-shape-design/)
-   -   Transition between Direct and Adjoint (https://www.cfd-online.com/Forums/su2-shape-design/152955-transition-between-direct-adjoint.html)

RonSwanson May 13, 2015 08:21

Transition between Direct and Adjoint
 
I am using version 3.2.9 and there is an issue transferring between the direct flow solver and the adjoint.

My understanding of the process is as follows:
-Run Direct and converge solution
-Save restart file
-Start adjoint solver
-Open restart and read restart
-Run a single iteration and temporarily store data, printing residuals to screen *****
-Run adjoint and converge

My solution will converge log10 to -6 in the flow solver. However upon entering the adjoint the residual at stage **** is 10^-2.5 and subsequently my adjoint performs poorly.

I have looked at the iteration_structure.cpp file to try and force the solver to do for example 10000 iterations in place of one with the intention to return to 10^-6. To see if this is the root cause of my poor adjoint performance. However my lack of programming skills is limiting.

Is there something I am doing incorrectly? or is there a reasonably simple way to implement what I previously suggest? This occurs with both the continuous_adjoint.py script and manually.

Regards,
Ross

economon May 19, 2015 16:34

Hi,

Can you please clarify whether this is the direct residual in both instances, i.e., is the direct residual jumping from 10^-6 to 10^-2.5 after the single iteration of the direct solver?

Can you please provide a case that causes this issue, so that we can recreate it to check for a problem?

Thanks!
Tom

RonSwanson May 21, 2015 08:57

Tom,

Thanks for getting back to me. I am referring to the direct residual only when discussing iterations above.

The 10^6 appears every 40 iteration in the terminal when executing SU2_CFD in direct flow solving mode. The Direct residual 10^-2.5 appears in location XXXX, which I take from the introductory data print in terminal when the adjoint is executed and initialising:

------------------------------ Begin Solver -----------------------------
Begin direct solver to store flow data (single iteration).
Compute residuals to check the convergence of the direct problem.
log10[Maximum residual]: -XXXX, located at point 6437.
End direct solver, begin adjoint problem.


Maybe I have misunderstood the software but the problem almost certainly lies in my choice of turbulence model. A quick summary is SST causes a jump, SA doesn't. The single iteration at adjoint initialization is likely performed with SA each time.

I'm running an external aerodynamics problem, our preferred turbulence model is SST and this is what I use to solve flow, this works and provides good agreement with experimental data and almost identical results with a commercial CFD package. When transferring to adjoint I see a residual jump in XXXX, from 10^-6 to 10^-2.5.

However if I run the problem with Spal-Al I see a minimal change in the Direct residual between the direct flow solver and when printed in the adjoint at XXXX. Unfortunately I still see poor performance in the adjoint, so I'll continue to work at this.


I won't be able to provide a mesh of my problem unfortunately. However using the Flat plate RANS testcase, I did the following.

-Ran both SST and SA for direct flow solving to 1000 iterations, recorded last direct residual printed in both.

-Ran the adjoint for both seperately, SA produced no jump, SST produces jump at XXXX

-So I then restarted the SST case in the direct solver, but changed the turbulence model to SA. The direct residual print here in the direct solver upon restart is identical to XXXX when running SST in adjoint.


So it would appear in the initial single iteration ran in the adjoint it defaults to SA, this maybe intentional or not but the overall consequence was negligible. I assumed as I was using frozen viscosity in the adjoint my choice of turbulence model was mostly irrelevant.


Cheers,
Ross

Silver Silhouette April 27, 2017 04:58

Hello

I am currently running an airfoil optimization case using adjoint solver.
What I do is iteratively run the flow solver and adjoint solver without initializing. Is this correct?
Also after a certain number of iterations the adjoint solver or the flow solver doesn;t seem to converge. Initially i try to bring down the under relaxation factor. This converges the case up to a few more iterations then starts diverging again. However the mesh doesnt seem to have failed or there doesn't seem to a flow separation. Can i drive my solution to convergence using any other methods??
Or since it is an optimization problem should i stop when the solution diverges?


All times are GMT -4. The time now is 15:35.