Commit 79a7d227 authored by Kilian Weishaupt's avatar Kilian Weishaupt Committed by Timo Koch
Browse files

[staggeredGrid] Treat initial facet values the same way as dirichlet values

parent 851f5ecb
......@@ -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:
......
......@@ -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;
}
}
......
......@@ -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)
......
......@@ -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 initialFaceValueAtPos(const GlobalPosition &globalPos) const
GlobalPosition initialVelocityAtPos(const GlobalPosition &globalPos) const
{
FacePrimaryVariables value(0.0);
if(globalPos[0] < 1e-6)
value[0] = 1.0;
return value;
GlobalPosition velocity;
velocity[0] = 1.0;
velocity[1] = 0.0;
return velocity;
}
/*!
* \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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment