From 088cac68015ed62d833042d1fa93cedc6512d063 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Mon, 12 Jan 2015 07:19:18 +0100 Subject: [PATCH] BUGFIX: Avoid inclusion of disgas in the vapoil contribution A temporary copy is added to avoid inclusion of dissolved gas when the vaporized oil contribution is added in the accumulation term for the oil phase. --- opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp index dee7dc0d5..271c5a305 100644 --- a/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp +++ b/opm/autodiff/FullyImplicitBlackoilSolver_impl.hpp @@ -613,8 +613,12 @@ namespace { const int po = pu.phase_pos[ Oil ]; const int pg = pu.phase_pos[ Gas ]; + // Temporary copy to avoid contribution of dissolved gas in the vaporized oil + // when both dissolved gas and vaporized oil are present. + const ADB accum_gas_copy =rq_[pg].accum[aix]; + rq_[pg].accum[aix] += state.rs * rq_[po].accum[aix]; - rq_[po].accum[aix] += state.rv * rq_[pg].accum[aix]; + rq_[po].accum[aix] += state.rv * accum_gas_copy; //DUMP(rq_[pg].accum[aix]); } }