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

Fix equivalent area calculation #1329

Merged
merged 69 commits into from
Aug 13, 2021

Conversation

snow54
Copy link
Contributor

@snow54 snow54 commented Jul 19, 2021

Proposed Changes

Give a brief overview of your contribution here in a few sentences.
Since #724, equivalent area calculation and its use as objective function when EQUIV_AREA is set to YES have not been functioning. I have moved SpecialOutput_SonicBoom from output_structure_legacy.cpp to CFlowOutput.cpp and called it out in CFlowCompOutput.cpp similarly to inverse design Cp function mentioned in #1311. This PR fixes #841.

This is my first PR on github, so let me know if I should fix anything.

Mesh file and TargetEA.dat
NACA64206_EA.zip

Related Work

Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.
#724
#1311
#841

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags, or simply --warnlevel=2 when using meson).
  • My contribution is commented and consistent with SU2 style.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to SU2 and thank you for the contribution!
Did you decide to open the PR based on the conference? (asking for statistical purposes 😄 )
Some comments below to improve this old code a little (if you want).
And other more important aspects of adding test cases.

If you want to join the dev meeting this Weds at 3pm UK (https://meet.jit.si/SU2_DevMeeting) to let us know of other things you are working on, or just to meet the current "voices" behind SU2 you are most welcome.

Cheers!

SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
Common/include/option_structure.hpp Outdated Show resolved Hide resolved
SU2_CFD/include/output/CFlowOutput.hpp Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
@snow54
Copy link
Contributor Author

snow54 commented Jul 19, 2021

@pcarruscag
Thank you for your quick review. I'll address your comments tomorrow or later.

I decided to open the PR because I wanted to use the function introduced by #1020. I kept using v6 but was having hard time getting adjoint to converge. Nevertheless, I looked at your presentation for the conference (I could not listen to your talk due to time zone) and it encouraged me too.

It would be interesting to join the dev meeting but it's a bit hard again due to time zone. Thanks for asking though.

@pcarruscag
Copy link
Member

Great!
I see, I will propose different times for the meetings on the Slack channel (https://join.slack.com/t/su2devteam/shared_invite/zt-af0uuqf8-8XNExKMV9G~UVsnkvi5uVA), even for some folks in the US it is very early.
Join the channel if you would like and you can help to pick better times, we want all aspects of SU2 to be accessible worldwide.

Copy link
Contributor

@TobiKattmann TobiKattmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @snow54 for tackling this 💐 . Especially for the effort on documenting the Testcase.

towards my chunk of suggestions: I am well aware that you took the effort to move that stuff from the legacy output to the new, making it work and and add a testcase. You are not responsible to clean other peoples code. But that said, I think it makes sense to now spend a few extra minutes for a little more cleaning. That might spare you some headache down the road as well. Especially now that there is a testcase one can be a bit more aggressive on that ;)

I am not sure if maybe forgot to localize one the loop variables so it might fail on that. (Note that you can add the suggestions to a batch and make it one commit in the files-tab of the PR)

Otherwise it looks good to me

Comment on lines +544 to +548
% MARKER_NEARFIELD needs to be defined on a circumferential boundary within
% calculation domain so that it captures pressure disturbance from the model.
% The boundary should have a structured grid with the same number of nodes
% along each azimuthal angle.
% To run inverse design using target equivalent area, TargetEA.dat is required.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

OPT_BOUND_UPPER= 2
OPT_BOUND_LOWER= -2
FIN_DIFF_STEP= 0.0001
DEFINITION_DV= ( 11, 1.0 | Wing | WING, 0, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 1, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 1, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 1, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 1, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 1, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 1, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 1, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 1, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 1, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 1, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 1, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 2, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 2, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 2, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 2, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 2, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 2, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 2, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 2, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 2, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 2, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 2, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 3, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 3, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 3, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 3, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 3, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 3, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 3, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 3, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 3, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 3, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 3, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 4, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 4, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 4, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 4, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 4, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 4, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 4, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 4, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 4, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 4, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 4, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 5, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 5, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 5, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 5, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 5, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 5, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 5, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 5, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 5, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 5, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 5, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 6, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 6, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 6, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 6, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 6, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 6, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 6, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 6, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 6, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 6, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 6, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 7, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 7, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 7, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 7, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 7, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 7, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 7, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 7, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 7, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 7, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 7, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 8, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 8, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 8, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 8, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 8, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 8, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 8, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 8, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 8, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 8, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 8, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 0, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 0, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 0, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 0, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 0, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 0, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 0, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 0, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 0, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 0, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 0, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 1, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 1, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 1, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 1, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 1, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 1, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 1, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 1, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 1, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 1, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 1, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 2, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 2, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 2, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 2, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 2, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 2, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 2, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 2, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 2, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 2, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 2, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 3, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 3, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 3, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 3, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 3, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 3, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 3, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 3, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 3, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 3, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 3, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 4, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 4, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 4, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 4, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 4, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 4, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 4, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 4, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 4, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 4, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 4, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 5, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 5, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 5, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 5, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 5, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 5, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 5, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 5, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 5, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 5, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 5, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 6, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 6, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 6, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 6, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 6, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 6, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 6, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 6, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 6, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 6, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 6, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 7, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 7, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 7, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 7, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 7, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 7, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 7, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 7, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 7, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 7, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 7, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 0, 8, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 8, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 2, 8, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 3, 8, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 4, 8, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 5, 8, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 6, 8, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 7, 8, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 8, 8, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 9, 8, 1, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 10, 8, 1, 0.0, 0.0, 1.0 )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: you can use \\ for line breaks i.e.

DEFINITION_DV= ( 11, 1.0 | Wing | WING, 0, 0, 0, 0.0, 0.0, 1.0 ); ( 11, 1.0 | Wing | WING, 1, 0, 0, 0.0, 0.0, 1.0 );
DEFINITION_DV= ( 11, 1.0 | Wing | WING, 0, 0, 0, 0.0, 0.0, 1.0 ); \\
( 11, 1.0 | Wing | WING, 1, 0, 0, 0.0, 0.0, 1.0 );

are equivalent. These superlong lines aren't really that easy to handle

Copy link
Contributor

@TobiKattmann TobiKattmann Aug 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, it is just a single \ but two should be fine as the rest of the line is ignored I think and the next line is appended. Note also that can be repeated as long as one likes (i.e. more than 1 line break for 1 option possible) ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix this. gedit on Ubuntu had difficulty opening this super long line, so it will make it easy to handle this.
This is a copy-and-paste from set_ffd_design_var.py, so it might be better to edit this python script so it provides outputs that are easier to handle.

SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
Comment on lines 809 to 814
su2double AoA = -(config->GetAoA()*PI_NUMBER/180.0);
su2double EAScaleFactor = config->GetEA_ScaleFactor(); // The EA Obj. Func. should be ~ force based Obj. Func.

const su2double Mach = config->GetMach();
const su2double Gamma = config->GetGamma();
const su2double Beta = sqrt(Mach*Mach-1.0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 on the lower ones. While you're at it, you might try to get others (like the upper ones) const as well if possible. Now that there is a working testcase

SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
@TobiKattmann
Copy link
Contributor

Yes, it occurs with the case I added. I haven't tested with single core. As far as I see in CPhysicalGeometry::MatchNearField,
the code looks for a nearest point to a point on the nearfield boundary. If it exceeds 1e-1 (which is usually the case if you have
real scale mesh), it prints this warning. I'm not sure what this is for. I'm ignoring it since I don't see an issue with this distance
exceeding 1e-1.

Concerning this: I understand this nearfield marker as an internal "boundary" which does not alter the usual solution process at all. It is just added to compute some interesting quantity one. So the Nearfield marker needs to be in the mesh right, at the end like all other boundary markers? As such it is defined using mesh points and therefore there should be no discrepancies between nearfield marker nodes and mesh nodes? Am i correct with that, if not please enlighten me what is actually happening :)

@pcarruscag
Copy link
Member

If that is what it is supposed to do we might have problems 😬

@pcarruscag
Copy link
Member

For example Green-Gauss gradients have an exclusion for internal boundaries but not for nearfield ones.

@snow54
Copy link
Contributor Author

snow54 commented Aug 13, 2021

Hi @TobiKattmann

Thank you for making lots of suggestions. I'm out of town now, so I'll address those once I get back later this week.

Yes, it occurs with the case I added. I haven't tested with single core. As far as I see in CPhysicalGeometry::MatchNearField,
the code looks for a nearest point to a point on the nearfield boundary. If it exceeds 1e-1 (which is usually the case if you have
real scale mesh), it prints this warning. I'm not sure what this is for. I'm ignoring it since I don't see an issue with this distance
exceeding 1e-1.

Concerning this: I understand this nearfield marker as an internal "boundary" which does not alter the usual solution process at all. It is just added to compute some interesting quantity one. So the Nearfield marker needs to be in the mesh right, at the end like all other boundary markers? As such it is defined using mesh points and therefore there should be no discrepancies between nearfield marker nodes and mesh nodes? Am i correct with that, if not please enlighten me what is actually happening :)

