diff --git a/dumux/discretization/staggered/freeflow/subcontrolvolumeface.hh b/dumux/discretization/staggered/freeflow/subcontrolvolumeface.hh index d1b89848f2f205f931e10f7c63e8c2bd53e9df9a..2e203e0e81d15b190aa38cfcee4f8a00fb3744b2 100644 --- a/dumux/discretization/staggered/freeflow/subcontrolvolumeface.hh +++ b/dumux/discretization/staggered/freeflow/subcontrolvolumeface.hh @@ -334,6 +334,7 @@ public: { if (parallelDegreeIdx == 0) return (faceLength(localSubFaceIdx) + pairData(localSubFaceIdx).parallelCellWidths[0]) * 0.5; + // pairData(localSubFaceIdx).parallelCellWidths[0]) will return 0.0 if the subface perpendicular the scvf lies on a boundary else { assert((parallelDegreeIdx == 1) && "Only the width of the first two parallel cells (indicies 0 and 1) is stored for each scvf."); diff --git a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh index 2276366472f0922e72527b3f114df0aaa2b13362..70b8c08024888ab2f6daf1f9db5849cfc516730e 100644 --- a/dumux/freeflow/navierstokes/staggered/fluxvariables.hh +++ b/dumux/freeflow/navierstokes/staggered/fluxvariables.hh @@ -294,7 +294,7 @@ public: // Check if there is face/element parallel to our face of interest where the dof lives on. If there is no parallel neighbor, // we are on a boundary where we have to check for boundary conditions. - if (!scvf.hasParallelNeighbor(localSubFaceIdx, 0)) + if (lateralScvf.boundary()) { // Construct a temporary scvf which corresponds to the staggered sub face, featuring the location // the sub faces's center. @@ -526,7 +526,7 @@ private: const auto getParallelVelocity = [&]() { - if (scvf.hasParallelNeighbor(localSubFaceIdx, 0)) + if (!lateralFace.boundary()) return faceVars.velocityParallel(localSubFaceIdx, 0); else if (lateralFaceBoundaryTypes->isDirichlet(Indices::velocity(scvf.directionIndex()))) return problem.dirichlet(element, makeParallelGhostFace_(scvf, localSubFaceIdx))[Indices::velocity(scvf.directionIndex())]; @@ -540,7 +540,8 @@ private: const Scalar outerParallelVelocity = getParallelVelocity(); // The velocity gradient already accounts for the orientation - // of the staggered face's outer normal vector. + // of the staggered face's outer normal vector. This also correctly accounts for the reduced + // distance used in the gradient if the lateral scvf lies on a boundary. const Scalar velocityGrad_ij = (outerParallelVelocity - innerParallelVelocity) / scvf.parallelDofsDistance(localSubFaceIdx, 0);