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 EmbeddedTests | ||
10 | * \brief Definition of the spatial parameters for the blood flow problem. | ||
11 | */ | ||
12 | |||
13 | #ifndef DUMUX_BlOOD_FLOW_SPATIALPARAMS_HH | ||
14 | #define DUMUX_BlOOD_FLOW_SPATIALPARAMS_HH | ||
15 | |||
16 | #include <dumux/porousmediumflow/fvspatialparams1p.hh> | ||
17 | |||
18 | namespace Dumux { | ||
19 | |||
20 | /*! | ||
21 | * \ingroup EmbeddedTests | ||
22 | * \brief Definition of the spatial parameters for the blood flow problem. | ||
23 | */ | ||
24 | template<class GridGeometry, class Scalar> | ||
25 |
1/6✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 19 times.
✗ Branch 5 not taken.
|
19 | class BloodFlowSpatialParams |
26 | : public FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, BloodFlowSpatialParams<GridGeometry, Scalar>> | ||
27 | { | ||
28 | using ThisType = BloodFlowSpatialParams<GridGeometry, Scalar>; | ||
29 | using ParentType = FVPorousMediumFlowSpatialParamsOneP<GridGeometry, Scalar, ThisType>; | ||
30 | using GlobalPosition = typename GridGeometry::GlobalCoordinate; | ||
31 | using Element = typename GridGeometry::GridView::template Codim<0>::Entity; | ||
32 | using SubControlVolume = typename GridGeometry::SubControlVolume; | ||
33 | |||
34 | public: | ||
35 | // export permeability type | ||
36 | using PermeabilityType = Scalar; | ||
37 | |||
38 | 19 | BloodFlowSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry) | |
39 |
2/8✓ Branch 2 taken 19 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 19 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
|
19 | : ParentType(gridGeometry) |
40 | { | ||
41 |
1/2✓ Branch 1 taken 19 times.
✗ Branch 2 not taken.
|
19 | radius_ = getParam<Scalar>("SpatialParams.Radius"); |
42 | 19 | } | |
43 | |||
44 | /*! | ||
45 | * \brief Returns the intrinsic permeability for the current sub-control volume in [m^2]. | ||
46 | * | ||
47 | * \param ipGlobal The integration point | ||
48 | */ | ||
49 | PermeabilityType permeabilityAtPos(const GlobalPosition& ipGlobal) const | ||
50 | { | ||
51 | 6024 | return (1 + ipGlobal[2] + 0.5*ipGlobal[2]*ipGlobal[2])/(M_PI*radius(0)*radius(0)); | |
52 | } | ||
53 | |||
54 | //! we evaluate the permeability directly at the scvf since we have an analytical expression for it | ||
55 | static constexpr bool evaluatePermeabilityAtScvfIP() | ||
56 | { return true; } | ||
57 | |||
58 | /*! | ||
59 | * \brief Returns the radius of the circular pipe for the current sub-control volume in [m]. | ||
60 | * | ||
61 | * \param eIdxGlobal the index of the element | ||
62 | */ | ||
63 | ✗ | Scalar radius(unsigned int eIdxGlobal) const | |
64 | { | ||
65 | ✗ | return radius_; | |
66 | } | ||
67 | |||
68 | /*! | ||
69 | * \brief Returns the porosity \f$[-]\f$. | ||
70 | * | ||
71 | * \param globalPos the scv center | ||
72 | */ | ||
73 | ✗ | Scalar porosityAtPos(const GlobalPosition& globalPos) const | |
74 | { | ||
75 | ✗ | return 1.0; | |
76 | } | ||
77 | |||
78 | /*! | ||
79 | * \brief Returns how much the domain is extruded at a given sub-control volume. | ||
80 | * | ||
81 | * The extrusion factor here extrudes the 1d line to a circular tube with | ||
82 | * cross-section area pi*r^2. | ||
83 | */ | ||
84 | template<class ElementSolution> | ||
85 | ✗ | Scalar extrusionFactor(const Element &element, | |
86 | const SubControlVolume &scv, | ||
87 | const ElementSolution& elemSol) const | ||
88 | { | ||
89 | 3849 | const auto eIdx = this->gridGeometry().elementMapper().index(element); | |
90 | 1283 | const auto r = radius(eIdx); | |
91 | 1283 | return M_PI*r*r; | |
92 | } | ||
93 | |||
94 | private: | ||
95 | Scalar radius_; | ||
96 | }; | ||
97 | |||
98 | } // end namespace Dumux | ||
99 | |||
100 | #endif | ||
101 |