27#ifndef OPM_CPGRID_VANGUARD_HPP
28#define OPM_CPGRID_VANGUARD_HPP
30#include <opm/common/TimingMacros.hpp>
48template <
class TypeTag>
52namespace Opm::Properties {
56 using InheritsFrom = std::tuple<FlowBaseVanguard>;
61template<
class TypeTag>
65template<
class TypeTag>
67 using type = Dune::CpGrid;
69template<
class TypeTag>
85template <
class TypeTag>
88 GetPropType<TypeTag, Properties::GridView>,
89 GetPropType<TypeTag, Properties::Scalar>>
104 static constexpr int dimensionworld = Grid::dimensionworld;
106 static constexpr bool waterEnabled = Indices::waterEnabled;
107 static constexpr bool gasEnabled = Indices::gasEnabled;
108 static constexpr bool oilEnabled = Indices::oilEnabled;
110 using Element =
typename GridView::template Codim<0>::Entity;
117 this->callImplementationInit();
132 throw std::runtime_error(
"Input specifies energy while simulator has disabled it, try xxx_energy");
136 throw std::runtime_error(
"Input specifies no energy while simulator has energy, try run without _energy");
140 if (
config.isDiffusive()) {
142 throw std::runtime_error(
"Input specifies diffusion while simulator has disabled it, try xxx_diffusion");
148 throw std::runtime_error(
"Input specifies MICP while simulator has it disabled");
152 if (
phases.active(Phase::BRINE)) {
154 throw std::runtime_error(
"Input specifies Brine while simulator has it disabled");
158 if (
phases.active(Phase::POLYMER)) {
160 throw std::runtime_error(
"Input specifies Polymer while simulator has it disabled");
165 if (
phases.active(Phase::ZFRACTION)) {
167 throw std::runtime_error(
"Input specifies ExBo while simulator has it disabled");
170 if (
phases.active(Phase::FOAM)) {
172 throw std::runtime_error(
"Input specifies Foam while simulator has it disabled");
176 if (
phases.active(Phase::SOLVENT)) {
178 throw std::runtime_error(
"Input specifies Solvent while simulator has it disabled");
181 if(
phases.active(Phase::WATER)){
182 if(waterEnabled ==
false){
183 throw std::runtime_error(
"Input specifies water while simulator has it disabled");
186 if(
phases.active(Phase::GAS)){
187 if(gasEnabled ==
false){
188 throw std::runtime_error(
"Input specifies gas while simulator has it disabled");
191 if(
phases.active(Phase::OIL)){
192 if(oilEnabled ==
false){
193 throw std::runtime_error(
"Input specifies oil while simulator has it disabled");
206 globalTrans_.reset();
209 const TransmissibilityType& globalTransmissibility()
const
211 assert( globalTrans_ !=
nullptr );
212 return *globalTrans_;
233 this->allow_splitting_inactive_wells_,
240 this->updateGridView_();
241 this->updateCartesianToCompressedMapping_();
242 this->updateCellDepths_();
243 this->updateCellThickness_();
259 OpmLog::info(
"\nAdding LGRs to the grid and updating its leaf grid view");
260 this->addLgrsUpdateLeafView(
lgrs,
lgrs.size(), *
this->grid_);
264 unsigned int gridEquilIdxToGridIdx(
unsigned int elemIndex)
const {
268 unsigned int gridIdxToEquilGridIdx(
unsigned int elemIndex)
const {
278 std::function<std::array<double,dimensionworld>(
int)>
284 const std::vector<int>& globalCell()
286 return this->
grid().globalCell();
292 this->doCreateGrids_(this->
eclState());
295 void allocTrans()
override
298 globalTrans_.reset(
new TransmissibilityType(this->
eclState(),
306 globalTrans_->update(
false, TransmissibilityType::TransUpdateQuantities::Trans);
309 double getTransmissibility(
unsigned I,
unsigned J)
const override
311 return globalTrans_->transmissibility(I,J);
332 void filterConnections_()
334 this->doFilterConnections_(this->
schedule());
341 std::unique_ptr<TransmissibilityType> globalTrans_;
This file ensures that flow can be compiled in the presence of dune-fem.
Helper class for grid instantiation of ECL file-format using problems.
Helper class for grid instantiation of ECL file-format using problems.
Declares the properties required by the black oil model.
Definition CollectDataOnIORank.hpp:49
const GridView & gridView() const
Returns a reference to the grid view to be used.
Definition basevanguard.hh:69
Helper class for grid instantiation of ECL file-format using problems.
Definition CpGridVanguard.hpp:90
void releaseGlobalTransmissibilities()
Free the memory occupied by the global transmissibility object.
Definition CpGridVanguard.hpp:204
void addLgrs()
Add LGRs and update Leaf Grid View in the simulation grid.
Definition CpGridVanguard.hpp:253
void checkConsistency()
Checking consistency of simulator.
Definition CpGridVanguard.hpp:123
std::function< std::array< double, dimensionworld >(int)> cellCentroids() const
Get function to query cell centroids for a distributed grid.
Definition CpGridVanguard.hpp:279
void loadBalance()
Distribute the simulation grid over multiple processes.
Definition CpGridVanguard.hpp:220
Helper class for grid instantiation of ECL file-format using problems.
Definition FlowBaseVanguard.hpp:83
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.
Definition FlowBaseVanguard.hpp:297
int numJacobiBlocks() const
Number of blocks in the Block-Jacobi preconditioner.
Definition FlowGenericVanguard.hpp:247
const Schedule & schedule() const
Return a reference to the object that managages the ECL schedule.
Definition FlowGenericVanguard.hpp:176
ParallelWellStruct parallelWells_
Information about wells in parallel.
Definition FlowGenericVanguard.hpp:425
bool enableDistributedWells() const
Whether perforations of a well might be distributed.
Definition FlowGenericVanguard.hpp:307
const EclipseState & eclState() const
Return a reference to the internalized ECL deck.
Definition FlowGenericVanguard.hpp:167
bool enableEclOutput() const
Whether or not to emit result files that are compatible with a commercial reservoir simulator.
Definition FlowGenericVanguard.hpp:314
bool ownersFirst() const
Parameter that decide if cells owned by rank are ordered before ghost cells.
Definition FlowGenericVanguard.hpp:259
Dune::EdgeWeightMethod edgeWeightsMethod() const
Parameter deciding the edge-weight strategy of the load balancer.
Definition FlowGenericVanguard.hpp:241
Definition GenericCpGridVanguard.hpp:79
const CartesianIndexMapper & cartesianIndexMapper() const
Returns the object which maps a global element index of the simulation grid to the corresponding elem...
Definition GenericCpGridVanguard.cpp:623
static void setExternalLoadBalancer(const std::function< std::vector< int >(const Dune::CpGrid &)> &loadBalancer)
Sets a function that returns external load balancing information when passed the grid.
Definition GenericCpGridVanguard.hpp:125
Dune::CpGrid & grid()
Return a reference to the simulation grid.
Definition GenericCpGridVanguard.hpp:93
Definition Transmissibility.hpp:54
Defines the common properties required by the porous medium multi-phase models.
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition propertysystem.hh:235
Definition FlowBaseVanguard.hpp:69
The type of the DUNE grid.
Definition basicproperties.hh:100
Definition CpGridVanguard.hpp:55
Property which provides a Vanguard (manages grids)
Definition basicproperties.hh:96