-
Notifications
You must be signed in to change notification settings - Fork 847
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
Conversation
bool pointonAxis = false; | ||
|
||
bool chksamePoint = false; | ||
|
||
su2double dist_to_Axis = 0.0; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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
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.
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.
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.