2016-08-11 06:31:52 -05:00
|
|
|
/*
|
|
|
|
Copyright 2016 SINTEF ICT, Applied Mathematics.
|
2017-03-24 06:19:11 -05:00
|
|
|
Copyright 2016 - 2017 Statoil ASA.
|
|
|
|
Copyright 2017 Dr. Blatt - HPC-Simulation-Software & Services
|
2018-06-06 08:17:59 -05:00
|
|
|
Copyright 2016 - 2018 IRIS AS
|
2016-08-11 06:31:52 -05:00
|
|
|
|
|
|
|
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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2017-09-26 03:52:05 -05:00
|
|
|
#ifndef OPM_BLACKOILWELLMODEL_HEADER_INCLUDED
|
|
|
|
#define OPM_BLACKOILWELLMODEL_HEADER_INCLUDED
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2018-08-16 04:51:36 -05:00
|
|
|
#include <ebos/eclproblem.hh>
|
2016-08-11 06:31:52 -05:00
|
|
|
#include <opm/common/OpmLog/OpmLog.hpp>
|
|
|
|
|
|
|
|
#include <opm/common/utility/platform_dependent/disable_warnings.h>
|
|
|
|
#include <opm/common/utility/platform_dependent/reenable_warnings.h>
|
|
|
|
|
|
|
|
#include <cassert>
|
|
|
|
#include <tuple>
|
|
|
|
|
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
2018-06-06 08:17:59 -05:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/WellTestState.hpp>
|
2016-08-11 06:31:52 -05:00
|
|
|
|
|
|
|
#include <opm/core/wells.h>
|
|
|
|
#include <opm/core/wells/DynamicListEconLimited.hpp>
|
2017-01-09 03:36:17 -06:00
|
|
|
#include <opm/core/wells/WellCollection.hpp>
|
2017-05-22 12:35:38 -05:00
|
|
|
#include <opm/core/simulator/SimulatorReport.hpp>
|
2016-08-11 06:31:52 -05:00
|
|
|
#include <opm/autodiff/VFPProperties.hpp>
|
2016-08-23 02:45:37 -05:00
|
|
|
#include <opm/autodiff/WellHelpers.hpp>
|
|
|
|
#include <opm/autodiff/WellDensitySegmented.hpp>
|
2016-12-29 09:35:24 -06:00
|
|
|
#include <opm/autodiff/BlackoilPropsAdFromDeck.hpp>
|
2016-08-23 02:45:37 -05:00
|
|
|
#include <opm/autodiff/BlackoilDetails.hpp>
|
|
|
|
#include <opm/autodiff/BlackoilModelParameters.hpp>
|
2017-10-06 03:59:42 -05:00
|
|
|
#include <opm/autodiff/WellStateFullyImplicitBlackoil.hpp>
|
2017-01-17 06:14:32 -06:00
|
|
|
#include <opm/autodiff/RateConverter.hpp>
|
2017-06-15 10:19:49 -05:00
|
|
|
#include <opm/autodiff/WellInterface.hpp>
|
2017-06-27 09:04:04 -05:00
|
|
|
#include <opm/autodiff/StandardWell.hpp>
|
2017-09-01 10:37:51 -05:00
|
|
|
#include <opm/autodiff/MultisegmentWell.hpp>
|
2018-06-06 03:59:41 -05:00
|
|
|
#include <opm/autodiff/Compat.hpp>
|
2017-11-08 06:57:36 -06:00
|
|
|
#include<opm/autodiff/SimFIBODetails.hpp>
|
2016-08-25 08:25:01 -05:00
|
|
|
#include<dune/common/fmatrix.hh>
|
|
|
|
#include<dune/istl/bcrsmatrix.hh>
|
|
|
|
#include<dune/istl/matrixmatrix.hh>
|
2016-08-11 06:31:52 -05:00
|
|
|
|
|
|
|
#include <opm/material/densead/Math.hpp>
|
|
|
|
|
2017-01-24 08:59:41 -06:00
|
|
|
#include <opm/simulators/WellSwitchingLogger.hpp>
|
|
|
|
|
2018-08-16 04:51:36 -05:00
|
|
|
BEGIN_PROPERTIES
|
|
|
|
|
|
|
|
NEW_PROP_TAG(EnableTerminalOutput);
|
|
|
|
|
|
|
|
END_PROPERTIES
|
2017-06-15 10:19:49 -05:00
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
namespace Opm {
|
|
|
|
|
2017-09-26 03:52:05 -05:00
|
|
|
/// Class for handling the blackoil well model.
|
2017-05-03 06:34:15 -05:00
|
|
|
template<typename TypeTag>
|
2018-08-16 04:51:36 -05:00
|
|
|
class BlackoilWellModel : public Ewoms::BaseAuxiliaryModule<TypeTag>
|
|
|
|
{
|
2016-08-11 06:31:52 -05:00
|
|
|
public:
|
|
|
|
// --------- Types ---------
|
2017-10-06 03:59:42 -05:00
|
|
|
typedef WellStateFullyImplicitBlackoil WellState;
|
2018-06-21 05:14:17 -05:00
|
|
|
typedef BlackoilModelParametersEbos<TypeTag> ModelParameters;
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-06-27 09:51:11 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
|
2017-05-03 06:34:15 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, ElementContext) ElementContext;
|
2017-12-04 02:14:08 -06:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
|
2017-05-03 06:34:15 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
|
2017-06-27 07:04:59 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
2018-08-16 04:51:36 -05:00
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, RateVector) RateVector;
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, GlobalEqVector) GlobalEqVector;
|
|
|
|
typedef typename GET_PROP_TYPE(TypeTag, JacobianMatrix) JacobianMatrix;
|
|
|
|
|
|
|
|
typedef typename Ewoms::BaseAuxiliaryModule<TypeTag>::NeighborSet NeighborSet;
|
2017-05-03 06:34:15 -05:00
|
|
|
|
2017-12-04 02:14:08 -06:00
|
|
|
static const int numEq = Indices::numEq;
|
|
|
|
static const int solventSaturationIdx = Indices::solventSaturationIdx;
|
2017-06-27 07:04:59 -05:00
|
|
|
|
2017-07-21 08:30:34 -05:00
|
|
|
// TODO: where we should put these types, WellInterface or Well Model?
|
|
|
|
// or there is some other strategy, like TypeTag
|
2017-05-03 06:34:15 -05:00
|
|
|
typedef Dune::FieldVector<Scalar, numEq > VectorBlockType;
|
2016-11-01 07:41:00 -05:00
|
|
|
typedef Dune::BlockVector<VectorBlockType> BVector;
|
2017-05-03 06:34:15 -05:00
|
|
|
|
2017-05-15 07:46:43 -05:00
|
|
|
#if DUNE_VERSION_NEWER_REV(DUNE_ISTL, 2 , 5, 1)
|
|
|
|
// 3x3 matrix block inversion was unstable from at least 2.3 until and
|
|
|
|
// including 2.5.0
|
|
|
|
typedef Dune::FieldMatrix<Scalar, numEq, numEq > MatrixBlockType;
|
|
|
|
#else
|
|
|
|
typedef Dune::FieldMatrix<Scalar, numEq, numEq > MatrixBlockType;
|
|
|
|
#endif
|
|
|
|
typedef Dune::BCRSMatrix <MatrixBlockType> Mat;
|
|
|
|
|
2017-06-07 02:29:31 -05:00
|
|
|
typedef Ewoms::BlackOilPolymerModule<TypeTag> PolymerModule;
|
2016-11-18 05:43:53 -06:00
|
|
|
|
2017-01-17 06:14:32 -06:00
|
|
|
// For the conversion between the surface volume rate and resrevoir voidage rate
|
|
|
|
using RateConverterType = RateConverter::
|
2017-11-08 06:57:36 -06:00
|
|
|
SurfaceToReservoirVoidage<FluidSystem, std::vector<int> >;
|
2016-11-01 07:41:00 -05:00
|
|
|
|
2018-08-16 04:51:36 -05:00
|
|
|
BlackoilWellModel(Simulator& ebosSimulator);
|
|
|
|
|
|
|
|
void init(const Opm::EclipseState& eclState, const Opm::Schedule& schedule);
|
|
|
|
|
|
|
|
/////////////
|
|
|
|
// <eWoms auxiliary module stuff>
|
|
|
|
/////////////
|
|
|
|
unsigned numDofs() const
|
|
|
|
// No extra dofs are inserted for wells. (we use a Schur complement.)
|
|
|
|
{ return 0; }
|
2017-05-03 06:34:15 -05:00
|
|
|
|
2018-08-16 04:51:36 -05:00
|
|
|
void addNeighbors(std::vector<NeighborSet>& neighbors) const;
|
|
|
|
|
|
|
|
void applyInitial()
|
|
|
|
{}
|
|
|
|
|
|
|
|
void linearize(JacobianMatrix& mat , GlobalEqVector& res);
|
|
|
|
|
|
|
|
void postSolve(GlobalEqVector& deltaX)
|
2018-06-06 03:59:41 -05:00
|
|
|
{
|
2018-08-16 04:51:36 -05:00
|
|
|
recoverWellSolutionAndUpdateWellState(deltaX);
|
2018-06-06 03:59:41 -05:00
|
|
|
}
|
|
|
|
|
2018-08-16 04:51:36 -05:00
|
|
|
/////////////
|
|
|
|
// </ eWoms auxiliary module stuff>
|
|
|
|
/////////////
|
|
|
|
|
|
|
|
template <class Restarter>
|
|
|
|
void deserialize(Restarter& res)
|
|
|
|
{
|
|
|
|
// TODO (?)
|
|
|
|
}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief This method writes the complete state of the well
|
|
|
|
* to the harddisk.
|
|
|
|
*/
|
|
|
|
template <class Restarter>
|
|
|
|
void serialize(Restarter& res)
|
|
|
|
{
|
|
|
|
// TODO (?)
|
|
|
|
}
|
|
|
|
|
|
|
|
void beginEpisode(const Opm::EclipseState& eclState,
|
|
|
|
const Opm::Schedule& schedule,
|
|
|
|
bool isRestart)
|
|
|
|
{
|
|
|
|
size_t episodeIdx = ebosSimulator_.episodeIndex();
|
|
|
|
// beginEpisode in eclProblem advances the episode index
|
|
|
|
// we don't want this when we are at the beginning of an
|
|
|
|
// restart.
|
|
|
|
if (isRestart)
|
|
|
|
episodeIdx -= 1;
|
|
|
|
|
|
|
|
beginReportStep(episodeIdx);
|
|
|
|
}
|
|
|
|
|
|
|
|
void beginTimeStep();
|
|
|
|
|
|
|
|
void beginIteration()
|
|
|
|
{
|
|
|
|
assemble(ebosSimulator_.model().newtonMethod().numIterations(),
|
|
|
|
ebosSimulator_.timeStepSize());
|
|
|
|
}
|
|
|
|
|
|
|
|
void endIteration()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
void endTimeStep()
|
|
|
|
{
|
|
|
|
timeStepSucceeded(ebosSimulator_.time());
|
|
|
|
}
|
|
|
|
|
|
|
|
void endEpisode()
|
|
|
|
{
|
|
|
|
endReportStep();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <class Context>
|
|
|
|
void computeTotalRatesForDof(RateVector& rate,
|
|
|
|
const Context& context,
|
|
|
|
unsigned spaceIdx,
|
|
|
|
unsigned timeIdx) const;
|
|
|
|
|
|
|
|
void initFromRestartFile(const RestartValue& restartValues);
|
2016-08-25 08:25:01 -05:00
|
|
|
|
2018-08-16 04:51:36 -05:00
|
|
|
Opm::data::Wells wellData() const
|
|
|
|
{ return well_state_.report(phase_usage_, Opm::UgGridHelpers::globalCell(grid())); }
|
2016-08-25 08:25:01 -05:00
|
|
|
|
2016-09-07 06:23:52 -05:00
|
|
|
// subtract B*inv(D)*C * x from A*x
|
2017-06-07 07:23:43 -05:00
|
|
|
void apply(const BVector& x, BVector& Ax) const;
|
2016-08-25 08:25:01 -05:00
|
|
|
|
2016-11-17 06:43:39 -06:00
|
|
|
// apply well model with scaling of alpha
|
2017-06-07 07:23:43 -05:00
|
|
|
void applyScaleAdd(const Scalar alpha, const BVector& x, BVector& Ax) const;
|
2016-11-17 06:43:39 -06:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
// Check if well equations is converged.
|
|
|
|
bool getWellConvergence(const std::vector<Scalar>& B_avg) const;
|
2016-08-19 06:50:27 -05:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
// return all the wells.
|
|
|
|
const WellCollection& wellCollection() const;
|
2017-11-08 08:48:30 -06:00
|
|
|
// return non const reference to all the wells.
|
2017-11-08 06:57:36 -06:00
|
|
|
WellCollection& wellCollection();
|
2016-08-23 02:45:37 -05:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
// return the internal well state, ignore the passed one.
|
|
|
|
// Used by the legacy code to make it compatible with the legacy well models.
|
2017-11-08 08:48:30 -06:00
|
|
|
const WellState& wellState(const WellState& well_state OPM_UNUSED) const;
|
2017-02-13 10:07:34 -06:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
// return the internal well state
|
2017-11-08 08:48:30 -06:00
|
|
|
const WellState& wellState() const;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2018-08-16 04:51:36 -05:00
|
|
|
const SimulatorReport& lastReport() const;
|
2017-08-08 03:44:10 -05:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
// called at the beginning of a report step
|
|
|
|
void beginReportStep(const int time_step);
|
|
|
|
|
|
|
|
protected:
|
2018-08-16 04:51:36 -05:00
|
|
|
|
2018-06-06 03:59:41 -05:00
|
|
|
void extractLegacyPressure_(std::vector<double>& cellPressure) const
|
|
|
|
{
|
|
|
|
size_t nc = number_of_cells_;
|
|
|
|
std::vector<double> cellPressures(nc, 0.0);
|
|
|
|
ElementContext elemCtx(ebosSimulator_);
|
|
|
|
const auto& gridView = ebosSimulator_.vanguard().gridView();
|
|
|
|
const auto& elemEndIt = gridView.template end</*codim=*/0>();
|
|
|
|
for (auto elemIt = gridView.template begin</*codim=*/0>();
|
|
|
|
elemIt != elemEndIt;
|
|
|
|
++elemIt)
|
|
|
|
{
|
|
|
|
const auto& elem = *elemIt;
|
|
|
|
if (elem.partitionType() != Dune::InteriorEntity) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
elemCtx.updatePrimaryStencil(elem);
|
|
|
|
elemCtx.updatePrimaryIntensiveQuantities(/*timeIdx=*/0);
|
|
|
|
|
|
|
|
const unsigned cellIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
|
|
|
const auto& intQuants = elemCtx.intensiveQuantities(/*spaceIdx=*/0, /*timeIdx=*/0);
|
|
|
|
const auto& fs = intQuants.fluidState();
|
|
|
|
|
|
|
|
const double p = fs.pressure(FluidSystem::oilPhaseIdx).value();
|
|
|
|
cellPressures[cellIdx] = p;
|
|
|
|
}
|
|
|
|
}
|
2017-07-25 03:15:27 -05:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
Simulator& ebosSimulator_;
|
|
|
|
std::unique_ptr<WellsManager> wells_manager_;
|
|
|
|
std::vector< const Well* > wells_ecl_;
|
|
|
|
|
|
|
|
bool wells_active_;
|
2017-10-16 09:46:28 -05:00
|
|
|
|
2017-08-21 03:23:42 -05:00
|
|
|
using WellInterfacePtr = std::unique_ptr<WellInterface<TypeTag> >;
|
2017-06-15 10:19:49 -05:00
|
|
|
// a vector of all the wells.
|
2017-08-21 03:23:42 -05:00
|
|
|
std::vector<WellInterfacePtr > well_container_;
|
2017-06-15 10:19:49 -05:00
|
|
|
|
2018-08-16 04:51:36 -05:00
|
|
|
// map from logically cartesian cell indices to compressed ones
|
|
|
|
std::vector<int> cartesian_to_compressed_;
|
|
|
|
|
2017-08-21 03:23:42 -05:00
|
|
|
// create the well container
|
2018-06-06 08:17:59 -05:00
|
|
|
std::vector<WellInterfacePtr > createWellContainer(const int time_step);
|
2017-06-15 10:19:49 -05:00
|
|
|
|
2018-10-31 08:56:56 -05:00
|
|
|
WellInterfacePtr createWellForWellTest(const std::string& well_name, const int report_step) const;
|
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
WellState well_state_;
|
|
|
|
WellState previous_well_state_;
|
2017-01-09 03:36:17 -06:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
const ModelParameters param_;
|
2016-08-23 02:45:37 -05:00
|
|
|
bool terminal_output_;
|
2017-05-09 01:21:51 -05:00
|
|
|
bool has_solvent_;
|
2017-06-07 02:29:31 -05:00
|
|
|
bool has_polymer_;
|
2017-11-08 06:57:36 -06:00
|
|
|
std::vector<int> pvt_region_idx_;
|
2017-01-11 10:02:20 -06:00
|
|
|
PhaseUsage phase_usage_;
|
2017-11-08 06:57:36 -06:00
|
|
|
size_t global_nc_;
|
2017-08-11 07:51:29 -05:00
|
|
|
// the number of the cells in the local grid
|
2017-11-08 06:57:36 -06:00
|
|
|
size_t number_of_cells_;
|
|
|
|
double gravity_;
|
|
|
|
std::vector<double> depth_;
|
2018-03-23 06:56:19 -05:00
|
|
|
bool initial_step_;
|
2017-11-08 06:57:36 -06:00
|
|
|
|
|
|
|
std::unique_ptr<RateConverterType> rateConverter_;
|
|
|
|
std::unique_ptr<VFPProperties> vfp_properties_;
|
2016-08-11 06:31:52 -05:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
SimulatorReport last_report_;
|
2017-03-24 09:12:42 -05:00
|
|
|
|
2018-06-06 08:17:59 -05:00
|
|
|
WellTestState wellTestState_;
|
|
|
|
|
2017-08-21 03:23:42 -05:00
|
|
|
// used to better efficiency of calcuation
|
2016-11-17 06:43:39 -06:00
|
|
|
mutable BVector scaleAddRes_;
|
2016-11-02 04:43:55 -05:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
const Wells* wells() const { return wells_manager_->c_wells(); }
|
|
|
|
|
2018-06-06 03:59:41 -05:00
|
|
|
const Grid& grid() const
|
|
|
|
{ return ebosSimulator_.vanguard().grid(); }
|
|
|
|
|
|
|
|
const EclipseState& eclState() const
|
|
|
|
{ return ebosSimulator_.vanguard().eclState(); }
|
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
const Schedule& schedule() const
|
2018-02-01 09:27:42 -06:00
|
|
|
{ return ebosSimulator_.vanguard().schedule(); }
|
2017-08-10 08:27:05 -05:00
|
|
|
|
2018-08-16 04:51:36 -05:00
|
|
|
// compute the well fluxes and assemble them in to the reservoir equations as source terms
|
|
|
|
// and in the well equations.
|
|
|
|
void assemble(const int iterationIdx,
|
|
|
|
const double dt);
|
|
|
|
|
|
|
|
// called at the end of a time step
|
|
|
|
void timeStepSucceeded(const double& simulationTime);
|
|
|
|
|
|
|
|
// called at the end of a report step
|
|
|
|
void endReportStep();
|
|
|
|
|
|
|
|
// using the solution x to recover the solution xw for wells and applying
|
|
|
|
// xw to update Well State
|
|
|
|
void recoverWellSolutionAndUpdateWellState(const BVector& x);
|
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
void updateWellControls();
|
|
|
|
|
|
|
|
void updateGroupControls();
|
2017-08-10 08:27:05 -05:00
|
|
|
|
|
|
|
// setting the well_solutions_ based on well_state.
|
2017-11-08 06:57:36 -06:00
|
|
|
void updatePrimaryVariables();
|
2017-08-10 08:27:05 -05:00
|
|
|
|
2018-08-16 04:51:36 -05:00
|
|
|
void setupCartesianToCompressed_(const int* global_cell, int number_of_cells);
|
2017-06-07 02:29:31 -05:00
|
|
|
|
2017-06-27 13:06:44 -05:00
|
|
|
void computeRepRadiusPerfLength(const Grid& grid);
|
2017-06-07 02:29:31 -05:00
|
|
|
|
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
void computeAverageFormationFactor(std::vector<double>& B_avg) const;
|
2017-08-10 08:27:05 -05:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
void applyVREPGroupControl();
|
2017-08-10 08:27:05 -05:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
void computeWellVoidageRates(std::vector<double>& well_voidage_rates,
|
2017-08-10 08:27:05 -05:00
|
|
|
std::vector<double>& voidage_conversion_coeffs) const;
|
|
|
|
|
|
|
|
// Calculating well potentials for each well
|
2017-11-08 06:57:36 -06:00
|
|
|
void computeWellPotentials(std::vector<double>& well_potentials);
|
2017-08-10 08:27:05 -05:00
|
|
|
|
|
|
|
const std::vector<double>& wellPerfEfficiencyFactors() const;
|
|
|
|
|
|
|
|
void calculateEfficiencyFactors();
|
|
|
|
|
2017-09-05 04:09:58 -05:00
|
|
|
// it should be able to go to prepareTimeStep(), however, the updateWellControls() and initPrimaryVariablesEvaluation()
|
|
|
|
// makes it a little more difficult. unless we introduce if (iterationIdx != 0) to avoid doing the above functions
|
|
|
|
// twice at the beginning of the time step
|
|
|
|
/// Calculating the explict quantities used in the well calculation. By explicit, we mean they are cacluated
|
|
|
|
/// at the beginning of the time step and no derivatives are included in these quantities
|
2017-11-08 06:57:36 -06:00
|
|
|
void calculateExplicitQuantities() const;
|
2017-08-10 08:27:05 -05:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
SimulatorReport solveWellEq(const double dt);
|
2017-08-10 08:27:05 -05:00
|
|
|
|
2017-08-21 08:41:25 -05:00
|
|
|
void initPrimaryVariablesEvaluation() const;
|
2017-08-10 08:27:05 -05:00
|
|
|
|
2017-08-11 07:51:29 -05:00
|
|
|
// The number of components in the model.
|
2017-11-08 08:48:30 -06:00
|
|
|
int numComponents() const;
|
|
|
|
|
|
|
|
int numWells() const;
|
|
|
|
|
|
|
|
int numPhases() const;
|
2017-11-08 06:57:36 -06:00
|
|
|
|
|
|
|
void resetWellControlFromState() const;
|
2017-08-11 07:51:29 -05:00
|
|
|
|
2018-08-16 04:51:36 -05:00
|
|
|
void assembleWellEq(const double dt);
|
2017-08-14 07:11:58 -05:00
|
|
|
|
|
|
|
// some preparation work, mostly related to group control and RESV,
|
|
|
|
// at the beginning of each time step (Not report step)
|
2017-11-08 06:57:36 -06:00
|
|
|
void prepareTimeStep();
|
|
|
|
|
|
|
|
void prepareGroupControl();
|
|
|
|
|
|
|
|
void computeRESV(const std::size_t step);
|
|
|
|
|
2017-11-08 08:48:30 -06:00
|
|
|
void extractLegacyCellPvtRegionIndex_();
|
|
|
|
|
|
|
|
void extractLegacyDepth_();
|
2017-11-08 06:57:36 -06:00
|
|
|
|
|
|
|
/// return true if wells are available in the reservoir
|
|
|
|
bool wellsActive() const;
|
|
|
|
|
|
|
|
void setWellsActive(const bool wells_active);
|
2017-09-04 06:54:41 -05:00
|
|
|
|
2017-11-08 06:57:36 -06:00
|
|
|
/// return true if wells are available on this process
|
|
|
|
bool localWellsActive() const;
|
|
|
|
|
2018-06-28 06:47:10 -05:00
|
|
|
/// upate the wellTestState related to economic limits
|
|
|
|
void updateWellTestState(const double& simulationTime, WellTestState& wellTestState) const;
|
2017-11-08 06:57:36 -06:00
|
|
|
|
2017-11-08 08:48:30 -06:00
|
|
|
void updatePerforationIntensiveQuantities();
|
2017-09-04 06:54:41 -05:00
|
|
|
|
2018-07-02 04:06:51 -05:00
|
|
|
void wellTesting(const int timeStepIdx, const double simulationTime);
|
2018-06-06 08:17:59 -05:00
|
|
|
|
2016-08-11 06:31:52 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Opm
|
2017-02-13 09:45:06 -06:00
|
|
|
|
2017-09-26 03:52:05 -05:00
|
|
|
#include "BlackoilWellModel_impl.hpp"
|
2016-08-11 06:31:52 -05:00
|
|
|
#endif
|