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/)
-   -   Problem with FFD-based shape optimization: all gradients are zero (https://www.cfd-online.com/Forums/su2-shape-design/111879-problem-ffd-based-shape-optimization-all-gradients-zero.html)

praveen January 17, 2013 04:07

Problem with FFD-based shape optimization: all gradients are zero
 
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 ?

fpalacios January 18, 2013 21:20

5 Attachment(s)
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.

Attachment 18292

Attachment 18297

Attachment 18291

Attachment 18296

Attachment 18294

Thanks a lot for your feedback,

Best,
Francisco

praveen January 19, 2013 03:29

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.

fpalacios January 19, 2013 13:14

Quote:

Originally Posted by praveen (Post 402812)
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

praveen January 28, 2013 05:33

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'


praveen January 28, 2013 06:43

1 Attachment(s)
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 ?

fpalacios February 5, 2013 00:04

Yep, this is a visualization artifact that we are gonna solve as soon as possible.

Cheers,
Francisco

RcktMan77 October 2, 2013 20:39

Quote:

Originally Posted by fpalacios (Post 402874)
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.

fpalacios October 3, 2013 14:32

Quote:

Originally Posted by RcktMan77 (Post 454783)
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

RcktMan77 October 3, 2013 17:31

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!

fpalacios October 7, 2013 21:21

Quote:

Originally Posted by RcktMan77 (Post 454951)
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


All times are GMT -4. The time now is 20:04.