version 3.8
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_MATERIAL_FLUIDMATRIX_INTERACTIONS_3P_NAPL_ADSORPTION
13#define DUMUX_MATERIAL_FLUIDMATRIX_INTERACTIONS_3P_NAPL_ADSORPTION
14
15#include <algorithm>
16#include <dune/common/float_cmp.hh>
19
20namespace Dumux::FluidMatrix {
25template<class Scalar>
26class ThreePNAPLAdsorption : Adapter<ThreePNAPLAdsorption<Scalar>, Adsorption>
27{
28public:
29
30 struct Params
31 {
32 Params(const Scalar rhoBulk, const Scalar kdNAPL)
33 : rhoBulk_(rhoBulk), kdNAPL_(kdNAPL) {}
34
35 Scalar rhoBulk() const { return rhoBulk_; }
36 void setRhoBulk(const Scalar rhoBulk) { rhoBulk_ = rhoBulk; }
37
38 Scalar kdNAPL() const { return kdNAPL_; }
39 void setKdNAPL(const Scalar kdNAPL) { kdNAPL_ = kdNAPL; }
40
41 bool operator== (const Params& p) const
42 {
43 return Dune::FloatCmp::eq(kdNAPL(), p.kdNAPL(), 1e-6)
44 && Dune::FloatCmp::eq(rhoBulk(), p.rhoBulk(), 1e-6);
45 }
46
47 private:
48 Scalar rhoBulk_, kdNAPL_;
49 };
50
55 static Params makeParams(const std::string& paramGroup)
56 {
57 const auto rhoBulk = getParamFromGroup<Scalar>(paramGroup, "ThreePNAPLAdsorptionRhoBulk");
58 const auto kdNAPL = getParamFromGroup<Scalar>(paramGroup, "ThreePNAPLAdsorptionKdNAPL");
59 return {rhoBulk, kdNAPL};
60 }
61
62 ThreePNAPLAdsorption(const Params& params): params_(params) {}
63
64 ThreePNAPLAdsorption(const std::string& paramGroup)
65 : params_(makeParams(paramGroup)) {}
66
71 {
72 return params_.rhoBulk() * params_.kdNAPL();
73 }
74
75private:
76 Params params_;
77};
78} // end namespace Dumux::FluidMatrix
79
80#endif
Implementation of a NAPL adsorption model.
Definition: napladsorption.hh:27
Scalar bulkDensTimesAdsorpCoeff() const
the basis for calculating adsorbed NAPL in storage term
Definition: napladsorption.hh:70
ThreePNAPLAdsorption(const std::string &paramGroup)
Definition: napladsorption.hh:64
ThreePNAPLAdsorption(const Params &params)
Definition: napladsorption.hh:62
static Params makeParams(const std::string &paramGroup)
Construct from a subgroup from the global parameter tree.
Definition: napladsorption.hh:55
Wrapper type to combine an arbitrary number of different laws for fluid-matrix interaction (e....
Definition: brookscorey.hh:23
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Adapter to inherit from, allowing the inheriting class to be wrapped by the makeFluidMatrixInteractio...
Definition: fluidmatrixinteraction.hh:55
Definition: napladsorption.hh:31
Scalar kdNAPL() const
Definition: napladsorption.hh:38
Scalar rhoBulk() const
Definition: napladsorption.hh:35
Params(const Scalar rhoBulk, const Scalar kdNAPL)
Definition: napladsorption.hh:32
bool operator==(const Params &p) const
Definition: napladsorption.hh:41
void setKdNAPL(const Scalar kdNAPL)
Definition: napladsorption.hh:39
void setRhoBulk(const Scalar rhoBulk)
Definition: napladsorption.hh:36