CFD Online URL
[Sponsors]
Home > Forums > SU2 Shape Design

Problem with FFD-based shape optimization: all gradients are zero

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 17, 2013, 05:07
Default Problem with FFD-based shape optimization: all gradients are zero
  #1
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 239
Blog Entries: 6
Rep Power: 8
praveen is on a distinguished road
Hello

I was doing a shape optimization with v1.1 which I am now trying with v2.0

With v2.0 I find that in the very first iteration, all gradients turn out to be zero. I attach below some output from the two versions of SU2_GPC

With v1.1:
Code:
---------- Start gradient evaluation using surface sensitivity ----------
Design variable number 0.
Read the FFD information from mesh file.
Number of chunks: 1
Chunk 0 -> # degrees: 5, 5, 1.
# corner points: 8, # control points: 72, # surface points: 2021.
Perform 3D deformation of the surface.
Starting cartesian coordinates computation...
Total time used (s): 0.07.
Max. difference using FFD (parametrics -> cartesians): 5.13019e-05.
Evaluate functional gradient using the continuous adjoint strategy.
Drag coefficient gradient: 0.0428569.
With v2.0:
Code:
---------- Start gradient evaluation using surface sensitivity ----------
Read the FFD information from mesh file.
1 Free Form Deformation (FFD) chunks.
1 Free Form Deformation (FFD) nested levels.
FFD box tag: 0. FFD box level: 0. Degrees: 5, 5, 1.
Number of parent boxes: 0. Number of child boxes: 0.
Corner points: 8. Control points: 72. Surface points: 0.
-------------------------------------------------------------------------

Design variable number 0.
Perform 3D deformation of the surface.
Update cartesian coord        | FFD box: 0. Max diff: 0.
Evaluate functional gradient using the continuous adjoint strategy.
Drag coefficient gradient: 0.
I noticed that while previous version identified 2021 surface points within the ffd box, the v2.0 says zero points. I have updated the specification of ffd box as below

Code:
NCHUNK= 1
NLEVEL= 1
CHUNK_TAG= 0
CHUNK_LEVEL= 0
CHUNK_DEGREE_I= 5
CHUNK_DEGREE_J= 5
CHUNK_DEGREE_K= 1
CHUNK_PARENTS= 0
CHUNK_CHILDREN= 0
CHUNK_CORNER_POINTS= 8
-0.5    0.0  -0.75
11.3    0.0  -0.75
9.1     2.5   -0.35
3.25    2.5   -0.35
-0.5    0.0   1.00
11.3    0.0   1.00
9.1     2.5   0.40
3.25    2.5   0.40
CHUNK_CONTROL_POINTS= 0
CHUNK_SURFACE_POINTS= 0
Any ideas what is wrong ? Is there any change in the input files for FFD ?
__________________
http://twitter.com/cfdlab
praveen is offline   Reply With Quote

Old   January 18, 2013, 22:20
Default
  #2
Super Moderator
 
Francisco Palacios
Join Date: Jan 2013
Location: Stanford, CA
Posts: 258
Rep Power: 4
fpalacios is on a distinguished road
Hi Praveen,
The optimization stuff in release 2.0 is much better than 1.1. In particular in 2.0 the entire optimization loop is in parallel (including deformation, gradient computation, etc.)

The specification of ffd box looks like fine. Just to be sure, could you please repeat the problem that we described in our last workshop. You can find the .pdf of the presentation here:

http://su2.stanford.edu/news/news_20130115.html

I also attach the config file and some pictures with the results.

optimization.jpg

FFD.jpg

inv_ONERAM6.cfg.zip

CLSens.jpg

CDSens.jpg

Thanks a lot for your feedback,

Best,
Francisco
fpalacios is offline   Reply With Quote

Old   January 19, 2013, 04:29
Default
  #3
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 239
Blog Entries: 6
Rep Power: 8
praveen is on a distinguished road
Hello Francisco

I ran the inviscid oneram6 optimization included in su2 and used your config file (changed EXT_ITER to 1000). The optimization stops after first iteration since all the gradients are zero. The entire directory is here (about 130 MB)

http://math.tifrbng.res.in/~praveen/...oneram6_v2.tgz

There is a "log" file inside that which contains the screen output.
__________________
http://twitter.com/cfdlab
praveen is offline   Reply With Quote

Old   January 19, 2013, 14:14
Default
  #4
Super Moderator
 
Francisco Palacios
Join Date: Jan 2013
Location: Stanford, CA
Posts: 258
Rep Power: 4
fpalacios is on a distinguished road
Quote:
Originally Posted by praveen View Post
Hello Francisco

I ran the inviscid oneram6 optimization included in su2 and used your config file (changed EXT_ITER to 1000). The optimization stops after first iteration since all the gradients are zero. The entire directory is here (about 130 MB)

http://math.tifrbng.res.in/~praveen/...oneram6_v2.tgz

