From c06e65ef87498ac766db62d35207814a5a24f3d2 Mon Sep 17 00:00:00 2001 From: Guillermo Suarez Date: Tue, 24 Aug 2021 11:11:23 +0200 Subject: [PATCH 1/5] Solve segmenation fault for FULLMG_CYCLE and SST solver. - In CTurbSSTSolver.cpp consider the FULLMG_CYCLE scenario - In CIntegration.hpp fixed the description for the variable "Convergence_FullMG" --- SU2_CFD/include/integration/CIntegration.hpp | 2 +- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/include/integration/CIntegration.hpp b/SU2_CFD/include/integration/CIntegration.hpp index 0293f5cb85e..d4e49178986 100644 --- a/SU2_CFD/include/integration/CIntegration.hpp +++ b/SU2_CFD/include/integration/CIntegration.hpp @@ -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. diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 5714acf219c..a7678d52cfe 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -64,7 +64,7 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh /*--- Single grid simulation ---*/ - if (iMesh == MESH_0) { + if (iMesh == MESH_0 || config->GetMGCycle() == FULLMG_CYCLE) { /*--- Define some auxiliary vector related with the residual ---*/ From a458251883dd4b4d93c5685e8f2e68cd5775ed4d Mon Sep 17 00:00:00 2001 From: Max Aehle Date: Tue, 9 Nov 2021 11:21:54 +0100 Subject: [PATCH 2/5] Update FinestMesh when nMGLevels is changed Co-authored-by: Guillermo Suarez --- Common/include/CConfig.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 897f5a0a6f0..5001283813e 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -2611,7 +2611,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 ){ + SetFinestMesh(val_nMGLevels); + } + } /*! * \brief Get the index of the finest grid. From f6f986ec256a1c47199703ef6540145506dbbdc3 Mon Sep 17 00:00:00 2001 From: Max Aehle Date: Thu, 11 Nov 2021 13:11:07 +0100 Subject: [PATCH 3/5] Compute YPlus for domain points only --- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 41173268cdd..a75a01d7dff 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -2474,10 +2474,8 @@ void CFVMFlowSolverBase::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(); @@ -2549,13 +2547,15 @@ void CFVMFlowSolverBase::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)) { + // for CMultiGridGeometry, the normal neighbor of halo nodes in not set + iPointNormal = geometry->vertex[iMarker][iVertex]->GetNormal_Neighbor(); + Coord_Normal = geometry->nodes->GetCoord(iPointNormal); + WallDistMod = GeometryToolbox::Distance(nDim, Coord, Coord_Normal); YPlus[iMarker][iVertex] = WallDistMod * FrictionVel / (Viscosity / Density); } @@ -2592,7 +2592,7 @@ void CFVMFlowSolverBase::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)) { From 1575510e0e8a8f57a8e627a7b2424a9190136244 Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Sun, 15 May 2022 18:32:43 +0100 Subject: [PATCH 4/5] Update Common/include/CConfig.hpp --- Common/include/CConfig.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index fa90074786f..52d9d462bf4 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -2696,7 +2696,7 @@ class CConfig { */ void SetMGLevels(unsigned short val_nMGLevels) { nMGLevels = val_nMGLevels; - if( MGCycle == FULLMG_CYCLE ){ + if (MGCycle == FULLMG_CYCLE) { SetFinestMesh(val_nMGLevels); } } From eef893e3fa7a1a4870fdcf4eebe94ef376260e4d Mon Sep 17 00:00:00 2001 From: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> Date: Sun, 15 May 2022 18:38:27 +0100 Subject: [PATCH 5/5] Apply suggestions from code review --- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index c99edbc00be..0860f66e88e 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -2587,7 +2587,7 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr FrictionVel = sqrt(fabs(WallShearStress[iMarker][iVertex]) / Density); - if (!wallfunctions && geometry->nodes->GetDomain(iPoint)) { + if (!wallfunctions && (MGLevel == MESH_0 || geometry->nodes->GetDomain(iPoint))) { // for CMultiGridGeometry, the normal neighbor of halo nodes in not set iPointNormal = geometry->vertex[iMarker][iVertex]->GetNormal_Neighbor(); Coord_Normal = geometry->nodes->GetCoord(iPointNormal);