Skip to content
GitLab
Menu
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
4af64f83
Commit
4af64f83
authored
May 02, 2018
by
Thomas Fetzer
Browse files
[freeflow][compositional] Calculate diffusive fluxes for all components
How these fluxes are used later-on should be treated there.
parent
f993e36b
Changes
3
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/staggered/freeflow/fickslaw.hh
View file @
4af64f83
...
...
@@ -68,10 +68,8 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::staggered >
static_assert
(
ModelTraits
::
numPhases
()
==
1
,
"Only one phase allowed supported!"
);
enum
{
pressureIdx
=
Indices
::
pressureIdx
,
conti0EqIdx
=
Indices
::
conti0EqIdx
,
mainCompIdx
=
Indices
::
mainCompIdx
,
replaceCompEqIdx
=
Indices
::
replaceCompEqIdx
,
};
public:
...
...
@@ -118,14 +116,8 @@ public:
flux
[
compIdx
]
=
avgDensity
*
tij
*
(
insideMoleFraction
-
outsideMoleFraction
);
}
if
(
!
(
useMoles
&&
replaceCompEqIdx
==
mainCompIdx
))
{
const
Scalar
cumulativeFlux
=
std
::
accumulate
(
flux
.
begin
(),
flux
.
end
(),
0.0
);
flux
[
mainCompIdx
]
=
-
cumulativeFlux
;
}
if
(
useMoles
&&
replaceCompEqIdx
<=
numComponents
)
flux
[
replaceCompEqIdx
]
=
0.0
;
const
Scalar
cumulativeFlux
=
std
::
accumulate
(
flux
.
begin
(),
flux
.
end
(),
0.0
);
flux
[
mainCompIdx
]
=
-
cumulativeFlux
;
// Fick's law (for binary systems) states that the net flux of moles within the bulk phase has to be zero:
// If a given amount of molecules A travel into one direction, the same amount of molecules B have to
...
...
@@ -136,13 +128,6 @@ public:
//convert everything to a mass flux
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
++
compIdx
)
flux
[
compIdx
]
*=
FluidSystem
::
molarMass
(
compIdx
);
if
(
replaceCompEqIdx
<
numComponents
)
{
for
(
int
compIdx
=
0
;
compIdx
<
numComponents
;
++
compIdx
)
flux
[
replaceCompEqIdx
]
+=
(
compIdx
!=
replaceCompEqIdx
)
?
flux
[
compIdx
]
:
0.0
;
}
}
return
flux
;
...
...
dumux/discretization/staggered/freeflow/maxwellstefanslaw.hh
View file @
4af64f83
...
...
@@ -73,7 +73,6 @@ class MaxwellStefansLawImplementation<TypeTag, DiscretizationMethod::staggered >
enum
{
pressureIdx
=
Indices
::
pressureIdx
,
conti0EqIdx
=
Indices
::
conti0EqIdx
,
replaceCompEqIdx
=
Indices
::
replaceCompEqIdx
,
};
public:
...
...
@@ -187,9 +186,6 @@ public:
componentFlux
[
numComponents
-
1
]
-=
reducedFlux
[
compIdx
];
}
if
(
useMoles
&&
replaceCompEqIdx
<=
numComponents
)
componentFlux
[
replaceCompEqIdx
]
=
0.0
;
return
componentFlux
;
}
...
...
dumux/freeflow/compositional/staggered/fluxvariables.hh
View file @
4af64f83
...
...
@@ -97,16 +97,17 @@ public:
return
density
*
fraction
;
};
flux
[
eqIdx
-
Indices
::
conti0Eq
Idx
]
=
ParentType
::
advectiveFluxForCellCenter
(
elemVolVars
,
elemFaceVars
,
scvf
,
upwindTerm
,
isOutflow
);
flux
[
comp
Idx
]
=
ParentType
::
advectiveFluxForCellCenter
(
elemVolVars
,
elemFaceVars
,
scvf
,
upwindTerm
,
isOutflow
);
}
flux
+=
MolecularDiffusionType
::
flux
(
problem
,
fvGeometry
,
elemVolVars
,
scvf
);
// in case one balance is substituted by the total mass balance
if
(
Indices
::
replaceCompEqIdx
<
numComponents
)
{
flux
[
Indices
::
replaceCompEqIdx
]
=
std
::
accumulate
(
flux
.
begin
(),
flux
.
end
(),
0.0
);
}
flux
+=
MolecularDiffusionType
::
flux
(
problem
,
fvGeometry
,
elemVolVars
,
scvf
);
return
flux
;
}
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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