From 561c571e5d6f4f3b012fa094ac23f177df95c09b Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de> Date: Tue, 28 Feb 2017 09:18:53 +0100 Subject: [PATCH] [staggeredGrid][FicksLaw] Clean-up --- dumux/discretization/staggered/freeflow/fickslaw.hh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dumux/discretization/staggered/freeflow/fickslaw.hh b/dumux/discretization/staggered/freeflow/fickslaw.hh index 25d711fef1..968d17938e 100644 --- a/dumux/discretization/staggered/freeflow/fickslaw.hh +++ b/dumux/discretization/staggered/freeflow/fickslaw.hh @@ -110,23 +110,23 @@ public: if(compIdx == mainCompIdx) continue; - auto eqIdx = 1; - - const Scalar tij = transmissibility_(problem, fvGeometry, elemVolVars, scvf, compIdx); - const Scalar insideMoleFraction = insideVolVars.moleFraction(phaseIdx, compIdx); + // get equation index + const auto eqIdx = conti0EqIdx + compIdx; if(scvf.boundary()) { const auto bcTypes = problem.boundaryTypesAtPos(scvf.center()); - if(bcTypes.isOutflow(momentumBalanceIdx) || bcTypes.isNeumann(eqIdx)) // TODO: catch neumann and outflow in localResidual's evalBoundary_() + if(bcTypes.isOutflow(eqIdx) && eqIdx != pressureIdx) return flux; } + const Scalar tij = transmissibility_(problem, fvGeometry, elemVolVars, scvf, compIdx); + const Scalar insideMoleFraction = insideVolVars.moleFraction(phaseIdx, compIdx); + const Scalar outsideMolarDensity = scvf.boundary() ? insideVolVars.molarDensity() : outsideVolVars.molarDensity(); const Scalar avgDensity = 0.5*(insideMolarDensity + outsideMolarDensity); const Scalar outsideMoleFraction = outsideVolVars.moleFraction(phaseIdx, compIdx); flux[compIdx] = avgDensity * tij * (insideMoleFraction - outsideMoleFraction); - ++eqIdx; } if(!(useMoles && replaceCompEqIdx == mainCompIdx)) -- GitLab