28#ifndef DUMUX_DISCRETIZATION_BOX_DARCYS_LAW_HH
29#define DUMUX_DISCRETIZATION_BOX_DARCYS_LAW_HH
31#warning "This header is deprecated and will be removed after release 3.6. Use flux/cvfe/darcyslaw.hh"
43template<
class TypeTag,
class DiscretizationMethod>
47template<
class Scalar,
class Gr
idGeometry>
54template<
class TypeTag>
56:
public BoxDarcysLaw<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::GridGeometry>>
65template<
class Scalar,
class Gr
idGeometry>
68 using FVElementGeometry =
typename GridGeometry::LocalView;
69 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
71 using GridView =
typename GridGeometry::GridView;
72 using Element =
typename GridView::template Codim<0>::Entity;
74 enum { dim = GridView::dimension};
75 enum { dimWorld = GridView::dimensionworld};
89 template<
class Problem,
class ElementVolumeVariables,
class ElementFluxVarsCache>
90 static Scalar
flux(
const Problem& problem,
91 const Element& element,
92 const FVElementGeometry& fvGeometry,
93 const ElementVolumeVariables& elemVolVars,
94 const SubControlVolumeFace& scvf,
96 const ElementFluxVarsCache& elemFluxVarCache)
98 const auto& fluxVarCache = elemFluxVarCache[scvf];
99 const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
100 const auto& outsideScv = fvGeometry.scv(scvf.outsideScvIdx());
101 const auto& insideVolVars = elemVolVars[insideScv];
102 const auto& outsideVolVars = elemVolVars[outsideScv];
104 auto insideK = insideVolVars.permeability();
105 auto outsideK = outsideVolVars.permeability();
108 insideK *= insideVolVars.extrusionFactor();
109 outsideK *= outsideVolVars.extrusionFactor();
112 static const bool enableGravity = getParamFromGroup<bool>(problem.paramGroup(),
"Problem.EnableGravity");
114 const auto& shapeValues = fluxVarCache.shapeValues();
117 Dune::FieldVector<Scalar, dimWorld> gradP(0.0);
119 for (
auto&& scv : scvs(fvGeometry))
121 const auto& volVars = elemVolVars[scv];
124 rho += volVars.density(phaseIdx)*shapeValues[scv.indexInElement()][0];
127 gradP.axpy(volVars.pressure(phaseIdx), fluxVarCache.gradN(scv.indexInElement()));
131 gradP.axpy(-rho, problem.spatialParams().gravity(scvf.center()));
134 return -1.0*
vtmv(scvf.unitOuterNormal(), K, gradP)*Extrusion::area(fvGeometry, scvf);
138 template<
class Problem,
class ElementVolumeVariables,
class FluxVarCache>
140 const Element& element,
141 const FVElementGeometry& fvGeometry,
142 const ElementVolumeVariables& elemVolVars,
143 const SubControlVolumeFace& scvf,
144 const FluxVarCache& fluxVarCache)
146 const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
147 const auto& outsideScv = fvGeometry.scv(scvf.outsideScvIdx());
148 const auto& insideVolVars = elemVolVars[insideScv];
149 const auto& outsideVolVars = elemVolVars[outsideScv];
151 auto insideK = insideVolVars.permeability();
152 auto outsideK = outsideVolVars.permeability();
155 insideK *= insideVolVars.extrusionFactor();
156 outsideK *= outsideVolVars.extrusionFactor();
160 std::vector<Scalar> ti(fvGeometry.numScv());
161 for (
const auto& scv : scvs(fvGeometry))
162 ti[scv.indexInElement()] =
163 -1.0*Extrusion::area(fvGeometry, scvf)*
vtmv(scvf.unitOuterNormal(), K, fluxVarCache.gradN(scv.indexInElement()));
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Define some often used mathematical functions.
Helper classes to compute the integration elements.
The available discretization methods in Dumux.
A free function to average a Tensor at an interface.
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:863
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:251
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:41
CVFE< CVFEMethods::PQ1 > Box
Definition: method.hh:83
forward declaration of the method-specific implementation
Definition: flux/box/darcyslaw.hh:44
Darcy's law for the box scheme.
Definition: flux/box/darcyslaw.hh:67
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/box/darcyslaw.hh:139
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/box/darcyslaw.hh:90
Declares all properties used in Dumux.