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();
125 const auto& runspec = this->
eclState().runspec();
126 const auto& config = this->
eclState().getSimulationConfig();
127 const auto& phases = runspec.phases();
130 if (config.isThermal()) {
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");
146 if (runspec.micp()) {
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_;
223 if (
const auto& extPFile = this->externalPartitionFile();
224 !extPFile.empty() && (extPFile !=
"none"))
230 this->partitionMethod(), this->serialPartitioning(),
237 this->updateGridView_();
238 this->updateCartesianToCompressedMapping_();
239 this->updateCellDepths_();
240 this->updateCellThickness_();
243 this->distributeFieldProps_(this->
eclState());
247 unsigned int gridEquilIdxToGridIdx(
unsigned int elemIndex)
const {
251 unsigned int gridIdxToEquilGridIdx(
unsigned int elemIndex)
const {
261 std::function<std::array<double,dimensionworld>(
int)>
267 const std::vector<int>& globalCell()
269 return this->
grid().globalCell();
275 this->doCreateGrids_(this->
eclState());
278 void allocTrans()
override
280 OPM_TIMEBLOCK(allocateTrans);
281 globalTrans_.reset(
new TransmissibilityType(this->
eclState(),
289 globalTrans_->update(
false, TransmissibilityType::TransUpdateQuantities::Trans);
292 double getTransmissibility(
unsigned I,
unsigned J)
const override
294 return globalTrans_->transmissibility(I,J);
298 const std::string& zoltanParams()
const override
300 return this->zoltanParams_;
302 const std::string& metisParams()
const override
304 return this->metisParams_;
309 void filterConnections_()
311 this->doFilterConnections_(this->
schedule());
318 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 findOverlapRowsAndColumns.hpp:31
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 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:262
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:318
int numJacobiBlocks() const
Number of blocks in the Block-Jacobi preconditioner.
Definition FlowGenericVanguard.hpp:239
const Schedule & schedule() const
Return a reference to the object that managages the ECL schedule.
Definition FlowGenericVanguard.hpp:168
ParallelWellStruct parallelWells_
Information about wells in parallel.
Definition FlowGenericVanguard.hpp:391
bool enableDistributedWells() const
Whether perforations of a well might be distributed.
Definition FlowGenericVanguard.hpp:289
const EclipseState & eclState() const
Return a reference to the internalized ECL deck.
Definition FlowGenericVanguard.hpp:159
bool ownersFirst() const
Parameter that decide if cells owned by rank are ordered before ghost cells.
Definition FlowGenericVanguard.hpp:251
Dune::EdgeWeightMethod edgeWeightsMethod() const
Parameter deciding the edge-weight strategy of the load balancer.
Definition FlowGenericVanguard.hpp:233
Definition GenericCpGridVanguard.hpp:78
const CartesianIndexMapper & cartesianIndexMapper() const
Definition GenericCpGridVanguard.cpp:568
static void setExternalLoadBalancer(const std::function< std::vector< int >(const Dune::CpGrid &)> &loadBalancer)
Definition GenericCpGridVanguard.hpp:123
Dune::CpGrid & grid()
Definition GenericCpGridVanguard.hpp:91
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
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
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
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