diff --git a/dumux/freeflow/staggered/problem.hh b/dumux/freeflow/staggered/problem.hh index 6ee5c27bfe2c22a84f60e179479ea8dffa342606..128067bcbfca6460c19a0740755083bdb94bec8e 100644 --- a/dumux/freeflow/staggered/problem.hh +++ b/dumux/freeflow/staggered/problem.hh @@ -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: diff --git a/dumux/implicit/staggered/model.hh b/dumux/implicit/staggered/model.hh index 603fbc4912e161f41516f76db2ae345865cf9b43..7529c3f0c183401f95ac587519fd27e257d7f053 100644 --- a/dumux/implicit/staggered/model.hh +++ b/dumux/implicit/staggered/model.hh @@ -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; } } diff --git a/dumux/implicit/staggered/problem.hh b/dumux/implicit/staggered/problem.hh index ea9c1afec2b4983b97b27741b9453e558d069236..bcf6cf3422f5543170648516878cfe3073ad111d 100644 --- a/dumux/implicit/staggered/problem.hh +++ b/dumux/implicit/staggered/problem.hh @@ -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) diff --git a/test/freeflow/staggered/staggeredtestproblem.hh b/test/freeflow/staggered/staggeredtestproblem.hh index b42496d501c284d76aa492af99740f9ed8d9c2bd..f607210c28fe52b65d5c4002d0d6c09bbda8c9a4 100644 --- a/test/freeflow/staggered/staggeredtestproblem.hh +++ b/test/freeflow/staggered/staggeredtestproblem.hh @@ -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;