version 3.8
couplingconditions_staggered_cctpfa.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//
13#ifndef DUMUX_MD_FREEFLOW_POROUSMEDIUM_COUPLINGCONDITIONS_STAGGERED_TPFA_HH
14#define DUMUX_MD_FREEFLOW_POROUSMEDIUM_COUPLINGCONDITIONS_STAGGERED_TPFA_HH
15
16#include <numeric>
17
18#include <dune/common/exceptions.hh>
19
21#include <dumux/common/math.hh>
22
24
28
31
32namespace Dumux {
33
40{
47 {
48 harmonic, arithmetic, ffOnly, pmOnly
49 };
50
55 static DiffusionCoefficientAveragingType stringToEnum(DiffusionCoefficientAveragingType, const std::string& diffusionCoefficientAveragingType)
56 {
57 if (diffusionCoefficientAveragingType == "Harmonic")
59 else if (diffusionCoefficientAveragingType == "Arithmetic")
61 else if (diffusionCoefficientAveragingType == "FreeFlowOnly")
63 else if (diffusionCoefficientAveragingType == "PorousMediumOnly")
65 else
66 DUNE_THROW(Dune::IOError, "Unknown DiffusionCoefficientAveragingType");
67 }
68
69};
70
71template<class MDTraits, class CouplingManager, bool enableEnergyBalance, bool isCompositional>
73
79template<class MDTraits, class CouplingManager>
82 MDTraits, CouplingManager,
83 GetPropType<typename MDTraits::template SubDomain<0>::TypeTag, Properties::ModelTraits>::enableEnergyBalance(),
84 (GetPropType<typename MDTraits::template SubDomain<0>::TypeTag, Properties::ModelTraits>::numFluidComponents() > 1)
85 >;
86
91template<class MDTraits, class CouplingManager>
93{
94 using Scalar = typename MDTraits::Scalar;
95
96 template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomain<id>::TypeTag;
97 template<std::size_t id> using GridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::GridGeometry>;
98 template<std::size_t id> using Element = typename GridGeometry<id>::GridView::template Codim<0>::Entity;
99 template<std::size_t id> using FVElementGeometry = typename GridGeometry<id>::LocalView;
100 template<std::size_t id> using SubControlVolumeFace = typename GridGeometry<id>::LocalView::SubControlVolumeFace;
101 template<std::size_t id> using SubControlVolume = typename GridGeometry<id>::LocalView::SubControlVolume;
102 template<std::size_t id> using Indices = typename GetPropType<SubDomainTypeTag<id>, Properties::ModelTraits>::Indices;
103 template<std::size_t id> using ElementVolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::LocalView;
104 template<std::size_t id> using VolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::VolumeVariables;
105 template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>;
106 template<std::size_t id> using FluidSystem = GetPropType<SubDomainTypeTag<id>, Properties::FluidSystem>;
107 template<std::size_t id> using ModelTraits = GetPropType<SubDomainTypeTag<id>, Properties::ModelTraits>;
108 template<std::size_t id> using GlobalPosition = typename Element<id>::Geometry::GlobalCoordinate;
109 template<std::size_t id> using NumEqVector = typename Problem<id>::Traits::NumEqVector;
110
111public:
114 static constexpr auto porousMediumIndex = CouplingManager::porousMediumIndex;
115private:
116
117 using AdvectionType = GetPropType<SubDomainTypeTag<porousMediumIndex>, Properties::AdvectionType>;
120
121 static constexpr bool adapterUsed = ModelTraits<porousMediumIndex>::numFluidPhases() > 1;
123
124 static constexpr int enableEnergyBalance = GetPropType<SubDomainTypeTag<freeFlowMassIndex>, Properties::ModelTraits>::enableEnergyBalance();
125 static_assert(GetPropType<SubDomainTypeTag<porousMediumIndex>, Properties::ModelTraits>::enableEnergyBalance() == enableEnergyBalance,
126 "All submodels must both be either isothermal or non-isothermal");
127
129 FluidSystem<porousMediumIndex>>::value,
130 "All submodels must use the same fluid system");
131
132 using DiffusionCoefficientAveragingType = typename FreeFlowPorousMediumCouplingOptions::DiffusionCoefficientAveragingType;
133
134public:
138 template<std::size_t i>
139 static constexpr auto couplingPhaseIdx(Dune::index_constant<i> id, int coupledPhaseIdx = 0)
140 { return IndexHelper::couplingPhaseIdx(id, coupledPhaseIdx); }
141
145 template<std::size_t i>
146 static constexpr auto couplingCompIdx(Dune::index_constant<i> id, int coupledCompIdx)
147 { return IndexHelper::couplingCompIdx(id, coupledCompIdx); }
148
152 template<class Context>
153 static auto darcyPermeability(const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
154 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf,
155 const Context& context)
156 { return context.volVars.permeability(); }
157
165 template<class Context>
166 static NumEqVector<freeFlowMomentumIndex> momentumCouplingCondition(const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
167 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf,
168 const ElementVolumeVariables<freeFlowMomentumIndex>& elemVolVars,
169 const Context& context)
170 {
171 static constexpr auto numPhasesDarcy = GetPropType<SubDomainTypeTag<porousMediumIndex>, Properties::ModelTraits>::numFluidPhases();
172 NumEqVector<freeFlowMomentumIndex> momentumFlux(0.0);
173
174 if (!scvf.isFrontal())
175 return momentumFlux;
176
177 const auto pmPhaseIdx = couplingPhaseIdx(porousMediumIndex);
178
179 if(numPhasesDarcy > 1)
180 momentumFlux[scvf.normalAxis()] = context.volVars.pressure(pmPhaseIdx);
181 else // use pressure reconstruction for single phase models
182 momentumFlux[scvf.normalAxis()] = pressureAtInterface_(fvGeometry, scvf, elemVolVars, context);
183
184 // TODO: generalize for permeability tensors
185
186 // normalize pressure
187 momentumFlux[scvf.normalAxis()] -= elemVolVars.gridVolVars().problem().referencePressure(fvGeometry.element(), fvGeometry, scvf);
188
189 momentumFlux[scvf.normalAxis()] *= scvf.directionSign();
190
191 return momentumFlux;
192 }
193
197 static Scalar advectiveFlux(const Scalar insideQuantity, const Scalar outsideQuantity, const Scalar volumeFlow, bool insideIsUpstream)
198 {
199 const Scalar upwindWeight = 1.0; //TODO use Flux.UpwindWeight or something like Coupling.UpwindWeight?
200
201 if(insideIsUpstream)
202 return (upwindWeight * insideQuantity + (1.0 - upwindWeight) * outsideQuantity) * volumeFlow;
203 else
204 return (upwindWeight * outsideQuantity + (1.0 - upwindWeight) * insideQuantity) * volumeFlow;
205 }
206
207protected:
208
212 template<std::size_t i, std::size_t j>
213 Scalar transmissibility_(Dune::index_constant<i> domainI,
214 Dune::index_constant<j> domainJ,
215 const Scalar insideDistance,
216 const Scalar outsideDistance,
217 const Scalar avgQuantityI,
218 const Scalar avgQuantityJ,
219 const DiffusionCoefficientAveragingType diffCoeffAvgType) const
220 {
221 const Scalar totalDistance = insideDistance + outsideDistance;
222 if(diffCoeffAvgType == DiffusionCoefficientAveragingType::harmonic)
223 {
224 return harmonicMean(avgQuantityI, avgQuantityJ, insideDistance, outsideDistance)
225 / totalDistance;
226 }
227 else if(diffCoeffAvgType == DiffusionCoefficientAveragingType::arithmetic)
228 {
229 return arithmeticMean(avgQuantityI, avgQuantityJ, insideDistance, outsideDistance)
230 / totalDistance;
231 }
232 else if(diffCoeffAvgType == DiffusionCoefficientAveragingType::ffOnly)
233 return domainI == freeFlowMassIndex
234 ? avgQuantityI / totalDistance
235 : avgQuantityJ / totalDistance;
236
237 else // diffCoeffAvgType == DiffusionCoefficientAveragingType::pmOnly)
238 return domainI == porousMediumIndex
239 ? avgQuantityI / totalDistance
240 : avgQuantityJ / totalDistance;
241 }
242
246 template<class Scv, class Scvf>
247 Scalar getDistance_(const Scv& scv, const Scvf& scvf) const
248 {
249 return (scv.dofPosition() - scvf.ipGlobal()).two_norm();
250 }
251
255 template<std::size_t i, std::size_t j, bool isNI = enableEnergyBalance, typename std::enable_if_t<isNI, int> = 0>
256 Scalar conductiveEnergyFlux_(Dune::index_constant<i> domainI,
257 Dune::index_constant<j> domainJ,
258 const FVElementGeometry<i>& fvGeometryI,
259 const FVElementGeometry<j>& fvGeometryJ,
260 const SubControlVolumeFace<i>& scvfI,
261 const SubControlVolume<i>& scvI,
262 const SubControlVolume<j>& scvJ,
263 const VolumeVariables<i>& volVarsI,
264 const VolumeVariables<j>& volVarsJ,
265 const DiffusionCoefficientAveragingType diffCoeffAvgType) const
266 {
267 const Scalar insideDistance = getDistance_(scvI, scvfI);
268 const Scalar outsideDistance = getDistance_(scvJ, scvfI);
269
270 const Scalar deltaT = volVarsJ.temperature() - volVarsI.temperature();
271 const Scalar tij = transmissibility_(
272 domainI, domainJ,
273 insideDistance, outsideDistance,
274 volVarsI.effectiveThermalConductivity(), volVarsJ.effectiveThermalConductivity(),
275 diffCoeffAvgType
276 );
277
278 return -tij * deltaT;
279 }
280
284 template<class CouplingContext>
285 static Scalar pressureAtInterface_(const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
286 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf,
287 const ElementVolumeVariables<freeFlowMomentumIndex>& elemVolVars,
288 const CouplingContext& context)
289 {
290 GlobalPosition<freeFlowMomentumIndex> velocity(0.0);
291 const auto& scv = fvGeometry.scv(scvf.insideScvIdx());
292 velocity[scv.dofAxis()] = elemVolVars[scv].velocity();
293 const auto& pmScvf = context.fvGeometry.scvf(context.porousMediumScvfIdx);
294 return computeCouplingPhasePressureAtInterface_(context.fvGeometry, pmScvf, context.volVars, context.gravity, velocity, AdvectionType());
295 }
296
300 static Scalar computeCouplingPhasePressureAtInterface_(const FVElementGeometry<porousMediumIndex>& fvGeometry,
301 const SubControlVolumeFace<porousMediumIndex>& scvf,
302 const VolumeVariables<porousMediumIndex>& volVars,
303 const typename Element<freeFlowMomentumIndex>::Geometry::GlobalCoordinate& couplingPhaseVelocity,
305 {
306 DUNE_THROW(Dune::NotImplemented, "Forchheimer's law pressure reconstruction");
307 }
308
312 static Scalar computeCouplingPhasePressureAtInterface_(const FVElementGeometry<porousMediumIndex>& fvGeometry,
313 const SubControlVolumeFace<porousMediumIndex>& scvf,
314 const VolumeVariables<porousMediumIndex>& volVars,
315 const typename Element<freeFlowMomentumIndex>::Geometry::GlobalCoordinate& gravity,
316 const typename Element<freeFlowMomentumIndex>::Geometry::GlobalCoordinate& couplingPhaseVelocity,
317 DarcysLaw)
318 {
319 const auto pmPhaseIdx = couplingPhaseIdx(porousMediumIndex);
320 const Scalar couplingPhaseCellCenterPressure = volVars.pressure(pmPhaseIdx);
321 const Scalar couplingPhaseMobility = volVars.mobility(pmPhaseIdx);
322 const Scalar couplingPhaseDensity = volVars.density(pmPhaseIdx);
323 const auto K = volVars.permeability();
324
325 // A tpfa approximation yields (works if mobility != 0)
326 // v*n = -kr/mu*K * (gradP - rho*g)*n = mobility*(ti*(p_center - p_interface) + rho*n^TKg)
327 // -> p_interface = (1/mobility * (-v*n) + rho*n^TKg)/ti + p_center
328 // where v is the free-flow velocity (couplingPhaseVelocity)
329 const auto alpha = vtmv(scvf.unitOuterNormal(), K, gravity);
330
331 const auto& insideScv = fvGeometry.scv(scvf.insideScvIdx());
332 const auto ti = computeTpfaTransmissibility(fvGeometry, scvf, insideScv, K, 1.0);
333
334 return (-1/couplingPhaseMobility * (scvf.unitOuterNormal() * couplingPhaseVelocity) + couplingPhaseDensity * alpha)/ti
335 + couplingPhaseCellCenterPressure;
336 }
337};
338
343template<class MDTraits, class CouplingManager, bool enableEnergyBalance>
344class FFPMCouplingConditionsStaggeredCCTpfaImpl<MDTraits, CouplingManager, enableEnergyBalance, false>
345: public FFPMCouplingConditionsStaggeredCCTpfaImplBase<MDTraits, CouplingManager>
346{
348 using Scalar = typename MDTraits::Scalar;
349
350 // the sub domain type tags
351 template<std::size_t id>
352 using SubDomainTypeTag = typename MDTraits::template SubDomain<id>::TypeTag;
353
354 template<std::size_t id> using GridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::GridGeometry>;
355 template<std::size_t id> using Element = typename GridGeometry<id>::GridView::template Codim<0>::Entity;
356 template<std::size_t id> using FVElementGeometry = typename GridGeometry<id>::LocalView;
357 template<std::size_t id> using SubControlVolumeFace = typename GridGeometry<id>::LocalView::SubControlVolumeFace;
358 template<std::size_t id> using SubControlVolume = typename GridGeometry<id>::LocalView::SubControlVolume;
359 template<std::size_t id> using Indices = typename GetPropType<SubDomainTypeTag<id>, Properties::ModelTraits>::Indices;
360 template<std::size_t id> using ElementVolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::LocalView;
361 template<std::size_t id> using VolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::VolumeVariables;
362
363 static_assert(GetPropType<SubDomainTypeTag<ParentType::porousMediumIndex>, Properties::ModelTraits>::numFluidComponents() == GetPropType<SubDomainTypeTag<ParentType::porousMediumIndex>, Properties::ModelTraits>::numFluidPhases(),
364 "Darcy Model must not be compositional");
365
366 using DiffusionCoefficientAveragingType = typename FreeFlowPorousMediumCouplingOptions::DiffusionCoefficientAveragingType;
367
368public:
369 using ParentType::ParentType;
370 using ParentType::couplingPhaseIdx;
371
375 template<std::size_t i, std::size_t j, class CouplingContext>
376 static Scalar massCouplingCondition(Dune::index_constant<i> domainI,
377 Dune::index_constant<j> domainJ,
378 const FVElementGeometry<i>& fvGeometry,
379 const SubControlVolumeFace<i>& scvf,
380 const ElementVolumeVariables<i>& insideVolVars,
381 const CouplingContext& context)
382 {
383 const Scalar normalVelocity = context.velocity * scvf.unitOuterNormal();
384 const Scalar darcyDensity = insideVolVars[scvf.insideScvIdx()].density(couplingPhaseIdx(ParentType::porousMediumIndex));
385 const Scalar stokesDensity = context.volVars.density();
386 const bool insideIsUpstream = normalVelocity > 0.0;
387 return ParentType::advectiveFlux(darcyDensity, stokesDensity, normalVelocity, insideIsUpstream);
388 }
389
393 template<bool isNI = enableEnergyBalance, typename std::enable_if_t<isNI, int> = 0>
394 Scalar energyCouplingCondition(const Element<ParentType::porousMediumIndex>& element,
395 const FVElementGeometry<ParentType::porousMediumIndex>& fvGeometry,
396 const ElementVolumeVariables<ParentType::porousMediumIndex>& darcyElemVolVars,
397 const SubControlVolumeFace<ParentType::porousMediumIndex>& scvf,
398 const DiffusionCoefficientAveragingType diffCoeffAvgType = DiffusionCoefficientAveragingType::ffOnly) const
399 {
400 DUNE_THROW(Dune::NotImplemented, "Energy coupling condition");
401 }
402
406 template<bool isNI = enableEnergyBalance, typename std::enable_if_t<isNI, int> = 0>
407 Scalar energyCouplingCondition(const Element<ParentType::freeFlowMassIndex>& element,
408 const FVElementGeometry<ParentType::freeFlowMassIndex>& fvGeometry,
409 const ElementVolumeVariables<ParentType::freeFlowMassIndex>& stokesElemVolVars,
410 const SubControlVolumeFace<ParentType::freeFlowMassIndex>& scvf,
411 const DiffusionCoefficientAveragingType diffCoeffAvgType = DiffusionCoefficientAveragingType::ffOnly) const
412 {
413 DUNE_THROW(Dune::NotImplemented, "Energy coupling condition");
414 }
415
416private:
417
418
419
423 template<std::size_t i, std::size_t j, bool isNI = enableEnergyBalance, typename std::enable_if_t<isNI, int> = 0>
424 Scalar energyFlux_(Dune::index_constant<i> domainI,
425 Dune::index_constant<j> domainJ,
426 const FVElementGeometry<i>& insideFvGeometry,
427 const FVElementGeometry<j>& outsideFvGeometry,
428 const SubControlVolumeFace<i>& scvf,
429 const VolumeVariables<i>& insideVolVars,
430 const VolumeVariables<j>& outsideVolVars,
431 const Scalar velocity,
432 const bool insideIsUpstream,
433 const DiffusionCoefficientAveragingType diffCoeffAvgType) const
434 {
435 Scalar flux(0.0);
436
437 const auto& insideScv = (*scvs(insideFvGeometry).begin());
438 const auto& outsideScv = (*scvs(outsideFvGeometry).begin());
439
440 // convective fluxes
441 const Scalar insideTerm = insideVolVars.density(couplingPhaseIdx(domainI)) * insideVolVars.enthalpy(couplingPhaseIdx(domainI));
442 const Scalar outsideTerm = outsideVolVars.density(couplingPhaseIdx(domainJ)) * outsideVolVars.enthalpy(couplingPhaseIdx(domainJ));
443
444 flux += this->advectiveFlux(insideTerm, outsideTerm, velocity, insideIsUpstream);
445
446 flux += this->conductiveEnergyFlux_(domainI, domainJ, insideFvGeometry, outsideFvGeometry, scvf, insideScv, outsideScv, insideVolVars, outsideVolVars, diffCoeffAvgType);
447
448 return flux;
449 }
450
451};
452
453} // end namespace Dumux
454
455#endif
The interface of the coupling manager for multi domain problems.
Definition: multidomain/couplingmanager.hh:48
forward declaration of the method-specific implementation
Definition: flux/ccmpfa/darcyslaw.hh:27
static Scalar massCouplingCondition(Dune::index_constant< i > domainI, Dune::index_constant< j > domainJ, const FVElementGeometry< i > &fvGeometry, const SubControlVolumeFace< i > &scvf, const ElementVolumeVariables< i > &insideVolVars, const CouplingContext &context)
Returns the mass flux across the coupling boundary as seen from the Darcy domain.
Definition: couplingconditions_staggered_cctpfa.hh:376
Scalar energyCouplingCondition(const Element< ParentType::freeFlowMassIndex > &element, const FVElementGeometry< ParentType::freeFlowMassIndex > &fvGeometry, const ElementVolumeVariables< ParentType::freeFlowMassIndex > &stokesElemVolVars, const SubControlVolumeFace< ParentType::freeFlowMassIndex > &scvf, const DiffusionCoefficientAveragingType diffCoeffAvgType=DiffusionCoefficientAveragingType::ffOnly) const
Returns the energy flux across the coupling boundary as seen from the free-flow domain.
Definition: couplingconditions_staggered_cctpfa.hh:407
Scalar energyCouplingCondition(const Element< ParentType::porousMediumIndex > &element, const FVElementGeometry< ParentType::porousMediumIndex > &fvGeometry, const ElementVolumeVariables< ParentType::porousMediumIndex > &darcyElemVolVars, const SubControlVolumeFace< ParentType::porousMediumIndex > &scvf, const DiffusionCoefficientAveragingType diffCoeffAvgType=DiffusionCoefficientAveragingType::ffOnly) const
Returns the energy flux across the coupling boundary as seen from the Darcy domain.
Definition: couplingconditions_staggered_cctpfa.hh:394
A base class which provides some common methods used for Stokes-Darcy coupling.
Definition: couplingconditions_staggered_cctpfa.hh:93
static Scalar computeCouplingPhasePressureAtInterface_(const FVElementGeometry< porousMediumIndex > &fvGeometry, const SubControlVolumeFace< porousMediumIndex > &scvf, const VolumeVariables< porousMediumIndex > &volVars, const typename Element< freeFlowMomentumIndex >::Geometry::GlobalCoordinate &couplingPhaseVelocity, ForchheimersLaw)
Returns the pressure at the interface using Forchheimers's law for reconstruction.
Definition: couplingconditions_staggered_cctpfa.hh:300
static Scalar advectiveFlux(const Scalar insideQuantity, const Scalar outsideQuantity, const Scalar volumeFlow, bool insideIsUpstream)
Evaluate an advective flux across the interface and consider upwinding.
Definition: couplingconditions_staggered_cctpfa.hh:197
Scalar getDistance_(const Scv &scv, const Scvf &scvf) const
Returns the distance between an scvf and the corresponding scv center.
Definition: couplingconditions_staggered_cctpfa.hh:247
static constexpr auto freeFlowMomentumIndex
Definition: couplingconditions_staggered_cctpfa.hh:112
Scalar transmissibility_(Dune::index_constant< i > domainI, Dune::index_constant< j > domainJ, const Scalar insideDistance, const Scalar outsideDistance, const Scalar avgQuantityI, const Scalar avgQuantityJ, const DiffusionCoefficientAveragingType diffCoeffAvgType) const
Returns the transmissibility used for either molecular diffusion or thermal conductivity.
Definition: couplingconditions_staggered_cctpfa.hh:213
static NumEqVector< freeFlowMomentumIndex > momentumCouplingCondition(const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf, const ElementVolumeVariables< freeFlowMomentumIndex > &elemVolVars, const Context &context)
Returns the momentum flux across the coupling boundary.
Definition: couplingconditions_staggered_cctpfa.hh:166
static constexpr auto freeFlowMassIndex
Definition: couplingconditions_staggered_cctpfa.hh:113
static constexpr auto porousMediumIndex
Definition: couplingconditions_staggered_cctpfa.hh:114
static Scalar pressureAtInterface_(const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf, const ElementVolumeVariables< freeFlowMomentumIndex > &elemVolVars, const CouplingContext &context)
Returns the pressure at the interface.
Definition: couplingconditions_staggered_cctpfa.hh:285
Scalar conductiveEnergyFlux_(Dune::index_constant< i > domainI, Dune::index_constant< j > domainJ, const FVElementGeometry< i > &fvGeometryI, const FVElementGeometry< j > &fvGeometryJ, const SubControlVolumeFace< i > &scvfI, const SubControlVolume< i > &scvI, const SubControlVolume< j > &scvJ, const VolumeVariables< i > &volVarsI, const VolumeVariables< j > &volVarsJ, const DiffusionCoefficientAveragingType diffCoeffAvgType) const
Returns the conductive energy flux across the interface.
Definition: couplingconditions_staggered_cctpfa.hh:256
static constexpr auto couplingCompIdx(Dune::index_constant< i > id, int coupledCompIdx)
Returns the corresponding component index needed for coupling.
Definition: couplingconditions_staggered_cctpfa.hh:146
static constexpr auto couplingPhaseIdx(Dune::index_constant< i > id, int coupledPhaseIdx=0)
Returns the corresponding phase index needed for coupling.
Definition: couplingconditions_staggered_cctpfa.hh:139
static Scalar computeCouplingPhasePressureAtInterface_(const FVElementGeometry< porousMediumIndex > &fvGeometry, const SubControlVolumeFace< porousMediumIndex > &scvf, const VolumeVariables< porousMediumIndex > &volVars, const typename Element< freeFlowMomentumIndex >::Geometry::GlobalCoordinate &gravity, const typename Element< freeFlowMomentumIndex >::Geometry::GlobalCoordinate &couplingPhaseVelocity, DarcysLaw)
Returns the pressure at the interface using Darcy's law for reconstruction.
Definition: couplingconditions_staggered_cctpfa.hh:312
static auto darcyPermeability(const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf, const Context &context)
Returns the intrinsic permeability of the coupled Darcy element.
Definition: couplingconditions_staggered_cctpfa.hh:153
Definition: couplingconditions_staggered_cctpfa.hh:72
forward declare
Definition: forchheimerslaw_fwd.hh:27
Defines all properties used in Dumux.
Darcy's law specialized for different discretization schemes This file contains the data which is req...
Fick's law specialized for different discretization schemes. This file contains the data which is req...
Forchheimer's law specialized for different discretization schemes This file contains the data which ...
Tensor::field_type computeTpfaTransmissibility(const FVElementGeometry &fvGeometry, const typename FVElementGeometry::SubControlVolumeFace &scvf, const typename FVElementGeometry::SubControlVolume &scv, const Tensor &T, typename FVElementGeometry::SubControlVolume::Traits::Scalar extrusionFactor)
Free function to evaluate the Tpfa transmissibility associated with the flux (in the form of flux = T...
Definition: tpfa/computetransmissibility.hh:36
constexpr Scalar harmonicMean(Scalar x, Scalar y, Scalar wx=1.0, Scalar wy=1.0) noexcept
Calculate the (weighted) harmonic mean of two scalar values.
Definition: math.hh:57
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:851
constexpr Scalar arithmeticMean(Scalar x, Scalar y, Scalar wx=1.0, Scalar wy=1.0) noexcept
Calculate the (weighted) arithmetic mean of two scalar values.
Definition: math.hh:38
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
Index helpers for the free-flow/porous-medium-flow coupling.
Define some often used mathematical functions.
Traits for the free-flow/porous-medium-flow coupling.
static constexpr auto freeFlowMassIndex
Definition: multidomain/boundary/freeflowporenetwork/couplingmanager.hh:35
static constexpr auto freeFlowMomentumIndex
Definition: multidomain/boundary/freeflowporenetwork/couplingmanager.hh:34
Definition: adapt.hh:17
Helper struct to choose the correct index for phases and components. This is need if the porous-mediu...
Definition: indexhelper.hh:30
This structs helps to check if the two sub models use the same fluidsystem. Specialization for the ca...
Definition: multidomain/boundary/freeflowporousmedium/traits.hh:30
This structs holds a set of options which allow to modify the Stokes-Darcy coupling mechanism during ...
Definition: couplingconditions_staggered_cctpfa.hh:40
static DiffusionCoefficientAveragingType stringToEnum(DiffusionCoefficientAveragingType, const std::string &diffusionCoefficientAveragingType)
Convenience function to convert user input given as std::string to the corresponding enum class used ...
Definition: couplingconditions_staggered_cctpfa.hh:55
DiffusionCoefficientAveragingType
Defines which kind of averanging of diffusion coefficients (moleculat diffusion or thermal conductanc...
Definition: couplingconditions_staggered_cctpfa.hh:47
Free functions to evaluate the transmissibilities associated with flux evaluations across sub-control...