version 3.11-dev
Loading...
Searching...
No Matches
couplingmanager_cvfe_cvfe.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-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12
13#ifndef DUMUX_MULTIDOMAIN_BOUNDARY_FREEFLOW_POROUSMEDIUM_COUPLINGMANAGER_CVFE_CVFE_HH
14#define DUMUX_MULTIDOMAIN_BOUNDARY_FREEFLOW_POROUSMEDIUM_COUPLINGMANAGER_CVFE_CVFE_HH
15
16#include <algorithm>
17#include <array>
18#include <deque>
19#include <iostream>
20#include <type_traits>
21#include <utility>
22#include <vector>
23
24#include <dune/common/exceptions.hh>
25#include <dune/common/hybridutilities.hh>
26#include <dune/common/timer.hh>
27
28#include <dumux/common/concepts/variables_.hh>
32#include <dumux/io/format.hh>
36
39
40namespace Dumux {
41
42#ifndef DOXYGEN
43namespace Detail {
44
48template<class MDTraits, class MomentumGridDiscretization, class Element>
49auto interfaceVelocityQuadratureRule(const MomentumGridDiscretization& momentumGridDiscretization,
50 const Element& element)
51{
52 if constexpr (requires { typename MDTraits::InterfaceVelocityQuadratureRule; })
53 return typename MDTraits::InterfaceVelocityQuadratureRule{};
54 else
55 {
56 const auto order = momentumGridDiscretization.feCache().get(element.type()).localBasis().order();
57 return QuadratureRules::DuneQuadratureOfOrder(order);
58 }
59}
60
61} // end namespace Detail
62#endif
63
69template<class MDTraits>
72{
74
75 using Scalar = typename MDTraits::Scalar;
76
77 // the sub domain type tags
78 template<std::size_t id>
79 using SubDomainTypeTag = typename MDTraits::template SubDomain<id>::TypeTag;
80
81 template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>;
82 template<std::size_t id> using GridDiscretization = GetPropType<SubDomainTypeTag<id>, Properties::GridGeometry>;
83 template<std::size_t id> using ElementDiscretization = typename GridDiscretization<id>::LocalView;
84 template<std::size_t id> using SubControlVolumeFace = SubControlVolumeFace_t<ElementDiscretization<id>>;
85 template<std::size_t id> using SubControlVolume = SubControlVolume_t<ElementDiscretization<id>>;
86 template<std::size_t id> using GridVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>;
87 template<std::size_t id> using GridVariablesCache = Concept::GridVariablesCache_t<GridVariables<id>>;
88 template<std::size_t id> using ElementVariables = typename GridVariablesCache<id>::LocalView;
89
90 template<std::size_t id> using GridView = typename GridDiscretization<id>::GridView;
91 template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity;
92 template<std::size_t id> using ElementSeed = typename GridView<id>::Grid::template Codim<0>::EntitySeed;
93 using SolutionVector = typename MDTraits::SolutionVector;
94
96
97public:
101
108 template<std::size_t i, std::size_t j>
109 auto massCouplingCondition(Dune::index_constant<i> domainI, Dune::index_constant<j> domainJ,
110 const ElementDiscretization<i>& elemDisc,
111 const SubControlVolumeFace<i>& scvf,
112 const ElementVariables<i>& elemVars) const
113 {
114 static_assert(domainI != freeFlowMomentumIndex && domainJ != freeFlowMomentumIndex);
115
116 const auto& couplingContext = this->subApply(domainI, domainJ, [&](const auto& cm, auto&& ii, auto&& jj) {
117 return cm.couplingContext(ii, elemDisc, ipData(elemDisc, scvf));
118 });
119
120 const auto& outsideElemDisc = couplingContext.elemDisc;
121 const auto& ffMassElemDisc = [&]() -> const auto& {
122 if constexpr (i == porousMediumIndex)
123 return outsideElemDisc;
124 else
125 return elemDisc;
126 }();
127
128 using VelocityVector = typename GridDiscretization<freeFlowMomentumIndex>::GlobalCoordinate;
129 VelocityVector intVelocity(0.0);
130 // We apply the velocity-related quadrature rule
131 const auto velocityQuadratureRule = Detail::interfaceVelocityQuadratureRule<MDTraits>(
132 Dumux::gridDiscretization(this->problem(freeFlowMomentumIndex)), ffMassElemDisc.element()
133 );
134 for (const auto& qpData : CVFE::quadratureRule(elemDisc, scvf, velocityQuadratureRule))
135 {
136 const auto& faceIpData = qpData.ipData();
137 const auto ffMassFaceIpData = ipData(ffMassElemDisc, faceIpData.global());
138 intVelocity += qpData.weight()
139 * this->subCouplingManager(freeFlowMomentumIndex, freeFlowMassIndex).velocity(ffMassElemDisc, ffMassFaceIpData);
140 }
141
142 // For the densities we interpolate at the interpolation point and do not use a quadrature rule
143 const auto& ip = ipData(elemDisc, scvf);
144 const auto& outsideIp = ipData(outsideElemDisc, ip.global());
145 Scalar insideDensity = CouplingConditions::density(elemDisc, elemVars, ip);
146 Scalar outsideDensity = CouplingConditions::density(outsideElemDisc, couplingContext, outsideIp);
147
148 const auto normalIntVelocity = intVelocity * scvf.unitOuterNormal();
149 const bool insideIsUpstream = normalIntVelocity > 0.0;
150 return CouplingConditions::advectiveFlux(insideDensity, outsideDensity, normalIntVelocity, insideIsUpstream);
151 }
152
157 template<std::size_t i, std::size_t j, class FaceIpData>
158 requires requires (const FaceIpData& ipData) { ipData.global(); ipData.unitOuterNormal(); }
159 auto massCouplingCondition(Dune::index_constant<i> domainI, Dune::index_constant<j> domainJ,
160 const ElementDiscretization<i>& elemDisc,
161 const FaceIpData& faceIpData,
162 const ElementVariables<i>& elemVars) const
163 {
164 static_assert(domainI != freeFlowMomentumIndex && domainJ != freeFlowMomentumIndex);
165
166 const auto& couplingContext = this->subApply(domainI, domainJ, [&](const auto& cm, auto&& ii, auto&& jj) {
167 return cm.couplingContext(ii, elemDisc, faceIpData);
168 });
169
170 const auto& outsideElemDisc = couplingContext.elemDisc;
171 const auto& ffMassElemDisc = [&]() -> const auto& {
172 if constexpr (i == porousMediumIndex)
173 return outsideElemDisc;
174 else
175 return elemDisc;
176 }();
177
178 const auto ffMassFaceIpData = ipData(ffMassElemDisc, faceIpData.global());
180 ffMassElemDisc, ffMassFaceIpData
181 );
182
183 const Scalar density = CouplingConditions::density(elemDisc, elemVars, faceIpData);
184 return density * (velocity * faceIpData.unitOuterNormal());
185 }
186
189 template<class FaceIpData>
190 Scalar pmPressure(Dune::index_constant<freeFlowMomentumIndex> domainI,
191 Dune::index_constant<porousMediumIndex> domainJ,
192 const ElementDiscretization<freeFlowMomentumIndex>& elemDisc,
193 const ElementVariables<freeFlowMomentumIndex>& elemVars,
194 const FaceIpData& faceIpData) const
195 {
196 const auto& context = this->subCouplingManager(freeFlowMomentumIndex, porousMediumIndex).couplingContext(
197 domainI, elemDisc, faceIpData
198 );
199
200 return CouplingConditions::pressure(context.elemDisc, context, ipData(context.elemDisc, faceIpData.global()));
201 }
202
206 template<class FaceIpData>
207 auto darcyPermeability(const ElementDiscretization<freeFlowMomentumIndex>& elemDisc,
208 const FaceIpData& faceIpData) const
209 {
210 const auto& context = this->subCouplingManager(freeFlowMomentumIndex, porousMediumIndex).couplingContext(
211 Dune::index_constant<freeFlowMomentumIndex>(), elemDisc, faceIpData
212 );
213
214 return CouplingConditions::darcyPermeability(elemDisc, faceIpData, context);
215 }
216
221 template<class FaceIpData>
222 auto darcyVelocity(const ElementDiscretization<freeFlowMomentumIndex>& elemDisc,
223 const FaceIpData& faceIpData) const
224 {
225 const auto& context = this->subCouplingManager(freeFlowMomentumIndex, porousMediumIndex).couplingContext(
226 Dune::index_constant<freeFlowMomentumIndex>(), elemDisc, faceIpData
227 );
228
229 return CouplingConditions::darcyVelocity(context, ipData(context.elemDisc, faceIpData.global()));
230 }
231
234
238 Scalar pressure(const Element<freeFlowMomentumIndex>& element,
239 const ElementDiscretization<freeFlowMomentumIndex>& elemDisc,
240 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf) const
241 {
243 element, elemDisc, scvf
244 );
245 }
246
250 template <class IpData>
251 Scalar pressure(const Element<freeFlowMomentumIndex>& element,
252 const ElementDiscretization<freeFlowMomentumIndex>& elemDisc,
253 const IpData& ipData,
254 const bool considerPreviousTimeStep = false) const
255 {
257 element, elemDisc, ipData, considerPreviousTimeStep
258 );
259 }
260
264 Scalar density(const Element<freeFlowMomentumIndex>& element,
265 const ElementDiscretization<freeFlowMomentumIndex>& elemDisc,
266 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf,
267 const bool considerPreviousTimeStep = false) const
268 {
270 element, elemDisc, scvf, considerPreviousTimeStep
271 );
272 }
273
277 template <class IpData>
278 Scalar density(const Element<freeFlowMomentumIndex>& element,
279 const ElementDiscretization<freeFlowMomentumIndex>& elemDisc,
280 const IpData& ipData,
281 const bool considerPreviousTimeStep = false) const
282 {
284 element, elemDisc, ipData, considerPreviousTimeStep
285 );
286 }
287
291 auto insideAndOutsideDensity(const Element<freeFlowMomentumIndex>& element,
292 const ElementDiscretization<freeFlowMomentumIndex>& elemDisc,
293 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf,
294 const bool considerPreviousTimeStep = false) const
295 {
296 return this->subCouplingManager(freeFlowMomentumIndex, freeFlowMassIndex).insideAndOutsideDensity(
297 element, elemDisc, scvf, considerPreviousTimeStep
298 );
299 }
300
304 Scalar density(const Element<freeFlowMomentumIndex>& element,
305 const ElementDiscretization<freeFlowMomentumIndex>& elemDisc,
306 const SubControlVolume<freeFlowMomentumIndex>& scv,
307 const bool considerPreviousTimeStep = false) const
308 {
310 element, elemDisc, scv, considerPreviousTimeStep
311 );
312 }
313
317 Scalar effectiveViscosity(const Element<freeFlowMomentumIndex>& element,
318 const ElementDiscretization<freeFlowMomentumIndex>& elemDisc,
319 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf) const
320 {
321 return this->subCouplingManager(freeFlowMomentumIndex, freeFlowMassIndex).effectiveViscosity(
322 element, elemDisc, scvf
323 );
324 }
325
329 template <class IpData>
330 Scalar effectiveViscosity(const Element<freeFlowMomentumIndex>& element,
331 const ElementDiscretization<freeFlowMomentumIndex>& elemDisc,
332 const IpData& ipData,
333 const bool considerPreviousTimeStep = false) const
334 {
335 return this->subCouplingManager(freeFlowMomentumIndex, freeFlowMassIndex).effectiveViscosity(
336 element, elemDisc, ipData, considerPreviousTimeStep
337 );
338 }
339
343 template<class IpData>
344 Scalar velocityDivergence(const ElementDiscretization<freeFlowMassIndex>& elemDisc,
345 const IpData& ipData,
346 const bool considerPreviousTimeStep = false) const
347 {
348 return this->subCouplingManager(freeFlowMomentumIndex, freeFlowMassIndex).velocityDivergence(
349 elemDisc, ipData, considerPreviousTimeStep
350 );
351 }
352
356 auto faceVelocity(const Element<freeFlowMassIndex>& element,
357 const SubControlVolumeFace<freeFlowMassIndex>& scvf) const
358 {
360 element, scvf
361 );
362 }
363
367 template <class IpData>
368 auto velocity(const ElementDiscretization<freeFlowMassIndex>& elemDisc,
369 const IpData& ipData) const
370 {
372 elemDisc, ipData
373 );
374 }
375
379 auto elementVelocity(const ElementDiscretization<freeFlowMassIndex>& elemDisc) const
380 {
381 return this->subCouplingManager(freeFlowMomentumIndex, freeFlowMassIndex).elementVelocity(
382 elemDisc
383 );
384 }
385
395 {
396 elementSets_ = computeColoring_(std::index_sequence<freeFlowMomentumIndex, freeFlowMassIndex>{});
397 elementSetsPM_ = computeColoring_(std::index_sequence<porousMediumIndex>{});
398 }
399
406 template<std::size_t i, class AssembleElementFunc>
407 void assembleMultithreaded(Dune::index_constant<i> domainId, AssembleElementFunc&& assembleElement) const
408 {
409 if constexpr (i == porousMediumIndex)
410 {
411 if (elementSetsPM_.empty())
412 DUNE_THROW(Dune::InvalidStateException, "Call computeColorsForAssembly before assembling in parallel!");
413
414 const auto& grid = Dumux::gridDiscretization(this->problem(porousMediumIndex)).gridView().grid();
415 for (const auto& elements : elementSetsPM_)
416 {
417 Dumux::parallelFor(elements.size(), [&](const std::size_t eIdx)
418 {
419 const auto element = grid.entity(elements[eIdx]);
420 assembleElement(element);
421 });
422 }
423 }
424 else
425 {
426 if (elementSets_.empty())
427 DUNE_THROW(Dune::InvalidStateException, "Call computeColorsForAssembly before assembling in parallel!");
428
429 const auto& grid = Dumux::gridDiscretization(this->problem(freeFlowMomentumIndex)).gridView().grid();
430 for (const auto& elements : elementSets_)
431 {
432 Dumux::parallelFor(elements.size(), [&](const std::size_t eIdx)
433 {
434 const auto element = grid.entity(elements[eIdx]);
435 assembleElement(element);
436 });
437 }
438 }
439 }
440
441private:
447 template<std::size_t i, std::size_t... is>
448 auto computeColoring_(std::index_sequence<i, is...> assembledDomains) const
449 {
450 Dune::Timer timer;
451
452 static constexpr std::size_t numSubDomains = MDTraits::numSubDomains;
453 std::array<std::size_t, numSubDomains+1> dofOffset{};
454 Dune::Hybrid::forEach(std::make_index_sequence<numSubDomains>{}, [&](auto domainJ)
455 { dofOffset[domainJ+1] = dofOffset[domainJ] + Dumux::gridDiscretization(this->problem(domainJ)).numDofs(); });
456
457 const auto& gridDiscretization = Dumux::gridDiscretization(this->problem(Dune::index_constant<i>{}));
458 const auto& gridView = gridDiscretization.gridView();
459 const auto& elementMapper = gridDiscretization.elementMapper();
460
461 // the touched degrees of freedom of each element, numbered consecutively over all domains
462 std::vector<std::vector<std::size_t>> touchedDofs(gridView.size(0));
463 for (const auto& element : elements(gridView))
464 {
465 auto& dofs = touchedDofs[elementMapper.index(element)];
466 Dune::Hybrid::forEach(assembledDomains, [&](auto domainI)
467 {
468 const auto elemDisc = localView(Dumux::gridDiscretization(this->problem(domainI))).bindElement(element);
469 for (const auto& localDof : localDofs(elemDisc))
470 dofs.push_back(dofOffset[domainI] + localDof.dofIndex());
471
472 Dune::Hybrid::forEach(std::make_index_sequence<numSubDomains>{}, [&](auto domainJ)
473 {
474 if constexpr (decltype(domainJ)::value != std::decay_t<decltype(domainI)>::value)
475 for (const auto dofJ : this->couplingStencil(domainI, element, domainJ))
476 dofs.push_back(dofOffset[domainJ] + dofJ);
477 });
478 });
479
480 std::sort(dofs.begin(), dofs.end());
481 dofs.erase(std::unique(dofs.begin(), dofs.end()), dofs.end());
482 }
483
484 std::vector<std::vector<std::size_t>> elementsTouchingDof(dofOffset.back());
485 for (std::size_t eIdx = 0; eIdx < touchedDofs.size(); ++eIdx)
486 for (const auto dof : touchedDofs[eIdx])
487 elementsTouchingDof[dof].push_back(eIdx);
488
489 std::deque<std::vector<ElementSeed<i>>> sets;
490 std::vector<int> colors(gridView.size(0), -1);
491 std::vector<int> neighborColors;
492 std::vector<bool> colorUsed;
493 for (const auto& element : elements(gridView))
494 {
495 const auto eIdx = elementMapper.index(element);
496 neighborColors.clear();
497 for (const auto dof : touchedDofs[eIdx])
498 for (const auto nIdx : elementsTouchingDof[dof])
499 neighborColors.push_back(colors[nIdx]);
500
501 const auto color = Detail::smallestAvailableColor(neighborColors, colorUsed);
502 colors[eIdx] = color;
503 if (color < sets.size())
504 sets[color].push_back(element.seed());
505 else
506 sets.push_back(std::vector<ElementSeed<i>>{ element.seed() });
507 }
508
509 std::cout << Fmt::format("Colored {} elements with {} colors in {} seconds.\n",
510 gridView.size(0), sets.size(), timer.elapsed());
511
512 return sets;
513 }
514
515 std::deque<std::vector<ElementSeed<freeFlowMomentumIndex>>> elementSets_;
516 std::deque<std::vector<ElementSeed<porousMediumIndex>>> elementSetsPM_;
517};
518
519template<class T>
523
524} // end namespace Dumux
525
526#endif
Traits shared by the multi-domain assemblers.
Base coupling manager for coupling freeflow and porous medium flow models.
Definition couplingmanager_base.hh:147
static constexpr auto porousMediumIndex
Definition couplingmanager_base.hh:184
static constexpr auto freeFlowMassIndex
Definition couplingmanager_base.hh:183
const auto & couplingStencil(Dune::index_constant< freeFlowMomentumIndex > domainI, const Element< freeFlowMomentumIndex > &elementI, const SubControlVolume< freeFlowMomentumIndex > &scvI, Dune::index_constant< j > domainJ) const
returns an iterable container of all indices of degrees of freedom of domain j that couple with / inf...
Definition couplingmanager_base.hh:292
const Problem< i > & problem(Dune::index_constant< i > domainI) const
Definition couplingmanager_base.hh:230
static constexpr auto freeFlowMomentumIndex
Definition couplingmanager_base.hh:182
Coupling manager for coupling free flow and porous medium flow models, all discretized with control-v...
Definition couplingmanager_cvfe_cvfe.hh:72
void computeColorsForAssembly()
Compute colors for multithreaded assembly.
Definition couplingmanager_cvfe_cvfe.hh:394
auto insideAndOutsideDensity(const Element< freeFlowMomentumIndex > &element, const ElementDiscretization< freeFlowMomentumIndex > &elemDisc, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf, const bool considerPreviousTimeStep=false) const
Returns the inside and outside densities at a given sub control volume face.
Definition couplingmanager_cvfe_cvfe.hh:291
Scalar density(const Element< freeFlowMomentumIndex > &element, const ElementDiscretization< freeFlowMomentumIndex > &elemDisc, const IpData &ipData, const bool considerPreviousTimeStep=false) const
Returns the density at a given interpolation point.
Definition couplingmanager_cvfe_cvfe.hh:278
Scalar pmPressure(Dune::index_constant< freeFlowMomentumIndex > domainI, Dune::index_constant< porousMediumIndex > domainJ, const ElementDiscretization< freeFlowMomentumIndex > &elemDisc, const ElementVariables< freeFlowMomentumIndex > &elemVars, const FaceIpData &faceIpData) const
Definition couplingmanager_cvfe_cvfe.hh:190
void assembleMultithreaded(Dune::index_constant< i > domainId, AssembleElementFunc &&assembleElement) const
Execute assembly kernel in parallel.
Definition couplingmanager_cvfe_cvfe.hh:407
auto massCouplingCondition(Dune::index_constant< i > domainI, Dune::index_constant< j > domainJ, const ElementDiscretization< i > &elemDisc, const SubControlVolumeFace< i > &scvf, const ElementVariables< i > &elemVars) const
Returns the mass flux across the coupling boundary.
Definition couplingmanager_cvfe_cvfe.hh:109
auto massCouplingCondition(Dune::index_constant< i > domainI, Dune::index_constant< j > domainJ, const ElementDiscretization< i > &elemDisc, const FaceIpData &faceIpData, const ElementVariables< i > &elemVars) const
Returns the mass flux across the coupling boundary at an interpolation point.
Definition couplingmanager_cvfe_cvfe.hh:159
auto velocity(const ElementDiscretization< freeFlowMassIndex > &elemDisc, const IpData &ipData) const
Returns the velocity at an interpolation point.
Definition couplingmanager_cvfe_cvfe.hh:368
Scalar density(const Element< freeFlowMomentumIndex > &element, const ElementDiscretization< freeFlowMomentumIndex > &elemDisc, const SubControlVolume< freeFlowMomentumIndex > &scv, const bool considerPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition couplingmanager_cvfe_cvfe.hh:304
auto faceVelocity(const Element< freeFlowMassIndex > &element, const SubControlVolumeFace< freeFlowMassIndex > &scvf) const
Returns the velocity at a given sub control volume face.
Definition couplingmanager_cvfe_cvfe.hh:356
Scalar pressure(const Element< freeFlowMomentumIndex > &element, const ElementDiscretization< freeFlowMomentumIndex > &elemDisc, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf) const
Returns the pressure at a given sub control volume face.
Definition couplingmanager_cvfe_cvfe.hh:238
Scalar pressure(const Element< freeFlowMomentumIndex > &element, const ElementDiscretization< freeFlowMomentumIndex > &elemDisc, const IpData &ipData, const bool considerPreviousTimeStep=false) const
Returns the pressure at a given interpolation point.
Definition couplingmanager_cvfe_cvfe.hh:251
static constexpr auto freeFlowMomentumIndex
Definition couplingmanager_cvfe_cvfe.hh:98
static constexpr auto porousMediumIndex
Definition couplingmanager_cvfe_cvfe.hh:100
Scalar density(const Element< freeFlowMomentumIndex > &element, const ElementDiscretization< freeFlowMomentumIndex > &elemDisc, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf, const bool considerPreviousTimeStep=false) const
Returns the density at a given sub control volume face.
Definition couplingmanager_cvfe_cvfe.hh:264
Scalar effectiveViscosity(const Element< freeFlowMomentumIndex > &element, const ElementDiscretization< freeFlowMomentumIndex > &elemDisc, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf) const
Returns the effective viscosity at a given sub control volume face.
Definition couplingmanager_cvfe_cvfe.hh:317
auto elementVelocity(const ElementDiscretization< freeFlowMassIndex > &elemDisc) const
Returns the velocity at the element center.
Definition couplingmanager_cvfe_cvfe.hh:379
auto darcyVelocity(const ElementDiscretization< freeFlowMomentumIndex > &elemDisc, const FaceIpData &faceIpData) const
Returns the Darcy velocity of the coupled porous-medium element at a face interpolation point of the ...
Definition couplingmanager_cvfe_cvfe.hh:222
Scalar effectiveViscosity(const Element< freeFlowMomentumIndex > &element, const ElementDiscretization< freeFlowMomentumIndex > &elemDisc, const IpData &ipData, const bool considerPreviousTimeStep=false) const
Returns the effective viscosity at a interpolation point.
Definition couplingmanager_cvfe_cvfe.hh:330
Scalar velocityDivergence(const ElementDiscretization< freeFlowMassIndex > &elemDisc, const IpData &ipData, const bool considerPreviousTimeStep=false) const
Returns the divergence of the velocity at a given interpolation point.
Definition couplingmanager_cvfe_cvfe.hh:344
static constexpr auto freeFlowMassIndex
Definition couplingmanager_cvfe_cvfe.hh:99
auto darcyPermeability(const ElementDiscretization< freeFlowMomentumIndex > &elemDisc, const FaceIpData &faceIpData) const
Returns the intrinsic permeability of the coupled Darcy element.
Definition couplingmanager_cvfe_cvfe.hh:207
Coloring schemes for shared-memory-parallel assembly.
Coupling conditions for a Darcy model and a (Navier-)Stokes model, both discretized with control-volu...
Base class for coupling freeflow and porous medium flow models.
Formatting based on the fmt-library which implements std::format of C++20.
Type traits for classes providing a grid discretization.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition localview.hh:26
FFPMCouplingConditionsCvfeImpl< MDTraits, CouplingManager, GetPropType< typename MDTraits::template SubDomain< 0 >::TypeTag, Properties::ModelTraits >::enableEnergyBalance(),(GetPropType< typename MDTraits::template SubDomain< 0 >::TypeTag, Properties::ModelTraits >::numFluidComponents() > 1) > FFPMCouplingConditionsCvfe
Coupling conditions for a Darcy model and a (Navier-)Stokes model, both discretized with control-volu...
Definition couplingconditions_cvfe_cvfe.hh:44
@ element
Definition fieldtype.hh:23
void parallelFor(const std::size_t count, const FunctorType &functor)
A parallel for loop (multithreading).
Definition parallel_for.hh:160
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:296
decltype(auto) gridDiscretization(const T &t, Args &&... args)
The grid discretization.
Definition griddiscretization.hh:98
Dune::Std::detected_or_t< Detail::NoSubControlVolume, Detail::SpecifiedSubControlVolume, ElementDiscretization > SubControlVolume_t
The sub-control volume type of an element discretization, or a placeholder type for discretizations t...
Definition griddiscretization.hh:74
Dune::Std::detected_or_t< Detail::NoSubControlVolumeFace, Detail::SpecifiedSubControlVolumeFace, ElementDiscretization > SubControlVolumeFace_t
The sub-control volume face type of an element discretization, or a placeholder type for discretizati...
Definition griddiscretization.hh:85
Class representing dofs on elements for control-volume finite element schemes.
auto quadratureRule(const FVElementGeometry &fvGeometry, const typename FVElementGeometry::SubControlVolume &scv, QuadratureRules::MidpointQuadrature)
Midpoint quadrature for scv.
Definition quadraturerules.hh:171
Definition cvfelocalresidual.hh:25
Definition adapt.hh:17
auto localDofs(const FVElementGeometry &fvGeometry)
range over local dofs
Definition localdof.hh:50
Parallel for loop (multithreading).
Quadrature rules over sub-control volumes and sub-control volume faces.
Type trait that is specialized for coupling manager supporting multithreaded assembly.
Definition assemblytraits.hh:43