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
7e25d217
Commit
7e25d217
authored
8 months ago
by
Martin Schneider
Browse files
Options
Downloads
Patches
Plain Diff
[flux][dispersion] Include extrusionFactor in Box dispersion flux
parent
c4f9bb0b
No related branches found
No related tags found
1 merge request
!3803
Fix/tpfa dispersion
Checking pipeline status
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/flux/box/dispersionflux.hh
+45
-8
45 additions, 8 deletions
dumux/flux/box/dispersionflux.hh
with
45 additions
and
8 deletions
dumux/flux/box/dispersionflux.hh
+
45
−
8
View file @
7e25d217
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#include
<dune/common/fvector.hh>
#include
<dune/common/fvector.hh>
#include
<dune/common/fmatrix.hh>
#include
<dune/common/fmatrix.hh>
#include
<dune/common/float_cmp.hh>
#include
<dumux/common/math.hh>
#include
<dumux/common/math.hh>
#include
<dumux/common/properties.hh>
#include
<dumux/common/properties.hh>
...
@@ -22,6 +23,7 @@
...
@@ -22,6 +23,7 @@
#include
<dumux/discretization/extrusion.hh>
#include
<dumux/discretization/extrusion.hh>
#include
<dumux/flux/traits.hh>
#include
<dumux/flux/traits.hh>
#include
<dumux/flux/referencesystemformulation.hh>
#include
<dumux/flux/referencesystemformulation.hh>
#include
<dumux/flux/facetensoraverage.hh>
namespace
Dumux
{
namespace
Dumux
{
...
@@ -102,13 +104,30 @@ public:
...
@@ -102,13 +104,30 @@ public:
rhoMassOrMole
+=
rho
*
shapeValues
[
scv
.
indexInElement
()][
0
];
rhoMassOrMole
+=
rho
*
shapeValues
[
scv
.
indexInElement
()][
0
];
}
}
const
auto
&
insideVolVars
=
elemVolVars
[
scvf
.
insideScvIdx
()];
const
auto
&
outsideVolVars
=
elemVolVars
[
scvf
.
outsideScvIdx
()];
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
compIdx
++
)
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
compIdx
++
)
{
{
// collect the dispersion tensor, the fluxVarsCache and the shape values
// collect the dispersion tensor, the fluxVarsCache and the shape values
const
auto
&
dispersionTensor
=
const
auto
&
dispersionTensor
=
[
&
]()
ModelTraits
::
CompositionalDispersionModel
::
compositionalDispersionTensor
(
problem
,
scvf
,
fvGeometry
,
{
elemVolVars
,
elemFluxVarsCache
,
const
auto
&
tensor
=
phaseIdx
,
compIdx
);
ModelTraits
::
CompositionalDispersionModel
::
compositionalDispersionTensor
(
problem
,
scvf
,
fvGeometry
,
elemVolVars
,
elemFluxVarsCache
,
phaseIdx
,
compIdx
);
if
(
Dune
::
FloatCmp
::
eq
(
insideVolVars
.
extrusionFactor
(),
outsideVolVars
.
extrusionFactor
(),
1e-6
))
return
insideVolVars
.
extrusionFactor
()
*
tensor
;
else
{
const
auto
insideTensor
=
insideVolVars
.
extrusionFactor
()
*
tensor
;
const
auto
outsideTensor
=
outsideVolVars
.
extrusionFactor
()
*
tensor
;
// the resulting averaged dispersion tensor
return
faceTensorAverage
(
insideTensor
,
outsideTensor
,
scvf
.
unitOuterNormal
());
}
}();
// the mole/mass fraction gradient
// the mole/mass fraction gradient
Dune
::
FieldVector
<
Scalar
,
dimWorld
>
gradX
(
0.0
);
Dune
::
FieldVector
<
Scalar
,
dimWorld
>
gradX
(
0.0
);
...
@@ -138,11 +157,29 @@ public:
...
@@ -138,11 +157,29 @@ public:
const
int
phaseIdx
,
const
int
phaseIdx
,
const
ElementFluxVariablesCache
&
elemFluxVarsCache
)
const
ElementFluxVariablesCache
&
elemFluxVarsCache
)
{
{
const
auto
&
insideVolVars
=
elemVolVars
[
scvf
.
insideScvIdx
()];
const
auto
&
outsideVolVars
=
elemVolVars
[
scvf
.
outsideScvIdx
()];
// collect the dispersion tensor
// collect the dispersion tensor
const
auto
&
dispersionTensor
=
const
auto
&
dispersionTensor
=
[
&
]()
ModelTraits
::
ThermalDispersionModel
::
thermalDispersionTensor
(
problem
,
scvf
,
fvGeometry
,
{
elemVolVars
,
elemFluxVarsCache
,
const
auto
&
tensor
=
phaseIdx
);
ModelTraits
::
ThermalDispersionModel
::
thermalDispersionTensor
(
problem
,
scvf
,
fvGeometry
,
elemVolVars
,
elemFluxVarsCache
,
phaseIdx
);
if
(
Dune
::
FloatCmp
::
eq
(
insideVolVars
.
extrusionFactor
(),
outsideVolVars
.
extrusionFactor
(),
1e-6
))
return
insideVolVars
.
extrusionFactor
()
*
tensor
;
else
{
const
auto
insideTensor
=
insideVolVars
.
extrusionFactor
()
*
tensor
;
const
auto
outsideTensor
=
outsideVolVars
.
extrusionFactor
()
*
tensor
;
// the resulting averaged dispersion tensor
return
faceTensorAverage
(
insideTensor
,
outsideTensor
,
scvf
.
unitOuterNormal
());
}
}();
// compute the temperature gradient with the shape functions
// compute the temperature gradient with the shape functions
const
auto
&
fluxVarsCache
=
elemFluxVarsCache
[
scvf
];
const
auto
&
fluxVarsCache
=
elemFluxVarsCache
[
scvf
];
Dune
::
FieldVector
<
Scalar
,
GridView
::
dimensionworld
>
gradTemp
(
0.0
);
Dune
::
FieldVector
<
Scalar
,
GridView
::
dimensionworld
>
gradTemp
(
0.0
);
...
...
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