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 periodic boundary condition for nodes on axis of rotation #840

Merged
merged 7 commits into from
Jan 13, 2020

Conversation

koodlyakshay
Copy link
Member

Proposed Changes

This is a very small fix for periodic boundary conditions. In the MatchPeriodic routine, there is a check to make sure we never map to the same point when finding periodic pairs. However, if a node lies on the axis of rotation it has to map on to itself. The checks in the MatchPeriodic routine does not allow for this possibility and this node would end up getting mapped to the nearest neighbor which will lead to wrong results.

This PR introduces a small modification to the MatchPeriodic routine that will allow nodes on the axis to map onto themselves.

Related Work

As a test, consider the dummy geometry below. The domain is periodic about the Z-axis. I added a wall BC in the middle of the domain and the flow is supposed to separate at that point. This case is not very realistic but the main idea was to have periodic boundaries with points on the axis of rotation. The domain and the boundary conditions are similar to what we typically have when solving turbine blades. I wasn't sure if I can share the geometry, so I made this dummy test case. This case diverges with the develop branch. The image is from an intermediate result using the fix.
sample_test_case_fix

A quick way to verify if the nodes are matched properly is to check the velocity on the nodes that lie on the axis of rotation. Due to the periodicity constraint, the velocities must be aligned with the axis (here the Z-axis) which can be seen here as well.

vel

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.

  • [ X] I am submitting my contribution to the develop branch.
  • [ X] My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags).
  • [ X] 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.

Comment on lines 7979 to 7983
bool pointonAxis = false;

bool chksamePoint = false;

su2double dist_to_Axis = 0.0;
Copy link
Member

Choose a reason for hiding this comment

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

Hi @koodlyakshay,
Please follow the most common naming convention (pointOnAxis, distToAxis).
Is this going to match points to themselves if they are on the axis?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @pcarruscag,

Fixed the naming scheme.
Also, yes the idea is to map the CV around a node on the axis on one periodic face with the corresponding CV around the same node on the other periodic face.

Copy link
Member

@talbring talbring left a comment

Choose a reason for hiding this comment

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

Looks like a reasonable fix to me. Thanks @koodlyakshay

@koodlyakshay koodlyakshay merged commit 47ffabb into develop Jan 13, 2020
@koodlyakshay koodlyakshay deleted the fix_periodic_bc_nodes_on_axis branch January 13, 2020 08:20
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.

3 participants