3.6-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 {
37template<class Scalar>
38class ThreePNAPLAdsorption : Adapter<ThreePNAPLAdsorption<Scalar>, Adsorption>
39{
40public:
41
42 struct Params
43 {
44 Params(const Scalar rhoBulk, const Scalar kdNAPL)
45 : rhoBulk_(rhoBulk), kdNAPL_(kdNAPL) {}
46
47 Scalar rhoBulk() const { return rhoBulk_; }
48 void setRhoBulk(const Scalar rhoBulk) { rhoBulk_ = rhoBulk; }
49
50 Scalar kdNAPL() const { return kdNAPL_; }
51 void setKdNAPL(const Scalar kdNAPL) { kdNAPL_ = kdNAPL; }
52
53 bool operator== (const Params& p) const
54 {
55 return Dune::FloatCmp::eq(kdNAPL(), p.kdNAPL(), 1e-6)
56 && Dune::FloatCmp::eq(rhoBulk(), p.rhoBulk(), 1e-6);
57 }
58
59 private:
60 Scalar rhoBulk_, kdNAPL_;
61 };
62
67 static Params makeParams(const std::string& paramGroup)
68 {
69 const auto rhoBulk = getParamFromGroup<Scalar>(paramGroup, "ThreePNAPLAdsorptionRhoBulk");
70 const auto kdNAPL = getParamFromGroup<Scalar>(paramGroup, "ThreePNAPLAdsorptionKdNAPL");
71 return {rhoBulk, kdNAPL};
72 }
73
74 ThreePNAPLAdsorption(const Params& params): params_(params) {}
75
76 ThreePNAPLAdsorption(const std::string& paramGroup)
77 : params_(makeParams(paramGroup)) {}
78
84 {
85 return params_.rhoBulk() * params_.kdNAPL();
86 }
87
88private:
89 Params params_;
90};
91} // end namespace Dumux::FluidMatrix
92
93#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
Implementation of a NAPL adsorption model.
Definition: napladsorption.hh:39
Scalar bulkDensTimesAdsorpCoeff() const
the basis for calculating adsorbed NAPL in storage term
Definition: napladsorption.hh:83
ThreePNAPLAdsorption(const std::string &paramGroup)
Definition: napladsorption.hh:76
ThreePNAPLAdsorption(const Params &params)
Definition: napladsorption.hh:74
static Params makeParams(const std::string &paramGroup)
Construct from a subgroup from the global parameter tree.
Definition: napladsorption.hh:67
Definition: napladsorption.hh:43
Scalar kdNAPL() const
Definition: napladsorption.hh:50
Scalar rhoBulk() const
Definition: napladsorption.hh:47
Params(const Scalar rhoBulk, const Scalar kdNAPL)
Definition: napladsorption.hh:44
bool operator==(const Params &p) const
Definition: napladsorption.hh:53
void setKdNAPL(const Scalar kdNAPL)
Definition: napladsorption.hh:51
void setRhoBulk(const Scalar rhoBulk)
Definition: napladsorption.hh:48
Adapter to inherit from, allowing the inheriting class to be wrapped by the makeFluidMatrixInteractio...
Definition: fluidmatrixinteraction.hh:67