-
Notifications
You must be signed in to change notification settings - Fork 848
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
[WIP] Fix cornernode normal #2392
base: develop
Are you sure you want to change the base?
Conversation
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.
I don't think this is the full fix.
First issue, at vertices shared by two markers we compute two normals for the same point, potentially resulting in different "normal neighbors". Then the result we get depends on whether markers are merged or not, their order, etc.
Then the distance we should use is the wall distance and not just the straight line between points.
So if you want to do something that doesn't break all cases you have the solution I mentioned in the issue
smallest non-zero wall distance of a neighbor of the wall point.
OK, so the 'normal angle' does not matter anymore in that case, we only have edge length (to an interior node) as requirement? |
I am very interested in a solution to this issue, as this particular bug has caused convergence issues for a long time (especially with the SST Models). Here is a comparison of 8.1.0 (with the corner of issues circled in red) and the fix_cornernode_normal version just created. It seems to be causing all of the wall distances to be miscalculated now. |
We only have wall distance as a requirement, not distance between nodes. |
OK, I changed it to wall distance. But still, the corner node has zero shear stress, so y+ = 0 in that case. But I do not think that this is problematic. |
Good point, in such cases we can probably use cbrt of the volume at that point to avoid a 0. |
I can introduce FindClosest_Neighbor, and use that for the walls in TurbSSTSolver. We can then phase out FindNearest_Neighbor over time. |
Just do what you need to do in the SST wall boundary condition for now |
@@ -260,7 +260,8 @@ | |||
/*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ | |||
|
|||
if (geometry->nodes->GetDomain(iPoint)) { | |||
const auto jPoint = geometry->vertex[iMarker][iVertex]->GetNormal_Neighbor(); | |||
const auto jPoint = geometry->vertex[iMarker][iVertex]->GetNearest_Neighbor(); | |||
//const auto jPoint = geometry->vertex[iMarker][iVertex]->GetNormal_Neighbor(); |
Check notice
Code scanning / CodeQL
Commented-out code Note
@@ -459,7 +460,8 @@ | |||
} else { // smooth wall | |||
|
|||
/*--- distance to closest neighbor ---*/ | |||
const auto jPoint = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); | |||
//const auto jPoint = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); |
Check notice
Code scanning / CodeQL
Commented-out code Note
@@ -507,7 +509,8 @@ | |||
for (auto iVertex = 0u; iVertex < geometry->nVertex[val_marker]; iVertex++) { | |||
|
|||
const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); | |||
const auto iPoint_Neighbor = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); | |||
//const auto iPoint_Neighbor = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); |
Check notice
Code scanning / CodeQL
Commented-out code Note
Y plus value of zero just means that the skin friction is zero there, right? which is expected since it is a stagnation point. Thus I don't understand where a division by zero should be occurring. Moreover, why are we computing the distance again to search for the closest one? Shouldn't we use the wall distance already computed? |
Proposed Changes
Give a brief overview of your contribution here in a few sentences.
Quick fix to issue #2383
The normal node is the interior node that is most normal to the edge. If the node is on the wall, it is only considered as normal node if no previous normal nodes were detected (just for the case that there are no normal nodes). A normal node that is on the wall can be overwritten by any interior node.
PR Checklist
pre-commit run --all
to format old commits.