Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
c505f6cd
Commit
c505f6cd
authored
Aug 02, 2018
by
Kilian Weishaupt
Browse files
[freeflow][localResidual] Skip calculation of fluxes for symmetry boundaries
parent
2a1d034a
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/freeflow/navierstokes/staggered/localresidual.hh
View file @
c505f6cd
...
...
@@ -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 BC
s
FluxVariables
fluxVars
;
auto
boundaryFlux
=
fluxVars
.
computeMassFlux
(
problem
,
element
,
fvGeometry
,
elemVolVars
,
elemFaceVars
,
scvf
,
elemFluxVarsCache
[
scvf
]
);
//
no fluxes occur over symmetry boundarie
s
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
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment