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
28f187c4
Commit
28f187c4
authored
5 years ago
by
Kilian Weishaupt
Browse files
Options
Downloads
Patches
Plain Diff
[tracer][localresidual] Use free function for density
parent
e9a7d5cf
No related branches found
No related tags found
1 merge request
!1696
Feature/diffusion laws mass refvelocity
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/porousmediumflow/tracer/localresidual.hh
+8
-10
8 additions, 10 deletions
dumux/porousmediumflow/tracer/localresidual.hh
with
8 additions
and
10 deletions
dumux/porousmediumflow/tracer/localresidual.hh
+
8
−
10
View file @
28f187c4
...
@@ -242,24 +242,22 @@ public:
...
@@ -242,24 +242,22 @@ public:
const
auto
&
insideVolVars
=
curElemVolVars
[
scvf
.
insideScvIdx
()];
const
auto
&
insideVolVars
=
curElemVolVars
[
scvf
.
insideScvIdx
()];
const
auto
&
outsideVolVars
=
curElemVolVars
[
scvf
.
outsideScvIdx
()];
const
auto
&
outsideVolVars
=
curElemVolVars
[
scvf
.
outsideScvIdx
()];
const
auto
insideWeight
=
std
::
signbit
(
volFlux
)
?
(
1.0
-
upwindWeight
)
:
upwindWeight
;
const
Scalar
insideWeight
=
std
::
signbit
(
volFlux
)
?
(
1.0
-
upwindWeight
)
:
upwindWeight
;
const
auto
outsideWeight
=
1.0
-
insideWeight
;
const
Scalar
outsideWeight
=
1.0
-
insideWeight
;
const
auto
advDerivII
=
volFlux
*
rho
(
insideVolVars
)
*
insideWeight
;
const
auto
advDerivII
=
volFlux
*
rho
(
insideVolVars
)
*
insideWeight
;
const
auto
advDerivIJ
=
volFlux
*
rho
(
outsideVolVars
)
*
outsideWeight
;
const
auto
advDerivIJ
=
volFlux
*
rho
(
outsideVolVars
)
*
outsideWeight
;
// diffusive term
// diffusive term
auto
referenceSystemFormulation
=
FluxVariables
::
MolecularDiffusionType
::
referenceSystemFormulation
();
const
auto
referenceSystemFormulation
=
FluxVariables
::
MolecularDiffusionType
::
referenceSystemFormulation
();
const
auto
&
fluxCache
=
elemFluxVarsCache
[
scvf
];
const
auto
&
fluxCache
=
elemFluxVarsCache
[
scvf
];
const
auto
rhoInside
=
(
referenceSystemFormulation
==
ReferenceSystemFormulation
::
massAveraged
)
?
insideVolVars
.
density
(
phaseIdx
)
:
insideVolVars
.
molarDensity
(
phaseIdx
);
const
Scalar
rhoInside
=
massOrMolarDensity
(
insideVolVars
,
referenceSystemFormulation
,
phaseIdx
);
const
Scalar
rhoOutside
=
massOrMolarDensity
(
outsideVolVars
,
referenceSystemFormulation
,
phaseIdx
);
const
auto
rhoOutside
=
(
referenceSystemFormulation
==
ReferenceSystemFormulation
::
massAveraged
)
?
outsideVolVars
.
density
(
phaseIdx
)
:
outsideVolVars
.
molarDensity
(
phaseIdx
);
const
Scalar
massOrMolarDensity
=
0.5
*
(
rhoInside
+
rhoOutside
);
const
auto
massOrMolarDensity
=
0.5
*
(
rhoInside
+
rhoOutside
);
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
++
compIdx
)
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
++
compIdx
)
{
{
// diffusive term
// diffusive term
auto
diffDeriv
=
0.0
;
Scalar
diffDeriv
=
0.0
;
if
(
referenceSystemFormulation
==
ReferenceSystemFormulation
::
massAveraged
)
if
(
referenceSystemFormulation
==
ReferenceSystemFormulation
::
massAveraged
)
{
{
diffDeriv
=
useMoles
?
massOrMolarDensity
*
fluxCache
.
diffusionTij
(
phaseIdx
,
compIdx
)
/
FluidSystem
::
molarMass
(
compIdx
)
diffDeriv
=
useMoles
?
massOrMolarDensity
*
fluxCache
.
diffusionTij
(
phaseIdx
,
compIdx
)
/
FluidSystem
::
molarMass
(
compIdx
)
...
@@ -268,7 +266,7 @@ public:
...
@@ -268,7 +266,7 @@ public:
else
if
(
referenceSystemFormulation
==
ReferenceSystemFormulation
::
molarAveraged
)
else
if
(
referenceSystemFormulation
==
ReferenceSystemFormulation
::
molarAveraged
)
{
{
diffDeriv
=
useMoles
?
massOrMolarDensity
*
fluxCache
.
diffusionTij
(
phaseIdx
,
compIdx
)
diffDeriv
=
useMoles
?
massOrMolarDensity
*
fluxCache
.
diffusionTij
(
phaseIdx
,
compIdx
)
:
massOrMolarDensity
*
fluxCache
.
diffusionTij
(
phaseIdx
,
compIdx
)
*
FluidSystem
::
molarMass
(
compIdx
);
:
massOrMolarDensity
*
fluxCache
.
diffusionTij
(
phaseIdx
,
compIdx
)
*
FluidSystem
::
molarMass
(
compIdx
);
}
}
else
else
DUNE_THROW
(
Dune
::
NotImplemented
,
"other reference systems than mass and molar averaged are not implemented"
);
DUNE_THROW
(
Dune
::
NotImplemented
,
"other reference systems than mass and molar averaged are not 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