Skip to content

Commit

Permalink
symmetry instead of full reflection in GG
Browse files Browse the repository at this point in the history
  • Loading branch information
bigfooted committed Feb 17, 2024
1 parent 0c21b48 commit 5e3b208
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
19 changes: 8 additions & 11 deletions SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,11 @@ cout << "viscous = " << config.GetViscous();
* 2. n.grad(v.t) = 0
* 3. t.grad(v.n) = 0
*/

for (size_t iMarker = 0; iMarker < geometry.GetnMarker(); ++iMarker) {
if (config.GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE) {
for (size_t iVertex = 0; iVertex < geometry.GetnVertex(iMarker); ++iVertex) {

size_t iPoint = geometry.vertex[iMarker][iVertex]->GetNode();
auto nodes = geometry.nodes;
// we need to set the gradient to zero for the entire marker to prevent double-counting
// points that are shared by other markers
//for (size_t iVar = varBegin; iVar < varEnd; ++iVar)
// for (size_t iDim = 0; iDim < nDim; ++iDim) gradient(iPoint, iVar, iDim) = 0.0;

su2double halfOnVol = 0.5 / (nodes->GetVolume(iPoint) + nodes->GetPeriodicVolume(iPoint));

/*--- Normal vector for this vertex (negate for outward convention). ---*/
const su2double* VertexNormal = geometry.vertex[iMarker][iVertex]->GetNormal();
Expand Down Expand Up @@ -262,8 +254,10 @@ cout << "viscous = " << config.GetViscous();
su2double ProjGradient = 0.0;
for (auto iDim = 0u; iDim < nDim; iDim++) ProjGradient += Grad_Reflected[iVar][iDim] * UnitNormal[iDim];

/*--- we do a perfect reflection here ---*/
for (auto iDim = 0u; iDim < nDim; iDim++)
Grad_Reflected[iVar][iDim] = Grad_Reflected[iVar][iDim] - 2.0 * ProjGradient * UnitNormal[iDim];
//Grad_Reflected[iVar][iDim] = Grad_Reflected[iVar][iDim] - 2.0 * ProjGradient * UnitNormal[iDim];

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Grad_Reflected[iVar][iDim] = Grad_Reflected[iVar][iDim] - 1.0 * ProjGradient * UnitNormal[iDim];
}
}

Expand Down Expand Up @@ -294,9 +288,12 @@ cout << "viscous = " << config.GetViscous();
ProjTangVelGrad += GradTangVel[iDim] * UnitNormal[iDim]; // grad([v*t])*n
}

/*--- we do a perfect reflection here ---*/
for (auto iDim = 0u; iDim < nDim; iDim++) {
GradNormVel[iDim] = GradNormVel[iDim] - 2.0 * ProjNormVelGrad * Tangential[iDim];
GradTangVel[iDim] = GradTangVel[iDim] - 2.0 * ProjTangVelGrad * UnitNormal[iDim];
//GradNormVel[iDim] = GradNormVel[iDim] - 2.0 * ProjNormVelGrad * Tangential[iDim];
//GradTangVel[iDim] = GradTangVel[iDim] - 2.0 * ProjTangVelGrad * UnitNormal[iDim];

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
GradNormVel[iDim] = GradNormVel[iDim] - 1.0 * ProjNormVelGrad * Tangential[iDim];
GradTangVel[iDim] = GradTangVel[iDim] - 1.0 * ProjTangVelGrad * UnitNormal[iDim];
}

/*--- Transfer reflected gradients back into the Cartesian Coordinate system:
Expand Down
5 changes: 5 additions & 0 deletions SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,11 @@ void CFVMFlowSolverBase<V, R>::BC_Sym_Plane(CGeometry* geometry, CSolver** solve
for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) {
const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode();


const su2double *coor = geometry->nodes->GetCoord(iPoint);
if ((coor[0]>-1) && (coor[0] < 0.0) && (coor[1] < 0.001))
cout <<val_marker<<" , "<<iPoint << ", coordinates = " << coor[0] << " , " << coor[1] << endl;

/*--- Halo points do not need to be considered. ---*/
if (!geometry->nodes->GetDomain(iPoint)) continue;

Expand Down

0 comments on commit 5e3b208

Please sign in to comment.