GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/test/porousmediumflow/2p2c/evaporation/spatialparams.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 7 14 50.0%
Functions: 2 12 16.7%
Branches: 9 28 32.1%

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 TwoPTwoCTests
10 * \brief Definition of the spatial parameters for the evaporation constant component problem.
11 */
12 #ifndef DUMUX_EVAPORATION_CONSTANT_COMPONENT_SPATIAL_PARAMS_HH
13 #define DUMUX_EVAPORATION_CONSTANT_COMPONENT_SPATIAL_PARAMS_HH
14
15 #include <dumux/common/math.hh>
16 #include <dumux/io/gnuplotinterface.hh>
17 #include <dumux/io/ploteffectivediffusivitymodel.hh>
18 #include <dumux/io/plotpckrsw.hh>
19 #include <dumux/io/plotthermalconductivitymodel.hh>
20 #include <dumux/porousmediumflow/properties.hh>
21 #include <dumux/porousmediumflow/fvspatialparamsmp.hh>
22 #include <dumux/material/fluidmatrixinteractions/2p/brookscorey.hh>
23
24 namespace Dumux {
25
26 /*!
27 * \ingroup TwoPTwoCModel
28 * \brief Definition of the spatial parameters for the evaporation constant component 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 4 times.
✗ Branch 5 not taken.
4 class EvaporationConstantComponentSpatialParams
32 : public FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar,
33 EvaporationConstantComponentSpatialParams<GridGeometry, Scalar>>
34 {
35 using ThisType = EvaporationConstantComponentSpatialParams<GridGeometry, Scalar>;
36 using ParentType = FVPorousMediumFlowSpatialParamsMP<GridGeometry, Scalar, ThisType>;
37 using GridView = typename GridGeometry::GridView;
38 using FVElementGeometry = typename GridGeometry::LocalView;
39 using Element = typename GridView::template Codim<0>::Entity;
40 static constexpr int dimWorld = GridView::dimensionworld;
41 using GlobalPosition = typename Element::Geometry::GlobalCoordinate;
42
43 using PcKrSwCurve = FluidMatrix::BrooksCoreyDefault<Scalar>;
44
45 public:
46 //! Export the type used for the permeability
47 using PermeabilityType = Scalar;
48
49
50 4 EvaporationConstantComponentSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry)
51 : ParentType(gridGeometry)
52
6/18
✓ Branch 2 taken 4 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 4 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✓ Branch 13 taken 4 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 4 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
12 , pcKrSwCurve_("SpatialParams")
53 {
54 // intrinsic permeability
55 4 permeability_ = 1e-11;
56
57 // porosity
58 4 porosity_ = 0.3;
59 4 }
60
61
62 /*!
63 * \brief Applies the intrinsic permeability tensor to a pressure
64 * potential gradient.
65 *
66 * \param globalPos The global position
67 */
68 Scalar permeabilityAtPos(const GlobalPosition& globalPos) const
69 {
70 return permeability_;
71 }
72
73 /*!
74 * \brief Defines the porosity \f$[-]\f$ of the spatial parameters
75 *
76 * \param globalPos The global position
77 */
78 Scalar porosityAtPos(const GlobalPosition& globalPos) const
79 {
80 return porosity_;
81 }
82
83 /*!
84 * \brief Returns the fluid-matrix interaction law at a given location
85 * \param globalPos The global coordinates for the given location
86 */
87 auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const
88 {
89
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 358440 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 358440 times.
1433760 return makeFluidMatrixInteraction(pcKrSwCurve_);
90 }
91
92 /*!
93 * \brief Function for defining which phase is to be considered as the wetting phase.
94 *
95 * \param globalPos The position of the center of the element
96 * \return The wetting phase index
97 */
98 template<class FluidSystem>
99 int wettingPhaseAtPos(const GlobalPosition& globalPos) const
100 { return FluidSystem::phase0Idx; }
101
102 private:
103 Scalar permeability_;
104 Scalar porosity_;
105
106 const PcKrSwCurve pcKrSwCurve_;
107 };
108
109 } // end namespace Dumux
110
111 #endif
112