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 BoundaryTests | ||
10 | * \brief The spatial parameters for the incompressible test. | ||
11 | */ | ||
12 | |||
13 | #ifndef DUMUX_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH | ||
14 | #define DUMUX_INCOMPRESSIBLE_ONEP_TEST_SPATIAL_PARAMS_HH | ||
15 | |||
16 | #include <limits> | ||
17 | #include <dumux/porousmediumflow/fvspatialparams1p.hh> | ||
18 | |||
19 | namespace Dumux { | ||
20 | namespace LensSpatialParams { | ||
21 | /*! | ||
22 | * \brief Returns if a point is in a lens with a given bounding box | ||
23 | * | ||
24 | * \param globalPos The position of the point | ||
25 | * \param lensLowerLeft The lower left corner of the lens | ||
26 | * \param lensUpperRight The upper right corner of the lens | ||
27 | */ | ||
28 | template<class GlobalPosition> | ||
29 | 5340 | bool pointInLens(const GlobalPosition& globalPos, | |
30 | const GlobalPosition& lensLowerLeft, | ||
31 | const GlobalPosition& lensUpperRight) | ||
32 | { | ||
33 | 10680 | const auto eps = 1e-8*(lensUpperRight - lensLowerLeft).two_norm(); | |
34 |
2/2✓ Branch 0 taken 8676 times.
✓ Branch 1 taken 2052 times.
|
10728 | for (int i = 0; i < GlobalPosition::size(); ++i) |
35 |
12/12✓ Branch 0 taken 7032 times.
✓ Branch 1 taken 1644 times.
✓ Branch 2 taken 7032 times.
✓ Branch 3 taken 1644 times.
✓ Branch 4 taken 7032 times.
✓ Branch 5 taken 1644 times.
✓ Branch 6 taken 5388 times.
✓ Branch 7 taken 1644 times.
✓ Branch 8 taken 5388 times.
✓ Branch 9 taken 1644 times.
✓ Branch 10 taken 5388 times.
✓ Branch 11 taken 1644 times.
|
26028 | if (globalPos[i] < lensLowerLeft[i] + eps || globalPos[i] > lensUpperRight[i] - eps) |
36 | return false; | ||
37 | |||
38 | return true; | ||
39 | } | ||
40 | } // end namespace LensSpatialParams | ||
41 | |||
42 | /*! | ||
43 | * \ingroup BoundaryTests | ||
44 | * \brief The spatial parameters class for the test problem using the | ||
45 | * incompressible 1p model. | ||
46 | */ | ||
47 | template<class GridGeometry, class Scalar> | ||
48 |
1/6✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
|
4 | class OnePTestSpatialParams |
49 | : public FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, OnePTestSpatialParams<GridGeometry, Scalar>> | ||
50 | { | ||
51 | using ThisType = OnePTestSpatialParams<GridGeometry, Scalar>; | ||
52 | using ParentType = FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, ThisType>; | ||
53 | using GridView = typename GridGeometry::GridView; | ||
54 | using Element = typename GridView::template Codim<0>::Entity; | ||
55 | using FVElementGeometry = typename GridGeometry::LocalView; | ||
56 | using SubControlVolume = typename FVElementGeometry::SubControlVolume; | ||
57 | |||
58 | static constexpr int dimWorld = GridView::dimensionworld; | ||
59 | using GlobalPosition = typename Element::Geometry::GlobalCoordinate; | ||
60 | |||
61 | public: | ||
62 | using PermeabilityType = Scalar; | ||
63 | 4 | OnePTestSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry) | |
64 | : ParentType(gridGeometry) | ||
65 | 4 | , lensLowerLeft_(std::numeric_limits<Scalar>::max()) | |
66 |
2/8✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
|
12 | , lensUpperRight_(std::numeric_limits<Scalar>::lowest()) |
67 | { | ||
68 |
1/2✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
|
4 | permeability_ = getParam<Scalar>("SpatialParams.Permeability"); |
69 |
1/2✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
|
4 | permeabilityLens_ = getParam<Scalar>("SpatialParams.PermeabilityLens"); |
70 | 4 | } | |
71 | |||
72 | /*! | ||
73 | * \brief Function for defining the (intrinsic) permeability \f$[m^2]\f$. | ||
74 | * | ||
75 | * \return The intrinsic permeability | ||
76 | */ | ||
77 | PermeabilityType permeabilityAtPos(const GlobalPosition& globalPos) const | ||
78 | ✗ | { return isInLens_(globalPos) ? permeabilityLens_ : permeability_; } | |
79 | |||
80 | /*! | ||
81 | * \brief Defines the porosity \f$\mathrm{[-]}\f$. | ||
82 | * | ||
83 | * \param globalPos The global position | ||
84 | */ | ||
85 | ✗ | Scalar porosityAtPos(const GlobalPosition& globalPos) const | |
86 | ✗ | { return 0.4; } | |
87 | |||
88 | /*! | ||
89 | * \brief Optionally set a lens | ||
90 | */ | ||
91 | ✗ | void setLens(const GlobalPosition& lowerLeft, const GlobalPosition& upperRight) | |
92 |
2/4✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
2 | { lensLowerLeft_ = lowerLeft; lensUpperRight_ = upperRight; } |
93 | |||
94 | private: | ||
95 | bool isInLens_(const GlobalPosition &globalPos) const | ||
96 | ✗ | { return LensSpatialParams::pointInLens(globalPos, lensLowerLeft_, lensUpperRight_); } | |
97 | |||
98 | GlobalPosition lensLowerLeft_, lensUpperRight_; | ||
99 | Scalar permeability_, permeabilityLens_; | ||
100 | }; | ||
101 | |||
102 | } // end namespace Dumux | ||
103 | |||
104 | #endif | ||
105 |