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
98public:
99 using type = Opm::LinearMaterial<Traits>;
100};
101
102// Enable constraint DOFs?
103template<class TypeTag>
104struct EnableConstraints<TypeTag, TTag::ReservoirBaseProblem> { static constexpr bool value = true; };
105
114template<class TypeTag>
115struct FluidSystem<TypeTag, TTag::ReservoirBaseProblem>
116{
117private:
119
120public:
121 using type = Opm::BlackOilFluidSystem<Scalar>;
122};
123
124} // namespace Opm::Properties
125
126namespace Opm::Parameters {
127
128// Maximum depth of the reservoir
129template<class Scalar>
130struct MaxDepth { static constexpr Scalar value = 2500.0; };
131
132// The temperature inside the reservoir
133template<class Scalar>
134struct Temperature { static constexpr Scalar value = 293.15; };
135
136// The width of producer/injector wells as a fraction of the width of the spatial domain
137template<class Scalar>
138struct WellWidth { static constexpr Scalar value = 0.01; };
139
140} // namespace Opm::Parameters
141
142namespace Opm {
143
160template <class TypeTag>
161class ReservoirProblem : public GetPropType<TypeTag, Properties::BaseProblem>
162{
164
169
170 // Grid and world dimension
171 enum { dim = GridView::dimension };
172 enum { dimWorld = GridView::dimensionworld };
173
174 // copy some indices for convenience
175 enum { numPhases = FluidSystem::numPhases };
176 enum { numComponents = FluidSystem::numComponents };
177 enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
178 enum { oilPhaseIdx = FluidSystem::oilPhaseIdx };
179 enum { waterPhaseIdx = FluidSystem::waterPhaseIdx };
180 enum { gasCompIdx = FluidSystem::gasCompIdx };
181 enum { oilCompIdx = FluidSystem::oilCompIdx };
182 enum { waterCompIdx = FluidSystem::waterCompIdx };
183
194
195 using CoordScalar = typename GridView::ctype;
196 using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
197 using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
198 using PhaseVector = Dune::FieldVector<Scalar, numPhases>;
199
200 using InitialFluidState = Opm::CompositionalFluidState<Scalar,
201 FluidSystem,
202 /*enableEnthalpy=*/true>;
203
204public:
208 ReservoirProblem(Simulator& simulator)
209 : ParentType(simulator)
210 { }
211
216 {
217 ParentType::finishInit();
218
219 temperature_ = Parameters::Get<Parameters::Temperature<Scalar>>();
220 maxDepth_ = Parameters::Get<Parameters::MaxDepth<Scalar>>();
221 wellWidth_ = Parameters::Get<Parameters::WellWidth<Scalar>>();
222
223 std::vector<std::pair<Scalar, Scalar> > Bo = {
224 { 101353, 1.062 },
225 { 1.82504e+06, 1.15 },
226 { 3.54873e+06, 1.207 },
227 { 6.99611e+06, 1.295 },
228 { 1.38909e+07, 1.435 },
229 { 1.73382e+07, 1.5 },
230 { 2.07856e+07, 1.565 },
231 { 2.76804e+07, 1.695 },
232 { 3.45751e+07, 1.827 }
233 };
234 std::vector<std::pair<Scalar, Scalar> > muo = {
235 { 101353, 0.00104 },
236 { 1.82504e+06, 0.000975 },
237 { 3.54873e+06, 0.00091 },
238 { 6.99611e+06, 0.00083 },
239 { 1.38909e+07, 0.000695 },
240 { 1.73382e+07, 0.000641 },
241 { 2.07856e+07, 0.000594 },
242 { 2.76804e+07, 0.00051 },
243 { 3.45751e+07, 0.000449 }
244 };
245 std::vector<std::pair<Scalar, Scalar> > Rs = {
246 { 101353, 0.178108 },
247 { 1.82504e+06, 16.1187 },
248 { 3.54873e+06, 32.0594 },
249 { 6.99611e+06, 66.0779 },
250 { 1.38909e+07, 113.276 },
251 { 1.73382e+07, 138.033 },
252 { 2.07856e+07, 165.64 },
253 { 2.76804e+07, 226.197 },
254 { 3.45751e+07, 288.178 }
255 };
256 std::vector<std::pair<Scalar, Scalar> > Bg = {
257 { 101353, 0.93576 },
258 { 1.82504e+06, 0.0678972 },
259 { 3.54873e+06, 0.0352259 },
260 { 6.99611e+06, 0.0179498 },
261 { 1.38909e+07, 0.00906194 },
262 { 1.73382e+07, 0.00726527 },
263 { 2.07856e+07, 0.00606375 },
264 { 2.76804e+07, 0.00455343 },
265 { 3.45751e+07, 0.00364386 },
266 { 6.21542e+07, 0.00216723 }
267 };
268 std::vector<std::pair<Scalar, Scalar> > mug = {
269 { 101353, 8e-06 },
270 { 1.82504e+06, 9.6e-06 },
271 { 3.54873e+06, 1.12e-05 },
272 { 6.99611e+06, 1.4e-05 },
273 { 1.38909e+07, 1.89e-05 },
274 { 1.73382e+07, 2.08e-05 },
275 { 2.07856e+07, 2.28e-05 },
276 { 2.76804e+07, 2.68e-05 },
277 { 3.45751e+07, 3.09e-05 },
278 { 6.21542e+07, 4.7e-05 }
279 };
280
281 Scalar rhoRefO = 786.0; // [kg]
282 Scalar rhoRefG = 0.97; // [kg]
283 Scalar rhoRefW = 1037.0; // [kg]
284 FluidSystem::initBegin(/*numPvtRegions=*/1);
285 FluidSystem::setEnableDissolvedGas(true);
286 FluidSystem::setEnableVaporizedOil(false);
287 FluidSystem::setReferenceDensities(rhoRefO, rhoRefW, rhoRefG, /*regionIdx=*/0);
288
289 Opm::GasPvtMultiplexer<Scalar> *gasPvt = new Opm::GasPvtMultiplexer<Scalar>;
290 gasPvt->setApproach(GasPvtApproach::DryGas);
291 auto& dryGasPvt = gasPvt->template getRealPvt<GasPvtApproach::DryGas>();
292 dryGasPvt.setNumRegions(/*numPvtRegion=*/1);
293 dryGasPvt.setReferenceDensities(/*regionIdx=*/0, rhoRefO, rhoRefG, rhoRefW);
294 dryGasPvt.setGasFormationVolumeFactor(/*regionIdx=*/0, Bg);
295 dryGasPvt.setGasViscosity(/*regionIdx=*/0, mug);
296
297 Opm::OilPvtMultiplexer<Scalar> *oilPvt = new Opm::OilPvtMultiplexer<Scalar>;
298 oilPvt->setApproach(OilPvtApproach::LiveOil);
299 auto& liveOilPvt = oilPvt->template getRealPvt<OilPvtApproach::LiveOil>();
300 liveOilPvt.setNumRegions(/*numPvtRegion=*/1);
301 liveOilPvt.setReferenceDensities(/*regionIdx=*/0, rhoRefO, rhoRefG, rhoRefW);
302 liveOilPvt.setSaturatedOilGasDissolutionFactor(/*regionIdx=*/0, Rs);
303 liveOilPvt.setSaturatedOilFormationVolumeFactor(/*regionIdx=*/0, Bo);
304 liveOilPvt.setSaturatedOilViscosity(/*regionIdx=*/0, muo);
305
306 Opm::WaterPvtMultiplexer<Scalar> *waterPvt = new Opm::WaterPvtMultiplexer<Scalar>;
307 waterPvt->setApproach(WaterPvtApproach::ConstantCompressibilityWater);
308 auto& ccWaterPvt = waterPvt->template getRealPvt<WaterPvtApproach::ConstantCompressibilityWater>();
309 ccWaterPvt.setNumRegions(/*numPvtRegions=*/1);
310 ccWaterPvt.setReferenceDensities(/*regionIdx=*/0, rhoRefO, rhoRefG, rhoRefW);
311 ccWaterPvt.setViscosity(/*regionIdx=*/0, 9.6e-4);
312 ccWaterPvt.setCompressibility(/*regionIdx=*/0, 1.450377e-10);
313
314 gasPvt->initEnd();
315 oilPvt->initEnd();
316 waterPvt->initEnd();
317
318 using GasPvtSharedPtr = std::shared_ptr<Opm::GasPvtMultiplexer<Scalar> >;
319 FluidSystem::setGasPvt(GasPvtSharedPtr(gasPvt));
320
321 using OilPvtSharedPtr = std::shared_ptr<Opm::OilPvtMultiplexer<Scalar> >;
322 FluidSystem::setOilPvt(OilPvtSharedPtr(oilPvt));
323
324 using WaterPvtSharedPtr = std::shared_ptr<Opm::WaterPvtMultiplexer<Scalar> >;
325 FluidSystem::setWaterPvt(WaterPvtSharedPtr(waterPvt));
326
327 FluidSystem::initEnd();
328
329 pReservoir_ = 330e5;
330 layerBottom_ = 22.0;
331
332 // intrinsic permeabilities
333 fineK_ = this->toDimMatrix_(1e-12);
334 coarseK_ = this->toDimMatrix_(1e-11);
335
336 // porosities
337 finePorosity_ = 0.2;
338 coarsePorosity_ = 0.3;
339
340 for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
341 fineMaterialParams_.setPcMinSat(phaseIdx, 0.0);
342 fineMaterialParams_.setPcMaxSat(phaseIdx, 0.0);
343
344 coarseMaterialParams_.setPcMinSat(phaseIdx, 0.0);
345 coarseMaterialParams_.setPcMaxSat(phaseIdx, 0.0);
346 }
347
348 // wrap up the initialization of the material law's parameters
349 fineMaterialParams_.finalize();
350 coarseMaterialParams_.finalize();
351
352 materialParams_.resize(this->model().numGridDof());
353 ElementContext elemCtx(this->simulator());
354 auto eIt = this->simulator().gridView().template begin<0>();
355 const auto& eEndIt = this->simulator().gridView().template end<0>();
356 for (; eIt != eEndIt; ++eIt) {
357 elemCtx.updateStencil(*eIt);
358 size_t nDof = elemCtx.numPrimaryDof(/*timeIdx=*/0);
359 for (unsigned dofIdx = 0; dofIdx < nDof; ++ dofIdx) {
360 unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0);
361 const GlobalPosition& pos = elemCtx.pos(dofIdx, /*timeIdx=*/0);
362
363 if (isFineMaterial_(pos))
364 materialParams_[globalDofIdx] = &fineMaterialParams_;
365 else
366 materialParams_[globalDofIdx] = &coarseMaterialParams_;
367 }
368 }
369
370 initFluidState_();
371
372 // start the first ("settle down") episode for 100 days
373 this->simulator().startNextEpisode(100.0*24*60*60);
374 }
375
379 static void registerParameters()
380 {
381 ParentType::registerParameters();
382
383 Parameters::Register<Parameters::Temperature<Scalar>>
384 ("The temperature [K] in the reservoir");
385 Parameters::Register<Parameters::MaxDepth<Scalar>>
386 ("The maximum depth [m] of the reservoir");
387 Parameters::Register<Parameters::WellWidth<Scalar>>
388 ("The width of producer/injector wells as a fraction of the width"
389 " of the spatial domain");
390
391 Parameters::SetDefault<Parameters::GridFile>("data/reservoir.dgf");
392
395 Parameters::SetDefault<Parameters::EndTime<Scalar>>(1000.0*24*60*60);
396
397 Parameters::SetDefault<Parameters::EnableStorageCache>(true);
398 Parameters::SetDefault<Parameters::GridFile>("data/reservoir.dgf");
399 Parameters::SetDefault<Parameters::InitialTimeStepSize<Scalar>>(100e3);
400 // increase the tolerance for this problem to get larger time steps
401 Parameters::SetDefault<Parameters::NewtonTolerance<Scalar>>(1e-6);
402
403 Parameters::SetDefault<Parameters::EnableGravity>(true);
404 }
405
409 std::string name() const
410 { return std::string("reservoir_") + Model::name() + "_" + Model::discretizationName(); }
411
416 {
417 // in the second episode, the actual work is done (the first is "settle down"
418 // episode). we need to use a pretty short initial time step here as the change
419 // in conditions is quite abrupt.
420 this->simulator().startNextEpisode(1e100);
421 this->simulator().setTimeStepSize(5.0);
422 }
423
428 {
429#ifndef NDEBUG
430 // checkConservativeness() does not include the effect of constraints, so we
431 // disable it for this problem...
432 //this->model().checkConservativeness();
433
434 // Calculate storage terms
435 EqVector storage;
436 this->model().globalStorage(storage);
437
438 // Write mass balance information for rank 0
439 if (this->gridView().comm().rank() == 0) {
440 std::cout << "Storage: " << storage << std::endl << std::flush;
441 }
442#endif // NDEBUG
443 }
444
451 template <class Context>
452 const DimMatrix& intrinsicPermeability(const Context& context, unsigned spaceIdx,
453 unsigned timeIdx) const
454 {
455 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
456 if (isFineMaterial_(pos))
457 return fineK_;
458 return coarseK_;
459 }
460
464 template <class Context>
465 Scalar porosity(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
466 {
467 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
468 if (isFineMaterial_(pos))
469 return finePorosity_;
470 return coarsePorosity_;
471 }
472
476 template <class Context>
477 const MaterialLawParams& materialLawParams(const Context& context,
478 unsigned spaceIdx, unsigned timeIdx) const
479 {
480 unsigned globalIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
481 return *materialParams_[globalIdx];
482 }
483
484 const MaterialLawParams& materialLawParams(unsigned globalIdx) const
485 { return *materialParams_[globalIdx]; }
486
491
492
501 template <class Context>
502 Scalar temperature(const Context& /*context*/,
503 unsigned /*spaceIdx*/,
504 unsigned /*timeIdx*/) const
505 { return temperature_; }
506
507 // \}
508
513
520 template <class Context>
521 void boundary(BoundaryRateVector& values,
522 const Context& /*context*/,
523 unsigned /*spaceIdx*/,
524 unsigned /*timeIdx*/) const
525 {
526 // no flow on top and bottom
527 values.setNoFlow();
528 }
529
531
536
543 template <class Context>
544 void initial(PrimaryVariables& values,
545 const Context& /*context*/,
546 unsigned /*spaceIdx*/,
547 unsigned /*timeIdx*/) const
548 {
549 values.assignNaive(initialFluidState_);
550
551#ifndef NDEBUG
552 for (unsigned pvIdx = 0; pvIdx < values.size(); ++ pvIdx)
553 assert(std::isfinite(values[pvIdx]));
554#endif
555 }
556
565 template <class Context>
566 void constraints(Constraints& constraintValues,
567 const Context& context,
568 unsigned spaceIdx,
569 unsigned timeIdx) const
570 {
571 if (this->simulator().episodeIndex() == 1)
572 return; // no constraints during the "settle down" episode
573
574 const auto& pos = context.pos(spaceIdx, timeIdx);
575 if (isInjector_(pos)) {
576 constraintValues.setActive(true);
577 constraintValues.assignNaive(injectorFluidState_);
578 }
579 else if (isProducer_(pos)) {
580 constraintValues.setActive(true);
581 constraintValues.assignNaive(producerFluidState_);
582 }
583 }
584
590 template <class Context>
591 void source(RateVector& rate,
592 const Context& /*context*/,
593 unsigned /*spaceIdx*/,
594 unsigned /*timeIdx*/) const
595 { rate = Scalar(0.0); }
596
598
599private:
600 void initFluidState_()
601 {
602 auto& fs = initialFluidState_;
603
605 // set temperatures
607 fs.setTemperature(temperature_);
608
610 // set saturations
612 fs.setSaturation(FluidSystem::oilPhaseIdx, 1.0);
613 fs.setSaturation(FluidSystem::waterPhaseIdx, 0.0);
614 fs.setSaturation(FluidSystem::gasPhaseIdx, 0.0);
615
617 // set pressures
619 Scalar pw = pReservoir_;
620
621 PhaseVector pC;
622 const auto& matParams = fineMaterialParams_;
623 MaterialLaw::capillaryPressures(pC, matParams, fs);
624
625 fs.setPressure(oilPhaseIdx, pw + (pC[oilPhaseIdx] - pC[waterPhaseIdx]));
626 fs.setPressure(waterPhaseIdx, pw + (pC[waterPhaseIdx] - pC[waterPhaseIdx]));
627 fs.setPressure(gasPhaseIdx, pw + (pC[gasPhaseIdx] - pC[waterPhaseIdx]));
628
629 // reset all mole fractions to 0
630 for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
631 for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
632 fs.setMoleFraction(phaseIdx, compIdx, 0.0);
633
635 // set composition of the gas and water phases
637 fs.setMoleFraction(waterPhaseIdx, waterCompIdx, 1.0);
638 fs.setMoleFraction(gasPhaseIdx, gasCompIdx, 1.0);
639
641 // set composition of the oil phase
643 Scalar RsSat =
644 FluidSystem::saturatedDissolutionFactor(fs, oilPhaseIdx, /*pvtRegionIdx=*/0);
645 Scalar XoGSat = FluidSystem::convertRsToXoG(RsSat, /*pvtRegionIdx=*/0);
646 Scalar xoGSat = FluidSystem::convertXoGToxoG(XoGSat, /*pvtRegionIdx=*/0);
647 Scalar xoG = 0.95*xoGSat;
648 Scalar xoO = 1.0 - xoG;
649
650 // finally set the oil-phase composition
651 fs.setMoleFraction(oilPhaseIdx, gasCompIdx, xoG);
652 fs.setMoleFraction(oilPhaseIdx, oilCompIdx, xoO);
653
654 using CFRP = Opm::ComputeFromReferencePhase<Scalar, FluidSystem>;
655 typename FluidSystem::template ParameterCache<Scalar> paramCache;
656 CFRP::solve(fs,
657 paramCache,
658 /*refPhaseIdx=*/oilPhaseIdx,
659 /*setViscosities=*/false,
660 /*setEnthalpies=*/false);
661
662 // set up the fluid state used for the injectors
663 auto& injFs = injectorFluidState_;
664 injFs = initialFluidState_;
665
666 Scalar pInj = pReservoir_ * 1.5;
667 injFs.setPressure(waterPhaseIdx, pInj);
668 injFs.setPressure(oilPhaseIdx, pInj);
669 injFs.setPressure(gasPhaseIdx, pInj);
670 injFs.setSaturation(waterPhaseIdx, 1.0);
671 injFs.setSaturation(oilPhaseIdx, 0.0);
672 injFs.setSaturation(gasPhaseIdx, 0.0);
673
674 // set the composition of the phases to immiscible
675 for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
676 for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
677 injFs.setMoleFraction(phaseIdx, compIdx, 0.0);
678
679 injFs.setMoleFraction(gasPhaseIdx, gasCompIdx, 1.0);
680 injFs.setMoleFraction(oilPhaseIdx, oilCompIdx, 1.0);
681 injFs.setMoleFraction(waterPhaseIdx, waterCompIdx, 1.0);
682
683 CFRP::solve(injFs,
684 paramCache,
685 /*refPhaseIdx=*/waterPhaseIdx,
686 /*setViscosities=*/true,
687 /*setEnthalpies=*/false);
688
689 // set up the fluid state used for the producer
690 auto& prodFs = producerFluidState_;
691 prodFs = initialFluidState_;
692
693 Scalar pProd = pReservoir_ / 1.5;
694 prodFs.setPressure(waterPhaseIdx, pProd);
695 prodFs.setPressure(oilPhaseIdx, pProd);
696 prodFs.setPressure(gasPhaseIdx, pProd);
697 prodFs.setSaturation(waterPhaseIdx, 0.0);
698 prodFs.setSaturation(oilPhaseIdx, 1.0);
699 prodFs.setSaturation(gasPhaseIdx, 0.0);
700
701 CFRP::solve(prodFs,
702 paramCache,
703 /*refPhaseIdx=*/oilPhaseIdx,
704 /*setViscosities=*/true,
705 /*setEnthalpies=*/false);
706 }
707
708 bool isProducer_(const GlobalPosition& pos) const
709 {
710 Scalar x = pos[0] - this->boundingBoxMin()[0];
711 Scalar y = pos[dim - 1] - this->boundingBoxMin()[dim - 1];
712 Scalar width = this->boundingBoxMax()[0] - this->boundingBoxMin()[0];
713 Scalar height = this->boundingBoxMax()[dim - 1] - this->boundingBoxMin()[dim - 1];
714
715 // only the upper half of the center section of the spatial domain is assumed to
716 // be the producer
717 if (y <= height/2.0)
718 return false;
719
720 return width/2.0 - width*1e-5 < x && x < width/2.0 + width*(wellWidth_ + 1e-5);
721 }
722
723 bool isInjector_(const GlobalPosition& pos) const
724 {
725 Scalar x = pos[0] - this->boundingBoxMin()[0];
726 Scalar y = pos[dim - 1] - this->boundingBoxMin()[dim - 1];
727 Scalar width = this->boundingBoxMax()[0] - this->boundingBoxMin()[0];
728 Scalar height = this->boundingBoxMax()[dim - 1] - this->boundingBoxMin()[dim - 1];
729
730 // only the lower half of the leftmost and rightmost part of the spatial domain
731 // are assumed to be the water injectors
732 if (y > height/2.0)
733 return false;
734
735 return x < width*wellWidth_ - width*1e-5 || x > width*(1.0 - wellWidth_) + width*1e-5;
736 }
737
738 bool isFineMaterial_(const GlobalPosition& pos) const
739 { return pos[dim - 1] > layerBottom_; }
740
741 DimMatrix fineK_;
742 DimMatrix coarseK_;
743 Scalar layerBottom_;
744 Scalar pReservoir_;
745
746 Scalar finePorosity_;
747 Scalar coarsePorosity_;
748
749 MaterialLawParams fineMaterialParams_;
750 MaterialLawParams coarseMaterialParams_;
751 std::vector<const MaterialLawParams*> materialParams_;
752
753 InitialFluidState initialFluidState_;
754 InitialFluidState injectorFluidState_;
755 InitialFluidState producerFluidState_;
756
757 Scalar temperature_;
758 Scalar maxDepth_;
759 Scalar wellWidth_;
760};
761} // namespace Opm
762
763#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:162
static void registerParameters()
Definition: reservoirproblem.hh:379
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:591
void endTimeStep()
Called by the simulator after each time integration.
Definition: reservoirproblem.hh:427
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: reservoirproblem.hh:465
void initial(PrimaryVariables &values, const Context &, unsigned, unsigned) const
Evaluate the initial value for a control volume.
Definition: reservoirproblem.hh:544
ReservoirProblem(Simulator &simulator)
Definition: reservoirproblem.hh:208
void constraints(Constraints &constraintValues, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Evaluate the constraints for a control volume.
Definition: reservoirproblem.hh:566
void boundary(BoundaryRateVector &values, const Context &, unsigned, unsigned) const
Evaluate the boundary conditions for a boundary segment.
Definition: reservoirproblem.hh:521
const MaterialLawParams & materialLawParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: reservoirproblem.hh:477
std::string name() const
The problem name.
Definition: reservoirproblem.hh:409
const MaterialLawParams & materialLawParams(unsigned globalIdx) const
Definition: reservoirproblem.hh:484
void finishInit()
Called by the Opm::Simulator in order to initialize the problem.
Definition: reservoirproblem.hh:215
const DimMatrix & intrinsicPermeability(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: reservoirproblem.hh:452
Scalar temperature(const Context &, unsigned, unsigned) const
Definition: reservoirproblem.hh:502
void endEpisode()
Called when the end of an simulation episode is reached.
Definition: reservoirproblem.hh:415
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:72
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
static constexpr Scalar value
Definition: co2injectionproblem.hh:160
static constexpr Scalar value
Definition: co2injectionproblem.hh:165
Definition: reservoirproblem.hh:138
static constexpr Scalar value
Definition: reservoirproblem.hh:138
Specify whether the some degrees of fredom can be constraint.
Definition: fvbaseproperties.hh:199
Opm::BlackOilFluidSystem< Scalar > type
Definition: reservoirproblem.hh:121
The fluid systems including the information about the phases.
Definition: multiphasebaseproperties.hh:69
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:99
The material law which ought to be used (extracted from the spatial parameters)
Definition: multiphasebaseproperties.hh:51
The type of the problem.
Definition: fvbaseproperties.hh:81
Definition: reservoirproblem.hh:72