version 3.11-dev
pq1bubble.hh
Go to the documentation of this file.
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//
13#ifndef DUMUX_DISCRETIZTAION_PQ1BUBBLE_HH
14#define DUMUX_DISCRETIZTAION_PQ1BUBBLE_HH
15
16#include <concepts>
17#include <type_traits>
18
19#include <dune/common/fvector.hh>
20#include <dune/geometry/multilineargeometry.hh>
21
24#include <dumux/common/concepts/variables_.hh>
26#include <dumux/common/typetraits/boundary_.hh>
27
29#include <dumux/assembly/cvfelocalresidual_.hh>
30
35
45
47
48namespace Dumux::Properties {
49
51// Create new type tags
52namespace TTag {
53struct PQ1BubbleBase { using InheritsFrom = std::tuple<FiniteVolumeModel>; };
54struct PQ1BubbleModel { using InheritsFrom = std::tuple<PQ1BubbleBase>; };
55struct PQ1BubbleHybridModel { using InheritsFrom = std::tuple<PQ1BubbleBase>; };
56} // end namespace TTag
57
59template<class TypeTag>
60struct GridGeometry<TypeTag, TTag::PQ1BubbleModel>
61{
62private:
63 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
66public:
68};
69
71template<class TypeTag>
72struct GridGeometry<TypeTag, TTag::PQ1BubbleHybridModel>
73{
74private:
75 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridGeometryCache>();
79 // For hybrid scheme we use two bubble functions on cubes
80 // when only using one bubble function stability issues can arise, especially for coupled problems
81 static constexpr std::size_t numCubeBubbles = 2;
83public:
85};
86
88template<class TypeTag>
89struct GridVolumeVariables<TypeTag, TTag::PQ1BubbleBase>
90{
91private:
92 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridVolumeVariablesCache>();
96public:
98};
99
101template<class TypeTag>
102struct FluxVariablesCache<TypeTag, TTag::PQ1BubbleModel>
103{
104private:
107public:
109};
110
112template<class TypeTag>
113struct GridFluxVariablesCache<TypeTag, TTag::PQ1BubbleModel>
114{
115private:
116 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>();
118
120 using FluxVariablesCache = GetPropTypeOr<TypeTag,
121 Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar>
122 >;
123public:
125};
126
128template<class TypeTag>
129struct FluxVariablesCache<TypeTag, TTag::PQ1BubbleHybridModel>
130{
131private:
134public:
136};
137
139template<class TypeTag>
140struct GridFluxVariablesCache<TypeTag, TTag::PQ1BubbleHybridModel>
141{
142private:
143 static constexpr bool enableCache = getPropValue<TypeTag, Properties::EnableGridFluxVariablesCache>();
145
147 using FluxVariablesCache = GetPropTypeOr<TypeTag,
148 Properties::FluxVariablesCache, FluxVariablesCaching::EmptyCache<Scalar>
149 >;
150public:
152};
153
155template<class TypeTag>
156struct ElementBoundaryTypes<TypeTag, TTag::PQ1BubbleBase>
157{
158private:
160 using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
161 using BoundaryTypes = typename ProblemTraits<Problem>::BoundaryTypes;
162public:
163 // Check if problem has new boundaryTypes interface
164 // then use ElementIntersectionBoundaryTypes
165 using type = std::conditional_t<
166 Dumux::Detail::hasProblemBoundaryTypesForIntersectionFunction<Problem, typename GG::LocalView, typename GG::GridView::Intersection>(),
169 >;
170};
171
172} // namespace Dumux::Properties
173
174namespace Dumux::Detail {
175
176template<class Problem>
177struct ProblemTraits<Problem, DiscretizationMethods::PQ1Bubble>
178{
179private:
180 using GG = std::decay_t<decltype(std::declval<Problem>().gridGeometry())>;
181public:
182 using GridGeometry = GG;
183 // Determine BoundaryTypes dependent on the used problem interface, either boundaryTypes(element, scv) or boundaryTypes(element, intersection)
184 using BoundaryTypes = Detail::BoundaryTypes<Problem, typename GG::LocalView, typename GG::GridView::Intersection>::type;
185};
186
187template<class TypeTag>
188concept PQ1BubbleModel = std::is_same_v<
189 typename GetPropType<TypeTag, Properties::GridGeometry>::DiscretizationMethod,
191>;
192
193template<PQ1BubbleModel TypeTag>
195{
196private:
197 using GV = GetPropType<TypeTag, Properties::GridVariables>;
198 static constexpr bool usesGeneralGridVariables =
199 Dumux::Concept::GridVariables<GV> && !Dumux::Concept::FVGridVariables<GV>;
200public:
201 using type = std::conditional_t<usesGeneralGridVariables,
202 Dumux::Experimental::CVFELocalResidual<TypeTag>,
204};
205
206} // end namespace Dumux::Detail
207
208#endif
Boundary flag to store e.g. in sub control volume faces.
This class stores an array of BoundaryTypes objects.
Definition: cvfe/elementboundarytypes.hh:28
Flux variables cache class for control-volume finite element schemes. For control-volume finite eleme...
Definition: discretization/cvfe/fluxvariablescache.hh:34
Flux variable caches implementation on a gridview.
Definition: discretization/cvfe/gridfluxvariablescache.hh:48
The element-wise residual for control-volume finite element schemes.
Definition: cvfelocalresidual.hh:77
Base class for the grid local variables.
Definition: gridvariablescache.hh:44
A class for providing the new update interface of variables. This allows to still use the VolumesVari...
Definition: variablesadapter.hh:36
This class stores an array of BoundaryTypes objects. This class is not dependent on the used discreti...
Definition: elementboundarytypes.hh:30
Flux variables cache class for control-volume finite element schemes. For control-volume finite eleme...
Definition: discretization/cvfe/hybrid/fluxvariablescache.hh:32
Flux variable caches implementation on a gridview.
Definition: discretization/cvfe/hybrid/gridfluxvariablescache.hh:51
Base class for the finite volume geometry vector for pq1bubble schemes This builds up the sub control...
Definition: discretization/pq1bubble/fvgridgeometry.hh:142
Defines all properties used in Dumux.
Type traits for problem classes.
Definition: pq1bubble.hh:188
Boundary types gathered on an element.
The local element solution class for control-volume finite element methods.
Calculates the element-wise residual for control-volume finite element schemes.
The default local operator than can be specialized for each discretization scheme.
Flux variables cache class for control-volume finite element schemes.
Global flux variable cache.
Flux variables cache class for control-volume finite element schemes.
Global flux variable cache.
Base class for the finite volume geometry vector for the pq1bubble method This builds up the sub cont...
Boundary types gathered on an element.
Classes related to flux variables caching.
Declares properties required for finite-volume models models.
The grid local variables class for control-volume finite element methods.
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
typename GetPropOr< TypeTag, Property, T >::type GetPropTypeOr
get the type alias defined in the property or the type T if the property is undefined
Definition: propertysystem.hh:303
The available discretization methods in Dumux.
Definition: cvfelocalresidual.hh:30
CVFE< CVFEMethods::PQ1Bubble > PQ1Bubble
Definition: method.hh:112
The energy balance equation for a porous solid.
Definition: common/properties.hh:26
typename Detail::DiscretizationDefaultLocalOperator< TypeTag >::type DiscretizationDefaultLocalOperator
Definition: defaultlocaloperator.hh:27
Quadrature rule traits for discretization schemes.
Definition: quadraturerules.hh:84
std::conditional_t< usesGeneralGridVariables, Dumux::Experimental::CVFELocalResidual< TypeTag >, Dumux::CVFELocalResidual< TypeTag > > type
Definition: box.hh:154
Detail::BoundaryTypes< Problem, typename GG::LocalView, typename GG::GridView::Intersection >::type BoundaryTypes
Definition: pq1bubble.hh:184
Definition: common/typetraits/problem.hh:23
An empty flux variables cache.
Definition: fluxvariablescaching.hh:35
The default traits for the hybrid pq1bubble finite volume grid geometry Defines the scv and scvf type...
Definition: discretization/pq1bubble/fvgridgeometry.hh:128
typename Detail::template ProblemTraits< Problem, typename GridGeometry::DiscretizationMethod >::BoundaryTypes BoundaryTypes
Definition: common/typetraits/problem.hh:34
std::conditional_t< Dumux::Detail::hasProblemBoundaryTypesForIntersectionFunction< Problem, typename GG::LocalView, typename GG::GridView::Intersection >(), Dumux::ElementIntersectionBoundaryTypes< BoundaryTypes >, Dumux::CVFEElementBoundaryTypes< BoundaryTypes > > type
Definition: pq1bubble.hh:169
Definition: pq1bubble.hh:53
std::tuple< FiniteVolumeModel > InheritsFrom
Definition: pq1bubble.hh:53
std::tuple< PQ1BubbleBase > InheritsFrom
Definition: pq1bubble.hh:55
Definition: pq1bubble.hh:54
std::tuple< PQ1BubbleBase > InheritsFrom
Definition: pq1bubble.hh:54