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

Maybe a small bug in code of design.py in folder SU2_PY

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2022, 04:19
Default Maybe a small bug in code of design.py in folder SU2_PY
  #1
New Member
 
Haolin Zhi
Join Date: Apr 2022
Posts: 5
Rep Power: 4
Haolin Zhi is on a distinguished road
Hello, every SU2 developer:

I'm reading the python codes of SU2-7.3.1 to figure out the whole framework of shape optimization. Here, I find a small irrational point in the definition of evalution of constraint gradients. (in SU2_PY/SU2/eval/design.py)

For example, we may add a weight coefficient to each equality/inequality constraint in the .cfg file. So in the python framework, the weight will be stored in <config['OPT_CONSTRAINT']['EQUALITY']['SCALE']>, right? When we compute the constraint as well as its gradients using SU2_CFD solver, the python code will get the constraint and gradients from the history files, and then multiple them with the weight (or SCALE), and then return the results to scipy_tools.py for optimization.

Look at line 429 in the function "con_ceq" in file "design.py", the resulted constraint is scaled by the SCALE parameter, which is no problem. Then look at line 477 in the gradient function "con_dceq", the resulted gradients are not scaled by the SCALE parameter, that I think it is irrational. The same problem also happens in the function "con_dcieq", the gradients of inequality constraints.

I think that the two gradients function for constraints should be scaled with the SCALE parameter, because at line 386 in the objective gradient function "obj_df", the computed objective gradients are indeed scaled.

I really appreciate any SU2 developer could check and critize my doubt. Maybe I'm wrong, because I am just a novice of SU2 code.

ZHI
Haolin Zhi is offline   Reply With Quote

Old   June 3, 2022, 06:37
Default
  #2
New Member
 
Haolin Zhi
Join Date: Apr 2022
Posts: 5
Rep Power: 4
Haolin Zhi is on a distinguished road
Sorry, everyone. I have seen the statement in .cfg file that this push factor does not affect the gradients of constraints.

So I mistook it.
Haolin Zhi is offline   Reply With Quote

Reply

Tags
bug, optimization, python code


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
why doesnt my code work for small Re No?? lostsoul Main CFD Forum 4 December 1, 2000 13:04
Open source CFD code development, possible? Dr. Yazid Bindar Main CFD Forum 27 July 18, 2000 01:18
State of the art in CFD technology Juan Carlos GARCIA SALAS Main CFD Forum 39 November 1, 1999 15:34
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 12:44
What kind of Cmmercial CFD code you feel well? Lans Main CFD Forum 13 October 27, 1998 11:20


All times are GMT -4. The time now is 00:31.