diff --git a/dumux/material/fluidsystems/brine.hh b/dumux/material/fluidsystems/brine.hh index 67685a187ebcdaa5cbda4d6bd7c4c8b2d739c3db..77d3d3adb7784e4e8adc6eb61a6198a9f546e8cf 100644 --- a/dumux/material/fluidsystems/brine.hh +++ b/dumux/material/fluidsystems/brine.hh @@ -423,6 +423,11 @@ public: { if (phaseIdx == liquidPhaseIdx) { + if (compIIdx > compJIdx) + { + using std::swap; + swap(compIIdx, compJIdx); + } //! \todo TODO implement binary coefficients // http://webserver.dmt.upm.es/~isidoro/dat1/Mass%20diffusivity%20data.htm // The link above was given as a reference in brine_air fluid system. diff --git a/dumux/porousmediumflow/1pnc/volumevariables.hh b/dumux/porousmediumflow/1pnc/volumevariables.hh index f3a67cb668bb6a5eedc739e1832bb025e66dbabf..a098d5499eac056172fdf92bb452940cd4be6328 100644 --- a/dumux/porousmediumflow/1pnc/volumevariables.hh +++ b/dumux/porousmediumflow/1pnc/volumevariables.hh @@ -99,11 +99,21 @@ public: // Could be avoided if diffusion coefficients also // became part of the fluid state. typename FluidSystem::ParameterCache paramCache; + paramCache.updatePhase(fluidState_, 0); - diffCoeff_[0] = 0.0; // the main component with itself doesn't have a binary diffusion coefficient - for (unsigned int compJIdx = 1; compJIdx < numFluidComps; ++compJIdx) - diffCoeff_[compJIdx] = FluidSystem::binaryDiffusionCoefficient(fluidState_, paramCache, 0, 0, compJIdx); + for (unsigned int compIIdx = 0; compIIdx < numFluidComps; ++compIIdx) + { + for (unsigned int compJIdx = 0; compJIdx < numFluidComps; ++compJIdx) + { + if(compIIdx != compJIdx) + diffCoeff_[compIIdx][compJIdx] = FluidSystem::binaryDiffusionCoefficient(fluidState_, + paramCache, + 0, + compIIdx, + compJIdx); + } + } } /*! @@ -294,7 +304,7 @@ public: Scalar diffusionCoefficient(int phaseIdx, int compIdx) const { assert(compIdx < numFluidComps); - return diffCoeff_[compIdx]; + return diffCoeff_[phaseIdx][compIdx]; } /*! @@ -330,8 +340,8 @@ protected: SolidState solidState_; private: - PermeabilityType permeability_; //!< Effective permeability within the control volume - Dune::FieldVector<Scalar, numFluidComps> diffCoeff_; //!< Binary diffusion coefficients + PermeabilityType permeability_; + std::array<std::array<Scalar, numFluidComps>, numFluidComps> diffCoeff_; }; } // end namespace Dumux