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 PoromechanicsTests | ||
10 | * \brief Definition of the spatial parameters for the poro-elastic problem. | ||
11 | */ | ||
12 | #ifndef DUMUX_POROELASTIC_SPATIAL_PARAMS_HH | ||
13 | #define DUMUX_POROELASTIC_SPATIAL_PARAMS_HH | ||
14 | |||
15 | #include <dumux/geomechanics/lameparams.hh> | ||
16 | #include <dumux/geomechanics/poroelastic/fvspatialparams.hh> | ||
17 | #include <dumux/material/fluidmatrixinteractions/porositydeformation.hh> | ||
18 | |||
19 | namespace Dumux { | ||
20 | |||
21 | /*! | ||
22 | * \ingroup PoromechanicsTests | ||
23 | * \brief Definition of the spatial parameters for the poro-elastic | ||
24 | * sub-problem in the coupled poro-mechanical el1p problem. | ||
25 | */ | ||
26 | template<class Scalar, class GridGeometry, class CouplingManager> | ||
27 | class PoroElasticSpatialParams : public FVPoroElasticSpatialParams< GridGeometry, | ||
28 | Scalar, | ||
29 | PoroElasticSpatialParams<Scalar, GridGeometry, CouplingManager> > | ||
30 | { | ||
31 | using ThisType = PoroElasticSpatialParams<Scalar, GridGeometry, CouplingManager>; | ||
32 | using ParentType = FVPoroElasticSpatialParams<GridGeometry, Scalar, ThisType>; | ||
33 | |||
34 | using SubControlVolume = typename GridGeometry::SubControlVolume; | ||
35 | using GridView = typename GridGeometry::GridView; | ||
36 | using Element = typename GridView::template Codim<0>::Entity; | ||
37 | using FVElementGeometry = typename GridGeometry::LocalView; | ||
38 | using GlobalPosition = typename Element::Geometry::GlobalCoordinate; | ||
39 | public: | ||
40 | //! Export the type of the lame parameters | ||
41 | using LameParams = Dumux::LameParams<Scalar>; | ||
42 | |||
43 | 1 | PoroElasticSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry, | |
44 | std::shared_ptr<CouplingManager> couplingManagerPtr) | ||
45 | : ParentType(gridGeometry) | ||
46 | , couplingManager_(couplingManagerPtr) | ||
47 |
3/12✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
|
2 | , initPorosity_(getParam<Scalar>("SpatialParams.InitialPorosity")) |
48 | { | ||
49 | // Young's modulus [Pa] | ||
50 | 1 | Scalar E = 6.e9; | |
51 | // Poisson's ratio [-] | ||
52 | 1 | Scalar nu = 0.2; | |
53 | // Lame parameters [Pa] | ||
54 | 1 | lameParams_.setLambda( (E * nu) / ((1 + nu)*(1 - 2 * nu)) ); | |
55 | 1 | lameParams_.setMu( E / (2 * (1 + nu)) ); | |
56 | 1 | } | |
57 | |||
58 | //! Defines the Lame parameters. | ||
59 | ✗ | const LameParams& lameParamsAtPos(const GlobalPosition& globalPos) const | |
60 | 13200 | { return lameParams_; } | |
61 | |||
62 | //! Returns the porosity of the porous medium. | ||
63 | template<class ElementSolution> | ||
64 | Scalar porosity(const Element& element, | ||
65 | const SubControlVolume& scv, | ||
66 | const ElementSolution& elemSol) const | ||
67 | |||
68 | { | ||
69 | 13600 | return PorosityDeformation<Scalar>::evaluatePorosity(this->gridGeometry(), element, scv, elemSol, initPorosity_); | |
70 | } | ||
71 | |||
72 | /*! | ||
73 | * \brief Returns the effective fluid density. | ||
74 | */ | ||
75 | ✗ | Scalar effectiveFluidDensity(const Element& element, | |
76 | const SubControlVolume& scv) const | ||
77 | { | ||
78 | // get porous medium flow volume variables from coupling manager | ||
79 | ✗ | const auto& pmFlowVolVars = couplingManager().getPMFlowVolVars(element); | |
80 | ✗ | return pmFlowVolVars.density(); | |
81 | } | ||
82 | |||
83 | /*! | ||
84 | * \brief Returns the effective pore pressure. | ||
85 | */ | ||
86 | template<class ElementVolumeVariables, class FluxVarsCache> | ||
87 | ✗ | Scalar effectivePorePressure(const Element& element, | |
88 | const FVElementGeometry& fvGeometry, | ||
89 | const ElementVolumeVariables& elemVolVars, | ||
90 | const FluxVarsCache& fluxVarsCache) const | ||
91 | { | ||
92 | // get porous medium flow volume variables from coupling manager | ||
93 | 39600 | const auto& pmFlowVolVars = couplingManager().getPMFlowVolVars(element); | |
94 | 26400 | return pmFlowVolVars.pressure(); | |
95 | } | ||
96 | |||
97 | //! Returns the Biot coefficient of the porous medium. | ||
98 | ✗ | Scalar biotCoefficientAtPos(const GlobalPosition& globalPos) const | |
99 | ✗ | { return 1.0; } | |
100 | |||
101 | //! Returns reference to the coupling manager. | ||
102 | const CouplingManager& couplingManager() const | ||
103 | 26400 | { return *couplingManager_; } | |
104 | |||
105 | private: | ||
106 | std::shared_ptr<const CouplingManager> couplingManager_; | ||
107 | Scalar initPorosity_; | ||
108 | LameParams lameParams_; | ||
109 | }; | ||
110 | |||
111 | } // end namespace Dumux | ||
112 | |||
113 | #endif | ||
114 |