FlowGenericProblem_impl.hpp
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*/
23#ifndef OPM_FLOW_GENERIC_PROBLEM_IMPL_HPP
24#define OPM_FLOW_GENERIC_PROBLEM_IMPL_HPP
25
26#ifndef OPM_FLOW_GENERIC_PROBLEM_HPP
27#include <config.h>
29#endif
30
31#include <dune/common/parametertree.hh>
32
33#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
34#include <opm/input/eclipse/EclipseState/Tables/OverburdTable.hpp>
35#include <opm/input/eclipse/EclipseState/Tables/RockwnodTable.hpp>
36#include <opm/input/eclipse/Schedule/Schedule.hpp>
37#include <opm/input/eclipse/Units/Units.hpp>
38
42
45
47
48#include <boost/date_time.hpp>
49
50#include <fmt/format.h>
51#include <fmt/ranges.h>
52
53#include <iostream>
54#include <stdexcept>
55
56namespace Opm {
57
58template<class GridView, class FluidSystem>
60FlowGenericProblem(const EclipseState& eclState,
61 const Schedule& schedule,
62 const GridView& gridView)
63 : eclState_(eclState)
64 , schedule_(schedule)
65 , gridView_(gridView)
66 , lookUpData_(gridView)
67{
68 // we need to update the FluidSystem based on EclipseState before it is passed around
69 this->initFluidSystem_();
70
71 enableTuning_ = Parameters::Get<Parameters::EnableTuning>();
72 enableDriftCompensation_ = Parameters::Get<Parameters::EnableDriftCompensation>();
73 initialTimeStepSize_ = Parameters::Get<Parameters::InitialTimeStepSize<Scalar>>();
74 maxTimeStepAfterWellEvent_ = unit::convert::from
76
77 // The value N for this parameter is defined in the following order of precedence:
78 //
79 // 1. Command line value (--num-pressure-points-equil=N)
80 //
81 // 2. EQLDIMS item 2. Default value from
82 // opm-common/opm/input/eclipse/share/keywords/000_Eclipse100/E/EQLDIMS
83
84 numPressurePointsEquil_ = Parameters::IsSet<Parameters::NumPressurePointsEquil>()
85 ? Parameters::Get<Parameters::NumPressurePointsEquil>()
86 : eclState.getTableManager().getEqldims().getNumDepthNodesP();
87
88 explicitRockCompaction_ = Parameters::Get<Parameters::ExplicitRockCompaction>();
89}
91template<class GridView, class FluidSystem>
94serializationTestObject(const EclipseState& eclState,
95 const Schedule& schedule,
96 const GridView& gridView)
97{
98 FlowGenericProblem result(eclState, schedule, gridView);
99 result.maxOilSaturation_ = {1.0, 2.0};
100 result.maxWaterSaturation_ = {6.0};
101 result.minRefPressure_ = {7.0, 8.0, 9.0, 10.0};
102 result.overburdenPressure_ = {11.0};
103 result.solventSaturation_ = {15.0};
104 result.solventRsw_ = {18.0};
108
109 return result;
110}
111
112template<class GridView, class FluidSystem>
113std::string
115helpPreamble(int,
116 const char **argv)
117{
118 std::string desc = FlowGenericProblem::briefDescription();
119 if (!desc.empty())
120 desc = desc + "\n";
121
122 return
123 "Usage: "+std::string(argv[0]) + " [OPTIONS] [ECL_DECK_FILENAME]\n"
124 + desc;
125}
126
127template<class GridView, class FluidSystem>
128std::string
131{
132 return briefDescription_;
133}
134
135template<class GridView, class FluidSystem>
137readRockParameters_(const std::vector<Scalar>& cellCenterDepths,
138 std::function<std::array<int,3>(const unsigned)> ijkIndex)
139{
140 const auto& rock_config = eclState_.getSimulationConfig().rock_config();
141
142 // read the rock compressibility parameters
143 {
144 const auto& comp = rock_config.comp();
145 rockParams_.clear();
146 std::transform(comp.begin(), comp.end(), std::back_inserter(rockParams_),
147 [](const auto& c)
148 {
149 return RockParams{static_cast<Scalar>(c.pref),
150 static_cast<Scalar>(c.compressibility)};
151 });
152 }
153
154 // Warn that ROCK and ROCKOPTS item 2 = STORE is used together
155 if (rock_config.store()) {
156 OpmLog::warning("ROCKOPTS item 2 set to STORE, ROCK item 1 replaced with initial (equilibrated) pressures");
157 }
158
159 // read the parameters for water-induced rock compaction
160 readRockCompactionParameters_();
162 unsigned numElem = gridView_.size(0);
163 if (eclState_.fieldProps().has_int(rock_config.rocknum_property())) {
164 // Auxiliary function to check rockTableIdx_ values belong to the right range. Otherwise, throws.
165 std::function<void(int, int)> valueCheck = [&ijkIndex,&rock_config,this](int fieldPropValue, int coarseElemIdx)
167 auto fmtError = [fieldPropValue, coarseElemIdx,&ijkIndex,&rock_config](const char* type, std::size_t size)
168 {
169 return fmt::format("{} table index {} for elem {} read from {}"
170 " is out of bounds for number of tables {}",
171 type, fieldPropValue,
172 ijkIndex(coarseElemIdx),
173 rock_config.rocknum_property(), size);
174 };
175 if (!rockCompPoroMult_.empty() &&
176 fieldPropValue > static_cast<int>(rockCompPoroMult_.size())) {
177 throw std::runtime_error(fmtError("Rock compaction",
178 rockCompPoroMult_.size()));
179 }
180 if (!rockCompPoroMultWc_.empty() &&
181 fieldPropValue > static_cast<int>(rockCompPoroMultWc_.size())) {
182 throw std::runtime_error(fmtError("Rock water compaction",
183 rockCompPoroMultWc_.size()));
184 }
185 };
186
187 rockTableIdx_ = this->lookUpData_.template assignFieldPropsIntOnLeaf<short unsigned int>(eclState_.fieldProps(),
188 rock_config.rocknum_property(),
189 true /*needsTranslation*/,
190 valueCheck);
191 }
193 // Store overburden pressure pr element
194 const auto& overburdTables = eclState_.getTableManager().getOverburdTables();
195 if (!overburdTables.empty() && !rock_config.store()) {
196 overburdenPressure_.resize(numElem,0.0);
197 std::size_t numRocktabTables = rock_config.num_rock_tables();
198
199 if (overburdTables.size() != numRocktabTables)
200 throw std::runtime_error(std::to_string(numRocktabTables) +" OVERBURD tables is expected, but " + std::to_string(overburdTables.size()) +" is provided");
201
202 std::vector<Tabulated1DFunction<Scalar>> overburdenTables(numRocktabTables);
203 for (std::size_t regionIdx = 0; regionIdx < numRocktabTables; ++regionIdx) {
204 const OverburdTable& overburdTable = overburdTables.template getTable<OverburdTable>(regionIdx);
205 overburdenTables[regionIdx].setXYContainers(overburdTable.getDepthColumn(),overburdTable.getOverburdenPressureColumn());
206 }
208 for (std::size_t elemIdx = 0; elemIdx < numElem; ++ elemIdx) {
209 unsigned tableIdx = 0;
210 if (!rockTableIdx_.empty()) {
211 tableIdx = rockTableIdx_[elemIdx];
212 }
213 overburdenPressure_[elemIdx] =
214 overburdenTables[tableIdx].eval(cellCenterDepths[elemIdx], /*extrapolation=*/true);
216 }
217 else if (!overburdTables.empty() && rock_config.store()) {
218 OpmLog::warning("ROCKOPTS item 2 set to STORE, OVERBURD ignored!");
219 }
221
222template<class GridView, class FluidSystem>
226 const auto& rock_config = eclState_.getSimulationConfig().rock_config();
227
228 if (!rock_config.active())
229 return; // deck does not enable rock compaction
231 unsigned numElem = gridView_.size(0);
232 switch (rock_config.hysteresis_mode()) {
233 case RockConfig::Hysteresis::REVERS:
234 break;
235 case RockConfig::Hysteresis::IRREVERS:
236 // interpolate the porv volume multiplier using the minimum pressure in the cell
237 // i.e. don't allow re-inflation.
238 minRefPressure_.resize(numElem, 1e99);
239 break;
240 default:
241 throw std::runtime_error("Not support ROCKOMP hysteresis option ");
242 }
243
244 std::size_t numRocktabTables = rock_config.num_rock_tables();
245 bool waterCompaction = rock_config.water_compaction();
246
247 if (!waterCompaction) {
248 const auto& rocktabTables = eclState_.getTableManager().getRocktabTables();
249 if (rocktabTables.size() != numRocktabTables)
250 throw std::runtime_error("ROCKCOMP is activated." + std::to_string(numRocktabTables)
251 +" ROCKTAB tables is expected, but " + std::to_string(rocktabTables.size()) +" is provided");
252
253 rockCompPoroMult_.resize(numRocktabTables);
254 rockCompTransMult_.resize(numRocktabTables);
255 for (std::size_t regionIdx = 0; regionIdx < numRocktabTables; ++regionIdx) {
256 const auto& rocktabTable = rocktabTables.template getTable<RocktabTable>(regionIdx);
257 const auto& pressureColumn = rocktabTable.getPressureColumn();
258 const auto& poroColumn = rocktabTable.getPoreVolumeMultiplierColumn();
259 const auto& transColumn = rocktabTable.getTransmissibilityMultiplierColumn();
260 rockCompPoroMult_[regionIdx].setXYContainers(pressureColumn, poroColumn);
261 rockCompTransMult_[regionIdx].setXYContainers(pressureColumn, transColumn);
262 }
263 } else {
264 const auto& rock2dTables = eclState_.getTableManager().getRock2dTables();
265 const auto& rock2dtrTables = eclState_.getTableManager().getRock2dtrTables();
266 const auto& rockwnodTables = eclState_.getTableManager().getRockwnodTables();
267 maxWaterSaturation_.resize(numElem, 0.0);
268
269 if (rock2dTables.size() != numRocktabTables)
270 throw std::runtime_error("Water compation option is selected in ROCKCOMP." + std::to_string(numRocktabTables)
271 +" ROCK2D tables is expected, but " + std::to_string(rock2dTables.size()) +" is provided");
273 if (rockwnodTables.size() != numRocktabTables)
274 throw std::runtime_error("Water compation option is selected in ROCKCOMP." + std::to_string(numRocktabTables)
275 +" ROCKWNOD tables is expected, but " + std::to_string(rockwnodTables.size()) +" is provided");
276 //TODO check size match
277 rockCompPoroMultWc_.resize(numRocktabTables, TabulatedTwoDFunction(TabulatedTwoDFunction::InterpolationPolicy::Vertical));
278 for (std::size_t regionIdx = 0; regionIdx < numRocktabTables; ++regionIdx) {
279 const RockwnodTable& rockwnodTable = rockwnodTables.template getTable<RockwnodTable>(regionIdx);
280 const auto& rock2dTable = rock2dTables[regionIdx];
281
282 if (rockwnodTable.getSaturationColumn().size() != rock2dTable.sizeMultValues())
283 throw std::runtime_error("Number of entries in ROCKWNOD and ROCK2D needs to match.");
284
285 for (std::size_t xIdx = 0; xIdx < rock2dTable.size(); ++xIdx) {
286 rockCompPoroMultWc_[regionIdx].appendXPos(rock2dTable.getPressureValue(xIdx));
287 for (std::size_t yIdx = 0; yIdx < rockwnodTable.getSaturationColumn().size(); ++yIdx)
288 rockCompPoroMultWc_[regionIdx].appendSamplePoint(xIdx,
289 rockwnodTable.getSaturationColumn()[yIdx],
290 rock2dTable.getPvmultValue(xIdx, yIdx));
292 }
293
294 if (!rock2dtrTables.empty()) {
295 rockCompTransMultWc_.resize(numRocktabTables, TabulatedTwoDFunction(TabulatedTwoDFunction::InterpolationPolicy::Vertical));
296 for (std::size_t regionIdx = 0; regionIdx < numRocktabTables; ++regionIdx) {
297 const RockwnodTable& rockwnodTable = rockwnodTables.template getTable<RockwnodTable>(regionIdx);
298 const auto& rock2dtrTable = rock2dtrTables[regionIdx];
300 if (rockwnodTable.getSaturationColumn().size() != rock2dtrTable.sizeMultValues())
301 throw std::runtime_error("Number of entries in ROCKWNOD and ROCK2DTR needs to match.");
302
303 for (std::size_t xIdx = 0; xIdx < rock2dtrTable.size(); ++xIdx) {
304 rockCompTransMultWc_[regionIdx].appendXPos(rock2dtrTable.getPressureValue(xIdx));
305 for (std::size_t yIdx = 0; yIdx < rockwnodTable.getSaturationColumn().size(); ++yIdx)
306 rockCompTransMultWc_[regionIdx].appendSamplePoint(xIdx,
307 rockwnodTable.getSaturationColumn()[yIdx],
308 rock2dtrTable.getTransMultValue(xIdx, yIdx));
309 }
314
315template<class GridView, class FluidSystem>
318rockCompressibility(unsigned globalSpaceIdx) const
319{
320 if (this->rockParams_.empty())
321 return 0.0;
322
323 unsigned tableIdx = 0;
324 if (!this->rockTableIdx_.empty()) {
325 tableIdx = this->rockTableIdx_[globalSpaceIdx];
326 }
327 return this->rockParams_[tableIdx].compressibility;
328}
329
330template<class GridView, class FluidSystem>
333porosity(unsigned globalSpaceIdx, unsigned timeIdx) const
334{
335 return this->referencePorosity_[timeIdx][globalSpaceIdx];
336}
337
338template<class GridView, class FluidSystem>
341rockFraction(unsigned elementIdx, unsigned timeIdx) const
342{
343 // For the energy equation, we need the volume of the rock.
344 // The volume of the rock is computed by rockFraction * geometric volume of the element.
345 // The reference porosity is defined as porosity * ntg * pore-volume-multiplier.
346 // A common practice in reservoir simulation is to use large pore-volume-multipliers in boundary cells
347 // to model boundary conditions other than no-flow. This may result in reference porosities that are larger than 1.
348 // A simple (1-reference porosity) * geometric volume of the element may give unphysical results.
349 // We therefore instead consider the pore-volume-multiplier as a volume multiplier. The rock fraction is thus given by
350 // (1 - porosity * ntg) * pore-volume-multiplier = (1 - porosity * ntg) * reference porosity / (porosity * ntg)
351 const auto ntg = this->lookUpData_.fieldPropDouble(eclState_.fieldProps(), "NTG", elementIdx);
352 const auto poro_eff = ntg * this->lookUpData_.fieldPropDouble(eclState_.fieldProps(), "PORO", elementIdx);
353 return (1 - poro_eff) * referencePorosity(elementIdx, timeIdx) / poro_eff;
354}
355
356template<class GridView, class FluidSystem>
357template<class T>
359updateNum(const std::string& name, std::vector<T>& numbers, std::size_t num_regions)
360{
361 if (!eclState_.fieldProps().has_int(name))
362 return;
363
364 std::function<void(T, int)> valueCheck = [num_regions,name](T fieldPropValue, [[maybe_unused]] int fieldPropIdx) {
365 if ( fieldPropValue > (int)num_regions) {
366 throw std::runtime_error("Values larger than maximum number of regions "
367 + std::to_string(num_regions) + " provided in " + name);
368 }
369 if ( fieldPropValue <= 0) {
370 throw std::runtime_error("zero or negative values provided for region array: " + name);
371 }
372 };
373
374 numbers = this->lookUpData_.template assignFieldPropsIntOnLeaf<T>(eclState_.fieldProps(), name,
375 true /*needsTranslation*/, valueCheck);
376}
377
378template<class GridView, class FluidSystem>
381{
382 const auto num_regions = eclState_.getTableManager().getTabdims().getNumPVTTables();
383 updateNum("PVTNUM", pvtnum_, num_regions);
384}
385
386template<class GridView, class FluidSystem>
389{
390 const auto num_regions = eclState_.getTableManager().getTabdims().getNumSatTables();
391 updateNum("SATNUM", satnum_, num_regions);
392}
393
394template<class GridView, class FluidSystem>
397{
398 const auto num_regions = 1; // we only support single region
399 updateNum("MISCNUM", miscnum_, num_regions);
400}
401
402template<class GridView, class FluidSystem>
405{
406 const auto num_regions = 1; // we only support single region
407 updateNum("PLMIXNUM", plmixnum_, num_regions);
408}
409
410template<class GridView, class FluidSystem>
412vapparsActive(int episodeIdx) const
413{
414 const auto& oilVaporizationControl = schedule_[episodeIdx].oilvap();
415 return (oilVaporizationControl.getType() == OilVaporizationProperties::OilVaporization::VAPPARS);
416}
417
418template<class GridView, class FluidSystem>
420beginEpisode_(bool enableExperiments,
421 int episodeIdx)
422{
423 if (enableExperiments && gridView_.comm().rank() == 0 && episodeIdx >= 0) {
424 // print some useful information in experimental mode. (the production
425 // simulator does this externally.)
426 std::ostringstream ss;
427 boost::posix_time::time_facet* facet = new boost::posix_time::time_facet("%d-%b-%Y");
428 boost::posix_time::ptime curDateTime =
429 boost::posix_time::from_time_t(schedule_.simTime(episodeIdx));
430 ss.imbue(std::locale(std::locale::classic(), facet));
431 ss << "Report step " << episodeIdx + 1
432 << "/" << schedule_.size() - 1
433 << " at day " << schedule_.seconds(episodeIdx)/(24*3600)
434 << "/" << schedule_.seconds(schedule_.size() - 1)/(24*3600)
435 << ", date = " << curDateTime.date()
436 << "\n ";
437 OpmLog::info(ss.str());
438 }
439
440 const auto& events = schedule_[episodeIdx].events();
441
442 // react to TUNING changes
443 if (episodeIdx > 0 && enableTuning_ && events.hasEvent(ScheduleEvents::TUNING_CHANGE))
444 {
445 const auto& sched_state = schedule_[episodeIdx];
446 const auto& tuning = sched_state.tuning();
447 initialTimeStepSize_ = sched_state.max_next_tstep(enableTuning_);
448 maxTimeStepAfterWellEvent_ = tuning.TMAXWC;
449 return true;
450 }
451
452 return false;
453}
454
455template<class GridView, class FluidSystem>
457beginTimeStep_(bool enableExperiments,
458 int episodeIdx,
459 int timeStepIndex,
460 Scalar startTime,
461 Scalar time,
462 Scalar timeStepSize,
463 Scalar endTime)
464{
465 if (enableExperiments && gridView_.comm().rank() == 0 && episodeIdx >= 0) {
466 std::ostringstream ss;
467 boost::posix_time::time_facet* facet = new boost::posix_time::time_facet("%d-%b-%Y");
468 boost::posix_time::ptime date = boost::posix_time::from_time_t(startTime) + boost::posix_time::milliseconds(static_cast<long long>(time / prefix::milli));
469 ss.imbue(std::locale(std::locale::classic(), facet));
470 ss <<"\nTime step " << timeStepIndex << ", stepsize "
471 << unit::convert::to(timeStepSize, unit::day) << " days,"
472 << " at day " << (double)unit::convert::to(time, unit::day)
473 << "/" << (double)unit::convert::to(endTime, unit::day)
474 << ", date = " << date;
475 OpmLog::info(ss.str());
476 }
477}
478
479template<class GridView, class FluidSystem>
482{
483 FluidSystem::initFromState(eclState_, schedule_);
484}
485
486template<class GridView, class FluidSystem>
489 bool enableSolvent,
490 bool enablePolymer,
491 bool enablePolymerMolarWeight,
492 bool enableBioeffects,
493 bool enableMICP)
494{
495 auto getArray = [](const std::vector<double>& input)
496 {
497 if constexpr (std::is_same_v<Scalar,double>) {
498 return input;
499 } else {
500 return std::vector<Scalar>{input.begin(), input.end()};
501 }
502 };
503
504 if (enableSolvent) {
505 if (eclState_.fieldProps().has_double("SSOL")) {
506 solventSaturation_ = getArray(eclState_.fieldProps().get_double("SSOL"));
507 } else {
508 solventSaturation_.resize(numDof, 0.0);
509 }
510
511 solventRsw_.resize(numDof, 0.0);
512 }
513
514 if (enablePolymer) {
515 if (eclState_.fieldProps().has_double("SPOLY")) {
516 polymer_.concentration = getArray(eclState_.fieldProps().get_double("SPOLY"));
517 } else {
518 polymer_.concentration.resize(numDof, 0.0);
519 }
520 }
521
522 if (enablePolymerMolarWeight) {
523 if (eclState_.fieldProps().has_double("SPOLYMW")) {
524 polymer_.moleWeight = getArray(eclState_.fieldProps().get_double("SPOLYMW"));
525 } else {
526 polymer_.moleWeight.resize(numDof, 0.0);
527 }
528 }
529
530 if (enableBioeffects) {
531 if (eclState_.fieldProps().has_double("SMICR")) {
532 bioeffects_.microbialConcentration = getArray(eclState_.fieldProps().get_double("SMICR"));
533 } else {
534 bioeffects_.microbialConcentration.resize(numDof, 0.0);
535 }
536 if (eclState_.fieldProps().has_double("SBIOF")) {
537 bioeffects_.biofilmVolumeFraction = getArray(eclState_.fieldProps().get_double("SBIOF"));
538 } else {
539 bioeffects_.biofilmVolumeFraction.resize(numDof, 0.0);
540 }
541 if (enableMICP) {
542 if (eclState_.fieldProps().has_double("SOXYG")) {
543 bioeffects_.oxygenConcentration = getArray(eclState_.fieldProps().get_double("SOXYG"));
544 } else {
545 bioeffects_.oxygenConcentration.resize(numDof, 0.0);
546 }
547 if (eclState_.fieldProps().has_double("SUREA")) {
548 bioeffects_.ureaConcentration = getArray(eclState_.fieldProps().get_double("SUREA"));
549 } else {
550 bioeffects_.ureaConcentration.resize(numDof, 0.0);
551 }
552 if (eclState_.fieldProps().has_double("SCALC")) {
553 bioeffects_.calciteVolumeFraction = getArray(eclState_.fieldProps().get_double("SCALC"));
554 } else {
555 bioeffects_.calciteVolumeFraction.resize(numDof, 0.0);
556 }
557 }
558 }
559}
560
561template<class GridView, class FluidSystem>
564maxWaterSaturation(unsigned globalDofIdx) const
565{
566 if (maxWaterSaturation_.empty())
567 return 0.0;
568
569 return maxWaterSaturation_[globalDofIdx];
570}
571
572template<class GridView, class FluidSystem>
575minOilPressure(unsigned globalDofIdx) const
576{
577 if (minRefPressure_.empty())
578 return 0.0;
579
580 return minRefPressure_[globalDofIdx];
581}
582
583template<class GridView, class FluidSystem>
586overburdenPressure(unsigned elementIdx) const
587{
588 if (overburdenPressure_.empty())
589 return 0.0;
590
591 return overburdenPressure_[elementIdx];
592}
593
594template<class GridView, class FluidSystem>
597solventSaturation(unsigned elemIdx) const
598{
599 if (solventSaturation_.empty())
600 return 0;
601
602 return solventSaturation_[elemIdx];
603}
604
605template<class GridView, class FluidSystem>
608solventRsw(unsigned elemIdx) const
609{
610 if (solventRsw_.empty())
611 return 0;
612
613 return solventRsw_[elemIdx];
614}
615
616
617
618template<class GridView, class FluidSystem>
621polymerConcentration(unsigned elemIdx) const
622{
623 if (polymer_.concentration.empty()) {
624 return 0;
625 }
626
627 return polymer_.concentration[elemIdx];
628}
629
630template<class GridView, class FluidSystem>
633polymerMolecularWeight(const unsigned elemIdx) const
634{
635 if (polymer_.moleWeight.empty()) {
636 return 0.0;
637 }
638
639 return polymer_.moleWeight[elemIdx];
640}
641
642template<class GridView, class FluidSystem>
645microbialConcentration(unsigned elemIdx) const
646{
647 if (bioeffects_.microbialConcentration.empty()) {
648 return 0;
649 }
650
651 return bioeffects_.microbialConcentration[elemIdx];
652}
653
654template<class GridView, class FluidSystem>
657oxygenConcentration(unsigned elemIdx) const
658{
659 if (bioeffects_.oxygenConcentration.empty()) {
660 return 0;
661 }
662
663 return bioeffects_.oxygenConcentration[elemIdx];
664}
665
666template<class GridView, class FluidSystem>
669ureaConcentration(unsigned elemIdx) const
670{
671 if (bioeffects_.ureaConcentration.empty()) {
672 return 0;
673 }
674
675 return bioeffects_.ureaConcentration[elemIdx];
676}
677
678template<class GridView, class FluidSystem>
681biofilmVolumeFraction(unsigned elemIdx) const
682{
683 if (bioeffects_.biofilmVolumeFraction.empty()) {
684 return 0;
685 }
686
687 return bioeffects_.biofilmVolumeFraction[elemIdx];
688}
689
690template<class GridView, class FluidSystem>
693calciteVolumeFraction(unsigned elemIdx) const
694{
695 if (bioeffects_.calciteVolumeFraction.empty()) {
696 return 0;
697 }
698
699 return bioeffects_.calciteVolumeFraction[elemIdx];
700}
701
702template<class GridView, class FluidSystem>
704pvtRegionIndex(unsigned elemIdx) const
705{
706 if (pvtnum_.empty())
707 return 0;
708
709 return pvtnum_[elemIdx];
710}
711
712template<class GridView, class FluidSystem>
714satnumRegionIndex(unsigned elemIdx) const
715{
716 if (satnum_.empty())
717 return 0;
718
719 return satnum_[elemIdx];
720}
721
722template<class GridView, class FluidSystem>
724miscnumRegionIndex(unsigned elemIdx) const
725{
726 if (miscnum_.empty())
727 return 0;
728
729 return miscnum_[elemIdx];
730}
731
732template<class GridView, class FluidSystem>
734plmixnumRegionIndex(unsigned elemIdx) const
735{
736 if (plmixnum_.empty())
737 return 0;
738
739 return plmixnum_[elemIdx];
740}
741
742template<class GridView, class FluidSystem>
745maxPolymerAdsorption(unsigned elemIdx) const
746{
747 if (polymer_.maxAdsorption.empty()) {
748 return 0;
749 }
750
751 return polymer_.maxAdsorption[elemIdx];
752}
753
754template<class GridView, class FluidSystem>
756operator==(const FlowGenericProblem& rhs) const
757{
758 return this->maxWaterSaturation_ == rhs.maxWaterSaturation_ &&
759 this->minRefPressure_ == rhs.minRefPressure_ &&
760 this->overburdenPressure_ == rhs.overburdenPressure_ &&
761 this->solventSaturation_ == rhs.solventSaturation_ &&
762 this->solventRsw_ == rhs.solventRsw_ &&
763 this->polymer_ == rhs.polymer_ &&
764 this->bioeffects_ == rhs.bioeffects_;
765}
766
767} // namespace Opm
768
769#endif // OPM_FLOW_GENERIC_PROBLEM_IMPL_HPP
Defines some fundamental parameters for all models.
This problem simulates an input file given in the data format used by the commercial ECLiPSE simulato...
Definition: FlowGenericProblem.hpp:61
UniformXTabulated2DFunction< Scalar > TabulatedTwoDFunction
Definition: FlowGenericProblem.hpp:64
Scalar oxygenConcentration(unsigned elemIdx) const
Returns the initial oxygen concentration for a given a cell index.
Definition: FlowGenericProblem_impl.hpp:657
Scalar microbialConcentration(unsigned elemIdx) const
Returns the initial microbial concentration for a given a cell index.
Definition: FlowGenericProblem_impl.hpp:645
PolymerSolutionContainer< Scalar > polymer_
Definition: FlowGenericProblem.hpp:335
static std::string briefDescription()
Returns a human readable description of the problem for the help message.
Definition: FlowGenericProblem_impl.hpp:130
Scalar initialTimeStepSize_
Definition: FlowGenericProblem.hpp:347
std::vector< Scalar > solventSaturation_
Definition: FlowGenericProblem.hpp:340
bool enableDriftCompensation_
Definition: FlowGenericProblem.hpp:353
static FlowGenericProblem serializationTestObject(const EclipseState &eclState, const Schedule &schedule, const GridView &gridView)
Definition: FlowGenericProblem_impl.hpp:94
Scalar calciteVolumeFraction(unsigned elemIdx) const
Returns the initial calcite volume fraction for a given a cell index.
Definition: FlowGenericProblem_impl.hpp:693
CO2H2SolutionContainer< Scalar > CO2H2_
Definition: FlowGenericProblem.hpp:343
FlowGenericProblem(const EclipseState &eclState, const Schedule &schedule, const GridView &gridView)
Definition: FlowGenericProblem_impl.hpp:60
BioeffectsSolutionContainer< Scalar > bioeffects_
Definition: FlowGenericProblem.hpp:342
bool enableTuning_
Definition: FlowGenericProblem.hpp:346
void readRockParameters_(const std::vector< Scalar > &cellCenterDepths, std::function< std::array< int, 3 >(const unsigned)> ijkIndex)
Definition: FlowGenericProblem_impl.hpp:137
std::vector< Scalar > maxOilSaturation_
Definition: FlowGenericProblem.hpp:336
int numPressurePointsEquil_
Definition: FlowGenericProblem.hpp:351
std::vector< Scalar > maxWaterSaturation_
Definition: FlowGenericProblem.hpp:337
void initFluidSystem_()
Definition: FlowGenericProblem_impl.hpp:481
Scalar maxTimeStepAfterWellEvent_
Definition: FlowGenericProblem.hpp:348
Scalar ureaConcentration(unsigned elemIdx) const
Returns the initial urea concentration for a given a cell index.
Definition: FlowGenericProblem_impl.hpp:669
std::vector< Scalar > minRefPressure_
Definition: FlowGenericProblem.hpp:338
Scalar biofilmVolumeFraction(unsigned elemIdx) const
Returns the initial biofilm volume fraction for a given a cell index.
Definition: FlowGenericProblem_impl.hpp:681
std::vector< Scalar > solventRsw_
Definition: FlowGenericProblem.hpp:341
static std::string helpPreamble(int, const char **argv)
Returns the string that is printed before the list of command line parameters in the help message.
Definition: FlowGenericProblem_impl.hpp:115
std::vector< Scalar > overburdenPressure_
Definition: FlowGenericProblem.hpp:339
bool explicitRockCompaction_
Definition: FlowGenericProblem.hpp:354
typename FluidSystem::Scalar Scalar
Definition: FlowGenericProblem.hpp:63
Declare the properties used by the infrastructure code of the finite volume discretizations.
auto Get(bool errorIfNotRegistered=true)
Retrieve a runtime parameter.
Definition: parametersystem.hpp:187
Definition: blackoilbioeffectsmodules.hh:43
bool operator==(const aligned_allocator< T1, Alignment > &, const aligned_allocator< T2, Alignment > &) noexcept
Definition: alignedallocator.hh:200
std::string to_string(const ConvergenceReport::ReservoirFailure::Type t)
This file provides the infrastructure to retrieve run-time parameters.
static BioeffectsSolutionContainer serializationTestObject()
static CO2H2SolutionContainer serializationTestObject()
Definition: EclTimeSteppingParams.hpp:45
static PolymerSolutionContainer serializationTestObject()