My Project
co2injectionproblem.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_CO2_INJECTION_PROBLEM_HH
29#define EWOMS_CO2_INJECTION_PROBLEM_HH
30
31#include <opm/models/immiscible/immisciblemodel.hh>
32#include <opm/simulators/linalg/parallelamgbackend.hh>
33
34#include <opm/material/fluidsystems/H2ON2FluidSystem.hpp>
35#include <opm/material/fluidsystems/BrineCO2FluidSystem.hpp>
36#include <opm/material/fluidstates/CompositionalFluidState.hpp>
37#include <opm/material/fluidstates/ImmiscibleFluidState.hpp>
38#include <opm/material/constraintsolvers/ComputeFromReferencePhase.hpp>
39#include <opm/material/fluidmatrixinteractions/LinearMaterial.hpp>
40#include <opm/material/fluidmatrixinteractions/RegularizedBrooksCorey.hpp>
41#include <opm/material/fluidmatrixinteractions/EffToAbsLaw.hpp>
42#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
43#include <opm/material/thermal/SomertonThermalConductionLaw.hpp>
44#include <opm/material/thermal/ConstantSolidHeatCapLaw.hpp>
45#include <opm/material/binarycoefficients/Brine_CO2.hpp>
46#include <opm/material/common/UniformTabulated2DFunction.hpp>
47
48#include <dune/grid/yaspgrid.hh>
49#include <dune/grid/io/file/dgfparser/dgfyasp.hh>
50
51#include <dune/common/version.hh>
52#include <dune/common/fvector.hh>
53#include <dune/common/fmatrix.hh>
54
55#include <sstream>
56#include <iostream>
57#include <string>
58
59namespace Opm {
61template <class TypeTag>
62class Co2InjectionProblem;
63
65}
66
67namespace Opm::Properties {
68
69namespace TTag {
71}
72
73// declare the CO2 injection problem specific property tags
74template<class TypeTag, class MyTypeTag>
75struct FluidSystemPressureLow { using type = UndefinedProperty; };
76template<class TypeTag, class MyTypeTag>
77struct FluidSystemPressureHigh { using type = UndefinedProperty; };
78template<class TypeTag, class MyTypeTag>
79struct FluidSystemNumPressure { using type = UndefinedProperty; };
80template<class TypeTag, class MyTypeTag>
81struct FluidSystemTemperatureLow { using type = UndefinedProperty; };
82template<class TypeTag, class MyTypeTag>
83struct FluidSystemTemperatureHigh { using type = UndefinedProperty; };
84template<class TypeTag, class MyTypeTag>
85struct FluidSystemNumTemperature { using type = UndefinedProperty; };
86
87template<class TypeTag, class MyTypeTag>
88struct MaxDepth { using type = UndefinedProperty; };
89template<class TypeTag, class MyTypeTag>
90struct Temperature { using type = UndefinedProperty; };
91template<class TypeTag, class MyTypeTag>
92struct SimulationName { using type = UndefinedProperty; };
93
94// Set the grid type
95template<class TypeTag>
96struct Grid<TypeTag, TTag::Co2InjectionBaseProblem> { using type = Dune::YaspGrid<2>; };
97
98// Set the problem property
99template<class TypeTag>
100struct Problem<TypeTag, TTag::Co2InjectionBaseProblem>
102
103// Set fluid configuration
104template<class TypeTag>
105struct FluidSystem<TypeTag, TTag::Co2InjectionBaseProblem>
106{
107private:
108 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
109
110public:
111 using type = Opm::BrineCO2FluidSystem<Scalar>;
112 //using type = Opm::H2ON2FluidSystem<Scalar, /*useComplexRelations=*/false>;
113};
114
115// Set the material Law
116template<class TypeTag>
117struct MaterialLaw<TypeTag, TTag::Co2InjectionBaseProblem>
118{
119private:
120 using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
121 enum { liquidPhaseIdx = FluidSystem::liquidPhaseIdx };
122 enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
123
124 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
125 using Traits = Opm::TwoPhaseMaterialTraits<Scalar,
126 /*wettingPhaseIdx=*/FluidSystem::liquidPhaseIdx,
127 /*nonWettingPhaseIdx=*/FluidSystem::gasPhaseIdx>;
128
129 // define the material law which is parameterized by effective
130 // saturations
131 using EffMaterialLaw = Opm::RegularizedBrooksCorey<Traits>;
132
133public:
134 // define the material law parameterized by absolute saturations
135 using type = Opm::EffToAbsLaw<EffMaterialLaw>;
136};
137
138// Set the thermal conduction law
139template<class TypeTag>
140struct ThermalConductionLaw<TypeTag, TTag::Co2InjectionBaseProblem>
141{
142private:
143 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
144 using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
145
146public:
147 // define the material law parameterized by absolute saturations
148 using type = Opm::SomertonThermalConductionLaw<FluidSystem, Scalar>;
149};
150
151// set the energy storage law for the solid phase
152template<class TypeTag>
153struct SolidEnergyLaw<TypeTag, TTag::Co2InjectionBaseProblem>
154{ using type = Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>; };
155
156// Use the algebraic multi-grid linear solver for this problem
157template<class TypeTag>
158struct LinearSolverSplice<TypeTag, TTag::Co2InjectionBaseProblem> { using type = TTag::ParallelAmgLinearSolver; };
159
160// Write the Newton convergence behavior to disk?
161template<class TypeTag>
162struct NewtonWriteConvergence<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr bool value = false; };
163
164// Enable gravity
165template<class TypeTag>
166struct EnableGravity<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr bool value = true; };
167
168// set the defaults for the problem specific properties
169template<class TypeTag>
170struct FluidSystemPressureLow<TypeTag, TTag::Co2InjectionBaseProblem>
171{
172 using type = GetPropType<TypeTag, Scalar>;
173 static constexpr type value = 3e7;
174};
175template<class TypeTag>
176struct FluidSystemPressureHigh<TypeTag, TTag::Co2InjectionBaseProblem>
177{
178 using type = GetPropType<TypeTag, Scalar>;
179 static constexpr type value = 4e7;
180};
181template<class TypeTag>
182struct FluidSystemNumPressure<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr int value = 100; };
183template<class TypeTag>
184struct FluidSystemTemperatureLow<TypeTag, TTag::Co2InjectionBaseProblem>
185{
186 using type = GetPropType<TypeTag, Scalar>;
187 static constexpr type value = 290;
188};
189template<class TypeTag>
190struct FluidSystemTemperatureHigh<TypeTag, TTag::Co2InjectionBaseProblem>
191{
192 using type = GetPropType<TypeTag, Scalar>;
193 static constexpr type value = 500;
194};
195template<class TypeTag>
196struct FluidSystemNumTemperature<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr int value = 100; };
197
198template<class TypeTag>
199struct MaxDepth<TypeTag, TTag::Co2InjectionBaseProblem>
200{
201 using type = GetPropType<TypeTag, Scalar>;
202 static constexpr type value = 2500;
203};
204template<class TypeTag>
205struct Temperature<TypeTag, TTag::Co2InjectionBaseProblem>
206{
207 using type = GetPropType<TypeTag, Scalar>;
208 static constexpr type value = 293.15;
209};
210template<class TypeTag>
211struct SimulationName<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr auto value = "co2injection"; };
212
213// The default for the end time of the simulation
214template<class TypeTag>
215struct EndTime<TypeTag, TTag::Co2InjectionBaseProblem>
216{
217 using type = GetPropType<TypeTag, Scalar>;
218 static constexpr type value = 1e4;
219};
220
221// The default for the initial time step size of the simulation
222template<class TypeTag>
223struct InitialTimeStepSize<TypeTag, TTag::Co2InjectionBaseProblem>
224{
225 using type = GetPropType<TypeTag, Scalar>;
226 static constexpr type value = 250;
227};
228
229// The default DGF file to load
230template<class TypeTag>
231struct GridFile<TypeTag, TTag::Co2InjectionBaseProblem> { static constexpr auto value = "data/co2injection.dgf"; };
232
233} // namespace Opm::Properties
234
235namespace Opm {
258template <class TypeTag>
259class Co2InjectionProblem : public GetPropType<TypeTag, Properties::BaseProblem>
260{
261 using ParentType = GetPropType<TypeTag, Properties::BaseProblem>;
262
263 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
264 using Evaluation = GetPropType<TypeTag, Properties::Evaluation>;
265 using GridView = GetPropType<TypeTag, Properties::GridView>;
266 using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
267
268 enum { dim = GridView::dimension };
269 enum { dimWorld = GridView::dimensionworld };
270
271 // copy some indices for convenience
272 using Indices = GetPropType<TypeTag, Properties::Indices>;
273 enum { numPhases = FluidSystem::numPhases };
274 enum { gasPhaseIdx = FluidSystem::gasPhaseIdx };
275 enum { liquidPhaseIdx = FluidSystem::liquidPhaseIdx };
276 enum { CO2Idx = FluidSystem::CO2Idx };
277 enum { BrineIdx = FluidSystem::BrineIdx };
278 enum { conti0EqIdx = Indices::conti0EqIdx };
279 enum { contiCO2EqIdx = conti0EqIdx + CO2Idx };
280
281 using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
282 using RateVector = GetPropType<TypeTag, Properties::RateVector>;
283 using BoundaryRateVector = GetPropType<TypeTag, Properties::BoundaryRateVector>;
284 using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>;
285 using Simulator = GetPropType<TypeTag, Properties::Simulator>;
286 using Model = GetPropType<TypeTag, Properties::Model>;
287 using MaterialLawParams = GetPropType<TypeTag, Properties::MaterialLawParams>;
288 using ThermalConductionLaw = GetPropType<TypeTag, Properties::ThermalConductionLaw>;
289 using SolidEnergyLawParams = GetPropType<TypeTag, Properties::SolidEnergyLawParams>;
290 using ThermalConductionLawParams = typename ThermalConductionLaw::Params;
291
292 using Toolbox = Opm::MathToolbox<Evaluation>;
293 using CoordScalar = typename GridView::ctype;
294 using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
295 using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>;
296
297public:
301 Co2InjectionProblem(Simulator& simulator)
302 : ParentType(simulator)
303 { }
304
309 {
310 ParentType::finishInit();
311
312 eps_ = 1e-6;
313
314 temperatureLow_ = EWOMS_GET_PARAM(TypeTag, Scalar, FluidSystemTemperatureLow);
315 temperatureHigh_ = EWOMS_GET_PARAM(TypeTag, Scalar, FluidSystemTemperatureHigh);
316 nTemperature_ = EWOMS_GET_PARAM(TypeTag, unsigned, FluidSystemNumTemperature);
317
318 pressureLow_ = EWOMS_GET_PARAM(TypeTag, Scalar, FluidSystemPressureLow);
319 pressureHigh_ = EWOMS_GET_PARAM(TypeTag, Scalar, FluidSystemPressureHigh);
320 nPressure_ = EWOMS_GET_PARAM(TypeTag, unsigned, FluidSystemNumPressure);
321
322 maxDepth_ = EWOMS_GET_PARAM(TypeTag, Scalar, MaxDepth);
323 temperature_ = EWOMS_GET_PARAM(TypeTag, Scalar, Temperature);
324
325 // initialize the tables of the fluid system
326 // FluidSystem::init();
327 FluidSystem::init(/*Tmin=*/temperatureLow_,
328 /*Tmax=*/temperatureHigh_,
329 /*nT=*/nTemperature_,
330 /*pmin=*/pressureLow_,
331 /*pmax=*/pressureHigh_,
332 /*np=*/nPressure_);
333
334 fineLayerBottom_ = 22.0;
335
336 // intrinsic permeabilities
337 fineK_ = this->toDimMatrix_(1e-13);
338 coarseK_ = this->toDimMatrix_(1e-12);
339
340 // porosities
341 finePorosity_ = 0.3;
342 coarsePorosity_ = 0.3;
343
344 // residual saturations
345 fineMaterialParams_.setResidualSaturation(liquidPhaseIdx, 0.2);
346 fineMaterialParams_.setResidualSaturation(gasPhaseIdx, 0.0);
347 coarseMaterialParams_.setResidualSaturation(liquidPhaseIdx, 0.2);
348 coarseMaterialParams_.setResidualSaturation(gasPhaseIdx, 0.0);
349
350 // parameters for the Brooks-Corey law
351 fineMaterialParams_.setEntryPressure(1e4);
352 coarseMaterialParams_.setEntryPressure(5e3);
353 fineMaterialParams_.setLambda(2.0);
354 coarseMaterialParams_.setLambda(2.0);
355
356 fineMaterialParams_.finalize();
357 coarseMaterialParams_.finalize();
358
359 // parameters for the somerton law thermal conduction
360 computeThermalCondParams_(fineThermalCondParams_, finePorosity_);
361 computeThermalCondParams_(coarseThermalCondParams_, coarsePorosity_);
362
363 // assume constant heat capacity and granite
364 solidEnergyLawParams_.setSolidHeatCapacity(790.0 // specific heat capacity of granite [J / (kg K)]
365 * 2700.0); // density of granite [kg/m^3]
366 solidEnergyLawParams_.finalize();
367 }
368
372 static void registerParameters()
373 {
374 ParentType::registerParameters();
375
376 EWOMS_REGISTER_PARAM(TypeTag, Scalar, FluidSystemTemperatureLow,
377 "The lower temperature [K] for tabulation of the "
378 "fluid system");
379 EWOMS_REGISTER_PARAM(TypeTag, Scalar, FluidSystemTemperatureHigh,
380 "The upper temperature [K] for tabulation of the "
381 "fluid system");
382 EWOMS_REGISTER_PARAM(TypeTag, unsigned, FluidSystemNumTemperature,
383 "The number of intervals between the lower and "
384 "upper temperature");
385
386 EWOMS_REGISTER_PARAM(TypeTag, Scalar, FluidSystemPressureLow,
387 "The lower pressure [Pa] for tabulation of the "
388 "fluid system");
389 EWOMS_REGISTER_PARAM(TypeTag, Scalar, FluidSystemPressureHigh,
390 "The upper pressure [Pa] for tabulation of the "
391 "fluid system");
392 EWOMS_REGISTER_PARAM(TypeTag, unsigned, FluidSystemNumPressure,
393 "The number of intervals between the lower and "
394 "upper pressure");
395
396 EWOMS_REGISTER_PARAM(TypeTag, Scalar, Temperature,
397 "The temperature [K] in the reservoir");
398 EWOMS_REGISTER_PARAM(TypeTag, Scalar, MaxDepth,
399 "The maximum depth [m] of the reservoir");
400 EWOMS_REGISTER_PARAM(TypeTag, std::string, SimulationName,
401 "The name of the simulation used for the output "
402 "files");
403 }
404
409
413 std::string name() const
414 {
415 std::ostringstream oss;
416 oss << EWOMS_GET_PARAM(TypeTag, std::string, SimulationName)
417 << "_" << Model::name();
418 if (getPropValue<TypeTag, Properties::EnableEnergy>())
419 oss << "_ni";
420 oss << "_" << Model::discretizationName();
421 return oss.str();
422 }
423
428 {
429#ifndef NDEBUG
430 Scalar tol = this->model().newtonMethod().tolerance()*1e5;
431 this->model().checkConservativeness(tol);
432
433 // Calculate storage terms
434 PrimaryVariables storageL, storageG;
435 this->model().globalPhaseStorage(storageL, /*phaseIdx=*/0);
436 this->model().globalPhaseStorage(storageG, /*phaseIdx=*/1);
437
438 // Write mass balance information for rank 0
439 if (this->gridView().comm().rank() == 0) {
440 std::cout << "Storage: liquid=[" << storageL << "]"
441 << " gas=[" << storageG << "]\n" << std::flush;
442 }
443#endif // NDEBUG
444 }
445
449 template <class Context>
450 Scalar temperature(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
451 {
452 const auto& pos = context.pos(spaceIdx, timeIdx);
453 if (inHighTemperatureRegion_(pos))
454 return temperature_ + 100;
455 return temperature_;
456 }
457
461 template <class Context>
462 const DimMatrix& intrinsicPermeability(const Context& context, unsigned spaceIdx,
463 unsigned timeIdx) const
464 {
465 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
466 if (isFineMaterial_(pos))
467 return fineK_;
468 return coarseK_;
469 }
470
474 template <class Context>
475 Scalar porosity(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
476 {
477 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
478 if (isFineMaterial_(pos))
479 return finePorosity_;
480 return coarsePorosity_;
481 }
482
486 template <class Context>
487 const MaterialLawParams& materialLawParams(const Context& context,
488 unsigned spaceIdx, unsigned timeIdx) const
489 {
490 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
491 if (isFineMaterial_(pos))
492 return fineMaterialParams_;
493 return coarseMaterialParams_;
494 }
495
501 template <class Context>
502 const SolidEnergyLawParams&
503 solidEnergyLawParams(const Context& /*context*/,
504 unsigned /*spaceIdx*/,
505 unsigned /*timeIdx*/) const
506 { return solidEnergyLawParams_; }
507
511 template <class Context>
512 const ThermalConductionLawParams &
513 thermalConductionLawParams(const Context& context,
514 unsigned spaceIdx,
515 unsigned timeIdx) const
516 {
517 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
518 if (isFineMaterial_(pos))
519 return fineThermalCondParams_;
520 return coarseThermalCondParams_;
521 }
522
524
529
533 template <class Context>
534 void boundary(BoundaryRateVector& values, const Context& context,
535 unsigned spaceIdx, unsigned timeIdx) const
536 {
537 const auto& pos = context.pos(spaceIdx, timeIdx);
538 if (onLeftBoundary_(pos)) {
539 Opm::CompositionalFluidState<Scalar, FluidSystem> fs;
540 initialFluidState_(fs, context, spaceIdx, timeIdx);
541 fs.checkDefined();
542
543 // impose an freeflow boundary condition
544 values.setFreeFlow(context, spaceIdx, timeIdx, fs);
545 }
546 else if (onInlet_(pos)) {
547 RateVector massRate(0.0);
548 massRate[contiCO2EqIdx] = -1e-3; // [kg/(m^3 s)]
549
550 using FluidState = Opm::ImmiscibleFluidState<Scalar, FluidSystem>;
551 FluidState fs;
552 fs.setSaturation(gasPhaseIdx, 1.0);
553 const auto& pg =
554 context.intensiveQuantities(spaceIdx, timeIdx).fluidState().pressure(gasPhaseIdx);
555 fs.setPressure(gasPhaseIdx, Toolbox::value(pg));
556 fs.setTemperature(temperature(context, spaceIdx, timeIdx));
557
558 typename FluidSystem::template ParameterCache<Scalar> paramCache;
559 paramCache.updatePhase(fs, gasPhaseIdx);
560 Scalar h = FluidSystem::template enthalpy<FluidState, Scalar>(fs, paramCache, gasPhaseIdx);
561
562 // impose an forced inflow boundary condition for pure CO2
563 values.setMassRate(massRate);
564 values.setEnthalpyRate(massRate[contiCO2EqIdx] * h);
565 }
566 else
567 // no flow on top and bottom
568 values.setNoFlow();
569 }
570
571 // \}
572
577
581 template <class Context>
582 void initial(PrimaryVariables& values, const Context& context, unsigned spaceIdx,
583 unsigned timeIdx) const
584 {
585 Opm::CompositionalFluidState<Scalar, FluidSystem> fs;
586 initialFluidState_(fs, context, spaceIdx, timeIdx);
587
588 // const auto& matParams = this->materialLawParams(context, spaceIdx,
589 // timeIdx);
590 // values.assignMassConservative(fs, matParams, /*inEquilibrium=*/true);
591 values.assignNaive(fs);
592 }
593
600 template <class Context>
601 void source(RateVector& rate,
602 const Context& /*context*/,
603 unsigned /*spaceIdx*/,
604 unsigned /*timeIdx*/) const
605 { rate = Scalar(0.0); }
606
608
609private:
610 template <class Context, class FluidState>
611 void initialFluidState_(FluidState& fs,
612 const Context& context,
613 unsigned spaceIdx,
614 unsigned timeIdx) const
615 {
616 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
617
619 // set temperature
621 fs.setTemperature(temperature(context, spaceIdx, timeIdx));
622
624 // set saturations
626 fs.setSaturation(FluidSystem::liquidPhaseIdx, 1.0);
627 fs.setSaturation(FluidSystem::gasPhaseIdx, 0.0);
628
630 // set pressures
632 Scalar densityL = FluidSystem::Brine::liquidDensity(temperature_, Scalar(1e5));
633 Scalar depth = maxDepth_ - pos[dim - 1];
634 Scalar pl = 1e5 - densityL * this->gravity()[dim - 1] * depth;
635
636 Scalar pC[numPhases];
637 const auto& matParams = this->materialLawParams(context, spaceIdx, timeIdx);
638 MaterialLaw::capillaryPressures(pC, matParams, fs);
639
640 fs.setPressure(liquidPhaseIdx, pl + (pC[liquidPhaseIdx] - pC[liquidPhaseIdx]));
641 fs.setPressure(gasPhaseIdx, pl + (pC[gasPhaseIdx] - pC[liquidPhaseIdx]));
642
644 // set composition of the liquid phase
646 fs.setMoleFraction(liquidPhaseIdx, CO2Idx, 0.005);
647 fs.setMoleFraction(liquidPhaseIdx, BrineIdx,
648 1.0 - fs.moleFraction(liquidPhaseIdx, CO2Idx));
649
650 typename FluidSystem::template ParameterCache<Scalar> paramCache;
651 using CFRP = Opm::ComputeFromReferencePhase<Scalar, FluidSystem>;
652 CFRP::solve(fs, paramCache,
653 /*refPhaseIdx=*/liquidPhaseIdx,
654 /*setViscosity=*/true,
655 /*setEnthalpy=*/true);
656 }
657
658 bool onLeftBoundary_(const GlobalPosition& pos) const
659 { return pos[0] < eps_; }
660
661 bool onRightBoundary_(const GlobalPosition& pos) const
662 { return pos[0] > this->boundingBoxMax()[0] - eps_; }
663
664 bool onInlet_(const GlobalPosition& pos) const
665 { return onRightBoundary_(pos) && (5 < pos[1]) && (pos[1] < 15); }
666
667 bool inHighTemperatureRegion_(const GlobalPosition& pos) const
668 { return (pos[0] > 20) && (pos[0] < 30) && (pos[1] > 5) && (pos[1] < 35); }
669
670 void computeThermalCondParams_(ThermalConductionLawParams& params, Scalar poro)
671 {
672 Scalar lambdaWater = 0.6;
673 Scalar lambdaGranite = 2.8;
674
675 Scalar lambdaWet = std::pow(lambdaGranite, (1 - poro))
676 * std::pow(lambdaWater, poro);
677 Scalar lambdaDry = std::pow(lambdaGranite, (1 - poro));
678
679 params.setFullySaturatedLambda(gasPhaseIdx, lambdaDry);
680 params.setFullySaturatedLambda(liquidPhaseIdx, lambdaWet);
681 params.setVacuumLambda(lambdaDry);
682 }
683
684 bool isFineMaterial_(const GlobalPosition& pos) const
685 { return pos[dim - 1] > fineLayerBottom_; }
686
687 DimMatrix fineK_;
688 DimMatrix coarseK_;
689 Scalar fineLayerBottom_;
690
691 Scalar finePorosity_;
692 Scalar coarsePorosity_;
693
694 MaterialLawParams fineMaterialParams_;
695 MaterialLawParams coarseMaterialParams_;
696
697 ThermalConductionLawParams fineThermalCondParams_;
698 ThermalConductionLawParams coarseThermalCondParams_;
699 SolidEnergyLawParams solidEnergyLawParams_;
700
701 Scalar temperature_;
702 Scalar maxDepth_;
703 Scalar eps_;
704
705 unsigned nTemperature_;
706 unsigned nPressure_;
707
708 Scalar pressureLow_, pressureHigh_;
709 Scalar temperatureLow_, temperatureHigh_;
710};
711} // namespace Opm
712
713#endif
Problem where is injected under a low permeable layer at a depth of 2700m.
Definition: co2injectionproblem.hh:260
void finishInit()
Definition: co2injectionproblem.hh:308
Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: co2injectionproblem.hh:475
const ThermalConductionLawParams & thermalConductionLawParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: co2injectionproblem.hh:513
const DimMatrix & intrinsicPermeability(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: co2injectionproblem.hh:462
void boundary(BoundaryRateVector &values, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: co2injectionproblem.hh:534
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: co2injectionproblem.hh:582
const MaterialLawParams & materialLawParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: co2injectionproblem.hh:487
void source(RateVector &rate, const Context &, unsigned, unsigned) const
Definition: co2injectionproblem.hh:601
const SolidEnergyLawParams & solidEnergyLawParams(const Context &, unsigned, unsigned) const
Return the parameters for the heat storage law of the rock.
Definition: co2injectionproblem.hh:503
std::string name() const
Definition: co2injectionproblem.hh:413
void endTimeStep()
Definition: co2injectionproblem.hh:427
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition: co2injectionproblem.hh:450
Co2InjectionProblem(Simulator &simulator)
Definition: co2injectionproblem.hh:301
static void registerParameters()
Definition: co2injectionproblem.hh:372
Definition: co2injectionproblem.hh:79
Definition: co2injectionproblem.hh:85
Definition: co2injectionproblem.hh:77
Definition: co2injectionproblem.hh:75
Definition: co2injectionproblem.hh:83
Definition: co2injectionproblem.hh:81
Definition: co2injectionproblem.hh:88
Definition: co2injectionproblem.hh:92
Definition: co2injectionproblem.hh:70
Definition: co2injectionproblem.hh:90