Skip to content

Illegal access to normal neighbor of halo vertex #1430

@maxaehle

Description

@maxaehle

Describe the bug
In CFVMFlowSolverBase<>::Friction_Forces, there is the following piece of code (permalink):

    /*--- Loop over the vertices to compute the forces ---*/
    
    for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) {
      iPoint = geometry->vertex[iMarker][iVertex]->GetNode();
      iPointNormal = geometry->vertex[iMarker][iVertex]->GetNormal_Neighbor();
      ...
    }

However, a normal neighbor exists only for vertices on the domain (see CMultiGridGeometry::FindNormal_Neighbor and CPhysicalGeometry::FindNormal_Neighbor), not for halo points.
Edit: The link for CPhysicalGeometry was wrong. CPhysicalGeometry actually computes the normal neighbors for halo points, CMultigridGeometry doesn't.

iPointNormal is needed to retrieve Coord_Normal, which is needed to compute WallDist/WallDistMod, which are needed to compute YPlus. To fix the above problem, I would therefore suggest to compute YPlus only for domain points.

Looking for locations where YPlus could be accessed (to see whether YPlus is needed on non-domain points), I found e.g. CTurbSSTSolver::SetTurbVars_WF. However there again the normal neighbor is accessed without checking that we're on a domain point, so likely this should also be changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions