/*
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 .
*/
#ifndef OPM_BLACKOILAQUIFERMODEL_HEADER_INCLUDED
#define OPM_BLACKOILAQUIFERMODEL_HEADER_INCLUDED
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifdef USE_POLYHEDRALGRID
#include
#endif
#if USE_ALUGRID
#include
#endif
#include
#include
#include
#include
namespace Opm
{
template
class SupportsFaceTag
: public std::bool_constant
{};
template<>
class SupportsFaceTag
: public std::bool_constant
{};
#ifdef USE_POLYHEDRALGRID
template<>
class SupportsFaceTag>
: public std::bool_constant
{};
#endif
#if USE_ALUGRID
template<>
class SupportsFaceTag>
: public std::bool_constant
{};
#endif
/// Class for handling the blackoil well model.
template
class BlackoilAquiferModel
{
using Simulator = GetPropType;
using RateVector = GetPropType;
public:
explicit BlackoilAquiferModel(Simulator& simulator);
void initialSolutionApplied();
void initFromRestart(const data::Aquifers& aquiferSoln);
void beginEpisode();
void beginTimeStep();
void beginIteration();
// add the water rate due to aquifers to the source term.
template
void addToSource(RateVector& rates, const Context& context, unsigned spaceIdx, unsigned timeIdx) const;
void addToSource(RateVector& rates, unsigned globalSpaceIdx, unsigned timeIdx) const;
void endIteration();
void endTimeStep();
void endEpisode();
data::Aquifers aquiferData() const;
template
void serialize(Restarter& res);
template
void deserialize(Restarter& res);
template
void serializeOp(Serializer& serializer);
protected:
// --------- Types ---------
using ElementContext = GetPropType;
using Scalar = GetPropType;
Simulator& simulator_;
// TODO: possibly better to use unorder_map here for aquifers
std::vector>> aquifers;
// This initialization function is used to connect the parser objects
// with the ones needed by AquiferCarterTracy
void init();
private:
void createDynamicAquifers(const int episode_index);
void initializeStaticAquifers();
template
std::unique_ptr
createAnalyticAquiferPointer(const AquiferData& aqData,
const int aquiferID,
std::string_view aqType) const;
};
} // namespace Opm
#include "BlackoilAquiferModel_impl.hpp"
#endif