From 341d14519b3ea8b2a7a9405910190ba5fc99c816 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Wed, 23 Sep 2020 09:58:55 +0200 Subject: [PATCH] Allow negative injection rates for completions --- src/opm/output/eclipse/Summary.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/opm/output/eclipse/Summary.cpp b/src/opm/output/eclipse/Summary.cpp index fc703a9e0..6b259b0f1 100644 --- a/src/opm/output/eclipse/Summary.cpp +++ b/src/opm/output/eclipse/Summary.cpp @@ -493,7 +493,7 @@ template< rt phase, bool injection = true> inline quantity crate( const fn_args& args ) { const quantity zero = { 0, rate_unit< phase >() }; // The args.num value is the literal value which will go to the - // NUMS array in the eclispe SMSPEC file; the values in this array + // NUMS array in the eclipse SMSPEC file; the values in this array // are offset 1 - whereas we need to use this index here to look // up a completion with offset 0. const size_t global_index = args.num - 1; @@ -509,13 +509,13 @@ inline quantity crate( const fn_args& args ) { [=]( const Opm::data::Connection& c ) { return c.index == global_index; } ); - + if (well_data.current_control.isProducer == injection) return zero; if( completion == well_data.connections.end() ) return zero; double eff_fac = efac( args.eff_factors, name ); auto v = completion->rates.get( phase, 0.0 ) * eff_fac; - if( ( v > 0 ) != injection ) return zero; - if( !injection ) v *= -1; + if (!injection) + v *= -1; if( phase == rt::polymer || phase == rt::brine ) return { v, measure::mass_rate }; return { v, rate_unit< phase >() };