Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfooted committed Jan 10, 2025
1 parent 31bd154 commit 1f1a4fe
Showing 1 changed file with 40 additions and 45 deletions.
85 changes: 40 additions & 45 deletions SU2_CFD/src/solvers/CTurbSSTSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,56 +1040,51 @@ su2double CTurbSSTSolver::GetNearest_Neighbor(CGeometry *geometry, unsigned lon
su2double distance = 0.0;

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable distance is not used.
unsigned long Point_Normal;

/*--- Compute closest normal neighbor, note that the normal are oriented inwards ---*/
Point_Normal = 0;
// we use distance
dist_min = 0.0;
for (size_t iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); iNeigh++) {
size_t jPoint = geometry->nodes->GetPoint(iPoint, iNeigh);
if (geometry->nodes->GetViscousBoundary(jPoint) == false) {
su2double distance[MAXNDIM] = {0.0};
// compute distance between ipoint and jpoint (vector)
GeometryToolbox::Distance(nDim,
geometry->nodes->GetCoord(iPoint),
geometry->nodes->GetCoord(jPoint),
distance);
// get the edge
size_t iEdge = geometry->nodes->GetEdge(iPoint, iNeigh);
const su2double* Normal = geometry->edges->GetNormal(iEdge);
const su2double Area = GeometryToolbox::Norm(nDim, Normal);
su2double projdistance = abs(GeometryToolbox::DotProduct(nDim,distance,Normal) / Area);


// Take the interior node that is closest to the wall node.
// cout << "projected distance = " << projdistance << " , area="<< Area << endl;

Point_Normal = jPoint;
dist_min = projdistance;
}
}

Point_Normal = 0;
dist_min = 0.0;
for (size_t iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); iNeigh++) {
size_t jPoint = geometry->nodes->GetPoint(iPoint, iNeigh);
if (geometry->nodes->GetViscousBoundary(jPoint) == false) {
su2double distance[MAXNDIM] = {0.0};

Check notice

Code scanning / CodeQL

Declaration hides variable Note

Variable distance hides another variable of the same name (on
line 1040
).
// compute distance between ipoint and jpoint (vector)
GeometryToolbox::Distance(nDim,
geometry->nodes->GetCoord(iPoint),
geometry->nodes->GetCoord(jPoint),
distance);
// get the edge
size_t iEdge = geometry->nodes->GetEdge(iPoint, iNeigh);
const su2double* Normal = geometry->edges->GetNormal(iEdge);
const su2double Area = GeometryToolbox::Norm(nDim, Normal);
su2double projdistance = abs(GeometryToolbox::DotProduct(nDim,distance,Normal) / Area);

// Take the interior node that is closest to the wall node.
// cout << "projected distance = " << projdistance << " , area="<< Area << endl;

Point_Normal = jPoint;
dist_min = projdistance;
}
}

if (Point_Normal==0) {
//cout << "no point found at i = " << iPoint << endl;
su2double Area = 0.0;
su2double TwoVol = 2.0* (geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint));

//for (auto iVertex = 0u; iVertex < geometry->nVertex[iMarker]; iVertex++) {
if (Point_Normal==0) {
//cout << "no point found at i = " << iPoint << endl;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
su2double Area = 0.0;
su2double TwoVol = 2.0* (geometry->nodes->GetVolume(iPoint) + geometry->nodes->GetPeriodicVolume(iPoint));

for (size_t iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); ++iNeigh) {
size_t iEdge = geometry->nodes->GetEdge(iPoint, iNeigh);
size_t jPoint = geometry->nodes->GetPoint(iPoint, iNeigh);
for (size_t iNeigh = 0; iNeigh < geometry->nodes->GetnPoint(iPoint); ++iNeigh) {
size_t iEdge = geometry->nodes->GetEdge(iPoint, iNeigh);
size_t jPoint = geometry->nodes->GetPoint(iPoint, iNeigh);

if (geometry->nodes->GetViscousBoundary(jPoint) == true) {
const su2double* Normal = geometry->edges->GetNormal(iEdge);
Area = GeometryToolbox::Norm(nDim, Normal);
dist_min += TwoVol / Area;
//cout << " distmin = " << dist_min << " , vol = "<<TwoVol << " , Area=" << Area<< endl;
}
if (geometry->nodes->GetViscousBoundary(jPoint) == true) {
const su2double* Normal = geometry->edges->GetNormal(iEdge);
Area = GeometryToolbox::Norm(nDim, Normal);
dist_min += TwoVol / Area;
//cout << " distmin = " << dist_min << " , vol = "<<TwoVol << " , Area=" << Area<< endl;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
}

}
//cout << "distmin = " << dist_min << " , vol = "<<TwoVol << " , Area=" << Area<< endl;
}
}
//cout << "distmin = " << dist_min << " , vol = "<<TwoVol << " , Area=" << Area<< endl;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
}

return (dist_min);
}

0 comments on commit 1f1a4fe

Please sign in to comment.