calculating the accumulative water injection volume

for each connection
This commit is contained in:
Kai Bao
2022-12-14 14:56:24 +01:00
parent ac9c5fb13c
commit 49774186ab
5 changed files with 39 additions and 0 deletions

View File

@@ -472,6 +472,10 @@ namespace Opm {
if (getPropValue<TypeTag, Properties::EnablePolymerMW>() && well->isInjector()) {
well->updateWaterThroughput(dt, this->wellState());
}
if (well->isInjector()) {
well->updateWaterInjectionVolume(dt, this->wellState());
}
}
// at the end of the time step, updating the inj_multiplier saved in WellState for later use

View File

@@ -46,6 +46,7 @@ PerfData::PerfData(std::size_t num_perf, double pressure_first_connection_, bool
this->water_throughput.resize(num_perf);
this->skin_pressure.resize(num_perf);
this->water_velocity.resize(num_perf);
this->water_injection_volume.resize(num_perf);
}
}
@@ -97,6 +98,7 @@ bool PerfData::try_assign(const PerfData& other) {
this->water_throughput = other.water_throughput;
this->skin_pressure = other.skin_pressure;
this->water_velocity = other.water_velocity;
this->water_injection_volume = other.water_injection_volume;
this->prod_index = other.prod_index;
this->micp_rates = other.micp_rates;
return true;

View File

@@ -84,6 +84,12 @@ public:
std::vector<double> water_throughput;
std::vector<double> skin_pressure;
std::vector<double> water_velocity;
// This is the accumulated water injection volume
// At the moment, it will be used for the filtration cake modeling
// TODO: it might be problematic to handle the well open and shut, connection open and shut
// TODO: let us handle the most straightforward scenarios for now
std::vector<double> water_injection_volume;
};
} // namespace Opm

View File

@@ -303,6 +303,8 @@ public:
// update perforation water throughput based on solved water rate
virtual void updateWaterThroughput(const double dt, WellState& well_state) const = 0;
void updateWaterInjectionVolume(const double dt, WellState& well_state) const;
/// Compute well rates based on current reservoir conditions and well variables.
/// Used in updateWellStateRates().
virtual std::vector<double> computeCurrentWellRates(const Simulator& ebosSimulator,

View File

@@ -1370,4 +1370,29 @@ namespace Opm
connII[phase_pos] = connIICalc(mt * fs.invB(this->flowPhaseToEbosPhaseIdx(phase_pos)).value());
}
template<typename TypeTag>
void WellInterface<TypeTag>::updateWaterInjectionVolume(const double dt, WellState& well_state) const
{
if (!FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
return;
}
// it is currently used for the filter cake modeling related to formation damage study
auto& ws = well_state.well(this->index_of_well_);
const auto& connection_rates = ws.perf_data.phase_rates;
// per connection
auto& water_injection_volume = ws.perf_data.water_injection_volume;
// which is the index for water
// and also, we should check whether the phase is active
const size_t water_index = FluidSystem::waterPhaseIdx;
const size_t np = well_state.numPhases();
for (int perf = 0; perf < this->number_of_perforations_; ++perf) {
// not considering the production water
const double water_rates = std::max(0., connection_rates[perf * np + water_index]);
water_injection_volume[perf] += water_rates * dt;
std::cout << " well " << this->name() << " perf " << perf << " injection volume " << water_injection_volume[perf] << std::endl;
}
}
} // namespace Opm