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

Error in Tutorial-Optimal Shape Design of a Fixed Wing

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 23, 2013, 01:42
Default Error in Tutorial-Optimal Shape Design of a Fixed Wing
  #1
New Member
 
cfdbooks
Join Date: Jan 2013
Posts: 7
Rep Power: 13
cfdbooks2008 is on a distinguished road
I have installed the serial source version of SU2 on Ubuntu 12.10(64bit) and tried to run the Tutorial-Optimal Shape Design of a Fixed Wing. I tried the following steps:

$ 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
$ python shape_optimization.py -f inv_ONERAM6.cfg


Iter Time(s) Res[Rho] Res[RhoE] CLift(Total) CDrag(Total)
100 11.104851 -4.086491 -3.563917 0.285536 0.012296
101 11.098431 -4.098954 -3.568896 0.285536 0.012296
102 11.092136 -4.109356 -3.567447 0.285536 0.012296

------------------------- Exit Success (SU2_CFD) ------------------------

Traceback (most recent call last):
File "shape_optimization.py", line 676, in <module>
acc=1e-12, iprint=2, full_output=1, epsilon=1.0e-10)
File "/usr/lib/python2.7/dist-packages/scipy/optimize/slsqp.py", line 319, in fmin_slsqp
g = append(fprime(x),0.0)
File "/usr/lib/python2.7/dist-packages/scipy/optimize/optimize.py", line 176, in function_wrapper
return function(x, *args)
File "shape_optimization.py", line 319, in df
for key,value in Gradient_Dict.iteritems():
UnboundLocalError: local variable 'Gradient_Dict' referenced before assignment

After running SU2_CFD, the procedure stopped. It seems something wrong in shape_optimization.py. I'm sorry I don't know python. Could anybody help me? Thanks in advance.
cfdbooks2008 is offline   Reply With Quote

Old   January 27, 2013, 19:44
Default
  #2
Super Moderator
 
Francisco Palacios
Join Date: Jan 2013
Location: Long Beach, CA
Posts: 404
Rep Power: 15
fpalacios is on a distinguished road
Hi,
Could you please tell us what it the version of the Python, Numpy and SciPy that you are using?

Just in case, could you please also post the config file that you are using and the shape_optimization.py (we have different version of this script), and a file with all the screen output.

Best,
Francisco
fpalacios is offline   Reply With Quote

Old   January 27, 2013, 22:34
Default
  #3
New Member
 
cfdbooks
Join Date: Jan 2013
Posts: 7
Rep Power: 13
cfdbooks2008 is on a distinguished road
Quote:
Originally Posted by fpalacios View Post
Hi,
Could you please tell us what it the version of the Python, Numpy and SciPy that you are using?

Just in case, could you please also post the config file that you are using and the shape_optimization.py (we have different version of this script), and a file with all the screen output.

Best,
Francisco
Dear Francisco,
Thank you for your reply. The version of the Python is 2.7.3, Numpy is 1.6.2 and SciPy is 0.10.1+dfsg1-4. All these packages were installed using "sudo apt-get install" command. The files you need are in the attachment.

Regards!
Attached Files
File Type: gz files.tar.gz (14.0 KB, 7 views)
cfdbooks2008 is offline   Reply With Quote

Old   January 28, 2013, 02:04
Default
  #4
Member
 
Trent Lukaczyk
Join Date: Feb 2011
Location: Stanford, CA
Posts: 75
Rep Power: 15
rktchip is on a distinguished road
Hello,

Have you set your SU2_HOME and SU2_RUN variables? (an example here)

Thanks!
- Trent
rktchip is offline   Reply With Quote

Old   January 28, 2013, 02:28
Default
  #5
New Member
 
cfdbooks
Join Date: Jan 2013
Posts: 7
Rep Power: 13
cfdbooks2008 is on a distinguished road
Quote:
Originally Posted by rktchip View Post
Hello,

Have you set your SU2_HOME and SU2_RUN variables? (an example here)

Thanks!
- Trent
Yes. I have set the SU2_HOME and SU2_RUN variables as required.
cfdbooks2008 is offline   Reply With Quote

Old   January 28, 2013, 14:48
Default
  #6
Member
 
Trent Lukaczyk
Join Date: Feb 2011
Location: Stanford, CA
Posts: 75
Rep Power: 15
rktchip is on a distinguished road
In you config file it looks like you set RESTART_SOL = YES. This assumes that you have all preconverged solutions for your problem. For shape_optimization.py, this means you need a direct solution file (solution_flow.dat) and adjoint solution files (solution_adj_*.dat) for each objective and constraint function (drag and lift in this case).

