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

[freeflow][localResidual] Skip calculation of fluxes for symmetry boundaries

parent 2a1d034a
......@@ -225,39 +225,47 @@ protected:
if (scvf.boundary())
{
const auto bcTypes = problem.boundaryTypes(element, scvf);
const auto extrusionFactor = elemVolVars[scvf.insideScvIdx()].extrusionFactor();
// treat Dirichlet and outflow BCs
FluxVariables fluxVars;
auto boundaryFlux = fluxVars.computeMassFlux(problem, element, fvGeometry, elemVolVars,
elemFaceVars, scvf, elemFluxVarsCache[scvf]);
// no fluxes occur over symmetry boundaries
if (!bcTypes.isSymmetry())
{
const auto extrusionFactor = elemVolVars[scvf.insideScvIdx()].extrusionFactor();
EnergyLocalResidual::heatFlux(boundaryFlux, problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf);
// treat Dirichlet and outflow BCs
FluxVariables fluxVars;
auto boundaryFlux = fluxVars.computeMassFlux(problem, element, fvGeometry, elemVolVars,
elemFaceVars, scvf, elemFluxVarsCache[scvf]);
// 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)
EnergyLocalResidual::heatFlux(boundaryFlux, problem, element, fvGeometry, elemVolVars, elemFaceVars, scvf);
// treat Neumann BCs, i.e. overwrite certain fluxes by user-specified values
static constexpr auto numEqCellCenter = CellCenterResidual::dimension;
if(bcTypes.hasNeumann())
{
if(bcTypes.isNeumann(eqIdx + cellCenterOffset))
for(int eqIdx = 0; eqIdx < numEqCellCenter; ++eqIdx)
{
boundaryFlux[eqIdx] = problem.neumann(element, fvGeometry, elemVolVars, elemFaceVars, scvf)[eqIdx + cellCenterOffset]
* extrusionFactor * scvf.area();
if(bcTypes.isNeumann(eqIdx + cellCenterOffset))
{
boundaryFlux[eqIdx] = problem.neumann(element, fvGeometry, elemVolVars, elemFaceVars, scvf)[eqIdx + cellCenterOffset]
* extrusionFactor * scvf.area();
}
}
}
}
for(int eqIdx = 0; eqIdx < numEqCellCenter; ++eqIdx)
{
// use a wall function
if(problem.useWallFunction(element, scvf, eqIdx + cellCenterOffset))
// account for wall functions, if used
for(int eqIdx = 0; eqIdx < numEqCellCenter; ++eqIdx)
{
boundaryFlux[eqIdx] = problem.wallFunction(element, fvGeometry, elemVolVars, elemFaceVars, scvf)[eqIdx]
* extrusionFactor * scvf.area();
// use a wall function
if(problem.useWallFunction(element, scvf, eqIdx + cellCenterOffset))
{
boundaryFlux[eqIdx] = problem.wallFunction(element, fvGeometry, elemVolVars, elemFaceVars, scvf)[eqIdx]
* extrusionFactor * scvf.area();
}
}
}
residual += boundaryFlux;
// add the flux over the boundary scvf to the residual
residual += boundaryFlux;
}
// if specified, set a fixed value at the center of a cell at the boundary
const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
......
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