begining simulator code for numerical aquifer

most of the functionality is to collect data for summary output.
This commit is contained in:
Kai Bao
2021-02-22 23:15:26 +01:00
parent ef67d9a9e7
commit 6008aa8339
4 changed files with 104 additions and 0 deletions
+1
View File
@@ -160,6 +160,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/aquifers/AquiferInterface.hpp
opm/simulators/aquifers/AquiferCarterTracy.hpp
opm/simulators/aquifers/AquiferFetkovich.hpp
opm/simulators/aquifers/AquiferNumerical.hpp
opm/simulators/aquifers/BlackoilAquiferModel.hpp
opm/simulators/aquifers/BlackoilAquiferModel_impl.hpp
opm/simulators/linalg/bda/BdaBridge.hpp
@@ -0,0 +1,76 @@
/*
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
#include <opm/output/data/Aquifer.hpp>
#include <opm/parser/eclipse/EclipseState/NumericalAquifer.hpp>
namespace Opm
{
template <typename TypeTag>
class AquiferNumerical
{
public:
// Constructor
AquiferNumerical(const SingleNumericalAquifer& aquifer)
: aquifer_(aquifer)
, init_pressure_(aquifer.initPressure())
, pressure_(this->init_pressure_)
, flux_rate_(0.)
, cumulative_flux_(0.)
{
}
void initFromRestart(const std::vector<data::AquiferData>& aquiferSoln)
{
// NOT handling Restart for now
}
void beginTimeStep()
{
}
void endTimeStep()
{
}
Opm::data::AquiferData aquiferData() const
{
data::AquiferData data;
data.aquiferID = this->aquifer_.id();
data.initPressure = this->init_pressure_;
data.pressure = this->pressure_;
data.volume = this->cumulative_flux_;
data.type = Opm::data::AquiferType::Numerical;
return data;
}
private:
const Opm::SingleNumericalAquifer& aquifer_;
double init_pressure_;
double pressure_; // aquifer pressure
double flux_rate_; // aquifer influx rate
double cumulative_flux_; // cumulative aquifer influx
};
} // namespace Opm
#endif
@@ -34,6 +34,7 @@
#include <opm/simulators/aquifers/AquiferCarterTracy.hpp>
#include <opm/simulators/aquifers/AquiferFetkovich.hpp>
#include <opm/simulators/aquifers/AquiferNumerical.hpp>
#include <opm/grid/CpGrid.hpp>
#include <opm/grid/polyhedralgrid.hh>
@@ -120,6 +121,7 @@ protected:
// they share the base class
mutable std::vector<AquiferCarterTracy_object> aquifers_CarterTracy;
mutable std::vector<AquiferFetkovich_object> aquifers_Fetkovich;
std::vector<AquiferNumerical<TypeTag>> aquifers_numerical;
// This initialization function is used to connect the parser objects with the ones needed by AquiferCarterTracy
void init();
@@ -127,6 +129,7 @@ protected:
bool aquiferActive() const;
bool aquiferCarterTracyActive() const;
bool aquiferFetkovichActive() const;
bool aquiferNumericalActive() const;
};
@@ -18,6 +18,9 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <opm/grid/utility/cartesianToCompressed.hpp>
#include "BlackoilAquiferModel.hpp"
namespace Opm
{
@@ -179,6 +182,12 @@ BlackoilAquiferModel<TypeTag>::init()
aquifers_Fetkovich.emplace_back(connections[aq.aquiferID],
this->simulator_, aq);
}
if (aquifer.hasNumericalAquifer()) {
for (const auto& elem : aquifer.numericalAquifers().aquifers()) {
this->aquifers_numerical.emplace_back(elem.second);
}
}
}
template <typename TypeTag>
bool
@@ -199,6 +208,13 @@ BlackoilAquiferModel<TypeTag>::aquiferFetkovichActive() const
return !aquifers_Fetkovich.empty();
}
template<typename TypeTag>
bool
BlackoilAquiferModel<TypeTag>::aquiferNumericalActive() const
{
return !(this->aquifers_numerical.empty());
}
template<typename TypeTag>
Opm::data::Aquifers BlackoilAquiferModel<TypeTag>::aquiferData() const {
Opm::data::Aquifers data;
@@ -215,6 +231,14 @@ Opm::data::Aquifers BlackoilAquiferModel<TypeTag>::aquiferData() const {
data[aqu_data.aquiferID] = aqu_data;
}
}
if (this->aquiferNumericalActive()) {
for (const auto& aqu : this->aquifers_numerical) {
Opm::data::AquiferData aqu_data = aqu.aquiferData();
data[aqu_data.aquiferID] = aqu_data;
}
}
return data;
}
} // namespace Opm