Loading...
Searching...
No Matches
ScheduleGrid.hpp
/*
Copyright 2021 Equinor ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SCHEDULE_GRID
#define SCHEDULE_GRID
#include <opm/input/eclipse/Schedule/CompletedCells.hpp>
#include <cstddef>
#include <functional>
#include <optional>
#include <string>
#include <unordered_map>
#include <vector>
namespace Opm {
class EclipseGrid;
class FieldPropsManager;
class NumericalAquifers;
struct NumericalAquiferCell;
} // namespace Opm
namespace Opm {
class ScheduleGrid
{
public:
explicit ScheduleGrid(CompletedCells& completed_cells);
ScheduleGrid(CompletedCells& completed_cells,
std::vector<CompletedCells>& completed_cells_lgr,
const std::unordered_map<std::string, std::size_t>& label_to_index_);
ScheduleGrid(const EclipseGrid& ecl_grid,
const FieldPropsManager& fpm,
CompletedCells& completed_cells);
ScheduleGrid(const EclipseGrid& ecl_grid,
const FieldPropsManager& fpm,
CompletedCells& completed_cells,
std::vector<CompletedCells>& completed_cells_lgr,
const std::unordered_map<std::string, std::size_t>& label_to_index_);
void include_numerical_aquifers(const NumericalAquifers& num_aquifers);
const CompletedCells::Cell&
get_cell(std::size_t i, std::size_t j, std::size_t k) const;
const CompletedCells::Cell&
get_cell(std::size_t i, std::size_t j, std::size_t k, const std::optional<std::string>& tag) const;
const EclipseGrid* get_grid() const;
int get_lgr_grid_number(const std::optional<std::string>& lgr_label) const;
private:
const EclipseGrid* grid{nullptr};
const FieldPropsManager* fp{nullptr};
std::reference_wrapper<CompletedCells> cells;
std::reference_wrapper<std::vector<CompletedCells>> cells_lgr;
std::reference_wrapper<const std::unordered_map<std::string, std::size_t>> label_to_index;
std::unordered_map<std::size_t, const NumericalAquiferCell*> num_aqu_cells{};
const CompletedCells::Cell&
get_cell_lgr(std::size_t i, std::size_t j, std::size_t k, const std::string& tag) const;
void populate_props_from_main_grid(CompletedCells::Cell& cell) const;
void populate_props_from_main_grid_cell(CompletedCells::Cell& cell) const;
void populate_props_from_num_aquifer(const NumericalAquiferCell& numAquCell,
CompletedCells::Cell& cell) const;
void populate_props_lgr(const std::string& tag,
CompletedCells::Cell& cell) const;
const NumericalAquiferCell*
get_num_aqu_cell(const std::size_t global_index) const;
};
} // namespace Opm
#endif // SCHEDULE_GRID
Opm::CompletedCells
Sparse collection of cells, and their properties, intersected by one or more well connections.
Definition CompletedCells.hpp:36
Opm::EclipseGrid
About cell information and dimension: The actual grid information is held in a pointer to an ERT ecl_...
Definition EclipseGrid.hpp:61
Opm::FieldPropsManager
Definition FieldPropsManager.hpp:42
Opm::NumericalAquifers
Definition NumericalAquifers.hpp:38
Opm::ScheduleGrid::get_grid
const EclipseGrid * get_grid() const
Retrieve underlying grid object.
Definition ScheduleGrid.cpp:129
Opm::ScheduleGrid::get_cell
const CompletedCells::Cell & get_cell(std::size_t i, std::size_t j, std::size_t k) const
Retrieve particular intersected cell in main grid.
Definition ScheduleGrid.cpp:97
Opm::ScheduleGrid::include_numerical_aquifers
void include_numerical_aquifers(const NumericalAquifers &num_aquifers)
Make collection aware of numerical aquifers.
Definition ScheduleGrid.cpp:91
Opm::ScheduleGrid::get_lgr_grid_number
int get_lgr_grid_number(const std::optional< std::string > &lgr_label) const
Translate LGR name into a numeric grid index.
Definition ScheduleGrid.cpp:134
Opm::ScheduleGrid::ScheduleGrid
ScheduleGrid(CompletedCells &completed_cells)
Constructor.
Definition ScheduleGrid.cpp:55
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Opm::CompletedCells::Cell
Identification and associate properties of cell intersected by one or more well connections.
Definition CompletedCells.hpp:41
Opm::NumericalAquiferCell
Definition NumericalAquiferCell.hpp:31