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-FileCopyrightText: 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 PNMTwoPModel | ||
10 | * \copydoc Dumux::PoreNetwork::TwoPVolumeVariables | ||
11 | */ | ||
12 | |||
13 | #ifndef DUMUX_PNM_2P_VOLUME_VARIABLES_HH | ||
14 | #define DUMUX_PNM_2P_VOLUME_VARIABLES_HH | ||
15 | |||
16 | #include <dumux/common/parameters.hh> | ||
17 | #include <dumux/porousmediumflow/2p/volumevariables.hh> | ||
18 | |||
19 | namespace Dumux::PoreNetwork { | ||
20 | |||
21 | /*! | ||
22 | * \ingroup PNMTwoPModel | ||
23 | * \brief Contains the quantities which are are constant within a | ||
24 | * finite volume (the pore body) in the two-phase model. | ||
25 | */ | ||
26 | template <class Traits> | ||
27 | 735092 | class TwoPVolumeVariables | |
28 | : public Dumux::TwoPVolumeVariables<Traits> | ||
29 | { | ||
30 | using ParentType = Dumux::TwoPVolumeVariables<Traits>; | ||
31 | using ModelTraits = typename Traits::ModelTraits; | ||
32 | using Scalar = typename Traits::PrimaryVariables::value_type; | ||
33 | using FS = typename Traits::FluidSystem; | ||
34 | static constexpr int numFluidComps = ParentType::numFluidComponents(); | ||
35 | static constexpr auto formulation = ModelTraits::priVarFormulation(); | ||
36 | public: | ||
37 | |||
38 | //! Export type of fluid system | ||
39 | using FluidSystem = typename Traits::FluidSystem; | ||
40 | //! Export type of fluid state | ||
41 | using FluidState = typename Traits::FluidState; | ||
42 | //! Export type of solid state | ||
43 | using SolidState = typename Traits::SolidState; | ||
44 | //! Export type of solid system | ||
45 | using SolidSystem = typename Traits::SolidSystem; | ||
46 | //! Export the indices | ||
47 | using Indices = typename ModelTraits::Indices; | ||
48 | |||
49 | /*! | ||
50 | * \brief Updates all quantities for a given control volume. | ||
51 | * | ||
52 | * \param elemSol A vector containing all primary variables connected to the element | ||
53 | * \param problem The object specifying the problem which ought to | ||
54 | * be simulated | ||
55 | * \param element An element which contains part of the control volume | ||
56 | * \param scv The sub control volume | ||
57 | */ | ||
58 | template<class ElemSol, class Problem, class Element, class Scv> | ||
59 | 1489738 | void update(const ElemSol& elemSol, | |
60 | const Problem& problem, | ||
61 | const Element& element, | ||
62 | const Scv& scv) | ||
63 | { | ||
64 | 1489738 | ParentType::update(elemSol, problem, element, scv); | |
65 | 1489738 | poreInscribedRadius_ = problem.spatialParams().poreInscribedRadius(element, scv, elemSol); | |
66 | 1489738 | poreVolume_ = problem.gridGeometry().poreVolume(scv.dofIndex()) * this->porosity(); | |
67 | 1489738 | surfaceTension_ = problem.spatialParams().surfaceTension(element, scv, elemSol); | |
68 | 1489738 | } | |
69 | |||
70 | /*! | ||
71 | * \brief Returns the pore's inscribed radius. | ||
72 | */ | ||
73 | 62472 | Scalar poreInscribedRadius() const | |
74 | 62472 | { return poreInscribedRadius_; } | |
75 | |||
76 | /*! | ||
77 | * \brief Returns the pore volume. // TODO should this be a fraction only? | ||
78 | */ | ||
79 | Scalar poreVolume() const | ||
80 | { return poreVolume_; } | ||
81 | |||
82 | /*! | ||
83 | * \brief Returns the surface tension. | ||
84 | */ | ||
85 | 2818059 | Scalar surfaceTension() const | |
86 |
2/4✓ Branch 0 taken 939328 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 939459 times.
✗ Branch 3 not taken.
|
2818059 | { return surfaceTension_; } |
87 | |||
88 | protected: | ||
89 | Scalar poreInscribedRadius_; | ||
90 | Scalar poreVolume_; | ||
91 | Scalar surfaceTension_; | ||
92 | }; | ||
93 | |||
94 | } // end namespace Dumux::PoreNetwork | ||
95 | |||
96 | #endif | ||
97 |