Merge pull request #654 from andlaus/fix_rate_conversion
Fix rate conversion
This commit is contained in:
commit
c0627c2305
@ -547,14 +547,13 @@ protected:
|
|||||||
flatIdx_ = timeStepWellIdx_*phaseUses_.num_phases + phaseUses_.phase_pos[phaseIdx_];
|
flatIdx_ = timeStepWellIdx_*phaseUses_.num_phases + phaseUses_.phase_pos[phaseIdx_];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// return m^3/s of injected or produced fluid
|
||||||
double rate(const WellState& wellState)
|
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;
|
double value = 0;
|
||||||
if (wellState.wellRates().size() > 0) {
|
if (wellState.wellRates().size() > 0) {
|
||||||
assert(int(wellState.wellRates().size()) > flatIdx_);
|
assert(int(wellState.wellRates().size()) > flatIdx_);
|
||||||
value = sign_ * wellState.wellRates()[flatIdx_] * convFactor;
|
value = sign_ * wellState.wellRates()[flatIdx_];
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@ -668,7 +667,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Why only positive rates?
|
// 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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -711,10 +712,11 @@ public:
|
|||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Is the rate average for the timestep, or is in
|
// due to using an Euler method as time integration scheme, the well rate is the
|
||||||
// instantaneous (in which case trapezoidal or Simpson integration
|
// average for the time step. For more complicated time stepping schemes, the
|
||||||
// would probably be better)
|
// integral of the rate is not simply multiplying two numbers...
|
||||||
const double intg = timer.stepLengthTaken() * rate(wellState);
|
const double intg = timer.stepLengthTaken() * rate(wellState);
|
||||||
|
|
||||||
// add this timesteps production to the total
|
// add this timesteps production to the total
|
||||||
total_ += intg;
|
total_ += intg;
|
||||||
// report the new production total
|
// report the new production total
|
||||||
|
Loading…
Reference in New Issue
Block a user