CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   SU2 (https://www.cfd-online.com/Forums/su2/)
-   -   Report bugs on discrete adj solver restart (https://www.cfd-online.com/Forums/su2/238818-report-bugs-discrete-adj-solver-restart.html)

Zhen ZHANG October 5, 2021 08:46

Report bugs on discrete adj solver restart
 
Hi all,

I met a problem when I used the discrete adjoint solver to restart the calculation.

First, the discrete adjoint solver gets converged (1e-12) and exports the restart file.

Second #1, read the restart file and calculate 1 step, the residual becomes 1e-2

Second #2, read the restart file and calculate 0 steps, Adjoint_Nu_Tilde differs from the converged values while other Ajdoint values keep exactly the same as before.

So maybe there are some bugs in the treatment of the discrete solver.

Btw, I used 30 cores with mpi, calculated 3D RANS with the S-A model and ROE scheme, and modified the second recording to calculate derivatives w.r.t the turbulent Prandtl number on each node. I am based on v7.2.0.

Zhen

pcg October 6, 2021 03:07

Hi Zhen,
There some known difficulties with restarting the adjoint mode.
But you should get the same results if you let it converge in the restarted run. Have you tried that?

TKatt October 6, 2021 06:29

Hi,


I am currently fixing a similar issue for CHT (flow + solid head conduction).


See https://github.com/su2code/SU2/issues/1395 for the approach I take to tackle the problem.


I am not fully understand your approach tbh.


Best Tobi

Zhen ZHANG October 6, 2021 21:51

Quote:

Originally Posted by pcg (Post 813682)
Hi Zhen,
There some known difficulties with restarting the adjoint mode.
But you should get the same results if you let it converge in the restarted run. Have you tried that?

Hi Pedro,

Thank you for your reply. Yes, when it converges again, I can get the same results. The only problem is it takes a long time. :)

Zhen

Zhen ZHANG October 6, 2021 22:07

Quote:

Originally Posted by TKatt (Post 813697)
Hi,


I am currently fixing a similar issue for CHT (flow + solid head conduction).


See https://github.com/su2code/SU2/issues/1395 for the approach I take to tackle the problem.


I am not fully understand your approach tbh.


Best Tobi

Hi Tobi,

Thank you for your reply, too. You focus on the residual with and without the restart. It is also my concern. But what I find is that the residual changes from 1e-12, a converged state, to 1e-2, after I restart the adjoint solver. So I need to calculate for about 20000 steps to let it converge again.

The possible reason is that the adjoint solution of the turbulence variable is not correctly stored in the restart file.

Zhen

pdp.aero October 7, 2021 13:20

Not sure if it helps your case, but had similar problem a while back.

If you use MG_ADJFLOW= YES it could be that. Run it with different number of cores like 12.

Zhen ZHANG October 7, 2021 23:34

Quote:

Originally Posted by pdp.aero (Post 813839)
Not sure if it helps your case, but had similar problem a while back.

If you use MG_ADJFLOW= YES it could be that. Run it with different number of cores like 12.

Hi Pay,

I did not use MG_ADJFLOW=YES, but I tried the suggestion. I tried with and without MG_ADJFLOW, also with different cores. That problem still occurred.

Still thank you for your suggestion:)

pdp.aero October 8, 2021 09:25

When your primal solution converges well but the adjoint solution is stable and yet takes lots of time to get converged you may use quasi new acceleration/stabilization.


The RELAXATION_FACTOR_ADJOINT has effects on acceleration. Number of cores has effects on convergence if you are using multi-grid.





% ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------%
%
% Frozen the slope limiter in the discrete adjoint formulation (NO, YES)
FROZEN_LIMITER_DISC= YES
%
% Frozen the turbulent viscosity in the discrete adjoint formulation (NO, YES)
FROZEN_VISC_DISC= YES
%
% Use an inconsistent spatial integration (primal-dual) in the discrete
% adjoint formulation. The AD will use the numerical methods in
% the ADJOINT-FLOW NUMERICAL METHOD DEFINITION section (NO, YES)
INCONSISTENT_DISC= YES
%
% Convective numerical method (JST, LAX-FRIEDRICH, ROE)
CONV_NUM_METHOD_ADJFLOW= JST
%
% Time discretization (RUNGE-KUTTA_EXPLICIT, EULER_IMPLICIT)
TIME_DISCRE_ADJFLOW= EULER_IMPLICIT
%
% Relaxation coefficient (also for discrete adjoint problems)
RELAXATION_FACTOR_ADJOINT= 2.0
%
% Enable (if != 0) quasi-Newton acceleration/stabilization of discrete adjoints
QUASI_NEWTON_NUM_SAMPLES= 10
%
% Reduction factor of the CFL coefficient in the adjoint problem
CFL_REDUCTION_ADJFLOW= 0.8
%
% Limit value for the adjoint variable
LIMIT_ADJFLOW= 1E6
%
% Use multigrid in the adjoint problem (NO, YES)
MG_ADJFLOW= YES

Zhen ZHANG October 9, 2021 06:35

Hi Pay,

It really helps! Setting both the quasi-Newton and the frozen increases the convergence speed by 10 times.

Thanks a lot!
Zhen

Zhen ZHANG October 9, 2021 07:04

Btw, by freezing the turbulent viscosity, the discrete adjoint solver continues to converge after reading the restart files. :)

pdp.aero October 9, 2021 08:12

Welcome.


Thank Pedro. He implemented this. I came across to it a while back.

Zhen ZHANG October 9, 2021 09:20

Thank both of you! It saves a lot of time in optimization.


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