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
517 Scalar temperature(unsigned /*globalDofIdx*/,
518 unsigned /*timeIdx*/) const
519 { return temperature_; }
520
521 // \}
522
527
534 template <class Context>
535 void boundary(BoundaryRateVector& values,
536 const Context& /*context*/,
537 unsigned /*spaceIdx*/,
538 unsigned /*timeIdx*/) const
539 {
540 // no flow on top and bottom
541 values.setNoFlow();
542 }
543
545
550
557 template <class Context>
558 void initial(PrimaryVariables& values,
559 const Context& /*context*/,
560 unsigned /*spaceIdx*/,
561 unsigned /*timeIdx*/) const
562 {
563 values.assignNaive(initialFluidState_);
564
565#ifndef NDEBUG
566 for (unsigned pvIdx = 0; pvIdx < values.size(); ++ pvIdx)
567 assert(std::isfinite(values[pvIdx]));
568#endif
569 }
570
579 template <class Context>
580 void constraints(Constraints& constraintValues,
581 const Context& context,
582 unsigned spaceIdx,
583 unsigned timeIdx) const
584 {
585 if (this->simulator().episodeIndex() == 1)
586 return; // no constraints during the "settle down" episode
587
588 const auto& pos = context.pos(spaceIdx, timeIdx);
589 if (isInjector_(pos)) {
590 constraintValues.setActive(true);
591 constraintValues.assignNaive(injectorFluidState_);
592 }
593 else if (isProducer_(pos)) {
594 constraintValues.setActive(true);
595 constraintValues.assignNaive(producerFluidState_);
596 }
597 }
598
604 template <class Context>
605 void source(RateVector& rate,
606 const Context& /*context*/,
607 unsigned /*spaceIdx*/,
608 unsigned /*timeIdx*/) const
609 { rate = Scalar(0.0); }
610
612
613private:
614 void initFluidState_()
615 {
616 auto& fs = initialFluidState_;
617
619 // set temperatures
621 fs.setTemperature(temperature_);
622
624 // set saturations
626 fs.setSaturation(FluidSystem::oilPhaseIdx, 1.0);
627 fs.setSaturation(FluidSystem::waterPhaseIdx, 0.0);
628 fs.setSaturation(FluidSystem::gasPhaseIdx, 0.0);
629
631 // set pressures
633 Scalar pw = pReservoir_;
634
635 PhaseVector pC;
636 const auto& matParams = fineMaterialParams_;
637 MaterialLaw::capillaryPressures(pC, matParams, fs);
638
639 fs.setPressure(oilPhaseIdx, pw + (pC[oilPhaseIdx] - pC[waterPhaseIdx]));
640 fs.setPressure(waterPhaseIdx, pw + (pC[waterPhaseIdx] - pC[waterPhaseIdx]));
641 fs.setPressure(gasPhaseIdx, pw + (pC[gasPhaseIdx] - pC[waterPhaseIdx]));
642
643 // reset all mole fractions to 0
644 for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
645 for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
646 fs.setMoleFraction(phaseIdx, compIdx, 0.0);
647
649 // set composition of the gas and water phases
651 fs.setMoleFraction(waterPhaseIdx, waterCompIdx, 1.0);
652 fs.setMoleFraction(gasPhaseIdx, gasCompIdx, 1.0);
653
655 // set composition of the oil phase
657 Scalar RsSat =
658 FluidSystem::saturatedDissolutionFactor(fs, oilPhaseIdx, /*pvtRegionIdx=*/0);
659 Scalar XoGSat = FluidSystem::convertRsToXoG(RsSat, /*pvtRegionIdx=*/0);
660 Scalar xoGSat = FluidSystem::convertXoGToxoG(XoGSat, /*pvtRegionIdx=*/0);
661 Scalar xoG = 0.95*xoGSat;
662 Scalar xoO = 1.0 - xoG;
663
664 // finally set the oil-phase composition
665 fs.setMoleFraction(oilPhaseIdx, gasCompIdx, xoG);
666 fs.setMoleFraction(oilPhaseIdx, oilCompIdx, xoO);
667
668 using CFRP = Opm::ComputeFromReferencePhase<Scalar, FluidSystem>;
669 typename FluidSystem::template ParameterCache<Scalar> paramCache;
670 CFRP::solve(fs,
671 paramCache,
672 /*refPhaseIdx=*/oilPhaseIdx,
673 /*setViscosities=*/false,
674 /*setEnthalpies=*/false);
675
676 // set up the fluid state used for the injectors
677 auto& injFs = injectorFluidState_;
678 injFs = initialFluidState_;
679
680 Scalar pInj = pReservoir_ * 1.5;
681 injFs.setPressure(waterPhaseIdx, pInj);
682 injFs.setPressure(oilPhaseIdx, pInj);
683 injFs.setPressure(gasPhaseIdx, pInj);
684 injFs.setSaturation(waterPhaseIdx, 1.0);
685 injFs.setSaturation(oilPhaseIdx, 0.0);
686 injFs.setSaturation(gasPhaseIdx, 0.0);
687
688 // set the composition of the phases to immiscible
689 for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
690 for (unsigned compIdx = 0; compIdx < numComponents; ++compIdx)
691 injFs.setMoleFraction(phaseIdx, compIdx, 0.0);
692
693 injFs.setMoleFraction(gasPhaseIdx, gasCompIdx, 1.0);
694 injFs.setMoleFraction(oilPhaseIdx, oilCompIdx, 1.0);
695 injFs.setMoleFraction(waterPhaseIdx, waterCompIdx, 1.0);
696
697 CFRP::solve(injFs,
698 paramCache,
699 /*refPhaseIdx=*/waterPhaseIdx,
700 /*setViscosities=*/true,
701 /*setEnthalpies=*/false);
702
703 // set up the fluid state used for the producer
704 auto& prodFs = producerFluidState_;
705 prodFs = initialFluidState_;
706
707 Scalar pProd = pReservoir_ / 1.5;
708 prodFs.setPressure(waterPhaseIdx, pProd);
709 prodFs.setPressure(oilPhaseIdx, pProd);
710 prodFs.setPressure(gasPhaseIdx, pProd);
711 prodFs.setSaturation(waterPhaseIdx, 0.0);
712 prodFs.setSaturation(oilPhaseIdx, 1.0);
713 prodFs.setSaturation(gasPhaseIdx, 0.0);
714
715 CFRP::solve(prodFs,
716 paramCache,
717 /*refPhaseIdx=*/oilPhaseIdx,
718 /*setViscosities=*/true,
719 /*setEnthalpies=*/false);
720 }
721
722 bool isProducer_(const GlobalPosition& pos) const
723 {
724 Scalar x = pos[0] - this->boundingBoxMin()[0];
725 Scalar y = pos[dim - 1] - this->boundingBoxMin()[dim - 1];
726 Scalar width = this->boundingBoxMax()[0] - this->boundingBoxMin()[0];
727 Scalar height = this->boundingBoxMax()[dim - 1] - this->boundingBoxMin()[dim - 1];
728
729 // only the upper half of the center section of the spatial domain is assumed to
730 // be the producer
731 if (y <= height/2.0)
732 return false;
733
734 return width/2.0 - width*1e-5 < x && x < width/2.0 + width*(wellWidth_ + 1e-5);
735 }
736
737 bool isInjector_(const GlobalPosition& pos) const
738 {
739 Scalar x = pos[0] - this->boundingBoxMin()[0];
740 Scalar y = pos[dim - 1] - this->boundingBoxMin()[dim - 1];
741 Scalar width = this->boundingBoxMax()[0] - this->boundingBoxMin()[0];
742 Scalar height = this->boundingBoxMax()[dim - 1] - this->boundingBoxMin()[dim - 1];
743
744 // only the lower half of the leftmost and rightmost part of the spatial domain
745 // are assumed to be the water injectors
746 if (y > height/2.0)
747 return false;
748
749 return x < width*wellWidth_ - width*1e-5 || x > width*(1.0 - wellWidth_) + width*1e-5;
750 }
751
752 bool isFineMaterial_(const GlobalPosition& pos) const
753 { return pos[dim - 1] > layerBottom_; }
754
755 DimMatrix fineK_;
756 DimMatrix coarseK_;
757 Scalar layerBottom_;
758 Scalar pReservoir_;
759
760 Scalar finePorosity_;
761 Scalar coarsePorosity_;
762
763 MaterialLawParams fineMaterialParams_;
764 MaterialLawParams coarseMaterialParams_;
765 std::vector<const MaterialLawParams*> materialParams_;
766
767 InitialFluidState initialFluidState_;
768 InitialFluidState injectorFluidState_;
769 InitialFluidState producerFluidState_;
770
771 Scalar temperature_;
772 Scalar maxDepth_;
773 Scalar wellWidth_;
774};
775} // namespace Opm
776
777#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:605
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:558
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:580
Scalar temperature(unsigned, unsigned) const
Definition: reservoirproblem.hh:517
void boundary(BoundaryRateVector &values, const Context &, unsigned, unsigned) const
Evaluate the boundary conditions for a boundary segment.
Definition: reservoirproblem.hh:535
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:80
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:104
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