diff --git a/test/freeflow/navierstokes/angeli/problem.hh b/test/freeflow/navierstokes/angeli/problem.hh index 4a56274b4d04032ee57388f3012d61e838dabacb..7bb7e4be95bc49e46eb4eab08a2e8b99a67f2e9a 100644 --- a/test/freeflow/navierstokes/angeli/problem.hh +++ b/test/freeflow/navierstokes/angeli/problem.hh @@ -174,7 +174,7 @@ public: } /*! - * \brief Returns the analytical solution of the problem at a given position. + * \brief Returns the analytical solution of the problem at a given time and position. * * \param globalPos The global position * \param time The current simulation time @@ -195,6 +195,16 @@ public: return values; } + /*! + * \brief Returns the analytical solution of the problem at a given position. + * + * \param globalPos The global position + */ + PrimaryVariables analyticalSolution(const GlobalPosition& globalPos) const + { + return analyticalSolution(globalPos, time_+timeStepSize_); + } + // \} /*! diff --git a/test/freeflow/navierstokes/l2error.hh b/test/freeflow/navierstokes/l2error.hh index 21b0006afe35a5710a4319525a86df669db2b293..8c001783b364bf5f8b4d715020b44473169ae619 100644 --- a/test/freeflow/navierstokes/l2error.hh +++ b/test/freeflow/navierstokes/l2error.hh @@ -71,7 +71,7 @@ public: // treat cell-center dofs const auto dofIdxCellCenter = scv.dofIndex(); const auto& posCellCenter = scv.dofPosition(); - const auto analyticalSolutionCellCenter = problem.dirichletAtPos(posCellCenter)[Indices::pressureIdx]; + const auto analyticalSolutionCellCenter = problem.analyticalSolution(posCellCenter)[Indices::pressureIdx]; const auto numericalSolutionCellCenter = curSol[GridGeometry::cellCenterIdx()][dofIdxCellCenter][Indices::pressureIdx - ModelTraits::dim()]; sumError[Indices::pressureIdx] += squaredDiff_(analyticalSolutionCellCenter, numericalSolutionCellCenter) * scv.volume(); sumReference[Indices::pressureIdx] += analyticalSolutionCellCenter * analyticalSolutionCellCenter * scv.volume(); @@ -82,7 +82,7 @@ public: { const int dofIdxFace = scvf.dofIndex(); const int dirIdx = scvf.directionIndex(); - const auto analyticalSolutionFace = problem.dirichletAtPos(scvf.center())[Indices::velocity(dirIdx)]; + const auto analyticalSolutionFace = problem.analyticalSolution(scvf.center())[Indices::velocity(dirIdx)]; const auto numericalSolutionFace = curSol[GridGeometry::faceIdx()][dofIdxFace][0]; directionIndex[dofIdxFace] = dirIdx; errorVelocity[dofIdxFace] = squaredDiff_(analyticalSolutionFace, numericalSolutionFace); diff --git a/test/freeflow/navierstokes/sincos/problem.hh b/test/freeflow/navierstokes/sincos/problem.hh index 04dfe76cb9a655117cdd877b853461e7fcf2136e..614208ac44df29f4d7a8ab96747b489fe1aea988 100644 --- a/test/freeflow/navierstokes/sincos/problem.hh +++ b/test/freeflow/navierstokes/sincos/problem.hh @@ -207,7 +207,7 @@ public: } /*! - * \brief Returns the analytical solution of the problem at a given position. + * \brief Returns the analytical solution of the problem at a given time and position. * * \param globalPos The global position * \param time The current simulation time @@ -238,6 +238,16 @@ public: return values; } + /*! + * \brief Returns the analytical solution of the problem at a given position. + * + * \param globalPos The global position + */ + PrimaryVariables analyticalSolution(const GlobalPosition& globalPos) const + { + return analyticalSolution(globalPos, time_+timeStepSize_); + } + // \} /*!