28 #ifndef EWOMS_GROUND_WATER_PROBLEM_HH
29 #define EWOMS_GROUND_WATER_PROBLEM_HH
34 #include <opm/material/components/SimpleH2O.hpp>
35 #include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
36 #include <opm/material/fluidsystems/LiquidPhase.hpp>
37 #include <opm/common/Unused.hpp>
39 #include <dune/grid/yaspgrid.hh>
40 #include <dune/grid/io/file/dgfparser/dgfyasp.hh>
42 #include <dune/common/version.hh>
43 #include <dune/common/fmatrix.hh>
44 #include <dune/common/fvector.hh>
50 template <
class TypeTag>
55 namespace Properties {
67 SET_PROP(GroundWaterBaseProblem, Fluid)
73 typedef Opm::LiquidPhase<Scalar, Opm::SimpleH2O<Scalar> > type;
77 SET_TYPE_PROP(GroundWaterBaseProblem, Grid, Dune::YaspGrid<2>);
102 SET_STRING_PROP(GroundWaterBaseProblem, GridFile, "./data/groundwater_2d.dgf");
106 SET_TAG_PROP(GroundWaterBaseProblem, LinearSolverSplice, ParallelIstlLinearSolver);
108 Ewoms::Linear::SolverWrapperConjugatedGradients<TypeTag>);
124 template <
class TypeTag>
127 typedef typename GET_PROP_TYPE(TypeTag, BaseProblem) ParentType;
136 dim = GridView::dimension,
137 dimWorld = GridView::dimensionworld,
140 pressure0Idx = Indices::pressure0Idx
143 typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
144 typedef typename
GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
146 typedef typename
GET_PROP_TYPE(TypeTag, RateVector) RateVector;
147 typedef typename
GET_PROP_TYPE(TypeTag, BoundaryRateVector) BoundaryRateVector;
148 typedef typename
GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
151 typedef typename GridView::ctype CoordScalar;
152 typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition;
154 typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;
161 : ParentType(simulator)
169 ParentType::finishInit();
179 lensUpperRight_[0] =
EWOMS_GET_PARAM(TypeTag, Scalar, LensUpperRightX);
181 lensUpperRight_[1] =
EWOMS_GET_PARAM(TypeTag, Scalar, LensUpperRightY);
183 lensUpperRight_[2] =
EWOMS_GET_PARAM(TypeTag, Scalar, LensUpperRightY);
185 intrinsicPerm_ = this->toDimMatrix_(
EWOMS_GET_PARAM(TypeTag, Scalar, Permeability));
186 intrinsicPermLens_ = this->toDimMatrix_(
EWOMS_GET_PARAM(TypeTag, Scalar, PermeabilityLens));
194 ParentType::registerParameters();
197 "The x-coordinate of the lens' lower-left corner "
200 "The x-coordinate of the lens' upper-right corner "
205 "The y-coordinate of the lens' lower-left "
208 "The y-coordinate of the lens' upper-right "
214 "The z-coordinate of the lens' lower-left "
217 "The z-coordinate of the lens' upper-right "
222 "The intrinsic permeability [m^2] of the ambient "
225 "The intrinsic permeability [m^2] of the lens.");
238 std::ostringstream oss;
239 oss <<
"groundwater_" << Model::name();
249 this->model().checkConservativeness();
253 this->model().globalStorage(storage);
256 if (this->gridView().comm().rank() == 0) {
257 std::cout <<
"Storage: " << storage << std::endl << std::flush;
265 template <
class Context>
267 unsigned spaceIdx OPM_UNUSED,
268 unsigned timeIdx OPM_UNUSED)
const
269 {
return 273.15 + 10; }
274 template <
class Context>
276 unsigned spaceIdx OPM_UNUSED,
277 unsigned timeIdx OPM_UNUSED)
const
283 template <
class Context>
286 unsigned timeIdx)
const
288 if (isInLens_(context.pos(spaceIdx, timeIdx)))
289 return intrinsicPermLens_;
291 return intrinsicPerm_;
303 template <
class Context>
304 void boundary(BoundaryRateVector& values,
const Context& context,
305 unsigned spaceIdx,
unsigned timeIdx)
const
307 const GlobalPosition& globalPos = context.pos(spaceIdx, timeIdx);
309 if (onLowerBoundary_(globalPos) || onUpperBoundary_(globalPos)) {
311 Scalar T = temperature(context, spaceIdx, timeIdx);
312 if (onLowerBoundary_(globalPos))
317 Opm::ImmiscibleFluidState<Scalar, FluidSystem,
319 fs.setSaturation(0, 1.0);
320 fs.setPressure(0, pressure);
321 fs.setTemperature(T);
324 values.setFreeFlow(context, spaceIdx, timeIdx, fs);
342 template <
class Context>
344 const Context& context OPM_UNUSED,
345 unsigned spaceIdx OPM_UNUSED,
346 unsigned timeIdx OPM_UNUSED)
const
349 values[pressure0Idx] = 1.0e+5;
355 template <
class Context>
357 const Context& context OPM_UNUSED,
358 unsigned spaceIdx OPM_UNUSED,
359 unsigned timeIdx OPM_UNUSED)
const
360 { rate = Scalar(0.0); }
365 bool onLowerBoundary_(
const GlobalPosition& pos)
const
366 {
return pos[dim - 1] < eps_; }
368 bool onUpperBoundary_(
const GlobalPosition& pos)
const
369 {
return pos[dim - 1] > this->boundingBoxMax()[dim - 1] - eps_; }
371 bool isInLens_(
const GlobalPosition& pos)
const
373 return lensLowerLeft_[0] <= pos[0] && pos[0] <= lensUpperRight_[0]
374 && lensLowerLeft_[1] <= pos[1] && pos[1] <= lensUpperRight_[1];
377 GlobalPosition lensLowerLeft_;
378 GlobalPosition lensUpperRight_;
380 DimMatrix intrinsicPerm_;
381 DimMatrix intrinsicPermLens_;
Scalar porosity(const Context &context OPM_UNUSED, unsigned spaceIdx OPM_UNUSED, unsigned timeIdx OPM_UNUSED) const
Definition: groundwaterproblem.hh:275
#define SET_BOOL_PROP(EffTypeTagName, PropTagName,...)
Set a property to a simple constant boolean value.
Definition: propertysystem.hh:361
void finishInit()
Called by the Ewoms::Simulator in order to initialize the problem.
Definition: groundwaterproblem.hh:167
void boundary(BoundaryRateVector &values, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Evaluate the boundary conditions for a boundary segment.
Definition: groundwaterproblem.hh:304
#define NEW_TYPE_TAG(...)
Define a new type tag.
Definition: propertysystem.hh:169
void initial(PrimaryVariables &values, const Context &context OPM_UNUSED, unsigned spaceIdx OPM_UNUSED, unsigned timeIdx OPM_UNUSED) const
Evaluate the initial value for a control volume.
Definition: groundwaterproblem.hh:343
#define GET_PROP_TYPE(TypeTag, PropTagName)
Access the type attribute of a property for a type tag.
Definition: propertysystem.hh:486
Test for the immisicible VCVF discretization with only a single phase.
Definition: groundwaterproblem.hh:51
#define SET_TAG_PROP(EffTypeTagName, PropTagName, ValueTypeTagName)
Define a property containing a type tag.
Definition: propertysystem.hh:436
void endTimeStep()
Called by the simulator after each time integration.
Definition: groundwaterproblem.hh:246
#define EWOMS_REGISTER_PARAM(TypeTag, ParamType, ParamName, Description)
Register a run-time parameter.
Definition: parametersystem.hh:68
Provides all unmodified linear solvers from dune-istl.
std::string name() const
The problem name.
Definition: groundwaterproblem.hh:236
void source(RateVector &rate, const Context &context OPM_UNUSED, unsigned spaceIdx OPM_UNUSED, unsigned timeIdx OPM_UNUSED) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: groundwaterproblem.hh:356
#define EWOMS_GET_PARAM(TypeTag, ParamType, ParamName)
Retrieve a runtime parameter.
Definition: parametersystem.hh:99
#define SET_PROP(EffTypeTagName, PropTagName)
Set a property for a specific type tag.
Definition: propertysystem.hh:297
Defines the properties required for the immiscible multi-phase model.
const DimMatrix & intrinsicPermeability(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: groundwaterproblem.hh:284
#define NEW_PROP_TAG(PTagName)
Define a property tag.
Definition: propertysystem.hh:247
#define SET_TYPE_PROP(EffTypeTagName, PropTagName,...)
Set a property which defines a type.
Definition: propertysystem.hh:377
#define SET_STRING_PROP(EffTypeTagName, PropTagName,...)
Set a property to a simple constant string value.
Definition: propertysystem.hh:416
static void registerParameters()
Definition: groundwaterproblem.hh:192
Scalar temperature(const Context &context OPM_UNUSED, unsigned spaceIdx OPM_UNUSED, unsigned timeIdx OPM_UNUSED) const
Definition: groundwaterproblem.hh:266
#define SET_SCALAR_PROP(EffTypeTagName, PropTagName,...)
Set a property to a simple constant scalar value.
Definition: propertysystem.hh:394