Skip to content

Commit fc97426

Browse files
authored
Merge pull request #2639 from joshkellyjak/feature_MUSCL_ramp
MUSCL Ramp options
2 parents 3dcd390 + 9e07ab8 commit fc97426

File tree

16 files changed

+167
-32
lines changed

16 files changed

+167
-32
lines changed

Common/include/CConfig.hpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,7 @@ class CConfig {
11061106
bool SpatialFourier; /*!< \brief option for computing the fourier transforms for subsonic non-reflecting BC. */
11071107
bool RampMotionFrame; /*!< \brief option for ramping up or down the motion Frame values */
11081108
bool RampOutlet; /*!< \brief option for ramping up or down the outlet values */
1109+
bool RampMUSCL;
11091110
bool RampRotatingFrame; /*!< \brief option for ramping up or down the motion Frame values */
11101111
bool RampTranslationFrame; /*!< \brief option for ramping up or down the outlet values */
11111112
bool RampOutletMassFlow; /*!< \brief option for ramping up or down the motion Frame values */
@@ -1122,6 +1123,13 @@ class CConfig {
11221123
array<su2double, N_POLY_COEFFS> kt_polycoeffs{{0.0}}; /*!< \brief Array for thermal conductivity polynomial coefficients. */
11231124
bool Body_Force; /*!< \brief Flag to know if a body force is included in the formulation. */
11241125

1126+
struct CMUSCLRampParam {
1127+
su2double RampMUSCLPower; /*!< \brief Exponent by which to raise the MUSCL ramp to the power of */
1128+
MUSCL_RAMP_TYPE Kind_MUSCLRamp; /*!< \brief The kind of MUSCL ramp */
1129+
unsigned long rampMUSCLCoeff[3]; /*!< \brief ramp MUSCL value coefficients for the COption class. */
1130+
} RampMUSCLParam;
1131+
su2double rampMUSCLValue; /*!< \brief Current value of the MUSCL ramp */
1132+
11251133
ENUM_STREAMWISE_PERIODIC Kind_Streamwise_Periodic; /*!< \brief Kind of Streamwise periodic flow (pressure drop or massflow) */
11261134
bool Streamwise_Periodic_Temperature; /*!< \brief Use real periodicity for Energy equation or otherwise outlet source term. */
11271135
su2double Streamwise_Periodic_PressureDrop; /*!< \brief Value of prescribed pressure drop [Pa] which results in an artificial body force vector. */
@@ -1352,6 +1360,8 @@ class CConfig {
13521360

13531361
void addUShortArrayOption(const string& name, int size, bool allow_fewer, unsigned short* option_field);
13541362

1363+
void addULongArrayOption(const string& name, int size, bool allow_fewer, unsigned long* option_field);
1364+
13551365
void addDoubleListOption(const string& name, unsigned short & size, su2double * & option_field);
13561366

13571367
void addShortListOption(const string& name, unsigned short & size, short * & option_field);
@@ -5208,6 +5218,12 @@ class CConfig {
52085218
*/
52095219
bool GetRampOutflow(void) const { return RampOutlet; }
52105220

5221+
/*!
5222+
* \brief Get MUSCL ramp option.
5223+
* \return Ramp MUSCL option
5224+
*/
5225+
bool GetMUSCLRamp(void) const { return RampMUSCL; }
5226+
52115227
/*!
52125228
* \brief General interface for accessing ramp coefficient information
52135229
* \return coeff for ramps
@@ -5218,6 +5234,23 @@ class CConfig {
52185234
else return 0;
52195235
};
52205236

5237+
/*!
5238+
* \brief Set MUSCL ramp value.
5239+
*/
5240+
void SetMUSCLRampValue(su2double ramp_value) { rampMUSCLValue = ramp_value; }
5241+
5242+
/*!
5243+
* \brief Get MUSCL ramp value.
5244+
* \return Ramp MUSCL value
5245+
*/
5246+
su2double GetMUSCLRampValue(void) const { return rampMUSCLValue; }
5247+
5248+
/*!
5249+
* \brief Get MUSCL ramp paramaters.
5250+
* \return Ramp MUSCL kind
5251+
*/
5252+
const CMUSCLRampParam& GetMUSCLRampParam(void) const { return RampMUSCLParam; }
5253+
52215254
/*!
52225255
* \brief Generic interface for setting monitor outlet values for the ramp.
52235256
*/

Common/include/option_structure.hpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,18 @@ enum TURBO_MARKER_TYPE{
19591959

19601960
enum class RAMP_TYPE{
19611961
GRID, /*!< \brief flag for rotational/translational ramps */
1962-
BOUNDARY /*!< \brief flag for pressure/mass flow ramps*/
1962+
BOUNDARY, /*!< \brief flag for pressure/mass flow ramps*/
1963+
MUSCL /*!< \brief flag for MUSCL ramps */
1964+
};
1965+
1966+
enum class MUSCL_RAMP_TYPE{
1967+
ITERATION, /*!< \brief flag for linear iteration-based ramp */
1968+
SMOOTH_FUNCTION /*!< \brief flag for smooth cosine ramp */
1969+
};
1970+
1971+
static const MapType<std::string, MUSCL_RAMP_TYPE> MUSCLRamp_Map = {
1972+
MakePair("ITERATION", MUSCL_RAMP_TYPE::ITERATION)
1973+
MakePair("SMOOTH_FUNCTION", MUSCL_RAMP_TYPE::SMOOTH_FUNCTION)
19631974
};
19641975

19651976
/*!

Common/src/CConfig.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,13 @@ void CConfig::addULongListOption(const string& name, unsigned short & size, unsi
409409
option_map.insert(pair<string, COptionBase *>(name, val));
410410
}
411411

412+
void CConfig::addULongArrayOption(const string& name, const int size, const bool allow_fewer, unsigned long* option_field) {
413+
assert(option_map.find(name) == option_map.end());
414+
all_options.insert(pair<string, bool>(name, true));
415+
COptionBase* val = new COptionArray<unsigned long>(name, size, allow_fewer, option_field);
416+
option_map.insert(pair<string, COptionBase *>(name, val));
417+
}
418+
412419
void CConfig::addStringListOption(const string& name, unsigned short & num_marker, string* & option_field) {
413420
assert(option_map.find(name) == option_map.end());
414421
all_options.insert(pair<string, bool>(name, true));
@@ -2009,6 +2016,16 @@ void CConfig::SetConfig_Options() {
20092016
addBoolOption("MUSCL_FLOW", MUSCL_Flow, true);
20102017
/*!\brief MUSCL_KAPPA_FLOW \n DESCRIPTION: Blending coefficient for the U-MUSCL scheme \ingroup Config*/
20112018
addDoubleOption("MUSCL_KAPPA_FLOW", MUSCL_Kappa_Flow, 0.0);
2019+
/*!\brief RAMP_MUSCL \n DESCRIPTION: Enable ramping of the MUSCL scheme from 1st to 2nd order using specified method*/
2020+
addBoolOption("RAMP_MUSCL", RampMUSCL, false);
2021+
/*! brief RAMP_OUTLET_COEFF \n DESCRIPTION: the 1st coeff is the ramp start iteration,
2022+
* the 2nd coeff is the iteration update frequenct, 3rd coeff is the total number of iterations */
2023+
RampMUSCLParam.rampMUSCLCoeff[0] = 0.0; RampMUSCLParam.rampMUSCLCoeff[1] = 1.0; RampMUSCLParam.rampMUSCLCoeff[2] = 500.0;
2024+
addULongArrayOption("RAMP_MUSCL_COEFF", 3, false, RampMUSCLParam.rampMUSCLCoeff);
2025+
/*!\brief RAMP_MUSCL_POWER \n DESRCIPTION: Exponent of the MUSCL ramp formulation */
2026+
addDoubleOption("RAMP_MUSCL_POWER", RampMUSCLParam.RampMUSCLPower, 1.0);
2027+
/*!\brief KIND_MUSCL_RAMP \n DESCRIPTION: The kind of MUSCL Ramp to be applied */
2028+
addEnumOption("KIND_MUSCL_RAMP", RampMUSCLParam.Kind_MUSCLRamp, MUSCLRamp_Map, MUSCL_RAMP_TYPE::ITERATION);
20122029
/*!\brief SLOPE_LIMITER_FLOW
20132030
* DESCRIPTION: Slope limiter for the direct solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/
20142031
addEnumOption("SLOPE_LIMITER_FLOW", Kind_SlopeLimit_Flow, Limiter_Map, LIMITER::VENKATAKRISHNAN);
@@ -4502,6 +4519,13 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
45024519
}
45034520
}
45044521

4522+
if(RampMUSCL && !DiscreteAdjoint){
4523+
if (RampMUSCLParam.RampMUSCLPower <= 0.0) SU2_MPI::Error("RAMP_MUSCL_POWER cannot be less than or equal to zero!", CURRENT_FUNCTION);
4524+
rampMUSCLValue = 0.0;
4525+
} else {
4526+
rampMUSCLValue = 1.0;
4527+
}
4528+
45054529
/*--- Check on extra Relaxation factor for Giles---*/
45064530
if(extrarelfac[1] > 0.5){
45074531
extrarelfac[1] = 0.5;
@@ -6993,6 +7017,21 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
69937017

69947018
auto PrintLimiterInfo = [&](const LIMITER kind_limiter, const su2double kappa) {
69957019
cout << "Second order integration in space, with slope limiter.\n";
7020+
if (RampMUSCL) {
7021+
cout << "Ramping MUSCL sheme from first to second order starting at iter " << RampMUSCLParam.rampMUSCLCoeff[RAMP_COEFF::INITIAL_VALUE]
7022+
<< ", ending at iter " << RampMUSCLParam.rampMUSCLCoeff[RAMP_COEFF::FINAL_ITER] + RampMUSCLParam.rampMUSCLCoeff[RAMP_COEFF::INITIAL_VALUE]
7023+
<< ", updating every " << RampMUSCLParam.rampMUSCLCoeff[RAMP_COEFF::UPDATE_FREQ] << " iterations." << endl;
7024+
string MUSCLRampType;
7025+
switch (RampMUSCLParam.Kind_MUSCLRamp) {
7026+
case MUSCL_RAMP_TYPE::ITERATION:
7027+
MUSCLRampType = "linear";
7028+
break;
7029+
case MUSCL_RAMP_TYPE::SMOOTH_FUNCTION:
7030+
MUSCLRampType = "cosine";
7031+
break;
7032+
}
7033+
cout << "Ramp applied according to a " << MUSCLRampType << " function, raised to the power " << RampMUSCLParam.RampMUSCLPower << "." << endl;
7034+
}
69967035
if (kappa != 0.0) cout << "U-MUSCL reconstruction, with coefficient: " << kappa << ".\n";
69977036
switch (kind_limiter) {
69987037
case LIMITER::NONE:

SU2_CFD/include/numerics_simd/flow/convection/common.hpp

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ FORCEINLINE Double musclReconstruction(const GradType& grad,
7171
const Double delta,
7272
size_t iVar,
7373
Double kappa,
74-
Double relax) {
74+
Double relax,
75+
Double ramp_val) {
7576
const Double proj = dot(grad[iVar], vector_ij);
76-
return relax * umusclProjection(proj, delta, kappa);
77+
return ramp_val * relax * umusclProjection(proj, delta, kappa);
7778
}
7879

7980
/*!
@@ -86,7 +87,8 @@ FORCEINLINE void musclUnlimited(Int iPoint,
8687
const Gradient_t& gradient,
8788
CPair<VarType>& V,
8889
Double kappa,
89-
Double relax) {
90+
Double relax,
91+
Double ramp_val) {
9092
constexpr auto nVarGrad = nVarGrad_ > 0 ? nVarGrad_ : VarType::nVar;
9193

9294
auto grad_i = gatherVariables<nVarGrad,nDim>(iPoint, gradient);
@@ -97,8 +99,8 @@ FORCEINLINE void musclUnlimited(Int iPoint,
9799
const Double delta_ij = V.j.all(iVar) - V.i.all(iVar);
98100

99101
/*--- U-MUSCL reconstructed variables ---*/
100-
const Double proj_i = musclReconstruction(grad_i, vector_ij, delta_ij, iVar, kappa, relax);
101-
const Double proj_j = musclReconstruction(grad_j, vector_ij, delta_ij, iVar, kappa, relax);
102+
const Double proj_i = musclReconstruction(grad_i, vector_ij, delta_ij, iVar, kappa, relax, ramp_val);
103+
const Double proj_j = musclReconstruction(grad_j, vector_ij, delta_ij, iVar, kappa, relax, ramp_val);
102104

103105
/*--- Apply reconstruction: V_L = V_i + 0.5 * dV_ij^kap ---*/
104106
V.i.all(iVar) += 0.5 * proj_i;
@@ -117,7 +119,8 @@ FORCEINLINE void musclPointLimited(Int iPoint,
117119
const Gradient_t& gradient,
118120
CPair<VarType>& V,
119121
Double kappa,
120-
Double relax) {
122+
Double relax,
123+
Double ramp_val) {
121124
constexpr auto nVarGrad = nVarGrad_ > 0 ? nVarGrad_ : VarType::nVar;
122125

123126
auto lim_i = gatherVariables<nVarGrad>(iPoint, limiter);
@@ -131,8 +134,8 @@ FORCEINLINE void musclPointLimited(Int iPoint,
131134
const Double delta_ij = V.j.all(iVar) - V.i.all(iVar);
132135

133136
/*--- U-MUSCL reconstructed variables ---*/
134-
const Double proj_i = musclReconstruction(grad_i, vector_ij, delta_ij, iVar, kappa, relax);
135-
const Double proj_j = musclReconstruction(grad_j, vector_ij, delta_ij, iVar, kappa, relax);
137+
const Double proj_i = musclReconstruction(grad_i, vector_ij, delta_ij, iVar, kappa, relax, ramp_val);
138+
const Double proj_j = musclReconstruction(grad_j, vector_ij, delta_ij, iVar, kappa, relax, ramp_val);
136139

137140
/*--- Apply reconstruction: V_L = V_i + 0.5 * lim * dV_ij^kap ---*/
138141
V.i.all(iVar) += 0.5 * lim_i(iVar) * proj_i;
@@ -150,7 +153,8 @@ FORCEINLINE void musclEdgeLimited(Int iPoint,
150153
const Gradient_t& gradient,
151154
CPair<VarType>& V,
152155
Double kappa,
153-
Double relax) {
156+
Double relax,
157+
Double ramp_val) {
154158
constexpr auto nVarGrad = nVarGrad_ > 0 ? nVarGrad_ : VarType::nVar;
155159

156160
auto grad_i = gatherVariables<nVarGrad,nDim>(iPoint, gradient);
@@ -162,8 +166,8 @@ FORCEINLINE void musclEdgeLimited(Int iPoint,
162166
const Double delta_ij_2 = pow(delta_ij, 2) + 1e-6;
163167

164168
/*--- U-MUSCL reconstructed variables ---*/
165-
const Double proj_i = musclReconstruction(grad_i, vector_ij, delta_ij, iVar, kappa, relax);
166-
const Double proj_j = musclReconstruction(grad_j, vector_ij, delta_ij, iVar, kappa, relax);
169+
const Double proj_i = musclReconstruction(grad_i, vector_ij, delta_ij, iVar, kappa, relax, ramp_val);
170+
const Double proj_j = musclReconstruction(grad_j, vector_ij, delta_ij, iVar, kappa, relax, ramp_val);
167171

168172
/// TODO: Customize the limiter function.
169173
const Double lim_i = (delta_ij_2 + proj_i*delta_ij) / (pow(proj_i,2) + delta_ij_2);
@@ -200,7 +204,8 @@ FORCEINLINE CPair<ReconVarType> reconstructPrimitives(Int iEdge, Int iPoint, Int
200204
LIMITER limiterType,
201205
const CPair<PrimVarType>& V1st,
202206
const VectorDbl<nDim>& vector_ij,
203-
const VariableType& solution) {
207+
const VariableType& solution,
208+
const su2double& ramp_val) {
204209
static_assert(ReconVarType::nVar <= PrimVarType::nVar);
205210

206211
const auto& gradients = solution.GetGradient_Reconstruction();
@@ -218,13 +223,13 @@ FORCEINLINE CPair<ReconVarType> reconstructPrimitives(Int iEdge, Int iPoint, Int
218223
constexpr auto nVarGrad = ReconVarType::nVar - 2;
219224
switch (limiterType) {
220225
case LIMITER::NONE:
221-
musclUnlimited<nVarGrad>(iPoint, jPoint, vector_ij, gradients, V, kappa, relax);
226+
musclUnlimited<nVarGrad>(iPoint, jPoint, vector_ij, gradients, V, kappa, relax, ramp_val);
222227
break;
223228
case LIMITER::VAN_ALBADA_EDGE:
224-
musclEdgeLimited<nVarGrad>(iPoint, jPoint, vector_ij, gradients, V, kappa, relax);
229+
musclEdgeLimited<nVarGrad>(iPoint, jPoint, vector_ij, gradients, V, kappa, relax, ramp_val);
225230
break;
226231
default:
227-
musclPointLimited<nVarGrad>(iPoint, jPoint, vector_ij, limiters, gradients, V, kappa, relax);
232+
musclPointLimited<nVarGrad>(iPoint, jPoint, vector_ij, limiters, gradients, V, kappa, relax, ramp_val);
228233
break;
229234
}
230235
/*--- Recompute density using the reconstructed pressure and temperature. ---*/

SU2_CFD/include/numerics_simd/flow/convection/roe.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class CRoeBase : public Base {
123123

124124
/*--- Recompute density and enthalpy instead of reconstructing. ---*/
125125
auto V = reconstructPrimitives<CCompressiblePrimitives<nDim,nPrimVarGrad> >(
126-
iEdge, iPoint, jPoint, gamma, gasConst, muscl, umusclKappa, nkRelax, typeLimiter, V1st, vector_ij, solution);
126+
iEdge, iPoint, jPoint, gamma, gasConst, muscl, umusclKappa, nkRelax, typeLimiter, V1st, vector_ij, solution, config.GetMUSCLRampValue());
127127

128128
/*--- Compute conservative variables. ---*/
129129

SU2_CFD/include/solvers/CScalarSolver.inl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ void CScalarSolver<VariableType>::Upwind_Residual(CGeometry* geometry, CSolver**
222222
for (auto iVar = 0u; iVar < solver_container[FLOW_SOL]->GetnPrimVarGrad(); iVar++) {
223223
const su2double V_ij = V_j[iVar] - V_i[iVar];
224224

225-
su2double Project_Grad_i = MUSCL_Reconstruction(Gradient_i[iVar], Vector_ij, V_ij, kappaFlow);
226-
su2double Project_Grad_j = MUSCL_Reconstruction(Gradient_j[iVar], Vector_ij, V_ij, kappaFlow);
225+
su2double Project_Grad_i = MUSCL_Reconstruction(Gradient_i[iVar], Vector_ij, V_ij, kappaFlow, config->GetMUSCLRampValue());
226+
su2double Project_Grad_j = MUSCL_Reconstruction(Gradient_j[iVar], Vector_ij, V_ij, kappaFlow, config->GetMUSCLRampValue());
227227

228228
if (limiterFlow) {
229229
Project_Grad_i *= Limiter_i[iVar];
@@ -251,8 +251,8 @@ void CScalarSolver<VariableType>::Upwind_Residual(CGeometry* geometry, CSolver**
251251
for (auto iVar = 0u; iVar < nVar; iVar++) {
252252
const su2double U_ij = Scalar_j[iVar] - Scalar_i[iVar];
253253

254-
su2double Project_Grad_i = MUSCL_Reconstruction(Gradient_i[iVar], Vector_ij, U_ij, kappa);
255-
su2double Project_Grad_j = MUSCL_Reconstruction(Gradient_j[iVar], Vector_ij, U_ij, kappa);
254+
su2double Project_Grad_i = MUSCL_Reconstruction(Gradient_i[iVar], Vector_ij, U_ij, kappa, config->GetMUSCLRampValue());
255+
su2double Project_Grad_j = MUSCL_Reconstruction(Gradient_j[iVar], Vector_ij, U_ij, kappa, config->GetMUSCLRampValue());
256256

257257
if (limiter) {
258258
Project_Grad_i *= Limiter_i[iVar];

SU2_CFD/include/solvers/CSolver.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,11 +587,12 @@ class CSolver {
587587
* \param[in] vector_ij - Distance vector.
588588
* \param[in] delta_ij - Centered difference.
589589
* \param[in] kappa - Blending coefficient for U-MUSCL reconstruction.
590+
* \param[in] ramp_val - Value of the ramp
590591
* \return - Projected variable.
591592
*/
592-
inline su2double MUSCL_Reconstruction(const su2double* grad, const su2double* vector_ij, su2double delta_ij, su2double kappa) {
593+
inline su2double MUSCL_Reconstruction(const su2double* grad, const su2double* vector_ij, su2double delta_ij, su2double kappa, su2double ramp_val) {
593594
su2double project_grad = GeometryToolbox::DotProduct(nDim, grad, vector_ij);
594-
return LimiterHelpers<>::umusclProjection(project_grad, delta_ij, kappa);
595+
return ramp_val * LimiterHelpers<>::umusclProjection(project_grad, delta_ij, kappa);
595596
}
596597

597598
/*!

SU2_CFD/src/iteration/CFluidIteration.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ bool CFluidIteration::Monitor(COutput* output, CIntegration**** integration, CGe
241241
if (config[val_iZone]->GetRampOutflow())
242242
UpdateRamp(geometry, config, config[val_iZone]->GetInnerIter(), val_iZone, RAMP_TYPE::BOUNDARY);
243243

244+
if (config[val_iZone]->GetMUSCLRamp())
245+
UpdateRamp(geometry, config, config[val_iZone]->GetInnerIter(), val_iZone, RAMP_TYPE::MUSCL);
246+
244247
output->SetHistoryOutput(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0],
245248
config[val_iZone], config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(),
246249
config[val_iZone]->GetInnerIter());
@@ -330,6 +333,29 @@ void CFluidIteration::UpdateRamp(CGeometry**** geometry_container, CConfig** con
330333
}
331334
}
332335
}
336+
337+
if (ramp_flag == RAMP_TYPE::MUSCL) {
338+
const auto RampMUSCLParam = config->GetMUSCLRampParam();
339+
const long unsigned startIter = RampMUSCLParam.rampMUSCLCoeff[RAMP_COEFF::INITIAL_VALUE];
340+
const long unsigned updateFreq = RampMUSCLParam.rampMUSCLCoeff[RAMP_COEFF::UPDATE_FREQ];
341+
const long unsigned rampLength = RampMUSCLParam.rampMUSCLCoeff[RAMP_COEFF::FINAL_ITER];
342+
auto iterFrac = (static_cast<double>(iter - startIter)/static_cast<double>((rampLength + startIter) - startIter));
343+
if (iter < startIter) return;
344+
if ((iter == startIter) && (rank == MASTER_NODE)) cout << "Beginning to ramp MUSCL scheme..." << endl;
345+
if ((iter % updateFreq == 0 && iter < (rampLength + startIter)) || (iter == (rampLength + startIter))) {
346+
switch (RampMUSCLParam.Kind_MUSCLRamp) {
347+
case MUSCL_RAMP_TYPE::ITERATION:
348+
config->SetMUSCLRampValue(std::pow(std::min<double>(1.0, iterFrac), RampMUSCLParam.RampMUSCLPower));
349+
break;
350+
case MUSCL_RAMP_TYPE::SMOOTH_FUNCTION:
351+
config->SetMUSCLRampValue(std::pow((0.5 * (1 - cos(M_PI * std::min(1.0, iterFrac)))), RampMUSCLParam.RampMUSCLPower));
352+
break;
353+
default:
354+
break;
355+
}
356+
if (rank == MASTER_NODE) cout << "MUSCL Ramp value updated. New Value: " << config->GetMUSCLRampValue() << endl;
357+
}
358+
}
333359
}
334360

335361
void CFluidIteration::ComputeTurboPerformance(CSolver***** solver, CGeometry**** geometry_container, CConfig** config_container, unsigned long ExtIter) {

SU2_CFD/src/solvers/CEulerSolver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,8 +1886,8 @@ void CEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_contain
18861886
for (auto iVar = 0u; iVar < nPrimVarGrad; iVar++) {
18871887
const su2double V_ij = V_j[iVar] - V_i[iVar];
18881888

1889-
const su2double Project_Grad_i = nkRelax * MUSCL_Reconstruction(Gradient_i[iVar], Vector_ij, V_ij, kappa);
1890-
const su2double Project_Grad_j = nkRelax * MUSCL_Reconstruction(Gradient_j[iVar], Vector_ij, V_ij, kappa);
1889+
const su2double Project_Grad_i = nkRelax * MUSCL_Reconstruction(Gradient_i[iVar], Vector_ij, V_ij, kappa, config->GetMUSCLRampValue());
1890+
const su2double Project_Grad_j = nkRelax * MUSCL_Reconstruction(Gradient_j[iVar], Vector_ij, V_ij, kappa, config->GetMUSCLRampValue());
18911891

18921892
su2double lim_i = 1.0;
18931893
su2double lim_j = 1.0;

0 commit comments

Comments
 (0)