Enable aquifers in H2STORE oil/gas version

This commit is contained in:
Svenn Tveit 2023-08-08 10:51:20 +02:00
parent d6f2f1e3ff
commit 8b6a504874
6 changed files with 15 additions and 15 deletions

View File

@ -715,7 +715,7 @@ private:
void applyNumericalAquifers_(const GridView& gridView,
const NumericalAquifers& aquifer,
const bool co2store);
const bool co2store_or_h2store);
template<class RMap>
void setRegionPvtIdx(const EclipseState& eclState, const RMap& reg);

View File

@ -1507,7 +1507,7 @@ InitialStateComputer(MaterialLawManager& materialLawManager,
calcPressSatRsRv(eqlmap, rec, materialLawManager, comm, grav);
// modify the pressure and saturation for numerical aquifer cells
applyNumericalAquifers_(gridView, num_aquifers, eclipseState.runspec().co2Storage());
applyNumericalAquifers_(gridView, num_aquifers, eclipseState.runspec().co2Storage() || eclipseState.runspec().h2Storage());
// Modify oil pressure in no-oil regions so that the pressures of present phases can
// be recovered from the oil pressure and capillary relations.
@ -1654,7 +1654,7 @@ void InitialStateComputer<FluidSystem,
CartesianIndexMapper>::
applyNumericalAquifers_(const GridView& gridView,
const NumericalAquifers& aquifer,
const bool co2store)
const bool co2store_or_h2store)
{
const auto num_aqu_cells = aquifer.allAquiferCells();
if (num_aqu_cells.empty()) return;
@ -1669,9 +1669,9 @@ applyNumericalAquifers_(const GridView& gridView,
const auto search = num_aqu_cells.find(cartIx);
if (search != num_aqu_cells.end()) {
// numerical aquifer cells are filled with water initially
// for co2store the oilphase may be used for the brine
bool co2store_oil_as_brine = co2store && FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx);
const auto watPos = co2store_oil_as_brine? FluidSystem::oilPhaseIdx : FluidSystem::waterPhaseIdx;
// for co2store and h2store the oil phase may be used for the brine
bool oil_as_brine = co2store_or_h2store && FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx);
const auto watPos = oil_as_brine? FluidSystem::oilPhaseIdx : FluidSystem::waterPhaseIdx;
if (FluidSystem::phaseIsActive(watPos)) {
this->sat_[watPos][elemIdx] = 1.;
} else {
@ -1679,7 +1679,7 @@ applyNumericalAquifers_(const GridView& gridView,
}
const auto oilPos = FluidSystem::oilPhaseIdx;
if (!co2store && FluidSystem::phaseIsActive(oilPos)) {
if (!co2store_or_h2store && FluidSystem::phaseIsActive(oilPos)) {
this->sat_[oilPos][elemIdx] = 0.;
}

View File

@ -246,7 +246,7 @@ protected:
int compIdx_() const
{
if (this->co2store_())
if (this->co2store_or_h2store_())
return FluidSystem::oilCompIdx;
return FluidSystem::waterCompIdx;

View File

@ -104,7 +104,7 @@ public:
aquCT->dimensionless_pressure = this->dimensionless_pressure_;
aquCT->influxConstant = this->aquct_data_.influxConstant();
if (!this->co2store_()) {
if (!this->co2store_or_h2store_()) {
aquCT->timeConstant = this->aquct_data_.timeConstant();
aquCT->waterDensity = this->aquct_data_.waterDensity();
aquCT->waterViscosity = this->aquct_data_.waterViscosity();
@ -217,7 +217,7 @@ protected:
void calculateAquiferConstants() override
{
this->Tc_ = this->co2store_()
this->Tc_ = this->co2store_or_h2store_()
? this->timeConstantCO2Store()
: this->aquct_data_.timeConstant();
@ -245,7 +245,7 @@ protected:
this->Ta0_ = this->aquct_data_.initial_temperature.value();
}
this->rhow_ = this->co2store_()
this->rhow_ = this->co2store_or_h2store_()
? this->waterDensityCO2Store()
: this->aquct_data_.waterDensity();
}

View File

@ -214,7 +214,7 @@ private:
// TODO: this is a function from AquiferAnalytical
int compIdx_() const
{
if (this->co2store_())
if (this->co2store_or_h2store_())
return FluidSystem::oilCompIdx;
return FluidSystem::waterCompIdx;

View File

@ -78,15 +78,15 @@ public:
int aquiferID() const { return this->aquiferID_; }
protected:
bool co2store_() const
bool co2store_or_h2store_() const
{
return ebos_simulator_.vanguard().eclState().runspec().co2Storage();
return ebos_simulator_.vanguard().eclState().runspec().co2Storage() || ebos_simulator_.vanguard().eclState().runspec().h2Storage();
}
int phaseIdx_() const
{
// If OIL is used to model brine the aquifer should do the same
if (co2store_() && FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx))
if (co2store_or_h2store_() && FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx))
return FluidSystem::oilPhaseIdx;
return FluidSystem::waterPhaseIdx;