There is a "log" file inside that which contains the screen output.
Mmm... as far I see the files mesh_ONERAM6_inv_?.su2 don't have any information about the parametric coordinates. Could you please try the following...
$ SU2_MDC inv_ONERAM6.cfg
$ mv mesh_out.su2 mesh_ONERAM6_inv_FFD.su2
change the name of the mesh input file in inv_ONERAM6.cfg
instead of MESH_FILENAME= mesh_ONERAM6_inv.su2
use MESH_FILENAME= mesh_ONERAM6_inv_FFD.su2

and run the continuous adjoint gradient computation and check that the gradients are not zero.
$ continuous_adjoint.py -f inv_ONERAM6.cfg -p 6

In short, if you are gonna do design, the .su2 mesh should contain all the FFD information (including parametric coordinates) from the very beginning. I also recommend to run the optimization scripts with RESTART_SOL= YES, so you need a flow and adjoint flow solution before starting the optimization process.

Best,
Francisco
fpalacios is offline   Reply With Quote

Old   January 28, 2013, 06:33
Default
  #5
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 239
Blog Entries: 6
Rep Power: 8
praveen is on a distinguished road
After following your instructions exactly, I am able to run the oneram6 problem.

But I am facing a problem for my own shape optimization case. I ran upto Step 5 but during Step 6 I get this error

Code:
------------------- Config file boundary information --------------------
Navier-Stokes wall boundary marker(s): TOP_SURFS, BOT_SURFS.
Far-field boundary marker(s): DOMAIIN.
Symmetry plane boundary marker(s): SYMM1, SYMM2.
WARNING: unrecognized option in the config. file: MG_RESTART_CYCLE.
WARNING: unrecognized option in the config. file: ONESHOT_CAUCHY_EPS.
WARNING: unrecognized option in the config. file: GRID_DEFORM_SOLVER.
WARNING: unrecognized option in the config. file: GRID_DEFORM_BOX.
WARNING: unrecognized option in the config. file: MG_RESTART_CYCLE.
WARNING: unrecognized option in the config. file: ONESHOT_CAUCHY_EPS.
WARNING: unrecognized option in the config. file: GRID_DEFORM_SOLVER.
WARNING: unrecognized option in the config. file: GRID_DEFORM_BOX.
WARNING: unrecognized option in the config. file: MG_RESTART_CYCLE.
WARNING: unrecognized option in the config. file: ONESHOT_CAUCHY_EPS.
WARNING: unrecognized option in the config. file: GRID_DEFORM_SOLVER.
WARNING: unrecognized option in the config. file: GRID_DEFORM_BOX.
WARNING: unrecognized option in the config. file: MG_RESTART_CYCLE.
WARNING: unrecognized option in the config. file: ONESHOT_CAUCHY_EPS.
WARNING: unrecognized option in the config. file: GRID_DEFORM_SOLVER.
WARNING: unrecognized option in the config. file: GRID_DEFORM_BOX.
WARNING: unrecognized option in the config. file: MG_RESTART_CYCLE.
WARNING: unrecognized option in the config. file: ONESHOT_CAUCHY_EPS.
WARNING: unrecognized option in the config. file: GRID_DEFORM_SOLVER.
WARNING: unrecognized option in the config. file: GRID_DEFORM_BOX.
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 5 in communicator MPI_COMM_WORLD 
with errorcode 1.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
There is no geometry file (CBoundaryGeometry)!
Press any key to exit...
There is no geometry file (CBoundaryGeometry)!
Press any key to exit...
--------------------------------------------------------------------------
mpirun has exited due to process rank 5 with PID 10600 on
node cfdlab exiting without calling "finalize". This may
have caused other processes in the application to be
terminated by signals sent by mpirun (as reported here).
--------------------------------------------------------------------------
[cfdlab:10594] 1 more process has sent help message help-mpi-api.txt / mpi-abort
[cfdlab:10594] Set MCA parameter "orte_base_help_aggregate" to 0 to see all help / error messages
Traceback (most recent call last):
  File "/home/praveen/opt/SU2v2.0/bin/continuous_adjoint.py", line 346, in <module>
    main()
  File "/home/praveen/opt/SU2v2.0/bin/continuous_adjoint.py", line 62, in main
    options.divide_grid  )
  File "/home/praveen/opt/SU2v2.0/bin/continuous_adjoint.py", line 291, in continuous_adjoint
    gradients = libSU2.get_GradientVals(objfunc_grad_filename)    
  File "/home/praveen/opt/SU2v2.0/bin/libSU2.py", line 379, in get_GradientVals
    gradfile = open(Grad_filename)
IOError: [Errno 2] No such file or directory: 'objfunc_grad_adj_turb.dat'
__________________
http://twitter.com/cfdlab
praveen is offline   Reply With Quote

Old   January 28, 2013, 07:43
Default
  #6
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 239
Blog Entries: 6
Rep Power: 8
praveen is on a distinguished road
The shape sensitivity does not look correct. I can see the domain partitions in the attached plot. Is this normal behaviour with parallel computation visualization ?
Attached Images
File Type: jpg export.jpg (34.2 KB, 22 views)
__________________
http://twitter.com/cfdlab
praveen is offline   Reply With Quote

