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

When will the optimization stop?

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

Like Tree1Likes
  • 1 Post By copeland

Reply
 
LinkBack Thread Tools Display Modes
Old   April 14, 2014, 12:13
Default When will the optimization stop?
  #1
New Member
 
emily
Join Date: Mar 2014
Posts: 15
Rep Power: 5
Emily1412 is on a distinguished road
According to the documentation Running SU2,"Objective functions (drag, lift, etc.) are determined running a direct flow solution in SU2_CFD and gradients are obtained using the adjoint solution. For each iteration in the design process, the mesh is deformed using SU2_MDC, and the analysis is repeated until a local optimum is reached."
I want to know that when will a local optimum be reached? What the exact meaning of it? It seems that it calls the SU2_CFD many times. How many DESIGNS/DSN_00x will be performed? When will the program terminate?
Hope for your reply!!
Emily1412 is offline   Reply With Quote

Old   May 15, 2014, 16:08
Default
  #2
Member
 
Sean R. Copeland
Join Date: Jan 2013
Posts: 40
Rep Power: 6
copeland is on a distinguished road
Hello Emily,

Your question is a good one -- and, in general, not one that has a single answer. The optimization in SU2 uses gradient based optimization techniques to evolve the initial design to the optimal design in the manner that's described in your quote from the website. A local optimum is determined using the KKT conditions (run a google search for this) -- but in principle it's a zero gradient and only small changes in the objective function value from the previous design. The tolerances for these conditions are set in the shape_optimization.py script. Feel free to open this python script and adjust them as you see fit.

The optimizer will call SU2 as many times as it needs until these KKT conditions are met. In general, there's no way to know how many times are required -- it depends on how well-behaved your problem is and how large your design space is.


Hope that helps,
Sean
zkdkeen likes this.
copeland is offline   Reply With Quote

Old   December 8, 2016, 17:00
Default How to stop and restart a shape optimization (shape_optimization.py)
  #3
New Member
 
Join Date: Nov 2013
Posts: 15
Rep Power: 6
beatlejuice is on a distinguished road
Hi,

our cluster has a 24 hour limitation for jobs. The usual way to deal with that is to write a script that stops the simulation before the 24 h end and qsub it again (restart from previous state).

Is there a proper and clean way to stop a shape optimization (shape_optimization.py) and to restart it?

For parallel_computation.py or continous_adjoint.py i make use of a runtime.dat to stop the simulation and do the restart in the usual way with the solution...dat files. This works fine. But unfortunately, this approach does not work for shape optimization procedure.

If anyone knows a way to handle this, i would appreciate it, if you could share this information =)

Thanks!
beatlejuice is offline   Reply With Quote

Old   December 9, 2016, 01:32
Default
  #4
hlk
Senior Member
 
Heather Kline
Join Date: Jun 2013
Posts: 267
Rep Power: 7
hlk is on a distinguished road
Quote:
Originally Posted by beatlejuice View Post
Hi,

our cluster has a 24 hour limitation for jobs. The usual way to deal with that is to write a script that stops the simulation before the 24 h end and qsub it again (restart from previous state).

Is there a proper and clean way to stop a shape optimization (shape_optimization.py) and to restart it?

For parallel_computation.py or continous_adjoint.py i make use of a runtime.dat to stop the simulation and do the restart in the usual way with the solution...dat files. This works fine. But unfortunately, this approach does not work for shape optimization procedure.

If anyone knows a way to handle this, i would appreciate it, if you could share this information =)

Thanks!
shape optimization can be restarted by appending ' -r project.pkl' to the command.
The project.pkl file should be created in the run directory during the shape optimization run.
hlk is offline   Reply With Quote

Old   December 10, 2016, 11:56
Default
  #5
New Member
 
Join Date: Nov 2013
Posts: 15
Rep Power: 6
beatlejuice is on a distinguished road
Thank you hlk,

restarting works like a charm ...

But how to stop the shape_optimization in a proper way? (at any state)

Thx in advance!

Sry for double post ...

Last edited by beatlejuice; December 15, 2016 at 07:09.
beatlejuice is offline   Reply With Quote

