diff --git a/dumux/flux/staggered/freeflow/fickslaw.hh b/dumux/flux/staggered/freeflow/fickslaw.hh index 1f9d1dded72c39d6ec2f68b42bc171de66a6d624..6c0c426f6b9532200dada8b1d18941b871ab9ac2 100644 --- a/dumux/flux/staggered/freeflow/fickslaw.hh +++ b/dumux/flux/staggered/freeflow/fickslaw.hh @@ -55,6 +55,7 @@ class FicksLawImplementation<TypeTag, DiscretizationMethod::staggered, reference using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>; using FVElementGeometry = typename GridGeometry::LocalView; using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace; + using VolumeVariables = GetPropType<TypeTag, Properties::VolumeVariables>; using GridView = typename GridGeometry::GridView; using Element = typename GridView::template Codim<0>::Entity; using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>; @@ -111,7 +112,7 @@ public: const Scalar massOrMoleFractionInside = massOrMoleFraction(insideVolVars, referenceSystem, phaseIdx, compIdx); const Scalar massOrMoleFractionOutside = massOrMoleFraction(outsideVolVars, referenceSystem, phaseIdx, compIdx); - const Scalar insideD = insideVolVars.effectiveDiffusionCoefficient(phaseIdx, phaseIdx, compIdx) * insideVolVars.extrusionFactor(); + const Scalar insideD = getEffectiveDiffusionCoefficient_(insideVolVars, phaseIdx, compIdx) * insideVolVars.extrusionFactor(); if (scvf.boundary()) { @@ -121,7 +122,7 @@ public: else { const auto& outsideScv = fvGeometry.scv(scvf.outsideScvIdx()); - const Scalar outsideD = outsideVolVars.effectiveDiffusionCoefficient(phaseIdx, phaseIdx, compIdx) + const Scalar outsideD = getEffectiveDiffusionCoefficient_(outsideVolVars, phaseIdx, compIdx) * outsideVolVars.extrusionFactor(); const Scalar outsideDistance = (outsideScv.dofPosition() - scvf.ipGlobal()).two_norm(); const Scalar outsideDensity = massOrMolarDensity(outsideVolVars, referenceSystem, phaseIdx); @@ -142,6 +143,18 @@ public: return flux; } + +private: + static Scalar getEffectiveDiffusionCoefficient_(const VolumeVariables& volVars, const int phaseIdx, const int compIdx) + { + if constexpr (Dumux::Deprecated::hasEffDiffCoeff<VolumeVariables>) + return volVars.effectiveDiffusionCoefficient(phaseIdx, phaseIdx, compIdx); + else + { + // TODO: remove this else clause after release 3.2! + return volVars.effectiveDiffusivity(phaseIdx, compIdx); + } + } }; } // end namespace diff --git a/dumux/flux/staggered/freeflow/maxwellstefanslaw.hh b/dumux/flux/staggered/freeflow/maxwellstefanslaw.hh index 6f6321948f20765f0de6522940dbadf7e1a72603..254966a69be535045dcf6adeb4cbf08a335f971f 100644 --- a/dumux/flux/staggered/freeflow/maxwellstefanslaw.hh +++ b/dumux/flux/staggered/freeflow/maxwellstefanslaw.hh @@ -220,7 +220,7 @@ private: const auto xi = volVars.moleFraction(compIIdx); const auto avgMolarMass = volVars.averageMolarMass(0); const auto Mn = FluidSystem::molarMass(numComponents-1); - const Scalar tin = volVars.effectiveDiffusionCoefficient(0, compIIdx, numComponents-1); + const Scalar tin = getEffectiveDiffusionCoefficient_(volVars, compIIdx, numComponents-1); // set the entries of the diffusion matrix of the diagonal reducedDiffusionMatrix[compIIdx][compIIdx] += xi*avgMolarMass/(tin*Mn); @@ -234,7 +234,7 @@ private: const auto xj = volVars.moleFraction(compJIdx); const auto Mi = FluidSystem::molarMass(compIIdx); const auto Mj = FluidSystem::molarMass(compJIdx); - const Scalar tij = volVars.effectiveDiffusionCoefficient(0, compIIdx, compJIdx); + const Scalar tij = getEffectiveDiffusionCoefficient_(volVars, compIIdx, compJIdx); reducedDiffusionMatrix[compIIdx][compIIdx] += xj*avgMolarMass/(tij*Mi); if (compJIdx < numComponents-1) reducedDiffusionMatrix[compIIdx][compJIdx] += xi*(avgMolarMass/(tin*Mn) - avgMolarMass/(tij*Mj)); @@ -242,6 +242,17 @@ private: } return reducedDiffusionMatrix; } + + static Scalar getEffectiveDiffusionCoefficient_(const VolumeVariables& volVars, const int phaseIdx, const int compIdx) + { + if constexpr (Dumux::Deprecated::hasEffDiffCoeff<VolumeVariables>) + return volVars.effectiveDiffusionCoefficient(phaseIdx, phaseIdx, compIdx); + else + { + // TODO: remove this else clause after release 3.2! + return volVars.effectiveDiffusivity(phaseIdx, compIdx); + } + } }; } // end namespace diff --git a/dumux/freeflow/compositional/iofields.hh b/dumux/freeflow/compositional/iofields.hh index 9d6fb11ebad875a6f87ea637bca20bb5fd0087c0..e7d278b8f8670164b6c35c03e33cc36b3fbc7c90 100644 --- a/dumux/freeflow/compositional/iofields.hh +++ b/dumux/freeflow/compositional/iofields.hh @@ -57,7 +57,7 @@ struct FreeflowNCIOFields // the eddy diffusivity is recalculated for an arbitrary component which is not the phase component if (turbulenceModel) - out.addVolumeVariable([j](const auto& v){ return v.effectiveDiffusionCoefficient(0,0, j) - v.diffusionCoefficient(0,0, j); }, "D_t^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(0)); + out.addVolumeVariable([j](const auto& v){ return getEffectiveDiffusionCoefficient_(v, 0, j) - v.diffusionCoefficient(0,0, j); }, "D_t^" + FluidSystem::componentName(j) + "_" + FluidSystem::phaseName(0)); } } } @@ -74,6 +74,20 @@ struct FreeflowNCIOFields return BaseOutputFields::template primaryVariableName<ModelTraits, FluidSystem>(pvIdx, state); } + + template<class VolumeVariables> + static double getEffectiveDiffusionCoefficient_(const VolumeVariables& volVars, const int phaseIdx, const int compIdx) + { + if constexpr (Dumux::Deprecated::hasEffDiffCoeff<VolumeVariables>) + return volVars.effectiveDiffusionCoefficient(phaseIdx, phaseIdx, compIdx); + else + { + // TODO: remove this else clause after release 3.2! + return volVars.effectiveDiffusivity(phaseIdx, compIdx); + } + } + + }; } // end namespace Dumux diff --git a/dumux/freeflow/compositional/volumevariables.hh b/dumux/freeflow/compositional/volumevariables.hh index d98d5d22fa0c01640f7ee7418c5a379e97b88912..bf362043c0a2669b70fdc3888dbbe7516383e12e 100644 --- a/dumux/freeflow/compositional/volumevariables.hh +++ b/dumux/freeflow/compositional/volumevariables.hh @@ -269,6 +269,16 @@ public: Scalar diffusionCoefficient(int phaseIdx, int compIIdx, int compJIdx) const { return diffCoefficient_(0, compIIdx, compJIdx); } + /*! + * \brief Returns the effective diffusion coefficient \f$\mathrm{[m^2/s]}\f$ + * + * \param compIIdx the index of the component which diffusive + * \param compJIdx the index of the component with respect to which compIIdx diffuses + */ + [[deprecated("Signature deprecated. Use effectiveDiffusionCoefficient(phaseIdx, compIIdx, compJIdx)!")]] + Scalar effectiveDiffusivity(int compIIdx, int compJIdx = 0) const + { return diffusionCoefficient(compIIdx, compJIdx); } + /*! * \brief Returns the effective diffusion coefficients for a phase in \f$[m^2/s]\f$. */