Commit afb78a45 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[navierstokes][localresidual] Early return zero flux for symmetry BCs

parent e4f43fd7
......@@ -201,30 +201,30 @@ public:
const auto bcTypes = problem.boundaryTypes(element, scvf);
// no fluxes occur over symmetry boundaries
if (!bcTypes.isSymmetry())
{
const auto extrusionFactor = elemVolVars[scvf.insideScvIdx()].extrusionFactor();
if (bcTypes.isSymmetry())
return result;
const auto extrusionFactor = elemVolVars[scvf.insideScvIdx()].extrusionFactor();
// treat Dirichlet and outflow BCs
result = computeFluxForCellCenter(problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf, elemFluxVarsCache);
// treat Dirichlet and outflow BCs
result = computeFluxForCellCenter(problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf, elemFluxVarsCache);
// treat Neumann BCs, i.e. overwrite certain fluxes by user-specified values
static constexpr auto numEqCellCenter = CellCenterResidual::dimension;
if(bcTypes.hasNeumann())
// treat Neumann BCs, i.e. overwrite certain fluxes by user-specified values
static constexpr auto numEqCellCenter = CellCenterResidual::dimension;
if (bcTypes.hasNeumann())
{
for(int eqIdx = 0; eqIdx < numEqCellCenter; ++eqIdx)
{
for(int eqIdx = 0; eqIdx < numEqCellCenter; ++eqIdx)
if(bcTypes.isNeumann(eqIdx + cellCenterOffset))
{
if(bcTypes.isNeumann(eqIdx + cellCenterOffset))
{
result[eqIdx] = problem.neumann(element, fvGeometry, elemVolVars, elemFaceVars, scvf)[eqIdx + cellCenterOffset]
* extrusionFactor * scvf.area();
}
result[eqIdx] = problem.neumann(element, fvGeometry, elemVolVars, elemFaceVars, scvf)[eqIdx + cellCenterOffset]
* extrusionFactor * scvf.area();
}
}
// account for wall functions, if used
incorporateWallFunction_(result, problem, element, fvGeometry, scvf, elemVolVars, elemFaceVars);
}
// account for wall functions, if used
incorporateWallFunction_(result, problem, element, fvGeometry, scvf, elemVolVars, elemFaceVars);
}
return result;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment