version 3.8
porenetwork/1p/fluxvariablescache.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-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_PNM_1P_FLUXVARIABLESCACHE_HH
13#define DUMUX_PNM_1P_FLUXVARIABLESCACHE_HH
14
16
17namespace Dumux::PoreNetwork {
18
24template<class AdvectionType>
26{
27 using Scalar = typename AdvectionType::Scalar;
28public:
30 static bool constexpr isSolDependent = true;
31
32 template<class Problem, class Element, class FVElementGeometry, class ElementVolumeVariables>
33 void update(const Problem& problem,
34 const Element& element,
35 const FVElementGeometry& fvGeometry,
36 const ElementVolumeVariables& elemVolVars,
37 const typename FVElementGeometry::SubControlVolumeFace& scvf)
38 {
39 const auto eIdx = fvGeometry.gridGeometry().elementMapper().index(element);
40 throatCrossSectionShape_ = fvGeometry.gridGeometry().throatCrossSectionShape(eIdx);
41 throatShapeFactor_ = fvGeometry.gridGeometry().throatShapeFactor(eIdx);
42 throatCrossSectionalArea_ = problem.spatialParams().throatCrossSectionalArea(element, elemVolVars);
43 throatLength_ = problem.spatialParams().throatLength(element, elemVolVars);
44 throatInscribedRadius_ = problem.spatialParams().throatInscribedRadius(element, elemVolVars);
45 poreToPoreDistance_ = element.geometry().volume();
46
47 cache_.fill(problem, element, fvGeometry, scvf, elemVolVars, *this, /*phaseIdx*/0);
48 transmissibility_ = AdvectionType::calculateTransmissibility(problem, element, fvGeometry, scvf, elemVolVars, *this, /*phaseIdx*/0);
49 }
50
55 { return throatCrossSectionShape_; }
56
60 Scalar throatShapeFactor() const
61 { return throatShapeFactor_; }
62
66 Scalar transmissibility(const int phaseIdx = 0) const
67 { return transmissibility_; }
68
72 Scalar throatCrossSectionalArea(const int phaseIdx = 0) const
73 { return throatCrossSectionalArea_; }
74
78 Scalar throatLength() const
79 { return throatLength_; }
80
84 Scalar throatInscribedRadius() const
85 { return throatInscribedRadius_; }
86
90 Scalar poreToPoreDistance() const
91 { return poreToPoreDistance_; }
92
96 const auto& singlePhaseFlowVariables() const
97 { return cache_; }
98
99private:
100 Throat::Shape throatCrossSectionShape_;
101 Scalar throatShapeFactor_;
102 Scalar transmissibility_;
103 Scalar throatCrossSectionalArea_;
104 Scalar throatLength_;
105 Scalar throatInscribedRadius_;
106 Scalar poreToPoreDistance_;
107
108 typename AdvectionType::Transmissibility::SinglePhaseCache cache_;
109};
110
111} // end namespace Dumux::PoreNetwork
112
113#endif
Flux variables cache for the single-phase-flow PNM Store data required for flux calculation.
Definition: porenetwork/1p/fluxvariablescache.hh:26
const auto & singlePhaseFlowVariables() const
Returns the throats's cached flow variables for single-phase flow.
Definition: porenetwork/1p/fluxvariablescache.hh:96
Scalar transmissibility(const int phaseIdx=0) const
Returns the throats's transmissibility.
Definition: porenetwork/1p/fluxvariablescache.hh:66
Scalar poreToPoreDistance() const
Returns the throats's pore-to-pore-center distance.
Definition: porenetwork/1p/fluxvariablescache.hh:90
Scalar throatShapeFactor() const
Returns the throats's shape factor.
Definition: porenetwork/1p/fluxvariablescache.hh:60
Scalar throatInscribedRadius() const
Returns the throats's inscribed radius.
Definition: porenetwork/1p/fluxvariablescache.hh:84
Throat::Shape throatCrossSectionShape() const
Returns the throats's cross-sectional shape.
Definition: porenetwork/1p/fluxvariablescache.hh:54
static bool constexpr isSolDependent
whether the cache needs an update when the solution changes
Definition: porenetwork/1p/fluxvariablescache.hh:30
Scalar throatLength() const
Returns the throats's length.
Definition: porenetwork/1p/fluxvariablescache.hh:78
Scalar throatCrossSectionalArea(const int phaseIdx=0) const
Returns the throats's cross-sectional area.
Definition: porenetwork/1p/fluxvariablescache.hh:72
void update(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolumeFace &scvf)
Definition: porenetwork/1p/fluxvariablescache.hh:33
Shape
Collection of different pore-throat shapes.
Definition: throatproperties.hh:26
Definition: discretization/porenetwork/fvelementgeometry.hh:24
This file contains functions related to calculate pore-throat properties.