28#ifndef OPM_FLOW_GENERIC_PROBLEM_HPP
29#define OPM_FLOW_GENERIC_PROBLEM_HPP
31#include <opm/material/common/UniformXTabulated2DFunction.hpp>
32#include <opm/material/common/Tabulated1DFunction.hpp>
51template<
typename Gr
id,
typename Gr
idView>
class LookUpData;
59template<
class Gr
idView,
class Flu
idSystem>
60class FlowGenericProblem
63 using Scalar =
typename FluidSystem::Scalar;
64 using TabulatedTwoDFunction = UniformXTabulated2DFunction<Scalar>;
65 using TabulatedFunction = Tabulated1DFunction<Scalar>;
68 Scalar referencePressure;
69 Scalar compressibility;
72 FlowGenericProblem(
const EclipseState& eclState,
73 const Schedule& schedule,
74 const GridView& gridView);
77 static FlowGenericProblem serializationTestObject(
const EclipseState& eclState,
78 const Schedule& schedule,
79 const GridView& gridView);
98 { briefDescription_ = msg; }
138 {
return referencePorosity_[timeIdx][elementIdx]; }
150 return rockFraction_[timeIdx][elementIdx];
157 void setPorosity(Scalar poro,
unsigned elementIdx,
unsigned timeIdx = 0)
158 { referencePorosity_[timeIdx][elementIdx] = poro; }
251 Scalar
porosity(
unsigned globalSpaceIdx,
unsigned timeIdx)
const;
253 bool vapparsActive(
int episodeIdx)
const;
255 int numPressurePointsEquil()
const
256 {
return numPressurePointsEquil_; }
260 template<
class Serializer>
261 void serializeOp(Serializer& serializer)
263 serializer(maxOilSaturation_);
264 serializer(polymer_);
265 serializer(maxWaterSaturation_);
266 serializer(minRefPressure_);
267 serializer(overburdenPressure_);
268 serializer(solventSaturation_);
269 serializer(solventRsw_);
270 serializer(bioeffects_);
274 void initFluidSystem_();
291 bool beginEpisode_(
bool enableExperiments,
293 void beginTimeStep_(
bool enableExperiments,
301 void readRockParameters_(
const std::vector<Scalar>& cellCenterDepths,
302 std::function<std::array<int,3>(
const unsigned)> ijkIndex);
303 void readRockCompactionParameters_();
305 void readBlackoilExtentionsInitialConditions_(std::size_t numDof,
308 bool enablePolymerMolarWeight,
309 bool enableBioeffects,
312 void updatePvtnum_();
313 void updateSatnum_();
314 void updateMiscnum_();
315 void updatePlmixnum_();
317 const EclipseState& eclState_;
318 const Schedule& schedule_;
319 const GridView& gridView_;
321 static inline std::string briefDescription_;
322 std::array<std::vector<Scalar>, 2> referencePorosity_;
323 std::array<std::vector<Scalar>, 2> rockFraction_;
325 std::vector<int> pvtnum_;
326 std::vector<unsigned short> satnum_;
327 std::vector<unsigned short> miscnum_;
328 std::vector<unsigned short> plmixnum_;
330 std::vector<RockParams> rockParams_;
331 std::vector<unsigned short> rockTableIdx_;
332 std::vector<TabulatedTwoDFunction> rockCompPoroMultWc_;
333 std::vector<TabulatedTwoDFunction> rockCompTransMultWc_;
334 std::vector<TabulatedFunction> rockCompPoroMult_;
335 std::vector<TabulatedFunction> rockCompTransMult_;
336 std::vector<Scalar> rockCompTransMultVal_;
339 std::vector<Scalar> maxOilSaturation_;
340 std::vector<Scalar> maxWaterSaturation_;
341 std::vector<Scalar> minRefPressure_;
342 std::vector<Scalar> overburdenPressure_;
343 std::vector<Scalar> solventSaturation_;
344 std::vector<Scalar> solventRsw_;
350 Scalar initialTimeStepSize_;
351 Scalar maxTimeStepAfterWellEvent_;
354 int numPressurePointsEquil_;
356 bool enableDriftCompensation_;
357 bool enableDriftCompensationTemp_{
false};
358 bool explicitRockCompaction_;
361 using Grid = std::remove_cv_t<
typename std::remove_reference<
decltype(gridView_.grid())>::type>;
363 const LookUpData lookUpData_;
369 std::function<unsigned(
unsigned)> lookupIdxOnLevelZeroAssigner_()
371 return [
this](
unsigned elemIdx) {
return lookUpData_.template getFieldPropIdx<Grid>(elemIdx);};
376 void updateNum(
const std::string& name, std::vector<T>& numbers, std::size_t num_regions);
This problem simulates an input file given in the data format used by the commercial ECLiPSE simulato...
This problem simulates an input file given in the data format used by the commercial ECLiPSE simulato...
Definition FlowGenericProblem.hpp:61
void setPorosity(Scalar poro, unsigned elementIdx, unsigned timeIdx=0)
Sets the porosity of an element.
Definition FlowGenericProblem.hpp:157
Scalar maxPolymerAdsorption(unsigned elemIdx) const
Returns the max polymer adsorption value.
Definition FlowGenericProblem_impl.hpp:733
unsigned pvtRegionIndex(unsigned elemIdx) const
Returns the index the relevant PVT region given a cell index.
Definition FlowGenericProblem_impl.hpp:692
Scalar oxygenConcentration(unsigned elemIdx) const
Returns the initial oxygen concentration for a given a cell index.
Definition FlowGenericProblem_impl.hpp:645
Scalar microbialConcentration(unsigned elemIdx) const
Returns the initial microbial concentration for a given a cell index.
Definition FlowGenericProblem_impl.hpp:633
static std::string briefDescription()
Returns a human readable description of the problem for the help message.
Definition FlowGenericProblem_impl.hpp:130
Scalar solventRsw(unsigned elemIdx) const
Returns the initial solvent dissolved in water for a given a cell index.
Definition FlowGenericProblem_impl.hpp:596
Scalar overburdenPressure(unsigned elementIdx) const
Get the pressure of the overburden.
Definition FlowGenericProblem_impl.hpp:574
Scalar porosity(unsigned globalSpaceIdx, unsigned timeIdx) const
Direct indexed access to the porosity.
Definition FlowGenericProblem_impl.hpp:338
Scalar rockCompressibility(unsigned globalSpaceIdx) const
Direct access to rock compressibility.
Definition FlowGenericProblem_impl.hpp:323
unsigned miscnumRegionIndex(unsigned elemIdx) const
Returns the index the relevant MISC region given a cell index.
Definition FlowGenericProblem_impl.hpp:712
Scalar referencePorosity(unsigned elementIdx, unsigned timeIdx) const
Returns the porosity of an element.
Definition FlowGenericProblem.hpp:137
unsigned satnumRegionIndex(unsigned elemIdx) const
Returns the index the relevant saturation function region given a cell index.
Definition FlowGenericProblem_impl.hpp:702
Scalar maxWaterSaturation(unsigned globalDofIdx) const
Returns an element's historic maximum water phase saturation that was observed during the simulation.
Definition FlowGenericProblem_impl.hpp:552
Scalar rockFraction(unsigned elementIdx, unsigned timeIdx) const
Returns the rockFraction of an element.
Definition FlowGenericProblem.hpp:149
Scalar calciteVolumeFraction(unsigned elemIdx) const
Returns the initial calcite volume fraction for a given a cell index.
Definition FlowGenericProblem_impl.hpp:681
unsigned plmixnumRegionIndex(unsigned elemIdx) const
Returns the index the relevant PLMIXNUM (for polymer module) region given a cell index.
Definition FlowGenericProblem_impl.hpp:722
Scalar solventSaturation(unsigned elemIdx) const
Returns the initial solvent saturation for a given a cell index.
Definition FlowGenericProblem_impl.hpp:585
Scalar polymerMolecularWeight(const unsigned elemIdx) const
Returns the polymer molecule weight for a given cell index.
Definition FlowGenericProblem_impl.hpp:621
Scalar minOilPressure(unsigned globalDofIdx) const
Returns an element's historic minimum pressure of the oil phase that was observed during the simulati...
Definition FlowGenericProblem_impl.hpp:563
Scalar ureaConcentration(unsigned elemIdx) const
Returns the initial urea concentration for a given a cell index.
Definition FlowGenericProblem_impl.hpp:657
bool shouldWriteOutput() const
Always returns true.
Definition FlowGenericProblem.hpp:279
static void setBriefDescription(const std::string &msg)
Specifies the string returned by briefDescription().
Definition FlowGenericProblem.hpp:97
Scalar biofilmVolumeFraction(unsigned elemIdx) const
Returns the initial biofilm volume fraction for a given a cell index.
Definition FlowGenericProblem_impl.hpp:669
static std::string helpPreamble(int, const char **argv)
Returns the string that is printed before the list of command line parameters in the help message.
Definition FlowGenericProblem_impl.hpp:115
bool shouldWriteRestartFile() const
Returns true if an eWoms restart file should be written to disk.
Definition FlowGenericProblem.hpp:288
Scalar polymerConcentration(unsigned elemIdx) const
Returns the initial polymer concentration for a given a cell index.
Definition FlowGenericProblem_impl.hpp:609
Definition FlowGenericProblem.hpp:51
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:45
Struct holding MICP extension data.
Definition SolutionContainers.hpp:57
Struct holding CO2 and H2 extension data.
Definition SolutionContainers.hpp:84
Definition FlowGenericProblem.hpp:67
Struct holding polymer extension data.
Definition SolutionContainers.hpp:37