From 49a8c7bfd1587dcca189591d34e9ae8533efb39f Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Fri, 8 Mar 2019 14:25:47 +0100 Subject: [PATCH] changing the sign of the mass balance equations for ms wells following the conventions with StandardWell --- opm/autodiff/MultisegmentWell_impl.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/opm/autodiff/MultisegmentWell_impl.hpp b/opm/autodiff/MultisegmentWell_impl.hpp index d1c2be900..ffc2d5868 100644 --- a/opm/autodiff/MultisegmentWell_impl.hpp +++ b/opm/autodiff/MultisegmentWell_impl.hpp @@ -1883,9 +1883,9 @@ namespace Opm const EvalWell segment_surface_volume = getSegmentSurfaceVolume(ebosSimulator, seg); // for each component for (int comp_idx = 0; comp_idx < num_components_; ++comp_idx) { - const EvalWell accumulation_term = (segment_fluid_initial_[seg][comp_idx] - - segment_surface_volume * surfaceVolumeFraction(seg, comp_idx) ) / dt - + getSegmentRate(seg, comp_idx); + const EvalWell accumulation_term = (segment_surface_volume * surfaceVolumeFraction(seg, comp_idx) + - segment_fluid_initial_[seg][comp_idx]) / dt + - getSegmentRate(seg, comp_idx); resWell_[seg][comp_idx] += accumulation_term.value(); for (int pv_idx = 0; pv_idx < numWellEq; ++pv_idx) { @@ -1899,9 +1899,9 @@ namespace Opm for (const int inlet : segment_inlets_[seg]) { for (int comp_idx = 0; comp_idx < num_components_; ++comp_idx) { const EvalWell inlet_rate = getSegmentRate(inlet, comp_idx); - resWell_[seg][comp_idx] -= inlet_rate.value(); + resWell_[seg][comp_idx] += inlet_rate.value(); for (int pv_idx = 0; pv_idx < numWellEq; ++pv_idx) { - duneD_[seg][inlet][comp_idx][pv_idx] -= inlet_rate.derivative(pv_idx + numEq); + duneD_[seg][inlet][comp_idx][pv_idx] += inlet_rate.derivative(pv_idx + numEq); } } } @@ -1932,7 +1932,7 @@ namespace Opm connectionRates_[perf][comp_idx] = Base::restrictEval(cq_s_effective); // subtract sum of phase fluxes in the well equations. - resWell_[seg][comp_idx] -= cq_s_effective.value(); + resWell_[seg][comp_idx] += cq_s_effective.value(); // assemble the jacobians for (int pv_idx = 0; pv_idx < numWellEq; ++pv_idx) { @@ -1941,7 +1941,7 @@ namespace Opm duneC_[seg][cell_idx][pv_idx][comp_idx] -= cq_s_effective.derivative(pv_idx + numEq); // intput in transformed matrix // the index name for the D should be eq_idx / pv_idx - duneD_[seg][seg][comp_idx][pv_idx] -= cq_s_effective.derivative(pv_idx + numEq); + duneD_[seg][seg][comp_idx][pv_idx] += cq_s_effective.derivative(pv_idx + numEq); } for (int pv_idx = 0; pv_idx < numEq; ++pv_idx) {