Merge pull request #4580 from GitPaean/fixing_co2store_water_gas

fixing running with CO2Store + water + gas + AquiferCarterTracy
This commit is contained in:
Tor Harald Sandve 2023-04-11 15:11:36 +02:00 committed by GitHub
commit 5309ba22f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,8 +223,17 @@ protected:
if (this->aquct_data_.initial_temperature.has_value())
temp = this->aquct_data_.initial_temperature.value();
Scalar rs = 0.0; // no dissolved CO2
Scalar waterViscosity = FluidSystem::oilPvt().viscosity(pvtRegionIdx(), temp, press, rs);
Scalar waterViscosity = 0.;
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
Scalar rs = 0.0; // no dissolved CO2
waterViscosity = FluidSystem::oilPvt().viscosity(pvtRegionIdx(), temp, press, rs);
} else if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
Scalar salt = 0.;
Scalar rsw = 0.;
waterViscosity = FluidSystem::waterPvt().viscosity(pvtRegionIdx(), temp, press, rsw, salt);
} else {
OPM_THROW(std::runtime_error, "water or oil phase is needed to run CO2Store.");
}
const auto x = this->aquct_data_.porosity * this->aquct_data_.total_compr * this->aquct_data_.inner_radius * this->aquct_data_.inner_radius;
this->Tc_ = waterViscosity * x / this->aquct_data_.permeability;
} else {
@ -254,16 +263,26 @@ protected:
this->Ta0_ = this->aquct_data_.initial_temperature.value();
if(this->co2store_()) {
const auto press = this->aquct_data_.initial_pressure.value();
const auto press = this->aquct_data_.initial_pressure.value();
Scalar temp = FluidSystem::reservoirTemperature();
if (this->aquct_data_.initial_temperature.has_value())
temp = this->aquct_data_.initial_temperature.value();
Scalar temp = FluidSystem::reservoirTemperature();
if (this->aquct_data_.initial_temperature.has_value())
temp = this->aquct_data_.initial_temperature.value();
Scalar rs = 0.0; // no dissolved CO2
Scalar waterDensity = FluidSystem::oilPvt().inverseFormationVolumeFactor(pvtRegionIdx(), temp, press, rs)
* FluidSystem::oilPvt().oilReferenceDensity(pvtRegionIdx());
this->rhow_ = waterDensity;
Scalar waterDensity = 0.;
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx)) {
Scalar rs = 0.0; // no dissolved CO2
waterDensity = FluidSystem::oilPvt().inverseFormationVolumeFactor(pvtRegionIdx(), temp, press, rs)
* FluidSystem::oilPvt().oilReferenceDensity(pvtRegionIdx());
} else if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
Scalar salinity = 0.;
Scalar rsw = 0.;
waterDensity = FluidSystem::waterPvt().inverseFormationVolumeFactor(pvtRegionIdx(), temp, press, rsw, salinity)
* FluidSystem::waterPvt().waterReferenceDensity(pvtRegionIdx());
} else {
OPM_THROW(std::runtime_error, "water or oil phase is needed to run CO2Store.");
}
this->rhow_ = waterDensity;
} else {
this->rhow_ = this->aquct_data_.waterDensity();
}