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

of_func.dat not found when running shape_optimization.py

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2016, 12:39
Default of_func.dat not found when running shape_optimization.py
  #1
New Member
 
Jason Shih
Join Date: Jan 2015
Location: Xi'an China
Posts: 26
Rep Power: 11
dasssj is on a distinguished road
Hi, guys,
I copied the mesh file, configuration file , solution_flow.dat and solution_adj_eff.dat to the work directory, and then run the shape_optimizaton.py but it showed the messege bellow:
Code:
Sequential Least SQuares Programming (SLSQP) parameters:
Number of design variables: 132
Objective function scaling factor: -0.1
Maximum number of iterations: 100
Requested accuracy: -1e-07
Initial guess for the independent variable(s): [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
Lower and upper bound for each independent variable: [(-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044), (-0.044, 0.044)]

Traceback (most recent call last):
  File "M100_shape_optimization.py", line 156, in <module>
    main()
  File "M100_shape_optimization.py", line 100, in main
    options.quiet        )
  File "M100_shape_optimization.py", line 139, in shape_optimization
    SU2.opt.SLSQP(project,x0,xb,its,accu)
  File "/home/voltron/SU2_intel/bin/SU2/opt/scipy_tools.py", line 128, in scipy_slsqp
    epsilon        = eps            )
  File "/home/voltron/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/scipy/optimize/slsqp.py", line 206, in fmin_slsqp
    constraints=cons, **opts)
  File "/home/voltron/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/scipy/optimize/slsqp.py", line 308, in _minimize_slsqp
    mieq = sum(map(len, [atleast_1d(c['fun'](x, *c['args'])) for c in cons['ineq']]))
  File "/home/voltron/SU2_intel/bin/SU2/opt/scipy_tools.py", line 211, in con_cieq
    cons = project.con_cieq(x)
  File "/home/voltron/SU2_intel/bin/SU2/opt/project.py", line 233, in con_cieq
    return self._eval(konfig, func,dvs)
  File "/home/voltron/SU2_intel/bin/SU2/opt/project.py", line 182, in _eval
    vals = design._eval(func,*args)
  File "/home/voltron/SU2_intel/bin/SU2/eval/design.py", line 142, in _eval
    vals = eval_func(*inputs)
  File "/home/voltron/SU2_intel/bin/SU2/eval/design.py", line 432, in con_cieq
    func = su2func(this_con,config,state)
  File "/home/voltron/SU2_intel/bin/SU2/eval/functions.py", line 93, in function
    geometry( func_name, config, state )
  File "/home/voltron/SU2_intel/bin/SU2/eval/functions.py", line 471, in geometry
    info = su2run.geometry(config)
  File "/home/voltron/SU2_intel/bin/SU2/run/geometry.py", line 98, in geometry
    functions = su2io.tools.read_plot(func_filename)
  File "/home/voltron/SU2_intel/bin/SU2/io/tools.py", line 80, in read_plot
    plot_file = open(filename)
IOError: [Errno 2] No such file or directory: 'of_func.dat'
Besides, when I have run the adjoint solver, renamed restart_adj_eff.dat to solution_adj_eff.dat, and then run SU2_DOT, for each design variable, the efficiency coefficient gradient was 0.
Code:
Design variable number 0.
Perform 3D deformation of the surface.
Update cartesian coord        | FFD box: WING_BOX. Max Diff: 4.04334e-05.
Evaluate functional gradient using the continuous adjoint strategy.
Efficiency coefficient gradient: 0.
My configuration file is attached bellow. Is anybody know what's going wrong?

Thanks in advance,

Jason Shih
Attached Files
File Type: txt M100_WING.cfg.txt (30.2 KB, 7 views)
dasssj is offline   Reply With Quote

Old   February 27, 2016, 08:32
Default
  #2
New Member
 
Jason Shih
Join Date: Jan 2015
Location: Xi'an China
Posts: 26
Rep Power: 11
dasssj is on a distinguished road
I have figured out why it could't find the file of_func.dat. In the cfg file, I set VALUE_OBJFUNC_FILENAME= of_eval.dat, and when I set VALUE_OBJFUNC_FILENAME= of_func.dat, then the problem was solved.

In SU2/run/geometry.py, line 76, the variable func_filename is explicitly set to "of_func.dat', is it a bug?

And is anybody know why the efficiency coefficient gradient is 0?

Best,

Jason Shih
dasssj is offline   Reply With Quote

Old   February 27, 2016, 10:59
Default
  #3
Super Moderator
 
