Skip to content

Commit 5fc376e

Browse files
committed
Use Muscl and limiter from GlobalParams for ScalarSolver
1 parent 54a0c69 commit 5fc376e

4 files changed

Lines changed: 10 additions & 12 deletions

File tree

SU2_CFD/include/solvers/CScalarSolver.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ class CScalarSolver : public CSolver {
5757

5858
const bool Conservative; /*!< \brief Transported Variable is conservative. Solution has to be multiplied with rho. */
5959

60-
bool muscl; /*!< \brief Solver uses MUSCL reconstruction. */
61-
bool limiter; /*!< \brief Solver uses limiters. */
62-
6360
/*--- Shallow copy of grid coloring for OpenMP parallelization. ---*/
6461

6562
#ifdef HAVE_OMP

SU2_CFD/include/solvers/CScalarSolver.inl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ CScalarSolver<VariableType>::~CScalarSolver() {
7979

8080
template <class VariableType>
8181
void CScalarSolver<VariableType>::CommonPreprocessing(CGeometry *geometry, const CConfig *config, const bool Output) {
82+
/*--- Define booleans that are solver specific through CConfig's GlobalParams which have to be set in CFluidIteration
83+
* before calling these solver functions. ---*/
8284
const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT);
85+
const bool muscl = config->GetMUSCL();
86+
const bool limiter = (config->GetKind_SlopeLimit() != NO_LIMITER) &&
87+
(config->GetInnerIter() <= config->GetLimiterIter());
8388

8489
/*--- Clear residual and system matrix, not needed for
8590
* reducer strategy as we write over the entire matrix. ---*/
@@ -114,7 +119,12 @@ template <class VariableType>
114119
void CScalarSolver<VariableType>::Upwind_Residual(CGeometry* geometry, CSolver** solver_container,
115120
CNumerics** numerics_container, CConfig* config,
116121
unsigned short iMesh) {
122+
/*--- Define booleans that are solver specific through CConfig's GlobalParams which have to be set in CFluidIteration
123+
* before calling these solver functions. ---*/
117124
const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT);
125+
const bool muscl = config->GetMUSCL();
126+
const bool limiter = (config->GetKind_SlopeLimit() != NO_LIMITER) &&
127+
(config->GetInnerIter() <= config->GetLimiterIter());
118128

119129
/*--- Only reconstruct flow variables if MUSCL is on for flow (requires upwind) and turbulence. ---*/
120130
const bool musclFlow = config->GetMUSCL_Flow() && muscl && (config->GetKind_ConvNumScheme_Flow() == SPACE_UPWIND);

SU2_CFD/src/solvers/CSpeciesSolver.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ CSpeciesSolver::CSpeciesSolver(CGeometry* geometry, CConfig* config, unsigned sh
5858

5959
nDim = geometry->GetnDim();
6060

61-
/*--- Set whether MUSCL and limiters are used in this solver. ---*/
62-
muscl = config->GetMUSCL_Species();
63-
limiter = (config->GetKind_SlopeLimit_Species() != NO_LIMITER) &&
64-
(config->GetInnerIter() <= config->GetLimiterIter());
65-
6661
/*--- Single grid simulation ---*/
6762

6863
if (iMesh == MESH_0 || config->GetMGCycle() == FULLMG_CYCLE) {

SU2_CFD/src/solvers/CTurbSolver.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ CTurbSolver::CTurbSolver(CGeometry* geometry, CConfig *config, bool conservative
3737
: CScalarSolver<CTurbVariable>(geometry, config, conservative) {
3838
/*--- Store if an implicit scheme is used, for use during periodic boundary conditions. ---*/
3939
SetImplicitPeriodic(config->GetKind_TimeIntScheme_Turb() == EULER_IMPLICIT);
40-
41-
muscl = config->GetMUSCL_Turb();
42-
limiter = (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) &&
43-
(config->GetInnerIter() <= config->GetLimiterIter());
4440
}
4541

4642
CTurbSolver::~CTurbSolver() {

0 commit comments

Comments
 (0)