opm-simulators
Loading...
Searching...
No Matches
Opm::FlowBaseVanguard< TypeTag > Class Template Reference

Helper class for grid instantiation of ECL file-format using problems. More...

#include <FlowBaseVanguard.hpp>

Inheritance diagram for Opm::FlowBaseVanguard< TypeTag >:
Opm::BaseVanguard< TypeTag > Opm::FlowGenericVanguard Opm::AluGridVanguard< TypeTag > Opm::CpGridVanguard< TypeTag > Opm::PolyhedralGridVanguard< TypeTag >

Public Types

using Grid = GetPropType<TypeTag, Properties::Grid>
using GridView = GetPropType<TypeTag, Properties::GridView>
Public Types inherited from Opm::FlowGenericVanguard
using ParallelWellStruct = std::vector<std::pair<std::string,bool>>

Public Member Functions

virtual ~FlowBaseVanguard ()=default
 Empty virtual dtor.
 FlowBaseVanguard (Simulator &simulator)
 Create the grid for problem data files which use the ECL file format.
const CartesianIndexMapper & cartesianMapper () const
const std::array< int, dimension > & cartesianDimensions () const
 Returns the number of logically Cartesian cells in each direction.
int cartesianSize () const
 Returns the overall number of cells of the logically Cartesian grid.
int equilCartesianSize () const
 Returns the overall number of cells of the logically EquilCartesian grid.
unsigned cartesianIndex (unsigned compressedCellIdx) const
 Returns the Cartesian cell id for identifaction with ECL data.
unsigned cartesianIndex (const std::array< int, dimension > &coords) const
 Return the index of the cells in the logical Cartesian grid.
int compressedIndex (int cartesianCellIdx) const
 Return compressed index from cartesian index.
int compressedIndexForInterior (int cartesianCellIdx) const
 Return compressed index from cartesian index only in interior.
virtual int compressedIndexForInteriorLGR (const std::string &lgr_tag, const Connection &conn) const
void cartesianCoordinate (unsigned cellIdx, std::array< int, 3 > &ijk) const
 Extract Cartesian index triplet (i,j,k) of an active cell.
unsigned equilCartesianIndex (unsigned compressedEquilCellIdx) const
 Returns the Cartesian cell id given an element index for the grid used for equilibration.
void equilCartesianCoordinate (unsigned cellIdx, std::array< int, 3 > &ijk) const
 Extract Cartesian index triplet (i,j,k) of an active cell of the grid used for EQUIL.
Scalar cellCenterDepth (unsigned globalSpaceIdx) const
 Returns the depth of a degree of freedom [m].
const std::vector< Scalar > & cellCenterDepths () const
Scalar cellThickness (unsigned globalSpaceIdx) const
 Returns the thickness of a degree of freedom [m].
std::size_t globalNumCells () const
 Get the number of cells in the global leaf grid view.
Public Member Functions inherited from Opm::BaseVanguard< TypeTag >
 BaseVanguard (Simulator &simulator)
 BaseVanguard (const BaseVanguard &)=delete
const GridView & gridView () const
 Returns a reference to the grid view to be used.
int gridSequenceNumber () const
 Returns the number of times the grid has been changed since its creation.
void loadBalance ()
 Distribute the grid (and attached data) over all processes.
void addLgrs ()
 Add LGRs to the grid, if any.
Public Member Functions inherited from Opm::FlowGenericVanguard
 FlowGenericVanguard ()
 Constructor.
 FlowGenericVanguard (SimulationModelParams &&params)
 ~FlowGenericVanguard ()
 Destructor.
double setupTime ()
 Returns the wall time required to set up the simulator before it was born.
void defineSimulationModel (SimulationModelParams &&params)
 Set the simulation configuration objects.
const EclipseState & eclState () const
 Return a reference to the internalized ECL deck.
EclipseState & eclState ()
const Schedule & schedule () const
 Return a reference to the object that managages the ECL schedule.
Schedule & schedule ()
const SummaryConfig & summaryConfig () const
 Return a reference to the object that determines which quantities ought to be put into the ECL summary output.
SummaryState & summaryState ()
 Returns the summary state.
const SummaryState & summaryState () const
Action::State & actionState ()
 Returns the action state.
const Action::State & actionState () const
UDQState & udqState ()
 Returns the udq state.
