25#ifndef DUMUX_CC_LOCAL_RESIDUAL_HH
26#define DUMUX_CC_LOCAL_RESIDUAL_HH
40template<
class TypeTag>
51 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
55 using ParentType::ParentType;
60 const Element& element,
61 const FVElementGeometry& fvGeometry,
62 const ElementVolumeVariables& elemVolVars,
63 const ElementBoundaryTypes& elemBcTypes,
64 const ElementFluxVariablesCache& elemFluxVarsCache,
65 const SubControlVolumeFace& scvf)
const
67 const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
68 const auto localScvIdx = scv.localDofIndex();
69 residual[localScvIdx] += this->
asImp().evalFlux(problem, element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf);
74 const Element& element,
75 const FVElementGeometry& fvGeometry,
76 const ElementVolumeVariables& elemVolVars,
77 const ElementFluxVariablesCache& elemFluxVarsCache,
78 const SubControlVolumeFace& scvf)
const
80 NumEqVector flux(0.0);
85 flux += this->
asImp().computeFlux(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
91 const auto& bcTypes =
problem.boundaryTypes(element, scvf);
94 if (bcTypes.hasDirichlet() && !bcTypes.hasNeumann())
95 flux += this->
asImp().computeFlux(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
98 else if (bcTypes.hasNeumann() && !bcTypes.hasDirichlet())
100 auto neumannFluxes = Deprecated::neumann(
problem, element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf);
103 const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
104 neumannFluxes *= scvf.area()*elemVolVars[scv].extrusionFactor();
106 flux += neumannFluxes;
110 DUNE_THROW(Dune::NotImplemented,
"Mixed boundary conditions. Use pure boundary conditions by converting Dirichlet BCs to Robin BCs");
The element-wise residual for finite volume schemes.
A arithmetic block vector type based on DUNE's reserved vector.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
Calculates the element-wise residual for the cell-centered discretization schemes.
Definition: cclocalresidual.hh:42
NumEqVector evalFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
evaluate the flux residual for a sub control volume face
Definition: cclocalresidual.hh:73
void evalFlux(ElementResidualVector &residual, const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementBoundaryTypes &elemBcTypes, const ElementFluxVariablesCache &elemFluxVarsCache, const SubControlVolumeFace &scvf) const
evaluate the flux residual for a sub control volume face and add to residual
Definition: cclocalresidual.hh:58
typename ParentType::ElementResidualVector ElementResidualVector
Definition: cclocalresidual.hh:54
The element-wise residual for finite volume schemes.
Definition: fvlocalresidual.hh:45
Implementation & asImp()
Definition: fvlocalresidual.hh:501
const Problem & problem() const
the problem
Definition: fvlocalresidual.hh:486
ReservedBlockVector< NumEqVector, FVElementGeometry::maxNumElementScvs > ElementResidualVector
the container storing all element residuals
Definition: fvlocalresidual.hh:66
Declares all properties used in Dumux.