16#ifndef DUMUX_DISCRETIZATION_CVFE_DARCYS_LAW_HH
17#define DUMUX_DISCRETIZATION_CVFE_DARCYS_LAW_HH
37template<
class Scalar,
class Gr
idGeometry,
class GravityTermDensity = PhaseDensityInGravityTerm>
40 using FVElementGeometry =
typename GridGeometry::LocalView;
41 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
43 using GridView =
typename GridGeometry::GridView;
44 using Element =
typename GridView::template Codim<0>::Entity;
46 static constexpr int dim = GridView::dimension;
47 static constexpr int dimWorld = GridView::dimensionworld;
61 template<
class Problem,
class ElementVolumeVariables,
class ElementFluxVarsCache>
62 static Scalar
flux(
const Problem& problem,
63 const Element& element,
64 const FVElementGeometry& fvGeometry,
65 const ElementVolumeVariables& elemVolVars,
66 const SubControlVolumeFace& scvf,
68 const ElementFluxVarsCache& elemFluxVarCache)
70 const auto& fluxVarCache = elemFluxVarCache[scvf];
71 const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
72 const auto& outsideScv = fvGeometry.scv(scvf.outsideScvIdx());
73 const auto& insideVolVars = elemVolVars[insideScv];
74 const auto& outsideVolVars = elemVolVars[outsideScv];
76 auto insideK = insideVolVars.permeability();
77 auto outsideK = outsideVolVars.permeability();
80 insideK *= insideVolVars.extrusionFactor();
81 outsideK *= outsideVolVars.extrusionFactor();
86 const auto& shapeValues = fluxVarCache.shapeValues();
89 Dune::FieldVector<Scalar, dimWorld> gradP(0.0);
91 for (
auto&& scv :
scvs(fvGeometry))
93 const auto& volVars = elemVolVars[scv];
96 rho += GravityTermDensity::density(problem, volVars, phaseIdx)*shapeValues[scv.indexInElement()][0];
99 gradP.axpy(volVars.pressure(phaseIdx), fluxVarCache.gradN(scv.indexInElement()));
103 gradP.axpy(-rho, problem.spatialParams().gravity(scvf.center()));
106 return -1.0*
vtmv(scvf.unitOuterNormal(), K, gradP)*Extrusion::area(fvGeometry, scvf);
110 template<
class Problem,
class ElementVolumeVariables,
class FluxVarCache>
112 const Element& element,
113 const FVElementGeometry& fvGeometry,
114 const ElementVolumeVariables& elemVolVars,
115 const SubControlVolumeFace& scvf,
116 const FluxVarCache& fluxVarCache)
118 const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
119 const auto& outsideScv = fvGeometry.scv(scvf.outsideScvIdx());
120 const auto& insideVolVars = elemVolVars[insideScv];
121 const auto& outsideVolVars = elemVolVars[outsideScv];
123 auto insideK = insideVolVars.permeability();
124 auto outsideK = outsideVolVars.permeability();
127 insideK *= insideVolVars.extrusionFactor();
128 outsideK *= outsideVolVars.extrusionFactor();
132 std::vector<Scalar> ti(fvGeometry.numScv());
133 for (
const auto& scv :
scvs(fvGeometry))
134 ti[scv.indexInElement()] =
135 -1.0*Extrusion::area(fvGeometry, scvf)*
vtmv(scvf.unitOuterNormal(), K, fluxVarCache.gradN(scv.indexInElement()));
142template<
class TypeTag,
class DiscretizationMethod>
143class DarcysLawImplementation;
149template<
class TypeTag,
class DM>
151:
public CVFEDarcysLaw<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::GridGeometry>>
Darcy's law for control-volume finite element schemes.
Definition flux/cvfe/darcyslaw.hh:39
static Scalar flux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const int phaseIdx, const ElementFluxVarsCache &elemFluxVarCache)
Returns the advective flux of a fluid phase across the given sub-control volume face.
Definition flux/cvfe/darcyslaw.hh:62
static std::vector< Scalar > calculateTransmissibilities(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const FluxVarCache &fluxVarCache)
Definition flux/cvfe/darcyslaw.hh:111
forward declaration of the method-specific implementation
Definition flux/ccmpfa/darcyslaw.hh:27
Defines all properties used in Dumux.
Helper classes to compute the integration elements.
A free function to average a Tensor at an interface.
The density in the gravity term of Darcy's law.
Dune::DenseMatrix< MAT >::value_type vtmv(const Dune::DenseVector< V1 > &v1, const Dune::DenseMatrix< MAT > &M, const Dune::DenseVector< V2 > &v2)
Evaluates the scalar product of a vector v2, projected by a matrix M, with a vector v1.
Definition math.hh:880
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:165
Define some often used mathematical functions.
The available discretization methods in Dumux.
Definition interpolate.hh:27
std::ranges::range auto scvs(const FVElementGeometry &fvGeometry, const LocalDof &localDof)
Definition localdof.hh:82
Scalar faceTensorAverage(const Scalar T1, const Scalar T2, const Dune::FieldVector< Scalar, dim > &normal)
Average of a discontinuous scalar field at discontinuity interface (for compatibility reasons with th...
Definition facetensoraverage.hh:29
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition extrusion.hh:257
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.