const UDQState & udqState () const
std::unique_ptr< WellTestState > transferWTestState ()
const std::string & caseName () const
 Returns the name of the case.
Dune::EdgeWeightMethod edgeWeightsMethod () const
 Parameter deciding the edge-weight strategy of the load balancer.
int numJacobiBlocks () const
 Number of blocks in the Block-Jacobi preconditioner.
bool ownersFirst () const
 Parameter that decide if cells owned by rank are ordered before ghost cells.
bool edgeConformal () const
bool enableDistributedWells () const
 Whether perforations of a well might be distributed.
bool enableEclOutput () const
 Whether or not to emit result files that are compatible with a commercial reservoir simulator.
const ParallelWellStruct & parallelWells () const
 Retrieve collection (a vector of pairs) of well names and whether or not the corresponding well objects are perforated on the current rank.
template<class Serializer>
void serializeOp (Serializer &serializer)
bool operator== (const FlowGenericVanguard &rhs) const

Static Public Member Functions

static void registerParameters ()
 Register the common run-time parameters for all ECL simulator vanguards.
Static Public Member Functions inherited from Opm::FlowGenericVanguard
static SimulationModelParams serializationTestParams ()
static std::string canonicalDeckPath (const std::string &caseName)
 Returns the canonical path to a deck file.
static void readDeck (const std::string &filename)
 Read a deck.
static void setCommunication (std::unique_ptr< Opm::Parallel::Communication > comm)
 Set global communication.
static Parallel::Communication & comm ()
 Obtain global communicator.

Protected Types

using Element = typename GridView::template Codim<0>::Entity
using CartesianIndexMapper = Dune::CartesianIndexMapper<Grid>

Protected Member Functions

template<class CartMapper>
std::function< std::array< double, dimensionworld >(int)> cellCentroids_ (const CartMapper &cartMapper, const bool &isCpGrid) const
 Get function to query cell centroids for a distributed grid.
void callImplementationInit ()
void updateCartesianToCompressedMapping_ ()
void updateCellDepths_ ()
void updateCellThickness_ ()
Protected Member Functions inherited from Opm::BaseVanguard< TypeTag >
void finalizeInit_ ()
void updateGridView_ ()
Protected Member Functions inherited from Opm::FlowGenericVanguard
void updateOutputDir_ (std::string outputDir, bool enableEclCompatFile)
void updateNOSIM_ (std::string_view enableDryRun)
bool drsdtconEnabled () const
std::unordered_map< std::size_t, const NumericalAquiferCell * > allAquiferCells () const
void init ()

Protected Attributes

std::unordered_map< int, int > cartesianToCompressed_
 Mapping between cartesian and compressed cells.
std::optional< std::vector< std::unordered_map< std::size_t, std::size_t > > > lgrMappers_
 Mapping between LGR cartesian and compressed cells.
std::vector< Scalar > cellCenterDepth_
 Cell center depths.
std::vector< Scalar > cellThickness_
 Cell thickness.
std::vector< int > is_interior_
 Whether a cells is in the interior.
Protected Attributes inherited from Opm::FlowGenericVanguard
double setupTime_
std::string caseName_
std::string fileName_
Dune::EdgeWeightMethod edgeWeightsMethod_
bool ownersFirst_
bool edgeConformal_
bool enableDistributedWells_
bool enableEclOutput_
bool allow_splitting_inactive_wells_
std::string ignoredKeywords_
std::optional< int > outputInterval_
bool useMultisegmentWell_
bool enableExperiments_
std::unique_ptr< SummaryState > summaryState_
std::unique_ptr< UDQState > udqState_
std::unique_ptr< Action::State > actionState_
std::unique_ptr< WellTestState > wtestState_
std::shared_ptr< Python > python
std::shared_ptr< EclipseState > eclState_
std::shared_ptr< Schedule > eclSchedule_
std::shared_ptr< SummaryConfig > eclSummaryConfig_
ParallelWellStruct parallelWells_
 Information about wells in parallel.

Static Protected Attributes

static const int dimension = Grid::dimension
static const int dimensionworld = Grid::dimensionworld
Static Protected Attributes inherited from Opm::FlowGenericVanguard
static std::unique_ptr< Parallel::Communication > comm_

Additional Inherited Members

