Skip to content

Commit 6ca6ec2

Browse files
authored
Merge pull request #1362 from suargi/fix_fullmultigrid
Solve segmentation faults for FULLMG_CYCLE
2 parents 2ce680a + eef893e commit 6ca6ec2

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

Common/include/CConfig.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2694,7 +2694,12 @@ class CConfig {
26942694
* \brief Set the number of multigrid levels.
26952695
* \param[in] val_nMGLevels - Index of the mesh were the CFL is applied
26962696
*/
2697-
void SetMGLevels(unsigned short val_nMGLevels) { nMGLevels = val_nMGLevels; }
2697+
void SetMGLevels(unsigned short val_nMGLevels) {
2698+
nMGLevels = val_nMGLevels;
2699+
if (MGCycle == FULLMG_CYCLE) {
2700+
SetFinestMesh(val_nMGLevels);
2701+
}
2702+
}
26982703

26992704
/*!
27002705
* \brief Get the index of the finest grid.

SU2_CFD/include/integration/CIntegration.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class CIntegration {
4949
size; /*!< \brief MPI Size. */
5050
bool Convergence, /*!< \brief To indicate if the flow solver (direct, adjoint, or linearized) has converged or not. */
5151
Convergence_FSI, /*!< \brief To indicate if the FSI problem has converged or not. */
52-
Convergence_FullMG; /*!< \brief Initial value of the residual to evaluate the convergence level. */
52+
Convergence_FullMG; /*!< \brief To indicate if the full multigrid has converged or not. */
5353

5454
/*!
5555
* \brief Do the space integration of the numerical system.

SU2_CFD/include/solvers/CFVMFlowSolverBase.inl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,10 +2516,8 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
25162516

25172517
for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) {
25182518
iPoint = geometry->vertex[iMarker][iVertex]->GetNode();
2519-
iPointNormal = geometry->vertex[iMarker][iVertex]->GetNormal_Neighbor();
25202519

25212520
Coord = geometry->nodes->GetCoord(iPoint);
2522-
Coord_Normal = geometry->nodes->GetCoord(iPointNormal);
25232521

25242522
Normal = geometry->vertex[iMarker][iVertex]->GetNormal();
25252523

@@ -2585,13 +2583,15 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
25852583
CSkinFriction[iMarker](iVertex,iDim) = TauTangent[iDim] * factorFric;
25862584
}
25872585

2588-
WallDistMod = GeometryToolbox::Distance(nDim, Coord, Coord_Normal);
2589-
25902586
/*--- Compute non-dimensional velocity and y+ ---*/
25912587

25922588
FrictionVel = sqrt(fabs(WallShearStress[iMarker][iVertex]) / Density);
2593-
2594-
if (!wallfunctions) {
2589+
2590+
if (!wallfunctions && (MGLevel == MESH_0 || geometry->nodes->GetDomain(iPoint))) {
2591+
// for CMultiGridGeometry, the normal neighbor of halo nodes in not set
2592+
iPointNormal = geometry->vertex[iMarker][iVertex]->GetNormal_Neighbor();
2593+
Coord_Normal = geometry->nodes->GetCoord(iPointNormal);
2594+
WallDistMod = GeometryToolbox::Distance(nDim, Coord, Coord_Normal);
25952595
YPlus[iMarker][iVertex] = WallDistMod * FrictionVel / (Viscosity / Density);
25962596
}
25972597

@@ -2628,7 +2628,7 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
26282628
HeatFlux[iMarker][iVertex] = thermal_conductivity_tr*dTn + thermal_conductivity_ve*dTven;
26292629
}
26302630

2631-
/*--- Note that y+, and heat are computed at the
2631+
/*--- Note that heat is computed at the
26322632
halo cells (for visualization purposes), but not the forces ---*/
26332633

26342634
if ((geometry->nodes->GetDomain(iPoint)) && (Monitoring == YES)) {

SU2_CFD/src/solvers/CTurbSSTSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh
5858

5959
/*--- Single grid simulation ---*/
6060

61-
if (iMesh == MESH_0) {
61+
if (iMesh == MESH_0 || config->GetMGCycle() == FULLMG_CYCLE) {
6262

6363
/*--- Define some auxiliary vector related with the residual ---*/
6464

0 commit comments

Comments
 (0)