diff --git a/dumux/discretization/cellcentered/mpfa/darcyslaw.hh b/dumux/discretization/cellcentered/mpfa/darcyslaw.hh index ad6c150e29d2007c1b693c5862a5865494754d7e..590859986afb71ecdf60bf34e1535db55884fed2 100644 --- a/dumux/discretization/cellcentered/mpfa/darcyslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/darcyslaw.hh @@ -138,7 +138,7 @@ class DarcysLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> stencil_ = &iv.stencil(); for (unsigned int pIdx = 0; pIdx < numPhases; ++pIdx) - primaryPj_[pIdx] = &dataHandle.pressures(pIdx); + primaryPj_[pIdx] = &dataHandle.advectionHandle().pressures(pIdx); static const bool enableGravity = getParamFromGroup<bool>(problem.paramGroup(), "Problem.EnableGravity"); const auto ivLocalIdx = localFaceData.ivLocalScvfIndex(); @@ -146,28 +146,28 @@ class DarcysLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> // standard grids if (dim == dimWorld) { - primaryTij_ = &dataHandle.advectionT()[ivLocalIdx]; + primaryTij_ = &dataHandle.advectionHandle().advectionT()[ivLocalIdx]; if (enableGravity) for (unsigned int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - g_[phaseIdx] = dataHandle.gravity(phaseIdx)[ivLocalIdx]; + g_[phaseIdx] = dataHandle.advectionHandle().gravity(phaseIdx)[ivLocalIdx]; } // surface grids else { if (!localFaceData.isOutsideFace()) { - primaryTij_ = &dataHandle.advectionT()[ivLocalIdx]; + primaryTij_ = &dataHandle.advectionHandle().advectionT()[ivLocalIdx]; if (enableGravity) for (unsigned int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - g_[phaseIdx] = dataHandle.gravity(phaseIdx)[ivLocalIdx]; + g_[phaseIdx] = dataHandle.advectionHandle().gravity(phaseIdx)[ivLocalIdx]; } else { const auto idxInOutsideFaces = localFaceData.scvfLocalOutsideScvfIndex(); - primaryTij_ = &dataHandle.advectionTout()[ivLocalIdx][idxInOutsideFaces]; + primaryTij_ = &dataHandle.advectionHandle().advectionTout()[ivLocalIdx][idxInOutsideFaces]; if (enableGravity) for (unsigned int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - g_[phaseIdx] = dataHandle.gravityOutside(phaseIdx)[ivLocalIdx][idxInOutsideFaces]; + g_[phaseIdx] = dataHandle.advectionHandle().gravityOutside(phaseIdx)[ivLocalIdx][idxInOutsideFaces]; } } } @@ -193,7 +193,7 @@ class DarcysLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> stencil_ = &iv.stencil(); for (unsigned int pIdx = 0; pIdx < numPhases; ++pIdx) - secondaryPj_[pIdx] = &dataHandle.pressures(pIdx); + secondaryPj_[pIdx] = &dataHandle.advectionHandle().pressures(pIdx); static const bool enableGravity = getParamFromGroup<bool>(problem.paramGroup(), "Problem.EnableGravity"); const auto ivLocalIdx = localFaceData.ivLocalScvfIndex(); @@ -201,28 +201,28 @@ class DarcysLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> // standard grids if (dim == dimWorld) { - secondaryTij_ = &dataHandle.advectionT()[ivLocalIdx]; + secondaryTij_ = &dataHandle.advectionHandle().advectionT()[ivLocalIdx]; if (enableGravity) for (unsigned int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - g_[phaseIdx] = dataHandle.gravity(phaseIdx)[ivLocalIdx]; + g_[phaseIdx] = dataHandle.advectionHandle().gravity(phaseIdx)[ivLocalIdx]; } // surface grids else { if (!localFaceData.isOutsideFace()) { - secondaryTij_ = &dataHandle.advectionT()[ivLocalIdx]; + secondaryTij_ = &dataHandle.advectionHandle().advectionT()[ivLocalIdx]; if (enableGravity) for (unsigned int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - g_[phaseIdx] = dataHandle.gravity(phaseIdx)[ivLocalIdx]; + g_[phaseIdx] = dataHandle.advectionHandle().gravity(phaseIdx)[ivLocalIdx]; } else { const auto idxInOutsideFaces = localFaceData.scvfLocalOutsideScvfIndex(); - secondaryTij_ = &dataHandle.advectionTout()[ivLocalIdx][idxInOutsideFaces]; + secondaryTij_ = &dataHandle.advectionHandle().advectionTout()[ivLocalIdx][idxInOutsideFaces]; if (enableGravity) for (unsigned int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) - g_[phaseIdx] = dataHandle.gravityOutside(phaseIdx)[ivLocalIdx][idxInOutsideFaces]; + g_[phaseIdx] = dataHandle.advectionHandle().gravityOutside(phaseIdx)[ivLocalIdx][idxInOutsideFaces]; } } } diff --git a/dumux/discretization/cellcentered/mpfa/fickslaw.hh b/dumux/discretization/cellcentered/mpfa/fickslaw.hh index 71dcb70fcc8517d8b92ac132145b7556a1698531..e4cc85ae578bf049684da4975e35807e776a18fb 100644 --- a/dumux/discretization/cellcentered/mpfa/fickslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/fickslaw.hh @@ -136,15 +136,15 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> switchFluxSign_[phaseIdx][compIdx] = localFaceData.isOutsideFace(); // store pointer to the mole fraction vector of this iv - primaryXj_[phaseIdx][compIdx] = &dataHandle.moleFractions(phaseIdx, compIdx); + primaryXj_[phaseIdx][compIdx] = &dataHandle.diffusionHandle().moleFractions(phaseIdx, compIdx); const auto ivLocalIdx = localFaceData.ivLocalScvfIndex(); if (dim == dimWorld) - primaryTij_[phaseIdx][compIdx] = &dataHandle.diffusionT()[ivLocalIdx]; + primaryTij_[phaseIdx][compIdx] = &dataHandle.diffusionHandle().diffusionT()[ivLocalIdx]; else primaryTij_[phaseIdx][compIdx] = localFaceData.isOutsideFace() - ? &dataHandle.diffusionTout()[ivLocalIdx][localFaceData.scvfLocalOutsideScvfIndex()] - : &dataHandle.diffusionT()[ivLocalIdx]; + ? &dataHandle.diffusionHandle().diffusionTout()[ivLocalIdx][localFaceData.scvfLocalOutsideScvfIndex()] + : &dataHandle.diffusionHandle().diffusionT()[ivLocalIdx]; } /*! @@ -167,15 +167,15 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> switchFluxSign_[phaseIdx][compIdx] = localFaceData.isOutsideFace(); // store pointer to the mole fraction vector of this iv - secondaryXj_[phaseIdx][compIdx] = &dataHandle.moleFractions(phaseIdx, compIdx); + secondaryXj_[phaseIdx][compIdx] = &dataHandle.diffusionHandle().moleFractions(phaseIdx, compIdx); const auto ivLocalIdx = localFaceData.ivLocalScvfIndex(); if (dim == dimWorld) - secondaryTij_[phaseIdx][compIdx] = &dataHandle.diffusionT()[ivLocalIdx]; + secondaryTij_[phaseIdx][compIdx] = &dataHandle.diffusionHandle().diffusionT()[ivLocalIdx]; else secondaryTij_[phaseIdx][compIdx] = localFaceData.isOutsideFace() - ? &dataHandle.diffusionTout()[ivLocalIdx][localFaceData.scvfLocalOutsideScvfIndex()] - : &dataHandle.diffusionT()[ivLocalIdx]; + ? &dataHandle.diffusionHandle().diffusionTout()[ivLocalIdx][localFaceData.scvfLocalOutsideScvfIndex()] + : &dataHandle.diffusionHandle().diffusionT()[ivLocalIdx]; } //! In the interaction volume-local system of eq we have one unknown per face. diff --git a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh index 0a59d20489e362518637d9d85120a42aabd7319a..c63e10ccee6ded6727cd55db498b22059fe52fd4 100644 --- a/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh +++ b/dumux/discretization/cellcentered/mpfa/fluxvariablescachefiller.hh @@ -446,18 +446,18 @@ private: if (dim < dimWorld) { if (enableGravity) - localAssembler.assembleWithGravity( handle.advectionTout(), - handle.advectionT(), - handle.gravityOutside(), - handle.gravity(), - handle.advectionCA(), - handle.advectionA(), + localAssembler.assembleWithGravity( handle.advectionHandle().advectionTout(), + handle.advectionHandle().advectionT(), + handle.advectionHandle().gravityOutside(), + handle.advectionHandle().gravity(), + handle.advectionHandle().advectionCA(), + handle.advectionHandle().advectionA(), iv, LambdaFactory::getAdvectionLambda() ); else - localAssembler.assemble( handle.advectionTout(), - handle.advectionT(), + localAssembler.assemble( handle.advectionHandle().advectionTout(), + handle.advectionHandle().advectionT(), iv, LambdaFactory::getAdvectionLambda() ); } @@ -466,13 +466,13 @@ private: else { if (enableGravity) - localAssembler.assembleWithGravity( handle.advectionT(), - handle.gravity(), - handle.advectionCA(), + localAssembler.assembleWithGravity( handle.advectionHandle().advectionT(), + handle.advectionHandle().gravity(), + handle.advectionHandle().advectionCA(), iv, LambdaFactory::getAdvectionLambda() ); else - localAssembler.assemble( handle.advectionT(), + localAssembler.assemble( handle.advectionHandle().advectionT(), iv, LambdaFactory::getAdvectionLambda() ); } @@ -482,16 +482,16 @@ private: else if (enableGravity) { if (dim == dimWorld) - localAssembler.assembleGravity( handle.gravity(), + localAssembler.assembleGravity( handle.advectionHandle().gravity(), iv, - handle.advectionCA(), + handle.advectionHandle().advectionCA(), LambdaFactory::getAdvectionLambda() ); else - localAssembler.assembleGravity( handle.gravity(), - handle.gravityOutside(), + localAssembler.assembleGravity( handle.advectionHandle().gravity(), + handle.advectionHandle().gravityOutside(), iv, - handle.advectionCA(), - handle.advectionA(), + handle.advectionHandle().advectionCA(), + handle.advectionHandle().advectionA(), LambdaFactory::getAdvectionLambda() ); } @@ -500,7 +500,7 @@ private: { const auto& evv = &elemVolVars(); auto getPressure = [&evv, pIdx] (auto volVarIdx) { return (evv->operator[](volVarIdx)).pressure(pIdx); }; - localAssembler.assemble(handle.pressures(pIdx), iv, getPressure); + localAssembler.assemble(handle.advectionHandle().pressures(pIdx), iv, getPressure); } } @@ -522,19 +522,19 @@ private: IvLocalAssembler localAssembler(problem(), fvGeometry(), elemVolVars()); // solve the local system subject to the tensor and update the handle - handle.setPhaseIndex(phaseIdx); - handle.setComponentIndex(compIdx); + handle.diffusionHandle().setPhaseIndex(phaseIdx); + handle.diffusionHandle().setComponentIndex(compIdx); // assemble T if (forceUpdateAll || soldependentDiffusion) { if (dim < dimWorld) - localAssembler.assemble( handle.diffusionTout(), - handle.diffusionT(), + localAssembler.assemble( handle.diffusionHandle().diffusionTout(), + handle.diffusionHandle().diffusionT(), iv, LambdaFactory::getDiffusionLambda(phaseIdx, compIdx) ); else - localAssembler. assemble( handle.diffusionT(), + localAssembler. assemble( handle.diffusionHandle().diffusionT(), iv, LambdaFactory::getDiffusionLambda(phaseIdx, compIdx) ); } @@ -543,7 +543,7 @@ private: const auto& evv = &elemVolVars(); auto getMoleFraction = [&evv, phaseIdx, compIdx] (auto volVarIdx) { return (evv->operator[](volVarIdx)).moleFraction(phaseIdx, compIdx); }; - localAssembler.assemble(handle.moleFractions(phaseIdx, compIdx), iv, getMoleFraction); + localAssembler.assemble(handle.diffusionHandle().moleFractions(phaseIdx, compIdx), iv, getMoleFraction); } //! prepares the quantities necessary for conductive fluxes in the handle @@ -563,12 +563,12 @@ private: if (forceUpdateAll || soldependentAdvection) { if (dim < dimWorld) - localAssembler.assemble( handle.heatConductionTout(), - handle.heatConductionT(), + localAssembler.assemble( handle.heatConductionHandle().heatConductionTout(), + handle.heatConductionHandle().heatConductionT(), iv, LambdaFactory::template getHeatConductionLambda<GetPropType<TypeTag, Properties::ThermalConductivityModel>>() ); else - localAssembler.assemble( handle.heatConductionT(), + localAssembler.assemble( handle.heatConductionHandle().heatConductionT(), iv, LambdaFactory::template getHeatConductionLambda<GetPropType<TypeTag, Properties::ThermalConductivityModel>>() ); } @@ -576,7 +576,7 @@ private: // assemble vector of temperatures const auto& evv = &elemVolVars(); auto getMoleFraction = [&evv] (auto volVarIdx) { return (evv->operator[](volVarIdx)).temperature(); }; - localAssembler.assemble(handle.temperatures(), iv, getMoleFraction); + localAssembler.assemble(handle.heatConductionHandle().temperatures(), iv, getMoleFraction); } //! fill handle only when advection uses mpfa diff --git a/dumux/discretization/cellcentered/mpfa/fourierslaw.hh b/dumux/discretization/cellcentered/mpfa/fourierslaw.hh index 5a69ad33ff683ae375384f61c7af83750d603cae..0a8fa2774355fb74e42a6f09ec4c6f43bc10e2c3 100644 --- a/dumux/discretization/cellcentered/mpfa/fourierslaw.hh +++ b/dumux/discretization/cellcentered/mpfa/fourierslaw.hh @@ -131,15 +131,15 @@ class FouriersLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> switchFluxSign_ = localFaceData.isOutsideFace(); // store pointer to the temperature vector of this iv - primaryTj_ = &dataHandle.temperatures(); + primaryTj_ = &dataHandle.heatConductionHandle().temperatures(); const auto ivLocalIdx = localFaceData.ivLocalScvfIndex(); if (dim == dimWorld) - primaryTij_ = &dataHandle.heatConductionT()[ivLocalIdx]; + primaryTij_ = &dataHandle.heatConductionHandle().heatConductionT()[ivLocalIdx]; else primaryTij_ = localFaceData.isOutsideFace() - ? &dataHandle.heatConductionTout()[ivLocalIdx][localFaceData.scvfLocalOutsideScvfIndex()] - : &dataHandle.heatConductionT()[ivLocalIdx]; + ? &dataHandle.heatConductionHandle().heatConductionTout()[ivLocalIdx][localFaceData.scvfLocalOutsideScvfIndex()] + : &dataHandle.heatConductionHandle().heatConductionT()[ivLocalIdx]; } /*! @@ -161,15 +161,15 @@ class FouriersLawImplementation<TypeTag, DiscretizationMethod::ccmpfa> switchFluxSign_ = localFaceData.isOutsideFace(); // store pointer to the temperature vector of this iv - secondaryTj_ = &dataHandle.temperatures(); + secondaryTj_ = &dataHandle.heatConductionHandle().temperatures(); const auto ivLocalIdx = localFaceData.ivLocalScvfIndex(); if (dim == dimWorld) secondaryTij_ = &dataHandle.heatConductionT()[ivLocalIdx]; else secondaryTij_ = localFaceData.isOutsideFace() - ? &dataHandle.heatConductionTout()[ivLocalIdx][localFaceData.scvfLocalOutsideScvfIndex()] - : &dataHandle.heatConductionT()[ivLocalIdx]; + ? &dataHandle.heatConductionHandle().heatConductionTout()[ivLocalIdx][localFaceData.scvfLocalOutsideScvfIndex()] + : &dataHandle.heatConductionHandle().heatConductionT()[ivLocalIdx]; } //! Coefficients for the cell (& Dirichlet) unknowns in flux expressions (primary type) diff --git a/dumux/discretization/cellcentered/mpfa/interactionvolumedatahandle.hh b/dumux/discretization/cellcentered/mpfa/interactionvolumedatahandle.hh index 863bc739d875a40add151f72593f5b5a17d732ef..eb302b7d17851354e4b29a6876ebc3e118373121 100644 --- a/dumux/discretization/cellcentered/mpfa/interactionvolumedatahandle.hh +++ b/dumux/discretization/cellcentered/mpfa/interactionvolumedatahandle.hh @@ -179,10 +179,29 @@ class HeatConductionDataHandle<MatVecTraits, PhysicsTraits, false> : public Empt */ template<class MVT, class PT> class InteractionVolumeDataHandle -: public AdvectionDataHandle<MVT, PT, PT::enableAdvection> -, public DiffusionDataHandle<MVT, PT, PT::enableMolecularDiffusion> -, public HeatConductionDataHandle<MVT, PT, PT::enableHeatConduction> -{}; +{ + using AdvectionHandle = AdvectionDataHandle<MVT, PT, PT::enableAdvection>; + using DiffusionHandle = DiffusionDataHandle<MVT, PT, PT::enableMolecularDiffusion>; + using HeatConductionHandle = HeatConductionDataHandle<MVT, PT, PT::enableHeatConduction>; +public: + + //! return references to the handle containing data related to advection + const AdvectionHandle& advectionHandle() const { return advectionHandle_; } + AdvectionHandle& advectionHandle() { return advectionHandle_; } + + //! return references to the handle containing data related to diffusion + const DiffusionHandle& diffusionHandle() const { return diffusionHandle_; } + DiffusionHandle& diffusionHandle() { return diffusionHandle_; } + + //! return references to the handle containing data related to heat conduction + const HeatConductionHandle& heatConductionHandle() const { return heatConductionHandle_; } + HeatConductionHandle& heatConductionHandle() { return heatConductionHandle_; } + +private: + AdvectionHandle advectionHandle_; + DiffusionHandle diffusionHandle_; + HeatConductionHandle heatConductionHandle_; +}; } // end namespace Dumux