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
db32a283
Commit
db32a283
authored
6 years ago
by
Katharina Heck
Browse files
Options
Downloads
Patches
Plain Diff
[box] reuse gradN from fluxvarscache
parent
70b50ab5
No related branches found
No related tags found
1 merge request
!1006
Cleanup/maxwellstefan
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/discretization/box/maxwellstefanslaw.hh
+10
-16
10 additions, 16 deletions
dumux/discretization/box/maxwellstefanslaw.hh
with
10 additions
and
16 deletions
dumux/discretization/box/maxwellstefanslaw.hh
+
10
−
16
View file @
db32a283
...
@@ -92,20 +92,15 @@ public:
...
@@ -92,20 +92,15 @@ public:
// evaluate gradX at integration point and interpolate density
// evaluate gradX at integration point and interpolate density
const
auto
&
fluxVarsCache
=
elemFluxVarsCache
[
scvf
];
const
auto
&
fluxVarsCache
=
elemFluxVarsCache
[
scvf
];
const
auto
&
jacInvT
=
fluxVarsCache
.
jacInvT
();
const
auto
&
shapeJacobian
=
fluxVarsCache
.
shapeJacobian
();
const
auto
&
shapeValues
=
fluxVarsCache
.
shapeValues
();
const
auto
&
shapeValues
=
fluxVarsCache
.
shapeValues
();
Scalar
rho
(
0.0
);
Scalar
rho
(
0.0
);
std
::
vector
<
GlobalPosition
>
gradN
(
fvGeometry
.
numScv
());
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
{
const
auto
&
volVars
=
elemVolVars
[
scv
];
const
auto
&
volVars
=
elemVolVars
[
scv
];
// density interpolation
// density interpolation
rho
+=
volVars
.
molarDensity
(
phaseIdx
)
*
shapeValues
[
scv
.
indexInElement
()][
0
];
rho
+=
volVars
.
molarDensity
(
phaseIdx
)
*
shapeValues
[
scv
.
indexInElement
()][
0
];
// the ansatz function gradient
jacInvT
.
mv
(
shapeJacobian
[
scv
.
localDofIndex
()][
0
],
gradN
[
scv
.
indexInElement
()]);
//interpolate the mole fraction for the diffusion matrix
//interpolate the mole fraction for the diffusion matrix
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
compIdx
++
)
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
compIdx
++
)
...
@@ -114,7 +109,7 @@ public:
...
@@ -114,7 +109,7 @@ public:
}
}
}
}
reducedDiffusionMatrix
=
setupMSMatrix_
(
problem
,
element
,
fvGeometry
,
elemVolVars
,
scvf
,
phaseIdx
,
moleFrac
);
reducedDiffusionMatrix
=
setupMSMatrix_
(
problem
,
element
,
fvGeometry
,
elemVolVars
,
scvf
,
phaseIdx
,
moleFrac
);
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
-
1
;
compIdx
++
)
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
-
1
;
compIdx
++
)
{
{
...
@@ -124,7 +119,7 @@ public:
...
@@ -124,7 +119,7 @@ public:
const
auto
&
volVars
=
elemVolVars
[
scv
];
const
auto
&
volVars
=
elemVolVars
[
scv
];
// the mole/mass fraction gradient
// the mole/mass fraction gradient
gradX
.
axpy
(
volVars
.
moleFraction
(
phaseIdx
,
compIdx
),
gradN
[
scv
.
indexInElement
()
]
);
gradX
.
axpy
(
volVars
.
moleFraction
(
phaseIdx
,
compIdx
),
fluxVarsCache
.
gradN
(
scv
.
indexInElement
()
)
);
}
}
normalX
[
compIdx
]
=
gradX
*
scvf
.
unitOuterNormal
();
normalX
[
compIdx
]
=
gradX
*
scvf
.
unitOuterNormal
();
...
@@ -132,11 +127,10 @@ public:
...
@@ -132,11 +127,10 @@ public:
reducedDiffusionMatrix
.
solve
(
reducedFlux
,
normalX
);
reducedDiffusionMatrix
.
solve
(
reducedFlux
,
normalX
);
reducedFlux
*=
-
1.0
*
rho
*
scvf
.
area
();
reducedFlux
*=
-
1.0
*
rho
*
scvf
.
area
();
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
-
1
;
compIdx
++
)
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
-
1
;
compIdx
++
)
{
{
componentFlux
[
compIdx
]
=
reducedFlux
[
compIdx
];
componentFlux
[
compIdx
]
=
reducedFlux
[
compIdx
];
componentFlux
[
numComponents
-
1
]
-=
reducedFlux
[
compIdx
];
componentFlux
[
numComponents
-
1
]
-=
reducedFlux
[
compIdx
];
}
}
return
componentFlux
;
return
componentFlux
;
}
}
...
@@ -144,12 +138,12 @@ public:
...
@@ -144,12 +138,12 @@ public:
private
:
private
:
static
ReducedComponentMatrix
setupMSMatrix_
(
const
Problem
&
problem
,
static
ReducedComponentMatrix
setupMSMatrix_
(
const
Problem
&
problem
,
const
Element
&
element
,
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolumeFace
&
scvf
,
const
SubControlVolumeFace
&
scvf
,
const
int
phaseIdx
,
const
int
phaseIdx
,
const
ComponentFluxVector
moleFrac
)
const
ComponentFluxVector
moleFrac
)
{
{
ReducedComponentMatrix
reducedDiffusionMatrix
(
0.0
);
ReducedComponentMatrix
reducedDiffusionMatrix
(
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