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
3aa12e45
Commit
3aa12e45
authored
Jul 26, 2016
by
Timo Koch
Browse files
[localresidual] Fix how boundary types are obtained. Don't pass them to computeFlux
parent
0273ac12
Changes
4
Hide whitespace changes
Inline
Side-by-side
dumux/implicit/box/localresidual.hh
View file @
3aa12e45
...
...
@@ -87,7 +87,7 @@ protected:
const
auto
&
insideScv
=
fvGeometry
.
scv
(
scvf
.
insideScvIdx
());
const
auto
&
outsideScv
=
fvGeometry
.
scv
(
scvf
.
outsideScvIdx
());
auto
flux
=
this
->
asImp_
().
computeFlux
(
element
,
fvGeometry
,
elemVolVars
,
scvf
,
bcTypes
[
insideScv
.
index
()],
elemFluxVarsCache
[
scvf
]);
auto
flux
=
this
->
asImp_
().
computeFlux
(
element
,
fvGeometry
,
elemVolVars
,
scvf
,
elemFluxVarsCache
[
scvf
]);
this
->
residual_
[
insideScv
.
index
()]
+=
flux
;
this
->
residual_
[
outsideScv
.
index
()]
-=
flux
;
...
...
@@ -119,10 +119,8 @@ protected:
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
auto
scvBcTypes
=
bcTypes
[
scv
.
index
()];
if
(
!
scvBcTypes
.
hasDirichlet
())
continue
;
this
->
asImp_
().
evalDirichlet_
(
element
,
fvGeometry
,
elemVolVars
,
scv
,
scvBcTypes
);
if
(
scvBcTypes
.
hasDirichlet
())
this
->
asImp_
().
evalDirichlet_
(
element
,
fvGeometry
,
elemVolVars
,
scv
,
scvBcTypes
);
}
}
}
...
...
dumux/implicit/cellcentered/localresidual.hh
View file @
3aa12e45
...
...
@@ -89,7 +89,7 @@ protected:
const
FluxVariablesCache
&
fluxVarsCache
)
{
if
(
!
scvf
.
boundary
()
/*TODO: || GET_PROP_VALUE(TypeTag, BoundaryReconstruction)*/
)
return
this
->
asImp_
().
computeFlux
(
element
,
fvGeometry
,
elemVolVars
,
scvf
,
bcTypes
[
0
],
fluxVarsCache
);
return
this
->
asImp_
().
computeFlux
(
element
,
fvGeometry
,
elemVolVars
,
scvf
,
fluxVarsCache
);
else
return
PrimaryVariables
(
0.0
);
...
...
@@ -98,17 +98,20 @@ protected:
void
evalBoundary_
(
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
ElementBoundaryTypes
&
b
cTypes
,
const
ElementBoundaryTypes
&
elemB
cTypes
,
const
ElementFluxVariablesCache
&
elemFluxVarsCache
)
{
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
{
if
(
scvf
.
boundary
())
this
->
residual_
[
0
]
+=
evalBoundaryFluxes_
(
element
,
fvGeometry
,
elemVolVars
,
scvf
,
bcTypes
[
0
],
elemFluxVarsCache
[
scvf
]);
{
auto
bcTypes
=
this
->
problem
().
boundaryTypes
(
element
,
scvf
);
this
->
residual_
[
0
]
+=
evalBoundaryFluxes_
(
element
,
fvGeometry
,
elemVolVars
,
scvf
,
bcTypes
,
elemFluxVarsCache
[
scvf
]);
}
}
// additionally treat mixed D/N conditions in a strong sense
if
(
b
cTypes
.
hasDirichlet
())
if
(
elemB
cTypes
.
hasDirichlet
())
{
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
{
...
...
@@ -201,7 +204,7 @@ protected:
// temporary vector to store the Dirichlet boundary fluxes
PrimaryVariables
flux
(
0
);
auto
dirichletFlux
=
this
->
asImp_
().
computeFlux
(
element
,
fvGeometry
,
elemVolVars
,
scvf
,
bcTypes
,
fluxVarsCache
);
auto
dirichletFlux
=
this
->
asImp_
().
computeFlux
(
element
,
fvGeometry
,
elemVolVars
,
scvf
,
fluxVarsCache
);
// add fluxes to the residual
for
(
int
eqIdx
=
0
;
eqIdx
<
numEq
;
++
eqIdx
)
...
...
dumux/porousmediumflow/3p3c/implicit/localresidual.hh
View file @
3aa12e45
...
...
@@ -40,19 +40,21 @@ namespace Dumux
template
<
class
TypeTag
>
class
ThreePThreeCLocalResidual
:
public
GET_PROP_TYPE
(
TypeTag
,
BaseLocalResidual
)
{
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
BaseLocalResidual
)
ParentType
;
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
LocalResidual
)
Implementation
;
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
S
calar
)
Scalar
;
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
SubControlVolume
)
SubControlVolume
;
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
SubControlVolumeFace
)
SubControlVolumeFace
;
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
Primary
Variables
)
PrimaryVariables
;
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
FluxVariables
)
FluxVariables
;
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
Indices
)
Indices
;
using
ParentType
=
typename
GET_PROP_TYPE
(
TypeTag
,
BaseLocalResidual
);
using
Implementation
=
typename
GET_PROP_TYPE
(
TypeTag
,
LocalResidual
);
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
SubControlVolume
=
typename
GET_PROP_TYPE
(
TypeTag
,
S
ubControlVolume
)
;
using
SubControlVolumeFace
=
typename
GET_PROP_TYPE
(
TypeTag
,
SubControlVolume
Face
)
;
using
PrimaryVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
PrimaryVariables
)
;
using
FluxVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
Flux
Variables
);
using
FluxVariablesCache
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluxVariables
Cache
)
;
using
Indices
=
typename
GET_PROP_TYPE
(
TypeTag
,
Indices
);
using
BoundaryTypes
=
typename
GET_PROP_TYPE
(
TypeTag
,
BoundaryTypes
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVElementGeometry
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
ElementVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementVolumeVariables
);
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
);
enum
{
numPhases
=
GET_PROP_VALUE
(
TypeTag
,
NumPhases
),
...
...
@@ -71,8 +73,6 @@ class ThreePThreeCLocalResidual: public GET_PROP_TYPE(TypeTag, BaseLocalResidual
gCompIdx
=
Indices
::
gCompIdx
};
typedef
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
)
VolumeVariables
;
public:
ThreePThreeCLocalResidual
()
:
ParentType
()
...
...
@@ -122,11 +122,17 @@ public:
*/
PrimaryVariables
computeFlux
(
const
Element
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolumeFace
&
scvf
,
const
BoundaryTypes
&
bcTypes
)
const
FluxVariablesCache
&
fluxVarsCache
)
{
FluxVariables
fluxVars
;
fluxVars
.
initAndComputeFluxes
(
this
->
problem
(),
element
,
fvGeometry
,
scvf
);
fluxVars
.
initAndComputeFluxes
(
this
->
problem
(),
element
,
fvGeometry
,
elemVolVars
,
scvf
,
fluxVarsCache
);
// get upwind weights into local scope
auto
massWeight
=
massWeight_
;
...
...
dumux/porousmediumflow/immiscible/localresidual.hh
View file @
3aa12e45
...
...
@@ -47,7 +47,6 @@ class ImmiscibleLocalResidual : public GET_PROP_TYPE(TypeTag, BaseLocalResidual)
using
SubControlVolume
=
typename
GET_PROP_TYPE
(
TypeTag
,
SubControlVolume
);
using
SubControlVolumeFace
=
typename
GET_PROP_TYPE
(
TypeTag
,
SubControlVolumeFace
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVElementGeometry
);
using
BoundaryTypes
=
typename
GET_PROP_TYPE
(
TypeTag
,
BoundaryTypes
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
...
...
@@ -105,7 +104,6 @@ public:
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
SubControlVolumeFace
&
scvf
,
const
BoundaryTypes
&
bcTypes
,
const
FluxVariablesCache
&
fluxVarsCache
)
const
{
FluxVariables
fluxVars
;
...
...
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