25#ifndef DUMUX_COMMON_DEPRECATED_HH
26#define DUMUX_COMMON_DEPRECATED_HH
30#include <dune/common/deprecated.hh>
52constexpr auto hasEffDiffCoeffImpl =
Dumux::isValid([](
auto&& v) ->
decltype(v.effectiveDiffusionCoefficient(0,0,0)){return 0;});
53template<
class VolumeVariables>
constexpr bool hasEffDiffCoeff =
decltype(hasEffDiffCoeffImpl(std::declval<VolumeVariables>())){};
55template<
class EDL,
class VV,
56 typename std::enable_if_t<!hasEffDiffCoeff<VV>,
int> = 0>
57[[deprecated(
"The volume variables class used does not have an effectiveDiffusionCoefficient(phaseIdx, compIIdx, compJIdx) function. "
58 "This will become mandatory after the 3.2 release! See e.g. the files /dumux/porousmediumflow/2p2c/volumevariables.hh "
59 "and /dumux/porousmediumflow/2p2c/properties.hh to see how this can be realized.")]]
60decltype(EDL::effectiveDiffusionCoefficient(std::declval<VV>(),
int(),
int(),
int()))
61effectiveDiffusionCoefficient(
const VV& volVars,
int phaseIdx,
int compIIdx,
int compJIdx)
63 return EDL::effectiveDiffusionCoefficient(volVars, phaseIdx, compIIdx, compJIdx);
66template<
class EDL,
class VV,
67 typename std::enable_if_t<hasEffDiffCoeff<VV>,
int> = 0>
68auto effectiveDiffusionCoefficient(
const VV& volVars,
int phaseIdx,
int compIIdx,
int compJIdx)
69{
return volVars.effectiveDiffusionCoefficient(phaseIdx, compIIdx, compJIdx); }
75template<
class EDL,
class FS,
class VV,
class P,
class E,
class SCV,
76 typename std::enable_if_t<hasEffDiffCoeff<VV>,
int> = 0>
77auto effectiveMSDiffusionCoefficient(
const VV& volVars,
84{
return volVars.effectiveDiffusionCoefficient(phaseIdx, compIIdx, compJIdx); }
86template<
class EDL,
class FS,
class VV,
class P,
class E,
class SCV,
87 typename std::enable_if_t<!hasEffDiffCoeff<VV>,
int> = 0>
88[[deprecated(
"The volume variables class used does not have an effectiveDiffusionCoefficient(phaseIdx, compIIdx, compJIdx) function. "
89 "This will become mandatory after the 3.2 release! See e.g. the files /dumux/porousmediumflow/2p2c/volumevariables.hh "
90 "and /dumux/porousmediumflow/2p2c/properties.hh to see how this can be realized.")]]
91auto effectiveMSDiffusionCoefficient(
const VV& volVars,
100 if constexpr (FS::isTracerFluidSystem())
102 tinInside = FS::binaryDiffusionCoefficient(compIIdx,
110 auto fluidState = volVars.fluidState();
111 typename FS::ParameterCache paramCache;
112 paramCache.updateAll(fluidState);
113 tinInside = FS::binaryDiffusionCoefficient(fluidState,
120 return EDL::effectiveDiffusivity(volVars.porosity(), volVars.saturation(phaseIdx), tinInside);
A helper function for class member function introspection.
constexpr auto isValid(const Expression &t)
A function that creates a test functor to do class member introspection at compile time.
Definition: isvalid.hh:93