Skip to content

Commit 3f68501

Browse files
authored
Merge pull request #1990 from su2code/remove_cusp
Deprecate CUSP scheme and make it an error to use MUSCL_FLOW=YES with centered schemes
2 parents 4ed142f + cda1c50 commit 3f68501

57 files changed

Lines changed: 65 additions & 534 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Common/include/option_structure.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,6 @@ enum class UPWIND {
820820
MSW, /*!< \brief Modified Steger-Warming method. */
821821
TURKEL, /*!< \brief Roe-Turkel's upwind numerical method. */
822822
SLAU, /*!< \brief Simple Low-Dissipation AUSM numerical method. */
823-
CUSP, /*!< \brief Convective upwind and split pressure numerical method. */
824823
CONVECTIVE_TEMPLATE, /*!< \brief Template for new numerical method . */
825824
L2ROE, /*!< \brief L2ROE numerical method . */
826825
LMROE, /*!< \brief Rieper's Low Mach ROE numerical method . */
@@ -844,7 +843,6 @@ static const MapType<std::string, UPWIND> Upwind_Map = {
844843
MakePair("HLLC", UPWIND::HLLC)
845844
MakePair("SW", UPWIND::SW)
846845
MakePair("MSW", UPWIND::MSW)
847-
MakePair("CUSP", UPWIND::CUSP)
848846
MakePair("SCALAR_UPWIND", UPWIND::SCALAR_UPWIND)
849847
MakePair("BOUNDED_SCALAR", UPWIND::BOUNDED_SCALAR)
850848
MakePair("CONVECTIVE_TEMPLATE", UPWIND::CONVECTIVE_TEMPLATE)

Common/src/CConfig.cpp

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,7 @@ void CConfig::SetConfig_Options() {
19091909
* \n DESCRIPTION: Convective numerical method for the adjoint solver.
19101910
* \n OPTIONS: See \link Upwind_Map \endlink , \link Centered_Map \endlink. Note: not all methods are guaranteed to be implemented for the adjoint solver. \ingroup Config */
19111911
addConvectOption("CONV_NUM_METHOD_ADJFLOW", Kind_ConvNumScheme_AdjFlow, Kind_Centered_AdjFlow, Kind_Upwind_AdjFlow);
1912-
/*!\brief MUSCL_FLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/
1912+
/*!\brief MUSCL_ADJFLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/
19131913
addBoolOption("MUSCL_ADJFLOW", MUSCL_AdjFlow, true);
19141914
/*!\brief SLOPE_LIMITER_ADJFLOW
19151915
* DESCRIPTION: Slope limiter for the adjoint solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/
@@ -1920,7 +1920,7 @@ void CConfig::SetConfig_Options() {
19201920
/*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the adjoint Lax-Friedrichs method. \ingroup Config*/
19211921
addDoubleOption("ADJ_LAX_SENSOR_COEFF", Kappa_1st_AdjFlow, 0.15);
19221922

1923-
/*!\brief MUSCL_FLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/
1923+
/*!\brief MUSCL_TURB \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/
19241924
addBoolOption("MUSCL_TURB", MUSCL_Turb, false);
19251925
/*!\brief SLOPE_LIMITER_TURB
19261926
* \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/
@@ -1929,7 +1929,7 @@ void CConfig::SetConfig_Options() {
19291929
* \n DESCRIPTION: Convective numerical method \ingroup Config*/
19301930
addConvectOption("CONV_NUM_METHOD_TURB", Kind_ConvNumScheme_Turb, Kind_Centered_Turb, Kind_Upwind_Turb);
19311931

1932-
/*!\brief MUSCL_FLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/
1932+
/*!\brief MUSCL_ADJTURB \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/
19331933
addBoolOption("MUSCL_ADJTURB", MUSCL_AdjTurb, false);
19341934
/*!\brief SLOPE_LIMITER_ADJTURB
19351935
* \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config */
@@ -1944,7 +1944,7 @@ void CConfig::SetConfig_Options() {
19441944
/*!\brief CONV_NUM_METHOD_SPECIES \n DESCRIPTION: Convective numerical method for species transport \ingroup Config*/
19451945
addConvectOption("CONV_NUM_METHOD_SPECIES", Kind_ConvNumScheme_Species, Kind_Centered_Species, Kind_Upwind_Species);
19461946

1947-
/*!\brief MUSCL_FLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/
1947+
/*!\brief MUSCL_HEAT \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/
19481948
addBoolOption("MUSCL_HEAT", MUSCL_Heat, false);
19491949
/*!\brief SLOPE_LIMITER_HEAT \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT NONE \ingroup Config*/
19501950
addEnumOption("SLOPE_LIMITER_HEAT", Kind_SlopeLimit_Heat, Limiter_Map, LIMITER::NONE);
@@ -3560,6 +3560,21 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
35603560
SetScalarDefaults(MUSCL_Heat, Kind_ConvNumScheme_Heat, Kind_Upwind_Heat, Kind_SlopeLimit_Heat);
35613561
SetScalarDefaults(MUSCL_Species, Kind_ConvNumScheme_Species, Kind_Upwind_Species, Kind_SlopeLimit_Species);
35623562

3563+
if (MUSCL_Flow && (Kind_ConvNumScheme_Flow == SPACE_CENTERED)) {
3564+
if (OptionIsSet("MUSCL_FLOW")) {
3565+
SU2_MPI::Error("Centered schemes do not use MUSCL reconstruction (use MUSCL_FLOW= NO).", CURRENT_FUNCTION);
3566+
} else {
3567+
MUSCL_Flow = false;
3568+
}
3569+
}
3570+
if (MUSCL_AdjFlow && (Kind_ConvNumScheme_AdjFlow == SPACE_CENTERED)) {
3571+
if (OptionIsSet("MUSCL_ADJFLOW")) {
3572+
SU2_MPI::Error("Centered schemes do not use MUSCL reconstruction (use MUSCL_ADJFLOW= NO).", CURRENT_FUNCTION);
3573+
} else {
3574+
MUSCL_AdjFlow = false;
3575+
}
3576+
}
3577+
35633578
if (!MUSCL_Flow || (Kind_ConvNumScheme_Flow == SPACE_CENTERED)) Kind_SlopeLimit_Flow = LIMITER::NONE;
35643579
if (!MUSCL_AdjFlow || (Kind_ConvNumScheme_AdjFlow == SPACE_CENTERED)) Kind_SlopeLimit_AdjFlow = LIMITER::NONE;
35653580
if (!MUSCL_AdjTurb || (Kind_ConvNumScheme_AdjTurb == SPACE_CENTERED)) Kind_SlopeLimit_AdjTurb = LIMITER::NONE;
@@ -5142,8 +5157,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
51425157
Mesh_Box_Size[1] = 33;
51435158
Mesh_Box_Size[2] = 33;
51445159
} else if (nMesh_Box_Size != 3) {
5145-
SU2_MPI::Error(string("MESH_BOX_SIZE specified without 3 values.\n"),
5146-
CURRENT_FUNCTION);
5160+
SU2_MPI::Error("MESH_BOX_SIZE specified without 3 values.\n", CURRENT_FUNCTION);
51475161
}
51485162

51495163
/* Force the lowest memory preconditioner when direct solvers are used. */
@@ -5160,8 +5174,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
51605174
if (DiscreteAdjoint) {
51615175
#if !defined CODI_REVERSE_TYPE
51625176
if (Kind_SU2 == SU2_COMPONENT::SU2_CFD) {
5163-
SU2_MPI::Error(string("SU2_CFD: Config option MATH_PROBLEM= DISCRETE_ADJOINT requires AD support!\n") +
5164-
string("Please use SU2_CFD_AD (configuration/compilation is done using the preconfigure.py script)."),
5177+
SU2_MPI::Error("SU2_CFD: Config option MATH_PROBLEM= DISCRETE_ADJOINT requires AD support!\n"
5178+
"Please use SU2_CFD_AD (configuration/compilation is done using the preconfigure.py script).",
51655179
CURRENT_FUNCTION);
51665180
}
51675181
#endif
@@ -5175,8 +5189,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
51755189
Restart_Flow = false;
51765190

51775191
if (Unst_AdjointIter- long(nTimeIter) < 0){
5178-
SU2_MPI::Error(string("Invalid iteration number requested for unsteady adjoint.\n" ) +
5179-
string("Make sure EXT_ITER is larger or equal than UNST_ADJOINT_ITER."),
5192+
SU2_MPI::Error("Invalid iteration number requested for unsteady adjoint.\n"
5193+
"Make sure EXT_ITER is larger or equal than UNST_ADJOINT_ITER.",
51805194
CURRENT_FUNCTION);
51815195
}
51825196

@@ -5235,8 +5249,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
52355249
turbulence model. */
52365250

52375251
if (MUSCL_AdjTurb) {
5238-
SU2_MPI::Error(string("MUSCL_ADJTURB= YES not currently supported.\n") +
5239-
string("Please select MUSCL_ADJTURB= NO (first-order)."),
5252+
SU2_MPI::Error("MUSCL_ADJTURB= YES not currently supported.\nPlease select MUSCL_ADJTURB= NO (first-order).",
52405253
CURRENT_FUNCTION);
52415254
}
52425255

@@ -5257,9 +5270,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
52575270
we also want to avoid recomputation. */
52585271

52595272
ReconstructionGradientRequired = false;
5260-
Kind_Gradient_Method_Recon = Kind_Gradient_Method;
5273+
Kind_Gradient_Method_Recon = Kind_Gradient_Method;
52615274
}
52625275

5276+
} else {
5277+
ReconstructionGradientRequired = false;
52635278
}
52645279

52655280
if (ReconstructionGradientRequired && GetFluidProblem() && Kind_ConvNumScheme_Flow == SPACE_CENTERED)
@@ -6642,7 +6657,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
66426657
if (Kind_Upwind_Flow == UPWIND::HLLC) cout << "HLLC solver for the flow inviscid terms."<< endl;
66436658
if (Kind_Upwind_Flow == UPWIND::SW) cout << "Steger-Warming solver for the flow inviscid terms."<< endl;
66446659
if (Kind_Upwind_Flow == UPWIND::MSW) cout << "Modified Steger-Warming solver for the flow inviscid terms."<< endl;
6645-
if (Kind_Upwind_Flow == UPWIND::CUSP) cout << "CUSP solver for the flow inviscid terms."<< endl;
66466660
if (Kind_Upwind_Flow == UPWIND::L2ROE) cout << "L2ROE Low Mach ROE solver for the flow inviscid terms."<< endl;
66476661
if (Kind_Upwind_Flow == UPWIND::LMROE) cout << "Rieper Low Mach ROE solver for the flow inviscid terms."<< endl;
66486662
if (Kind_Upwind_Flow == UPWIND::SLAU) cout << "Simple Low-Dissipation AUSM solver for the flow inviscid terms."<< endl;

QuickStart/inv_NACA0012.cfg

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,9 @@ MG_DAMP_PROLONGATION= 1.0
146146

147147
% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------%
148148
%
149-
% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC,
150-
% TURKEL_PREC, MSW)
151-
CONV_NUM_METHOD_FLOW= JST
152-
%
153-
% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations.
154-
% Required for 2nd order upwind schemes (NO, YES)
155-
MUSCL_FLOW= YES
149+
% Convective numerical method
156150
%
157-
% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG,
158-
% BARTH_JESPERSEN, VAN_ALBADA_EDGE)
159-
SLOPE_LIMITER_FLOW= VENKATAKRISHNAN_WANG
151+
CONV_NUM_METHOD_FLOW= JST
160152
%
161153
% 2nd and 4th order artificial dissipation coefficients
162154
JST_SENSOR_COEFF= ( 0.5, 0.02 )
@@ -169,14 +161,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT
169161
% Convective numerical method (JST, LAX-FRIEDRICH, ROE)
170162
CONV_NUM_METHOD_ADJFLOW= JST
171163
%
172-
% Monotonic Upwind Scheme for Conservation Laws (TVD) in the adjoint flow equations.
173-
% Required for 2nd order upwind schemes (NO, YES)
174-
MUSCL_ADJFLOW= YES
175-
%
176-
% Slope limiter (NONE, VENKATAKRISHNAN, BARTH_JESPERSEN, VAN_ALBADA_EDGE,
177-
% SHARP_EDGES, WALL_DISTANCE)
178-
SLOPE_LIMITER_ADJFLOW= NONE
179-
%
180164
% Reduction factor of the CFL coefficient in the adjoint problem
181165
CFL_REDUCTION_ADJFLOW= 0.01
182166
%

SU2_CFD/include/numerics/flow/convection/cusp.hpp

Lines changed: 0 additions & 69 deletions
This file was deleted.

SU2_CFD/src/drivers/CDriver.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
#include "../../include/numerics/flow/convection/roe.hpp"
6262
#include "../../include/numerics/flow/convection/fds.hpp"
6363
#include "../../include/numerics/flow/convection/fvs.hpp"
64-
#include "../../include/numerics/flow/convection/cusp.hpp"
6564
#include "../../include/numerics/flow/convection/hllc.hpp"
6665
#include "../../include/numerics/flow/convection/ausm_slau.hpp"
6766
#include "../../include/numerics/flow/convection/centered.hpp"
@@ -1783,13 +1782,6 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol
17831782
}
17841783
break;
17851784

1786-
case UPWIND::CUSP:
1787-
for (iMGlevel = 0; iMGlevel <= config->GetnMGLevels(); iMGlevel++) {
1788-
numerics[iMGlevel][FLOW_SOL][conv_term] = new CUpwCUSP_Flow(nDim, nVar_Flow, config);
1789-
numerics[iMGlevel][FLOW_SOL][conv_bound_term] = new CUpwCUSP_Flow(nDim, nVar_Flow, config);
1790-
}
1791-
break;
1792-
17931785
default:
17941786
SU2_MPI::Error("Invalid upwind scheme or not implemented.", CURRENT_FUNCTION);
17951787
break;
@@ -2048,13 +2040,6 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol
20482040
}
20492041
break;
20502042

2051-
case UPWIND::CUSP:
2052-
for (iMGlevel = 0; iMGlevel <= config->GetnMGLevels(); iMGlevel++) {
2053-
numerics[iMGlevel][FLOW_SOL][conv_term] = new CUpwCUSP_Flow(nDim, nVar_Flow, config);
2054-
numerics[iMGlevel][FLOW_SOL][conv_bound_term] = new CUpwCUSP_Flow(nDim, nVar_Flow, config);
2055-
}
2056-
break;
2057-
20582043
default:
20592044
SU2_MPI::Error("Riemann solver not implemented.", CURRENT_FUNCTION);
20602045
break;

SU2_CFD/src/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ su2_cfd_src += files(['numerics/CNumerics.cpp',
122122
'numerics/flow/convection/roe.cpp',
123123
'numerics/flow/convection/fds.cpp',
124124
'numerics/flow/convection/fvs.cpp',
125-
'numerics/flow/convection/cusp.cpp',
126125
'numerics/flow/convection/hllc.cpp',
127126
'numerics/flow/convection/ausm_slau.cpp',
128127
'numerics/flow/convection/centered.cpp',

0 commit comments

Comments
 (0)