3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
ploteffectivediffusivitymodel.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_PLOT_EFFECTIVE_DIFFUSIVITY_MODEL_HH
25#define DUMUX_PLOT_EFFECTIVE_DIFFUSIVITY_MODEL_HH
26
27#include <string>
28#include <vector>
29
30namespace Dumux {
31
32// forward declaration
33template<class Scalar> class GnuplotInterface;
34
39template<class Scalar, class EffectiveDiffusivityModel>
41{
42
43public:
46 : numIntervals_(1000)
47 { }
48
60 Scalar porosity,
61 Scalar lowerSat = 0.0,
62 Scalar upperSat = 1.0,
63 std::string curveName = "deff",
64 std::string curveOptions = "w l")
65 {
66 std::vector<Scalar> sw(numIntervals_+1);
67 std::vector<Scalar> deff(numIntervals_+1);
68 Scalar satInterval = upperSat - lowerSat;
69
70 for (int i = 0; i <= numIntervals_; i++)
71 {
72 sw[i] = lowerSat + satInterval * Scalar(i) / Scalar(numIntervals_);
73 deff[i] = EffectiveDiffusivityModel::effectiveDiffusivity(porosity, sw[i],
74 1.0 /*Diffusion Coefficient*/);
75 }
76
77 gnuplot.setXlabel("phase saturation [-]");
78 gnuplot.setYlabel("effective diffusion/molecular diffusion [-]");
79 gnuplot.addDataSetToPlot(sw, deff, curveName, curveOptions);
80 }
81
82private:
83 int numIntervals_;
84};
85
86} // end namespace Dumux
87
88#endif // DUMUX_PLOT_EFFECTIVE_DIFFUSIVITY_MODEL_HH
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
std::string porosity() noexcept
I/O name of porosity.
Definition: name.hh:139
Interface for passing data sets to a file and plotting them, if gnuplot is installed.
Definition: gnuplotinterface.hh:57
void setXlabel(const std::string &label)
Sets the label for the x-axis.
Definition: gnuplotinterface.hh:279
void addDataSetToPlot(const std::vector< Scalar > &x, const std::vector< Scalar > &y, const std::string &fileName, const std::string &options="with lines")
Adds a data set and writes a data file.
Definition: gnuplotinterface.hh:242
void setYlabel(const std::string &label)
Sets the label for the y-axis.
Definition: gnuplotinterface.hh:289
Interface for plotting the multi-component-matrix-interaction laws.
Definition: ploteffectivediffusivitymodel.hh:41
PlotEffectiveDiffusivityModel()
Constructor.
Definition: ploteffectivediffusivitymodel.hh:45
void adddeffcurve(GnuplotInterface< Scalar > &gnuplot, Scalar porosity, Scalar lowerSat=0.0, Scalar upperSat=1.0, std::string curveName="deff", std::string curveOptions="w l")
Add a effective diffusion factor-saturation data set to the plot.
Definition: ploteffectivediffusivitymodel.hh:59