addressing review comments for PR OPM/opm-simulators#4429

This commit is contained in:
Kai Bao 2023-02-21 13:40:25 +01:00
parent 73dc31a7a5
commit 7a67b16c3e
5 changed files with 10 additions and 10 deletions

View File

@ -110,7 +110,7 @@ public:
}
private:
const std::vector<Aquancon::AquancCell> connections_;
const std::vector<Aquancon::AquancCell>& connections_;
SingleAquiferFlux aquifer_data_;
std::vector<int> cellToConnectionIdx_;
std::vector<Eval> connection_flux_;
@ -119,17 +119,13 @@ private:
void initializeConnections() {
this->cellToConnectionIdx_.resize(this->ebos_simulator_.gridView().size(/*codim=*/0), -1);
const auto& gridView = this->ebos_simulator_.vanguard().gridView();
for (std::size_t idx = 0; idx < this->connections_.size(); ++idx) {
const auto global_index = this->connections_[idx].global_index;
const int cell_index = this->ebos_simulator_.vanguard().compressedIndex(global_index);
auto elemIt = gridView.template begin</*codim=*/ 0>();
if (cell_index > 0)
std::advance(elemIt, cell_index);
const int cell_index = this->ebos_simulator_.vanguard().compressedIndexForInterior(global_index);
//the global_index is not part of this grid
if (cell_index < 0 || elemIt->partitionType() != Dune::InteriorEntity)
if (cell_index < 0) {
continue;
}
this->cellToConnectionIdx_[cell_index] = idx;
}

View File

@ -21,6 +21,9 @@
#include <opm/simulators/aquifers/AquiferConstantFlux.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <algorithm>
#include <memory>
#include <stdexcept>
namespace Opm

View File

@ -133,7 +133,7 @@ add_test_compare_parallel_simulation(CASENAME numerical_aquifer_3d_2aqu
DIR aquifer-num
TEST_ARGS --tolerance-cnv=0.000003 --time-step-control=pid --linear-solver=cpr_trueimpes)
add_test_compare_parallel_simulation(CASENAME aquflux-01
add_test_compare_parallel_simulation(CASENAME aquflux_01
FILENAME AQUFLUX-01
SIMULATOR flow
ABS_TOL ${abs_tol}

View File

@ -186,7 +186,7 @@ add_test_compareECLFiles(CASENAME numerical_aquifer_3d_1aqu
DIR aquifer-num
TEST_ARGS --tolerance-cnv=0.00003 --time-step-control=pid --linear-solver=cpr_trueimpes)
add_test_compareECLFiles(CASENAME aquflux-01
add_test_compareECLFiles(CASENAME aquflux_01
FILENAME AQUFLUX-01
SIMULATOR flow
ABS_TOL ${abs_tol}

View File

@ -83,6 +83,7 @@ tests[ctaquifer_2d_oilwater]="flow aquifer-oilwater 2D_OW_CTAQUIFER"
tests[fetkovich_2d]="flow aquifer-fetkovich 2D_FETKOVICHAQUIFER"
tests[numerical_aquifer_3d_1aqu]="flow aquifer-num 3D_1AQU_3CELLS"
tests[numerical_aquifer_3d_2aqu]="flow aquifer-num 3D_2AQU_NUM"
tests[aquflux_01]="flow aquifers AQUFLUX-01"
tests[msw_2d_h]="flow msw_2d_h 2D_H__"
tests[msw_3d_hfa]="flow msw_3d_hfa 3D_MSW"
tests[polymer_oilwater]="flow polymer_oilwater 2D_OILWATER_POLYMER"