Line | Branch | Exec | Source |
---|---|---|---|
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 | // | ||
7 | /*! | ||
8 | * \file | ||
9 | * \ingroup ThreePThreeCTests | ||
10 | * \brief Definition of the spatial parameters for the kuevette problem. | ||
11 | */ | ||
12 | |||
13 | #ifndef DUMUX_KUEVETTE3P3CNI_SPATIAL_PARAMS_HH | ||
14 | #define DUMUX_KUEVETTE3P3CNI_SPATIAL_PARAMS_HH | ||
15 | |||
16 | #include <dune/common/float_cmp.hh> | ||
17 | |||
18 | #include <dumux/porousmediumflow/properties.hh> | ||
19 | #include <dumux/porousmediumflow/fvspatialparamsmp.hh> | ||
20 | |||
21 | #include <dumux/material/fluidmatrixinteractions/3p/parkervangenuchten.hh> | ||
22 | #include <dumux/material/fluidmatrixinteractions/3p/napladsorption.hh> | ||
23 | |||
24 | namespace Dumux { | ||
25 | |||
26 | /*! | ||
27 | * \ingroup ThreePThreeCTests | ||
28 | * \brief Definition of the spatial parameters for the kuevette problem | ||
29 | */ | ||
30 | template<class GridGeometry, class Scalar> | ||
31 |
1/6✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
|
2 | class KuevetteSpatialParams |
32 | : public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, | ||
33 | KuevetteSpatialParams<GridGeometry, Scalar>> | ||
34 | { | ||
35 | using GridView = typename GridGeometry::GridView; | ||
36 | using FVElementGeometry = typename GridGeometry::LocalView; | ||
37 | using SubControlVolume = typename FVElementGeometry::SubControlVolume; | ||
38 | |||
39 | using Element = typename GridView::template Codim<0>::Entity; | ||
40 | using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, | ||
41 | KuevetteSpatialParams<GridGeometry, Scalar>>; | ||
42 | |||
43 | using GlobalPosition = typename SubControlVolume::GlobalPosition; | ||
44 | |||
45 | using ThreePhasePcKrSw = FluidMatrix::ParkerVanGenuchten3PDefault<Scalar>; | ||
46 | using AdsorptionModel = FluidMatrix::ThreePNAPLAdsorption<Scalar>; | ||
47 | |||
48 | public: | ||
49 | using PermeabilityType = Scalar; | ||
50 | |||
51 | 2 | KuevetteSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry) | |
52 | : ParentType(gridGeometry) | ||
53 | , pcKrSwCurveFine_("SpatialParams.Fine") | ||
54 | , pcKrSwCurveCoarse_("SpatialParams.Coarse") | ||
55 |
16/42✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 2 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 2 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 2 times.
✗ Branch 16 not taken.
✓ Branch 18 taken 2 times.
✗ Branch 19 not taken.
✓ Branch 21 taken 2 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 2 times.
✗ Branch 25 not taken.
✓ Branch 27 taken 2 times.
✗ Branch 28 not taken.
✓ Branch 29 taken 2 times.
✗ Branch 30 not taken.
✓ Branch 32 taken 2 times.
✗ Branch 33 not taken.
✓ Branch 35 taken 2 times.
✗ Branch 36 not taken.
✓ Branch 38 taken 2 times.
✗ Branch 39 not taken.
✓ Branch 41 taken 2 times.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✓ Branch 44 taken 2 times.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
|
18 | , adsorption_("SpatialParams") |
56 | { | ||
57 | // intrinsic permeabilities | ||
58 | 2 | fineK_ = 6.28e-12; | |
59 | 2 | coarseK_ = 9.14e-10; | |
60 | |||
61 | // porosities | ||
62 | 2 | finePorosity_ = 0.42; | |
63 | 2 | coarsePorosity_ = 0.42; | |
64 | 2 | } | |
65 | |||
66 | /*! | ||
67 | * \brief Function for defining the (intrinsic) permeability \f$[m^2]\f$ | ||
68 | * \note It is possibly solution dependent. | ||
69 | * | ||
70 | * \param element The current element | ||
71 | * \param scv The sub-control volume inside the element. | ||
72 | * \param elemSol The solution at the dofs connected to the element. | ||
73 | * \return The permeability | ||
74 | */ | ||
75 | template<class ElementSolution> | ||
76 | ✗ | PermeabilityType permeability(const Element& element, | |
77 | const SubControlVolume& scv, | ||
78 | const ElementSolution& elemSol) const | ||
79 | { | ||
80 |
2/4✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 278855 times.
✓ Branch 3 taken 604264 times.
|
883119 | const auto& globalPos = scv.dofPosition(); |
81 |
2/4✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 376547 times.
✓ Branch 3 taken 802646 times.
|
1179193 | if (isFineMaterial_(globalPos)) |
82 | 376547 | return fineK_; | |
83 | 802646 | return coarseK_; | |
84 | } | ||
85 | |||
86 | /*! | ||
87 | * \brief Define the porosity \f$[-]\f$ of the spatial parameters | ||
88 | * | ||
89 | * \param globalPos The position for which the bc type should be evaluated | ||
90 | */ | ||
91 | Scalar porosityAtPos(const GlobalPosition& globalPos) const | ||
92 | { | ||
93 | ✗ | if (isFineMaterial_(globalPos)) | |
94 | ✗ | return finePorosity_; | |
95 | else | ||
96 | ✗ | return coarsePorosity_; | |
97 | } | ||
98 | |||
99 | /*! | ||
100 | * \brief Returns the fluid-matrix interaction law at a given location | ||
101 | * | ||
102 | * \param globalPos The global coordinates for the given location | ||
103 | */ | ||
104 | auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const | ||
105 | { | ||
106 |
2/4✓ Branch 0 taken 370791 times.
✓ Branch 1 taken 808402 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
|
1179193 | if (isFineMaterial_(globalPos)) |
107 | 370791 | return makeFluidMatrixInteraction(pcKrSwCurveFine_, adsorption_); | |
108 | else | ||
109 | 808402 | return makeFluidMatrixInteraction(pcKrSwCurveCoarse_, adsorption_); | |
110 | } | ||
111 | |||
112 | private: | ||
113 | 3537579 | bool isFineMaterial_(const GlobalPosition &globalPos) const | |
114 | { | ||
115 |
4/4✓ Branch 0 taken 325860 times.
✓ Branch 1 taken 3211719 times.
✓ Branch 2 taken 325860 times.
✓ Branch 3 taken 3211719 times.
|
7075158 | return ((Dune::FloatCmp::ge<Scalar>(globalPos[0], 0.13) |
116 |
4/4✓ Branch 0 taken 620328 times.
✓ Branch 1 taken 2591391 times.
✓ Branch 2 taken 620328 times.
✓ Branch 3 taken 2591391 times.
|
6423438 | && Dune::FloatCmp::le<Scalar>(globalPos[0], 1.24) |
117 |
4/4✓ Branch 0 taken 1092762 times.
✓ Branch 1 taken 1498629 times.
✓ Branch 2 taken 1092762 times.
✓ Branch 3 taken 1498629 times.
|
5182782 | && Dune::FloatCmp::ge<Scalar>(globalPos[1], 0.32) |
118 |
4/4✓ Branch 0 taken 530211 times.
✓ Branch 1 taken 968418 times.
✓ Branch 2 taken 530211 times.
✓ Branch 3 taken 968418 times.
|
2997258 | && Dune::FloatCmp::le<Scalar>(globalPos[1], 0.60)) |
119 |
4/4✓ Branch 0 taken 1875979 times.
✓ Branch 1 taken 693182 times.
✓ Branch 2 taken 1875979 times.
✓ Branch 3 taken 693182 times.
|
5138322 | || (Dune::FloatCmp::ge<Scalar>(globalPos[0], 1.20) |
120 |
4/4✓ Branch 0 taken 543471 times.
✓ Branch 1 taken 149711 times.
✓ Branch 2 taken 543471 times.
✓ Branch 3 taken 149711 times.
|
1386364 | && Dune::FloatCmp::le<Scalar>(globalPos[1], 0.15))); |
121 | } | ||
122 | |||
123 | Scalar fineK_; | ||
124 | Scalar coarseK_; | ||
125 | |||
126 | Scalar finePorosity_; | ||
127 | Scalar coarsePorosity_; | ||
128 | |||
129 | const ThreePhasePcKrSw pcKrSwCurveFine_; | ||
130 | const ThreePhasePcKrSw pcKrSwCurveCoarse_; | ||
131 | const AdsorptionModel adsorption_; | ||
132 | |||
133 | }; | ||
134 | |||
135 | } // end namespace Dumux | ||
136 | |||
137 | #endif | ||
138 |