Yes, nearfield marker is just used to extract required physical quantities and should not alter the usual solution process at all. There should be no discrepancies between nearfield marker nodes and mesh nodes. I haven't checked this part of the code for a while but if I remember correctly, the "Bad match..." message is shown if there is discrepancy between a nearfield marker node and the nearest mesh node that is NOT on nearfield boundary.

For example Green-Gauss gradients have an exclusion for internal boundaries but not for nearfield ones.

@pcarruscag So, I need to make something similar to internal boundaries? The flowfield looked reasonable though except when I use the VENKATAKRISHNAN limiter where the nearfield boundary seemed to act like half permeable wall.

Co-authored-by: TobiKattmann <31306376+TobiKattmann@users.noreply.github.com>
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Aug 13, 2021

This pull request introduces 2 alerts and fixes 12 when merging 16d7e01 into 3f745be - view on LGTM.com

new alerts:

  • 2 for Comparison of narrow type with wide type in loop condition

fixed alerts:

  • 12 for Comparison of narrow type with wide type in loop condition

SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/output/CFlowOutput.cpp Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Aug 13, 2021

This pull request fixes 12 alerts when merging d5b43fa into 3f745be - view on LGTM.com

fixed alerts:

  • 12 for Comparison of narrow type with wide type in loop condition

