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
2169a267
Commit
2169a267
authored
7 years ago
by
Kilian Weishaupt
Browse files
Options
Downloads
Patches
Plain Diff
[staggered] Improve usability of faceVars
parent
f4c85a46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!617
[WIP] Next
,
!576
Feature/port staggered ff to next next
,
!571
Cleanup/next
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dumux/discretization/staggered/freeflow/facevariables.hh
+19
-64
19 additions, 64 deletions
dumux/discretization/staggered/freeflow/facevariables.hh
dumux/freeflow/staggered/fluxvariables.hh
+7
-9
7 additions, 9 deletions
dumux/freeflow/staggered/fluxvariables.hh
with
26 additions
and
73 deletions
dumux/discretization/staggered/freeflow/facevariables.hh
+
19
−
64
View file @
2169a267
...
...
@@ -37,80 +37,35 @@ template<class TypeTag>
class
StaggeredFaceVariables
{
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
FaceSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
FaceSolutionVector
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
FacePrimaryVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
FacePrimaryVariables
);
using
SubControlVolumeFace
=
typename
GET_PROP_TYPE
(
TypeTag
,
SubControlVolumeFace
);
using
GlobalFaceVars
=
typename
GET_PROP_TYPE
(
TypeTag
,
GlobalFaceVars
);
using
FaceSolution
=
typename
GET_PROP_TYPE
(
TypeTag
,
StaggeredFaceSolution
);
struct
SubFaceData
{
Scalar
velocityNormalInside
;
Scalar
velocityNormalOutside
;
Scalar
velocityParallelInside
;
Scalar
velocityParallelOutside
;
};
static
constexpr
int
dimWorld
=
GridView
::
dimensionworld
;
static
constexpr
int
numPairs
=
(
dimWorld
==
2
)
?
2
:
4
;
public:
StaggeredFaceVariables
()
=
default
;
StaggeredFaceVariables
(
const
GlobalFaceVars
&
globalFacesVars
)
:
globalFaceVarsPtr_
(
&
globalFacesVars
)
{}
const
StaggeredFaceVariables
&
operator
[](
const
SubControlVolumeFace
&
scvf
)
const
{
return
globalFaceVars
().
faceVars
(
scvf
.
index
());
}
// // operator for the access with an index
// // needed for cc methods for the access to the boundary volume variables
// const StaggeredFaceVariables& operator [](const IndexType scvIdx) const
// { return globalVolVars().volVars(scvIdx); }
void
update
(
const
FacePrimaryVariables
&
facePrivars
)
{
velocitySelf_
=
facePrivars
;
}
void
update
(
const
SubControlVolumeFace
&
scvf
,
const
FaceSolutionVector
&
sol
)
{
velocitySelf_
=
sol
[
scvf
.
dofIndex
()];
velocityOpposite_
=
sol
[
scvf
.
dofIndexOpposingFace
()];
subFaceVelocities_
.
resize
(
scvf
.
pairData
().
size
());
for
(
int
i
=
0
;
i
<
scvf
.
pairData
().
size
();
++
i
)
{
subFaceVelocities_
[
i
].
velocityNormalInside
=
sol
[
scvf
.
pairData
(
i
).
normalPair
.
first
];
if
(
scvf
.
pairData
(
i
).
normalPair
.
second
>=
0
)
subFaceVelocities_
[
i
].
velocityNormalOutside
=
sol
[
scvf
.
pairData
(
i
).
normalPair
.
second
];
subFaceVelocities_
[
i
].
velocityParallelInside
=
sol
[
scvf
.
dofIndex
()];
if
(
scvf
.
pairData
(
i
).
outerParallelFaceDofIdx
>=
0
)
subFaceVelocities_
[
i
].
velocityParallelOutside
=
sol
[
scvf
.
pairData
(
i
).
outerParallelFaceDofIdx
];
}
}
void
update
(
const
SubControlVolumeFace
&
scvf
,
const
FaceSolution
&
faceSol
)
template
<
class
SolVector
>
void
update
(
const
SubControlVolumeFace
&
scvf
,
const
SolVector
&
faceSol
)
{
velocitySelf_
=
faceSol
[
scvf
.
dofIndex
()];
velocityOpposite_
=
faceSol
[
scvf
.
dofIndexOpposingFace
()];
subFaceVelocities_
.
resize
(
scvf
.
pairData
().
size
());
for
(
int
i
=
0
;
i
<
scvf
.
pairData
().
size
();
++
i
)
{
subFaceVelocities_
[
i
].
velocityNormalInside
=
faceSol
[
scvf
.
pairData
(
i
).
normalPair
.
first
];
velocityNormalInside
_
[
i
]
=
faceSol
[
scvf
.
pairData
(
i
).
normalPair
.
first
];
if
(
scvf
.
pairData
(
i
).
normalPair
.
second
>=
0
)
subFaceVelocities_
[
i
].
velocityNormalOutside
=
faceSol
[
scvf
.
pairData
(
i
).
normalPair
.
second
];
subFaceVelocities_
[
i
].
velocityParallelInside
=
faceSol
[
scvf
.
dofIndex
()];
velocityNormalOutside_
[
i
]
=
faceSol
[
scvf
.
pairData
(
i
).
normalPair
.
second
];
if
(
scvf
.
pairData
(
i
).
outerParallelFaceDofIdx
>=
0
)
subFaceVelocities_
[
i
].
velocityParallel
Outside
=
faceSol
[
scvf
.
pairData
(
i
).
outerParallelFaceDofIdx
];
velocityParallel
_
[
i
]
=
faceSol
[
scvf
.
pairData
(
i
).
outerParallelFaceDofIdx
];
}
}
...
...
@@ -124,27 +79,27 @@ public:
return
velocityOpposite_
;
}
auto
&
s
ubFace
Data
(
)
const
Scalar
velocityParallel
(
const
int
localS
ubFace
Idx
)
const
{
return
subFaceVelocities_
;
return
velocityParallel_
[
localSubFaceIdx
]
;
}
auto
&
subFaceData
(
const
int
localSubFaceIdx
)
const
Scalar
velocityNormalInside
(
const
int
localSubFaceIdx
)
const
{
return
subFaceVelocities
_
[
localSubFaceIdx
];
return
velocityNormalInside
_
[
localSubFaceIdx
];
}
//! The global volume variables object we are a restriction of
const
GlobalFaceVars
&
globalFaceVars
()
const
{
return
*
globalFaceVarsPtr_
;
}
Scalar
velocityNormalOutside
(
const
int
localSubFaceIdx
)
const
{
return
velocityNormalOutside_
[
localSubFaceIdx
];
}
private
:
const
GlobalFaceVars
*
globalFaceVarsPtr_
;
Scalar
velocity_
;
Scalar
velocitySelf_
;
Scalar
velocityOpposite_
;
std
::
vector
<
SubFaceData
>
subFaceVelocities_
;
std
::
array
<
Scalar
,
numPairs
>
velocityParallel_
;
std
::
array
<
Scalar
,
numPairs
>
velocityNormalInside_
;
std
::
array
<
Scalar
,
numPairs
>
velocityNormalOutside_
;
};
}
// end namespace
...
...
This diff is collapsed.
Click to expand it.
dumux/freeflow/staggered/fluxvariables.hh
+
7
−
9
View file @
2169a267
...
...
@@ -297,7 +297,7 @@ private:
const
FaceVars
&
faceVars
,
const
int
localSubFaceIdx
)
{
const
Scalar
transportingVelocity
=
faceVars
.
subFaceData
(
localSubFaceIdx
).
velocityNormalInside
;
const
Scalar
transportingVelocity
=
faceVars
.
velocityNormalInside
(
localSubFaceIdx
)
;
const
auto
insideScvIdx
=
normalFace
.
insideScvIdx
();
const
auto
outsideScvIdx
=
normalFace
.
outsideScvIdx
();
...
...
@@ -314,12 +314,12 @@ private:
Scalar
transportedVelocity
(
0.0
);
if
(
innerElementIsUpstream
)
transportedVelocity
=
faceVars
.
subFaceData
(
localSubFaceIdx
).
velocityParallelInside
;
transportedVelocity
=
faceVars
.
velocitySelf
()
;
else
{
const
int
outerDofIdx
=
scvf
.
pairData
(
localSubFaceIdx
).
outerParallelFaceDofIdx
;
if
(
outerDofIdx
>=
0
)
transportedVelocity
=
faceVars
.
subFaceData
(
localSubFaceIdx
)
.
velocityParallelOutside
;
transportedVelocity
=
faceVars
.
velocityParallel
(
localSubFaceIdx
);
else
// this is the case when the outer parallal dof would lie outside the domain TODO: discuss which one is better
// transportedVelocity = problem.dirichlet(makeGhostFace(subFaceData.virtualOuterParallelFaceDofPos))[faceIdx][scvf.directionIndex()];
transportedVelocity
=
problem
.
dirichlet
(
element
,
scvf
)[
faceIdx
][
scvf
.
directionIndex
()];
...
...
@@ -361,10 +361,10 @@ private:
// the normal derivative
const
int
outerNormalVelocityIdx
=
scvf
.
pairData
(
localSubFaceIdx
).
normalPair
.
second
;
const
Scalar
innerNormalVelocity
=
faceVars
.
subFaceData
(
localSubFaceIdx
).
velocityNormalInside
;
const
Scalar
innerNormalVelocity
=
faceVars
.
velocityNormalInside
(
localSubFaceIdx
)
;
const
Scalar
outerNormalVelocity
=
outerNormalVelocityIdx
>=
0
?
faceVars
.
subFaceData
(
localSubFaceIdx
).
velocityNormalOutside
:
faceVars
.
velocityNormalOutside
(
localSubFaceIdx
)
:
problem
.
dirichlet
(
element
,
makeGhostFace
(
scvf
.
pairData
(
localSubFaceIdx
).
virtualOuterNormalFaceDofPos
))[
faceIdx
][
normalDirIdx
];
const
Scalar
normalDeltaV
=
scvf
.
normalInPosCoordDir
()
?
...
...
@@ -375,13 +375,11 @@ private:
tangentialDiffusiveFlux
-=
muAvg
*
normalDerivative
;
// the parallel derivative
// const Scalar innerParallelVelocity = velocity(scvf.dofIndex());
const
Scalar
innerParallelVelocity
=
faceVars
.
subFaceData
(
localSubFaceIdx
).
velocityParallelInside
;
const
Scalar
innerParallelVelocity
=
faceVars
.
velocitySelf
();
const
int
outerParallelFaceDofIdx
=
scvf
.
pairData
(
localSubFaceIdx
).
outerParallelFaceDofIdx
;
const
Scalar
outerParallelVelocity
=
outerParallelFaceDofIdx
>=
0
?
faceVars
.
subFaceData
(
localSubFaceIdx
).
velocityParallelOutside
:
// velocity(outerParallelFaceDofIdx) :
faceVars
.
velocityParallel
(
localSubFaceIdx
)
:
problem
.
dirichlet
(
element
,
makeGhostFace
(
scvf
.
pairData
(
localSubFaceIdx
).
virtualOuterParallelFaceDofPos
))[
faceIdx
][
scvf
.
directionIndex
()];
const
Scalar
parallelDeltaV
=
normalFace
.
normalInPosCoordDir
()
?
...
...
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