diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh index 7abc55a283b7656529c4aa4cd329202721dd57ea..49fd961eca976ea0dceba30e058dc4012ccb6319 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/fluxvariables.hh @@ -71,10 +71,8 @@ class LowReKEpsilonFluxVariablesImpl<TypeTag, BaseFluxVariables, DiscretizationM using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables); - enum { - turbulentKineticEnergyEqIdx = Indices::turbulentKineticEnergyEqIdx, - dissipationEqIdx = Indices::dissipationEqIdx, - }; + static constexpr int turbulentKineticEnergyEqIdx = Indices::turbulentKineticEnergyEqIdx - ModelTraits::dim(); + static constexpr int dissipationEqIdx = Indices::dissipationEqIdx - ModelTraits::dim(); public: @@ -102,9 +100,9 @@ public: return volVars.dissipationTilde(); }; - flux[turbulentKineticEnergyEqIdx - ModelTraits::dim()] + flux[turbulentKineticEnergyEqIdx] = ParentType::advectiveFluxForCellCenter(problem, elemVolVars, elemFaceVars, scvf, upwindTermK); - flux[dissipationEqIdx - ModelTraits::dim()] + flux[dissipationEqIdx] = ParentType::advectiveFluxForCellCenter(problem, elemVolVars, elemFaceVars, scvf, upwindTermEpsilon); // calculate diffusive flux @@ -147,18 +145,18 @@ public: } const auto bcTypes = problem.boundaryTypes(element, scvf); - if (!(scvf.boundary() && (bcTypes.isOutflow(turbulentKineticEnergyEqIdx) + if (!(scvf.boundary() && (bcTypes.isOutflow(Indices::turbulentKineticEnergyEqIdx) || bcTypes.isSymmetry()))) { - flux[turbulentKineticEnergyEqIdx - ModelTraits::dim()] + flux[turbulentKineticEnergyEqIdx] += coeff_k / distance * (insideVolVars.turbulentKineticEnergy() - outsideVolVars.turbulentKineticEnergy()) * scvf.area(); } - if (!(scvf.boundary() && (bcTypes.isOutflow(dissipationEqIdx) + if (!(scvf.boundary() && (bcTypes.isOutflow(Indices::dissipationEqIdx) || bcTypes.isSymmetry()))) { - flux[dissipationEqIdx - ModelTraits::dim()] + flux[dissipationEqIdx] += coeff_e / distance * (insideVolVars.dissipationTilde() - outsideVolVars.dissipationTilde()) * scvf.area(); diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh index df8afddffe0547c4114859293c618ad658fd0ae4..41f4137db230b76e3c1b9ba633daeae20e3120d1 100644 --- a/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh +++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/staggered/localresidual.hh @@ -69,6 +69,9 @@ class LowReKEpsilonResidualImpl<TypeTag, BaseLocalResidual, DiscretizationMethod using BoundaryTypes = typename GET_PROP_TYPE(TypeTag, BoundaryTypes); using ModelTraits = typename GET_PROP_TYPE(TypeTag, ModelTraits); + static constexpr int turbulentKineticEnergyEqIdx = Indices::turbulentKineticEnergyEqIdx - ModelTraits::dim(); + static constexpr int dissipationEqIdx = Indices::dissipationEqIdx - ModelTraits::dim(); + public: using ParentType::ParentType; @@ -79,8 +82,6 @@ public: { CellCenterPrimaryVariables storage = ParentType::computeStorageForCellCenter(problem, scv, volVars); - static constexpr int turbulentKineticEnergyEqIdx = Indices::turbulentKineticEnergyEqIdx - ModelTraits::dim(); - static constexpr int dissipationEqIdx = Indices::dissipationEqIdx - ModelTraits::dim(); storage[turbulentKineticEnergyEqIdx] = volVars.turbulentKineticEnergy(); storage[dissipationEqIdx] = volVars.dissipationTilde(); @@ -99,9 +100,6 @@ public: const auto& volVars = elemVolVars[scv]; - static constexpr int turbulentKineticEnergyEqIdx = Indices::turbulentKineticEnergyEqIdx - ModelTraits::dim(); - static constexpr int dissipationEqIdx = Indices::dissipationEqIdx - ModelTraits::dim(); - // production source[turbulentKineticEnergyEqIdx] += 2.0 * volVars.kinematicEddyViscosity() * volVars.stressTensorScalarProduct();