From 60534d66b6cc4f0e6b66b3f83300f2befe94ef1f Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Wed, 24 Feb 2021 12:56:38 +0100 Subject: [PATCH 1/3] FOR TESTING. Enable Diffusion by default --- ebos/eclproblem.hh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index eba3a2d3e..df798b3b7 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -323,6 +323,12 @@ struct EnableGravity { static constexpr bool value = true; }; +// Enable diffusion +template +struct EnableDiffusion { + static constexpr bool value = true; +}; + // only write the solutions for the report steps to disk template struct EnableWriteAllSolutions { From 48ad67601090d9042dc35c4cc89a1a5fcea90816 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Thu, 25 Feb 2021 11:14:12 +0100 Subject: [PATCH 2/3] only update diffusivity when DIFFUSIVE is in the deck --- ebos/ecltransmissibility.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ebos/ecltransmissibility.hh b/ebos/ecltransmissibility.hh index 9d2bcaf3b..8e2f5b69c 100644 --- a/ebos/ecltransmissibility.hh +++ b/ebos/ecltransmissibility.hh @@ -127,7 +127,7 @@ public: // get the ntg values, the ntg values are modified for the cells merged with minpv const std::vector& ntg = eclState.fieldProps().get_double("NTG"); - + const bool updateDiffusivity = eclState.getSimulationConfig().isDiffusive() && enableDiffusion; unsigned numElements = elemMapper.size(); extractPermeability_(); @@ -183,7 +183,7 @@ public: } // if diffusion is enabled, let's do the same for the "diffusivity" - if (enableDiffusion) { + if (updateDiffusivity) { diffusivity_->clear(); diffusivity_->reserve(numElements*3*1.05); extractPorosity_(); @@ -396,7 +396,7 @@ public: trans_[isId_(elemIdx, outsideElemIdx)] = trans; // update the "thermal half transmissibility" for the intersection - if (enableDiffusion) { + if (updateDiffusivity) { Scalar halfDiffusivity1; Scalar halfDiffusivity2; From ffe51aa346b111e851e6d03a5a5f93c26b839446 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Thu, 25 Feb 2021 15:22:01 +0100 Subject: [PATCH 3/3] return 0 diffusivity if diffusion in disabled --- ebos/ecltransmissibility.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ebos/ecltransmissibility.hh b/ebos/ecltransmissibility.hh index 8e2f5b69c..8ef288cb6 100644 --- a/ebos/ecltransmissibility.hh +++ b/ebos/ecltransmissibility.hh @@ -498,7 +498,13 @@ public: * \brief Return the diffusivity for the intersection between two elements. */ Scalar diffusivity(unsigned elemIdx1, unsigned elemIdx2) const - { return diffusivity_->at(isId_(elemIdx1, elemIdx2)); } + { + if(diffusivity_->empty()) + return 0.0; + + return diffusivity_->at(isId_(elemIdx1, elemIdx2)); + + } private: