mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-24 16:30:02 -06:00
Merge pull request #494 from totto82/crossflow
Add support for banning cross-flow in a well
This commit is contained in:
commit
2bf42e1eb2
@ -1041,6 +1041,25 @@ namespace detail {
|
||||
selectProducingPerforations[c] = 1;
|
||||
}
|
||||
|
||||
// Handle cross flow
|
||||
const V numInjectingPerforations = (wops_.p2w * ADB::constant(selectInjectingPerforations)).value();
|
||||
const V numProducingPerforations = (wops_.p2w * ADB::constant(selectProducingPerforations)).value();
|
||||
for (int w = 0; w < nw; ++w) {
|
||||
if (!wells().allow_cf[w]) {
|
||||
for (int perf = wells().well_connpos[w] ; perf < wells().well_connpos[w+1]; ++perf) {
|
||||
// Crossflow is not allowed; reverse flow is prevented.
|
||||
// At least one of the perforation must be open in order to have a meeningful
|
||||
// equation to solve. For the special case where all perforations have reverse flow,
|
||||
// and the target rate is non-zero all of the perforations are keept open.
|
||||
if (wells().type[w] == INJECTOR && numInjectingPerforations[w] > 0) {
|
||||
selectProducingPerforations[perf] = 0.0;
|
||||
} else if (wells().type[w] == PRODUCER && numProducingPerforations[w] > 0 ){
|
||||
selectInjectingPerforations[perf] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// HANDLE FLOW INTO WELLBORE
|
||||
// compute phase volumetric rates at standard conditions
|
||||
std::vector<ADB> cq_ps(np, ADB::null());
|
||||
|
Loading…
Reference in New Issue
Block a user