24#ifndef DUMUX_TRACER_VOLUME_VARIABLES_HH
25#define DUMUX_TRACER_VOLUME_VARIABLES_HH
31#include <dune/common/std/type_traits.hh>
41template <
typename T,
typename ...Ts>
42using SaturationDetector =
decltype(std::declval<T>().spatialParams().saturation(std::declval<Ts>()...));
44template<
class T,
typename ...Args>
55template <
class Traits>
60 using Scalar =
typename Traits::PrimaryVariables::value_type;
61 static constexpr bool useMoles = Traits::ModelTraits::useMoles();
62 using EffDiffModel =
typename Traits::EffectiveDiffusivityModel;
71 using Indices =
typename Traits::ModelTraits::Indices;
82 template<
class ElemSol,
class Problem,
class Element,
class Scv>
84 const Problem &problem,
85 const Element &element,
94 fluidDensity_ = problem.spatialParams().fluidDensity(element, scv);
97 if constexpr (Detail::hasSaturation<Problem, Element, Scv>())
103 diffCoeff_[compIdx] = FluidSystem::binaryDiffusionCoefficient(compIdx, problem, element, scv);
104 effectiveDiffCoeff_[compIdx] = EffDiffModel::effectiveDiffusionCoefficient(*
this, 0, 0, compIdx);
196 if (phaseIdx != compIIdx) std::swap(compIIdx, compJIdx);
197 assert(phaseIdx == 0);
198 assert(phaseIdx == compIIdx);
206 if (phaseIdx != compIIdx) std::swap(compIIdx, compJIdx);
207 assert(phaseIdx == 0);
208 assert(phaseIdx == compIIdx);
Update the solid volume fractions (inert and reacitve) and set them in the solidstate.
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:36
decltype(std::declval< T >().spatialParams().saturation(std::declval< Ts >()...)) SaturationDetector
Definition: porousmediumflow/tracer/volumevariables.hh:42
static constexpr bool hasSaturation()
Definition: porousmediumflow/tracer/volumevariables.hh:45
Contains the quantities which are constant within a finite volume for the tracer model.
Definition: porousmediumflow/tracer/volumevariables.hh:58
Scalar averageMolarMass(int phaseIdx=0) const
Returns the average molar mass of the fluid phase.
Definition: porousmediumflow/tracer/volumevariables.hh:123
typename Traits::FluidSystem FluidSystem
Export the fluid system type.
Definition: porousmediumflow/tracer/volumevariables.hh:67
Scalar moleFraction(int phaseIdx, int compIdx) const
Returns the mole fraction of a component in the phase.
Definition: porousmediumflow/tracer/volumevariables.hh:170
Scalar massFraction(int phaseIdx, int compIdx) const
Returns the mass fraction of a component in the phase.
Definition: porousmediumflow/tracer/volumevariables.hh:179
std::array< Scalar, numFluidComps > effectiveDiffCoeff_
Definition: porousmediumflow/tracer/volumevariables.hh:224
Scalar molarDensity(int phaseIdx=0) const
Returns the molar density the of the fluid phase.
Definition: porousmediumflow/tracer/volumevariables.hh:161
std::array< Scalar, numFluidComps > moleOrMassFraction_
Definition: porousmediumflow/tracer/volumevariables.hh:225
typename Traits::SolidState SolidState
Export the solid state type.
Definition: porousmediumflow/tracer/volumevariables.hh:69
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the effective diffusion coefficients for a phase in .
Definition: porousmediumflow/tracer/volumevariables.hh:204
Scalar fluidDensity_
Definition: porousmediumflow/tracer/volumevariables.hh:220
SolidState solidState_
Definition: porousmediumflow/tracer/volumevariables.hh:219
Scalar density(int phaseIdx=0) const
Returns the density the of the fluid phase.
Definition: porousmediumflow/tracer/volumevariables.hh:115
const SolidState & solidState() const
Returns the phase state for the control volume.
Definition: porousmediumflow/tracer/volumevariables.hh:129
Scalar mobility(int phaseIdx=0) const
Returns the mobility.
Definition: porousmediumflow/tracer/volumevariables.hh:153
Scalar diffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: porousmediumflow/tracer/volumevariables.hh:194
Scalar saturation(int phaseIdx=0) const
Returns the saturation.
Definition: porousmediumflow/tracer/volumevariables.hh:142
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:83
Scalar porosity() const
Return the average porosity within the control volume.
Definition: porousmediumflow/tracer/volumevariables.hh:215
typename Traits::ModelTraits::Indices Indices
Export the indices.
Definition: porousmediumflow/tracer/volumevariables.hh:71
Scalar fluidSaturation_
Definition: porousmediumflow/tracer/volumevariables.hh:221
Scalar fluidMolarMass_
Definition: porousmediumflow/tracer/volumevariables.hh:220
Scalar molarity(int phaseIdx, int compIdx) const
Returns the concentration of a component in the phase.
Definition: porousmediumflow/tracer/volumevariables.hh:188
std::array< Scalar, numFluidComps > diffCoeff_
Definition: porousmediumflow/tracer/volumevariables.hh:223
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:42
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: porousmediumflow/volumevariables.hh:54
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition: porousmediumflow/volumevariables.hh:78
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:66
Base class for the model specific class which provides access to all volume averaged quantities.