12#ifndef DUMUX_MULTIDOMAIN_FREEFLOW_COUPLING_MANAGER_PQ1BUBBLE_HH
13#define DUMUX_MULTIDOMAIN_FREEFLOW_COUPLING_MANAGER_PQ1BUBBLE_HH
15#warning "This file is deprecated and will be removed after 3.7. Use CVFEFreeFlowCouplingManager."
22#include <dune/common/exceptions.hh>
23#include <dune/common/indices.hh>
24#include <dune/common/float_cmp.hh>
25#include <dune/geometry/referenceelements.hh>
60 template<std::
size_t id>
using SubDomainTypeTag =
typename Traits::template SubDomain<id>::TypeTag;
63 template<std::
size_t id>
using GridView =
typename GridGeometry<id>::GridView;
64 template<std::
size_t id>
using Element =
typename GridView<id>::template Codim<0>::Entity;
65 template<std::
size_t id>
using ElementSeed =
typename GridView<id>::Grid::template Codim<0>::EntitySeed;
66 template<std::
size_t id>
using FVElementGeometry =
typename GridGeometry<id>::LocalView;
67 template<std::
size_t id>
using SubControlVolume =
typename FVElementGeometry<id>::SubControlVolume;
68 template<std::
size_t id>
using SubControlVolumeFace =
typename FVElementGeometry<id>::SubControlVolumeFace;
69 template<std::
size_t id>
using GridVariables =
typename Traits::template SubDomain<id>::GridVariables;
70 template<std::
size_t id>
using ElementVolumeVariables =
typename GridVariables<id>::GridVolumeVariables::LocalView;
71 template<std::
size_t id>
using GridFluxVariablesCache =
typename GridVariables<id>::GridFluxVariablesCache;
75 using Scalar =
typename Traits::Scalar;
76 using SolutionVector =
typename Traits::SolutionVector;
80 using GridVariablesTuple =
typename Traits::template TupleOfSharedPtr<GridVariables>;
82 using FluidSystem =
typename VolumeVariables<freeFlowMassIndex>::FluidSystem;
84 using VelocityVector =
typename SubControlVolumeFace<freeFlowMassIndex>::GlobalPosition;
85 using ShapeValue =
typename Dune::FieldVector<Scalar, 1>;
87 static_assert(std::is_same_v<VelocityVector, typename SubControlVolumeFace<freeFlowMomentumIndex>::GlobalPosition>);
89 struct MomentumCouplingContext
91 FVElementGeometry<freeFlowMassIndex> fvGeometry;
92 ElementVolumeVariables<freeFlowMassIndex> curElemVolVars;
93 ElementVolumeVariables<freeFlowMassIndex> prevElemVolVars;
97 struct MassAndEnergyCouplingContext
99 MassAndEnergyCouplingContext(FVElementGeometry<freeFlowMomentumIndex>&& f,
const std::size_t i)
100 : fvGeometry(std::move(f))
104 FVElementGeometry<freeFlowMomentumIndex> fvGeometry;
108 using MomentumDiscretizationMethod =
typename GridGeometry<freeFlowMomentumIndex>::DiscretizationMethod;
109 using MassDiscretizationMethod =
typename GridGeometry<freeFlowMassIndex>::DiscretizationMethod;
113 static constexpr auto pressureIdx = VolumeVariables<freeFlowMassIndex>::Indices::pressureIdx;
121 void init(std::shared_ptr<Problem<freeFlowMomentumIndex>> momentumProblem,
122 std::shared_ptr<Problem<freeFlowMassIndex>> massProblem,
123 GridVariablesTuple&& gridVariables,
124 const SolutionVector&
curSol)
126 this->
setSubProblems(std::make_tuple(momentumProblem, massProblem));
127 gridVariables_ = gridVariables;
130 computeCouplingStencils_();
134 void init(std::shared_ptr<Problem<freeFlowMomentumIndex>> momentumProblem,
135 std::shared_ptr<Problem<freeFlowMassIndex>> massProblem,
136 GridVariablesTuple&& gridVariables,
137 const SolutionVector&
curSol,
138 const SolutionVector& prevSol)
140 init(momentumProblem, massProblem, std::forward<GridVariablesTuple>(gridVariables),
curSol);
146 void init(std::shared_ptr<Problem<freeFlowMomentumIndex>> momentumProblem,
147 std::shared_ptr<Problem<freeFlowMassIndex>> massProblem,
148 GridVariablesTuple&& gridVariables,
151 this->
setSubProblems(std::make_tuple(momentumProblem, massProblem));
152 gridVariables_ = gridVariables;
155 computeCouplingStencils_();
168 Scalar
pressure(
const Element<freeFlowMomentumIndex>& element,
169 const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
170 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf,
171 const bool considerPreviousTimeStep =
false)
const
173 assert(!(considerPreviousTimeStep && !this->isTransient_));
184 Scalar
pressure(
const Element<freeFlowMomentumIndex>& element,
185 const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
186 const SubControlVolume<freeFlowMomentumIndex>& scv,
187 const bool considerPreviousTimeStep =
false)
const
189 assert(!(considerPreviousTimeStep && !this->isTransient_));
200 Scalar
density(
const Element<freeFlowMomentumIndex>& element,
201 const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
202 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf,
203 const bool considerPreviousTimeStep =
false)
const
205 assert(!(considerPreviousTimeStep && !this->isTransient_));
206 bindCouplingContext_(Dune::index_constant<freeFlowMomentumIndex>(), element, fvGeometry.elementIndex());
210 const auto eIdx = fvGeometry.elementIndex();
211 const auto& scv = this->momentumCouplingContext_()[0].fvGeometry.scv(eIdx);
213 const auto& volVars = considerPreviousTimeStep ?
214 this->momentumCouplingContext_()[0].prevElemVolVars[scv]
215 : this->momentumCouplingContext_()[0].curElemVolVars[scv];
217 return volVars.density();
223 using ShapeValue =
typename Dune::FieldVector<Scalar, 1>;
224 const auto& localBasis = this->momentumCouplingContext_()[0].fvGeometry.feLocalBasis();
225 std::vector<ShapeValue> shapeValues;
226 const auto ipLocal = element.geometry().local(scvf.ipGlobal());
227 localBasis.evaluateFunction(ipLocal, shapeValues);
230 for (
const auto& scv : scvs(this->momentumCouplingContext_()[0].fvGeometry))
232 const auto& volVars = considerPreviousTimeStep ?
233 this->momentumCouplingContext_()[0].prevElemVolVars[scv]
234 : this->momentumCouplingContext_()[0].curElemVolVars[scv];
235 rho += volVars.density()*shapeValues[scv.indexInElement()][0];
241 DUNE_THROW(Dune::NotImplemented,
242 "Density interpolation for discretization scheme " << MassDiscretizationMethod{}
249 Scalar
density(
const Element<freeFlowMomentumIndex>& element,
250 const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
251 const SubControlVolume<freeFlowMomentumIndex>& scv,
252 const bool considerPreviousTimeStep =
false)
const
254 assert(!(considerPreviousTimeStep && !this->isTransient_));
255 bindCouplingContext_(Dune::index_constant<freeFlowMomentumIndex>(), element, scv.elementIndex());
259 const auto eIdx = scv.elementIndex();
260 const auto& scvI = this->momentumCouplingContext_()[0].fvGeometry.scv(eIdx);
262 const auto& volVars = considerPreviousTimeStep ?
263 this->momentumCouplingContext_()[0].prevElemVolVars[scvI]
264 : this->momentumCouplingContext_()[0].curElemVolVars[scvI];
266 return volVars.density();
272 using ShapeValue =
typename Dune::FieldVector<Scalar, 1>;
273 const auto& localBasis = this->momentumCouplingContext_()[0].fvGeometry.feLocalBasis();
274 std::vector<ShapeValue> shapeValues;
275 const auto ipLocal = element.geometry().local(scv.dofPosition());
276 localBasis.evaluateFunction(ipLocal, shapeValues);
279 for (
const auto& scvI : scvs(this->momentumCouplingContext_()[0].fvGeometry))
281 const auto& volVars = considerPreviousTimeStep ?
282 this->momentumCouplingContext_()[0].prevElemVolVars[scvI]
283 : this->momentumCouplingContext_()[0].curElemVolVars[scvI];
284 rho += volVars.density()*shapeValues[scvI.indexInElement()][0];
289 DUNE_THROW(Dune::NotImplemented,
290 "Density interpolation for discretization scheme " << MassDiscretizationMethod{}
298 const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
299 const SubControlVolumeFace<freeFlowMomentumIndex>& scvf,
300 const bool considerPreviousTimeStep =
false)
const
302 assert(!(considerPreviousTimeStep && !this->isTransient_));
303 bindCouplingContext_(Dune::index_constant<freeFlowMomentumIndex>(), element, fvGeometry.elementIndex());
307 const auto eIdx = fvGeometry.elementIndex();
308 const auto& scv = this->momentumCouplingContext_()[0].fvGeometry.scv(eIdx);
309 const auto& volVars = considerPreviousTimeStep ?
310 this->momentumCouplingContext_()[0].prevElemVolVars[scv]
311 : this->momentumCouplingContext_()[0].curElemVolVars[scv];
312 return volVars.viscosity();
318 using ShapeValue =
typename Dune::FieldVector<Scalar, 1>;
319 const auto& localBasis = this->momentumCouplingContext_()[0].fvGeometry.feLocalBasis();
320 std::vector<ShapeValue> shapeValues;
321 const auto ipLocal = element.geometry().local(scvf.ipGlobal());
322 localBasis.evaluateFunction(ipLocal, shapeValues);
325 for (
const auto& scv : scvs(this->momentumCouplingContext_()[0].fvGeometry))
327 const auto& volVars = considerPreviousTimeStep ?
328 this->momentumCouplingContext_()[0].prevElemVolVars[scv]
329 : this->momentumCouplingContext_()[0].curElemVolVars[scv];
330 mu += volVars.viscosity()*shapeValues[scv.indexInElement()][0];
336 DUNE_THROW(Dune::NotImplemented,
337 "Viscosity interpolation for discretization scheme " << MassDiscretizationMethod{}
345 const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
346 const SubControlVolume<freeFlowMomentumIndex>& scv,
347 const bool considerPreviousTimeStep =
false)
const
349 assert(!(considerPreviousTimeStep && !this->isTransient_));
350 bindCouplingContext_(Dune::index_constant<freeFlowMomentumIndex>(), element, fvGeometry.elementIndex());
354 const auto eIdx = fvGeometry.elementIndex();
355 const auto& scvI = this->momentumCouplingContext_()[0].fvGeometry.scv(eIdx);
356 const auto& volVars = considerPreviousTimeStep ?
357 this->momentumCouplingContext_()[0].prevElemVolVars[scvI]
358 : this->momentumCouplingContext_()[0].curElemVolVars[scvI];
359 return volVars.viscosity();
365 using ShapeValue =
typename Dune::FieldVector<Scalar, 1>;
366 const auto& localBasis = this->momentumCouplingContext_()[0].fvGeometry.feLocalBasis();
367 std::vector<ShapeValue> shapeValues;
368 const auto ipLocal = element.geometry().local(scv.dofPosition());
369 localBasis.evaluateFunction(ipLocal, shapeValues);
372 for (
const auto& scvI : scvs(this->momentumCouplingContext_()[0].fvGeometry))
374 const auto& volVars = considerPreviousTimeStep ?
375 this->momentumCouplingContext_()[0].prevElemVolVars[scvI]
376 : this->momentumCouplingContext_()[0].curElemVolVars[scvI];
377 mu += volVars.viscosity()*shapeValues[scvI.indexInElement()][0];
383 DUNE_THROW(Dune::NotImplemented,
384 "Viscosity interpolation for discretization scheme " << MassDiscretizationMethod{}
392 const SubControlVolumeFace<freeFlowMassIndex>& scvf)
const
397 bindCouplingContext_(Dune::index_constant<freeFlowMassIndex>(), element, eIdx);
399 const auto& fvGeometry = this->massAndEnergyCouplingContext_()[0].fvGeometry;
400 const auto& localBasis = fvGeometry.feLocalBasis();
402 std::vector<ShapeValue> shapeValues;
403 const auto ipLocal = element.geometry().local(scvf.ipGlobal());
404 localBasis.evaluateFunction(ipLocal, shapeValues);
407 VelocityVector velocity(0.0);
408 for (
const auto& scv : scvs(fvGeometry))
409 velocity.axpy(shapeValues[scv.localDofIndex()][0], this->curSol(
freeFlowMomentumIndex)[scv.dofIndex()]);
417 VelocityVector
elementVelocity(
const FVElementGeometry<freeFlowMassIndex>& fvGeometry)
const
419 bindCouplingContext_(Dune::index_constant<freeFlowMassIndex>(), fvGeometry.element());
421 const auto& momentumFvGeometry = this->massAndEnergyCouplingContext_()[0].fvGeometry;
422 const auto& localBasis = momentumFvGeometry.feLocalBasis();
425 VelocityVector velocity(0.0);
426 std::vector<ShapeValue> shapeValues;
427 localBasis.evaluateFunction(referenceElement(fvGeometry.element()).position(0,0), shapeValues);
429 for (
const auto& scv : scvs(momentumFvGeometry))
430 velocity.axpy(shapeValues[scv.localDofIndex()][0], this->curSol(
freeFlowMomentumIndex)[scv.dofIndex()]);
439 template<std::
size_t j>
441 const Element<freeFlowMomentumIndex>& elementI,
442 const SubControlVolume<freeFlowMomentumIndex>& scvI,
443 Dune::index_constant<j> domainJ)
const
444 {
return emptyStencil_; }
461 const Element<freeFlowMassIndex>& elementI,
462 Dune::index_constant<freeFlowMomentumIndex> domainJ)
const
465 return massAndEnergyToMomentumStencils_[eIdx];
477 const Element<freeFlowMomentumIndex>& elementI,
478 Dune::index_constant<freeFlowMassIndex> domainJ)
const
481 return momentumToMassAndEnergyStencils_[eIdx];
510 template<std::
size_t i, std::
size_t j,
class LocalAssemblerI>
512 const LocalAssemblerI& localAssemblerI,
513 Dune::index_constant<j> domainJ,
514 std::size_t dofIdxGlobalJ,
515 const PrimaryVariables<j>& priVarsJ,
518 this->
curSol(domainJ)[dofIdxGlobalJ][pvIdxJ] = priVarsJ[pvIdxJ];
524 bindCouplingContext_(domainI, localAssemblerI.element());
527 const auto& deflectedElement =
problem.gridGeometry().element(dofIdxGlobalJ);
529 const auto& fvGeometry = momentumCouplingContext_()[0].fvGeometry;
530 const auto& scv = fvGeometry.scv(dofIdxGlobalJ);
532 if constexpr (ElementVolumeVariables<freeFlowMassIndex>::GridVolumeVariables::cachingEnabled)
533 gridVars_(
freeFlowMassIndex).curGridVolVars().volVars(scv).update(std::move(elemSol),
problem, deflectedElement, scv);
535 momentumCouplingContext_()[0].curElemVolVars[scv].update(std::move(elemSol),
problem, deflectedElement, scv);
543 bindCouplingContext_(domainI, localAssemblerI.element());
546 const auto& deflectedElement =
problem.gridGeometry().element(this->momentumCouplingContext_()[0].eIdx);
548 const auto& fvGeometry = this->momentumCouplingContext_()[0].fvGeometry;
550 for (
const auto& scv : scvs(fvGeometry))
552 if(scv.dofIndex() == dofIdxGlobalJ)
554 if constexpr (ElementVolumeVariables<freeFlowMassIndex>::GridVolumeVariables::cachingEnabled)
555 this->gridVars_(
freeFlowMassIndex).curGridVolVars().volVars(scv).update(std::move(elemSol),
problem, deflectedElement, scv);
557 this->momentumCouplingContext_()[0].curElemVolVars[scv].update(std::move(elemSol),
problem, deflectedElement, scv);
563 DUNE_THROW(Dune::NotImplemented,
564 "Context update for discretization scheme " << MassDiscretizationMethod{}
585 template<std::
size_t i,
class AssembleElementFunc>
588 if (elementSets_.empty())
589 DUNE_THROW(Dune::InvalidStateException,
"Call computeColorsForAssembly before assembling in parallel!");
596 for (
const auto& elements : elementSets_)
600 const auto element = grid.entity(elements[eIdx]);
601 assembleElement(element);
607 void bindCouplingContext_(Dune::index_constant<freeFlowMomentumIndex> domainI,
608 const Element<freeFlowMomentumIndex>& elementI)
const
611 if (momentumCouplingContext_().empty())
614 bindCouplingContext_(domainI, elementI, momentumCouplingContext_()[0].fvGeometry.gridGeometry().elementMapper().index(elementI));
617 void bindCouplingContext_(Dune::index_constant<freeFlowMomentumIndex> domainI,
618 const Element<freeFlowMomentumIndex>& elementI,
619 const std::size_t eIdx)
const
621 if (momentumCouplingContext_().empty())
624 fvGeometry.bind(elementI);
633 prevElemVolVars.bindElement(elementI, fvGeometry, (*prevSol_)[
freeFlowMassIndex]);
635 momentumCouplingContext_().emplace_back(MomentumCouplingContext{std::move(fvGeometry), std::move(curElemVolVars), std::move(prevElemVolVars), eIdx});
637 else if (eIdx != momentumCouplingContext_()[0].eIdx)
639 momentumCouplingContext_()[0].eIdx = eIdx;
640 momentumCouplingContext_()[0].fvGeometry.bind(elementI);
641 momentumCouplingContext_()[0].curElemVolVars.bind(elementI, momentumCouplingContext_()[0].fvGeometry, this->
curSol(freeFlowMassIndex));
644 momentumCouplingContext_()[0].prevElemVolVars.bindElement(elementI, momentumCouplingContext_()[0].fvGeometry, (*prevSol_)[
freeFlowMassIndex]);
648 void bindCouplingContext_(Dune::index_constant<freeFlowMassIndex> domainI,
649 const Element<freeFlowMassIndex>& elementI)
const
652 if (massAndEnergyCouplingContext_().empty())
653 bindCouplingContext_(domainI, elementI, this->
problem(freeFlowMassIndex).gridGeometry().elementMapper().index(elementI));
655 bindCouplingContext_(domainI, elementI, massAndEnergyCouplingContext_()[0].fvGeometry.gridGeometry().elementMapper().index(elementI));
658 void bindCouplingContext_(Dune::index_constant<freeFlowMassIndex> domainI,
659 const Element<freeFlowMassIndex>& elementI,
660 const std::size_t eIdx)
const
662 if (massAndEnergyCouplingContext_().empty())
665 auto fvGeometry =
localView(gridGeometry);
666 fvGeometry.bindElement(elementI);
667 massAndEnergyCouplingContext_().emplace_back(std::move(fvGeometry), eIdx);
669 else if (eIdx != massAndEnergyCouplingContext_()[0].eIdx)
671 massAndEnergyCouplingContext_()[0].eIdx = eIdx;
672 massAndEnergyCouplingContext_()[0].fvGeometry.bindElement(elementI);
680 template<std::
size_t i>
681 const GridVariables<i>& gridVars_(Dune::index_constant<i> domainIdx)
const
683 if (std::get<i>(gridVariables_))
684 return *std::get<i>(gridVariables_);
686 DUNE_THROW(Dune::InvalidStateException,
"The gridVariables pointer was not set. Use setGridVariables() before calling this function");
693 template<std::
size_t i>
694 GridVariables<i>& gridVars_(Dune::index_constant<i> domainIdx)
696 if (std::get<i>(gridVariables_))
697 return *std::get<i>(gridVariables_);
699 DUNE_THROW(Dune::InvalidStateException,
"The gridVariables pointer was not set. Use setGridVariables() before calling this function");
703 void computeCouplingStencils_()
706 const auto& massGridGeometry = this->
problem(freeFlowMassIndex).gridGeometry();
707 auto momentumFvGeometry =
localView(momentumGridGeometry);
708 auto massFvGeometry =
localView(massGridGeometry);
710 massAndEnergyToMomentumStencils_.clear();
711 massAndEnergyToMomentumStencils_.resize(massGridGeometry.gridView().size(0));
713 momentumToMassAndEnergyStencils_.clear();
714 momentumToMassAndEnergyStencils_.resize(momentumGridGeometry.gridView().size(0));
716 assert(massAndEnergyToMomentumStencils_.size() == momentumToMassAndEnergyStencils_.size());
718 for (
const auto& element : elements(momentumGridGeometry.gridView()))
720 momentumFvGeometry.bindElement(element);
721 massFvGeometry.bindElement(element);
722 const auto eIdx = momentumFvGeometry.elementIndex();
724 for (
const auto& scv : scvs(momentumFvGeometry))
725 massAndEnergyToMomentumStencils_[eIdx].push_back(scv.dofIndex());
727 for (
const auto& scv : scvs(massFvGeometry))
728 momentumToMassAndEnergyStencils_[eIdx].push_back(scv.dofIndex());
732 CouplingStencilType emptyStencil_;
733 std::vector<CouplingStencilType> momentumToMassAndEnergyStencils_;
734 std::vector<CouplingStencilType> massAndEnergyToMomentumStencils_;
739 std::vector<MomentumCouplingContext>& momentumCouplingContext_()
const
741 thread_local static std::vector<MomentumCouplingContext> c;
746 std::vector<MassAndEnergyCouplingContext>& massAndEnergyCouplingContext_()
const
748 thread_local static std::vector<MassAndEnergyCouplingContext> c;
753 GridVariablesTuple gridVariables_;
755 const SolutionVector* prevSol_;
758 std::deque<std::vector<ElementSeed<freeFlowMomentumIndex>>> elementSets_;
764:
public std::false_type {};
The interface of the coupling manager for multi domain problems.
Definition: multidomain/couplingmanager.hh:48
void attachSolution(SolutionVectorStorage &curSol)
Attach a solution vector stored outside of this class.
Definition: multidomain/couplingmanager.hh:322
void setSubProblems(const std::tuple< std::shared_ptr< SubProblems >... > &problems)
set the pointers to the sub problems
Definition: multidomain/couplingmanager.hh:287
const Problem< i > & problem(Dune::index_constant< i > domainIdx) const
Return a reference to the sub problem.
Definition: multidomain/couplingmanager.hh:309
std::vector< std::size_t > CouplingStencilType
default type used for coupling element stencils
Definition: multidomain/couplingmanager.hh:64
SubSolutionVector< i > & curSol(Dune::index_constant< i > domainIdx)
the solution vector of the subproblem
Definition: multidomain/couplingmanager.hh:338
void updateSolution(const SolutionVector &curSol)
Updates the entire solution vector, e.g. before assembly or after grid adaption Overload might want t...
Definition: multidomain/couplingmanager.hh:219
typename Traits::template TupleOfSharedPtr< SubSolutionVector > SolutionVectorStorage
the type in which the solution vector is stored in the manager
Definition: multidomain/couplingmanager.hh:71
The interface of the coupling manager for free flow systems.
Definition: couplingmanager_pq1bubble.hh:50
static constexpr auto freeFlowMomentumIndex
Definition: couplingmanager_pq1bubble.hh:53
void computeColorsForAssembly()
Compute colors for multithreaded assembly.
Definition: couplingmanager_pq1bubble.hh:573
static constexpr auto freeFlowMassIndex
Definition: couplingmanager_pq1bubble.hh:54
Scalar effectiveViscosity(const Element< freeFlowMomentumIndex > &element, const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolume< freeFlowMomentumIndex > &scv, const bool considerPreviousTimeStep=false) const
Returns the effective viscosity at a given sub control volume.
Definition: couplingmanager_pq1bubble.hh:344
const CouplingStencilType & couplingStencil(Dune::index_constant< freeFlowMomentumIndex > domainI, const Element< freeFlowMomentumIndex > &elementI, Dune::index_constant< freeFlowMassIndex > domainJ) const
returns an iterable container of all indices of degrees of freedom of domain j that couple with / inf...
Definition: couplingmanager_pq1bubble.hh:476
Scalar pressure(const Element< freeFlowMomentumIndex > &element, const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf, const bool considerPreviousTimeStep=false) const
Returns the pressure at a given sub control volume face.
Definition: couplingmanager_pq1bubble.hh:168
Scalar effectiveViscosity(const Element< freeFlowMomentumIndex > &element, const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf, const bool considerPreviousTimeStep=false) const
Returns the effective viscosity at a given sub control volume face.
Definition: couplingmanager_pq1bubble.hh:297
void init(std::shared_ptr< Problem< freeFlowMomentumIndex > > momentumProblem, std::shared_ptr< Problem< freeFlowMassIndex > > massProblem, GridVariablesTuple &&gridVariables, const SolutionVector &curSol, const SolutionVector &prevSol)
use as regular coupling manager in a transient setting
Definition: couplingmanager_pq1bubble.hh:134
Scalar density(const Element< freeFlowMomentumIndex > &element, const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolume< freeFlowMomentumIndex > &scv, const bool considerPreviousTimeStep=false) const
Returns the density at a given sub control volume.
Definition: couplingmanager_pq1bubble.hh:249
const CouplingStencilType & couplingStencil(Dune::index_constant< freeFlowMomentumIndex > domainI, const Element< freeFlowMomentumIndex > &elementI, const SubControlVolume< freeFlowMomentumIndex > &scvI, Dune::index_constant< j > domainJ) const
The coupling stencil of domain I, i.e. which domain J DOFs the given domain I element's residual depe...
Definition: couplingmanager_pq1bubble.hh:440
const CouplingStencilType & couplingStencil(Dune::index_constant< freeFlowMassIndex > domainI, const Element< freeFlowMassIndex > &elementI, Dune::index_constant< freeFlowMomentumIndex > domainJ) const
returns an iterable container of all indices of degrees of freedom of domain j that couple with / inf...
Definition: couplingmanager_pq1bubble.hh:460
void init(std::shared_ptr< Problem< freeFlowMomentumIndex > > momentumProblem, std::shared_ptr< Problem< freeFlowMassIndex > > massProblem, GridVariablesTuple &&gridVariables, const SolutionVector &curSol)
Methods to be accessed by main.
Definition: couplingmanager_pq1bubble.hh:121
static constexpr auto pressureIdx
Definition: couplingmanager_pq1bubble.hh:113
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_pq1bubble.hh:200
Scalar pressure(const Element< freeFlowMomentumIndex > &element, const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolume< freeFlowMomentumIndex > &scv, const bool considerPreviousTimeStep=false) const
Returns the pressure at a given sub control volume.
Definition: couplingmanager_pq1bubble.hh:184
void init(std::shared_ptr< Problem< freeFlowMomentumIndex > > momentumProblem, std::shared_ptr< Problem< freeFlowMassIndex > > massProblem, GridVariablesTuple &&gridVariables, typename ParentType::SolutionVectorStorage &curSol)
use as binary coupling manager in multi model context
Definition: couplingmanager_pq1bubble.hh:146
VelocityVector faceVelocity(const Element< freeFlowMassIndex > &element, const SubControlVolumeFace< freeFlowMassIndex > &scvf) const
Returns the velocity at a given sub control volume face.
Definition: couplingmanager_pq1bubble.hh:391
VelocityVector elementVelocity(const FVElementGeometry< freeFlowMassIndex > &fvGeometry) const
Returns the velocity at the element center.
Definition: couplingmanager_pq1bubble.hh:417
void assembleMultithreaded(Dune::index_constant< i > domainId, AssembleElementFunc &&assembleElement) const
Execute assembly kernel in parallel.
Definition: couplingmanager_pq1bubble.hh:586
Coloring schemes for shared-memory-parallel assembly.
Defines all properties used in Dumux.
Element solution classes and factory functions.
free functions for the evaluation of primary variables inside elements.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:26
PrimaryVariables evalSolution(const Element &element, const typename Element::Geometry &geometry, const typename FVElementGeometry::GridGeometry &gridGeometry, const CVFEElementSolution< FVElementGeometry, PrimaryVariables > &elemSol, const typename Element::Geometry::GlobalCoordinate &globalPos, bool ignoreState=false)
Interpolates a given box element solution at a given global position. Uses the finite element cache o...
Definition: evalsolution.hh:152
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethods::cctpfa||GridGeometry::discMethod==DiscretizationMethods::ccmpfa, CCElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for cell-centered schemes.
Definition: cellcentered/elementsolution.hh:101
void updateCouplingContext(Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< j > domainJ, std::size_t dofIdxGlobalJ, const PrimaryVariables< j > &priVarsJ, int pvIdxJ)
updates all data and variables that are necessary to evaluate the residual of the element of domain i...
Definition: couplingmanager_pq1bubble.hh:511
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
The available discretization methods in Dumux.
The interface of the coupling manager for multi domain problems.
A linear system assembler (residual and Jacobian) for finite volume schemes with multiple domains.
constexpr FCDiamond fcdiamond
Definition: method.hh:152
constexpr CCTpfa cctpfa
Definition: method.hh:145
constexpr Box box
Definition: method.hh:147
auto computeColoring(const GridGeometry &gg, int verbosity=1)
Compute iterable lists of element seeds partitioned by color.
Definition: coloring.hh:239
Parallel for loop (multithreading)
Type trait that is specialized for coupling manager supporting multithreaded assembly.
Definition: multistagemultidomainfvassembler.hh:78