@TobiKattmann
Copy link
Contributor

👍 This PR could be the one with the highest conversation count. very gud

@TobiKattmann
Copy link
Contributor

TobiKattmann commented Aug 13, 2021

@pcarruscag I guess the last to changes were in the equivalent area computation routine so they shouldn't alter the result of 'discadj_incomp_cylinder' in hybrid_regression_AD? Why does it fail?

In the flamelet PR I am currently fixing all regression tests and conflicts and I noticed in one of the recent runs that hybrid_regression_AD failed for a case which I couldn't explain at all. Rerunning the regression tests without any code modification solved that problem... so there seems to be some non-deterministic behavior maybe. @jblueh have you noticed such behaviour over at #1294 ?

@snow54
Copy link
Contributor Author

snow54 commented Aug 15, 2021

Thanks for merging this PR!

@snow54
Copy link
Contributor Author

snow54 commented Aug 15, 2021

Hi @TobiKattmann

Thank you for making lots of suggestions. I'm out of town now, so I'll address those once I get back later this week.

Yes, it occurs with the case I added. I haven't tested with single core. As far as I see in CPhysicalGeometry::MatchNearField,
the code looks for a nearest point to a point on the nearfield boundary. If it exceeds 1e-1 (which is usually the case if you have
real scale mesh), it prints this warning. I'm not sure what this is for. I'm ignoring it since I don't see an issue with this distance
exceeding 1e-1.

Concerning this: I understand this nearfield marker as an internal "boundary" which does not alter the usual solution process at all. It is just added to compute some interesting quantity one. So the Nearfield marker needs to be in the mesh right, at the end like all other boundary markers? As such it is defined using mesh points and therefore there should be no discrepancies between nearfield marker nodes and mesh nodes? Am i correct with that, if not please enlighten me what is actually happening :)

Yes, nearfield marker is just used to extract required physical quantities and should not alter the usual solution process at all. There should be no discrepancies between nearfield marker nodes and mesh nodes. I haven't checked this part of the code for a while but if I remember correctly, the "Bad match..." message is shown if there is discrepancy between a nearfield marker node and the nearest mesh node that is NOT on nearfield boundary.

I did more investigations. This "Bad match..." message is output in CPhysicalGeometry::MatchNearField and this function has SetDonorPoint. However, currently there is no GetDonorPoint except for periodic boundary condition. I don't believe this is used any more. I went back in history and found out that GetDonorPoint exists in CGridAdaptation::SetHomothetic_Adaptation2D in ver.6.2.0. I suspect this is for grid adaptation to make mesh finer to capture shock waves. In ver.7, grid adaptation related parameters in configuration template file are not used, so it appears that grid adaptation function is dead now.

@snow54
Copy link
Contributor Author

snow54 commented Aug 15, 2021

For example Green-Gauss gradients have an exclusion for internal boundaries but not for nearfield ones.

@pcarruscag So, I need to make something similar to internal boundaries? The flowfield looked reasonable though except when I use the VENKATAKRISHNAN limiter where the nearfield boundary seemed to act like half permeable wall.

I am doing some trials after NEARFIELD_BOUNDARY is excluded in computeGradientsGreenGauss like INTERNAL_BOUNDARY. The result looks more reasonable and also the issue I encountered with VENKATAKRISHNAN limiter appears to have been fixed. Can I add changes in this PR or should I create a new PR to address it?

@pcarruscag
Copy link
Member

There are near field boundary conditions in the code. But they are not called. We can cleanup this dead code.
You would need a new PR. If you open one, make sure your branch is in su2code and not in your fork. This will make it easier for us to help (you should have received an invite for the SU2 organizations right?)

@snow54
Copy link
Contributor Author

snow54 commented Aug 15, 2021

OK, I will create a new PR. Yes, I have received the invite.

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

Successfully merging this pull request may close these issues.

4 participants