@@ -4002,6 +4002,27 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
40024002 if (!MUSCL_AdjFlow || (Kind_ConvNumScheme_AdjFlow == SPACE_CENTERED)) Kind_SlopeLimit_AdjFlow = LIMITER::NONE;
40034003 if (!MUSCL_AdjTurb || (Kind_ConvNumScheme_AdjTurb == SPACE_CENTERED)) Kind_SlopeLimit_AdjTurb = LIMITER::NONE;
40044004
4005+ /*--- The SHARP_EDGES and WALL_DISTANCE limiters are first order within a distance proportional to
4006+ * VENKAT_LIMITER_COEFF * ADJ_SHARP_LIMITER_COEFF, with a zero width they are first order everywhere.
4007+ * Only the limiters of the active equations are checked. ---*/
4008+ const bool turb = Kind_Turb_Model != TURB_MODEL::NONE;
4009+ const bool heat =
4010+ Weakly_Coupled_Heat || Kind_Solver == MAIN_SOLVER::HEAT_EQUATION || Kind_Solver == MAIN_SOLVER::DISC_ADJ_HEAT;
4011+ vector<LIMITER> activeLimiters = {Kind_SlopeLimit_Flow};
4012+ if (turb) activeLimiters.push_back(Kind_SlopeLimit_Turb);
4013+ if (Kind_Species_Model != SPECIES_MODEL::NONE) activeLimiters.push_back(Kind_SlopeLimit_Species);
4014+ if (heat) activeLimiters.push_back(Kind_SlopeLimit_Heat);
4015+ if (ContinuousAdjoint) activeLimiters.push_back(Kind_SlopeLimit_AdjFlow);
4016+ if (ContinuousAdjoint && turb) activeLimiters.push_back(Kind_SlopeLimit_AdjTurb);
4017+ for (const auto kind : activeLimiters) {
4018+ if ((kind == LIMITER::SHARP_EDGES || kind == LIMITER::WALL_DISTANCE) &&
4019+ !(Venkat_LimiterCoeff > 0.0 && AdjSharp_LimiterCoeff > 0.0)) {
4020+ SU2_MPI::Error("The SHARP_EDGES and WALL_DISTANCE slope limiters need VENKAT_LIMITER_COEFF > 0 and\n"
4021+ "ADJ_SHARP_LIMITER_COEFF > 0 (they set the width of the region limited to first order).",
4022+ CURRENT_FUNCTION);
4023+ }
4024+ }
4025+
40054026 /*--- Set the default for thrust in ActDisk ---*/
40064027
40074028 if ((Kind_ActDisk == NET_THRUST) || (Kind_ActDisk == BC_THRUST)
@@ -4706,6 +4727,36 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
47064727
47074728 Rotating_Frame = (Kind_GridMovement == ROTATING_FRAME);
47084729
4730+ /*--- The finite volume flow solvers apply these source terms with a single numerics object, which is built
4731+ for only one of them: combinations would apply one source several times and ignore the others. Only these
4732+ solvers (and their discrete adjoints) are checked: e.g. elasticity uses BODY_FORCE and GRAVITY_FORCE together. ---*/
4733+
4734+ if (GetFluidProblem() && !GetNEMOProblem()) {
4735+ const bool inc = (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE);
4736+ const int nSources = int(Body_Force) + int(Rotating_Frame) + int(Axisymmetric) + int(GravityForce && !inc) +
4737+ int(inc && Kind_DensityModel == INC_DENSITYMODEL::BOUSSINESQ) +
4738+ int(inc && Kind_Streamwise_Periodic != ENUM_STREAMWISE_PERIODIC::NONE);
4739+ if (nSources > 1) {
4740+ SU2_MPI::Error("Only one of BODY_FORCE, GRID_MOVEMENT= ROTATING_FRAME, AXISYMMETRIC, GRAVITY_FORCE (compressible), "
4741+ "INC_DENSITY_MODEL= BOUSSINESQ and KIND_STREAMWISE_PERIODIC (incompressible) can be used at a time.",
4742+ CURRENT_FUNCTION);
4743+ }
4744+ }
4745+
4746+ /*--- The second source object, for radiation, the energy correction of incompressible streamwise periodic flow
4747+ (without periodic temperature) or vorticity confinement, is also built for only one of them. ---*/
4748+
4749+ if (GetFluidProblem() && !GetNEMOProblem()) {
4750+ const bool inc = (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE);
4751+ const bool periodicOutlet = inc && Kind_Streamwise_Periodic != ENUM_STREAMWISE_PERIODIC::NONE && Energy_Equation &&
4752+ !Streamwise_Periodic_Temperature;
4753+ if (int(Radiation) + int(periodicOutlet) + int(VorticityConfinement) > 1) {
4754+ SU2_MPI::Error("Only one of RADIATION, the energy correction of KIND_STREAMWISE_PERIODIC (incompressible, "
4755+ "STREAMWISE_PERIODIC_TEMPERATURE= NO) and VORTICITY_CONFINEMENT can be used at a time.",
4756+ CURRENT_FUNCTION);
4757+ }
4758+ }
4759+
47094760 /*--- In case the grid movement parameters have not been declared in the
47104761 config file, set them equal to zero for safety. Also check to make sure
47114762 that for each option, a value has been declared for each moving marker. ---*/
@@ -5065,6 +5116,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
50655116
50665117 if (Restart || ((Kind_MGCycle == MG_CYCLE::FULL) && ContinuousAdjoint)) Kind_MGCycle = MG_CYCLE::V;
50675118
5119+ /*--- The multigrid arrays hold at most 10 coarse levels (CMultiGridIntegration::MAX_MG_LEVELS). ---*/
5120+ if (nMGLevels > 10) {
5121+ SU2_MPI::Error("MGLEVEL must be between 0 and 10; larger multigrid hierarchies are not supported.", CURRENT_FUNCTION);
5122+ }
5123+
50685124 FinestMesh = MESH_0;
50695125 if (Kind_MGCycle == MG_CYCLE::FULL) FinestMesh = nMGLevels;
50705126
0 commit comments