Implemented well_controls based on well_controls_iset_xxx() functions.
This commit is contained in:
parent
57226cde9e
commit
a19881f5f4
@ -22,7 +22,6 @@
|
|||||||
#include <opm/core/utility/Units.hpp>
|
#include <opm/core/utility/Units.hpp>
|
||||||
#include <opm/core/grid.h>
|
#include <opm/core/grid.h>
|
||||||
#include <opm/core/wells.h>
|
#include <opm/core/wells.h>
|
||||||
#define HAVE_WELLCONTROLS
|
|
||||||
#include <opm/core/well_controls.h>
|
#include <opm/core/well_controls.h>
|
||||||
#include <opm/core/props/IncompPropertiesInterface.hpp>
|
#include <opm/core/props/IncompPropertiesInterface.hpp>
|
||||||
#include <opm/core/props/BlackoilPropertiesInterface.hpp>
|
#include <opm/core/props/BlackoilPropertiesInterface.hpp>
|
||||||
@ -459,22 +458,25 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
src.resize(num_cells);
|
src.resize(num_cells);
|
||||||
for (int w = 0; w < wells.number_of_wells; ++w) {
|
for (int w = 0; w < wells.number_of_wells; ++w) {
|
||||||
const int cur = wells.ctrls[w]->current;
|
const int cur = well_controls_get_current(wells.ctrls[w]);
|
||||||
if (wells.ctrls[w]->num != 1) {
|
if (well_controls_get_num(wells.ctrls[w]) != 1) {
|
||||||
OPM_MESSAGE("In wellsToSrc(): well has more than one control, all but current control will be ignored.");
|
OPM_MESSAGE("In wellsToSrc(): well has more than one control, all but current control will be ignored.");
|
||||||
}
|
}
|
||||||
if (wells.ctrls[w]->type[cur] != RESERVOIR_RATE) {
|
if (well_controls_iget_type(wells.ctrls[w] , cur) != RESERVOIR_RATE) {
|
||||||
OPM_THROW(std::runtime_error, "In wellsToSrc(): well is something other than RESERVOIR_RATE.");
|
OPM_THROW(std::runtime_error, "In wellsToSrc(): well is something other than RESERVOIR_RATE.");
|
||||||
}
|
}
|
||||||
if (wells.well_connpos[w+1] - wells.well_connpos[w] != 1) {
|
if (wells.well_connpos[w+1] - wells.well_connpos[w] != 1) {
|
||||||
OPM_THROW(std::runtime_error, "In wellsToSrc(): well has multiple perforations.");
|
OPM_THROW(std::runtime_error, "In wellsToSrc(): well has multiple perforations.");
|
||||||
}
|
}
|
||||||
for (int p = 0; p < np; ++p) {
|
{
|
||||||
if (wells.ctrls[w]->distr[np*cur + p] != 1.0) {
|
const double * distr = well_controls_iget_distr( wells.ctrls[w] , cur);
|
||||||
OPM_THROW(std::runtime_error, "In wellsToSrc(): well not controlled on total rate.");
|
for (int p = 0; p < np; ++p) {
|
||||||
|
if (distr[p] != 1.0) {
|
||||||
|
OPM_THROW(std::runtime_error, "In wellsToSrc(): well not controlled on total rate.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
double flow = wells.ctrls[w]->target[cur];
|
double flow = well_controls_iget_target(wells.ctrls[w] , cur);
|
||||||
if (wells.type[w] == INJECTOR) {
|
if (wells.type[w] == INJECTOR) {
|
||||||
flow *= wells.comp_frac[np*w + 0]; // Obtaining water rate for inflow source.
|
flow *= wells.comp_frac[np*w + 0]; // Obtaining water rate for inflow source.
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user