Old   February 5, 2013, 01:04
Default
  #7
Super Moderator
 
Francisco Palacios
Join Date: Jan 2013
Location: Stanford, CA
Posts: 258
Rep Power: 4
fpalacios is on a distinguished road
Yep, this is a visualization artifact that we are gonna solve as soon as possible.

Cheers,
Francisco
fpalacios is offline   Reply With Quote

Old   October 2, 2013, 21:39
Default
  #8
New Member
 
Join Date: Jan 2010
Posts: 7
Rep Power: 6
RcktMan77 is on a distinguished road
Quote:
Originally Posted by fpalacios View Post
Mmm... as far I see the files mesh_ONERAM6_inv_?.su2 don't have any information about the parametric coordinates. Could you please try the following...
$ SU2_MDC inv_ONERAM6.cfg
$ mv mesh_out.su2 mesh_ONERAM6_inv_FFD.su2
change the name of the mesh input file in inv_ONERAM6.cfg
instead of MESH_FILENAME= mesh_ONERAM6_inv.su2
use MESH_FILENAME= mesh_ONERAM6_inv_FFD.su2

and run the continuous adjoint gradient computation and check that the gradients are not zero.
$ continuous_adjoint.py -f inv_ONERAM6.cfg -p 6

In short, if you are gonna do design, the .su2 mesh should contain all the FFD information (including parametric coordinates) from the very beginning. I also recommend to run the optimization scripts with RESTART_SOL= YES, so you need a flow and adjoint flow solution before starting the optimization process.

Best,
Francisco
I've followed your directions here, but the continuous_adjoint.py gives me the same result as using the shape_optimization.py script in that all the gradients are 0 and gradient evaluation doesn't detect an FFD box definition.
RcktMan77 is offline   Reply With Quote

Old   October 3, 2013, 15:32
Default
  #9
Super Moderator
 
Francisco Palacios
Join Date: Jan 2013
Location: Stanford, CA
Posts: 258
Rep Power: 4
fpalacios is on a distinguished road
Quote:
Originally Posted by RcktMan77 View Post
I've followed your directions here, but the continuous_adjoint.py gives me the same result as using the shape_optimization.py script in that all the gradients are 0 and gradient evaluation doesn't detect an FFD box definition.
Hi, We have had a workshop 2 days ago. at the end of
http://su2.stanford.edu/news/news_20130922.html
you will find a presentation and the config files for the optimal design of ONERA M6 using the current version of SU2 in the https://github.com/su2code repository (our recommendation is to fork the repository if you are gonna introduce any change in the code).

Best,
Francisco
fpalacios is offline   Reply With Quote

Old   October 3, 2013, 18:31
Default
  #10
New Member
 
Join Date: Jan 2010
Posts: 7
Rep Power: 6
RcktMan77 is on a distinguished road
Francisco,

Tom pointed out the issue I was having earlier this morning regarding how specification of FFD boxes has been re-defined in more recent versions of the code, but I appreciate you pointing to where the workshop materials have been posted on your site. Would you be willing to explain in a bit more detail how the MAX_THICKNESS_SEC? values being used as geometric constraints in addition to the lift coefficient were arrived at in the configuration file posted with this case? They don't seem to correspond to the max thickness values of the airfoil sections resulting from the geometry design code, so I was curious how one goes about setting these.

Thanks!
RcktMan77 is offline   Reply With Quote

Old   October 7, 2013, 22:21
Default
  #11
Super Moderator
 
Francisco Palacios
Join Date: Jan 2013
Location: Stanford, CA
Posts: 258
Rep Power: 4
fpalacios is on a distinguished road
Quote:
Originally Posted by RcktMan77 View Post
Francisco,

Tom pointed out the issue I was having earlier this morning regarding how specification of FFD boxes has been re-defined in more recent versions of the code, but I appreciate you pointing to where the workshop materials have been posted on your site. Would you be willing to explain in a bit more detail how the MAX_THICKNESS_SEC? values being used as geometric constraints in addition to the lift coefficient were arrived at in the configuration file posted with this case? They don't seem to correspond to the max thickness values of the airfoil sections resulting from the geometry design code, so I was curious how one goes about setting these.

Thanks!
Hi,

He have posted all the workshop documentation in

http://su2.stanford.edu/training.html

The use of MAX_THICKNESS_SEC is described in the workshop documentation

Best,
Francisco
fpalacios is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 06:59
Parametric runs and Optimization in ANSYS (Conjugate Heat Transfer Problem) cp_jef ANSYS 0 May 30, 2011 05:08
Velocity profiles problem behind the elbow (3D problem) kabat73 FLUENT 8 May 9, 2010 05:26
problem when running icoFoam on a complex shape flow field wendywu OpenFOAM 1 May 21, 2009 00:40
windows based STAR-CD screen viewing problem ? gary pem CD-adapco 2 February 25, 2008 20:33


All times are GMT -4. The time now is 16:54.