So could you try to set RESTART_SOL=NO and make sure it works in this simpler case?

If this still doesn't work please upload the full and verbose command line output one more time and we'll keep sorting it out.

Thanks,
-Trent
rktchip is offline   Reply With Quote

Old   January 29, 2013, 00:45
Default
  #7
New Member
 
cfdbooks
Join Date: Jan 2013
Posts: 7
Rep Power: 13
cfdbooks2008 is on a distinguished road
Quote:
Originally Posted by rktchip View Post
In you config file it looks like you set RESTART_SOL = YES. This assumes that you have all preconverged solutions for your problem. For shape_optimization.py, this means you need a direct solution file (solution_flow.dat) and adjoint solution files (solution_adj_*.dat) for each objective and constraint function (drag and lift in this case).

So could you try to set RESTART_SOL=NO and make sure it works in this simpler case?

If this still doesn't work please upload the full and verbose command line output one more time and we'll keep sorting it out.

Thanks,
-Trent
Dear Trent

It still doesn't work. I tried the following steps:

$ 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
$ python shape_optimization.py -f inv_ONERAM6.cfg -g 1.0

The files you need are in the attachment.
Thanks.
Attached Files
File Type: gz files_new.tar.gz (19.3 KB, 4 views)
cfdbooks2008 is offline   Reply With Quote

Old   January 29, 2013, 03:24
Default
  #8
Member
 
Trent Lukaczyk
Join Date: Feb 2011
Location: Stanford, CA
Posts: 75
Rep Power: 15
rktchip is on a distinguished road
For shape_optimization.py, the option -g takes either 'Adjoint' or 'FinDiff'. I think you might mean -p 1 since you are running it in serial. Try running this command -

python shape_optimization.py -f inv_ONERAM6.cfg -p 1

Best,
-Trent
rktchip is offline   Reply With Quote

Old   January 29, 2013, 06:23
Default
  #9
New Member
 
cfdbooks
Join Date: Jan 2013
Posts: 7
Rep Power: 13
cfdbooks2008 is on a distinguished road
Quote:
Originally Posted by rktchip View Post
For shape_optimization.py, the option -g takes either 'Adjoint' or 'FinDiff'. I think you might mean -p 1 since you are running it in serial. Try running this command -

python shape_optimization.py -f inv_ONERAM6.cfg -p 1

Best,
-Trent
-g GRADIENT SCALE,- g 1.0 means GRADIENT SCALE is 1.0. The tutorial uses the same command. I will try your command later and tell you the result. Thanks.
cfdbooks2008 is offline   Reply With Quote

Old   January 29, 2013, 09:05
Default
  #10
New Member
 
cfdbooks
Join Date: Jan 2013
Posts: 7
Rep Power: 13
cfdbooks2008 is on a distinguished road
Hi, Trent,
The command( python shape_optimization.py -f inv_ONERAM6.cfg -p 1) worked. Thanks. Whether shoud I chage the item MATH_PROBLE from DIRECT to ADJOINT for this case?
cfdbooks2008 is offline   Reply With Quote

Old   January 29, 2013, 09:10
Default
  #11
Member
 
Trent Lukaczyk
Join Date: Feb 2011
Location: Stanford, CA
Posts: 75
Rep Power: 15
rktchip is on a distinguished road
great! i'm not sure where there was a gradient scale setting, but you can always check the python script inputs by asking for option -h

shape_optimization.py will take care of setting the mathproblem for you and it won't matter what it's set at before you start.

regards,
-trent

edit: ah -g was an old option we phased out. the tutorial has changed since to reflect this.

Last edited by rktchip; February 1, 2013 at 00:53.
rktchip 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
Design of a flapping wing aircraft yahya_azizi FLUENT 0 July 11, 2012 11:26
Question about aerodynamik design (rear wing) Zweeper FLUENT 0 March 24, 2010 06:15
[Other] Question about aerodynamik design (rear wing) Zweeper ANSYS Meshing & Geometry 1 March 23, 2010 08:35
Rigid Wing Design for Micro Air Vehicle A.M.Yang Main CFD Forum 0 March 7, 2002 04:32
Info: Short Course On Thermal Design of Electronic Equipment Arnold Free Main CFD Forum 0 August 10, 1999 10:18


All times are GMT -4. The time now is 14:26.