mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: put handling of filtration particle volume in separate class
This commit is contained in:
parent
a560b06dce
commit
1e7ca08702
@ -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
|
||||
|
@ -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) {
|
||||
|
61
opm/simulators/wells/WellFilterCake.cpp
Normal file
61
opm/simulators/wells/WellFilterCake.cpp
Normal 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
|
45
opm/simulators/wells/WellFilterCake.hpp
Normal file
45
opm/simulators/wells/WellFilterCake.hpp
Normal 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
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user