3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
plotthermalconductivitymodel.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_THERMAL_CONDUCTIVITY_LAW_HH
25#define DUMUX_PLOT_THERMAL_CONDUCTIVITY_LAW_HH
26
27#include <string>
28#include <vector>
30
31namespace Dumux {
32
33// forward declaration
34template<class Scalar> class GnuplotInterface;
35
40template<class Scalar, class ThermalConductivityModel, class FluidSystem>
42{
44
45 // phase indices
46 enum
47 {
48 phase0Idx = FluidSystem::phase0Idx,
49 phase1Idx = FluidSystem::phase1Idx
50 };
51
52public:
62 Scalar pressure = 1e5)
63 : numIntervals_(1000)
64 {
65 FluidState fluidstate;
66 fluidstate.setTemperature(temperature);
67 fluidstate.setPressure(phase0Idx, pressure);
68 fluidstate.setPressure(phase1Idx, pressure);
69 lambdaW_ = FluidSystem::thermalConductivity(fluidstate, phase0Idx);
70 lambdaN_ = FluidSystem::thermalConductivity(fluidstate, phase1Idx);
71 }
72
86 Scalar porosity,
87 Scalar rhoSolid,
88 Scalar lambdaSolid,
89 Scalar lowerSat = 0.0,
90 Scalar upperSat = 1.0,
91 std::string curveName = "lambdaeff",
92 std::string curveOptions = "w l")
93 {
94 std::vector<Scalar> sw(numIntervals_+1);
95 std::vector<Scalar> lambda(numIntervals_+1);
96 Scalar satInterval = upperSat - lowerSat;
97
98 for (int i = 0; i <= numIntervals_; i++)
99 {
100 sw[i] = lowerSat + satInterval * Scalar(i) / Scalar(numIntervals_);
101 lambda[i] = ThermalConductivityModel::effectiveThermalConductivity(sw[i], lambdaW_,
102 lambdaN_, lambdaSolid,
103 porosity, rhoSolid);
104 }
105
106 gnuplot.setXlabel("wetting phase saturation [-]");
107 gnuplot.setYlabel("effective thermal conductivity [W/(m K)]");
108 gnuplot.addDataSetToPlot(sw, lambda, curveName, curveOptions);
109 }
110
111private:
112 int numIntervals_;
113 Scalar lambdaN_;
114 Scalar lambdaW_;
115};
116
117} // end namespace Dumux
118
119#endif // DUMUX_PLOT_THERMAL_CONDUCTIVITY_LAW_HH
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:34
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 non-isothermal two-phase fluid-matrix-interaction laws.
Definition: plotthermalconductivitymodel.hh:42
PlotThermalConductivityModel(Scalar temperature=283.15, Scalar pressure=1e5)
Constructor.
Definition: plotthermalconductivitymodel.hh:61
void addlambdaeffcurve(GnuplotInterface< Scalar > &gnuplot, Scalar porosity, Scalar rhoSolid, Scalar lambdaSolid, Scalar lowerSat=0.0, Scalar upperSat=1.0, std::string curveName="lambdaeff", std::string curveOptions="w l")
Add a effective thermal conductivity-saturation curve to the plot.
Definition: plotthermalconductivitymodel.hh:85
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assum...
Definition: compositional.hh:47
void setTemperature(Scalar value)
Set the temperature of all phases.
Definition: compositional.hh:318
void setPressure(int phaseIdx, Scalar value)
Set the fluid pressure of a phase .
Definition: compositional.hh:334