Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux
Commits
0563c14d
Commit
0563c14d
authored
5 years ago
by
Kilian Weishaupt
Browse files
Options
Downloads
Patches
Plain Diff
[staggeredupwindfluxvars] Clean-up
* Remove unused code and simplify
parent
82c63ef4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1551
[freeflow][upwindfluxvars] Use given velocity value at boundary
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/freeflow/navierstokes/staggered/staggeredupwindfluxvariables.hh
+20
-44
20 additions, 44 deletions
...ow/navierstokes/staggered/staggeredupwindfluxvariables.hh
with
20 additions
and
44 deletions
dumux/freeflow/navierstokes/staggered/staggeredupwindfluxvariables.hh
+
20
−
44
View file @
0563c14d
...
...
@@ -72,9 +72,6 @@ class StaggeredUpwindFluxVariables
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
static
constexpr
bool
useHigherOrder
=
upwindSchemeOrder
>
1
;
static
constexpr
auto
cellCenterIdx
=
FVGridGeometry
::
cellCenterIdx
();
static
constexpr
auto
faceIdx
=
FVGridGeometry
::
faceIdx
();
public:
/*!
* \brief Returns the momentum in the frontal directon.
...
...
@@ -90,23 +87,20 @@ public:
const
GridFluxVariablesCache
&
gridFluxVarsCache
,
const
Scalar
transportingVelocity
)
{
Scalar
momentum
(
0.0
);
const
bool
canHigherOrder
=
canFrontalSecondOrder_
(
scvf
,
transportingVelocity
,
std
::
integral_constant
<
bool
,
useHigherOrder
>
{});
if
(
canHigherOrder
)
{
const
auto
upwindingMomenta
=
getFrontalUpwindingMomenta_
(
scvf
,
elemFaceVars
,
elemVolVars
[
scvf
.
insideScvIdx
()].
density
(),
transportingVelocity
,
std
::
integral_constant
<
bool
,
useHigherOrder
>
{});
momentum
=
doFrontalMomentumUpwinding_
(
scvf
,
upwindingMomenta
,
transportingVelocity
,
gridFluxVarsCache
);
return
doFrontalMomentumUpwinding_
(
scvf
,
upwindingMomenta
,
transportingVelocity
,
gridFluxVarsCache
);
}
else
{
const
auto
upwindingMomenta
=
getFrontalUpwindingMomenta_
(
scvf
,
elemFaceVars
,
elemVolVars
[
scvf
.
insideScvIdx
()].
density
(),
transportingVelocity
,
std
::
integral_constant
<
bool
,
false
>
{});
momentum
=
doFrontalMomentumUpwinding_
(
scvf
,
upwindingMomenta
,
transportingVelocity
,
gridFluxVarsCache
);
return
doFrontalMomentumUpwinding_
(
scvf
,
upwindingMomenta
,
transportingVelocity
,
gridFluxVarsCache
);
}
return
momentum
;
}
/*!
...
...
@@ -137,7 +131,6 @@ public:
// Check whether the own or the neighboring element is upstream.
const
bool
selfIsUpstream
=
(
normalFace
.
directionSign
()
==
sign
(
transportingVelocity
)
);
Scalar
momentum
(
0.0
);
const
bool
canHigherOrder
=
canLateralSecondOrder_
(
scvf
,
selfIsUpstream
,
localSubFaceIdx
,
std
::
integral_constant
<
bool
,
useHigherOrder
>
{});
if
(
canHigherOrder
)
...
...
@@ -146,7 +139,7 @@ public:
transportingVelocity
,
localSubFaceIdx
,
lateralFaceHasDirichletPressure
,
lateralFaceHasBJS
,
std
::
integral_constant
<
bool
,
useHigherOrder
>
{});
momentum
=
doLateralMomentumUpwinding_
(
scvf
,
normalFace
,
parallelUpwindingMomenta
,
transportingVelocity
,
localSubFaceIdx
,
gridFluxVarsCache
);
return
doLateralMomentumUpwinding_
(
scvf
,
normalFace
,
parallelUpwindingMomenta
,
transportingVelocity
,
localSubFaceIdx
,
gridFluxVarsCache
);
}
else
{
...
...
@@ -154,10 +147,8 @@ public:
transportingVelocity
,
localSubFaceIdx
,
lateralFaceHasDirichletPressure
,
lateralFaceHasBJS
,
std
::
integral_constant
<
bool
,
false
>
{});
momentum
=
doLateralMomentumUpwinding_
(
scvf
,
normalFace
,
parallelUpwindingMomenta
,
transportingVelocity
,
localSubFaceIdx
,
gridFluxVarsCache
);
return
doLateralMomentumUpwinding_
(
scvf
,
normalFace
,
parallelUpwindingMomenta
,
transportingVelocity
,
localSubFaceIdx
,
gridFluxVarsCache
);
}
return
momentum
;
}
private
:
...
...
@@ -174,9 +165,7 @@ private:
static
bool
canFrontalSecondOrder_
(
const
SubControlVolumeFace
&
ownScvf
,
const
Scalar
transportingVelocity
,
std
::
false_type
)
{
return
false
;
}
{
return
false
;
}
/*!
* \brief Returns whether or not the face in question is far enough from the wall to handle higher order methods.
...
...
@@ -199,19 +188,9 @@ private:
const
bool
selfIsUpstream
=
ownScvf
.
directionSign
()
!=
sign
(
transportingVelocity
);
if
(
selfIsUpstream
)
{
if
(
ownScvf
.
hasForwardNeighbor
(
0
))
return
true
;
else
return
false
;
}
return
ownScvf
.
hasForwardNeighbor
(
0
);
else
{
if
(
ownScvf
.
hasBackwardNeighbor
(
0
))
return
true
;
else
return
false
;
}
return
ownScvf
.
hasBackwardNeighbor
(
0
);
}
/*!
...
...
@@ -253,7 +232,7 @@ private:
std
::
true_type
)
{
const
bool
selfIsUpstream
=
scvf
.
directionSign
()
!=
sign
(
transportingVelocity
);
std
::
array
<
Scalar
,
3
>
momenta
{
0.0
,
0.0
,
0.0
}
;
std
::
array
<
Scalar
,
3
>
momenta
;
if
(
selfIsUpstream
)
{
...
...
@@ -320,7 +299,7 @@ private:
{
// Depending on selfIsUpstream the downstream and the (up)upstream distances are saved.
// distances {upstream to downstream distance, up-upstream to upstream distance, downstream staggered cell size}
std
::
array
<
Scalar
,
3
>
distances
{
0.0
,
0.0
,
0.0
}
;
std
::
array
<
Scalar
,
3
>
distances
;
if
(
selfIsUpstream
)
{
...
...
@@ -362,10 +341,7 @@ private:
else
{
// The self velocity is downstream. If there is no parallel neighbor I cannot use a second order approximation.
if
(
!
ownScvf
.
hasParallelNeighbor
(
localSubFaceIdx
,
0
))
return
false
;
else
return
true
;
return
ownScvf
.
hasParallelNeighbor
(
localSubFaceIdx
,
0
);
}
}
...
...
@@ -540,16 +516,16 @@ private:
const
bool
selfIsUpstream
)
{
// distances {upstream to downstream distance, up-upstream to upstream distance, downstream staggered cell size}
std
::
array
<
Scalar
,
3
>
distances
{
0.0
,
0.0
,
0.0
};
// The local index of the faces that is opposite to localSubFaceIdx
const
int
oppositeSubFaceIdx
=
localSubFaceIdx
%
2
?
localSubFaceIdx
-
1
:
localSubFaceIdx
+
1
;
std
::
array
<
Scalar
,
3
>
distances
;
if
(
selfIsUpstream
)
{
// The local index of the faces that is opposite to localSubFaceIdx
const
int
oppositeSubFaceIdx
=
localSubFaceIdx
%
2
?
localSubFaceIdx
-
1
:
localSubFaceIdx
+
1
;
distances
[
0
]
=
ownScvf
.
cellCenteredParallelDistance
(
localSubFaceIdx
,
0
);
distances
[
1
]
=
ownScvf
.
cellCenteredParallelDistance
(
oppositeSubFaceIdx
,
0
);
if
(
ownScvf
.
hasParallelNeighbor
(
localSubFaceIdx
,
0
))
if
(
ownScvf
.
hasParallelNeighbor
(
localSubFaceIdx
,
0
))
distances
[
2
]
=
ownScvf
.
pairData
(
localSubFaceIdx
).
parallelCellWidths
[
0
];
else
distances
[
2
]
=
ownScvf
.
area
()
/
2.0
;
...
...
@@ -592,10 +568,13 @@ private:
if
(
lateralFaceHasDirichletPressure
)
return
velocitySelf
;
const
auto
ghostFace
=
makeParallelGhostFace_
(
scvf
,
localSubFaceIdx
);
if
(
lateralFaceHasBJS
)
return
problem
.
bjsVelocity
(
element
,
scvf
,
normalFace
,
localSubFaceIdx
,
velocitySelf
);
return
problem
.
dirichlet
(
element
,
ghostFace
)[
Indices
::
velocity
(
scvf
.
directionIndex
())];
else
{
const
auto
ghostFace
=
makeParallelGhostFace_
(
scvf
,
localSubFaceIdx
);
return
problem
.
dirichlet
(
element
,
ghostFace
)[
Indices
::
velocity
(
scvf
.
directionIndex
())];
}
}
/*!
...
...
@@ -633,10 +612,7 @@ private:
else
if
(
bcTypes
.
isSymmetry
()
||
bcTypes
.
isDirichlet
(
Indices
::
pressureIdx
))
return
parallelVelocity
;
else
if
(
bcTypes
.
isBJS
(
Indices
::
velocity
(
scvf
.
directionIndex
())))
{
const
SubControlVolumeFace
ghostFace
=
makeParallelGhostFace_
(
scvf
,
localIdx
);
return
problem
.
bjsVelocity
(
boundaryElement
,
scvf
,
boundaryNormalFace
,
localIdx
,
parallelVelocity
);
}
else
{
// Neumann conditions are not well implemented
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment