Skip to content
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

Solve segmentation faults for FULLMG_CYCLE #1362

Merged
merged 10 commits into from
May 17, 2022
7 changes: 6 additions & 1 deletion Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2694,7 +2694,12 @@ class CConfig {
* \brief Set the number of multigrid levels.
* \param[in] val_nMGLevels - Index of the mesh were the CFL is applied
*/
void SetMGLevels(unsigned short val_nMGLevels) { nMGLevels = val_nMGLevels; }
void SetMGLevels(unsigned short val_nMGLevels) {
nMGLevels = val_nMGLevels;
if( MGCycle == FULLMG_CYCLE ){
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved
SetFinestMesh(val_nMGLevels);
}
}

/*!
* \brief Get the index of the finest grid.
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/include/integration/CIntegration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CIntegration {
size; /*!< \brief MPI Size. */
bool Convergence, /*!< \brief To indicate if the flow solver (direct, adjoint, or linearized) has converged or not. */
Convergence_FSI, /*!< \brief To indicate if the FSI problem has converged or not. */
Convergence_FullMG; /*!< \brief Initial value of the residual to evaluate the convergence level. */
Convergence_FullMG; /*!< \brief To indicate if the full multigrid has converged or not. */

/*!
* \brief Do the space integration of the numerical system.
Expand Down
14 changes: 7 additions & 7 deletions SU2_CFD/include/solvers/CFVMFlowSolverBase.inl
Original file line number Diff line number Diff line change
Expand Up @@ -2516,10 +2516,8 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr

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

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

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

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

WallDistMod = GeometryToolbox::Distance(nDim, Coord, Coord_Normal);

/*--- Compute non-dimensional velocity and y+ ---*/

FrictionVel = sqrt(fabs(WallShearStress[iMarker][iVertex]) / Density);

if (!wallfunctions) {

if (!wallfunctions && geometry->nodes->GetDomain(iPoint)) {
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved
// for CMultiGridGeometry, the normal neighbor of halo nodes in not set
iPointNormal = geometry->vertex[iMarker][iVertex]->GetNormal_Neighbor();
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved
Coord_Normal = geometry->nodes->GetCoord(iPointNormal);
WallDistMod = GeometryToolbox::Distance(nDim, Coord, Coord_Normal);
YPlus[iMarker][iVertex] = WallDistMod * FrictionVel / (Viscosity / Density);
}

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

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

if ((geometry->nodes->GetDomain(iPoint)) && (Monitoring == YES)) {
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/src/solvers/CTurbSSTSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh

/*--- Single grid simulation ---*/

if (iMesh == MESH_0) {
if (iMesh == MESH_0 || config->GetMGCycle() == FULLMG_CYCLE) {
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down