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>
|
|
|
|
|
2017-12-04 15:26:53 -06:00
|
|
|
#include <opm/parser/eclipse/EclipseState/AquiferCT.hpp>
|
2018-01-04 08:50:04 -06:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Aquancon.hpp>
|
2017-12-04 15:26:53 -06:00
|
|
|
#include <opm/simulators/timestepping/SimulatorTimer.hpp>
|
|
|
|
#include <opm/autodiff/AquiferCarterTracy.hpp>
|
|
|
|
#include <opm/material/densead/Math.hpp>
|
|
|
|
|
|
|
|
namespace Opm {
|
|
|
|
|
|
|
|
/// Class for handling the blackoil well model.
|
|
|
|
template<typename TypeTag>
|
2018-10-25 09:47:00 -05:00
|
|
|
class BlackoilAquiferModel : public Ewoms::EclBaseAquiferModel<TypeTag>
|
|
|
|
{
|
|
|
|
typedef Ewoms::EclBaseAquiferModel<TypeTag> ParentType;
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2018-10-25 09:47:00 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2018-10-25 09:47:00 -05:00
|
|
|
public:
|
2018-04-26 09:22:26 -05:00
|
|
|
explicit BlackoilAquiferModel(Simulator& ebosSimulator);
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2018-10-26 05:25:02 -05:00
|
|
|
void initialSolutionApplied()
|
|
|
|
{
|
|
|
|
for (auto aquifer = aquifers_.begin(); aquifer != aquifers_.end(); ++aquifer)
|
|
|
|
aquifer->initialSolutionApplied();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-10-30 05:21:44 -05:00
|
|
|
void beginTimeStep()
|
|
|
|
{
|
|
|
|
for (auto aquifer = aquifers_.begin(); aquifer != aquifers_.end(); ++aquifer)
|
|
|
|
aquifer->beginTimeStep();
|
|
|
|
}
|
2018-10-25 09:47:00 -05:00
|
|
|
|
|
|
|
// 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
|
|
|
|
{
|
2018-10-30 05:21:44 -05:00
|
|
|
for (auto& aquifer: aquifers_)
|
|
|
|
aquifer.addToSource(rates, context, spaceIdx, timeIdx);
|
|
|
|
}
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2018-10-30 05:21:44 -05:00
|
|
|
void endTimeStep()
|
|
|
|
{
|
|
|
|
for (auto aquifer = aquifers_.begin(); aquifer != aquifers_.end(); ++aquifer)
|
|
|
|
aquifer->endTimeStep();
|
2018-10-25 09:47:00 -05:00
|
|
|
}
|
2017-12-04 15:26:53 -06:00
|
|
|
|
|
|
|
protected:
|
2018-10-25 09:47:00 -05:00
|
|
|
// --------- Types ---------
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2018-10-30 05:21:44 -05:00
|
|
|
typedef AquiferCarterTracy<TypeTag> AquiferType;
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2018-10-30 05:21:44 -05:00
|
|
|
// TODO: declaring this as mutable is a hack which should be fixed in the
|
2018-10-25 09:47:00 -05:00
|
|
|
// long term
|
2018-10-30 05:21:44 -05:00
|
|
|
mutable std::vector<AquiferType> aquifers_;
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2018-04-26 09:22:26 -05:00
|
|
|
// This initialization function is used to connect the parser objects with the ones needed by AquiferCarterTracy
|
|
|
|
void init();
|
2017-12-04 15:26:53 -06:00
|
|
|
|
2018-05-31 02:51:54 -05:00
|
|
|
bool aquiferActive() const;
|
2017-12-04 15:26:53 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Opm
|
|
|
|
|
|
|
|
#include "BlackoilAquiferModel_impl.hpp"
|
2018-06-05 02:16:34 -05:00
|
|
|
#endif
|