diff --git a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh
index 9db8fc856c3bf5cb4035128c2594b6ce5bfb0cc6..6d7e394c0199d18adc179ba2b4479c3ffbf7dfb1 100644
--- a/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh
+++ b/dumux/porousmediumflow/1p/incompressiblelocalresidual.hh
@@ -130,7 +130,10 @@ public:
         if (fluxVarsCache.usesSecondaryIv())
         {
             const auto& tij = fluxVarsCache.advectionTijSecondaryIv();
-            assert(stencil.size() == tij.size());
+
+            // We assume same the tij are order as the stencil up to stencil.size()
+            // any contribution of Dirichlet BCs is assumed to be placed afterwards
+            assert(stencil.size() <= tij.size());
 
             // add partial derivatives to the respective given matrices
             for (unsigned int i = 0; i < stencil.size();++i)
@@ -144,7 +147,10 @@ public:
         else
         {
             const auto& tij = fluxVarsCache.advectionTijPrimaryIv();
-            assert(stencil.size() == tij.size());
+
+            // We assume same the tij are order as the stencil up to stencil.size()
+            // any contribution of Dirichlet BCs is assumed to be placed afterwards
+            assert(stencil.size() <= tij.size());
 
             // add partial derivatives to the respective given matrices
             for (unsigned int i = 0; i < stencil.size();++i)