diff --git a/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.hpp b/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.hpp index 867bfbaeb..fe1f42eb6 100644 --- a/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.hpp +++ b/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.hpp @@ -41,8 +41,6 @@ namespace Opm { const std::unordered_map & aquifers() const; bool operator==(const NumericalAquifers& other) const; - std::array, 3> transToRemove(const EclipseGrid& grid) const; - std::unordered_map allAquiferCells() const; std::vector aquiferNNCs(const EclipseGrid& grid, const FieldPropsManager& fp) const; @@ -60,7 +58,6 @@ namespace Opm { std::unordered_map m_aquifers; void addAquiferCell(const NumericalAquiferCell& aqu_cell); - void addAquiferConnections(const Deck &deck, const EclipseGrid &grid); }; } diff --git a/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp b/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp index b01dd4208..408a9a078 100644 --- a/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp +++ b/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp @@ -55,14 +55,8 @@ namespace Opm { size_t numConnections() const; const NumericalAquiferCell* getCellPrt(size_t index) const; - // we remove the connection around the aquifer cells to isolate aquifer cells - // from the other part of the reservoir - // the removing of the connection is done by make transmissiblities to be zero - std::array, 3> transToRemove(const EclipseGrid& grid) const; - std::unordered_map aquiferCellProps() const; - void appendNNC(const EclipseGrid& grid, const FieldPropsManager& fp, NNC& nnc) const; std::vector aquiferNNCs(const EclipseGrid& grid, const FieldPropsManager& fp) const; bool operator==(const SingleNumericalAquifer& other) const; diff --git a/src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.cpp b/src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.cpp index abde76d90..9d4714d1d 100644 --- a/src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.cpp +++ b/src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.cpp @@ -147,17 +147,6 @@ namespace Opm { return cells; } - std::array, 3> NumericalAquifers::transToRemove(const EclipseGrid& grid) const { - std::array, 3> trans; - for (const auto& [id, aquifer] : this->m_aquifers) { - auto trans_aquifer = aquifer.transToRemove(grid); - for (size_t i = 0; i < 3; ++i) { - trans[i].merge(trans_aquifer[i]); - } - } - return trans; - } - const std::unordered_map& NumericalAquifers::aquifers() const { return this->m_aquifers; } diff --git a/src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.cpp b/src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.cpp index 569db83db..d88f3dca7 100644 --- a/src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.cpp +++ b/src/opm/parser/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.cpp @@ -58,34 +58,6 @@ namespace Opm { return this->connections_.size(); } - std::array, 3> SingleNumericalAquifer::transToRemove(const EclipseGrid& grid) const { - std::array, 3> trans; - for (const auto& cell : this->cells_) { - const size_t i = cell.I; - const size_t j = cell.J; - const size_t k = cell.K; - if (AquiferHelpers::neighborCellInsideReservoirAndActive(grid, i, j, k, FaceDir::XPlus)) { - trans[0].insert(cell.global_index); - } - if (AquiferHelpers::neighborCellInsideReservoirAndActive(grid, i, j, k, FaceDir::XMinus)) { - trans[0].insert(grid.getGlobalIndex(i-1, j, k)); - } - if (AquiferHelpers::neighborCellInsideReservoirAndActive(grid, i, j, k, FaceDir::YPlus)) { - trans[1].insert(cell.global_index); - } - if (AquiferHelpers::neighborCellInsideReservoirAndActive(grid, i, j, k, FaceDir::YMinus)) { - trans[1].insert(grid.getGlobalIndex(i, j-1, k)); - } - if (AquiferHelpers::neighborCellInsideReservoirAndActive(grid, i, j, k, FaceDir::ZPlus)) { - trans[2].insert(cell.global_index); - } - if (AquiferHelpers::neighborCellInsideReservoirAndActive(grid, i, j, k, FaceDir::ZMinus)) { - trans[2].insert(grid.getGlobalIndex(i, j, k-1)); - } - } - return trans; - } - size_t SingleNumericalAquifer::id() const { return this->id_; } diff --git a/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp b/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp index 2176ed30e..2f44fde4d 100644 --- a/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp +++ b/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp @@ -1218,8 +1218,12 @@ bool FieldProps::tran_active(const std::string& keyword) const { void FieldProps::apply_numerical_aquifers(const NumericalAquifers& numerical_aquifers) { auto& porv_data = this->init_get("PORV").data; auto& poro_data = this->init_get("PORO").data; - auto& satnum_data = this->int_data["SATNUM"].data; - auto& pvtnum_data = this->int_data["PVTNUM"].data; + auto& satnum_data = this->init_get("SATNUM").data; + auto& pvtnum_data = this->init_get("PVTNUM").data; + + auto& permx_data = this->init_get("PERMX").data; + auto& permy_data = this->init_get("PERMY").data; + auto& permz_data = this->init_get("PERMZ").data; const auto& aqu_cell_props = numerical_aquifers.aquiferCellProps(); for (const auto& [global_index, cellprop] : aqu_cell_props) { @@ -1230,42 +1234,11 @@ void FieldProps::apply_numerical_aquifers(const NumericalAquifers& numerical_aqu this->cell_depth[active_index] = cellprop.depth; satnum_data[active_index] = cellprop.satnum; pvtnum_data[active_index] = cellprop.pvtnum; - } - this->updateTransWithNumericalAquifer(numerical_aquifers); -} - -void FieldProps::updateTransWithNumericalAquifer(const NumericalAquifers& numerical_aquifers) { - const std::array, 3> trans_to_remove = numerical_aquifers.transToRemove(*(this->grid_ptr)); - std::array, 3> index_lists; - for (int i = 0; i < 3; ++i) { - size_t num = 0; - for (const auto& elem : trans_to_remove[i]) { - const size_t active_index = this->grid_ptr->activeIndex(elem); - index_lists[i].emplace_back(elem, active_index, num); - num++; - } - } - - const std::array trans_string {"TRANX", "TRANY", "TRANZ"}; - for (int i = 0; i < 3; ++i) { - const std::string& target_kw = trans_string[i]; - const std::vector& single_index_list = index_lists[i]; - auto tran_iter = this->tran.find(target_kw); - if (tran_iter == this->tran.end()) { - const std::string msg = trans_string[i] + " TranCalculator could not be found when applying numerical aquifer"; - throw std::logic_error(msg); - } - const std::string unique_name = tran_iter->second.next_name(); - const auto operation = Fieldprops::ScalarOperation::EQUAL; - tran_iter->second.add_action(operation, unique_name); - const auto kw_info = tran_iter->second.make_kw_info(operation); - auto& field_data = this->init_get(unique_name, kw_info); - // setting the transmissiblity to be zero to remove the connection between specific cells - FieldProps::apply(operation, field_data.data, field_data.value_status, 0.0, single_index_list); - // TODO: not sure when we need the following. If we need, we also need to make a global_index_list; - /* if (field_data.global_data) - FieldProps::apply(operation, *field_data.global_data, *field_data.global_value_status, scalar_value, box.global_index_list()); */ + // isolate the numerical aquifer cells by setting permeability to be zero + permx_data[active_index] = 0.; + permy_data[active_index] = 0.; + permz_data[active_index] = 0.; } } diff --git a/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.hpp b/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.hpp index 28746e670..2f2aac904 100644 --- a/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.hpp +++ b/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.hpp @@ -362,9 +362,6 @@ public: void reset_actnum(const std::vector& actnum); void apply_numerical_aquifers(const NumericalAquifers& numerical_aquifers); - // set the transmissiblities around the numerical aquifer cells to be zero, so we can isolate them - // from the other reservoir cells - void updateTransWithNumericalAquifer(const NumericalAquifers& numerical_aquifer); const std::string& default_region() const;