#1483 Update opm-flowdiagnostics and ..-applications

to b6e59ddcd2fe, and ccaaa4dd1b55 respectively.

In order to include flowCapacityStorageCapacityCurve with max pv fraction threshold
This commit is contained in:
Jacob Støren
2017-05-29 13:08:32 +02:00
parent 4d41f43a99
commit 4e091641a4
24 changed files with 6608 additions and 101 deletions

View File

@@ -69,11 +69,13 @@ namespace FlowDiagnostics
/// al. (SPE 146446), Shook and Mitchell (SPE 124625).
Graph flowCapacityStorageCapacityCurve(const Toolbox::Forward& injector_solution,
const Toolbox::Reverse& producer_solution,
const std::vector<double>& pv)
const std::vector<double>& pv,
const double max_pv_fraction)
{
return flowCapacityStorageCapacityCurve(injector_solution.fd.timeOfFlight(),
producer_solution.fd.timeOfFlight(),
pv);
pv,
max_pv_fraction);
}
@@ -88,20 +90,30 @@ namespace FlowDiagnostics
/// al. (SPE 146446), Shook and Mitchell (SPE 124625).
Graph flowCapacityStorageCapacityCurve(const std::vector<double>& injector_tof,
const std::vector<double>& producer_tof,
const std::vector<double>& pv)
const std::vector<double>& pv,
const double max_pv_fraction)
{
if (pv.size() != injector_tof.size() || pv.size() != producer_tof.size()) {
throw std::runtime_error("flowCapacityStorageCapacityCurve(): "
"Input solutions must have same size.");
}
// Compute max pv cutoff.
const double total_pv = std::accumulate(pv.begin(), pv.end(), 0.0);
const double max_pv = max_pv_fraction * total_pv;
// Sort according to total travel time.
const int n = pv.size();
typedef std::pair<double, double> D2;
std::vector<D2> time_and_pv(n);
for (int ii = 0; ii < n; ++ii) {
time_and_pv[ii].first = injector_tof[ii] + producer_tof[ii]; // Total travel time.
time_and_pv[ii].second = pv[ii];
if (pv[ii] > max_pv) {
time_and_pv[ii].first = 1e100;
time_and_pv[ii].second = 0.0;
} else {
time_and_pv[ii].first = injector_tof[ii] + producer_tof[ii]; // Total travel time.
time_and_pv[ii].second = pv[ii];
}
}
std::sort(time_and_pv.begin(), time_and_pv.end());

View File

@@ -44,11 +44,19 @@ namespace FlowDiagnostics
/// coefficient. For a technical description see Shavali et
/// al. (SPE 146446), Shook and Mitchell (SPE 124625).
///
/// Single cells with a very large pore volume can be filtered out
/// before creating the curve. The 'max_pv_fraction' parameter
/// gives a fraction such that, if a cell's fraction of the total
/// pore volume is above this number, that cell will be
/// ignored. This can be used to disregard numerical aquifers for
/// example.
///
/// Returns F (flow capacity) as a function of Phi (storage capacity),
/// that is for the returned Graph g, g.first is Phi and g.second is F.
Graph flowCapacityStorageCapacityCurve(const Toolbox::Forward& injector_solution,
const Toolbox::Reverse& producer_solution,
const std::vector<double>& pore_volume);
const std::vector<double>& pore_volume,
const double max_pv_fraction = 1.0);
/// This overload gets the injector and producer time-of-flight
/// directly instead of extracting it from the solution
@@ -56,7 +64,8 @@ namespace FlowDiagnostics
/// overload.
Graph flowCapacityStorageCapacityCurve(const std::vector<double>& injector_tof,
const std::vector<double>& producer_tof,
const std::vector<double>& pore_volume);
const std::vector<double>& pore_volume,
const double max_pv_fraction = 1.0);
/// The Lorenz coefficient from the F-Phi curve.
///