|
[Sponsors] |
Maybe a small bug in code of design.py in folder SU2_PY |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 1, 2022, 04:19 |
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 |
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 |
|
June 3, 2022, 06:37 |
|
#2 |
New Member
Haolin Zhi
Join Date: Apr 2022
Posts: 5
Rep Power: 4 |
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. |
|
Tags |
bug, optimization, python code |
|
|
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 |