My Project
Loading...
Searching...
No Matches
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>
101{ using type = Opm::Co2InjectionProblem<TypeTag>; };
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 unsigned 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 unsigned 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_ = Parameters::get<TypeTag, Properties::FluidSystemTemperatureLow>();
315 temperatureHigh_ = Parameters::get<TypeTag, Properties::FluidSystemTemperatureHigh>();
316 nTemperature_ = Parameters::get<TypeTag, Properties::FluidSystemNumTemperature>();
317
318 pressureLow_ = Parameters::get<TypeTag, Properties::FluidSystemPressureLow>();
319 pressureHigh_ = Parameters::get<TypeTag, Properties::FluidSystemPressureHigh>();
320 nPressure_ = Parameters::get<TypeTag, Properties::FluidSystemNumPressure>();
321
322 maxDepth_ = Parameters::get<TypeTag, Properties::MaxDepth>();
323 temperature_ = Parameters::get<TypeTag, Properties::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 Parameters::registerParam<TypeTag, Properties::FluidSystemTemperatureLow>
377 ("The lower temperature [K] for tabulation of the fluid system");
378 Parameters::registerParam<TypeTag, Properties::FluidSystemTemperatureHigh>
379 ("The upper temperature [K] for tabulation of the fluid system");
380 Parameters::registerParam<TypeTag, Properties::FluidSystemNumTemperature>
381 ("The number of intervals between the lower and upper temperature");
382 Parameters::registerParam<TypeTag, Properties::FluidSystemPressureLow>
383 ("The lower pressure [Pa] for tabulation of the fluid system");
384 Parameters::registerParam<TypeTag, Properties::FluidSystemPressureHigh>
385 ("The upper pressure [Pa] for tabulation of the fluid system");
386 Parameters::registerParam<TypeTag, Properties::FluidSystemNumPressure>
387 ("The number of intervals between the lower and upper pressure");
388 Parameters::registerParam<TypeTag, Properties::Temperature>
389 ("The temperature [K] in the reservoir");
390 Parameters::registerParam<TypeTag, Properties::MaxDepth>
391 ("The maximum depth [m] of the reservoir");
392 Parameters::registerParam<TypeTag, Properties::SimulationName>
393 ("The name of the simulation used for the output files");
394 }
395
400
404 std::string name() const
405 {
406 std::ostringstream oss;
407 oss << Parameters::get<TypeTag, Properties::SimulationName>()
408 << "_" << Model::name();
409 if (getPropValue<TypeTag, Properties::EnableEnergy>())
410 oss << "_ni";
411 oss << "_" << Model::discretizationName();
412 return oss.str();
413 }
414
419 {
420#ifndef NDEBUG
421 Scalar tol = this->model().newtonMethod().tolerance()*1e5;
422 this->model().checkConservativeness(tol);
423
424 // Calculate storage terms
425 PrimaryVariables storageL, storageG;
426 this->model().globalPhaseStorage(storageL, /*phaseIdx=*/0);
427 this->model().globalPhaseStorage(storageG, /*phaseIdx=*/1);
428
429 // Write mass balance information for rank 0
430 if (this->gridView().comm().rank() == 0) {
431 std::cout << "Storage: liquid=[" << storageL << "]"
432 << " gas=[" << storageG << "]\n" << std::flush;
433 }
434#endif // NDEBUG
435 }
436
440 template <class Context>
441 Scalar temperature(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
442 {
443 const auto& pos = context.pos(spaceIdx, timeIdx);
444 if (inHighTemperatureRegion_(pos))
445 return temperature_ + 100;
446 return temperature_;
447 }
448
452 template <class Context>
453 const DimMatrix& intrinsicPermeability(const Context& context, unsigned spaceIdx,
454 unsigned timeIdx) const
455 {
456 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
457 if (isFineMaterial_(pos))
458 return fineK_;
459 return coarseK_;
460 }
461
465 template <class Context>
466 Scalar porosity(const Context& context, unsigned spaceIdx, unsigned timeIdx) const
467 {
468 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
469 if (isFineMaterial_(pos))
470 return finePorosity_;
471 return coarsePorosity_;
472 }
473
477 template <class Context>
478 const MaterialLawParams& materialLawParams(const Context& context,
479 unsigned spaceIdx, unsigned timeIdx) const
480 {
481 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
482 if (isFineMaterial_(pos))
483 return fineMaterialParams_;
484 return coarseMaterialParams_;
485 }
486
492 template <class Context>
493 const SolidEnergyLawParams&
494 solidEnergyLawParams(const Context& /*context*/,
495 unsigned /*spaceIdx*/,
496 unsigned /*timeIdx*/) const
497 { return solidEnergyLawParams_; }
498
502 template <class Context>
503 const ThermalConductionLawParams &
504 thermalConductionLawParams(const Context& context,
505 unsigned spaceIdx,
506 unsigned timeIdx) const
507 {
508 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
509 if (isFineMaterial_(pos))
510 return fineThermalCondParams_;
511 return coarseThermalCondParams_;
512 }
513
515
520
524 template <class Context>
525 void boundary(BoundaryRateVector& values, const Context& context,
526 unsigned spaceIdx, unsigned timeIdx) const
527 {
528 const auto& pos = context.pos(spaceIdx, timeIdx);
529 if (onLeftBoundary_(pos)) {
530 Opm::CompositionalFluidState<Scalar, FluidSystem> fs;
531 initialFluidState_(fs, context, spaceIdx, timeIdx);
532 fs.checkDefined();
533
534 // impose an freeflow boundary condition
535 values.setFreeFlow(context, spaceIdx, timeIdx, fs);
536 }
537 else if (onInlet_(pos)) {
538 RateVector massRate(0.0);
539 massRate[contiCO2EqIdx] = -1e-3; // [kg/(m^3 s)]
540
541 using FluidState = Opm::ImmiscibleFluidState<Scalar, FluidSystem>;
542 FluidState fs;
543 fs.setSaturation(gasPhaseIdx, 1.0);
544 const auto& pg =
545 context.intensiveQuantities(spaceIdx, timeIdx).fluidState().pressure(gasPhaseIdx);
546 fs.setPressure(gasPhaseIdx, Toolbox::value(pg));
547 fs.setTemperature(temperature(context, spaceIdx, timeIdx));
548
549 typename FluidSystem::template ParameterCache<Scalar> paramCache;
550 paramCache.updatePhase(fs, gasPhaseIdx);
551 Scalar h = FluidSystem::template enthalpy<FluidState, Scalar>(fs, paramCache, gasPhaseIdx);
552
553 // impose an forced inflow boundary condition for pure CO2
554 values.setMassRate(massRate);
555 values.setEnthalpyRate(massRate[contiCO2EqIdx] * h);
556 }
557 else
558 // no flow on top and bottom
559 values.setNoFlow();
560 }
561
562 // \}
563
568
572 template <class Context>
573 void initial(PrimaryVariables& values, const Context& context, unsigned spaceIdx,
574 unsigned timeIdx) const
575 {
576 Opm::CompositionalFluidState<Scalar, FluidSystem> fs;
577 initialFluidState_(fs, context, spaceIdx, timeIdx);
578
579 // const auto& matParams = this->materialLawParams(context, spaceIdx,
580 // timeIdx);
581 // values.assignMassConservative(fs, matParams, /*inEquilibrium=*/true);
582 values.assignNaive(fs);
583 }
584
591 template <class Context>
592 void source(RateVector& rate,
593 const Context& /*context*/,
594 unsigned /*spaceIdx*/,
595 unsigned /*timeIdx*/) const
596 { rate = Scalar(0.0); }
597
599
600private:
601 template <class Context, class FluidState>
602 void initialFluidState_(FluidState& fs,
603 const Context& context,
604 unsigned spaceIdx,
605 unsigned timeIdx) const
606 {
607 const GlobalPosition& pos = context.pos(spaceIdx, timeIdx);
608
610 // set temperature
612 fs.setTemperature(temperature(context, spaceIdx, timeIdx));
613
615 // set saturations
617 fs.setSaturation(FluidSystem::liquidPhaseIdx, 1.0);
618 fs.setSaturation(FluidSystem::gasPhaseIdx, 0.0);
619
621 // set pressures
623 Scalar densityL = FluidSystem::Brine::liquidDensity(temperature_, Scalar(1e5));
624 Scalar depth = maxDepth_ - pos[dim - 1];
625 Scalar pl = 1e5 - densityL * this->gravity()[dim - 1] * depth;
626
627 Scalar pC[numPhases];
628 const auto& matParams = this->materialLawParams(context, spaceIdx, timeIdx);
629 MaterialLaw::capillaryPressures(pC, matParams, fs);
630
631 fs.setPressure(liquidPhaseIdx, pl + (pC[liquidPhaseIdx] - pC[liquidPhaseIdx]));
632 fs.setPressure(gasPhaseIdx, pl + (pC[gasPhaseIdx] - pC[liquidPhaseIdx]));
633
635 // set composition of the liquid phase
637 fs.setMoleFraction(liquidPhaseIdx, CO2Idx, 0.005);
638 fs.setMoleFraction(liquidPhaseIdx, BrineIdx,
639 1.0 - fs.moleFraction(liquidPhaseIdx, CO2Idx));
640
641 typename FluidSystem::template ParameterCache<Scalar> paramCache;
642 using CFRP = Opm::ComputeFromReferencePhase<Scalar, FluidSystem>;
643 CFRP::solve(fs, paramCache,
644 /*refPhaseIdx=*/liquidPhaseIdx,
645 /*setViscosity=*/true,
646 /*setEnthalpy=*/true);
647 }
648
649 bool onLeftBoundary_(const GlobalPosition& pos) const
650 { return pos[0] < eps_; }
651
652 bool onRightBoundary_(const GlobalPosition& pos) const
653 { return pos[0] > this->boundingBoxMax()[0] - eps_; }
654
655 bool onInlet_(const GlobalPosition& pos) const
656 { return onRightBoundary_(pos) && (5 < pos[1]) && (pos[1] < 15); }
657
658 bool inHighTemperatureRegion_(const GlobalPosition& pos) const
659 { return (pos[0] > 20) && (pos[0] < 30) && (pos[1] > 5) && (pos[1] < 35); }
660
661 void computeThermalCondParams_(ThermalConductionLawParams& params, Scalar poro)
662 {
663 Scalar lambdaWater = 0.6;
664 Scalar lambdaGranite = 2.8;
665
666 Scalar lambdaWet = std::pow(lambdaGranite, (1 - poro))
667 * std::pow(lambdaWater, poro);
668 Scalar lambdaDry = std::pow(lambdaGranite, (1 - poro));
669
670 params.setFullySaturatedLambda(gasPhaseIdx, lambdaDry);
671 params.setFullySaturatedLambda(liquidPhaseIdx, lambdaWet);
672 params.setVacuumLambda(lambdaDry);
673 }
674
675 bool isFineMaterial_(const GlobalPosition& pos) const
676 { return pos[dim - 1] > fineLayerBottom_; }
677
678 DimMatrix fineK_;
679 DimMatrix coarseK_;
680 Scalar fineLayerBottom_;
681
682 Scalar finePorosity_;
683 Scalar coarsePorosity_;
684
685 MaterialLawParams fineMaterialParams_;
686 MaterialLawParams coarseMaterialParams_;
687
688 ThermalConductionLawParams fineThermalCondParams_;
689 ThermalConductionLawParams coarseThermalCondParams_;
690 SolidEnergyLawParams solidEnergyLawParams_;
691
692 Scalar temperature_;
693 Scalar maxDepth_;
694 Scalar eps_;
695
696 unsigned nTemperature_;
697 unsigned nPressure_;
698
699 Scalar pressureLow_, pressureHigh_;
700 Scalar temperatureLow_, temperatureHigh_;
701};
702} // namespace Opm
703
704#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:466
const ThermalConductionLawParams & thermalConductionLawParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition co2injectionproblem.hh:504
const DimMatrix & intrinsicPermeability(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition co2injectionproblem.hh:453
void boundary(BoundaryRateVector &values, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition co2injectionproblem.hh:525
void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition co2injectionproblem.hh:573
const MaterialLawParams & materialLawParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition co2injectionproblem.hh:478
void source(RateVector &rate, const Context &, unsigned, unsigned) const
Definition co2injectionproblem.hh:592
const SolidEnergyLawParams & solidEnergyLawParams(const Context &, unsigned, unsigned) const
Return the parameters for the heat storage law of the rock.
Definition co2injectionproblem.hh:494
std::string name() const
Definition co2injectionproblem.hh:404
void endTimeStep()
Definition co2injectionproblem.hh:418
Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
Definition co2injectionproblem.hh:441
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