Skip to content
Snippets Groups Projects
Commit 33875d68 authored by Timo Koch's avatar Timo Koch
Browse files

[test][pointsource] Use sol dependent point source in test

The update of the reference solution was necessary as the problem description
did not fit the implementation. The current time in an implicit Euler context
has to be t+1.
parent ec239018
No related branches found
No related tags found
1 merge request!617[WIP] Next
...@@ -46,7 +46,7 @@ NEW_TYPE_TAG(OnePSingularityProblemTimeDependent, INHERITS_FROM(OnePSingularityC ...@@ -46,7 +46,7 @@ NEW_TYPE_TAG(OnePSingularityProblemTimeDependent, INHERITS_FROM(OnePSingularityC
SET_TYPE_PROP(OnePSingularityProblemTimeDependent, Problem, OnePSingularityProblemTimeDependent<TypeTag>); SET_TYPE_PROP(OnePSingularityProblemTimeDependent, Problem, OnePSingularityProblemTimeDependent<TypeTag>);
// point source // point source
SET_TYPE_PROP(OnePSingularityProblemTimeDependent, PointSource, TimeDependentPointSource<TypeTag>); SET_TYPE_PROP(OnePSingularityProblemTimeDependent, PointSource, SolDependentPointSource<TypeTag>);
} }
/*! /*!
...@@ -74,6 +74,12 @@ class OnePSingularityProblemTimeDependent : public OnePSingularityProblem<TypeTa ...@@ -74,6 +74,12 @@ class OnePSingularityProblemTimeDependent : public OnePSingularityProblem<TypeTa
using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager); using TimeManager = typename GET_PROP_TYPE(TypeTag, TimeManager);
using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource); using PointSource = typename GET_PROP_TYPE(TypeTag, PointSource);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using Element = typename GridView::template Codim<0>::Entity;
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry);
using ElementVolumeVariables = typename GET_PROP_TYPE(TypeTag, ElementVolumeVariables);
using SubControlVolume = typename GET_PROP_TYPE(TypeTag, SubControlVolume);
static const int dimWorld = GridView::dimensionworld; static const int dimWorld = GridView::dimensionworld;
using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>; using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
...@@ -102,10 +108,15 @@ public: ...@@ -102,10 +108,15 @@ public:
void addPointSources(std::vector<PointSource>& pointSources) const void addPointSources(std::vector<PointSource>& pointSources) const
{ {
// inject <time> kg/s water at position (0, 0), where <time> is the current simulation time // inject <time> kg/s water at position (0, 0), where <time> is the current simulation time
auto function = [](const TimeManager& timeManager, const GlobalPosition& pos) // we use t+1 because this is an implicit Euler scheme
{ return PrimaryVariables(timeManager.time()); }; auto function = [](const Problem& problem,
const Element& element,
const FVElementGeometry& fvGeometry,
const ElementVolumeVariables& elemVolVars,
const SubControlVolume& scv)
{ return PrimaryVariables(problem.timeManager().time() + problem.timeManager().timeStepSize()); };
pointSources.push_back(PointSource({0, 0}, function)); pointSources.push_back(PointSource({0.0, 0.0}, function));
} }
}; };
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment