reservoirproblem.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
28#ifndef EWOMS_RESERVOIR_PROBLEM_HH
29#define EWOMS_RESERVOIR_PROBLEM_HH
30
31#include <dune/common/version.hh>
32#include <dune/common/fvector.hh>
33#include <dune/common/fmatrix.hh>
34
35#include <dune/grid/yaspgrid.hh>
36#include <dune/grid/io/file/dgfparser/dgfyasp.hh>
37
38#include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
39#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
40#include <opm/material/fluidstates/CompositionalFluidState.hpp>
41#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
42#include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
43#include <opm/material/fluidsystems/blackoilpvt/DryGasPvt.hpp>
44#include <opm/material/fluidsystems/blackoilpvt/LiveOilPvt.hpp>
45#include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.hpp>
46
48
50
53
55
57
58#include <string>
59#include <vector>
60
61namespace Opm {
62template <class TypeTag>
63class ReservoirProblem;
64
65} // namespace Opm
66
67namespace Opm::Properties {
68
69
70namespace TTag {
71
73
74} // namespace TTag
75
76// Set the grid type
77template<class TypeTag>
78struct Grid<TypeTag, TTag::ReservoirBaseProblem> { using type = Dune::YaspGrid<2>; };
79
80// Set the problem property
81template<class TypeTag>
82struct Problem<TypeTag, TTag::ReservoirBaseProblem> { using type = Opm::ReservoirProblem<TypeTag>; };
83
84// Set the material Law
85template<class TypeTag>
86struct MaterialLaw<TypeTag, TTag::ReservoirBaseProblem>
87{
88private:
91
92 using Traits = Opm::
93 ThreePhaseMaterialTraits<Scalar,
94 /*wettingPhaseIdx=*/FluidSystem::waterPhaseIdx,
95 /*nonWettingPhaseIdx=*/FluidSystem::oilPhaseIdx,
96 /*gasPhaseIdx=*/FluidSystem::gasPhaseIdx,
97 /* hysteresis */ false,
98 /* endpointscaling */ false>;
99
100public:
101 using type = Opm::LinearMaterial<Traits>;
102};
103
104// Enable constraint DOFs?
105template<class TypeTag>
106struct EnableConstraints<TypeTag, TTag::ReservoirBaseProblem> { static constexpr bool value = true; };
107
116template<class TypeTag>
117struct FluidSystem<TypeTag, TTag::ReservoirBaseProblem>
118{
119private:
121
122public:
123 using type = Opm::BlackOilFluidSystem<Scalar>;
124};
125
126} // namespace Opm::Properties
127
128namespace Opm::Parameters {
129
130// Maximum depth of the reservoir
131template<class Scalar>
132struct MaxDepth { static constexpr Scalar value = 2500.0; };
133
134// The temperature inside the reservoir
135template<class Scalar>
136struct Temperature { static constexpr Scalar value = 293.15; };
137
138// The width of producer/injector wells as a fraction of the width of the spatial domain
139template<class Scalar>
140struct WellWidth { static constexpr Scalar value = 0.01; };
141
142} // namespace Opm::Parameters
143
144namespace Opm {
145
162template <class TypeTag>
163class ReservoirProblem : public GetPropType<TypeTag, Properties::BaseProblem>
164{
166
171
172 // Grid and world dimension
173 enum { dim = GridView::dimension };
174 enum { dimWorld = GridView::dimensionworld };
175
176 // copy some indices for convenience
177 enum { numPhases = FluidSystem::numPhases };
178 enum { numComponents = FluidSystem::numComponents };
179 enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
180 enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
181 enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
182 enum { gasCompIdx = FluidSystem::gasCompIdx };
183 enum { oilCompIdx = FluidSystem::oilCompIdx };
184 enum { waterCompIdx = FluidSystem::waterCompIdx };
185
196
197 using CoordScalar = typename GridView::ctype;
198 using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
199 using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
200 using PhaseVector = Dune::FieldVector<Scalar, numPhases>;
201
202 using InitialFluidState = Opm::CompositionalFluidState<Scalar,
203 FluidSystem,
204 /*enableEnthalpy=*/true>;
205
206public:
210 explicit ReservoirProblem(Simulator& simulator)
211 : ParentType(simulator)
212 { }
213
218 {
219 ParentType::finishInit();
220
221 temperature_ = Parameters::Get<Parameters::Temperature<Scalar>>();
222 maxDepth_ = Parameters::Get<Parameters::MaxDepth<Scalar>>();
223 wellWidth_ = Parameters::Get<Parameters::WellWidth<Scalar>>();
224
225 std::vector<std::pair<Scalar, Scalar> > Bo = {
226 { 101353, 1.062 },
227 { 1.82504e+06, 1.15 },
228 { 3.54873e+06, 1.207 },
229 { 6.99611e+06, 1.295 },
230 { 1.38909e+07, 1.435 },
231 { 1.73382e+07, 1.5 },
232 { 2.07856e+07, 1.565 },
233 { 2.76804e+07, 1.695 },
234 { 3.45751e+07, 1.827 }
235 };
236 std::vector<std::pair<Scalar, Scalar> > muo = {
237 { 101353, 0.00104 },
238 { 1.82504e+06, 0.000975 },
239 { 3.54873e+06, 0.00091 },
240 { 6.99611e+06, 0.00083 },
241 { 1.38909e+07, 0.000695 },
242 { 1.73382e+07, 0.000641 },
243 { 2.07856e+07, 0.000594 },
244 { 2.76804e+07, 0.00051 },
245 { 3.45751e+07, 0.000449 }
246 };
247 std::vector<std::pair<Scalar, Scalar> > Rs = {
248 { 101353, 0.178108 },
249 { 1.82504e+06, 16.1187 },
250 { 3.54873e+06, 32.0594 },
251 { 6.99611e+06, 66.0779 },
252 { 1.38909e+07, 113.276 },
253 { 1.73382e+07, 138.033 },
254 { 2.07856e+07, 165.64 },
255 { 2.76804e+07, 226.197 },
256 { 3.45751e+07, 288.178 }
257 };
258 std::vector<std::pair<Scalar, Scalar> > Bg = {
259 { 101353, 0.93576 },
260 { 1.82504e+06, 0.0678972 },
261 { 3.54873e+06, 0.0352259 },
262 { 6.99611e+06, 0.0179498 },
263 { 1.38909e+07, 0.00906194 },
264 { 1.73382e+07, 0.00726527 },
265 { 2.07856e+07, 0.00606375 },
266 { 2.76804e+07, 0.00455343 },
267 { 3.45751e+07, 0.00364386 },
268 { 6.21542e+07, 0.00216723 }
269 };
270 std::vector<std::pair<Scalar, Scalar> > mug = {
271 { 101353, 8e-06 },
272 { 1.82504e+06, 9.6e-06 },
273 { 3.54873e+06, 1.12e-05 },
274 { 6.99611e+06, 1.4e-05 },
275 { 1.38909e+07, 1.89e-05 },
276 { 1.73382e+07, 2.08e-05 },
277 { 2.07856e+07, 2.28e-05 },
278 { 2.76804e+07, 2.68e-05 },
279 { 3.45751e+07, 3.09e-05 },
280 { 6.21542e+07, 4.7e-05 }
281 };
282
283 Scalar rhoRefO = 786.0; // [kg]
284 Scalar rhoRefG = 0.97; // [kg]
285 Scalar rhoRefW = 1037.0; // [kg]
286 FluidSystem::initBegin(/*numPvtRegions=*/1);
287 FluidSystem::setEnableDissolvedGas(true);
288 FluidSystem::setEnableVaporizedOil(false);
289 FluidSystem::setReferenceDensities(rhoRefO, rhoRefW, rhoRefG, /*regionIdx=*/0);
290
291 Opm::GasPvtMultiplexer<Scalar> *gasPvt = new Opm::GasPvtMultiplexer<Scalar>;
292 gasPvt->setApproach(GasPvtApproach::DryGas);
293 auto& dryGasPvt = gasPvt->template getRealPvt<GasPvtApproach::DryGas>();
294 dryGasPvt.setNumRegions(/*numPvtRegion=*/1);
295 dryGasPvt.setReferenceDensities(/*regionIdx=*/0, rhoRefO, rhoRefG, rhoRefW);
296 dryGasPvt.setGasFormationVolumeFactor(/*regionIdx=*/0, Bg);
297 dryGasPvt.setGasViscosity(/*regionIdx=*/0, Opm::Tabulated1DFunction<Scalar>(mug));
298
299 Opm::OilPvtMultiplexer<Scalar> *oilPvt = new Opm::OilPvtMultiplexer<Scalar>;
300 oilPvt->setApproach(OilPvtApproach::LiveOil);
301 auto& liveOilPvt = oilPvt->template getRealPvt<OilPvtApproach::LiveOil>();
302 liveOilPvt.setNumRegions(/*numPvtRegion=*/1);
303 liveOilPvt.setReferenceDensities(/*regionIdx=*/0, rhoRefO, rhoRefG, rhoRefW);
304 liveOilPvt.setSaturatedOilGasDissolutionFactor(/*regionIdx=*/0, Rs);
305 liveOilPvt.setSaturatedOilFormationVolumeFactor(/*regionIdx=*/0, Bo);
306 liveOilPvt.setSaturatedOilViscosity(/*regionIdx=*/0, muo);
307
308 Opm::WaterPvtMultiplexer<Scalar> *waterPvt = new Opm::WaterPvtMultiplexer<Scalar>;
309 waterPvt->setApproach(WaterPvtApproach::ConstantCompressibilityWater);
310 auto& ccWaterPvt = waterPvt->template getRealPvt<WaterPvtApproach::ConstantCompressibilityWater>();
311 ccWaterPvt.setNumRegions(/*numPvtRegions=*/1);
312 ccWaterPvt.setReferenceDensities(/*regionIdx=*/0, rhoRefO, rhoRefG, rhoRefW);
313 ccWaterPvt.setViscosity(/*regionIdx=*/0, 9.6e-4);
314 ccWaterPvt.setCompressibility(/*regionIdx=*/0, 1.450377e-10);
315
316 gasPvt->initEnd();
317 oilPvt->initEnd();
318 waterPvt->initEnd();
319
320 using GasPvtSharedPtr = std::shared_ptr<Opm::GasPvtMultiplexer<Scalar> >;
321 FluidSystem::setGasPvt(GasPvtSharedPtr(gasPvt));
322
323 using OilPvtSharedPtr = std::shared_ptr<Opm::OilPvtMultiplexer<Scalar> >;
324 FluidSystem::setOilPvt(OilPvtSharedPtr(oilPvt));
325
326 using WaterPvtSharedPtr = std::shared_ptr<Opm::WaterPvtMultiplexer<Scalar> >;
327 FluidSystem::setWaterPvt(WaterPvtSharedPtr(waterPvt));
328
329 FluidSystem::initEnd();
330
331 pReservoir_ = 330e5;
332 layerBottom_ = 22.0;
333
334 // intrinsic permeabilities
335 fineK_ = this->toDimMatrix_(1e-12);
336 coarseK_ = this->toDimMatrix_(1e-11);
337
338 // porosities
339 finePorosity_ = 0.2;
340 coarsePorosity_ = 0.3;
341
342 for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
343 fineMaterialParams_.setPcMinSat(phaseIdx, 0.0);
344 fineMaterialParams_.setPcMaxSat(phaseIdx, 0.0);
345
346 coarseMaterialParams_.setPcMinSat(phaseIdx, 0.0);
347 coarseMaterialParams_.setPcMaxSat(phaseIdx, 0.0);
348 }
349
350 // wrap up the initialization of the material law's parameters
351 fineMaterialParams_.finalize();
352 coarseMaterialParams_.finalize();
353
354 materialParams_.resize(this->model().numGridDof());
355 ElementContext elemCtx(this->simulator());
356 auto eIt = this->simulator().gridView().template begin<0>();
357 const auto& eEndIt = this->simulator().gridView().template end<0>();
358 for (; eIt != eEndIt; ++eIt) {
359 elemCtx.updateStencil(*eIt);
360 size_t nDof = elemCtx.numPrimaryDof(/*timeIdx=*/0);
361 for (unsigned dofIdx = 0; dofIdx < nDof; ++ dofIdx) {
362 unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0);
363 const GlobalPosition& pos = elemCtx.pos(dofIdx, /*timeIdx=*/0);
364
365 if (isFineMaterial_(pos))
366 materialParams_[globalDofIdx] = &fineMaterialParams_;
367 else
368 materialParams_[globalDofIdx] = &coarseMaterialParams_;
369 }
370 }
371
372 initFluidState_();
373
374 // start the first ("settle down") episode for 100 days
375 this->simulator().startNextEpisode(100.0*24*60*60);
376 }
377
381 static void registerParameters()
382 {
383 ParentType::registerParameters();
384
385 Parameters::Register<Parameters::Temperature<Scalar>>
386 ("The temperature [K] in the reservoir");
387 Parameters::Register<Parameters::MaxDepth<Scalar>>
388 ("The maximum depth [m] of the reservoir");
389 Parameters::Register<Parameters::WellWidth<Scalar>>
390 ("The width of producer/injector wells as a fraction of the width"
391 " of the spatial domain");
392
393 Parameters::SetDefault<Parameters::GridFile>("data/reservoir.dgf");
394
397 Parameters::SetDefault<Parameters::EndTime<Scalar>>(1000.0*24*60*60);
398
399 Parameters::SetDefault<Parameters::EnableStorageCache>(true);
400 Parameters::SetDefault<Parameters::GridFile>("data/reservoir.dgf");
401 Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(100e3);
402 // increase the tolerance for this problem to get larger time steps
403 Parameters::SetDefault<Parameters::NewtonTolerance<Scalar>>(1e-6);
404
405 Parameters::SetDefault<Parameters::EnableGravity>(true);
406 }
407
411 std::string name() const
412 { return std::string("reservoir_") + Model::name() + "_" + Model::discretizationName(); }
413
418 {
419 // in the second episode, the actual work is done (the first is "settle down"
420 // episode). we need to use a pretty short initial time step here as the change
421 // in conditions is quite abrupt.
422 this->simulator().startNextEpisode(1e100);
423 this->simulator().setTimeStepSize(5.0);
424 }
425
430 {
431#ifndef NDEBUG
432 // checkConservativeness() does not include the effect of constraints, so we
433 // disable it for this problem...
434 //this->model().checkConservativeness();
435
436 // Calculate storage terms
437 EqVector storage;
438 this->model().globalStorage(storage);
439
440 // Write mass balance information for rank 0
441 if (this->gridView().comm().rank() == 0) {
442 std::cout << "Storage: " << storage << std::endl << std::flush;
443 }
444#endif // NDEBUG
445 }
446
453 template <class Context>
454 const DimMatrix& intrinsicPermeability(const Context& context, unsigned spaceIdx,
455 unsigned timeIdx) const
456 {
457 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
458 if (isFineMaterial_(pos))
459 return fineK_;
460 return coarseK_;
461 }
462
466 template <class Context>
467 Scalar porosity(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
468 {
469 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
470 if (isFineMaterial_(pos))
471 return finePorosity_;
472 return coarsePorosity_;
473 }
474
478 template <class Context>
479 const MaterialLawParams& materialLawParams(const Context& context,
480 unsigned spaceIdx, unsigned timeIdx) const
481 {
482 unsigned globalIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
483 return *materialParams_[globalIdx];
484 }
485
486 const MaterialLawParams& materialLawParams(unsigned globalIdx) const
487 { return *materialParams_[globalIdx]; }
488
493
494
503 template <class Context>
504 Scalar temperature(const Context& /*context*/,
505 unsigned /*spaceIdx*/,
506 unsigned /*timeIdx*/) const
507 { return temperature_; }
508
509 // \}
510
515
522 template <class Context>
523 void boundary(BoundaryRateVector& values,
524 const Context& /*context*/,
525 unsigned /*spaceIdx*/,
526 unsigned /*timeIdx*/) const
527 {
528 // no flow on top and bottom
529 values.setNoFlow();
530 }
531
533
538
545 template <class Context>
546 void initial(PrimaryVariables& values,
547 const Context& /*context*/,
548 unsigned /*spaceIdx*/,
549 unsigned /*timeIdx*/) const
550 {
551 values.assignNaive(initialFluidState_);
552
553#ifndef NDEBUG
554 for (unsigned pvIdx = 0; pvIdx < values.size(); ++ pvIdx)
555 assert(std::isfinite(values[pvIdx]));
556#endif
557 }
558
567 template <class Context>
568 void constraints(Constraints& constraintValues,
569 const Context& context,
570 unsigned spaceIdx,
571 unsigned timeIdx) const
572 {
573 if (this->simulator().episodeIndex() == 1)
574 return; // no constraints during the "settle down" episode
575
576 const auto& pos = context.pos(spaceIdx, timeIdx);
577 if (isInjector_(pos)) {
578 constraintValues.setActive(true);
579 constraintValues.assignNaive(injectorFluidState_);
580 }
581 else if (isProducer_(pos)) {
582 constraintValues.setActive(true);
583 constraintValues.assignNaive(producerFluidState_);
584 }
585 }
586
592 template <class Context>
593 void source(RateVector& rate,
594 const Context& /*context*/,
595 unsigned /*spaceIdx*/,
596 unsigned /*timeIdx*/) const
597 { rate = Scalar(0.0); }
598
600
601private:
602 void initFluidState_()
603 {
604 auto& fs = initialFluidState_;
605
607 // set temperatures
609 fs.setTemperature(temperature_);
610
612 // set saturations
614 fs.setSaturation(FluidSystem::oilPhaseIdx, 1.0);
615 fs.setSaturation(FluidSystem::waterPhaseIdx, 0.0);
616 fs.setSaturation(FluidSystem::gasPhaseIdx, 0.0);
617
619 // set pressures
621 Scalar pw = pReservoir_;
622
623 PhaseVector pC;
624 const auto& matParams = fineMaterialParams_;
625 MaterialLaw::capillaryPressures(pC, matParams, fs);
626
627 fs.setPressure(oilPhaseIdx, pw + (pC[oilPhaseIdx] - pC[waterPhaseIdx]));
628 fs.setPressure(waterPhaseIdx, pw + (pC[waterPhaseIdx] - pC[waterPhaseIdx]));
629 fs.setPressure(gasPhaseIdx, pw + (pC[gasPhaseIdx] - pC[waterPhaseIdx]));
630
631 // reset all mole fractions to 0
632 for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
633 for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
634 fs.setMoleFraction(phaseIdx, compIdx, 0.0);
635
637 // set composition of the gas and water phases
639 fs.setMoleFraction(waterPhaseIdx, waterCompIdx, 1.0);
640 fs.setMoleFraction(gasPhaseIdx, gasCompIdx, 1.0);
641
643 // set composition of the oil phase
645 Scalar RsSat =
646 FluidSystem::saturatedDissolutionFactor(fs, oilPhaseIdx, /*pvtRegionIdx=*/0);
647 Scalar XoGSat = FluidSystem::convertRsToXoG(RsSat, /*pvtRegionIdx=*/0);
648 Scalar xoGSat = FluidSystem::convertXoGToxoG(XoGSat, /*pvtRegionIdx=*/0);
649 Scalar xoG = 0.95*xoGSat;
650 Scalar xoO = 1.0 - xoG;
651
652 // finally set the oil-phase composition
653 fs.setMoleFraction(oilPhaseIdx, gasCompIdx, xoG);
654 fs.setMoleFraction(oilPhaseIdx, oilCompIdx, xoO);
655
656 using CFRP = Opm::ComputeFromReferencePhase<Scalar, FluidSystem>;
657 typename FluidSystem::template ParameterCache<Scalar> paramCache;
658 CFRP::solve(fs,
659 paramCache,
660 /*refPhaseIdx=*/oilPhaseIdx,
661 /*setViscosities=*/false,
662 /*setEnthalpies=*/false);
663
664 // set up the fluid state used for the injectors
665 auto& injFs = injectorFluidState_;
666 injFs = initialFluidState_;
667
668 Scalar pInj = pReservoir_ * 1.5;
669 injFs.setPressure(waterPhaseIdx, pInj);
670 injFs.setPressure(oilPhaseIdx, pInj);
671 injFs.setPressure(gasPhaseIdx, pInj);
672 injFs.setSaturation(waterPhaseIdx, 1.0);
673 injFs.setSaturation(oilPhaseIdx, 0.0);
674 injFs.setSaturation(gasPhaseIdx, 0.0);
675
676 // set the composition of the phases to immiscible
677 for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
678 for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
679 injFs.setMoleFraction(phaseIdx, compIdx, 0.0);
680
681 injFs.setMoleFraction(gasPhaseIdx, gasCompIdx, 1.0);
682 injFs.setMoleFraction(oilPhaseIdx, oilCompIdx, 1.0);
683 injFs.setMoleFraction(waterPhaseIdx, waterCompIdx, 1.0);
684
685 CFRP::solve(injFs,
686 paramCache,
687 /*refPhaseIdx=*/waterPhaseIdx,
688 /*setViscosities=*/true,
689 /*setEnthalpies=*/false);
690
691 // set up the fluid state used for the producer
692 auto& prodFs = producerFluidState_;
693 prodFs = initialFluidState_;
694
695 Scalar pProd = pReservoir_ / 1.5;
696 prodFs.setPressure(waterPhaseIdx, pProd);
697 prodFs.setPressure(oilPhaseIdx, pProd);
698 prodFs.setPressure(gasPhaseIdx, pProd);
699 prodFs.setSaturation(waterPhaseIdx, 0.0);
700 prodFs.setSaturation(oilPhaseIdx, 1.0);
701 prodFs.setSaturation(gasPhaseIdx, 0.0);
702
703 CFRP::solve(prodFs,
704 paramCache,
705 /*refPhaseIdx=*/oilPhaseIdx,
706 /*setViscosities=*/true,
707 /*setEnthalpies=*/false);
708 }
709
710 bool isProducer_(const GlobalPosition& pos) const
711 {
712 Scalar x = pos[0] - this->boundingBoxMin()[0];
713 Scalar y = pos[dim - 1] - this->boundingBoxMin()[dim - 1];
714 Scalar width = this->boundingBoxMax()[0] - this->boundingBoxMin()[0];
715 Scalar height = this->boundingBoxMax()[dim - 1] - this->boundingBoxMin()[dim - 1];
716
717 // only the upper half of the center section of the spatial domain is assumed to
718 // be the producer
719 if (y <= height/2.0)
720 return false;
721
722 return width/2.0 - width*1e-5 < x && x < width/2.0 + width*(wellWidth_ + 1e-5);
723 }
724
725 bool isInjector_(const GlobalPosition& pos) const
726 {
727 Scalar x = pos[0] - this->boundingBoxMin()[0];
728 Scalar y = pos[dim - 1] - this->boundingBoxMin()[dim - 1];
729 Scalar width = this->boundingBoxMax()[0] - this->boundingBoxMin()[0];
730 Scalar height = this->boundingBoxMax()[dim - 1] - this->boundingBoxMin()[dim - 1];
731
732 // only the lower half of the leftmost and rightmost part of the spatial domain
733 // are assumed to be the water injectors
734 if (y > height/2.0)
735 return false;
736
737 return x < width*wellWidth_ - width*1e-5 || x > width*(1.0 - wellWidth_) + width*1e-5;
738 }
739
740 bool isFineMaterial_(const GlobalPosition& pos) const
741 { return pos[dim - 1] > layerBottom_; }
742
743 DimMatrix fineK_;
744 DimMatrix coarseK_;
745 Scalar layerBottom_;
746 Scalar pReservoir_;
747
748 Scalar finePorosity_;
749 Scalar coarsePorosity_;
750
751 MaterialLawParams fineMaterialParams_;
752 MaterialLawParams coarseMaterialParams_;
753 std::vector<const MaterialLawParams*> materialParams_;
754
755 InitialFluidState initialFluidState_;
756 InitialFluidState injectorFluidState_;
757 InitialFluidState producerFluidState_;
758
759 Scalar temperature_;
760 Scalar maxDepth_;
761 Scalar wellWidth_;
762};
763} // namespace Opm
764
765#endif
Defines a type tags and some fundamental properties all models.
Declares the properties required by the black oil model.
Some simple test problem for the black-oil VCVF discretization inspired by an oil reservoir.
Definition: reservoirproblem.hh:164
static void registerParameters()
Definition: reservoirproblem.hh:381
void source(RateVector &rate, const Context &, unsigned, unsigned) const
Evaluate the source term for all phases within a given sub-control-volume.
Definition: reservoirproblem.hh:593
void endTimeStep()
Called by the simulator after each time integration.
Definition: reservoirproblem.hh:429
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: reservoirproblem.hh:467
void initial(PrimaryVariables &values, const Context &, unsigned, unsigned) const
Evaluate the initial value for a control volume.
Definition: reservoirproblem.hh:546
ReservoirProblem(Simulator &simulator)
Definition: reservoirproblem.hh:210
void constraints(Constraints &constraintValues, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Evaluate the constraints for a control volume.
Definition: reservoirproblem.hh:568
void boundary(BoundaryRateVector &values, const Context &, unsigned, unsigned) const
Evaluate the boundary conditions for a boundary segment.
Definition: reservoirproblem.hh:523
const MaterialLawParams & materialLawParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: reservoirproblem.hh:479
std::string name() const
The problem name.
Definition: reservoirproblem.hh:411
const MaterialLawParams & materialLawParams(unsigned globalIdx) const
Definition: reservoirproblem.hh:486
void finishInit()
Called by the Opm::Simulator in order to initialize the problem.
Definition: reservoirproblem.hh:217
const DimMatrix & intrinsicPermeability(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: reservoirproblem.hh:454
Scalar temperature(const Context &, unsigned, unsigned) const
Definition: reservoirproblem.hh:504
void endEpisode()
Called when the end of an simulation episode is reached.
Definition: reservoirproblem.hh:417
Declare the properties used by the infrastructure code of the finite volume discretizations.
Declare the properties used by the infrastructure code of the finite volume discretizations.
Defines the common parameters for the porous medium multi-phase models.
Definition: blackoilnewtonmethodparams.hpp:31
Definition: blackoilmodel.hh:79
Definition: blackoilbioeffectsmodules.hh:43
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:233
static constexpr Scalar value
Definition: co2injectionproblem.hh:160
static constexpr Scalar value
Definition: co2injectionproblem.hh:165
Definition: reservoirproblem.hh:140
static constexpr Scalar value
Definition: reservoirproblem.hh:140
Specify whether the some degrees of fredom can be constraint.
Definition: fvbaseproperties.hh:199
Opm::BlackOilFluidSystem< Scalar > type
Definition: reservoirproblem.hh:123
The fluid systems including the information about the phases.
Definition: multiphasebaseproperties.hh:79
Dune::YaspGrid< 2 > type
Definition: reservoirproblem.hh:78
The type of the DUNE grid.
Definition: basicproperties.hh:100
Opm::LinearMaterial< Traits > type
Definition: reservoirproblem.hh:101
The material law which ought to be used (extracted from the spatial parameters)
Definition: multiphasebaseproperties.hh:55
The type of the problem.
Definition: fvbaseproperties.hh:81
Definition: reservoirproblem.hh:72