Francisco Palacios
Join Date: Jan 2013
Location: Long Beach, CA
Posts: 404
Rep Power: 15
fpalacios is on a distinguished road
Thanks Jason,
About the first problem of_eval vs. of_func that is a bug that we should solve in the next minor release. Could you please report the problem in GitHub (https://github.com/su2code/SU2/issues)? Thanks!

About the second problem. We need more information. Could you please send us the screen output that you have when running SU2_DEF to compute the FFD information and SU2_DOT to evaluate the gradients? Please note that if the FFD box intersect the geometry it will freeze several planes to guaranty the continuity is the 2nd order derivative at the surface.

Best,
Francisco Palacios
fpalacios is offline   Reply With Quote

Old   February 27, 2016, 11:10
Default
  #4
New Member
 
Jason Shih
Join Date: Jan 2015
Location: Xi'an China
Posts: 26
Rep Power: 11
dasssj is on a distinguished road
Thanks for your reply, Francisco .

I deleted all the csv file before I run the SU2_DOT, that's why all the gradient are 0.

The problem is that the program do not tell me there are not csv file (surface_flow.csv and surface_adjoint.csv) which it will use to compute the gradient, is it a bug too?

The web browser returned a 404 error when I tried to open the Github link, so I'm sorry that I can't report the problem in Github.

Best,
Jason Shih
dasssj is offline   Reply With Quote

Old   July 8, 2016, 10:19
Default
  #5
Member
 
tom pratt
Join Date: Jan 2016
Posts: 55
Rep Power: 10
tomp1993 is on a distinguished road
Hi everyone,
i recently had the same issue with SU2 whilst trying to run my own M6 SST adjoint optimisation.
here is the error message:

Traceback (most recent call last):
File "/users/mep15xxx/M6turb/shape_optimization.py", line 155, in <module>
main()
File "/users/mep15xxx/M6turb/shape_optimization.py", line 99, in main
options.quiet )
File "/users/mep15xxx/M6turb/shape_optimization.py", line 138, in shape_optimization
SU2.opt.SLSQP(project,x0,xb,its,accu)
File "/users/mep15xxx/SU2/bin/SU2/opt/scipy_tools.py", line 128, in scipy_slsqp
epsilon = eps )
File "/usr/local/share/Python/Python-2.6.7/lib/python2.6/site-packages/scipy/optimize/slsqp.py", line 236, in fmin_slsqp
mieq = len(f_ieqcons(x))
File "/usr/local/share/Python/Python-2.6.7/lib/python2.6/site-packages/scipy/optimize/optimize.py", line 176, in function_wrapper
return function(x, *args)
File "/users/mep15txxx/SU2/bin/SU2/opt/scipy_tools.py", line 211, in con_cieq
cons = project.con_cieq(x)
File "/users/mep15xxx/SU2/bin/SU2/opt/project.py", line 233, in con_cieq
return self._eval(konfig, func,dvs)
File "/users/mep15xxx/SU2/bin/SU2/opt/project.py", line 182, in _eval
vals = design._eval(func,*args)
File "/users/mep15xxx/SU2/bin/SU2/eval/design.py", line 142, in _eval
vals = eval_func(*inputs)
File "/users/mep15xxx/SU2/bin/SU2/eval/design.py", line 432, in con_cieq
func = su2func(this_con,config,state)
File "/users/mep15xxx/SU2/bin/SU2/eval/functions.py", line 93, in function
geometry( func_name, config, state )
File "/users/mep15xxx/SU2/bin/SU2/eval/functions.py", line 471, in geometry
info = su2run.geometry(config)
File "/users/mep15xxx/SU2/bin/SU2/run/geometry.py", line 98, in geometry
functions = su2io.tools.read_plot(func_filename)
File "/users/mep15xxx/SU2/bin/SU2/io/tools.py", line 80, in read_plot
plot_file = open(filename)
IOError: [Errno 2] No such file or directory: 'of_func.dat'

I have now changed the value of:
% Output Objective function
VALUE_OBJFUNC_FILENAME= of_eval.dat

to:

of_func.dat

and it all seems to be working fine.

i shall try to submit this error to Github if it helps with debugging for the next release, cheers!

i will attach the full CFG file to this message for further clarity.M6NSopt.f
tomp1993 is offline   Reply With Quote

Reply

Tags
of_func.dat, optimization


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
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 05:18
[ICEM] Icem cfd 13.0 Ehab44 ANSYS Meshing & Geometry 46 July 6, 2016 05:44
Running UDF with Supercomputer roi247 FLUENT 4 October 15, 2015 14:41
I found Error while running the jet flow model Rafee OpenFOAM Post-Processing 0 November 16, 2014 09:14
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 flakid OpenFOAM Installation 16 December 28, 2010 09:48


All times are GMT -4. The time now is 15:55.