12#ifndef DUMUX_TRACER_VOLUME_VARIABLES_HH
13#define DUMUX_TRACER_VOLUME_VARIABLES_HH
19#include <dune/common/std/type_traits.hh>
29template <
typename T,
typename ...Ts>
30using SaturationDetector =
decltype(std::declval<T>().spatialParams().saturation(std::declval<Ts>()...));
32template<
class T,
typename ...Args>
43template <
class Traits>
48 using Scalar =
typename Traits::PrimaryVariables::value_type;
49 static constexpr bool useMoles = Traits::ModelTraits::useMoles();
50 using EffDiffModel =
typename Traits::EffectiveDiffusivityModel;
59 using Indices =
typename Traits::ModelTraits::Indices;
70 template<
class ElemSol,
class Problem,
class Element,
class Scv>
72 const Problem &problem,
73 const Element &element,
82 fluidDensity_ = problem.spatialParams().fluidDensity(element, scv);
85 if constexpr (Detail::hasSaturation<Problem, Element, Scv>())
91 diffCoeff_[compIdx] = FluidSystem::binaryDiffusionCoefficient(compIdx, problem, element, scv);
92 effectiveDiffCoeff_[compIdx] = EffDiffModel::effectiveDiffusionCoefficient(*
this, 0, 0, compIdx);
184 if (phaseIdx != compIIdx) std::swap(compIIdx, compJIdx);
185 assert(phaseIdx == 0);
186 assert(phaseIdx == compIIdx);
194 if (phaseIdx != compIIdx) std::swap(compIIdx, compJIdx);
195 assert(phaseIdx == 0);
196 assert(phaseIdx == compIIdx);
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:28
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: porousmediumflow/volumevariables.hh:40
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition: porousmediumflow/volumevariables.hh:64
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition: porousmediumflow/volumevariables.hh:52
Contains the quantities which are constant within a finite volume for the tracer model.
Definition: porousmediumflow/tracer/volumevariables.hh:46
Scalar averageMolarMass(int phaseIdx=0) const
Returns the average molar mass of the fluid phase.
Definition: porousmediumflow/tracer/volumevariables.hh:111
typename Traits::FluidSystem FluidSystem
Export the fluid system type.
Definition: porousmediumflow/tracer/volumevariables.hh:55
Scalar moleFraction(int phaseIdx, int compIdx) const
Returns the mole fraction of a component in the phase.
Definition: porousmediumflow/tracer/volumevariables.hh:158
Scalar massFraction(int phaseIdx, int compIdx) const
Returns the mass fraction of a component in the phase.
Definition: porousmediumflow/tracer/volumevariables.hh:167
std::array< Scalar, numFluidComps > effectiveDiffCoeff_
Definition: porousmediumflow/tracer/volumevariables.hh:212
Scalar molarDensity(int phaseIdx=0) const
Returns the molar density the of the fluid phase.
Definition: porousmediumflow/tracer/volumevariables.hh:149
std::array< Scalar, numFluidComps > moleOrMassFraction_
Definition: porousmediumflow/tracer/volumevariables.hh:213
typename Traits::SolidState SolidState
Export the solid state type.
Definition: porousmediumflow/tracer/volumevariables.hh:57
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the effective diffusion coefficients for a phase in .
Definition: porousmediumflow/tracer/volumevariables.hh:192
Scalar fluidDensity_
Definition: porousmediumflow/tracer/volumevariables.hh:208
SolidState solidState_
Definition: porousmediumflow/tracer/volumevariables.hh:207
Scalar density(int phaseIdx=0) const
Returns the density the of the fluid phase.
Definition: porousmediumflow/tracer/volumevariables.hh:103
const SolidState & solidState() const
Returns the phase state for the control volume.
Definition: porousmediumflow/tracer/volumevariables.hh:117
Scalar mobility(int phaseIdx=0) const
Returns the mobility.
Definition: porousmediumflow/tracer/volumevariables.hh:141
Scalar diffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: porousmediumflow/tracer/volumevariables.hh:182
Scalar saturation(int phaseIdx=0) const
Returns the saturation.
Definition: porousmediumflow/tracer/volumevariables.hh:130
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition: porousmediumflow/tracer/volumevariables.hh:71
Scalar porosity() const
Return the average porosity within the control volume.
Definition: porousmediumflow/tracer/volumevariables.hh:203
typename Traits::ModelTraits::Indices Indices
Export the indices.
Definition: porousmediumflow/tracer/volumevariables.hh:59
Scalar fluidSaturation_
Definition: porousmediumflow/tracer/volumevariables.hh:209
Scalar fluidMolarMass_
Definition: porousmediumflow/tracer/volumevariables.hh:208
Scalar molarity(int phaseIdx, int compIdx) const
Returns the concentration of a component in the phase.
Definition: porousmediumflow/tracer/volumevariables.hh:176
std::array< Scalar, numFluidComps > diffCoeff_
Definition: porousmediumflow/tracer/volumevariables.hh:211
void updateSolidVolumeFractions(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv, SolidState &solidState, const int solidVolFracOffset)
update the solid volume fractions (inert and reacitve) and set them in the solidstate
Definition: updatesolidvolumefractions.hh:24
decltype(std::declval< T >().spatialParams().saturation(std::declval< Ts >()...)) SaturationDetector
Definition: porousmediumflow/tracer/volumevariables.hh:30
static constexpr bool hasSaturation()
Definition: porousmediumflow/tracer/volumevariables.hh:33
Base class for the model specific class which provides access to all volume averaged quantities.
Update the solid volume fractions (inert and reacitve) and set them in the solidstate.