Merge pull request #3532 from totto82/aqnumco2store

combine co2store and numerical aquifers
This commit is contained in:
Bård Skaflestad 2021-09-22 21:42:29 +02:00 committed by GitHub
commit 512f4c95b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1716,7 +1716,7 @@ public:
calcPressSatRsRv(eqlmap, rec, materialLawManager, comm, grav); calcPressSatRsRv(eqlmap, rec, materialLawManager, comm, grav);
// modify the pressure and saturation for numerical aquifer cells // modify the pressure and saturation for numerical aquifer cells
applyNumericalAquifers_(gridView, num_aquifers); applyNumericalAquifers_(gridView, num_aquifers, eclipseState.runspec().co2Storage());
// Modify oil pressure in no-oil regions so that the pressures of present phases can // Modify oil pressure in no-oil regions so that the pressures of present phases can
// be recovered from the oil pressure and capillary relations. // be recovered from the oil pressure and capillary relations.
@ -1815,7 +1815,8 @@ private:
} }
void applyNumericalAquifers_(const GridView& gridView, void applyNumericalAquifers_(const GridView& gridView,
const NumericalAquifers& aquifer) const NumericalAquifers& aquifer,
const bool co2store)
{ {
const auto num_aqu_cells = aquifer.allAquiferCells(); const auto num_aqu_cells = aquifer.allAquiferCells();
if (num_aqu_cells.empty()) return; if (num_aqu_cells.empty()) return;
@ -1830,7 +1831,8 @@ private:
const auto search = num_aqu_cells.find(cartIx); const auto search = num_aqu_cells.find(cartIx);
if (search != num_aqu_cells.end()) { if (search != num_aqu_cells.end()) {
// numerical aquifer cells are filled with water initially // numerical aquifer cells are filled with water initially
const auto watPos = FluidSystem::waterPhaseIdx; // for co2store the oilphase is used for brine
const auto watPos = co2store? FluidSystem::oilPhaseIdx : FluidSystem::waterPhaseIdx;
if (FluidSystem::phaseIsActive(watPos)) { if (FluidSystem::phaseIsActive(watPos)) {
this->sat_[watPos][elemIdx] = 1.; this->sat_[watPos][elemIdx] = 1.;
} else { } else {
@ -1838,7 +1840,7 @@ private:
} }
const auto oilPos = FluidSystem::oilPhaseIdx; const auto oilPos = FluidSystem::oilPhaseIdx;
if (FluidSystem::phaseIsActive(oilPos)) { if (!co2store && FluidSystem::phaseIsActive(oilPos)) {
this->sat_[oilPos][elemIdx] = 0.; this->sat_[oilPos][elemIdx] = 0.;
} }