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
79a7d227
Commit
79a7d227
authored
Dec 05, 2016
by
Kilian Weishaupt
Committed by
Timo Koch
Feb 10, 2017
Browse files
[staggeredGrid] Treat initial facet values the same way as dirichlet values
parent
851f5ecb
Changes
4
Hide whitespace changes
Inline
Side-by-side
dumux/freeflow/staggered/problem.hh
View file @
79a7d227
...
...
@@ -121,19 +121,31 @@ public:
/*!
* \brief Evaluate the boundary conditions for a dirichlet
*
control volume
.
*
facet
.
*
* \param globalPos The position of the center of the finite volume
* for which the dirichlet condition ought to be
* set in global coordinates
*
* For this method, the \a values parameter stores primary variables.
* \param direction The direction index of the facets unit outer normal
*/
FacePrimaryVariables
faceDirichletAtPos
(
const
GlobalPosition
&
globalPos
,
const
int
direction
)
const
{
return
asImp_
().
dirichletVelocityAtPos
(
globalPos
)[
direction
];
}
/*!
* \brief Evaluate the initial value for a facet.
*
* \param globalPos The position of the center of the finite volume
* for which the initial values ought to be
* set (in global coordinates)
* \param direction The direction index of the facets unit outer normal
*/
FacePrimaryVariables
initialFaceValueAtPos
(
const
GlobalPosition
&
globalPos
,
const
int
direction
)
const
{
return
asImp_
().
initialVelocityAtPos
(
globalPos
)[
direction
];
}
// \}
private:
...
...
dumux/implicit/staggered/model.hh
View file @
79a7d227
...
...
@@ -265,7 +265,7 @@ public:
// loop over faces
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
{
auto
initPriVars
=
this
->
problem_
().
initialFaceValueAtPos
(
scvf
.
center
());
auto
initPriVars
=
this
->
problem_
().
initialFaceValueAtPos
(
scvf
.
center
()
,
scvf
.
directionIndex
()
);
this
->
uCur_
[
faceIdx
][
scvf
.
dofIndexSelf
()]
=
initPriVars
;
}
}
...
...
dumux/implicit/staggered/problem.hh
View file @
79a7d227
...
...
@@ -299,7 +299,7 @@ public:
*
* For this method, the \a values parameter stores primary variables.
*/
FacePrimaryVariables
initialFaceValueAtPos
(
const
GlobalPosition
&
globalPos
)
const
FacePrimaryVariables
initialFaceValueAtPos
(
const
GlobalPosition
&
globalPos
,
const
int
direction
)
const
{
// Throw an exception (there is no reasonable default value
// for initial values)
...
...
test/freeflow/staggered/staggeredtestproblem.hh
View file @
79a7d227
...
...
@@ -254,25 +254,32 @@ public:
}
/*!
/*!
* \brief Evaluate the initial value for a facet.
*
* \param values The initial values for the primary variables
* \param globalPos The position of the center of the finite volume
* for which the initial values ought to be
* set (in global coordinates)
*
* For this method, the \a values parameter stores primary variables.
* \param direction The direction index of the facets unit outer normal
*/
FacePrimaryVariables
initialFaceValue
AtPos
(
const
GlobalPosition
&
globalPos
)
const
GlobalPosition
initialVelocity
AtPos
(
const
GlobalPosition
&
globalPos
)
const
{
FacePrimaryVariables
value
(
0.0
)
;
if
(
globalPos
[
0
]
<
1
e-6
)
value
[
0
]
=
1
.0
;
return
v
alue
;
GlobalPosition
velocity
;
velocity
[
0
]
=
1
.0
;
velocity
[
1
]
=
0
.0
;
return
v
elocity
;
}
/*!
* \brief Evaluate the boundary conditions for a dirichlet
* facet.
*
* \param globalPos The position of the center of the finite volume
* for which the dirichlet condition ought to be
* set in global coordinates
* \param direction The direction index of the facets unit outer normal
*/
GlobalPosition
dirichletVelocityAtPos
(
const
GlobalPosition
&
pos
)
const
{
GlobalPosition
velocity
;
...
...
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