Error in Tutorial-Optimal Shape Design of a Fixed Wing
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. |
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 |
1 Attachment(s)
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! |
|
Quote:
|
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 |
1 Attachment(s)
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. |
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 |
Quote:
|
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? |
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. |
All times are GMT -4. The time now is 19:52. |