Old   December 15, 2016, 07:05
Default
  #6
New Member
 
Join Date: Nov 2013
Posts: 15
Rep Power: 6
beatlejuice is on a distinguished road
Thank you hlk,

restarting works like a charm ...

But how to stop the shape_optimization in a proper way? (at any state)

Thx in advance!
beatlejuice is offline   Reply With Quote

Old   December 16, 2016, 04:17
Default
  #7
hlk
Senior Member
 
Heather Kline
Join Date: Jun 2013
Posts: 267
Rep Power: 7
hlk is on a distinguished road
Quote:
Originally Posted by beatlejuice View Post
Thank you hlk,

restarting works like a charm ...

But how to stop the shape_optimization in a proper way? (at any state)

Thx in advance!
you can set a maximum number of iterations, or increase the tolerance such that the optimizer will exit sooner. Otherwise, you do need to Ctrl-C or otherwise force it to stop at the command line. SU2 does not have a built-in abort utility, so this won't produce as nice of output, it will just stop the current simulation.

Please see the config template provided with the code for those options, and you may also find the shape optimization tutorials helpful:
https://github.com/su2code/SU2/wiki/...nsonic-Airfoil
and
https://github.com/su2code/SU2/wiki/...f-a-Fixed-Wing
hlk is offline   Reply With Quote

Old   January 11, 2017, 09:21
Default
  #8
New Member
 
Join Date: Nov 2013
Posts: 15
Rep Power: 6
beatlejuice is on a distinguished road
I have one question left =)

Is there a way to restart the shape_optimization from a certain DSN (not the latest one)? I had a look into the project.pkl with the idea to modify it to achieve this behavior.... but the project.pkl file is to cryptic for me ...

Is there somebody who knows how to do this?
beatlejuice is offline   Reply With Quote

Old   January 11, 2017, 15:39
Default
  #9
hlk
Senior Member
 
Heather Kline
Join Date: Jun 2013
Posts: 267
Rep Power: 7
hlk is on a distinguished road
Quote:
Originally Posted by beatlejuice View Post
I have one question left =)

Is there a way to restart the shape_optimization from a certain DSN (not the latest one)? I had a look into the project.pkl with the idea to modify it to achieve this behavior.... but the project.pkl file is to cryptic for me ...

Is there somebody who knows how to do this?
The easiest way to do what you are talking about is to start a new optimization problem, using the desired design as the initial point. You will find the new mesh and solution files in the DSN subdirectory, you can copy these to a new directory and after some filename changes start the optimization just as you would otherwise.
hlk is offline   Reply With Quote

Old   January 15, 2017, 16:38
Default
  #10
New Member
 
Join Date: Nov 2013
Posts: 15
Rep Power: 6
beatlejuice is on a distinguished road
Thank you for your help, hlk!
beatlejuice is offline   Reply With Quote

Old   May 16, 2017, 02:46
Default
  #11
New Member
 
Floris
Join Date: Sep 2016
Location: Enschede, The Netherlands
Posts: 21
Rep Power: 3
WillemFloris is on a distinguished road
Hi there!

In the .cfg script there is an option "OPT_ACCURACY = XX", when the difference in objective function between each function call is less then value "XX" then the optimization will stop as well.

I am interested in an option which is similar to "OPT_ACCURACY". However I would like to apply this value to "NIT" instead of applying it to the FC. Does anyone knows how to do this?

Kind regards,

Floris van der Schuur
WillemFloris is offline   Reply With Quote

Reply

Tags
terminate

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
Total force optimization or pressure force optimization? robyTKD SU2 Shape Design 1 August 19, 2013 15:54
command TUI / Scheme for stop and continue calculate rayolau FLUENT 1 May 13, 2013 10:20
compiling firefoam Farshad_Noravesh OpenFOAM 27 December 24, 2012 05:21
FSI doesnt stop if i click stop button peterputer CFX 7 November 20, 2012 16:56
COMSOL: optimization applied to a laminar flow tdh89 Main CFD Forum 0 April 30, 2012 08:57


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