GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/porenetwork/1p/volumevariables.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 4 10 40.0%
Functions: 0 14 0.0%
Branches: 2 4 50.0%

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 PNMOnePModel
10 * \copydoc Dumux::PoreNetwork::OnePVolumeVariables
11 */
12
13 #ifndef DUMUX_PNM_1P_VOLUME_VARIABLES_HH
14 #define DUMUX_PNM_1P_VOLUME_VARIABLES_HH
15
16 #include <dumux/porousmediumflow/1p/volumevariables.hh>
17
18 namespace Dumux::PoreNetwork {
19
20 /*!
21 * \ingroup PNMOnePModel
22 * \brief Contains the quantities which are constant within a
23 * finite volume (the pore body) in the one-phase model.
24 *
25 * \tparam Traits Class encapsulating types to be used by the volVars
26 */
27 template<class Traits>
28
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 42 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 42 times.
12298236 class OnePVolumeVariables : public Dumux::OnePVolumeVariables<Traits>
29 {
30 using ParentType = Dumux::OnePVolumeVariables<Traits>;
31 using Scalar = typename Traits::PrimaryVariables::value_type;
32 public:
33
34 /*!
35 * \brief Updates all quantities for a given control volume.
36 *
37 * \param elemSol A vector containing all primary variables connected to the element
38 * \param problem The object specifying the problem which ought to
39 * be simulated
40 * \param element An element which contains part of the control volume
41 * \param scv The sub-control volume
42 */
43 template<class ElemSol, class Problem, class Element, class Scv>
44 void update(const ElemSol& elemSol,
45 const Problem& problem,
46 const Element& element,
47 const Scv& scv)
48 {
49 4110 ParentType::update(elemSol, problem, element, scv);
50 8220 inscribedPoreRadius_ = problem.spatialParams().poreInscribedRadius(element, scv, elemSol);
51 16440 poreVolume_ = problem.gridGeometry().poreVolume(scv.dofIndex()) * this->porosity();
52 }
53
54 /*!
55 * \brief Returns the pore's inscribed radius.
56 */
57 Scalar poreInscribedRadius() const
58 { return inscribedPoreRadius_; }
59
60 /*!
61 * \brief Returns the pore volume. // TODO should this be a fraction only?
62 */
63 Scalar poreVolume() const
64 { return poreVolume_; }
65
66 protected:
67 Scalar inscribedPoreRadius_;
68 Scalar poreVolume_;
69 };
70
71 } // end namespace Dumux::PoreNetwork
72
73 #endif
74