3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
napladsorption.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_MATERIAL_FLUIDMATRIX_INTERACTIONS_3P_NAPL_ADSORPTION
25#define DUMUX_MATERIAL_FLUIDMATRIX_INTERACTIONS_3P_NAPL_ADSORPTION
26
27#include <algorithm>
28#include <dune/common/float_cmp.hh>
31
32namespace Dumux::FluidMatrix {
33
34template<class Scalar>
35class ThreePNAPLAdsorption : Adapter<ThreePNAPLAdsorption<Scalar>, Adsorption>
36{
37public:
38
39 struct Params
40 {
41 Params(const Scalar rhoBulk, const Scalar kdNAPL)
42 : rhoBulk_(rhoBulk), kdNAPL_(kdNAPL) {}
43
44 Scalar rhoBulk() const { return rhoBulk_; }
45 void setRhoBulk(const Scalar rhoBulk) { rhoBulk_ = rhoBulk; }
46
47 Scalar kdNAPL() const { return kdNAPL_; }
48 void setKdNAPL(const Scalar kdNAPL) { kdNAPL_ = kdNAPL; }
49
50 bool operator== (const Params& p) const
51 {
52 return Dune::FloatCmp::eq(kdNAPL(), p.kdNAPL(), 1e-6)
53 && Dune::FloatCmp::eq(rhoBulk(), p.rhoBulk(), 1e-6);
54 }
55
56 private:
57 Scalar rhoBulk_, kdNAPL_;
58 };
59
64 static Params makeParams(const std::string& paramGroup)
65 {
66 const auto rhoBulk = getParamFromGroup<Scalar>(paramGroup, "ThreePNAPLAdsorptionRhoBulk");
67 const auto kdNAPL = getParamFromGroup<Scalar>(paramGroup, "ThreePNAPLAdsorptionKdNAPL");
68 return {rhoBulk, kdNAPL};
69 }
70
71 ThreePNAPLAdsorption(const Params& params): params_(params) {}
72
73 ThreePNAPLAdsorption(const std::string& paramGroup)
74 : params_(makeParams(paramGroup)) {}
75
81 {
82 return params_.rhoBulk() * params_.kdNAPL();
83 }
84
85private:
86 Params params_;
87};
88} // end namespace Dumux::FluidMatrix
89
90#endif
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Wrapper type to combine an arbitrary number of different laws for fluid-matrix interaction (e....
Definition: brookscorey.hh:35
Definition: napladsorption.hh:36
Scalar bulkDensTimesAdsorpCoeff() const
the basis for calculating adsorbed NAPL in storage term
Definition: napladsorption.hh:80
ThreePNAPLAdsorption(const std::string &paramGroup)
Definition: napladsorption.hh:73
ThreePNAPLAdsorption(const Params &params)
Definition: napladsorption.hh:71
static Params makeParams(const std::string &paramGroup)
Construct from a subgroup from the global parameter tree.
Definition: napladsorption.hh:64
Definition: napladsorption.hh:40
Scalar kdNAPL() const
Definition: napladsorption.hh:47
Scalar rhoBulk() const
Definition: napladsorption.hh:44
Params(const Scalar rhoBulk, const Scalar kdNAPL)
Definition: napladsorption.hh:41
bool operator==(const Params &p) const
Definition: napladsorption.hh:50
void setKdNAPL(const Scalar kdNAPL)
Definition: napladsorption.hh:48
void setRhoBulk(const Scalar rhoBulk)
Definition: napladsorption.hh:45
Adapter to inherit from, allowing the inheriting class to be wrapped by the makeFluidMatrixInteractio...
Definition: fluidmatrixinteraction.hh:67