2017-12-04 15:26:53 -06:00
|
|
|
/*
|
|
|
|
File adapted from BlackoilWellModel.hpp
|
|
|
|
|
|
|
|
Copyright 2017 TNO - Heat Transfer & Fluid Dynamics, Modelling & Optimization of the Subsurface
|
|
|
|
Copyright 2017 Statoil ASA.
|
|
|
|
|
|
|
|
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_BLACKOILAQUIFERMODEL_HEADER_INCLUDED
|
|
|
|
#define OPM_BLACKOILAQUIFERMODEL_HEADER_INCLUDED
|
|
|
|
|
2018-10-25 09:47:00 -05:00
|
|
|
#include <ebos/eclbaseaquifermodel.hh>
|
|
|
|
|
2021-12-14 01:30:15 -06:00
|
|
|
#include <opm/input/eclipse/EclipseState/Aquifer/Aquancon.hpp>
|
|
|
|
#include <opm/input/eclipse/EclipseState/Aquifer/AquiferCT.hpp>
|
|
|
|
#include <opm/input/eclipse/EclipseState/Aquifer/Aquifetp.hpp>
|
2019-11-28 11:21:45 -06:00
|
|
|
|
|
|
|
#include <opm/output/data/Aquifer.hpp>
|
|
|
|
|
2019-05-07 06:06:02 -05:00
|
|
|
#include <opm/simulators/aquifers/AquiferCarterTracy.hpp>
|
|
|
|
#include <opm/simulators/aquifers/AquiferFetkovich.hpp>
|
2020-11-13 08:08:45 -06:00
|
|
|
#include <opm/simulators/aquifers/AquiferNumerical.hpp>
|
2019-11-28 11:21:45 -06:00
|
|
|
|
2020-12-11 08:33:25 -06:00
|
|
|
#include <opm/grid/CpGrid.hpp>
|
2022-08-26 01:22:07 -05:00
|
|
|
#ifdef USE_POLYHEDRALGRID
|
2020-12-11 08:33:25 -06:00
|
|
|
#include <opm/grid/polyhedralgrid.hh>
|
2022-08-26 01:22:07 -05:00
|
|
|
#endif
|
2022-11-14 08:11:12 -06:00
|
|
|
#if USE_ALUGRID
|
2020-12-11 08:33:25 -06:00
|
|
|
#include <dune/alugrid/grid.hh>
|
|
|
|
#endif
|
|
|
|
|
2017-12-04 15:26:53 -06:00
|
|
|
#include <opm/material/densead/Math.hpp>
|
|
|
|
|
2019-11-28 11:21:45 -06:00
|
|
|
#include <vector>
|
2020-12-11 10:38:00 -06:00
|
|
|
#include <type_traits>
|
2023-03-09 09:47:33 -06:00
|
|
|
#include <string_view>
|
2019-11-28 11:21:45 -06:00
|
|
|
|
2019-12-20 07:30:13 -06:00
|
|
|
namespace Opm
|
|
|
|
{
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2020-12-11 10:38:00 -06:00
|
|
|
template<class Grid>
|
|
|
|
class SupportsFaceTag
|
|
|
|
: public std::bool_constant<false>
|
|
|
|
{};
|
|
|
|
|
|
|
|
|
|
|
|
template<>
|
|
|
|
class SupportsFaceTag<Dune::CpGrid>
|
|
|
|
: public std::bool_constant<true>
|
|
|
|
{};
|
|
|
|
|
|
|
|
|
2022-08-26 01:22:07 -05:00
|
|
|
#ifdef USE_POLYHEDRALGRID
|
2020-12-11 10:38:00 -06:00
|
|
|
template<>
|
|
|
|
class SupportsFaceTag<Dune::PolyhedralGrid<3, 3>>
|
|
|
|
: public std::bool_constant<true>
|
|
|
|
{};
|
2022-08-26 01:22:07 -05:00
|
|
|
#endif
|
2020-12-11 10:38:00 -06:00
|
|
|
|
2022-11-14 08:11:12 -06:00
|
|
|
#if USE_ALUGRID
|
2020-12-11 10:38:00 -06:00
|
|
|
template<>
|
|
|
|
class SupportsFaceTag<Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>>
|
|
|
|
: public std::bool_constant<true>
|
|
|
|
{};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2019-12-20 07:30:13 -06:00
|
|
|
/// Class for handling the blackoil well model.
|
|
|
|
template <typename TypeTag>
|
|
|
|
class BlackoilAquiferModel
|
|
|
|
{
|
2020-08-26 03:49:52 -05:00
|
|
|
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
|
|
|
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2020-12-11 08:33:25 -06:00
|
|
|
|
2019-12-20 07:30:13 -06:00
|
|
|
public:
|
|
|
|
explicit BlackoilAquiferModel(Simulator& simulator);
|
2019-11-28 11:21:45 -06:00
|
|
|
|
2019-12-20 07:30:13 -06:00
|
|
|
void initialSolutionApplied();
|
2021-05-12 10:12:03 -05:00
|
|
|
void initFromRestart(const data::Aquifers& aquiferSoln);
|
2018-10-30 09:50:36 -05:00
|
|
|
|
2019-12-20 07:30:13 -06:00
|
|
|
void beginEpisode();
|
|
|
|
void beginTimeStep();
|
|
|
|
void beginIteration();
|
|
|
|
// add the water rate due to aquifers to the source term.
|
|
|
|
template <class Context>
|
|
|
|
void addToSource(RateVector& rates, const Context& context, unsigned spaceIdx, unsigned timeIdx) const;
|
2022-07-01 08:36:32 -05:00
|
|
|
void addToSource(RateVector& rates, unsigned globalSpaceIdx, unsigned timeIdx) const;
|
2019-12-20 07:30:13 -06:00
|
|
|
void endIteration();
|
|
|
|
void endTimeStep();
|
|
|
|
void endEpisode();
|
2019-02-25 05:14:38 -06:00
|
|
|
|
2021-05-05 04:22:44 -05:00
|
|
|
data::Aquifers aquiferData() const;
|
2020-10-01 16:30:07 -05:00
|
|
|
|
2019-12-20 07:30:13 -06:00
|
|
|
template <class Restarter>
|
|
|
|
void serialize(Restarter& res);
|
2019-02-25 05:14:38 -06:00
|
|
|
|
2019-12-20 07:30:13 -06:00
|
|
|
template <class Restarter>
|
|
|
|
void deserialize(Restarter& res);
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2023-02-02 04:52:08 -06:00
|
|
|
template<class Serializer>
|
|
|
|
void serializeOp(Serializer& serializer);
|
|
|
|
|
2019-12-20 07:30:13 -06:00
|
|
|
protected:
|
|
|
|
// --------- Types ---------
|
2020-08-26 03:49:52 -05:00
|
|
|
using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
|
|
|
|
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2019-12-20 07:30:13 -06:00
|
|
|
Simulator& simulator_;
|
2018-12-07 08:55:14 -06:00
|
|
|
|
2023-01-30 16:58:36 -06:00
|
|
|
// TODO: possibly better to use unorder_map here for aquifers
|
2022-08-10 07:28:00 -05:00
|
|
|
std::vector<std::unique_ptr<AquiferInterface<TypeTag>>> aquifers;
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2023-03-09 09:47:33 -06:00
|
|
|
// This initialization function is used to connect the parser objects
|
|
|
|
// with the ones needed by AquiferCarterTracy
|
2019-12-20 07:30:13 -06:00
|
|
|
void init();
|
2023-03-09 09:47:33 -06:00
|
|
|
|
|
|
|
private:
|
|
|
|
void createDynamicAquifers(const int episode_index);
|
|
|
|
|
|
|
|
void initializeStaticAquifers();
|
|
|
|
|
|
|
|
template <typename AquiferType, typename AquiferData>
|
|
|
|
std::unique_ptr<AquiferType>
|
|
|
|
createAnalyticAquiferPointer(const AquiferData& aqData,
|
|
|
|
const int aquiferID,
|
|
|
|
std::string_view aqType) const;
|
2019-12-20 07:30:13 -06:00
|
|
|
};
|
2017-12-04 15:26:53 -06:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace Opm
|
|
|
|
|
|
|
|
#include "BlackoilAquiferModel_impl.hpp"
|
2022-08-10 07:28:00 -05:00
|
|
|
|
2018-06-05 02:16:34 -05:00
|
|
|
#endif
|