24#ifndef DUMUX_TWOP_CORNERPOINT_TEST_SPATIAL_PARAMS_HH
25#define DUMUX_TWOP_CORNERPOINT_TEST_SPATIAL_PARAMS_HH
28#include <opm/parser/eclipse/Deck/Deck.hpp>
40template<
class Gr
idGeometry,
class Scalar>
41class TwoPCornerPointTestSpatialParams
42:
public FVSpatialParams<GridGeometry, Scalar, TwoPCornerPointTestSpatialParams<GridGeometry, Scalar>>
44 using GridView =
typename GridGeometry::GridView;
45 using Element =
typename GridView::template Codim<0>::Entity;
46 using FVElementGeometry =
typename GridGeometry::LocalView;
47 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
48 using ThisType = TwoPCornerPointTestSpatialParams<GridGeometry, Scalar>;
49 using ParentType = FVSpatialParams<GridGeometry, Scalar, ThisType>;
51 static constexpr int dimWorld = GridView::dimensionworld;
52 using GlobalPosition =
typename Element::Geometry::GlobalCoordinate;
54 using EffectiveLaw = RegularizedVanGenuchten<Scalar>;
56 using DimWorldMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
59 using MaterialLaw = EffToAbsLaw<EffectiveLaw>;
60 using MaterialLawParams =
typename MaterialLaw::Params;
61 using PermeabilityType = DimWorldMatrix;
63 TwoPCornerPointTestSpatialParams(std::shared_ptr<const GridGeometry> gridGeometry,
64 std::shared_ptr<const Opm::Deck> deck)
65 : ParentType(gridGeometry)
68 homogeneous_ = getParam<bool>(
"Problem.Homogeneous");
70 const std::vector<int>& globalCell = this->gridGeometry().gridView().grid().globalCell();
72 if (deck_->hasKeyword(
"PORO")) {
73 std::cout <<
"Found PORO..." << std::endl;
74 std::vector<double> eclVector = deck_->getKeyword(
"PORO").getRawDoubleData();
75 porosity_.resize(globalCell.size());
77 for (
size_t i = 0; i < globalCell.size(); ++i) {
81 porosity_[i] = eclVector[globalCell[i]];
85 if (deck_->hasKeyword(
"PERMX")) {
86 std::cout <<
"Found PERMX..." << std::endl;
87 std::vector<double> eclVector = deck_->getKeyword(
"PERMX").getRawDoubleData();
88 permX_.resize(globalCell.size());
90 for (
size_t i = 0; i < globalCell.size(); ++i) {
93 permX_[i] = 9.86923e-16;
95 permX_[i] = 9.86923e-16*eclVector[globalCell[i]];
99 if (deck_->hasKeyword(
"PERMZ")) {
100 std::cout <<
"Found PERMZ..." << std::endl;
101 std::vector<double> eclVector = deck_->getKeyword(
"PERMZ").getRawDoubleData();
102 permZ_.resize(globalCell.size());
104 for (
size_t i = 0; i < globalCell.size(); ++i) {
107 permZ_[i] = 9.86923e-16;
109 permZ_[i] = 9.86923e-16*eclVector[globalCell[i]];
113 std::cout <<
"PERMZ not found, set equal to PERMX..." << std::endl;
118 materialParams_.setVgAlpha(0.00045);
119 materialParams_.setVgn(7.3);
132 template<
class ElementSolution>
134 const SubControlVolume& scv,
135 const ElementSolution& elemSol)
const
137 int eIdx = this->gridGeometry().gridView().indexSet().index(element);
139 PermeabilityType K(0);
140 K[0][0] = K[1][1] = permX_[eIdx];
141 K[2][2] = permZ_[eIdx];
154 template<
class ElementSolution>
155 Scalar
porosity(
const Element& element,
156 const SubControlVolume& scv,
157 const ElementSolution& elemSol)
const
159 int eIdx = this->gridGeometry().gridView().indexSet().index(element);
160 return porosity_[eIdx];
171 template<
class ElementSolution>
172 const MaterialLawParams& materialLawParams(
const Element& element,
173 const SubControlVolume& scv,
174 const ElementSolution& elemSol)
const
176 return materialParams_;
185 template<
class Flu
idSystem>
186 int wettingPhaseAtPos(
const GlobalPosition& globalPos)
const
188 return FluidSystem::phase0Idx;
191 Scalar permeabilityX(
int eIdx)
192 {
return permX_[eIdx]; }
194 Scalar permeabilityZ(
int eIdx)
195 {
return permZ_[eIdx]; }
198 std::shared_ptr<const Opm::Deck> deck_;
199 MaterialLawParams materialParams_;
200 std::vector<Scalar> porosity_;
201 std::vector<Scalar> permX_;
202 std::vector<Scalar> permZ_;
209#warning "The opm-grid module is needed to use this class!"
Implementation of the regularized version of the van Genuchten's capillary pressure / relative permea...
The base class for spatial parameters of multi-phase problems using a fully implicit discretization m...
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
std::string permeability() noexcept
I/O name of permeability.
Definition: name.hh:143
std::string porosity() noexcept
I/O name of porosity.
Definition: name.hh:139
This material law takes a material law defined for effective saturations and converts it to a materia...