|
[Sponsors] |
Error in Tutorial-Optimal Shape Design of a Fixed Wing |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 23, 2013, 01:42 |
Error in Tutorial-Optimal Shape Design of a Fixed Wing
|
#1 |
New Member
cfdbooks
Join Date: Jan 2013
Posts: 7
Rep Power: 13 |
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. |
|
January 27, 2013, 19:44 |
|
#2 |
Super Moderator
Francisco Palacios
Join Date: Jan 2013
Location: Long Beach, CA
Posts: 404
Rep Power: 15 |
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 |
|
January 27, 2013, 22:34 |
|
#3 | |
New Member
cfdbooks
Join Date: Jan 2013
Posts: 7
Rep Power: 13 |
Quote:
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! |
||
January 28, 2013, 14:48 |
|
#6 |
Member
Trent Lukaczyk
Join Date: Feb 2011
Location: Stanford, CA
Posts: 75
Rep Power: 15 |
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 |
|
January 29, 2013, 00:45 |
|
#7 | |
New Member
cfdbooks
Join Date: Jan 2013
Posts: 7
Rep Power: 13 |
Quote:
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. |
||
January 29, 2013, 03:24 |
|
#8 |
Member
Trent Lukaczyk
Join Date: Feb 2011
Location: Stanford, CA
Posts: 75
Rep Power: 15 |
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 |
|
January 29, 2013, 06:23 |
|
#9 |
New Member
cfdbooks
Join Date: Jan 2013
Posts: 7
Rep Power: 13 |
-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.
|
|
January 29, 2013, 09:05 |
|
#10 |
New Member
cfdbooks
Join Date: Jan 2013
Posts: 7
Rep Power: 13 |
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? |
|
January 29, 2013, 09:10 |
|
#11 |
Member
Trent Lukaczyk
Join Date: Feb 2011
Location: Stanford, CA
Posts: 75
Rep Power: 15 |
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. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |