diff --git a/dumux/freeflow/staggered/localresidual.hh b/dumux/freeflow/staggered/localresidual.hh index c4006e0119ad701dfbbec6c98a554eff726c9b61..b5a440999c8b8edf478c3524fe469beb5b04c30a 100644 --- a/dumux/freeflow/staggered/localresidual.hh +++ b/dumux/freeflow/staggered/localresidual.hh @@ -127,10 +127,10 @@ public: const ElementVolumeVariables& elemVolVars, const GlobalFaceVars& globalFaceVars, const SubControlVolumeFace &scvf, - const FluxVariablesCache& fluxVarsCache) + const ElementFluxVariablesCache& elemFluxVarsCache) { FluxVariables fluxVars; - return fluxVars.computeFluxForCellCenter(element, fvGeometry, elemVolVars, globalFaceVars, scvf, fluxVarsCache); + return fluxVars.computeFluxForCellCenter(element, fvGeometry, elemVolVars, globalFaceVars, scvf, elemFluxVarsCache[scvf]); } CellCenterPrimaryVariables computeSourceForCellCenter(const Element &element, @@ -206,7 +206,8 @@ public: const SubControlVolumeFace& scvf, const FVElementGeometry& fvGeometry, const ElementVolumeVariables& elemVolVars, - const GlobalFaceVars& globalFaceVars) + const GlobalFaceVars& globalFaceVars, + const ElementFluxVariablesCache& elemFluxVarsCache) { FacePrimaryVariables flux(0.0); FluxVariables fluxVars; @@ -250,7 +251,7 @@ protected: if (scvf.boundary()) { // For the mass-balance residual, do the same as if the face was not on a boundary.This might need to be changed sometime... - this->ccResidual_ += computeFluxForCellCenter(element, fvGeometry, elemVolVars, faceVars, scvf, elemFluxVarsCache[scvf]); + this->ccResidual_ += computeFluxForCellCenter(element, fvGeometry, elemVolVars, faceVars, scvf, elemFluxVarsCache); // handle the actual boundary conditions: const auto bcTypes = this->problem().boundaryTypes(element, scvf); @@ -294,7 +295,7 @@ protected: if(bcTypes.isOutflow(momentumBalanceIdx)) { if(bcTypes.isDirichlet(massBalanceIdx)) - this->faceResiduals_[scvf.localFaceIdx()] += computeFluxForFace(element, scvf, fvGeometry, elemVolVars, faceVars); + this->faceResiduals_[scvf.localFaceIdx()] += computeFluxForFace(element, scvf, fvGeometry, elemVolVars, faceVars, elemFluxVarsCache); else DUNE_THROW(Dune::InvalidStateException, "Face at " << scvf.center() << " has an outflow BC for the momentum balance but no Dirichlet BC for the pressure!"); } diff --git a/dumux/implicit/staggered/localjacobian.hh b/dumux/implicit/staggered/localjacobian.hh index 28e12e50a926e85c189571866ed3874cdf107797..d54bcc9787cd4145528c2a832dc7851d6c75b960 100644 --- a/dumux/implicit/staggered/localjacobian.hh +++ b/dumux/implicit/staggered/localjacobian.hh @@ -193,7 +193,17 @@ public: this->model_().updatePVWeights(fvGeometry); // calculate derivatives of all dofs in stencil with respect to the dofs in the element - evalPartialDerivatives_(element, fvGeometry, prevElemVolVars, curElemVolVars, prevGlobalFaceVars, curGlobalFaceVars, elemFluxVarsCache, elemBcTypes, matrix, residual[cellCenterIdx][ccGlobalI_], faceResidualCache); + evalPartialDerivatives_(element, + fvGeometry, + prevElemVolVars, + curElemVolVars, + prevGlobalFaceVars, + curGlobalFaceVars, + elemFluxVarsCache, + elemBcTypes, + matrix, + residual[cellCenterIdx][ccGlobalI_], + faceResidualCache); } /*! diff --git a/dumux/implicit/staggered/localresidual.hh b/dumux/implicit/staggered/localresidual.hh index 9353b71b16ca81674d2f584cdec457fee1221c66..deb06209fb725b43c1d105ad717c9795bbe44acc 100644 --- a/dumux/implicit/staggered/localresidual.hh +++ b/dumux/implicit/staggered/localresidual.hh @@ -57,7 +57,6 @@ class StaggeredLocalResidual using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes); using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables); using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, ElementFluxVariablesCache); - using FluxVariablesCache = typename GET_PROP_TYPE(TypeTag, FluxVariablesCache); using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry); using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume); using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace); @@ -297,7 +296,7 @@ protected: for (auto&& scvf : scvfs(fvGeometry)) { if(!scvf.boundary()) - ccResidual_ += asImp_().computeFluxForCellCenter(element, fvGeometry, elemVolVars, faceVars, scvf, elemFluxVarsCache[scvf]); + ccResidual_ += asImp_().computeFluxForCellCenter(element, fvGeometry, elemVolVars, faceVars, scvf, elemFluxVarsCache); } }