EclipseWriter: don't convert the unit inside the rate() function
because if that is done, the integration for the production total is wrong because the time step length is days and not seconds. Note that the conversion now uses Opm::unit::convert::to(<>, 1/conversionFactor) instead of simply multiplying with the conversion factor. I still think this obfuscates things more than it helps, but [at] bska will hopefully want it this way...
This commit is contained in:
1 parent
6659070eac
commit
7ce561095c
1 file changed
+5
-4
@@ -547,14 +547,13 @@ protected:
|
||||
flatIdx_ = timeStepWellIdx_*phaseUses_.num_phases + phaseUses_.phase_pos[phaseIdx_];
|
||||
}
|
||||
|
||||
// return m^3/s of injected or produced fluid
|
||||
double rate(const WellState& wellState)
|
||||
{
|
||||
// convert m^3/s of injected fluid to m^3/d of produced fluid
|
||||
const double convFactor = Opm::unit::day;
|
||||
double value = 0;
|
||||
if (wellState.wellRates().size() > 0) {
|
||||
assert(int(wellState.wellRates().size()) > flatIdx_);
|
||||
value = sign_ * wellState.wellRates()[flatIdx_] * convFactor;
|
||||
value = sign_ * wellState.wellRates()[flatIdx_];
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@@ -668,7 +667,9 @@ public:
|
||||
}
|
||||
|
||||
// TODO: Why only positive rates?
|
||||
return std::max(0., rate(wellState));
|
||||
using namespace Opm::unit;
|
||||
return convert::to(std::max(0., rate(wellState)),
|
||||
cubic(meter)/day);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user