Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to calculate function for Adjoint calculation #1727

Closed
AbhijithMoni opened this issue Aug 2, 2022 · 5 comments
Closed

Fails to calculate function for Adjoint calculation #1727

AbhijithMoni opened this issue Aug 2, 2022 · 5 comments
Labels

Comments

@AbhijithMoni
Copy link

For an inverse design problem, SU2 fails to calculate INVERSE_DESIGN_PRESSURE for adjoint calculation. SU2_CFD runs without any errors, while the solver enters the adjoint calculation design phase using the shape_optimization.py script it exhibits the following key error:

File "C:\SU2\bin\SU2\eval\functions.py", line 118, in function func_out = state['FUNCTIONS'][func_name] KeyError: 'INVERSE_DESIGN_PRESSURE'

I have attached the files used for the simulation. Any help is appreciated.

Thanks.

inverse_design.zip

@zhangzhen117
Copy link

Hi, I think the "aerodynamics" calculation does not start, because in line 91 of functions.py
if su2io.historyOutFields[func_name]['TYPE'] == 'COEFFICIENT' or su2io.historyOutFields[func_name]['TYPE'] == 'D_COEFFICIENT':
and the su2io.historyOutFields[INVERSE_DESIGN_PRESSURE]['TYPE']='DEFAULT'. I think modifying the historyMap.py may fix this error.
Hope this helps.

zhen

@AbhijithMoni
Copy link
Author

@zhangzhen117

Thank you so much for your input. I really appreciate your time and help.

I made the following changes in the historyMap.py as suggested:

'INVERSE_DESIGN_PRESSURE': {'DESCRIPTION': 'Cp difference for inverse design',
                             'GROUP': 'CP_DIFF',
                             'HEADER': 'Cp_Diff',
                             'TYPE': `'DEFAULT'}`

to


'INVERSE_DESIGN_PRESSURE': {'DESCRIPTION': 'Cp difference for inverse design',
                             'GROUP': 'CP_DIFF',
                             'HEADER': 'Cp_Diff',
                             'TYPE': 'COEFFICIENT'}

Now the solver enters the adjoint calculation and works fine. Thanks a lot.

@zhangzhen117
Copy link

Nice to hear that! You are welcome. @AbhijithMoni

@pcarruscag
Copy link
Member

I'm sorry but I have to say, this is why the code never evolves, you open an issue, get a solution for your problem, then close the issue without there being a pull request that actually fixes the problem for everyone else.

@AbhijithMoni
Copy link
Author

@pcarruscag, my sincere apologies for not redirecting it to a pull request. I will make sure to redirect to pull request if something comes up in future. Thanks for your help. Sorry again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants