2020-11-13 08:08:45 -06:00
|
|
|
/*
|
|
|
|
Copyright (C) 2020 Equinor ASA
|
|
|
|
Copyright (C) 2020 SINTEF Digital
|
|
|
|
|
|
|
|
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_AQUIFERNUMERICAL_HEADER_INCLUDED
|
|
|
|
#define OPM_AQUIFERNUMERICAL_HEADER_INCLUDED
|
|
|
|
|
2024-07-01 04:20:57 -05:00
|
|
|
#include <dune/grid/common/partitionset.hh>
|
|
|
|
|
2021-12-14 01:30:15 -06:00
|
|
|
#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp>
|
2020-11-13 08:08:45 -06:00
|
|
|
|
2023-02-02 03:27:48 -06:00
|
|
|
#include <opm/material/common/MathToolbox.hpp>
|
|
|
|
#include <opm/material/densead/Evaluation.hpp>
|
|
|
|
|
|
|
|
#include <opm/output/data/Aquifer.hpp>
|
|
|
|
|
2022-08-11 02:54:15 -05:00
|
|
|
#include <opm/simulators/aquifers/AquiferInterface.hpp>
|
2021-09-20 04:12:27 -05:00
|
|
|
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
|
|
|
|
|
2021-06-22 09:09:39 -05:00
|
|
|
#include <algorithm>
|
|
|
|
#include <cassert>
|
|
|
|
#include <cstddef>
|
|
|
|
#include <vector>
|
2021-06-01 16:20:28 -05:00
|
|
|
|
2020-11-13 08:08:45 -06:00
|
|
|
namespace Opm
|
|
|
|
{
|
|
|
|
template <typename TypeTag>
|
2022-08-11 02:54:15 -05:00
|
|
|
class AquiferNumerical : public AquiferInterface<TypeTag>
|
2020-11-13 08:08:45 -06:00
|
|
|
{
|
|
|
|
public:
|
2022-08-11 02:54:15 -05:00
|
|
|
using BlackoilIndices = GetPropType<TypeTag, Properties::Indices>;
|
2020-11-16 17:18:16 -06:00
|
|
|
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
|
2022-08-11 02:54:15 -05:00
|
|
|
using ExtensiveQuantities = GetPropType<TypeTag, Properties::ExtensiveQuantities>;
|
2020-11-16 17:18:16 -06:00
|
|
|
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
|
|
|
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
2022-08-11 02:54:15 -05:00
|
|
|
using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>;
|
2020-11-16 17:18:16 -06:00
|
|
|
using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>;
|
2022-08-11 02:54:15 -05:00
|
|
|
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
2024-02-21 01:20:25 -06:00
|
|
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
2020-11-16 17:18:16 -06:00
|
|
|
|
|
|
|
enum { dimWorld = GridView::dimensionworld };
|
2022-06-10 15:58:32 -05:00
|
|
|
enum { numPhases = FluidSystem::numPhases };
|
2022-08-10 07:27:34 -05:00
|
|
|
static constexpr int numEq = BlackoilIndices::numEq;
|
2020-11-16 17:18:16 -06:00
|
|
|
|
2024-02-21 01:20:25 -06:00
|
|
|
using Eval = DenseAd::Evaluation<Scalar, numEq>;
|
2021-05-05 04:22:44 -05:00
|
|
|
using Toolbox = MathToolbox<Eval>;
|
2020-11-16 17:18:16 -06:00
|
|
|
|
2022-08-11 02:54:15 -05:00
|
|
|
using typename AquiferInterface<TypeTag>::RateVector;
|
|
|
|
|
2020-11-13 08:08:45 -06:00
|
|
|
// Constructor
|
2020-11-16 17:18:16 -06:00
|
|
|
AquiferNumerical(const SingleNumericalAquifer& aquifer,
|
2024-02-06 04:55:07 -06:00
|
|
|
const Simulator& simulator)
|
|
|
|
: AquiferInterface<TypeTag>(aquifer.id(), simulator)
|
2021-06-22 09:09:39 -05:00
|
|
|
, flux_rate_ (0.0)
|
|
|
|
, cumulative_flux_(0.0)
|
|
|
|
, init_pressure_ (aquifer.numCells(), 0.0)
|
2020-11-13 08:08:45 -06:00
|
|
|
{
|
2024-02-06 04:55:07 -06:00
|
|
|
this->cell_to_aquifer_cell_idx_.resize(this->simulator_.gridView().size(/*codim=*/0), -1);
|
2020-11-16 17:18:16 -06:00
|
|
|
|
2021-06-22 09:09:39 -05:00
|
|
|
auto aquifer_on_process = false;
|
|
|
|
for (std::size_t idx = 0; idx < aquifer.numCells(); ++idx) {
|
2021-06-01 16:20:28 -05:00
|
|
|
const auto* cell = aquifer.getCellPrt(idx);
|
|
|
|
|
2021-02-04 07:57:55 -06:00
|
|
|
// Due to parallelisation, the cell might not exist in the current process
|
2024-02-06 04:55:07 -06:00
|
|
|
const int compressed_idx = simulator.vanguard().compressedIndexForInterior(cell->global_index);
|
2022-08-18 07:59:17 -05:00
|
|
|
if (compressed_idx >= 0) {
|
|
|
|
this->cell_to_aquifer_cell_idx_[compressed_idx] = idx;
|
2021-06-22 09:09:39 -05:00
|
|
|
aquifer_on_process = true;
|
2021-02-04 07:57:55 -06:00
|
|
|
}
|
2020-11-16 17:18:16 -06:00
|
|
|
}
|
2021-06-22 09:09:39 -05:00
|
|
|
|
|
|
|
if (aquifer_on_process) {
|
|
|
|
this->checkConnectsToReservoir();
|
|
|
|
}
|
2020-11-13 08:08:45 -06:00
|
|
|
}
|
|
|
|
|
2024-02-06 04:55:07 -06:00
|
|
|
static AquiferNumerical serializationTestObject(const Simulator& simulator)
|
2023-02-02 03:27:48 -06:00
|
|
|
{
|
2024-02-06 04:55:07 -06:00
|
|
|
AquiferNumerical result({}, simulator);
|
2023-02-02 03:27:48 -06:00
|
|
|
result.flux_rate_ = 1.0;
|
|
|
|
result.cumulative_flux_ = 2.0;
|
|
|
|
result.init_pressure_ = {3.0, 4.0};
|
|
|
|
result.pressure_ = 5.0;
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2022-08-11 02:54:15 -05:00
|
|
|
void initFromRestart(const data::Aquifers& aquiferSoln) override
|
2020-11-13 08:08:45 -06:00
|
|
|
{
|
2021-06-22 09:09:39 -05:00
|
|
|
auto xaqPos = aquiferSoln.find(this->aquiferID());
|
|
|
|
if (xaqPos == aquiferSoln.end())
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (this->connects_to_reservoir_) {
|
|
|
|
this->cumulative_flux_ = xaqPos->second.volume;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (const auto* aqData = xaqPos->second.typeData.template get<data::AquiferType::Numerical>();
|
|
|
|
aqData != nullptr)
|
|
|
|
{
|
2024-02-21 01:20:25 -06:00
|
|
|
this->init_pressure_.resize(aqData->initPressure.size());
|
|
|
|
std::copy(aqData->initPressure.begin(),
|
|
|
|
aqData->initPressure.end(),
|
|
|
|
this->init_pressure_.begin());
|
2021-06-22 09:09:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
this->solution_set_from_restart_ = true;
|
2020-11-13 08:08:45 -06:00
|
|
|
}
|
|
|
|
|
2022-08-11 02:54:15 -05:00
|
|
|
void beginTimeStep() override {}
|
|
|
|
void addToSource(RateVector&, const unsigned, const unsigned) override {}
|
|
|
|
|
|
|
|
void endTimeStep() override
|
2020-11-13 08:08:45 -06:00
|
|
|
{
|
2020-11-16 17:18:16 -06:00
|
|
|
this->pressure_ = this->calculateAquiferPressure();
|
|
|
|
this->flux_rate_ = this->calculateAquiferFluxRate();
|
2024-02-06 04:55:07 -06:00
|
|
|
this->cumulative_flux_ += this->flux_rate_ * this->simulator_.timeStepSize();
|
2020-11-13 08:08:45 -06:00
|
|
|
}
|
|
|
|
|
2022-08-11 02:54:15 -05:00
|
|
|
data::AquiferData aquiferData() const override
|
2020-11-13 08:08:45 -06:00
|
|
|
{
|
|
|
|
data::AquiferData data;
|
2021-06-01 16:20:28 -05:00
|
|
|
data.aquiferID = this->aquiferID();
|
2020-11-13 08:08:45 -06:00
|
|
|
data.pressure = this->pressure_;
|
2020-11-16 17:18:16 -06:00
|
|
|
data.fluxRate = this->flux_rate_;
|
2020-11-13 08:08:45 -06:00
|
|
|
data.volume = this->cumulative_flux_;
|
2021-06-01 16:20:28 -05:00
|
|
|
|
|
|
|
auto* aquNum = data.typeData.template create<data::AquiferType::Numerical>();
|
2024-02-21 01:20:25 -06:00
|
|
|
aquNum->initPressure.resize(this->init_pressure_.size());
|
|
|
|
std::copy(this->init_pressure_.begin(),
|
|
|
|
this->init_pressure_.end(),
|
|
|
|
aquNum->initPressure.begin());
|
2021-06-01 16:20:28 -05:00
|
|
|
|
2020-11-13 08:08:45 -06:00
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
2022-08-11 02:54:15 -05:00
|
|
|
void initialSolutionApplied() override
|
2020-11-16 17:18:16 -06:00
|
|
|
{
|
2021-06-22 09:09:39 -05:00
|
|
|
if (this->solution_set_from_restart_) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-06-01 16:20:28 -05:00
|
|
|
this->pressure_ = this->calculateAquiferPressure(this->init_pressure_);
|
2020-11-16 17:18:16 -06:00
|
|
|
this->flux_rate_ = 0.;
|
|
|
|
this->cumulative_flux_ = 0.;
|
|
|
|
}
|
|
|
|
|
2024-02-21 01:20:25 -06:00
|
|
|
void computeFaceAreaFraction(const std::vector<Scalar>& /*total_face_area*/) override
|
2023-03-31 04:47:58 -05:00
|
|
|
{}
|
|
|
|
|
2024-02-21 01:20:25 -06:00
|
|
|
Scalar totalFaceArea() const override
|
2023-03-31 04:47:58 -05:00
|
|
|
{
|
|
|
|
return 1.0;
|
|
|
|
}
|
|
|
|
|
2023-02-02 03:27:48 -06:00
|
|
|
template<class Serializer>
|
|
|
|
void serializeOp(Serializer& serializer)
|
|
|
|
{
|
|
|
|
serializer(flux_rate_);
|
|
|
|
serializer(cumulative_flux_);
|
|
|
|
serializer(init_pressure_);
|
|
|
|
serializer(pressure_);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool operator==(const AquiferNumerical& rhs) const
|
|
|
|
{
|
|
|
|
return this->flux_rate_ == rhs.flux_rate_ &&
|
|
|
|
this->cumulative_flux_ == rhs.cumulative_flux_ &&
|
|
|
|
this->init_pressure_ == rhs.init_pressure_ &&
|
|
|
|
this->pressure_ == rhs.pressure_;
|
|
|
|
}
|
|
|
|
|
2024-02-21 01:20:25 -06:00
|
|
|
Scalar cumulativeFlux() const
|
2023-02-09 15:12:40 -06:00
|
|
|
{
|
|
|
|
return this->cumulative_flux_;
|
|
|
|
}
|
|
|
|
|
2020-11-13 08:08:45 -06:00
|
|
|
private:
|
2021-06-22 09:09:39 -05:00
|
|
|
void checkConnectsToReservoir()
|
|
|
|
{
|
2024-02-06 04:55:07 -06:00
|
|
|
ElementContext elem_ctx(this->simulator_);
|
|
|
|
auto elemIt = std::find_if(this->simulator_.gridView().template begin</*codim=*/0>(),
|
|
|
|
this->simulator_.gridView().template end</*codim=*/0>(),
|
2021-06-22 09:09:39 -05:00
|
|
|
[&elem_ctx, this](const auto& elem) -> bool
|
|
|
|
{
|
|
|
|
elem_ctx.updateStencil(elem);
|
|
|
|
|
|
|
|
const auto cell_index = elem_ctx
|
|
|
|
.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
|
|
|
|
|
|
|
return this->cell_to_aquifer_cell_idx_[cell_index] == 0;
|
|
|
|
});
|
|
|
|
|
2024-02-06 04:55:07 -06:00
|
|
|
assert ((elemIt != this->simulator_.gridView().template end</*codim=*/0>())
|
2021-06-22 09:09:39 -05:00
|
|
|
&& "Internal error locating numerical aquifer's connecting cell");
|
|
|
|
|
|
|
|
this->connects_to_reservoir_ =
|
|
|
|
elemIt->partitionType() == Dune::InteriorEntity;
|
|
|
|
}
|
|
|
|
|
2024-02-21 01:20:25 -06:00
|
|
|
Scalar calculateAquiferPressure() const
|
2021-06-01 16:20:28 -05:00
|
|
|
{
|
2024-02-21 01:20:25 -06:00
|
|
|
auto capture = std::vector<Scalar>(this->init_pressure_.size(), 0.0);
|
2021-06-01 16:20:28 -05:00
|
|
|
return this->calculateAquiferPressure(capture);
|
|
|
|
}
|
|
|
|
|
2024-02-21 01:20:25 -06:00
|
|
|
Scalar calculateAquiferPressure(std::vector<Scalar>& cell_pressure) const
|
2020-11-16 17:18:16 -06:00
|
|
|
{
|
2024-02-21 01:20:25 -06:00
|
|
|
Scalar sum_pressure_watervolume = 0.;
|
|
|
|
Scalar sum_watervolume = 0.;
|
2020-11-16 17:18:16 -06:00
|
|
|
|
2024-02-06 04:55:07 -06:00
|
|
|
ElementContext elem_ctx(this->simulator_);
|
|
|
|
const auto& gridView = this->simulator_.gridView();
|
2021-09-20 04:12:27 -05:00
|
|
|
OPM_BEGIN_PARALLEL_TRY_CATCH();
|
|
|
|
|
2022-10-12 07:27:20 -05:00
|
|
|
for (const auto& elem : elements(gridView, Dune::Partitions::interior)) {
|
2020-11-16 17:18:16 -06:00
|
|
|
elem_ctx.updatePrimaryStencil(elem);
|
|
|
|
|
2023-08-15 02:32:10 -05:00
|
|
|
const std::size_t cell_index = elem_ctx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
2020-11-16 17:18:16 -06:00
|
|
|
const int idx = this->cell_to_aquifer_cell_idx_[cell_index];
|
|
|
|
if (idx < 0) {
|
|
|
|
continue;
|
|
|
|
}
|
2021-02-05 04:22:49 -06:00
|
|
|
|
2020-11-16 17:18:16 -06:00
|
|
|
elem_ctx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
|
|
|
const auto& iq0 = elem_ctx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0);
|
|
|
|
const auto& fs = iq0.fluidState();
|
|
|
|
|
2021-02-04 06:49:09 -06:00
|
|
|
// TODO: the porosity of the cells are still wrong for numerical aquifer cells
|
|
|
|
// Because the dofVolume still based on the grid information.
|
|
|
|
// The pore volume is correct. Extra efforts will be done to get sensible porosity value here later.
|
2024-02-21 01:20:25 -06:00
|
|
|
const Scalar water_saturation = fs.saturation(this->phaseIdx_()).value();
|
|
|
|
const Scalar porosity = iq0.porosity().value();
|
|
|
|
const Scalar volume = elem_ctx.dofTotalVolume(0, 0);
|
2021-02-04 06:49:09 -06:00
|
|
|
// TODO: not sure we should use water pressure here
|
2024-02-21 01:20:25 -06:00
|
|
|
const Scalar water_pressure_reservoir = fs.pressure(this->phaseIdx_()).value();
|
|
|
|
const Scalar water_volume = volume * porosity * water_saturation;
|
2021-02-04 06:49:09 -06:00
|
|
|
sum_pressure_watervolume += water_volume * water_pressure_reservoir;
|
|
|
|
sum_watervolume += water_volume;
|
2021-06-01 16:20:28 -05:00
|
|
|
|
|
|
|
cell_pressure[idx] = water_pressure_reservoir;
|
2020-11-16 17:18:16 -06:00
|
|
|
}
|
2024-02-06 04:55:07 -06:00
|
|
|
OPM_END_PARALLEL_TRY_CATCH("AquiferNumerical::calculateAquiferPressure() failed: ",
|
|
|
|
this->simulator_.vanguard().grid().comm());
|
|
|
|
const auto& comm = this->simulator_.vanguard().grid().comm();
|
2021-02-04 07:57:55 -06:00
|
|
|
comm.sum(&sum_pressure_watervolume, 1);
|
|
|
|
comm.sum(&sum_watervolume, 1);
|
2021-06-01 16:20:28 -05:00
|
|
|
|
|
|
|
// Ensure all processes have same notion of the aquifer cells' pressure values.
|
|
|
|
comm.sum(cell_pressure.data(), cell_pressure.size());
|
|
|
|
|
2021-02-04 06:49:09 -06:00
|
|
|
return sum_pressure_watervolume / sum_watervolume;
|
2020-11-16 17:18:16 -06:00
|
|
|
}
|
|
|
|
|
2022-08-03 02:52:03 -05:00
|
|
|
template <class ElemCtx>
|
2024-02-21 01:20:25 -06:00
|
|
|
Scalar getWaterFlux(const ElemCtx& elem_ctx, unsigned face_idx) const
|
2022-08-03 02:52:03 -05:00
|
|
|
{
|
2022-06-10 15:58:32 -05:00
|
|
|
const auto& exQuants = elem_ctx.extensiveQuantities(face_idx, /*timeIdx*/ 0);
|
2024-02-21 01:20:25 -06:00
|
|
|
const Scalar water_flux = Toolbox::value(exQuants.volumeFlux(this->phaseIdx_()));
|
2022-06-10 15:58:32 -05:00
|
|
|
return water_flux;
|
|
|
|
}
|
|
|
|
|
2024-02-21 01:20:25 -06:00
|
|
|
Scalar calculateAquiferFluxRate() const
|
2020-11-16 17:18:16 -06:00
|
|
|
{
|
2024-02-21 01:20:25 -06:00
|
|
|
Scalar aquifer_flux = 0.0;
|
2020-11-16 17:18:16 -06:00
|
|
|
|
2021-06-22 09:09:39 -05:00
|
|
|
if (! this->connects_to_reservoir_) {
|
|
|
|
return aquifer_flux;
|
|
|
|
}
|
|
|
|
|
2024-02-06 04:55:07 -06:00
|
|
|
ElementContext elem_ctx(this->simulator_);
|
|
|
|
const auto& gridView = this->simulator_.gridView();
|
2022-10-12 07:27:20 -05:00
|
|
|
for (const auto& elem : elements(gridView, Dune::Partitions::interior)) {
|
2020-11-16 17:18:16 -06:00
|
|
|
// elem_ctx.updatePrimaryStencil(elem);
|
|
|
|
elem_ctx.updateStencil(elem);
|
|
|
|
|
2021-06-22 09:09:39 -05:00
|
|
|
const std::size_t cell_index = elem_ctx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
2020-11-16 17:18:16 -06:00
|
|
|
const int idx = this->cell_to_aquifer_cell_idx_[cell_index];
|
|
|
|
// we only need the first aquifer cell
|
|
|
|
if (idx != 0) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-08-04 08:54:32 -05:00
|
|
|
|
2021-06-22 09:09:39 -05:00
|
|
|
const std::size_t num_interior_faces = elem_ctx.numInteriorFaces(/*timeIdx*/ 0);
|
2021-01-29 07:31:35 -06:00
|
|
|
// const auto &problem = elem_ctx.problem();
|
2021-06-22 09:09:39 -05:00
|
|
|
const auto& stencil = elem_ctx.stencil(0);
|
2020-11-16 17:18:16 -06:00
|
|
|
// const auto& inQuants = elem_ctx.intensiveQuantities(0, /*timeIdx*/ 0);
|
|
|
|
|
2021-06-22 09:09:39 -05:00
|
|
|
for (std::size_t face_idx = 0; face_idx < num_interior_faces; ++face_idx) {
|
|
|
|
const auto& face = stencil.interiorFace(face_idx);
|
2020-11-16 17:18:16 -06:00
|
|
|
// dof index
|
2021-06-22 09:09:39 -05:00
|
|
|
const std::size_t i = face.interiorIndex();
|
|
|
|
const std::size_t j = face.exteriorIndex();
|
2020-11-16 17:18:16 -06:00
|
|
|
// compressed index
|
2023-08-15 02:32:10 -05:00
|
|
|
// const std::size_t I = stencil.globalSpaceIndex(i);
|
2021-06-22 09:09:39 -05:00
|
|
|
const std::size_t J = stencil.globalSpaceIndex(j);
|
2020-11-16 17:18:16 -06:00
|
|
|
|
2021-01-29 07:31:35 -06:00
|
|
|
assert(stencil.globalSpaceIndex(i) == cell_index);
|
2020-11-16 17:18:16 -06:00
|
|
|
|
|
|
|
// we do not consider the flux within aquifer cells
|
|
|
|
// we only need the flux to the connections
|
|
|
|
if (this->cell_to_aquifer_cell_idx_[J] > 0) {
|
|
|
|
continue;
|
|
|
|
}
|
2022-06-10 15:58:32 -05:00
|
|
|
elem_ctx.updateAllIntensiveQuantities();
|
|
|
|
elem_ctx.updateAllExtensiveQuantities();
|
2020-11-16 17:18:16 -06:00
|
|
|
|
2024-02-21 01:20:25 -06:00
|
|
|
const Scalar water_flux = getWaterFlux(elem_ctx,face_idx);
|
2021-06-22 09:09:39 -05:00
|
|
|
const std::size_t up_id = water_flux >= 0.0 ? i : j;
|
|
|
|
const auto& intQuantsIn = elem_ctx.intensiveQuantities(up_id, 0);
|
2024-02-21 01:20:25 -06:00
|
|
|
const Scalar invB = Toolbox::value(intQuantsIn.fluidState().invB(this->phaseIdx_()));
|
|
|
|
const Scalar face_area = face.area();
|
2020-11-18 03:14:14 -06:00
|
|
|
aquifer_flux += water_flux * invB * face_area;
|
2020-11-16 17:18:16 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// we only need to handle the first aquifer cell, we can exit loop here
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return aquifer_flux;
|
|
|
|
}
|
2022-08-11 02:54:15 -05:00
|
|
|
|
2024-02-21 01:20:25 -06:00
|
|
|
Scalar flux_rate_; // aquifer influx rate
|
|
|
|
Scalar cumulative_flux_; // cumulative aquifer influx
|
|
|
|
std::vector<Scalar> init_pressure_{};
|
|
|
|
Scalar pressure_; // aquifer pressure
|
2022-08-11 02:54:15 -05:00
|
|
|
bool solution_set_from_restart_ {false};
|
|
|
|
bool connects_to_reservoir_ {false};
|
|
|
|
|
|
|
|
// TODO: maybe unordered_map can also do the work to save memory?
|
|
|
|
std::vector<int> cell_to_aquifer_cell_idx_;
|
2020-11-13 08:08:45 -06:00
|
|
|
};
|
2022-08-11 02:54:15 -05:00
|
|
|
|
2020-11-13 08:08:45 -06:00
|
|
|
} // namespace Opm
|
2022-08-11 02:54:15 -05:00
|
|
|
|
2020-11-13 08:08:45 -06:00
|
|
|
#endif
|