CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 (https://www.cfd-online.com/Forums/su2/)
-   -   Wrong adjoint solution ONERA M6 euler test case (https://www.cfd-online.com/Forums/su2/149149-wrong-adjoint-solution-onera-m6-euler-test-case.html)

JanH February 26, 2015 12:50

Wrong adjoint solution ONERA M6 euler test case
 
Hello all,

I am using SU2 3.2.3 for my master thesis. However, I am experiencing some difficulties with regard to obtaining surface sensitivities.
In order to make sure I am running SU2 in the right way I went back to the test cases. I took the ONERA M6 euler optimization test case and compared my results with the reference results on the SU2 website. The direct flow solution I obtain is a match with the reference, but the adjoint solution is off and I cannot find why.. I am using the test case config file and mesh.

Any help is greatly appreciated.

I added the config file, the mesh, my adjoint solution, the convergence history and the adjoint plots (the reference plot and my solution) in the following dropbox link:
https://www.dropbox.com/sh/vnbfma5tp...NY4qu8zea?dl=0

Thanks in advance!

hlk March 1, 2015 17:34

Quote:

Originally Posted by JanH (Post 533549)
Hello all,

I am using SU2 3.2.3 for my master thesis. However, I am experiencing some difficulties with regard to obtaining surface sensitivities.
In order to make sure I am running SU2 in the right way I went back to the test cases. I took the ONERA M6 euler optimization test case and compared my results with the reference results on the SU2 website. The direct flow solution I obtain is a match with the reference, but the adjoint solution is off and I cannot find why.. I am using the test case config file and mesh.

Any help is greatly appreciated.

I added the config file, the mesh, my adjoint solution, the convergence history and the adjoint plots (the reference plot and my solution) in the following dropbox link:
https://www.dropbox.com/sh/vnbfma5tp...NY4qu8zea?dl=0

Thanks in advance!


Thank you for your question.
The first thing to try is to make sure that your testcases directory and su2 directory are updated to the master branch of the same SU2 version. Occasionally code changes require the settings to be tweaked, so if the versions do not match they are not guaranteed to work ideally. You will also want to check the convergence parameters - the test case may be set up to run only a few iterations and thus not be converged fully.

Since the optimization_euler/steady_oneram6 case is not included in the automatic regression tests, if the above does not work you may also try using the config file from cont_adj_euler/oneram6 (which IS included in the automated regression tests) with the modifications needed to do optimization. (But try the above first).

JanH March 2, 2015 04:19

Quote:

Originally Posted by hlk (Post 533911)
Thank you for your question.
The first thing to try is to make sure that your testcases directory and su2 directory are updated to the master branch of the same SU2 version. Occasionally code changes require the settings to be tweaked, so if the versions do not match they are not guaranteed to work ideally. You will also want to check the convergence parameters - the test case may be set up to run only a few iterations and thus not be converged fully.

Since the optimization_euler/steady_oneram6 case is not included in the automatic regression tests, if the above does not work you may also try using the config file from cont_adj_euler/oneram6 (which IS included in the automated regression tests) with the modifications needed to do optimization. (But try the above first).

Hi hlk,

thank you for your reply and help. I installed SU2v3.2.8 (I redirected the pythonpath to the new version and I ran "make clean" to be sure I removed all links to the old version) and I used the latest optimization_euler/steady_oneram6 test case (also v3.2.8).

The flow solution is again a perfect match but the adjoint solution is still off. (I let it converge until 1000 iter). This time the .vtk plot of the adjoint solution gives extreme surface sensitivities of <-50 and >10, and the .csv gives approximately the same surface sensitivities as when I ran the ONERMA M6 adjoint solver using SU2v3.2.3 (The difference between the .vtk and .csv files given by v3.2.8 is also very strange to me)

Afterwards I ran the cont_adj_euler/oneram6test case and it resulted in the same results as I described above.

I added the cont_adj_euler/oneram6 output files in the following dropbox link:
https://www.dropbox.com/sh/2qmljtdq1...pR3LNTyCa?dl=0

Thanks again,

JanH

hlk March 2, 2015 13:44

Quote:

Originally Posted by JanH (Post 533953)
Hi hlk,

thank you for your reply and help. I installed SU2v3.2.8 (I redirected the pythonpath to the new version and I ran "make clean" to be sure I removed all links to the old version) and I used the latest optimization_euler/steady_oneram6 test case (also v3.2.8).

The flow solution is again a perfect match but the adjoint solution is still off. (I let it converge until 1000 iter). This time the .vtk plot of the adjoint solution gives extreme surface sensitivities of <-50 and >10, and the .csv gives approximately the same surface sensitivities as when I ran the ONERMA M6 adjoint solver using SU2v3.2.3 (The difference between the .vtk and .csv files given by v3.2.8 is also very strange to me)

Afterwards I ran the cont_adj_euler/oneram6test case and it resulted in the same results as I described above.

I added the cont_adj_euler/oneram6 output files in the following dropbox link:
https://www.dropbox.com/sh/2qmljtdq1...pR3LNTyCa?dl=0

Thanks again,

JanH

Ok, this is most likely the problem:
A few months ago, for visualization only, the output sensitivities were changed to be the change in objective function per meter - which explains why the magnitudes are so different. This should not effect the optimization, it just means that we forgot to update the picture.
For your optimization, I recommend increasing the number of iterations (more than 1000 - you should set it high enough that it exits due to reaching the min residual bound), and adjusting the optimization settings such as the objective function scale. The first of these will help make sure that the solution converges, and the second will help make sure that the first few optimization steps do not take too large of a step.
If you are using RESTART_SOL=YES you might also consider changing it to "no" - this will require more iterations per solution but ensure that you are converging a solution for the deformed geometry (especially if the geometry changes by a large amount).

JanH March 5, 2015 04:03

I tried running the adjoint solver all night, it did 49000 iter and converged to a residual [Psi_Rho] of -5.273990. Is it useful to run it for an ever longer time? Maybe with a change in CFL coefficient to increase the convergence rate?

Is there a way I can verify the .csv file I obtained using my last run with a reference solution?

hlk March 5, 2015 04:08

Quote:

Originally Posted by JanH (Post 534496)
I tried running the adjoint solver all night, it did 49000 iter and converged to a residual [Psi_Rho] of -5.273990. Is it useful to run it for an ever longer time? Maybe with a change in CFL coefficient to increase the convergence rate?

Is there a way I can verify the .csv file I obtained using my last run with a reference solution?

That's probably fine, depending on how accurate you need it to be.
For more examples of running CFD and convergence parameters, please go through the tutorials available on github.
https://github.com/su2code/SU2/wiki

JanH March 6, 2015 11:58

2 Attachment(s)
I tested the last gained surface sensitivities by using SU2_DOT to get the sensitivity of lift w.r.t. the z-motion of one FFD control point. I checked if it corresponds to the sensitivity gained by finite differencing of that same control point. The solution is plotted in the attached file and is off by around 25%. When I let the adjoint solution run for 500 i.s.o 49000 iter the sensitivity is off with around 28%. This makes me think that running the adjoint solution for an even longer time will not help. It seems to be converging to an incorrect solution.

The FFD box I used and the control point I displaced are visible in the other file I attached (I displaced FFD control point x_index=1, y_index=1, z_index=2, hence the middle upper one).

Are there more settings I can change to make the adjoint solution converge to the correct solution?


All times are GMT -4. The time now is 12:19.