13#ifndef DUMUX_MULTIDOMAIN_BOUNDARY_FREEFLOW_POROUSMEDIUM_COUPLINGMANAGER_STAGGERED_CCTPFA_HH
14#define DUMUX_MULTIDOMAIN_BOUNDARY_FREEFLOW_POROUSMEDIUM_COUPLINGMANAGER_STAGGERED_CCTPFA_HH
26template<
class MDTraits>
32 using Scalar =
typename MDTraits::Scalar;
35 template<std::
size_t id>
36 using SubDomainTypeTag =
typename MDTraits::template SubDomain<id>::TypeTag;
40 template<std::
size_t id>
using FVElementGeometry =
typename GridGeometry<id>::LocalView;
41 template<std::
size_t id>
using SubControlVolumeFace =
typename FVElementGeometry<id>::SubControlVolumeFace;
42 template<std::
size_t id>
using SubControlVolume =
typename FVElementGeometry<id>::SubControlVolume;
44 template<std::
size_t id>
using NumEqVector =
typename Problem<id>::Traits::NumEqVector;
46 template<std::
size_t id>
using GridView =
typename GridGeometry<id>::GridView;
47 template<std::
size_t id>
using Element =
typename GridView<id>::template Codim<0>::Entity;
48 using SolutionVector =
typename MDTraits::SolutionVector;
61 template<std::
size_t i, std::
size_t j>
63 const FVElementGeometry<i>& fvGeometry,
64 const typename FVElementGeometry<i>::SubControlVolumeFace& scvf,
65 const ElementVolumeVariables<i>& elemVolVars)
const
69 const auto& couplingContext = this->
subApply(domainI, domainJ, [&](
const auto& cm,
auto&& ii,
auto&& jj) ->
const auto& {
70 return cm.couplingContext(ii, fvGeometry, scvf);
73 const auto& freeFlowElement = [&]
76 return fvGeometry.element();
78 return couplingContext.fvGeometry.element();
81 const auto& freeFlowScvf = [&]
86 return couplingContext.fvGeometry.scvf(couplingContext.freeFlowMassScvfIdx);
93 return CouplingConditions::massCouplingCondition(domainI, domainJ, fvGeometry, scvf, elemVolVars, couplingContext);
101 Dune::index_constant<porousMediumIndex> domainJ,
102 const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
103 const typename FVElementGeometry<freeFlowMomentumIndex>::SubControlVolumeFace& scvf,
104 const ElementVolumeVariables<freeFlowMomentumIndex>& elemVolVars)
const
106 if (scvf.isLateral())
107 return NumEqVector<freeFlowMomentumIndex>(0.0);
110 domainI, fvGeometry, scvf
113 return CouplingConditions::momentumCouplingCondition(fvGeometry, scvf, elemVolVars, context);
120 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf)
const
122 if (scvf.isFrontal())
125 Dune::index_constant<freeFlowMomentumIndex>(), fvGeometry, scvf
128 return CouplingConditions::darcyPermeability(fvGeometry, scvf, context);
132 const auto& orthogonalScvf = fvGeometry.lateralOrthogonalScvf(scvf);
133 const auto& orthogonalScv = fvGeometry.scv(orthogonalScvf.insideScvIdx());
134 const auto& frontalScvfOnBoundary = fvGeometry.frontalScvfOnBoundary(orthogonalScv);
136 Dune::index_constant<freeFlowMomentumIndex>(), fvGeometry, frontalScvfOnBoundary
139 return CouplingConditions::darcyPermeability(fvGeometry, frontalScvfOnBoundary, context);
149 Scalar
pressure(
const Element<freeFlowMomentumIndex>& element,
150 const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
151 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf)
const
154 element, fvGeometry, scvf
165 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf)
const
175 Scalar
density(
const Element<freeFlowMomentumIndex>& element,
176 const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
177 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf,
178 const bool considerPreviousTimeStep =
false)
const
181 element, fvGeometry, scvf, considerPreviousTimeStep
186 const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
187 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf,
188 const bool considerPreviousTimeStep =
false)
const
191 element, fvGeometry, scvf, considerPreviousTimeStep
198 Scalar
density(
const Element<freeFlowMomentumIndex>& element,
199 const SubControlVolume<freeFlowMomentumIndex>& scv,
200 const bool considerPreviousTimeStep =
false)
const
203 element, scv, considerPreviousTimeStep
211 const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
212 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf)
const
215 element, fvGeometry, scvf
223 const SubControlVolumeFace<freeFlowMassIndex>& scvf)
const
234 Dune::index_constant<porousMediumIndex> domainJ,
235 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf)
const
237 return this->
subApply(domainI, domainJ, [&](
const auto& cm,
auto&& ii,
auto&& jj){
238 return cm.isCoupledLateralScvf(ii, scvf);
Definition: couplingconditions_staggered_cctpfa.hh:72
Base coupling manager for coupling freeflow and porous medium flow models.
Definition: couplingmanager_base.hh:146
static constexpr auto porousMediumIndex
Definition: couplingmanager_base.hh:184
static constexpr auto freeFlowMassIndex
Definition: couplingmanager_base.hh:183
static constexpr auto freeFlowMomentumIndex
Definition: couplingmanager_base.hh:182
Coupling manager for coupling freeflow and porous medium flow models specialization for staggered-cct...
Definition: couplingmanager_staggered_cctpfa.hh:29
Scalar density(const Element< freeFlowMomentumIndex > &element, const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf, const bool considerPreviousTimeStep=false) const
Returns the density at a given sub control volume face.
Definition: couplingmanager_staggered_cctpfa.hh:175
static constexpr auto freeFlowMomentumIndex
Definition: couplingmanager_staggered_cctpfa.hh:53
bool isCoupledLateralScvf(Dune::index_constant< freeFlowMomentumIndex > domainI, Dune::index_constant< porousMediumIndex > domainJ, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf) const
Returns whether a given scvf is coupled to the other domain.
Definition: couplingmanager_staggered_cctpfa.hh:233
NumEqVector< freeFlowMomentumIndex > momentumCouplingCondition(Dune::index_constant< freeFlowMomentumIndex > domainI, Dune::index_constant< porousMediumIndex > domainJ, const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const typename FVElementGeometry< freeFlowMomentumIndex >::SubControlVolumeFace &scvf, const ElementVolumeVariables< freeFlowMomentumIndex > &elemVolVars) const
Definition: couplingmanager_staggered_cctpfa.hh:100
static constexpr auto porousMediumIndex
Definition: couplingmanager_staggered_cctpfa.hh:55
auto darcyPermeability(const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf) const
Returns the intrinsic permeability of the coupled Darcy element.
Definition: couplingmanager_staggered_cctpfa.hh:119
Scalar effectiveViscosity(const Element< freeFlowMomentumIndex > &element, const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf) const
Returns the pressure at a given sub control volume face.
Definition: couplingmanager_staggered_cctpfa.hh:210
auto massCouplingCondition(Dune::index_constant< i > domainI, Dune::index_constant< j > domainJ, const FVElementGeometry< i > &fvGeometry, const typename FVElementGeometry< i >::SubControlVolumeFace &scvf, const ElementVolumeVariables< i > &elemVolVars) const
Returns the mass flux across the coupling boundary.
Definition: couplingmanager_staggered_cctpfa.hh:62
auto faceVelocity(const Element< freeFlowMassIndex > &element, const SubControlVolumeFace< freeFlowMassIndex > &scvf) const
Returns the velocity at a given sub control volume face.
Definition: couplingmanager_staggered_cctpfa.hh:222
auto insideAndOutsideDensity(const Element< freeFlowMomentumIndex > &element, const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf, const bool considerPreviousTimeStep=false) const
Definition: couplingmanager_staggered_cctpfa.hh:185
Scalar pressure(const Element< freeFlowMomentumIndex > &element, const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf) const
Returns the pressure at a given sub control volume face.
Definition: couplingmanager_staggered_cctpfa.hh:149
static constexpr auto freeFlowMassIndex
Definition: couplingmanager_staggered_cctpfa.hh:54
Scalar cellPressure(const Element< freeFlowMomentumIndex > &element, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf) const
Returns the pressure at the center of a sub control volume corresponding to a given sub control volum...
Definition: couplingmanager_staggered_cctpfa.hh:164
Scalar density(const Element< freeFlowMomentumIndex > &element, const SubControlVolume< freeFlowMomentumIndex > &scv, const bool considerPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: couplingmanager_staggered_cctpfa.hh:198
Coupling manager that combines an arbitrary number of binary coupling manager (coupling two domains e...
Definition: multibinarycouplingmanager.hh:50
decltype(auto) subApply(Dune::index_constant< i > domainI, Dune::index_constant< j > domainJ, Apply &&apply)
apply a function to the domainI-domainJ sub coupling manager using its local indices
Definition: multibinarycouplingmanager.hh:137
auto & subCouplingManager(Dune::index_constant< i > domainI, Dune::index_constant< j > domainJ)
return the binary sub-coupling manager
Definition: multibinarycouplingmanager.hh:119
Base class for coupling freeflow and porous medium flow models.
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296