diff --git a/dumux/common/deprecated.hh b/dumux/common/deprecated.hh index 8a719f8eedb3ba818961a0a5f75456e9a7270c18..448c72720ba50499430a7670b5a4e371c66464da 100644 --- a/dumux/common/deprecated.hh +++ b/dumux/common/deprecated.hh @@ -40,6 +40,10 @@ namespace Dumux { // so most likely you don't want to use this in your code namespace Deprecated { +[[deprecated("The isOnWall and IsOnWallAtPos functions in the problem class will be removed after release 3.5. " + "Please use the Rans specific boundarytypes. Mark wall boundaries in the rans problems with the setWall() function.")]] +void ransWallsCompilerWarning() {} + #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -115,6 +119,27 @@ using HasBaseProblemExtrusionFactorAtPosDetector = decltype(std::declval +constexpr bool usesHasWallBCs() +{ + if constexpr (hasHasWallBC()) + return true; + + ransWallsCompilerWarning(); + return false; +} + +template +constexpr bool usesIsOnWall() +{ + if constexpr (hasIsOnWall()) + { + ransWallsCompilerWarning(); + return true; + } + return false; +} + #ifdef __clang__ #pragma clang diagnostic pop #endif // __clang__ @@ -190,6 +215,7 @@ decltype(auto) temperature(const Problem& problem, const Element& element, const return problem.temperatureAtPos(scv.dofPosition()); } + } // end namespace Deprecated #endif diff --git a/dumux/freeflow/rans/problem.hh b/dumux/freeflow/rans/problem.hh index 4f3e74346af273eeb2433b63938b3cff07327b85..80b99752d117d093d3bfa56fea4f57d13cd47683 100644 --- a/dumux/freeflow/rans/problem.hh +++ b/dumux/freeflow/rans/problem.hh @@ -368,19 +368,13 @@ private: auto fvGeometry = localView(this->gridGeometry()); fvGeometry.bindElement(element); for (auto&& scvf : scvfs(fvGeometry)) - { - if constexpr (Deprecated::hasHasWallBC()) - { + if constexpr (Deprecated::usesHasWallBCs()) if (asImp_().boundaryTypes(element, scvf).hasWall()) return; - } - else - noSetWallCompilerWarning_(); - } } // If reached, no walls were found, throw exception. Remove check after 3.5 - if constexpr (!Deprecated::hasIsOnWall()) + if constexpr (!Deprecated::usesIsOnWall()) DUNE_THROW(Dune::InvalidStateException, "No walls are are specified with the setWall() function"); } @@ -731,11 +725,6 @@ private: } } - [[deprecated("The isOnWall and IsOnWallAtPos functions will be removed after release 3.5. " - "Please use the Rans specific boundarytypes. " - "Mark wall boundaries in the rans problems with the setWall() function.")]] - void noSetWallCompilerWarning_(){} - const int fixedFlowDirectionAxis_ = getParam("RANS.FlowDirectionAxis", 0); const int fixedWallNormalAxis_ = getParam("RANS.WallNormalAxis", 1); diff --git a/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh index 1598488733b2736cb9745a49c202fea20ccf3dd2..920d80fa91314d911055cd8264ed085fcce42e40 100644 --- a/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/kepsilon/staggered/fluxvariables.hh @@ -25,6 +25,7 @@ #define DUMUX_KEPSILON_STAGGERED_FLUXVARIABLES_HH #include +#include #include #include #include @@ -152,7 +153,6 @@ public: // Remove this check after release 3.5. IsOnWall Interface is deprecated if constexpr (Deprecated::hasIsOnWall()) { - noSetWallCompilerWarning_(); // Remove this part if (!(scvf.boundary() && (bcTypes.isOutflow(Indices::turbulentKineticEnergyEqIdx) || bcTypes.isSymmetry() @@ -169,7 +169,7 @@ public: } } } - else + else if constexpr (Deprecated::usesHasWallBCs()) { // Keep this part if (!(scvf.boundary() && (bcTypes.isOutflow(Indices::turbulentKineticEnergyEqIdx) @@ -187,9 +187,12 @@ public: } } } + else + DUNE_THROW(Dune::Exception, "Please use the RANS boundary types to set wall conditions."); + if (!(scvf.boundary() && (bcTypes.isOutflow(Indices::dissipationEqIdx) - || bcTypes.isSymmetry()))) + || bcTypes.isSymmetry()))) { flux[dissipationEqIdx] += coeff_e / distance @@ -218,12 +221,6 @@ public: * Extrusion::area(scvf) * scvf.directionSign() * insideVolVars.extrusionFactor(); } -private: - - [[deprecated("The isOnWall and IsOnWallAtPos functions will be removed after release 3.5. " - "Please use the Rans specific boundarytypes. " - "Mark wall boundaries in the rans problems with the setWall() function.")]] - void noSetWallCompilerWarning_(){} }; } // end namespace