From dad6234490eb1d5f6548579b386f5192f8e2101e Mon Sep 17 00:00:00 2001 From: Martin Utz <martin.utz@baw.de> Date: Wed, 24 Apr 2019 14:41:11 +0200 Subject: [PATCH] Add the point source part. --- examples/2pinfiltration/README.md | 19 ++++++++++++++++++- examples/2pinfiltration/problem.hh | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/examples/2pinfiltration/README.md b/examples/2pinfiltration/README.md index 8c96a3244b..635b58dcf1 100644 --- a/examples/2pinfiltration/README.md +++ b/examples/2pinfiltration/README.md @@ -10,8 +10,25 @@ Soil contamination problem where DNAPL infiltrates a fully water saturated mediu ## Infiltration (point source) +### problem.hh +The point sources are specified in the problem.hh file by the addPointSources method, in which you can add an arbitrary number of point sources to the vector of point sources. +To instantiate a point source the position and the infiltration values are needed. +For the definition of the PointSource class see dumux/common/pointsource.hh +```C++ +void addPointSources(std::vector<PointSource>& pointSources) const +{ + // inject 0.1 kg/s of non-wetting phase at position (0.502, 3.02); + pointSources.push_back(PointSource({0.502, 3.02}, {0, 0.1})); +} +``` - +### main.cc +In the main.cc file the computePointSourceMap method deals with the point sources. It must be called during the initialisation (l. 97) and after each refinement of the mesh (ll. 135, 151 and 205). +```C++ +problem->computePointSourceMap(); +``` +The computePointSourceMap method is inherited from the fvproblem and therefore specified in the dumux/common/fvproblem.hh. +It calls the addPointSource method specified in the problem.hh file. ## Adaptive grid ### main.cc diff --git a/examples/2pinfiltration/problem.hh b/examples/2pinfiltration/problem.hh index 73d7c64ce0..96a3ef7c74 100644 --- a/examples/2pinfiltration/problem.hh +++ b/examples/2pinfiltration/problem.hh @@ -265,7 +265,7 @@ public: */ void addPointSources(std::vector<PointSource>& pointSources) const { - // inject 2 kg/s of non-wetting phase at position (1, 1); + // inject 0.1 kg/s of non-wetting phase at position (0.502, 3.02); pointSources.push_back(PointSource({0.502, 3.02}, {0, 0.1})); } -- GitLab