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;
79 template<
class ElemSol,
class Problem,
class Element,
class Scv>
81 const Problem &problem,
82 const Element &element,
91 fluidDensity_ = problem.spatialParams().fluidDensity(element, scv);
94 if constexpr (Detail::hasSaturation<Problem, Element, Scv>())
100 diffCoeff_[compIdx] = FluidSystem::binaryDiffusionCoefficient(compIdx, problem, element, scv);
101 effectiveDiffCoeff_[compIdx] = EffDiffModel::effectiveDiffusionCoefficient(*
this, 0, 0, compIdx);
191 [[deprecated(
"Will be removed after release 3.2. Use diffusionCoefficient(phaseIdx, compIIdx, compJIdx)!")]]
200 if (phaseIdx != compIIdx) std::swap(compIIdx, compJIdx);
201 assert(phaseIdx == 0);
202 assert(phaseIdx == compIIdx);
210 if (phaseIdx != compIIdx) std::swap(compIIdx, compJIdx);
211 assert(phaseIdx == 0);
212 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:120
Scalar diffusionCoefficient(int phaseIdx, int compIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: porousmediumflow/tracer/volumevariables.hh:192
typename Traits::FluidSystem FluidSystem
Export 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:167
Scalar massFraction(int phaseIdx, int compIdx) const
Returns the mass fraction of a component in the phase.
Definition: porousmediumflow/tracer/volumevariables.hh:176
std::array< Scalar, numFluidComps > effectiveDiffCoeff_
Definition: porousmediumflow/tracer/volumevariables.hh:228
Scalar molarDensity(int phaseIdx=0) const
Returns the molar density the of the fluid phase.
Definition: porousmediumflow/tracer/volumevariables.hh:158
std::array< Scalar, numFluidComps > moleOrMassFraction_
Definition: porousmediumflow/tracer/volumevariables.hh:229
typename Traits::SolidState SolidState
Definition: porousmediumflow/tracer/volumevariables.hh:68
Scalar effectiveDiffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the effective diffusion coefficients for a phase in .
Definition: porousmediumflow/tracer/volumevariables.hh:208
Scalar fluidDensity_
Definition: porousmediumflow/tracer/volumevariables.hh:224
SolidState solidState_
Definition: porousmediumflow/tracer/volumevariables.hh:223
Scalar density(int phaseIdx=0) const
Returns the density the of the fluid phase.
Definition: porousmediumflow/tracer/volumevariables.hh:112
const SolidState & solidState() const
Returns the phase state for the control volume.
Definition: porousmediumflow/tracer/volumevariables.hh:126
Scalar mobility(int phaseIdx=0) const
Returns the mobility.
Definition: porousmediumflow/tracer/volumevariables.hh:150
Scalar diffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const
Returns the binary diffusion coefficients for a phase in .
Definition: porousmediumflow/tracer/volumevariables.hh:198
Scalar saturation(int phaseIdx=0) const
Returns the saturation.
Definition: porousmediumflow/tracer/volumevariables.hh:139
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:80
Scalar porosity() const
Return the average porosity within the control volume.
Definition: porousmediumflow/tracer/volumevariables.hh:219
Scalar fluidSaturation_
Definition: porousmediumflow/tracer/volumevariables.hh:225
Scalar fluidMolarMass_
Definition: porousmediumflow/tracer/volumevariables.hh:224
Scalar molarity(int phaseIdx, int compIdx) const
Returns the concentration of a component in the phase.
Definition: porousmediumflow/tracer/volumevariables.hh:185
std::array< Scalar, numFluidComps > diffCoeff_
Definition: porousmediumflow/tracer/volumevariables.hh:227
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:40
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: porousmediumflow/volumevariables.hh:52
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition: porousmediumflow/volumevariables.hh:76
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:64
Base class for the model specific class which provides access to all volume averaged quantities.