Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
40540edc
Commit
40540edc
authored
Dec 18, 2016
by
Dennis Gläser
Browse files
[mpfa][fickslaw] give some things new names
parent
7c6e2cf8
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/cellcentered/mpfa/fickslaw.hh
View file @
40540edc
...
...
@@ -77,27 +77,27 @@ public:
const
auto
&
tij
=
fluxVarsCache
.
diffusionTij
(
phaseIdx
,
compIdx
);
// get the scaling factor for the effective diffusive fluxes
auto
f
actor
=
calculateEffectiveDiffusivityFactor
(
elemVolVars
,
scvf
,
phaseIdx
);
auto
effF
actor
=
calculateEffectiveDiffusivityFactor
(
elemVolVars
,
scvf
,
phaseIdx
);
// if factor is zero, the flux will end up zero anyway
if
(
f
actor
==
0.0
)
if
(
effF
actor
==
0.0
)
return
0.0
;
// lambda functions depending on if we use mole or mass fractions
auto
xDensity
=
[
useMoles
,
phaseIdx
]
(
const
VolumeVariables
&
volVars
)
{
return
useMoles
?
volVars
.
molarDensity
(
phaseIdx
)
:
volVars
.
density
(
phaseIdx
);
};
auto
xFraction
=
[
useMoles
,
phaseIdx
,
compIdx
]
(
const
VolumeVariables
&
volVars
)
auto
getX
=
[
useMoles
,
phaseIdx
,
compIdx
]
(
const
VolumeVariables
&
volVars
)
{
return
useMoles
?
volVars
.
moleFraction
(
phaseIdx
,
compIdx
)
:
volVars
.
massFraction
(
phaseIdx
,
compIdx
);
};
auto
getRho
=
[
useMoles
,
phaseIdx
]
(
const
VolumeVariables
&
volVars
)
{
return
useMoles
?
volVars
.
molarDensity
(
phaseIdx
)
:
volVars
.
density
(
phaseIdx
);
};
// calculate Tij*xj
Scalar
flux
(
0.0
);
unsigned
int
localIdx
=
0
;
for
(
const
auto
volVarIdx
:
volVarsStencil
)
flux
+=
tij
[
localIdx
++
]
*
xFraction
(
elemVolVars
[
volVarIdx
]);
flux
+=
tij
[
localIdx
++
]
*
getX
(
elemVolVars
[
volVarIdx
]);
// return effective mass flux
return
flux
*
interpolateDensity
(
elemVolVars
,
scvf
,
xDensity
)
*
f
actor
;
return
flux
*
interpolateDensity
(
elemVolVars
,
scvf
,
getRho
)
*
effF
actor
;
}
static
Stencil
stencil
(
const
Problem
&
problem
,
...
...
@@ -115,21 +115,21 @@ public:
}
private:
template
<
typename
Density
Function
>
template
<
typename
GetRho
Function
>
static
Scalar
interpolateDensity
(
const
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolumeFace
&
scvf
,
const
Density
Function
&
rhoFunction
)
const
GetRho
Function
&
getRho
)
{
// use arithmetic mean of the densities around the scvf
if
(
!
scvf
.
boundary
())
{
Scalar
rho
=
rhoFunction
(
elemVolVars
[
scvf
.
insideScvIdx
()]);
Scalar
rho
=
getRho
(
elemVolVars
[
scvf
.
insideScvIdx
()]);
for
(
auto
outsideIdx
:
scvf
.
outsideScvIndices
())
rho
+=
rhoFunction
(
elemVolVars
[
outsideIdx
]);
rho
+=
getRho
(
elemVolVars
[
outsideIdx
]);
return
rho
/
(
scvf
.
outsideScvIndices
().
size
()
+
1
);
}
else
return
rhoFunction
(
elemVolVars
[
scvf
.
outsideScvIdx
()]);
return
getRho
(
elemVolVars
[
scvf
.
outsideScvIdx
()]);
}
//! Here we want to calculate the factors with which the diffusion coefficient has to be
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment