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

Report bugs on discrete adj solver restart

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By pdp.aero

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 5, 2021, 09:46
Default Report bugs on discrete adj solver restart
  #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 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
Zhen ZHANG is offline   Reply With Quote

Old   October 6, 2021, 04:07
Default
  #2
pcg
Senior Member
 
Pedro Gomes
Join Date: Dec 2017
Posts: 466
Rep Power: 14
pcg is on a distinguished road
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?
pcg is offline   Reply With Quote

Old   October 6, 2021, 07:29
Default
  #3
Member
 
na
Join Date: Jul 2018
Posts: 90
Rep Power: 8
TKatt is on a distinguished road
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
TKatt is offline   Reply With Quote

Old   October 6, 2021, 22:51
Default
  #4
Member
 
Zhen ZHANG
Join Date: Jun 2018
Location: Beijing, China
Posts: 56
Rep Power: 8
Zhen ZHANG is on a distinguished road
Quote:
Originally Posted by pcg View Post
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 is offline   Reply With Quote

Old   October 6, 2021, 23:07
Default
  #5
Member
 
Zhen ZHANG
Join Date: Jun 2018
Location: Beijing, China
Posts: 56
Rep Power: 8
Zhen ZHANG is on a distinguished road
Quote:
Originally Posted by TKatt View Post
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
Zhen ZHANG is offline   Reply With Quote

Old   October 7, 2021, 14:20
Default
  #6
Senior Member
 
Pay D.
Join Date: Aug 2011
Posts: 166
Blog Entries: 1
Rep Power: 15
pdp.aero is on a distinguished road
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.
__________________
since every contribution counts, always good ones are appreciated!
pdp.aero is offline   Reply With Quote

Old   October 8, 2021, 00:34
Default
  #7
Member
 
Zhen ZHANG
Join Date: Jun 2018
Location: Beijing, China
Posts: 56
Rep Power: 8
Zhen ZHANG is on a distinguished road
Quote:
Originally Posted by pdp.aero View Post
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
Zhen ZHANG is offline   Reply With Quote

Old   October 8, 2021, 10:25
Default
  #8
Senior Member
 
Pay D.
Join Date: Aug 2011
Posts: 166
Blog Entries: 1
Rep Power: 15
pdp.aero is on a distinguished road
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 likes this.
__________________
since every contribution counts, always good ones are appreciated!
pdp.aero is offline   Reply With Quote

Old   October 9, 2021, 07:35
Smile
  #9
Member
 
Zhen ZHANG
Join Date: Jun 2018
Location: Beijing, China
Posts: 56
Rep Power: 8
Zhen ZHANG is on a distinguished road
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 is offline   Reply With Quote

Old   October 9, 2021, 08:04
Default
  #10
Member
 
Zhen ZHANG
Join Date: Jun 2018
Location: Beijing, China
Posts: 56
Rep Power: 8
Zhen ZHANG is on a distinguished road
Btw, by freezing the turbulent viscosity, the discrete adjoint solver continues to converge after reading the restart files.
Zhen ZHANG is offline   Reply With Quote

Old   October 9, 2021, 09:12
Default
  #11
Senior Member
 
Pay D.
Join Date: Aug 2011
Posts: 166
Blog Entries: 1
Rep Power: 15
pdp.aero is on a distinguished road
Welcome.


Thank Pedro. He implemented this. I came across to it a while back.
__________________
since every contribution counts, always good ones are appreciated!
pdp.aero is offline   Reply With Quote

Old   October 9, 2021, 10:20
Default
  #12
Member
 
Zhen ZHANG
Join Date: Jun 2018
Location: Beijing, China
Posts: 56
Rep Power: 8
Zhen ZHANG is on a distinguished road
Thank both of you! It saves a lot of time in optimization.
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
restart error in NEMO Solver hk.narahari SU2 0 July 29, 2021 11:27
The adjoint equation in the discrete adjoint solver Zhen ZHANG SU2 3 July 16, 2021 08:59
Working directory via command line Luiz CFX 4 March 6, 2011 21:02
ReactingFoam solver restart gcollecutt OpenFOAM Running, Solving & CFD 0 August 9, 2007 06:30
compressible two phase flow in CFX4.4 youngan CFX 0 July 2, 2003 00:32


All times are GMT -4. The time now is 13:42.