Static Public Attributes inherited from Opm::FlowGenericVanguard
static SimulationModelParams modelParams_
Static Protected Member Functions inherited from Opm::FlowGenericVanguard
template<class Scalar>
static void registerParameters_ ()

Detailed Description

template<class TypeTag>
class Opm::FlowBaseVanguard< TypeTag >

Helper class for grid instantiation of ECL file-format using problems.

Constructor & Destructor Documentation

◆ FlowBaseVanguard()

template<class TypeTag>
Opm::FlowBaseVanguard< TypeTag >::FlowBaseVanguard ( Simulator & simulator)
inlineexplicit

Create the grid for problem data files which use the ECL file format.

This is the file format used by the commercial ECLiPSE simulator. Usually it uses a cornerpoint description of the grid.

Member Function Documentation

◆ cartesianCoordinate()

template<class TypeTag>
void Opm::FlowBaseVanguard< TypeTag >::cartesianCoordinate ( unsigned cellIdx,
std::array< int, 3 > & ijk ) const
inline

Extract Cartesian index triplet (i,j,k) of an active cell.

Parameters
[in]cellIdxActive cell index.
[out]ijkCartesian index triplet

◆ cellCenterDepth()

template<class TypeTag>
Scalar Opm::FlowBaseVanguard< TypeTag >::cellCenterDepth ( unsigned globalSpaceIdx) const
inline

Returns the depth of a degree of freedom [m].

For ECL problems this is defined as the average of the depth of an element and is thus slightly different from the depth of an element's centroid.

◆ cellCentroids_()

template<class TypeTag>
template<class CartMapper>
std::function< std::array< double, dimensionworld >(int)> Opm::FlowBaseVanguard< TypeTag >::cellCentroids_ ( const CartMapper & cartMapper,
const bool & isCpGrid ) const
inlineprotected

Get function to query cell centroids for a distributed grid.

Currently this only non-empty for a loadbalanced CpGrid. It is a function return the centroid for the given element index.

Parameters
cartMapperThe cartesian index mapper for lookup of cartesian indices
isCpGridTrue if grid is a CpGrid

◆ cellThickness()

template<class TypeTag>
Scalar Opm::FlowBaseVanguard< TypeTag >::cellThickness ( unsigned globalSpaceIdx) const
inline

Returns the thickness of a degree of freedom [m].

For ECL problems this is defined as the average of the depths of the top surface corners minus the average of the depths of the bottom surface corners The cell thickness is computed only when needed.

◆ compressedIndex()

template<class TypeTag>
int Opm::FlowBaseVanguard< TypeTag >::compressedIndex ( int cartesianCellIdx) const
inline

Return compressed index from cartesian index.

Returns
compressed index of cell is in interior, -1 otherwise

◆ compressedIndexForInterior()

template<class TypeTag>
int Opm::FlowBaseVanguard< TypeTag >::compressedIndexForInterior ( int cartesianCellIdx) const
inline

Return compressed index from cartesian index only in interior.

Returns
compressed index of cell is in interior, -1 otherwise

◆ equilCartesianCoordinate()

template<class TypeTag>
void Opm::FlowBaseVanguard< TypeTag >::equilCartesianCoordinate ( unsigned cellIdx,
std::array< int, 3 > & ijk ) const
inline

Extract Cartesian index triplet (i,j,k) of an active cell of the grid used for EQUIL.

Parameters
[in]cellIdxActive cell index.
[out]ijkCartesian index triplet

◆ globalNumCells()

template<class TypeTag>
std::size_t Opm::FlowBaseVanguard< TypeTag >::globalNumCells ( ) const
inline

Get the number of cells in the global leaf grid view.

\warn This is a collective operation that needs to be called on all ranks.

Member Data Documentation

◆ cartesianToCompressed_

template<class TypeTag>
std::unordered_map<int,int> Opm::FlowBaseVanguard< TypeTag >::cartesianToCompressed_
protected

Mapping between cartesian and compressed cells.

It is initialized the first time it is called

◆ lgrMappers_

template<class TypeTag>
std::optional<std::vector<std::unordered_map<std::size_t, std::size_t> > > Opm::FlowBaseVanguard< TypeTag >::lgrMappers_
mutableprotected

Mapping between LGR cartesian and compressed cells.

It is initialized as it is called


The documentation for this class was generated from the following file: