changed: put handling of filtration particle volume in separate class

This commit is contained in:
Arne Morten Kvarving 2023-07-07 10:51:06 +02:00
parent a560b06dce
commit 1e7ca08702
6 changed files with 115 additions and 37 deletions

View File

@ -125,6 +125,7 @@ list (APPEND MAIN_SOURCE_FILES
opm/simulators/wells/WellConnectionAuxiliaryModule.cpp
opm/simulators/wells/WellConstraints.cpp
opm/simulators/wells/WellConvergence.cpp
opm/simulators/wells/WellFilterCake.cpp
opm/simulators/wells/WellGroupConstraints.cpp
opm/simulators/wells/WellGroupControls.cpp
opm/simulators/wells/WellGroupHelpers.cpp
@ -507,6 +508,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/wells/WellConnectionAuxiliaryModule.hpp
opm/simulators/wells/WellConstraints.hpp
opm/simulators/wells/WellConvergence.hpp
opm/simulators/wells/WellFilterCake.hpp
opm/simulators/wells/WellGroupConstraints.hpp
opm/simulators/wells/WellGroupControls.hpp
opm/simulators/wells/WellGroupHelpers.hpp

View File

@ -50,6 +50,7 @@
#include <opm/simulators/wells/BlackoilWellModelRestart.hpp>
#include <opm/simulators/wells/GasLiftStage2.hpp>
#include <opm/simulators/wells/VFPProperties.hpp>
#include <opm/simulators/wells/WellFilterCake.hpp>
#include <opm/simulators/wells/WellGroupHelpers.hpp>
#include <opm/simulators/wells/WellInterfaceGeneric.hpp>
#include <opm/simulators/wells/WellState.hpp>
@ -1422,7 +1423,9 @@ void BlackoilWellModelGeneric::initInjMult() {
}
void BlackoilWellModelGeneric::updateFiltrationParticleVolume(const double dt, const size_t water_index) {
void BlackoilWellModelGeneric::updateFiltrationParticleVolume(const double dt,
const size_t water_index)
{
for (auto& well : this->well_container_generic_) {
if (well->isInjector() && well->wellEcl().getFilterConc() > 0.) {
auto &values = this->filtration_particle_volume_[well->name()];
@ -1430,10 +1433,11 @@ void BlackoilWellModelGeneric::updateFiltrationParticleVolume(const double dt, c
if (values.empty()) {
values.assign(ws.perf_data.size(), 0.); // initializing to be zero
}
well->updateFiltrationParticleVolume(dt, water_index, this->wellState(), values);
WellFilterCake::
updateFiltrationParticleVolume(*well, dt, water_index,
this->wellState(), values);
}
}
}
void BlackoilWellModelGeneric::updateInjMult(DeferredLogger& deferred_logger) {

View File

@ -0,0 +1,61 @@
/*
Copyright 2023 Equinor
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <opm/simulators/wells/WellFilterCake.hpp>
#include <opm/simulators/wells/WellInterfaceGeneric.hpp>
#include <opm/simulators/wells/WellState.hpp>
namespace Opm {
void WellFilterCake::
updateFiltrationParticleVolume(const WellInterfaceGeneric& well,
const double dt,
const std::size_t water_index,
const WellState& well_state,
std::vector<double>& filtration_particle_volume)
{
if (!well.isInjector()) {
return;
}
const auto injectorType = well.wellEcl().injectorType();
if (injectorType != InjectorType::WATER) {
return;
}
const double conc = well.wellEcl().getFilterConc();
if (conc == 0.) {
return;
}
// it is currently used for the filter cake modeling related to formation damage study
auto& ws = well_state.well(well.indexOfWell());
const auto& connection_rates = ws.perf_data.phase_rates;
const std::size_t np = well_state.numPhases();
for (int perf = 0; perf < well.numPerfs(); ++perf) {
// not considering the production water
const double water_rates = std::max(0., connection_rates[perf * np + water_index]);
filtration_particle_volume[perf] += water_rates * conc * dt;
}
}
} // namespace Opm

View File

@ -0,0 +1,45 @@
/*
Copyright 2023 Equinor
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_WELL_FILTER_CAKE_HEADER_INCLUDED
#define OPM_WELL_FILTER_CAKE_HEADER_INCLUDED
#include <cstddef>
#include <vector>
namespace Opm {
class WellInterfaceGeneric;
class WellState;
//! \brief Class for well calculations related to filter cakes.
class WellFilterCake {
public:
//! \brief Update the water injection volume.
//! \details Used for calculation related to cake filtration due to injection activity.
static void updateFiltrationParticleVolume(const WellInterfaceGeneric& well,
const double dt,
const std::size_t water_index,
const WellState& well_state,
std::vector<double>& filtration_particle_volume);
};
}
#endif // OPM_WELL_FILTER_CAKE_HEADER_INCLUDED

View File

@ -718,36 +718,6 @@ checkNegativeWellPotentials(std::vector<double>& well_potentials,
}
}
void WellInterfaceGeneric::
updateFiltrationParticleVolume(const double dt, const size_t water_index,
const WellState& well_state, std::vector<double>& filtration_particle_volume) const
{
if (!this->isInjector()) {
return;
}
const auto injectorType = this->well_ecl_.injectorType();
if (injectorType != InjectorType::WATER) {
return;
}
const double conc = this->well_ecl_.getFilterConc();
if (conc == 0.) {
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;
const std::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]);
filtration_particle_volume[perf] += water_rates * conc * dt;
}
}
void WellInterfaceGeneric::
updateInjFCMult(const std::vector<double>& filtration_particle_volume, DeferredLogger& deferred_logger) {
for (int perf = 0; perf < this->number_of_perforations_; ++perf) {

View File

@ -188,10 +188,6 @@ public:
// it might change in the future
double getInjMult(const int perf, const double bhp, const double perf_pres) const;
// update the water injection volume, it will be used for calculation related to cake filtration due to injection activity
void updateFiltrationParticleVolume(const double dt, const size_t water_index,
const WellState& well_state, std::vector<double>& filtration_particle_volume) const;
// update the multiplier for well transmissbility due to cake filteration
void updateInjFCMult(const std::vector<double>& filtration_particle_volume, DeferredLogger& deferred_logger);