mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Make check whether a connection exists work for distributed wells.
This commit is contained in:
parent
bd06dff7e2
commit
a9a733ebc1
@ -563,6 +563,7 @@ namespace Opm {
|
|||||||
int globalNumWells = 0;
|
int globalNumWells = 0;
|
||||||
// Make wells_ecl_ contain only this partition's non-shut wells.
|
// Make wells_ecl_ contain only this partition's non-shut wells.
|
||||||
wells_ecl_ = getLocalNonshutWells(report_step, globalNumWells);
|
wells_ecl_ = getLocalNonshutWells(report_step, globalNumWells);
|
||||||
|
local_parallel_well_info_ = createLocalParallelWellInfo(wells_ecl_);
|
||||||
|
|
||||||
this->initializeWellProdIndCalculators();
|
this->initializeWellProdIndCalculators();
|
||||||
initializeWellPerfData();
|
initializeWellPerfData();
|
||||||
@ -614,19 +615,17 @@ namespace Opm {
|
|||||||
std::size_t completion_index = 0;
|
std::size_t completion_index = 0;
|
||||||
well_perf_data_[well_index].clear();
|
well_perf_data_[well_index].clear();
|
||||||
well_perf_data_[well_index].reserve(well.getConnections().size());
|
well_perf_data_[well_index].reserve(well.getConnections().size());
|
||||||
|
CheckDistributedWellConnections checker(well, *local_parallel_well_info_[well_index]);
|
||||||
|
|
||||||
for (const auto& completion : well.getConnections()) {
|
for (const auto& completion : well.getConnections()) {
|
||||||
|
const int i = completion.getI();
|
||||||
|
const int j = completion.getJ();
|
||||||
|
const int k = completion.getK();
|
||||||
|
const int cart_grid_indx = i + cartDims[0] * (j + cartDims[1] * k);
|
||||||
|
const int active_index = cartesian_to_compressed_[cart_grid_indx];
|
||||||
if (completion.state() == Connection::State::OPEN) {
|
if (completion.state() == Connection::State::OPEN) {
|
||||||
const int i = completion.getI();
|
if (active_index >= 0) {
|
||||||
const int j = completion.getJ();
|
checker.connectionFound(completion_index);
|
||||||
const int k = completion.getK();
|
|
||||||
const int cart_grid_indx = i + cartDims[0] * (j + cartDims[1] * k);
|
|
||||||
const int active_index = cartesian_to_compressed_[cart_grid_indx];
|
|
||||||
if (active_index < 0) {
|
|
||||||
const std::string msg
|
|
||||||
= ("Cell with i,j,k indices " + std::to_string(i) + " " + std::to_string(j) + " "
|
|
||||||
+ std::to_string(k) + " not found in grid (well = " + well.name() + ").");
|
|
||||||
OPM_THROW(std::runtime_error, msg);
|
|
||||||
} else {
|
|
||||||
PerforationData pd;
|
PerforationData pd;
|
||||||
pd.cell_index = active_index;
|
pd.cell_index = active_index;
|
||||||
pd.connection_transmissibility_factor = completion.CF();
|
pd.connection_transmissibility_factor = completion.CF();
|
||||||
@ -635,6 +634,7 @@ namespace Opm {
|
|||||||
well_perf_data_[well_index].push_back(pd);
|
well_perf_data_[well_index].push_back(pd);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
checker.connectionFound(completion_index);
|
||||||
if (completion.state() != Connection::State::SHUT) {
|
if (completion.state() != Connection::State::SHUT) {
|
||||||
OPM_THROW(std::runtime_error,
|
OPM_THROW(std::runtime_error,
|
||||||
"Completion state: " << Connection::State2String(completion.state()) << " not handled");
|
"Completion state: " << Connection::State2String(completion.state()) << " not handled");
|
||||||
@ -642,6 +642,7 @@ namespace Opm {
|
|||||||
}
|
}
|
||||||
++completion_index;
|
++completion_index;
|
||||||
}
|
}
|
||||||
|
checker.checkAllConnectionsFound();
|
||||||
++well_index;
|
++well_index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1194,23 +1194,23 @@ namespace Opm
|
|||||||
|
|
||||||
// COMPDAT handling
|
// COMPDAT handling
|
||||||
const auto& connectionSet = well_ecl_.getConnections();
|
const auto& connectionSet = well_ecl_.getConnections();
|
||||||
|
CheckDistributedWellConnections checker(well_ecl_, parallel_well_info_);
|
||||||
for (size_t c=0; c<connectionSet.size(); c++) {
|
for (size_t c=0; c<connectionSet.size(); c++) {
|
||||||
const auto& connection = connectionSet.get(c);
|
const auto& connection = connectionSet.get(c);
|
||||||
|
const int i = connection.getI();
|
||||||
|
const int j = connection.getJ();
|
||||||
|
const int k = connection.getK();
|
||||||
|
|
||||||
|
const int* cpgdim = cart_dims;
|
||||||
|
const int cart_grid_indx = i + cpgdim[0]*(j + cpgdim[1]*k);
|
||||||
|
const int cell = cartesian_to_compressed[cart_grid_indx];
|
||||||
|
if (connection.state() != Connection::State::OPEN || cell >= 0)
|
||||||
|
{
|
||||||
|
checker.connectionFound(c);
|
||||||
|
}
|
||||||
if (connection.state() == Connection::State::OPEN) {
|
if (connection.state() == Connection::State::OPEN) {
|
||||||
const int i = connection.getI();
|
|
||||||
const int j = connection.getJ();
|
|
||||||
const int k = connection.getK();
|
|
||||||
|
|
||||||
const int* cpgdim = cart_dims;
|
if (cell >= 0) {
|
||||||
const int cart_grid_indx = i + cpgdim[0]*(j + cpgdim[1]*k);
|
|
||||||
const int cell = cartesian_to_compressed[cart_grid_indx];
|
|
||||||
|
|
||||||
if (cell < 0) {
|
|
||||||
OPM_DEFLOG_THROW(std::runtime_error, "Cell with i,j,k indices " << i << ' ' << j << ' '
|
|
||||||
<< k << " not found in grid (well = " << name() << ')', deferred_logger);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
double radius = connection.rw();
|
double radius = connection.rw();
|
||||||
const std::array<double, 3> cubical =
|
const std::array<double, 3> cubical =
|
||||||
wellhelpers::getCubeDim<3>(cell_to_faces, begin_face_centroids, cell);
|
wellhelpers::getCubeDim<3>(cell_to_faces, begin_face_centroids, cell);
|
||||||
@ -1242,6 +1242,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
checker.checkAllConnectionsFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
|
Loading…
Reference in New Issue
Block a user