+
+

opm-simulators documentation

+
+
+
+
+

API Reference

+
+
+struct AcceleratorMode
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "none"
+
+ +
+
+ +
+
+template<class Scalar>
class ActionHandler
+
+#include <ActionHandler.hpp>
+

Class handling Action support in simulator.

+
+

Public Types

+
+
+using TransFunc = std::function<void(bool)>
+

Function handle to update transmissiblities.

+
+ +
+
+

Public Functions

+
+
+ActionHandler(EclipseState &ecl_state, Schedule &schedule, Action::State &actionState, SummaryState &summaryState, BlackoilWellModelGeneric<Scalar> &wellModel, Parallel::Communication comm)
+

Constructor.

+
+
Parameters:
+
    +
  • ecl_state[inout] Container of static properties such as permeability and transmissibility.

  • +
  • schedule[inout] Container of dynamic objects, such as wells.

  • +
  • actionState[inout] Dynamic state object for all actions.

  • +
  • summaryState[inout] Dynamic state object for all summary vectors.

  • +
  • wellModel[inout] Simulation wells on this rank.

  • +
  • comm[in] MPI communicator object linking all simulation ranks.

  • +
+
+
+
+ +
+
+void applyActions(int reportStep, double sim_time, const TransFunc &updateTrans)
+

Run all pending actions.

+
+
Parameters:
+
    +
  • reportStep[in] Zero-based report step index.

  • +
  • sim_time[in] Elapsed time since simulation start.

  • +
  • updateTrans[in] Call-back for affecting transmissibility updates. Typically invoked if the action triggers a keyword like MULTZ.

  • +
+
+
+
+ +
+
+void evalUDQAssignments(const unsigned episodeIdx, UDQState &udq_state)
+

Evaluates UDQ assign statements.

+
+
Parameters:
+
    +
  • episodeIdx[in] Zero-based report step index.

  • +
  • udq_state[inout] Dynamic state of all user-defined quantities.

  • +
+
+
+
+ +
+
+void applySimulatorUpdate(int report_step, const SimulatorUpdate &sim_update, const TransFunc &updateTrans, bool &commit_wellstate)
+

Convey dynamic updates triggered by an action block back to the running simulator.

+

This function is run after applyAction has been completed in the Schedule implementation. The sim_update argument should have members & flags for the simulator properties which need to be updated. This functionality is probably not complete.

+
+
Parameters:
+
    +
  • report_step[in] Zero-based report step index.

  • +
  • sim_update[in] Action’s resulting simulator update.

  • +
  • updateTrans[in] Call-back for affecting transmissibility updates. Typically invoked if the action triggers a keyword like MULTZ.

  • +
  • commit_wellstate[out] Whether or not the action affected any simulation wells which, in turn, may require rebuilding internal data structures in the simulator and therefore would require preserving the dynamic well and group states prior to doing so.

  • +
+
+
+
+ +
+
+

Private Members

+
+
+EclipseState &ecl_state_
+

Static properties such as permeability and transmissibility.

+
+ +
+
+Schedule &schedule_
+

Dynamic objects such as wells.

+
+ +
+
+Action::State &actionState_
+

Dynamic state for all actions&#8212;e.g., their run count.

+
+ +
+
+SummaryState &summaryState_
+

Dynamic state for all user-defined quantities.

+
+ +
+
+BlackoilWellModelGeneric<Scalar> &wellModel_
+

Simulation wells on this rank.

+
+ +
+
+Parallel::Communication comm_
+

MPI communicator object linking all simulation ranks.

+
+ +
+
+ +
+
+struct ActionParsingStrictness
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "normal"
+
+ +
+
+ +
+
+class AdaptiveSimulatorTimer : public Opm::SimulatorTimerInterface
+
+

Simulation timer for adaptive time stepping.

+
+

Public Functions

+
+
+AdaptiveSimulatorTimer(const boost::posix_time::ptime simulation_start_time, const double step_length, const double elapsed_time, const double last_step_taken, const int report_step, const double max_time_step = std::numeric_limits<double>::max())
+

constructor taking a simulator timer to determine start and end time

+
+
Parameters:
+
    +
  • timer – in case of sub stepping this is the outer timer

  • +
  • lastStepTaken – last suggested time step

  • +
  • maxTimeStep – maximum time step allowed

  • +
+
+
+
+ +
+
+AdaptiveSimulatorTimer &operator++()
+

advance time by currentStepLength

+
+ +
+
+inline virtual void advance() override
+

advance time by currentStepLength

+
+ +
+
+void provideTimeStepEstimate(const double dt_estimate)
+

provide and estimate for new time step size

+
+ +
+
+virtual bool initialStep() const override
+

Whether this is the first step.

+
+ +
+
+virtual int currentStepNum() const override
+
+ +
+
+virtual int reportStepNum() const override
+

return current report step

+
+ +
+
+virtual double currentStepLength() const override
+
+ +
+
+void setCurrentStepLength(double dt)
+
+ +
+
+double totalTime() const
+
+ +
+
+virtual double simulationTimeElapsed() const override
+
+ +
+
+virtual bool done() const override
+
+ +
+
+double averageStepLength() const
+

return average step length used so far

+
+ +
+
+double maxStepLength() const
+

return max step length used so far

+
+ +
+
+double minStepLength() const
+

return min step length used so far

+
+ +
+
+virtual double stepLengthTaken() const override
+

Previous step length. This is the length of the step that was taken to arrive at this time.

+
+ +
+
+void report(std::ostream &os) const
+

report start and end time as well as used steps so far

+
+ +
+
+virtual boost::posix_time::ptime startDateTime() const override
+

start date time of simulation

+
+ +
+
+inline virtual bool lastStepFailed() const override
+

Return true if last time step failed.

+
+ +
+
+inline void setLastStepFailed(bool last_step_failed)
+

tell the timestepper whether timestep failed or not

+
+ +
+
+virtual std::unique_ptr<SimulatorTimerInterface> clone() const override
+

return copy of object

+
+ +
+
+

Protected Attributes

+
+
+std::shared_ptr<boost::posix_time::ptime> start_date_time_
+
+ +
+
+const double start_time_
+
+ +
+
+const double total_time_
+
+ +
+
+const int report_step_
+
+ +
+
+const double max_time_step_
+
+ +
+
+double current_time_
+
+ +
+
+double dt_
+
+ +
+
+int current_step_
+
+ +
+
+std::vector<double> steps_
+
+ +
+
+bool last_step_failed_
+
+ +
+
+ +
+
+template<class TypeTag>
class AdaptiveTimeStepping
+
+
+

Public Types

+
+
+using TuningUpdateCallback = std::function<bool(const double, const double, const int)>
+
+ +
+
+

Public Functions

+
+
+AdaptiveTimeStepping() = default
+
+ +
+
+AdaptiveTimeStepping(const UnitSystem &unitSystem, const SimulatorReport &full_report, const double max_next_tstep = -1.0, const bool terminalOutput = true)
+

contructor taking parameter object

+
+ +
+
+AdaptiveTimeStepping(double max_next_tstep, const Tuning &tuning, const UnitSystem &unitSystem, const SimulatorReport &full_report, const bool terminalOutput = true)
+

contructor

+
+
Parameters:
+

tuning – Pointer to ecl TUNING keyword

+
+
+
+ +
+
+bool operator==(const AdaptiveTimeStepping<TypeTag> &rhs)
+
+ +
+
+void setSuggestedNextStep(const double x)
+
+ +
+
+double suggestedNextStep() const
+
+ +
+
+const TimeStepControlInterface &timeStepControl() const
+
+ +
+
+template<class Solver>
SimulatorReport step(const SimulatorTimer &simulator_timer, Solver &solver, const bool is_event, const TuningUpdateCallback &tuning_updater)
+

step method that acts like the solver::step method in a sub cycle of time steps

+
+
Parameters:
+

tuningUpdater – Function used to update TUNING parameters before each time step. ACTIONX might change tuning.

+
+
+
+ +
+
+void updateTUNING(double max_next_tstep, const Tuning &tuning)
+
+ +
+
+void updateNEXTSTEP(double max_next_tstep)
+
+ +
+
+template<class Serializer>
void serializeOp(Serializer &serializer)
+
+ +
+
+SimulatorReport &report()
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+
+ +
+
+static AdaptiveTimeStepping<TypeTag> serializationTestObjectHardcoded()
+
+ +
+
+static AdaptiveTimeStepping<TypeTag> serializationTestObjectPID()
+
+ +
+
+static AdaptiveTimeStepping<TypeTag> serializationTestObjectPIDIt()
+
+ +
+
+static AdaptiveTimeStepping<TypeTag> serializationTestObjectSimple()
+
+ +
+
+static AdaptiveTimeStepping<TypeTag> serializationTestObject3rdOrder()
+
+ +
+
+

Protected Types

+
+
+using TimeStepController = std::unique_ptr<TimeStepControlInterface>
+
+ +
+
+

Protected Functions

+
+
+void init_(const UnitSystem &unitSystem)
+
+ +
+
+

Protected Attributes

+
+
+TimeStepControlType time_step_control_type_ = {TimeStepControlType::PIDAndIterationCount}
+

type of time step control object

+
+ +
+
+TimeStepController time_step_control_ = {}
+

time step control object

+
+ +
+
+double restart_factor_ = {}
+

factor to multiply time step with when solver fails to converge

+
+ +
+
+double growth_factor_ = {}
+

factor to multiply time step when solver recovered from failed convergence

+
+ +
+
+double max_growth_ = {}
+

factor that limits the maximum growth of a time step

+
+ +
+
+double max_time_step_ = {}
+

maximal allowed time step size in days

+
+ +
+
+double min_time_step_ = {}
+

minimal allowed time step size before throwing

+
+ +
+
+bool ignore_convergence_failure_ = {false}
+

continue instead of stop when minimum time step is reached

+
+ +
+
+int solver_restart_max_ = {}
+

how many restart of solver are allowed

+
+ +
+
+bool solver_verbose_ = {false}
+

solver verbosity

+
+ +
+
+bool timestep_verbose_ = {false}
+

timestep verbosity

+
+ +
+
+double suggested_next_timestep_ = {}
+

suggested size of next timestep

+
+ +
+
+bool full_timestep_initially_ = {false}
+

beginning with the size of the time step from data file

+
+ +
+
+double timestep_after_event_ = {}
+

suggested size of timestep after an event

+
+ +
+
+bool use_newton_iteration_ = {false}
+

use newton iteration count for adaptive time step control

+
+ +
+
+double min_time_step_before_shutting_problematic_wells_ = {}
+

< shut problematic wells when time step size in days are less than this

+
+ +
+
+SimulatorReport report_ = {}
+
+ +
+
+

Private Types

+
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+

Private Functions

+
+
+void maybeModifySuggestedTimeStepAtBeginningOfReportStep_(const double original_time_step, const bool is_event)
+
+ +
+
+template<class T, class Serializer>
void allocAndSerialize(Serializer &serializer)
+
+ +
+
+template<class T>
bool castAndComp(const AdaptiveTimeStepping<TypeTag> &Rhs) const
+
+ +
+
+

Private Static Functions

+
+
+template<class Controller>
static AdaptiveTimeStepping<TypeTag> serializationTestObject_()
+
+ +
+
+ +
+
+struct AddCorners
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<typename T>
class allow_values
+
+
+

Public Functions

+
+
+inline allow_values(const std::initializer_list<T> &allowed_values)
+
+ +
+
+inline bool operator()(const T &value) const
+
+ +
+
+

Private Members

+
+
+std::vector<T> m_allowed_values
+
+ +
+
+ +
+
+struct AllowDistributedWells
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct AllowSplittingInactiveWells
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class Scalar>
class ALQState
+
+#include <ALQState.hpp>
+
+

Public Functions

+
+
+std::size_t pack_size() const
+
+ +
+
+std::size_t unpack_data(const Scalar *data)
+
+ +
+
+std::size_t pack_data(Scalar *data) const
+
+ +
+
+Scalar get(const std::string &wname) const
+
+ +
+
+void update_default(const std::string &wname, Scalar value)
+
+ +
+
+void insert(const std::string &wname)
+
+ +
+
+void set(const std::string &wname, Scalar value)
+
+ +
+
+bool oscillation(const std::string &wname) const
+
+ +
+
+void update_count(const std::string &wname, bool increase)
+
+ +
+
+void reset_count()
+
+ +
+
+int get_increment_count(const std::string &wname) const
+
+ +
+
+int get_decrement_count(const std::string &wname) const
+
+ +
+
+void set_debug_counter(int value)
+
+ +
+
+int get_debug_counter()
+
+ +
+
+int update_debug_counter()
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const ALQState&) const
+
+ +
+
+

Public Static Functions

+
+
+static ALQState serializationTestObject()
+
+ +
+
+

Private Members

+
+
+std::map<std::string, Scalar> current_alq_
+
+ +
+
+std::map<std::string, Scalar> default_alq_
+
+ +
+
+std::map<std::string, int> alq_increase_count_
+
+ +
+
+std::map<std::string, int> alq_decrease_count_
+
+ +
+
+int debug_counter_ = 0
+
+ +
+
+ +
+
+struct AlternativeWellRateInit
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class TypeTag>
class AluGridVanguard : public Opm::FlowBaseVanguard<TypeTag>
+
+#include <AluGridVanguard.hpp>
+

Helper class for grid instantiation of ECL file-format using problems.

+

This class uses Dune::ALUGrid as the simulation grid.

+
+

Public Types

+
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using EquilGrid = GetPropType<TypeTag, Properties::EquilGrid>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using CartesianIndexMapper = Dune::CartesianIndexMapper<Grid>
+
+ +
+
+using LevelCartesianIndexMapper = Opm::LevelCartesianIndexMapper<Grid>
+
+ +
+
+using EquilCartesianIndexMapper = Dune::CartesianIndexMapper<EquilGrid>
+
+ +
+
+using TransmissibilityType = Transmissibility<Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar>
+
+ +
+
+using Factory = Dune::FromToGridFactory<Grid>
+
+ +
+
+

Public Functions

+
+
+inline explicit AluGridVanguard(Simulator &simulator)
+
+ +
+
+inline Grid &grid()
+

Return a reference to the simulation grid.

+
+ +
+
+inline const Grid &grid() const
+

Return a reference to the simulation grid.

+
+ +
+
+inline const EquilGrid &equilGrid() const
+

Returns a refefence to the grid which should be used by the EQUIL initialization code.

+

The EQUIL keyword is used to specify the initial condition of the reservoir in hydrostatic equilibrium. Since the code which does this is not accepting arbitrary DUNE grids (the code is part of the opm-core module), this is not necessarily the same as the grid which is used for the actual simulation.

+
+ +
+
+inline void releaseEquilGrid()
+

Indicates that the initial condition has been computed and the memory used by the EQUIL grid can be released.

+

Depending on the implementation, subsequent accesses to the EQUIL grid lead to crashes.

+
+ +
+
+inline void loadBalance()
+

Distribute the simulation grid over multiple processes.

+

(For parallel simulation runs.)

+
+ +
+
+inline void addLgrs()
+
+ +
+
+template<class DataHandle>
inline void scatterData(DataHandle&) const
+
+ +
+
+template<class DataHandle>
inline void gatherData(DataHandle&) const
+
+ +
+
+template<class DataHandle, class InterfaceType, class CommunicationDirection>
inline void communicate(DataHandle&, InterfaceType, CommunicationDirection) const
+
+ +
+
+inline void releaseGlobalTransmissibilities()
+

Free the memory occupied by the global transmissibility object.

+

After writing the initial solution, this array should not be necessary anymore.

+
+ +
+
+inline const CartesianIndexMapper &cartesianIndexMapper() const
+

Returns the object which maps a global element index of the simulation grid to the corresponding element index of the logically Cartesian index.

+
+ +
+
+inline const LevelCartesianIndexMapper levelCartesianIndexMapper() const
+

Returns the object which maps a global element index of the simulation grid to the corresponding element index of the level logically Cartesian index. No refinement is supported for AluGrid so it coincides with CartesianIndexMapper.

+
+ +
+
+inline const EquilCartesianIndexMapper &equilCartesianIndexMapper() const
+

Returns mapper from compressed to cartesian indices for the EQUIL grid.

+
+ +
+
+inline std::function<std::array<double, dimensionworld>(int)> cellCentroids() const
+

Get function to query cell centroids for a distributed grid.

+

Currently this only non-empty for a loadbalanced CpGrid. It is a function return the centroid for the given element index.

+
+ +
+
+inline const TransmissibilityType &globalTransmissibility() const
+
+ +
+
+inline const std::vector<int> &globalCell()
+
+ +
+
+inline std::vector<int> cellPartition() const
+
+ +
+
+inline unsigned int gridEquilIdxToGridIdx(unsigned int elemIndex) const
+
+ +
+
+inline unsigned int gridIdxToEquilGridIdx(unsigned int elemIndex) const
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int dimension = Grid::dimension
+
+ +
+
+static constexpr int dimensionworld = Grid::dimensionworld
+
+ +
+
+

Protected Functions

+
+
+inline void createGrids_()
+
+ +
+
+inline void filterConnections_()
+
+ +
+
+

Protected Attributes

+
+
+std::unique_ptr<Grid> grid_
+
+ +
+
+std::unique_ptr<EquilGrid> equilGrid_
+
+ +
+
+std::vector<int> cartesianCellId_
+
+ +
+
+std::vector<unsigned int> ordering_
+
+ +
+
+std::vector<unsigned int> equilGridToGrid_
+
+ +
+
+std::array<int, dimension> cartesianDimension_
+
+ +
+
+std::unique_ptr<CartesianIndexMapper> cartesianIndexMapper_
+
+ +
+
+std::unique_ptr<EquilCartesianIndexMapper> equilCartesianIndexMapper_
+
+ +
+
+std::unique_ptr<Factory> factory_
+
+ +
+
+std::unique_ptr<TransmissibilityType> globalTrans_
+
+ +
+
+int mpiRank
+
+ +
+
+

Private Types

+
+
+using ParentType = FlowBaseVanguard<TypeTag>
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+

Friends

+
+
+friend class FlowBaseVanguard< TypeTag >
+
+ +
+
+ +
+
+struct AluGridVanguard
+
+#include <AluGridVanguard.hpp>
+
+

Public Types

+
+
+using InheritsFrom = std::tuple<FlowBaseVanguard>
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class amgclSolverBackend : public Opm::Accelerator::GpuSolver<Scalar, block_size>
+
+

This class does not implement a solver, but converts the BCSR format to normal CSR and uses amgcl for solving Note amgcl also implements blocked solvers, but looks like it needs unblocked input data

+
+

Public Functions

+
+
+amgclSolverBackend(int linear_solver_verbosity, int maxit, Scalar tolerance, unsigned int platformID, unsigned int deviceID)
+

Construct an amgcl solver

+
+
Parameters:
+
    +
  • linear_solver_verbosity[in] verbosity of amgclSolver

  • +
  • maxit[in] maximum number of iterations for amgclSolver

  • +
  • tolerance[in] required relative tolerance for amgclSolver

  • +
  • platformID[in] the OpenCL platform to be used

  • +
  • deviceID[in] the device to be used

  • +
+
+
+
+ +
+
+~amgclSolverBackend() override
+

Destroy a openclSolver, and free memory.

+
+ +
+
+virtual SolverStatus solve_system(std::shared_ptr<BlockedMatrix<Scalar>> matrix, Scalar *b, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix, WellContributions<Scalar> &wellContribs, GpuResult &res) override
+

Solve linear system, A*x = b, matrix A must be in blocked-CSR format

+
+
Parameters:
+
    +
  • matrix[in] matrix A

  • +
  • b[in] input vector, contains N values

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
  • wellContribs[in] WellContributions, to apply them separately, instead of adding them to matrix A

  • +
  • res[inout] summary of solver result

  • +
+
+
Returns:
+

status code

+
+
+
+ +
+
+virtual void get_result(Scalar *x) override
+

Get result after linear solve, and peform postprocessing if necessary

+
+
Parameters:
+

x[inout] resulting x vector, caller must guarantee that x points to a valid array

+
+
+
+ +
+
+

Private Types

+
+
+enum Amgcl_backend_type
+

Values:

+
+
+enumerator cpu
+
+ +
+
+enumerator cuda
+
+ +
+
+enumerator vexcl
+
+ +
+ +
+
+using Base = GpuSolver<Scalar, block_size>
+
+ +
+
+using dmat_type = amgcl::static_matrix<Scalar, block_size, block_size>
+
+ +
+
+using dvec_type = amgcl::static_matrix<Scalar, block_size, 1>
+
+ +
+
+using CPU_Backend = std::conditional_t<block_size == 1, amgcl::backend::builtin<Scalar>, amgcl::backend::builtin<dmat_type>>
+
+ +
+
+using CPU_Solver = amgcl::make_solver<amgcl::runtime::preconditioner<CPU_Backend>, amgcl::runtime::solver::wrapper<CPU_Backend>>
+
+ +
+
+

Private Functions

+
+
+void initialize(int Nb, int nnzbs)
+

Initialize host memory and determine amgcl parameters

+
+
Parameters:
+
    +
  • Nb[in] number of blockrows

  • +
  • nnzbs[in] number of blocks

  • +
+
+
+
+ +
+
+void convert_sparsity_pattern(const int *rows, const int *cols)
+

Convert the BCSR sparsity pattern to a CSR one

+
+
Parameters:
+
    +
  • rows[in] array of rowPointers, contains N/dim+1 values

  • +
  • cols[in] array of columnIndices, contains nnz values

  • +
+
+
+
+ +
+
+void convert_data(const Scalar *vals, const int *rows)
+

Convert the BCSR nonzero data to a CSR format

+
+
Parameters:
+
    +
  • vals[in] array of nonzeroes, each block is stored row-wise and contiguous, contains nnz values

  • +
  • rows[in] array of rowPointers, contains N/dim+1 values

  • +
+
+
+
+ +
+
+void solve_system(Scalar *b, GpuResult &res)
+

Solve linear system

+
+
Parameters:
+
    +
  • b[in] pointer to b vector

  • +
  • res[inout] summary of solver result

  • +
+
+
+
+ +
+
+

Private Members

+
+
+std::vector<unsigned> A_rows
+
+ +
+
+std::vector<unsigned> A_cols
+
+ +
+
+std::vector<Scalar> A_vals
+
+ +
+
+std::vector<Scalar> rhs
+
+ +
+
+std::vector<Scalar> x
+
+ +
+
+std::once_flag print_info
+
+ +
+
+Amgcl_backend_type backend_type = cpu
+
+ +
+
+boost::property_tree::ptree prm
+
+ +
+
+int iters = 0
+
+ +
+
+Scalar error = 0.0
+
+ +
+
+int N
+
+ +
+
+int Nb
+
+ +
+
+int nnz
+
+ +
+
+int nnzb
+
+ +
+
+int verbosity
+
+ +
+
+unsigned int platformID
+
+ +
+
+unsigned int deviceID
+
+ +
+
+int maxit
+
+ +
+
+Scalar tolerance
+
+ +
+
+bool initialized
+
+ +
+
+ +
+
+template<class Operator, class Comm, class Matrix, class Vector>
struct AMGHelper
+
+
+

Public Types

+
+
+using PrecPtr = std::shared_ptr<Dune::PreconditionerWithUpdate<Vector, Vector>>
+
+ +
+
+using CriterionBase = Dune::Amg::AggregationCriterion<Dune::Amg::SymmetricDependency<Matrix, Dune::Amg::FirstDiagonal>>
+
+ +
+
+using Criterion = Dune::Amg::CoarsenCriterion<CriterionBase>
+
+ +
+
+

Public Static Functions

+
+
+static Criterion criterion(const PropertyTree &prm)
+
+ +
+
+template<class Smoother>
static PrecPtr makeAmgPreconditioner(const Operator &op, const PropertyTree &prm, bool useKamg = false)
+
+ +
+
+ +
+
+template<class Smoother>
struct AMGSmootherArgsHelper
+
+
+

Public Static Functions

+
+
+static inline auto args(const PropertyTree &prm)
+
+ +
+
+ +
+
+template<class M, class V, class C>
struct AMGSmootherArgsHelper<ParallelOverlappingILU0<M, V, V, C>>
+
+
+

Public Static Functions

+
+
+static inline auto args(const PropertyTree &prm)
+
+ +
+
+ +
+
+struct AmgxConfig
+
+

Configuration structure for AMGX parameters.

+

This structure holds the configuration parameters for the AMGX solver.

+
+

Public Functions

+
+
+inline explicit AmgxConfig(const Opm::PropertyTree &prm)
+
+ +
+
+inline std::string toString() const
+
+ +
+
+

Public Members

+
+
+int determinism_flag = 0
+
+ +
+
+int print_grid_stats = 0
+
+ +
+
+int print_solve_stats = 0
+
+ +
+
+std::string solver = "AMG"
+
+ +
+
+std::string algorithm = "CLASSICAL"
+
+ +
+
+std::string interpolator = "D2"
+
+ +
+
+std::string selector = "PMIS"
+
+ +
+
+std::string smoother = "BLOCK_JACOBI"
+
+ +
+
+int presweeps = 3
+
+ +
+
+int postsweeps = 3
+
+ +
+
+double strength_threshold = 0.5
+
+ +
+
+int max_iters = 1
+
+ +
+
+ +
+
+template<class M, class X, class Y>
class AmgxPreconditioner : public Dune::PreconditionerWithUpdate<X, Y>
+
+

Wrapper for AMGX’s AMG preconditioner.

+

This class provides an interface to the AMG preconditioner from the AMGX library. It is designed to work with matrices, update vectors, and defect vectors specified by the template parameters.

+
+
Template Parameters:
+
    +
  • M – The matrix type the preconditioner is for.

  • +
  • X – The type of the update vector.

  • +
  • Y – The type of the defect vector.

  • +
+
+
+
+

Public Types

+
+
+using matrix_type = M
+

The matrix type the preconditioner is for.

+
+ +
+
+using matrix_field_type = typename M::field_type
+

The field type of the matrix.

+
+ +
+
+using domain_type = X
+

The domain type of the preconditioner.

+
+ +
+
+using range_type = Y
+

The range type of the preconditioner.

+
+ +
+
+using vector_field_type = typename X::field_type
+

The field type of the vectors.

+
+ +
+
+

Public Functions

+
+
+inline AmgxPreconditioner(const M &A, const Opm::PropertyTree prm)
+

Constructor for the AmgxPreconditioner class.

+

Initializes the preconditioner with the given matrix and property tree.

+
+
Parameters:
+
    +
  • A – The matrix for which the preconditioner is constructed.

  • +
  • prm – The property tree containing configuration parameters.

  • +
+
+
+
+ +
+
+inline ~AmgxPreconditioner()
+

Destructor for the AmgxPreconditioner class.

+

Cleans up resources allocated by the preconditioner.

+
+ +
+
+inline void pre(X&, Y&) override
+

Pre-processing step before applying the preconditioner.

+

This method is currently a no-op.

+
+
Parameters:
+
    +
  • v – The update vector.

  • +
  • d – The defect vector.

  • +
+
+
+
+ +
+
+inline void apply(X &v, const Y &d) override
+

Applies the preconditioner to a vector.

+

Performs one AMG cycle to solve the system. Involves uploading vectors to AMGX, applying the preconditioner, and downloading the result.

+
+
Parameters:
+
    +
  • v – The update vector.

  • +
  • d – The defect vector.

  • +
+
+
+
+ +
+
+inline void post(X&) override
+

Post-processing step after applying the preconditioner.

+

This method is currently a no-op.

+
+
Parameters:
+

v – The update vector.

+
+
+
+ +
+
+inline virtual void update() override
+

Updates the preconditioner with the current matrix values.

+

This method should be called whenever the matrix values change.

+
+ +
+
+inline Dune::SolverCategory::Category category() const override
+

Returns the solver category.

+
+
Returns:
+

The solver category, which is sequential.

+
+
+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+

Checks if the preconditioner has a perfect update.

+
+
Returns:
+

True, indicating that the preconditioner can be perfectly updated.

+
+
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int block_size = 1
+
+ +
+
+

Private Functions

+
+
+inline void setupSparsityPattern(std::vector<int> &row_ptrs, std::vector<int> &col_indices)
+

Sets up the sparsity pattern for the AMGX matrix.

+

This method initializes the row pointers and column indices for the AMGX matrix.

+
+
Parameters:
+
    +
  • row_ptrs – The row pointers for the AMGX matrix.

  • +
  • col_indices – The column indices for the AMGX matrix.

  • +
+
+
+
+ +
+
+inline void copyMatrixToAmgx()
+

Copies the matrix values to the AMGX matrix.

+

This method updates the AMGX matrix with the current matrix values. The method assumes that the sparsity structure is the same and that the values are stored in a contiguous array.

+
+ +
+
+

Private Members

+
+
+const M &A_
+

The matrix for which the preconditioner is constructed.

+
+ +
+
+const int N_
+

Number of rows in the matrix.

+
+ +
+
+const int nnz_
+

Number of non-zero elements in the matrix.

+
+ +
+
+int setup_frequency_ = -1
+

Frequency of updating the AMG hierarchy.

+
+ +
+
+int update_counter_ = 0
+

Counter for setup updates.

+
+ +
+
+AMGX_config_handle cfg_ = nullptr
+

The AMGX configuration handle.

+
+ +
+
+AMGX_resources_handle rsrc_ = nullptr
+

The AMGX resources handle.

+
+ +
+
+AMGX_solver_handle solver_ = nullptr
+

The AMGX solver handle.

+
+ +
+
+AMGX_matrix_handle A_amgx_ = nullptr
+

The AMGX matrix handle.

+
+ +
+
+AMGX_vector_handle x_amgx_ = nullptr
+

The AMGX solution vector handle.

+
+ +
+
+AMGX_vector_handle b_amgx_ = nullptr
+

The AMGX right-hand side vector handle.

+
+ +
+
+ +
+
+template<typename TypeTag>
class AquiferAnalytical : public Opm::AquiferInterface<TypeTag>
+
+

Subclassed by Opm::AquiferCarterTracy< TypeTag >, Opm::AquiferFetkovich< TypeTag >

+
+

Public Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableTemperature
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableEnergy
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableBrine
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableVapwat
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator has_disgas_in_water
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableSaltPrecipitation
+
+ +
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using BlackoilIndices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+using Eval = DenseAd::Evaluation<Scalar, numEq>
+
+ +
+
+using FluidState = BlackOilFluidState<Eval, FluidSystem, enableTemperature, enableEnergy, BlackoilIndices::gasEnabled, enableVapwat, enableBrine, enableSaltPrecipitation, has_disgas_in_water, BlackoilIndices::numPhases>
+
+ +
+
+

Public Functions

+
+
+inline AquiferAnalytical(const int aqID, const std::vector<Aquancon::AquancCell> &connections, const Simulator &simulator)
+
+ +
+
+inline void computeFaceAreaFraction(const std::vector<Scalar> &total_face_area) override
+
+ +
+
+inline virtual Scalar totalFaceArea() const override
+
+ +
+
+inline virtual void initFromRestart(const data::Aquifers &aquiferSoln) override
+
+ +
+
+inline virtual void initialSolutionApplied() override
+
+ +
+
+inline virtual void beginTimeStep() override
+
+ +
+
+inline virtual void addToSource(RateVector &rates, const unsigned cellIdx, const unsigned timeIdx) override
+
+ +
+
+inline std::size_t size() const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline bool operator==(const AquiferAnalytical &rhs) const
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numEq = BlackoilIndices::numEq
+
+ +
+
+

Protected Functions

+
+
+virtual void assignRestartData(const data::AquiferData &xaq) = 0
+
+ +
+
+virtual void calculateInflowRate(int idx, const Simulator &simulator) = 0
+
+ +
+
+virtual void calculateAquiferCondition() = 0
+
+ +
+
+virtual void calculateAquiferConstants() = 0
+
+ +
+
+virtual Scalar aquiferDepth() const = 0
+
+ +
+
+inline Scalar gravity_() const
+
+ +
+
+inline int compIdx_() const
+
+ +
+
+inline void initQuantities()
+
+ +
+
+inline void updateCellPressure(std::vector<Eval> &pressure_water, const int idx, const IntensiveQuantities &intQuants)
+
+ +
+
+inline void updateCellPressure(std::vector<Scalar> &pressure_water, const int idx, const IntensiveQuantities &intQuants)
+
+ +
+
+inline void initializeConnectionMappings()
+
+ +
+
+inline void initializeConnectionDepths()
+
+ +
+
+inline Scalar calculateReservoirEquilibrium()
+
+ +
+
+

Protected Attributes

+
+
+const std::vector<Aquancon::AquancCell> connections_
+
+ +
+
+std::vector<Scalar> faceArea_connected_
+
+ +
+
+std::vector<int> cellToConnectionIdx_
+
+ +
+
+std::vector<Scalar> cell_depth_
+
+ +
+
+std::vector<Scalar> pressure_previous_
+
+ +
+
+std::vector<Eval> pressure_current_
+
+ +
+
+std::vector<Eval> Qai_
+
+ +
+
+std::vector<Scalar> alphai_
+
+ +
+
+Scalar Tc_ = {}
+
+ +
+
+Scalar pa0_ = {}
+
+ +
+
+std::optional<Scalar> Ta0_ = {}
+
+ +
+
+Scalar rhow_ = {}
+
+ +
+
+Scalar total_face_area_ = {}
+
+ +
+
+Scalar area_fraction_ = {Scalar{1}}
+
+ +
+
+Eval W_flux_
+
+ +
+
+bool solution_set_from_restart_ = {false}
+
+ +
+
+bool has_active_connection_on_proc_ = {false}
+
+ +
+
+ +
+
+template<typename TypeTag>
class AquiferCarterTracy : public Opm::AquiferAnalytical<TypeTag>
+
+
+

Public Types

+
+
+using Base = AquiferAnalytical<TypeTag>
+
+ +
+
+using BlackoilIndices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using Eval = DenseAd::Evaluation<Scalar, numEq>
+
+ +
+
+using FluidState = BlackOilFluidState<Eval, FluidSystem, enableTemperature, enableEnergy, BlackoilIndices::gasEnabled, enableVapwat, enableBrine, enableSaltPrecipitation, has_disgas_in_water, BlackoilIndices::numPhases>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+

Public Functions

+
+
+inline AquiferCarterTracy(const std::vector<Aquancon::AquancCell> &connections, const Simulator &simulator, const AquiferCT::AQUCT_data &aquct_data)
+
+ +
+
+inline virtual void endTimeStep() override
+
+ +
+
+inline virtual data::AquiferData aquiferData() const override
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline bool operator==(const AquiferCarterTracy &rhs) const
+
+ +
+
+

Public Static Functions

+
+
+static inline AquiferCarterTracy serializationTestObject(const Simulator &simulator)
+
+ +
+
+

Protected Functions

+
+
+inline virtual void assignRestartData(const data::AquiferData &xaq) override
+
+ +
+
+inline std::pair<Scalar, Scalar> getInfluenceTableValues(const Scalar td_plus_dt)
+
+ +
+
+inline Scalar dpai(const int idx) const
+
+ +
+
+inline std::pair<Scalar, Scalar> calculateEqnConstants(const int idx, const Simulator &simulator)
+
+ +
+
+inline std::size_t pvtRegionIdx() const
+
+ +
+
+inline virtual void calculateInflowRate(int idx, const Simulator &simulator) override
+
+ +
+
+inline virtual void calculateAquiferConstants() override
+
+ +
+
+inline virtual void calculateAquiferCondition() override
+
+ +
+
+inline virtual Scalar aquiferDepth() const override
+
+ +
+
+

Protected Attributes

+
+
+AquiferCT::AQUCT_data aquct_data_
+
+ +
+
+Scalar beta_
+
+ +
+
+Scalar fluxValue_ = {0}
+
+ +
+
+Scalar dimensionless_time_ = {0}
+
+ +
+
+Scalar dimensionless_pressure_ = {0}
+
+ +
+
+

Private Functions

+
+
+inline Scalar timeConstantCO2Store() const
+
+ +
+
+inline Scalar waterDensityCO2Store() const
+
+ +
+
+inline Scalar reservoirTemperatureCO2Store() const
+
+ +
+
+ +
+
+template<typename TypeTag>
class AquiferConstantFlux : public Opm::AquiferInterface<TypeTag>
+
+
+

Public Types

+
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using BlackoilIndices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Eval = DenseAd::Evaluation<Scalar, numEq>
+
+ +
+
+

Public Functions

+
+
+inline AquiferConstantFlux(const std::vector<Aquancon::AquancCell> &connections, const Simulator &simulator, const SingleAquiferFlux &aquifer)
+
+ +
+
+inline virtual void computeFaceAreaFraction(const std::vector<Scalar> &total_face_area) override
+
+ +
+
+inline virtual Scalar totalFaceArea() const override
+
+ +
+
+inline void updateAquifer(const SingleAquiferFlux &aquifer)
+
+ +
+
+inline virtual void initFromRestart(const data::Aquifers &aquiferSoln) override
+
+ +
+
+inline virtual void initialSolutionApplied() override
+
+ +
+
+inline virtual void beginTimeStep() override
+
+ +
+
+inline virtual void endTimeStep() override
+
+ +
+
+inline virtual data::AquiferData aquiferData() const override
+
+ +
+
+inline virtual void addToSource(RateVector &rates, const unsigned cellIdx, const unsigned timeIdx) override
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline bool operator==(const AquiferConstantFlux &rhs) const
+
+ +
+
+

Public Static Functions

+
+
+static inline AquiferConstantFlux serializationTestObject(const Simulator &simulator)
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numEq = BlackoilIndices::numEq
+
+ +
+
+

Private Functions

+
+
+inline Scalar initializeConnections()
+
+ +
+
+inline Scalar computeFaceAreaFraction(const Scalar connected_face_area) const
+
+ +
+
+inline int compIdx_() const
+
+ +
+
+inline Scalar totalFluxRate() const
+
+ +
+
+

Private Members

+
+
+const std::vector<Aquancon::AquancCell> &connections_
+
+ +
+
+SingleAquiferFlux aquifer_data_
+
+ +
+
+std::vector<Eval> connection_flux_ = {}
+
+ +
+
+std::vector<int> cellToConnectionIdx_ = {}
+
+ +
+
+Scalar flux_rate_ = {}
+
+ +
+
+Scalar cumulative_flux_ = {}
+
+ +
+
+Scalar total_face_area_ = {0.0}
+
+ +
+
+Scalar area_fraction_ = {1.0}
+
+ +
+
+ +
+
+template<typename TypeTag>
class AquiferFetkovich : public Opm::AquiferAnalytical<TypeTag>
+
+
+

Public Types

+
+
+using Base = AquiferAnalytical<TypeTag>
+
+ +
+
+using BlackoilIndices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using Eval = DenseAd::Evaluation<Scalar, numEq>
+
+ +
+
+using FluidState = BlackOilFluidState<Eval, FluidSystem, enableTemperature, enableEnergy, BlackoilIndices::gasEnabled, enableVapwat, enableBrine, enableSaltPrecipitation, has_disgas_in_water, BlackoilIndices::numPhases>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+

Public Functions

+
+
+inline AquiferFetkovich(const std::vector<Aquancon::AquancCell> &connections, const Simulator &simulator, const Aquifetp::AQUFETP_data &aqufetp_data)
+
+ +
+
+inline virtual void endTimeStep() override
+
+ +
+
+inline virtual data::AquiferData aquiferData() const override
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline bool operator==(const AquiferFetkovich &rhs) const
+
+ +
+
+

Public Static Functions

+
+
+static inline AquiferFetkovich serializationTestObject(const Simulator &simulator)
+
+ +
+
+

Protected Functions

+
+
+inline virtual void assignRestartData(const data::AquiferData &xaq) override
+
+ +
+
+inline Eval dpai(int idx)
+
+ +
+
+inline Scalar aquiferPressure()
+
+ +
+
+inline virtual void calculateAquiferConstants() override
+
+ +
+
+inline virtual void calculateInflowRate(int idx, const Simulator &simulator) override
+
+ +
+
+inline virtual void calculateAquiferCondition() override
+
+ +
+
+inline virtual Scalar aquiferDepth() const override
+
+ +
+
+

Protected Attributes

+
+
+Aquifetp::AQUFETP_data aqufetp_data_
+
+ +
+
+Scalar aquifer_pressure_
+
+ +
+
+ +
+
+template<typename TypeTag>
class AquiferInterface
+
+

Subclassed by Opm::AquiferAnalytical< TypeTag >, Opm::AquiferConstantFlux< TypeTag >, Opm::AquiferNumerical< TypeTag >

+
+

Public Types

+
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+

Public Functions

+
+
+inline AquiferInterface(int aqID, const Simulator &simulator)
+
+ +
+
+virtual ~AquiferInterface() = default
+
+ +
+
+virtual void initFromRestart(const data::Aquifers &aquiferSoln) = 0
+
+ +
+
+virtual void initialSolutionApplied() = 0
+
+ +
+
+virtual void beginTimeStep() = 0
+
+ +
+
+virtual void endTimeStep() = 0
+
+ +
+
+virtual data::AquiferData aquiferData() const = 0
+
+ +
+
+virtual void computeFaceAreaFraction(const std::vector<Scalar> &total_face_area) = 0
+
+ +
+
+virtual Scalar totalFaceArea() const = 0
+
+ +
+
+template<class Context>
inline void addToSource(RateVector &rates, const Context &context, const unsigned spaceIdx, const unsigned timeIdx)
+
+ +
+
+virtual void addToSource(RateVector &rates, const unsigned cellIdx, const unsigned timeIdx) = 0
+
+ +
+
+inline int aquiferID() const
+
+ +
+
+

Protected Functions

+
+
+inline bool co2store_or_h2store_() const
+
+ +
+
+inline int phaseIdx_() const
+
+ +
+
+

Protected Attributes

+
+
+const int aquiferID_ = {}
+
+ +
+
+const Simulator &simulator_
+
+ +
+
+ +
+
+template<class TypeTag, class MyTypeTag>
struct AquiferModel
+
+
+

Public Types

+
+
+using type = UndefinedProperty
+
+ +
+
+ +
+
+template<class TypeTag>
struct AquiferModel<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Types

+
+
+using type = BaseAquiferModel<TypeTag>
+
+ +
+
+ +
+
+template<class TypeTag>
struct AquiferModel<TypeTag, TTag::FlowProblem>
+
+
+

Public Types

+
+
+using type = BlackoilAquiferModel<TypeTag>
+
+ +
+
+ +
+
+template<typename TypeTag>
class AquiferNumerical : public Opm::AquiferInterface<TypeTag>
+
+
+

Public Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator dimWorld
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+using BlackoilIndices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using ExtensiveQuantities = GetPropType<TypeTag, Properties::ExtensiveQuantities>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Eval = DenseAd::Evaluation<Scalar, numEq>
+
+ +
+
+using Toolbox = MathToolbox<Eval>
+
+ +
+
+

Public Functions

+
+
+inline AquiferNumerical(const SingleNumericalAquifer &aquifer, const Simulator &simulator)
+
+ +
+
+inline virtual void initFromRestart(const data::Aquifers &aquiferSoln) override
+
+ +
+
+inline virtual void beginTimeStep() override
+
+ +
+
+inline virtual void addToSource(RateVector&, const unsigned, const unsigned) override
+
+ +
+
+inline virtual void endTimeStep() override
+
+ +
+
+inline virtual data::AquiferData aquiferData() const override
+
+ +
+
+inline virtual void initialSolutionApplied() override
+
+ +
+
+inline void computeFaceAreaFraction(const std::vector<Scalar>&) override
+
+ +
+
+inline virtual Scalar totalFaceArea() const override
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline bool operator==(const AquiferNumerical &rhs) const
+
+ +
+
+inline Scalar cumulativeFlux() const
+
+ +
+
+

Public Static Functions

+
+
+static inline AquiferNumerical serializationTestObject(const Simulator &simulator)
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numEq = BlackoilIndices::numEq
+
+ +
+
+

Private Functions

+
+
+inline void checkConnectsToReservoir()
+
+ +
+
+inline Scalar calculateAquiferPressure() const
+
+ +
+
+inline Scalar calculateAquiferPressure(std::vector<Scalar> &cell_pressure) const
+
+ +
+
+template<class ElemCtx>
inline Scalar getWaterFlux(const ElemCtx &elem_ctx, unsigned face_idx) const
+
+ +
+
+inline Scalar calculateAquiferFluxRate() const
+
+ +
+
+

Private Members

+
+
+Scalar flux_rate_
+
+ +
+
+Scalar cumulative_flux_
+
+ +
+
+std::vector<Scalar> init_pressure_ = {}
+
+ +
+
+Scalar pressure_
+
+ +
+
+bool solution_set_from_restart_ = {false}
+
+ +
+
+bool connects_to_reservoir_ = {false}
+
+ +
+
+std::vector<int> cell_to_aquifer_cell_idx_
+
+ +
+
+ +
+
+struct Attributes
+

Derived property attributes for each active region.

+
+

Public Functions

+
+
+inline Attributes()
+
+ +
+
+inline Attributes(const Attributes &rhs)
+
+ +
+
+inline Attributes &operator=(const Attributes &rhs)
+
+ +
+
+

Public Members

+
+
+std::array<Scalar, 8> data
+
+ +
+
+Scalar &pressure
+
+ +
+
+Scalar &temperature
+
+ +
+
+Scalar &rs
+
+ +
+
+Scalar &rv
+
+ +
+
+Scalar &rsw
+
+ +
+
+Scalar &rvw
+
+ +
+
+Scalar &pv
+
+ +
+
+Scalar &saltConcentration
+
+ +
+
+ +
+
+struct Attributes
+

Derived property attributes for each active region.

+
+

Public Functions

+
+
+inline Attributes()
+
+ +
+
+

Public Members

+
+
+Scalar pressure
+
+ +
+
+Scalar pv
+
+ +
+
+ +
+
+template<class Scalar, bool is_parallel>
struct AverageIncrementCalculator
+
+

Computes the temperature, pressure, and counter increment.

+

In a parallel run only cells owned contribute to the cell average.

+
+
Template Parameters:
+

is_parallel – Whether this is a parallel run.

+
+
+
+

Public Functions

+
+
+inline std::tuple<Scalar, Scalar, Scalar, Scalar, int> operator()(const std::vector<Scalar> &pressure, const std::vector<Scalar> &temperature, const std::vector<Scalar> &rs, const std::vector<Scalar> &rv, const std::vector<Scalar> &ownership, std::size_t cell)
+

Computes the temperature, pressure, and counter increment.

+
+
Parameters:
+
    +
  • pressure – The pressure.

  • +
  • temperature – The temperature.

  • +
  • rs – The rs.

  • +
  • rv – The rv.

  • +
  • cell – The current cell index.

  • +
  • ownership – A vector indicating whether a cell is owned by this process (value 1), or not (value 0).

  • +
  • cell – The cell index.

  • +
+
+
+
+ +
+
+ +
+
+template<class Scalar>
struct AverageIncrementCalculator<Scalar, false>
+
+
+

Public Functions

+
+
+inline std::tuple<Scalar, Scalar, Scalar, Scalar, int> operator()(const std::vector<Scalar> &pressure, const std::vector<Scalar> &temperature, const std::vector<Scalar> &rs, const std::vector<Scalar> &rv, const std::vector<Scalar>&, std::size_t cell)
+
+ +
+
+ +
+
+template<class FluidSystem, class Region>
class AverageRegionalPressure
+
+

Computes hydrocarbon weighed average pressures over regions

+
+
Template Parameters:
+
    +
  • FluidSystem – Fluid system class. Expected to be a BlackOilFluidSystem

  • +
  • Region – Type of a forward region mapping. Expected to provide indexed access through

    operator[]()
    +
    +
    + as well as inner types value_type, size_type, and const_iterator. Typically
    std::vector<int> 
    +
    +
    +.

  • +
+
+
+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+typedef RegionMapping<Region>::RegionId RegionId
+

Region identifier.

+

Integral type.

+
+ +
+
+

Public Functions

+
+
+inline AverageRegionalPressure(const PhaseUsage &phaseUsage, const Region &region)
+

Constructor.

+
+
Parameters:
+

region[in] Forward region mapping. Often corresponds to the “FIPNUM” mapping of an ECLIPSE input deck.

+
+
+
+ +
+
+template<typename ElementContext, class Simulator>
inline void defineState(const Simulator &simulator)
+

Compute pore volume averaged hydrocarbon state pressure

+
+ +
+
+inline Scalar pressure(const RegionId r) const
+

Average pressure

+
+ +
+
+

Private Members

+
+
+const PhaseUsage phaseUsage_
+

Fluid property object.

+
+ +
+
+const RegionMapping<Region> rmap_
+

“Fluid-in-place” region mapping (forward and reverse).

+
+ +
+
+RegionAttributeHelpers::RegionAttributes<RegionId, Attributes> attr_
+
+ +
+
+ +
+
+class BarrierTasklet : public Opm::TaskletInterface
+

Implements a barrier. This class can only be used in the asynchronous case.

+
+

Public Functions

+
+
+explicit BarrierTasklet(unsigned numWorkers)
+
+ +
+
+void run() override
+
+ +
+
+void wait()
+
+ +
+
+

Private Members

+
+
+unsigned numWorkers_
+
+ +
+
+unsigned numWaiting_
+
+ +
+
+std::condition_variable barrierCondition_
+
+ +
+
+std::mutex barrierMutex_
+
+ +
+
+ +
+
+template<class TypeTag>
class BaseAquiferModel
+
+

The base class which specifies the API of aquifer models.

+

This class only provides the API for the actual aquifer model, it does not do anything on its own.

+
+

Public Functions

+
+
+inline explicit BaseAquiferModel(Simulator &simulator)
+
+ +
+
+inline void initialSolutionApplied()
+

Called once the problem has been fully initialized and the initial condition has been applied.

+
+ +
+
+inline void initFromRestart(const data::Aquifers&)
+

Called if aquifers are being initialized from values retrieved from a restart file.

+
+
Parameters:
+

aquiferSoln[in] Set of aquifer-related initial values, mostly pertaining to analytic aquifers. Contains at minimum the aquifer pressure and the base run’s total produced liquid volume from the model’s aquifers.

+
+
+
+ +
+
+inline void beginEpisode()
+

This method is called when a new episode (report step) starts.

+
+ +
+
+inline void beginTimeStep()
+

This method is called when a new time step (substep) starts.

+
+ +
+
+inline void beginIteration()
+

This method is called before each Newton-Raphson iteration.

+
+ +
+
+template<class Context>
inline void addToSource(RateVector&, const Context&, unsigned, unsigned) const
+

Add the water which enters or leaves the reservoir due to aquifiers.

+
+ +
+
+inline void addToSource(RateVector&, unsigned, unsigned) const
+
+ +
+
+inline void endIteration()
+

This method is called after each Newton-Raphson successful iteration.

+

I.e., no exceptions were thrown during the linearization and linear solution procedures.

+
+ +
+
+inline void endTimeStep()
+

This method is called after each successful time step (substep).

+

I.e., all iterations of the time step were successful and the Newton-Raphson algorithm converged.

+
+ +
+
+inline void endEpisode()
+

This method is called once an episode (report step) has been finished successfully.

+
+ +
+
+template<class Restarter>
inline void serialize(Restarter&)
+

Write the internal state of the aquifer model to disk using an ad-hoc file format.

+
+ +
+
+template<class Restarter>
inline void deserialize(Restarter&)
+

Load the internal state of the aquifer model to disk using an ad-hoc file format.

+
+ +
+
+inline data::Aquifers aquiferData() const
+
+ +
+
+

Protected Attributes

+
+
+Simulator &simulator_
+
+ +
+
+

Private Types

+
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+ +
+
+template<class TypeTag>
struct BaseDiscretizationType<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Types

+
+
+using type = FvBaseDiscretizationNoAdapt<TypeTag>
+
+ +
+
+ +
+
+template<class T1, class T2, class T3>
class basic_ptree
+
+ +
+
+struct BasicRates
+
+

Subclassed by Opm::GasLiftSingleWellGeneric< Scalar >::LimitedRates

+
+

Public Functions

+
+
+inline BasicRates(const BasicRates &rates)
+
+ +
+
+inline BasicRates(Scalar oil_, Scalar gas_, Scalar water_, bool bhp_is_limited_)
+
+ +
+
+inline BasicRates &operator=(const BasicRates &rates)
+
+ +
+
+explicit BasicRates(const LimitedRates &rates)
+
+ +
+
+inline Scalar operator[](Rate rate_type) const
+
+ +
+
+

Public Members

+
+
+Scalar oil
+
+ +
+
+Scalar gas
+
+ +
+
+Scalar water
+
+ +
+
+bool bhp_is_limited
+
+ +
+
+ +
+
+template<class T>
struct BCData
+
+#include <FlowProblem.hpp>
+
+

Public Functions

+
+
+inline void resize(std::size_t size, T defVal)
+
+ +
+
+inline const std::vector<T> &operator()(FaceDir::DirEnum dir) const
+
+ +
+
+inline std::vector<T> &operator()(FaceDir::DirEnum dir)
+
+ +
+
+

Public Members

+
+
+std::array<std::vector<T>, 6> data
+
+ +
+
+ +
+
+template<class Matrix, class Vector, class Scalar>
class BiCGStab
+
+ +
+
+template<typename TypeTag>
class BlackoilAquiferModel
+
+

Class for handling the blackoil aquifer model.

+
+

Public Functions

+
+
+explicit BlackoilAquiferModel(Simulator &simulator)
+
+ +
+
+void initialSolutionApplied()
+
+ +
+
+void initFromRestart(const data::Aquifers &aquiferSoln)
+
+ +
+
+void beginEpisode()
+
+ +
+
+void beginTimeStep()
+
+ +
+
+void beginIteration()
+
+ +
+
+template<class Context>
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<class Restarter>
void serialize(Restarter &res)
+
+ +
+
+template<class Restarter>
void deserialize(Restarter &res)
+
+ +
+
+template<class Serializer>
void serializeOp(Serializer &serializer)
+
+ +
+
+

Protected Types

+
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+

Protected Functions

+
+
+void init()
+
+ +
+
+

Protected Attributes

+
+
+Simulator &simulator_
+
+ +
+
+std::vector<std::unique_ptr<AquiferInterface<TypeTag>>> aquifers
+
+ +
+
+

Private Types

+
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+

Private Functions

+
+
+void createDynamicAquifers(const int episode_index)
+
+ +
+
+void initializeStaticAquifers()
+
+ +
+
+void initializeRestartDynamicAquifers()
+
+ +
+
+bool needRestartDynamicAquifers() const
+
+ +
+
+template<typename AquiferType, typename AquiferData>
std::unique_ptr<AquiferType> createAnalyticAquiferPointer(const AquiferData &aqData, const int aquiferID, std::string_view aqType) const
+
+ +
+
+void computeConnectionAreaFraction() const
+
+ +
+
+ +
+
+template<class Scalar>
struct BlackOilBrineParams
+
+

Struct holding the parameters for the BlackoilBrineModule class.

+
+

Public Types

+
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+

Public Members

+
+
+std::vector<TabulatedFunction> bdensityTable_
+
+ +
+
+std::vector<TabulatedFunction> pcfactTable_
+
+ +
+
+std::vector<TabulatedFunction> permfactTable_
+
+ +
+
+std::vector<Scalar> saltsolTable_
+
+ +
+
+std::vector<Scalar> saltdenTable_
+
+ +
+
+std::vector<Scalar> referencePressure_
+
+ +
+
+ +
+
+template<class TypeTag>
struct BlackoilConserveSurfaceVolume<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class Scalar>
struct BlackOilExtboParams
+
+

Struct holding the parameters for the BlackoilExtboModule class.

+
+

Public Types

+
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+using Tabulated2DFunction = UniformXTabulated2DFunction<Scalar>
+
+ +
+
+

Public Members

+
+
+std::vector<Tabulated2DFunction> X_
+
+ +
+
+std::vector<Tabulated2DFunction> Y_
+
+ +
+
+std::vector<Tabulated2DFunction> PBUB_RS_
+
+ +
+
+std::vector<Tabulated2DFunction> PBUB_RV_
+
+ +
+
+std::vector<Tabulated2DFunction> VISCO_
+
+ +
+
+std::vector<Tabulated2DFunction> VISCG_
+
+ +
+
+std::vector<Tabulated2DFunction> BO_
+
+ +
+
+std::vector<Tabulated2DFunction> BG_
+
+ +
+
+std::vector<Tabulated2DFunction> RS_
+
+ +
+
+std::vector<Tabulated2DFunction> RV_
+
+ +
+
+std::vector<Scalar> zReferenceDensity_
+
+ +
+
+std::vector<Scalar> zLim_
+
+ +
+
+std::vector<TabulatedFunction> oilCmp_
+
+ +
+
+std::vector<TabulatedFunction> gasCmp_
+
+ +
+
+ +
+
+template<class Scalar>
struct BlackOilFoamParams
+
+

Struct holding the parameters for the BlackoilFoamModule class.

+
+

Public Types

+
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+

Public Functions

+
+
+void setNumSatRegions(unsigned numRegions)
+

Specify the number of saturation regions.

+
+ +
+
+

Public Members

+
+
+std::vector<Scalar> foamRockDensity_
+
+ +
+
+std::vector<bool> foamAllowDesorption_
+
+ +
+
+std::vector<FoamCoefficients> foamCoefficients_
+
+ +
+
+std::vector<TabulatedFunction> adsorbedFoamTable_
+
+ +
+
+std::vector<TabulatedFunction> gasMobilityMultiplierTable_
+
+ +
+
+Opm::Phase transport_phase_
+
+ +
+
+ +
+
+template<class Scalar>
struct BlackOilMICPParams
+
+

Struct holding the parameters for the BlackOilMICPModule class.

+
+

Public Types

+
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+

Public Members

+
+
+std::vector<TabulatedFunction> permfactTable_
+
+ +
+
+std::vector<Scalar> densityBiofilm_
+
+ +
+
+std::vector<Scalar> densityCalcite_
+
+ +
+
+std::vector<Scalar> detachmentRate_
+
+ +
+
+std::vector<Scalar> detachmentExponent_
+
+ +
+
+std::vector<Scalar> halfVelocityOxygen_
+
+ +
+
+std::vector<Scalar> halfVelocityUrea_
+
+ +
+
+std::vector<Scalar> maximumGrowthRate_
+
+ +
+
+std::vector<Scalar> maximumUreaUtilization_
+
+ +
+
+std::vector<Scalar> microbialAttachmentRate_
+
+ +
+
+std::vector<Scalar> microbialDeathRate_
+
+ +
+
+std::vector<Scalar> oxygenConsumptionFactor_
+
+ +
+
+std::vector<Scalar> yieldGrowthCoefficient_
+
+ +
+
+std::vector<Scalar> yieldUreaToCalciteCoefficient_
+
+ +
+
+std::vector<Scalar> microbialDiffusion_
+
+ +
+
+std::vector<Scalar> oxygenDiffusion_
+
+ +
+
+std::vector<Scalar> ureaDiffusion_
+
+ +
+
+ +
+
+template<class TypeTag>
class BlackoilModel
+
+#include <BlackoilModel.hpp>
+

A model implementation for three-phase black oil.

+

The simulator is capable of handling three-phase problems where gas can be dissolved in oil and vice versa. It uses an industry-standard TPFA discretization with per-phase upwind weighting of mobilities.

+
+

Public Types

+
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>
+
+ +
+
+using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>
+
+ +
+
+using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using MaterialLawParams = GetPropType<TypeTag, Properties::MaterialLawParams>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using ModelParameters = BlackoilModelParameters<Scalar>
+
+ +
+
+using VectorBlockType = Dune::FieldVector<Scalar, numEq>
+
+ +
+
+using MatrixBlockType = typename SparseMatrixAdapter::MatrixBlock
+
+ +
+
+using Mat = typename SparseMatrixAdapter::IstlMatrix
+
+ +
+
+using BVector = Dune::BlockVector<VectorBlockType>
+
+ +
+
+using ComponentName = ::Opm::ComponentName<FluidSystem, Indices>
+
+ +
+
+

Public Functions

+
+
+BlackoilModel(Simulator &simulator, const ModelParameters &param, BlackoilWellModel<TypeTag> &well_model, const bool terminal_output)
+

Construct the model. It will retain references to the arguments of this functions, and they are expected to remain in scope for the lifetime of the solver.

+
+
Parameters:
+
    +
  • param[in] parameters

  • +
  • grid[in] grid data structure

  • +
  • wells[in] well structure

  • +
  • vfp_properties[in] Vertical flow performance tables

  • +
  • linsolver[in] linear solver

  • +
  • eclState[in] eclipse state

  • +
  • terminal_output[in] request output to cout/cerr

  • +
+
+
+
+ +
+
+inline bool isParallel() const
+
+ +
+
+inline const EclipseState &eclState() const
+
+ +
+
+SimulatorReportSingle prepareStep(const SimulatorTimerInterface &timer)
+

Called once before each time step.

+
+
Parameters:
+

timer[in] simulation timer

+
+
+
+ +
+
+void initialLinearization(SimulatorReportSingle &report, const int iteration, const int minIter, const int maxIter, const SimulatorTimerInterface &timer)
+
+ +
+
+template<class NonlinearSolverType>
SimulatorReportSingle nonlinearIteration(const int iteration, const SimulatorTimerInterface &timer, NonlinearSolverType &nonlinear_solver)
+

Called once per nonlinear iteration. This model will perform a Newton-Raphson update, changing reservoir_state and well_state. It will also use the nonlinear_solver to do relaxation of updates if necessary.

+
+
Parameters:
+
    +
  • iteration[in] should be 0 for the first call of a new timestep

  • +
  • timer[in] simulation timer

  • +
  • nonlinear_solver[in] nonlinear solver used (for oscillation/relaxation control)

  • +
+
+
+
+ +
+
+template<class NonlinearSolverType>
SimulatorReportSingle nonlinearIterationNewton(const int iteration, const SimulatorTimerInterface &timer, NonlinearSolverType &nonlinear_solver)
+
+ +
+
+SimulatorReportSingle afterStep(const SimulatorTimerInterface&)
+

Called once after each time step. In this class, this function does nothing.

+
+
Parameters:
+

timer[in] simulation timer

+
+
+
+ +
+
+SimulatorReportSingle assembleReservoir(const SimulatorTimerInterface&, const int iterationIdx)
+

Assemble the residual and Jacobian of the nonlinear system.

+
+ +
+
+Scalar relativeChange() const
+
+ +
+
+inline int linearIterationsLastSolve() const
+

Number of linear iterations used in last call to solveJacobianSystem().

+
+ +
+
+inline double &linearSolveSetupTime()
+
+ +
+
+void solveJacobianSystem(BVector &x)
+

Solve the Jacobian system Jx = r where J is the Jacobian and r is the residual.

+
+ +
+
+void updateSolution(const BVector &dx)
+

Apply an update to the primary variables.

+
+ +
+
+inline bool terminalOutputEnabled() const
+

Return true if output to cout is wanted.

+
+ +
+
+std::tuple<Scalar, Scalar> convergenceReduction(Parallel::Communication comm, const Scalar pvSumLocal, const Scalar numAquiferPvSumLocal, std::vector<Scalar> &R_sum, std::vector<Scalar> &maxCoeff, std::vector<Scalar> &B_avg)
+
+ +
+
+std::pair<Scalar, Scalar> localConvergenceData(std::vector<Scalar> &R_sum, std::vector<Scalar> &maxCoeff, std::vector<Scalar> &B_avg, std::vector<int> &maxCoeffCell)
+

Get reservoir quantities on this process needed for convergence calculations.

+
+
Returns:
+

A pair of the local pore volume of interior cells and the pore volumes of the cells associated with a numerical aquifer.

+
+
+
+ +
+
+std::pair<std::vector<double>, std::vector<int>> characteriseCnvPvSplit(const std::vector<Scalar> &B_avg, const double dt)
+

Compute pore-volume/cell count split among “converged”, “relaxed converged”, “unconverged” cells based on CNV point measures.

+
+ +
+
+void updateTUNING(const Tuning &tuning)
+
+ +
+
+ConvergenceReport getReservoirConvergence(const double reportTime, const double dt, const int iteration, const int maxIter, std::vector<Scalar> &B_avg, std::vector<Scalar> &residual_norms)
+
+ +
+
+ConvergenceReport getConvergence(const SimulatorTimerInterface &timer, const int iteration, const int maxIter, std::vector<Scalar> &residual_norms)
+

Compute convergence based on total mass balance (tol_mb) and maximum residual mass balance (tol_cnv).

+
+
Parameters:
+
    +
  • timer[in] simulation timer

  • +
  • iteration[in] current iteration number

  • +
  • maxIter[in] maximum number of iterations

  • +
  • residual_norms[out] CNV residuals by phase

  • +
+
+
+
+ +
+
+inline int numPhases() const
+

The number of active fluid phases in the model.

+
+ +
+
+template<class T>
inline std::vector<std::vector<Scalar>> computeFluidInPlace(const T&, const std::vector<int> &fipnum) const
+

Wrapper required due to not following generic API.

+
+ +
+
+std::vector<std::vector<Scalar>> computeFluidInPlace(const std::vector<int>&) const
+

Should not be called.

+
+ +
+
+inline const Simulator &simulator() const
+
+ +
+
+inline Simulator &simulator()
+
+ +
+
+inline const SimulatorReportSingle &failureReport() const
+

return the statistics if the nonlinearIteration() method failed

+
+ +
+
+const SimulatorReport &localAccumulatedReports() const
+

return the statistics of local solves accumulated for this rank

+
+ +
+
+const std::vector<SimulatorReport> &domainAccumulatedReports() const
+

return the statistics of local solves accumulated for each domain on this rank

+
+ +
+
+void writeNonlinearIterationsPerCell(const std::filesystem::path &odir) const
+

Write the number of nonlinear iterations per cell to a file in ResInsight compatible format.

+
+ +
+
+inline const std::vector<StepReport> &stepReports() const
+
+ +
+
+void writePartitions(const std::filesystem::path &odir) const
+
+ +
+
+inline BlackoilWellModel<TypeTag> &wellModel()
+

return the StandardWells object

+
+ +
+
+inline const BlackoilWellModel<TypeTag> &wellModel() const
+
+ +
+
+inline void beginReportStep()
+
+ +
+
+inline void endReportStep()
+
+ +
+
+template<class FluidState, class Residual>
void getMaxCoeff(const unsigned cell_idx, const IntensiveQuantities &intQuants, const FluidState &fs, const Residual &modelResid, const Scalar pvValue, std::vector<Scalar> &B_avg, std::vector<Scalar> &R_sum, std::vector<Scalar> &maxCoeff, std::vector<int> &maxCoeffCell)
+
+ +
+
+inline const ModelParameters &param() const
+

Returns const reference to model parameters.

+
+ +
+
+inline const ComponentName &compNames() const
+

Returns const reference to component names.

+
+ +
+
+inline bool hasNlddSolver() const
+

Returns true if an NLDD solver exists.

+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numEq = Indices::numEq
+
+ +
+
+static constexpr int contiSolventEqIdx = Indices::contiSolventEqIdx
+
+ +
+
+static constexpr int contiZfracEqIdx = Indices::contiZfracEqIdx
+
+ +
+
+static constexpr int contiPolymerEqIdx = Indices::contiPolymerEqIdx
+
+ +
+
+static constexpr int contiEnergyEqIdx = Indices::contiEnergyEqIdx
+
+ +
+
+static constexpr int contiPolymerMWEqIdx = Indices::contiPolymerMWEqIdx
+
+ +
+
+static constexpr int contiFoamEqIdx = Indices::contiFoamEqIdx
+
+ +
+
+static constexpr int contiBrineEqIdx = Indices::contiBrineEqIdx
+
+ +
+
+static constexpr int contiMicrobialEqIdx = Indices::contiMicrobialEqIdx
+
+ +
+
+static constexpr int contiOxygenEqIdx = Indices::contiOxygenEqIdx
+
+ +
+
+static constexpr int contiUreaEqIdx = Indices::contiUreaEqIdx
+
+ +
+
+static constexpr int contiBiofilmEqIdx = Indices::contiBiofilmEqIdx
+
+ +
+
+static constexpr int contiCalciteEqIdx = Indices::contiCalciteEqIdx
+
+ +
+
+static constexpr int solventSaturationIdx = Indices::solventSaturationIdx
+
+ +
+
+static constexpr int zFractionIdx = Indices::zFractionIdx
+
+ +
+
+static constexpr int polymerConcentrationIdx = Indices::polymerConcentrationIdx
+
+ +
+
+static constexpr int polymerMoleWeightIdx = Indices::polymerMoleWeightIdx
+
+ +
+
+static constexpr int temperatureIdx = Indices::temperatureIdx
+
+ +
+
+static constexpr int foamConcentrationIdx = Indices::foamConcentrationIdx
+
+ +
+
+static constexpr int saltConcentrationIdx = Indices::saltConcentrationIdx
+
+ +
+
+static constexpr int microbialConcentrationIdx = Indices::microbialConcentrationIdx
+
+ +
+
+static constexpr int oxygenConcentrationIdx = Indices::oxygenConcentrationIdx
+
+ +
+
+static constexpr int ureaConcentrationIdx = Indices::ureaConcentrationIdx
+
+ +
+
+static constexpr int biofilmConcentrationIdx = Indices::biofilmConcentrationIdx
+
+ +
+
+static constexpr int calciteConcentrationIdx = Indices::calciteConcentrationIdx
+
+ +
+
+

Protected Attributes

+
+
+Simulator &simulator_
+
+ +
+
+const Grid &grid_
+
+ +
+
+const PhaseUsage phaseUsage_
+
+ +
+
+ModelParameters param_
+
+ +
+
+SimulatorReportSingle failureReport_
+
+ +
+
+BlackoilWellModel<TypeTag> &well_model_
+
+ +
+
+bool terminal_output_
+

Whether we print something to std::cout.

+
+ +
+
+long int global_nc_
+

The number of cells of the global grid.

+
+ +
+
+std::vector<std::vector<Scalar>> residual_norms_history_
+
+ +
+
+Scalar current_relaxation_
+
+ +
+
+BVector dx_old_
+
+ +
+
+std::vector<StepReport> convergence_reports_
+
+ +
+
+ComponentName compNames_ = {}
+
+ +
+
+std::unique_ptr<BlackoilModelNldd<TypeTag>> nlddSolver_
+

Non-linear DD solver.

+
+ +
+
+BlackoilModelConvergenceMonitor<Scalar> conv_monitor_
+
+ +
+
+

Protected Static Attributes

+
+
+static constexpr bool has_solvent_ = getPropValue<TypeTag, Properties::EnableSolvent>()
+
+ +
+
+static constexpr bool has_extbo_ = getPropValue<TypeTag, Properties::EnableExtbo>()
+
+ +
+
+static constexpr bool has_polymer_ = getPropValue<TypeTag, Properties::EnablePolymer>()
+
+ +
+
+static constexpr bool has_polymermw_ = getPropValue<TypeTag, Properties::EnablePolymerMW>()
+
+ +
+
+static constexpr bool has_energy_ = getPropValue<TypeTag, Properties::EnableEnergy>()
+
+ +
+
+static constexpr bool has_foam_ = getPropValue<TypeTag, Properties::EnableFoam>()
+
+ +
+
+static constexpr bool has_brine_ = getPropValue<TypeTag, Properties::EnableBrine>()
+
+ +
+
+static constexpr bool has_micp_ = getPropValue<TypeTag, Properties::EnableMICP>()
+
+ +
+
+

Private Functions

+
+
+inline Scalar dpMaxRel() const
+
+ +
+
+inline Scalar dsMax() const
+
+ +
+
+inline Scalar drMaxRel() const
+
+ +
+
+inline Scalar maxResidualAllowed() const
+
+ +
+
+

Private Members

+
+
+double linear_solve_setup_time_
+
+ +
+
+std::vector<bool> wasSwitched_
+
+ +
+
+ +
+
+template<class Scalar>
class BlackoilModelConvergenceMonitor
+
+

Implementation of penalty cards for three-phase black oil.

+
+

Public Types

+
+
+using MonitorParams = typename BlackoilModelParameters<Scalar>::ConvergenceMonitorParams
+
+ +
+
+

Public Functions

+
+
+explicit BlackoilModelConvergenceMonitor(const MonitorParams &param)
+
+ +
+
+void checkPenaltyCard(ConvergenceReport &report, int iteration)
+
+ +
+
+void reset()
+
+ +
+
+

Private Members

+
+
+const MonitorParams &param_
+
+ +
+
+ConvergenceReport::PenaltyCard total_penaltyCard_
+
+ +
+
+double prev_distance_
+
+ +
+
+int prev_above_tolerance_
+
+ +
+
+ +
+
+template<class TypeTag>
class BlackoilModelNldd
+
+

A NLDD implementation for three-phase black oil.

+
+

Public Types

+
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using ModelParameters = BlackoilModelParameters<Scalar>
+
+ +
+
+using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>
+
+ +
+
+using BVector = typename BlackoilModel<TypeTag>::BVector
+
+ +
+
+using Domain = SubDomain<Grid>
+
+ +
+
+using ISTLSolverType = ISTLSolver<TypeTag>
+
+ +
+
+using Mat = typename BlackoilModel<TypeTag>::Mat
+
+ +
+
+

Public Functions

+
+
+inline explicit BlackoilModelNldd(BlackoilModel<TypeTag> &model)
+

The constructor sets up the subdomains.

+
+
Parameters:
+
    +
  • model – BlackOil model to solve for

  • +
  • param – param Model parameters

  • +
  • compNames – Names of the solution components

  • +
+
+
+
+ +
+
+inline void prepareStep()
+

Called before starting a time step.

+
+ +
+
+template<class NonlinearSolverType>
inline SimulatorReportSingle nonlinearIterationNldd(const int iteration, const SimulatorTimerInterface &timer, NonlinearSolverType &nonlinear_solver)
+

Do one non-linear NLDD iteration.

+
+ +
+
+inline const SimulatorReport &localAccumulatedReports() const
+

return the statistics of local solves accumulated for this rank

+
+ +
+
+inline const std::vector<SimulatorReport> &domainAccumulatedReports() const
+

return the statistics of local solves accumulated for each domain on this rank

+
+ +
+
+inline void writePartitions(const std::filesystem::path &odir) const
+

Write the partition vector to a file in ResInsight compatible format for inspection and a partition file for each rank, that can be used as input for OPM.

+
+ +
+
+inline void writeNonlinearIterationsPerCell(const std::filesystem::path &odir) const
+

Write the number of nonlinear iterations per cell to a file in ResInsight compatible format.

+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numEq = Indices::numEq
+
+ +
+
+

Private Functions

+
+
+inline ConvergenceReport solveDomain(const Domain &domain, const SimulatorTimerInterface &timer, SimulatorReportSingle &local_report, DeferredLogger &logger, const int global_iteration, const bool initial_assembly_required)
+

Solve the equation system for a single domain.

+
+ +
+
+inline void assembleReservoirDomain(const Domain &domain)
+

Assemble the residual and Jacobian of the nonlinear system.

+
+ +
+
+inline void solveJacobianSystemDomain(const Domain &domain, BVector &global_x)
+

Solve the linearized system for a domain.

+
+ +
+
+inline void updateDomainSolution(const Domain &domain, const BVector &dx)
+

Apply an update to the primary variables.

+
+ +
+
+inline std::pair<Scalar, Scalar> localDomainConvergenceData(const Domain &domain, std::vector<Scalar> &R_sum, std::vector<Scalar> &maxCoeff, std::vector<Scalar> &B_avg, std::vector<int> &maxCoeffCell)
+

Get reservoir quantities on this process needed for convergence calculations.

+
+ +
+
+inline ConvergenceReport getDomainReservoirConvergence(const double reportTime, const double dt, const int iteration, const Domain &domain, DeferredLogger &logger, std::vector<Scalar> &B_avg, std::vector<Scalar> &residual_norms)
+
+ +
+
+inline ConvergenceReport getDomainConvergence(const Domain &domain, const SimulatorTimerInterface &timer, const int iteration, DeferredLogger &logger, std::vector<Scalar> &residual_norms)
+
+ +
+
+inline std::vector<int> getSubdomainOrder()
+

Returns subdomain ordered according to method and ordering measure.

+
+ +
+
+template<class GlobalEqVector>
inline void solveDomainJacobi(GlobalEqVector &solution, GlobalEqVector &locally_solved, SimulatorReportSingle &local_report, DeferredLogger &logger, const int iteration, const SimulatorTimerInterface &timer, const Domain &domain)
+
+ +
+
+template<class GlobalEqVector>
inline void solveDomainGaussSeidel(GlobalEqVector &solution, GlobalEqVector &locally_solved, SimulatorReportSingle &local_report, DeferredLogger &logger, const int iteration, const SimulatorTimerInterface &timer, const Domain &domain)
+
+ +
+
+inline Scalar computeCnvErrorPvLocal(const Domain &domain, const std::vector<Scalar> &B_avg, double dt) const
+
+ +
+
+inline decltype(auto) partitionCells() const
+
+ +
+
+

Private Members

+
+
+BlackoilModel<TypeTag> &model_
+

Reference to model.

+
+ +
+
+BlackoilWellModelNldd<TypeTag> wellModel_
+

NLDD well model adapter.

+
+ +
+
+std::vector<Domain> domains_
+

Vector of subdomains.

+
+ +
+
+std::vector<std::unique_ptr<Mat>> domain_matrices_
+

Vector of matrix operator for each subdomain.

+
+ +
+
+std::vector<ISTLSolverType> domain_linsolvers_
+

Vector of linear solvers for each domain.

+
+ +
+
+SimulatorReport local_reports_accumulated_
+

Accumulated convergence report for subdomain solvers per rank.

+
+ +
+
+mutable std::vector<SimulatorReport> domain_reports_accumulated_
+

Accumulated convergence reports per domain.

+
+ +
+
+int rank_ = 0
+

MPI rank of this process.

+
+ +
+
+ +
+
+template<class Scalar>
struct BlackoilModelParameters
+
+

Solver parameters for the BlackoilModel.

+
+

Public Functions

+
+
+BlackoilModelParameters()
+

Construct from user parameters or defaults.

+
+ +
+
+

Public Members

+
+
+Scalar dbhp_max_rel_
+

Max relative change in bhp in single iteration.

+
+ +
+
+Scalar dwell_fraction_max_
+

Max absolute change in well volume fraction in single iteration.

+
+ +
+
+Scalar inj_mult_osc_threshold_
+

Injectivity multiplier oscillation threshold.

+
+ +
+
+Scalar inj_mult_damp_mult_
+

Injectivity multiplier dampening multiplier.

+
+ +
+
+Scalar inj_mult_min_damp_factor_
+

Minimum damping factor for injectivity multipliers.

+
+ +
+
+Scalar max_residual_allowed_
+

Absolute max limit for residuals.

+
+ +
+
+Scalar relaxed_max_pv_fraction_
+
+ +
+
+Scalar tolerance_mb_
+

Relative mass balance tolerance (total mass balance error).

+
+ +
+
+Scalar tolerance_mb_relaxed_
+

Relaxed mass balance tolerance (can be used when iter >= min_strict_mb_iter_).

+
+ +
+
+Scalar tolerance_energy_balance_
+

Relative energy balance tolerance (total energy balance error).

+
+ +
+
+Scalar tolerance_energy_balance_relaxed_
+

Relaxed energy balance tolerance (can be used when iter >= min_strict_mb_iter_).

+
+ +
+
+Scalar tolerance_cnv_
+

Local convergence tolerance (max of local saturation errors).

+
+ +
+
+Scalar tolerance_cnv_relaxed_
+

Relaxed local convergence tolerance (can be used when iter >= min_strict_cnv_iter_ && cnvViolatedPV < relaxed_max_pv_fraction_).

+
+ +
+
+Scalar tolerance_cnv_energy_
+

Local energy convergence tolerance (max of local energy errors).

+
+ +
+
+Scalar tolerance_cnv_energy_relaxed_
+

Relaxed local energy convergence tolerance (can be used when iter >= min_strict_cnv_iter_ && cnvViolatedPV < relaxed_max_pv_fraction_).

+
+ +
+
+Scalar tolerance_wells_
+

Well convergence tolerance.

+
+ +
+
+Scalar tolerance_well_control_
+

Tolerance for the well control equations.

+
+ +
+
+Scalar tolerance_pressure_ms_wells_
+

Tolerance for the pressure equations for multisegment wells.

+
+ +
+
+Scalar relaxed_tolerance_flow_well_
+

Relaxed tolerance for for the well flow residual.

+
+ +
+
+Scalar relaxed_tolerance_pressure_ms_well_
+

Relaxed tolerance for the MSW pressure solution.

+
+ +
+
+Scalar max_pressure_change_ms_wells_
+

Maximum pressure change over an iteratio for ms wells.

+
+ +
+
+int max_inner_iter_ms_wells_
+

Maximum inner iteration number for ms wells.

+
+ +
+
+int strict_inner_iter_wells_
+

Strict inner iteration number for wells.

+
+ +
+
+int strict_outer_iter_wells_
+

Newton iteration where wells are stricly convergent.

+
+ +
+
+Scalar regularization_factor_wells_
+

Regularization factor for wells.

+
+ +
+
+int max_niter_inner_well_iter_
+

Maximum newton iterations with inner well iterations.

+
+ +
+
+bool shut_unsolvable_wells_
+

Whether to shut unsolvable well.

+
+ +
+
+int max_inner_iter_wells_
+

Maximum inner iteration number for standard wells.

+
+ +
+
+int max_welleq_iter_
+

Maximum iteration number of the well equation solution.

+
+ +
+
+Scalar maxSinglePrecisionTimeStep_
+

Tolerance for time step in seconds where single precision can be used for solving for the Jacobian

+
+ +
+
+int min_strict_cnv_iter_
+

Minimum number of Newton iterations before we can use relaxed CNV convergence criterion.

+
+ +
+
+int min_strict_mb_iter_
+

Minimum number of Newton iterations before we can use relaxed MB convergence criterion.

+
+ +
+
+bool solve_welleq_initially_
+

Solve well equation initially.

+
+ +
+
+bool pre_solve_network_
+

Pre solve and iterate network model.

+
+ +
+
+bool update_equations_scaling_
+

Update scaling factors for mass balance equations.

+
+ +
+
+bool use_update_stabilization_
+

Try to detect oscillation or stagnation.

+
+ +
+
+bool use_multisegment_well_
+

Whether to use MultisegmentWell to handle multisegment wells it is something temporary before the multisegment well model is considered to be well developed and tested. if it is false, we will handle multisegment wells as standard wells, which will be the default behavoir for the moment. Later, we might set it to be true by default if necessary

+
+ +
+
+std::string deck_file_name_
+

The file name of the deck.

+
+ +
+
+bool matrix_add_well_contributions_
+

Whether to add influences of wells between cells to the matrix and preconditioner matrix.

+
+ +
+
+bool check_well_operability_
+

Whether to check well operability.

+
+ +
+
+bool check_well_operability_iter_
+

Whether to check well operability during iterations.

+
+ +
+
+int max_number_of_well_switches_
+

Maximum number of times a well can switch to the same control.

+
+ +
+
+int max_number_of_group_switches_
+

Maximum number of times group can switch to the same control.

+
+ +
+
+bool use_average_density_ms_wells_
+

Whether to approximate segment densities by averaging over segment and its outlet.

+
+ +
+
+bool local_well_solver_control_switching_
+

Whether to allow control switching during local well solutions.

+
+ +
+
+bool use_implicit_ipr_
+

Whether to use implicit IPR for thp stability checks and solution search.

+
+ +
+
+bool check_group_constraints_inner_well_iterations_
+

Whether to allow checking/changing to group controls during inner well iterations.

+
+ +
+
+int network_max_strict_outer_iterations_
+

Maximum number of iterations in the network solver before relaxing tolerance.

+
+ +
+
+int network_max_outer_iterations_
+

Maximum number of iterations in the network solver before giving up.

+
+ +
+
+int network_max_sub_iterations_
+

Maximum number of sub-iterations to update network pressures (within a single well/group control update)

+
+ +
+
+Scalar network_pressure_update_damping_factor_
+

Damping factor in the inner network pressure update iterations.

+
+ +
+
+Scalar network_max_pressure_update_in_bars_
+

Maximum pressure update in the inner network pressure update iterations.

+
+ +
+
+int well_group_constraints_max_iterations_
+

Maximum number of iterations in the well/group switch algorithm.

+
+ +
+
+std::string nonlinear_solver_
+

Nonlinear solver type: newton or nldd.

+
+ +
+
+DomainSolveApproach local_solve_approach_ = {DomainSolveApproach::Jacobi}
+

‘jacobi’ and ‘gauss-seidel’ supported.

+
+ +
+
+int max_local_solve_iterations_
+
+ +
+
+Scalar local_tolerance_scaling_mb_
+
+ +
+
+Scalar local_tolerance_scaling_cnv_
+
+ +
+
+int nldd_num_initial_newton_iter_ = {1}
+
+ +
+
+int num_local_domains_ = {0}
+
+ +
+
+Scalar local_domains_partition_imbalance_ = {1.03}
+
+ +
+
+std::string local_domains_partition_method_
+
+ +
+
+int local_domains_partition_well_neighbor_levels_ = {1}
+
+ +
+
+DomainOrderingMeasure local_domains_ordering_ = {DomainOrderingMeasure::MaxPressure}
+
+ +
+
+bool write_partitions_ = {false}
+
+ +
+
+ConvergenceMonitorParams monitor_params_
+

Convergence monitoring parameters.

+
+ +
+
+Scalar nupcol_group_rate_tolerance_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+
+ +
+
+ +
+
+template<class TypeTag>
class BlackOilNewtonMethod : public GetPropType<TypeTag, Properties::DiscNewtonMethod>
+
+

A newton solver which is specific to the black oil model.

+
+

Public Functions

+
+
+inline explicit BlackOilNewtonMethod(Simulator &simulator)
+
+ +
+
+inline void finishInit()
+
+ +
+
+inline unsigned numPriVarsSwitched() const
+

Returns the number of degrees of freedom for which the interpretation has changed for the most recent iteration.

+
+ +
+
+inline void update_(SolutionVector &nextSolution, const SolutionVector &currentSolution, const GlobalEqVector &solutionUpdate, const GlobalEqVector &currentResidual)
+
+ +
+
+template<class DofIndices>
inline void update_(SolutionVector &nextSolution, const SolutionVector &currentSolution, const GlobalEqVector &solutionUpdate, const GlobalEqVector &currentResidual, const DofIndices &dofIndices)
+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the blackoil newton method.

+
+ +
+
+

Protected Functions

+
+
+inline void beginIteration_()
+
+ +
+
+inline void endIteration_(SolutionVector &uCurrentIter, const SolutionVector &uLastIter)
+
+ +
+
+inline void updatePrimaryVariables_(unsigned globalDofIdx, PrimaryVariables &nextValue, const PrimaryVariables &currentValue, const EqVector &update, const EqVector &currentResidual)
+
+ +
+
+

Protected Attributes

+
+
+friend NewtonMethod< TypeTag >
+
+ +
+
+friend ParentType
+
+ +
+
+

Private Types

+
+
+using ParentType = GetPropType<TypeTag, Properties::DiscNewtonMethod>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>
+
+ +
+
+using GlobalEqVector = GetPropType<TypeTag, Properties::GlobalEqVector>
+
+ +
+
+using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>
+
+ +
+
+using EqVector = GetPropType<TypeTag, Properties::EqVector>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Linearizer = GetPropType<TypeTag, Properties::Linearizer>
+
+ +
+
+using MICPModule = BlackOilMICPModule<TypeTag>
+
+ +
+
+

Private Members

+
+
+int numPriVarsSwitched_ = {}
+
+ +
+
+BlackoilNewtonParams<Scalar> bparams_ = {}
+
+ +
+
+std::vector<bool> wasSwitched_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static const unsigned numEq = getPropValue<TypeTag, Properties::NumEq>()
+
+ +
+
+static constexpr bool enableSaltPrecipitation = getPropValue<TypeTag, Properties::EnableSaltPrecipitation>()
+
+ +
+
+ +
+
+template<class Scalar>
struct BlackoilNewtonParams
+
+

Struct holding the parameters for BlackoilNewtonMethod.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+Scalar priVarOscilationThreshold_
+
+ +
+
+Scalar waterSaturationMax_
+
+ +
+
+Scalar waterOnlyThreshold_
+
+ +
+
+Scalar dpMaxRel_
+
+ +
+
+Scalar dsMax_
+
+ +
+
+bool projectSaturations_
+
+ +
+
+Scalar maxTempChange_
+
+ +
+
+Scalar tempMax_
+
+ +
+
+Scalar tempMin_
+
+ +
+
+Scalar pressMax_
+
+ +
+
+Scalar pressMin_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+class BlackoilPhases
+
+#include <BlackoilPhases.hpp>
+

Subclassed by Opm::PhaseUsage

+
+

Public Types

+
+
+enum PhaseIndex
+

Values:

+
+
+enumerator Aqua
+
+ +
+
+enumerator Liquid
+
+ +
+
+enumerator Vapour
+
+ +
+
+enumerator Solvent
+
+ +
+
+enumerator Polymer
+
+ +
+
+enumerator Energy
+
+ +
+
+enumerator PolymerMW
+
+ +
+
+enumerator Foam
+
+ +
+
+enumerator Brine
+
+ +
+
+enumerator ZFraction
+
+ +
+ +
+
+

Public Static Attributes

+
+
+static const int MaxNumPhases = 3
+
+ +
+
+static const int NumCryptoPhases = 7
+
+ +
+
+ +
+
+template<class Scalar>
struct BlackOilPolymerParams
+
+

Struct holding the parameters for the BlackOilPolymerModule class.

+
+

Public Types

+
+
+enum AdsorptionBehaviour
+

Values:

+
+
+enumerator Desorption
+
+ +
+
+enumerator NoDesorption
+
+ +
+ +
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+using TabulatedTwoDFunction = IntervalTabulated2DFunction<Scalar>
+
+ +
+
+

Public Functions

+
+
+void setNumSatRegions(unsigned numRegions)
+

Specify the number of satuation regions.

+

This must be called before setting the PLYROCK and PLYADS of any region.

+
+ +
+
+void setNumMixRegions(unsigned numRegions, bool enablePolymerMolarWeight)
+

Specify the number of mix regions.

+

This must be called before setting the PLYMAC and PLMIXPAR of any region.

+
+ +
+
+void setPlyrock(unsigned satRegionIdx, const Scalar &plyrockDeadPoreVolume, const Scalar &plyrockResidualResistanceFactor, const Scalar &plyrockRockDensityFactor, const Scalar &plyrockAdsorbtionIndex, const Scalar &plyrockMaxAdsorbtion)
+

Specify the polymer rock properties a single region.

+

The index of specified here must be in range [0, numSatRegions)

+
+ +
+
+

Public Members

+
+
+std::vector<Scalar> plyrockDeadPoreVolume_ = {}
+
+ +
+
+std::vector<Scalar> plyrockResidualResistanceFactor_ = {}
+
+ +
+
+std::vector<Scalar> plyrockRockDensityFactor_ = {}
+
+ +
+
+std::vector<Scalar> plyrockAdsorbtionIndex_ = {}
+
+ +
+
+std::vector<Scalar> plyrockMaxAdsorbtion_ = {}
+
+ +
+
+std::vector<TabulatedFunction> plyadsAdsorbedPolymer_ = {}
+
+ +
+
+std::vector<TabulatedFunction> plyviscViscosityMultiplierTable_ = {}
+
+ +
+
+std::vector<Scalar> plymaxMaxConcentration_ = {}
+
+ +
+
+std::vector<Scalar> plymixparToddLongstaff_ = {}
+
+ +
+
+std::vector<std::vector<Scalar>> plyshlogShearEffectRefMultiplier_ = {}
+
+ +
+
+std::vector<std::vector<Scalar>> plyshlogShearEffectRefLogVelocity_ = {}
+
+ +
+
+std::vector<Scalar> shrate_ = {}
+
+ +
+
+bool hasShrate_ = false
+
+ +
+
+bool hasPlyshlog_ = false
+
+ +
+
+std::vector<PlyvmhCoefficients> plyvmhCoefficients_ = {}
+
+ +
+
+std::map<int, TabulatedTwoDFunction> plymwinjTables_ = {}
+
+ +
+
+std::map<int, TabulatedTwoDFunction> skprwatTables_ = {}
+
+ +
+
+std::map<int, SkprpolyTable> skprpolyTables_ = {}
+
+ +
+
+ +
+
+template<class Scalar>
struct BlackOilSolventParams
+
+

Struct holding the parameters for the BlackOilSolventModule class.

+
+

Public Types

+
+
+using BrineCo2Pvt = ::Opm::BrineCo2Pvt<Scalar>
+
+ +
+
+using BrineH2Pvt = ::Opm::BrineH2Pvt<Scalar>
+
+ +
+
+using Co2GasPvt = ::Opm::Co2GasPvt<Scalar>
+
+ +
+
+using H2GasPvt = ::Opm::H2GasPvt<Scalar>
+
+ +
+
+using SolventPvt = ::Opm::SolventPvt<Scalar>
+
+ +
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+

Public Functions

+
+
+void setNumSatRegions(unsigned numRegions)
+

Specify the number of satuation regions.

+

This must be called before setting the SSFN of any region.

+
+ +
+
+void setMsfn(unsigned satRegionIdx, const TabulatedFunction &msfnKrsg, const TabulatedFunction &msfnKro)
+

Specify miscible relative permeability multipliers of a single region.

+

The index of specified here must be in range [0, numSatRegions)

+
+ +
+
+

Public Members

+
+
+BrineCo2Pvt brineCo2Pvt_ = {}
+
+ +
+
+BrineH2Pvt brineH2Pvt_ = {}
+
+ +
+
+Co2GasPvt co2GasPvt_ = {}
+
+ +
+
+H2GasPvt h2GasPvt_ = {}
+
+ +
+
+SolventPvt solventPvt_ = {}
+
+ +
+
+std::vector<TabulatedFunction> ssfnKrg_ = {}
+
+ +
+
+std::vector<TabulatedFunction> ssfnKrs_ = {}
+
+ +
+
+std::vector<TabulatedFunction> sof2Krn_ = {}
+
+ +
+
+std::vector<TabulatedFunction> misc_ = {}
+
+ +
+
+std::vector<TabulatedFunction> pmisc_ = {}
+
+ +
+
+std::vector<TabulatedFunction> msfnKrsg_ = {}
+
+ +
+
+std::vector<TabulatedFunction> msfnKro_ = {}
+
+ +
+
+std::vector<TabulatedFunction> sorwmis_ = {}
+
+ +
+
+std::vector<TabulatedFunction> sgcwmis_ = {}
+
+ +
+
+std::vector<Scalar> tlMixParamViscosity_ = {}
+
+ +
+
+std::vector<Scalar> tlMixParamDensity_ = {}
+
+ +
+
+std::vector<TabulatedFunction> tlPMixTable_ = {}
+
+ +
+
+bool isMiscible_ = false
+
+ +
+
+bool rsSolw_active_ = false
+
+ +
+
+bool co2sol_ = false
+
+ +
+
+bool h2sol_ = false
+
+ +
+
+ +
+
+template<typename TypeTag>
class BlackoilWellModel : public Opm::WellConnectionAuxiliaryModule<TypeTag, BlackoilWellModel<TypeTag>>, public Opm::BlackoilWellModelGeneric<GetPropType<TypeTag, Properties::Scalar>>
+
+

Class for handling the blackoil well model.

+
+

Public Types

+
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using EquilGrid = GetPropType<TypeTag, Properties::EquilGrid>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+using GlobalEqVector = GetPropType<TypeTag, Properties::GlobalEqVector>
+
+ +
+
+using SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>
+
+ +
+
+using ModelParameters = BlackoilModelParameters<Scalar>
+
+ +
+
+using WellConnectionModule = WellConnectionAuxiliaryModule<TypeTag, BlackoilWellModel<TypeTag>>
+
+ +
+
+using VectorBlockType = Dune::FieldVector<Scalar, numEq>
+
+ +
+
+using BVector = Dune::BlockVector<VectorBlockType>
+
+ +
+
+using PolymerModule = BlackOilPolymerModule<TypeTag>
+
+ +
+
+using MICPModule = BlackOilMICPModule<TypeTag>
+
+ +
+
+using RateConverterType = RateConverter::SurfaceToReservoirVoidage<FluidSystem, std::vector<int>>
+
+ +
+
+using AverageRegionalPressureType = RegionAverageCalculator::AverageRegionalPressure<FluidSystem, std::vector<int>>
+
+ +
+
+using WellInterfacePtr = std::shared_ptr<WellInterface<TypeTag>>
+
+ +
+
+using PressureMatrix = Dune::BCRSMatrix<Opm::MatrixBlock<Scalar, 1, 1>>
+
+ +
+
+

Public Functions

+
+
+explicit BlackoilWellModel(Simulator &simulator)
+
+ +
+
+void init()
+
+ +
+
+virtual void initWellContainer(const int reportStepIdx) override
+
+ +
+
+inline void beginEpisode()
+
+ +
+
+void beginTimeStep()
+
+ +
+
+inline void beginIteration()
+
+ +
+
+inline void endIteration()
+
+ +
+
+inline void endTimeStep()
+
+ +
+
+inline void endEpisode()
+
+ +
+
+void computeTotalRatesForDof(RateVector &rate, unsigned globalIdx) const
+
+ +
+
+template<class Context>
void computeTotalRatesForDof(RateVector &rate, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+
+ +
+
+inline void initFromRestartFile(const RestartValue &restartValues)
+
+ +
+
+inline void prepareDeserialize(const int report_step)
+
+ +
+
+inline data::Wells wellData() const
+
+ +
+
+inline data::WellBlockAveragePressures wellBlockAveragePressures() const
+
+ +
+
+ConvergenceReport getWellConvergence(const std::vector<Scalar> &B_avg, const bool checkWellGroupControls = false) const
+
+ +
+
+const SimulatorReportSingle &lastReport() const
+
+ +
+
+void addWellContributions(SparseMatrixAdapter &jacobian) const
+
+ +
+
+void addReservoirSourceTerms(GlobalEqVector &residual, const std::vector<typename SparseMatrixAdapter::MatrixBlock*> &diagMatAddress) const
+
+ +
+
+void beginReportStep(const int time_step)
+
+ +
+
+void calculateExplicitQuantities(DeferredLogger &deferred_logger) const
+

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

+
+ +
+
+void prepareTimeStep(DeferredLogger &deferred_logger)
+
+ +
+
+bool updateWellControls(DeferredLogger &deferred_logger)
+
+ +
+
+std::tuple<bool, Scalar> updateNetworks(const bool mandatory_network_balance, DeferredLogger &deferred_logger, const bool relax_network_tolerance = false)
+
+ +
+
+void updateAndCommunicate(const int reportStepIdx, const int iterationIdx, DeferredLogger &deferred_logger)
+
+ +
+
+bool updateGroupControls(const Group &group, DeferredLogger &deferred_logger, const int reportStepIdx, const int iterationIdx)
+
+ +
+
+WellInterfacePtr getWell(const std::string &well_name) const
+
+ +
+
+void addWellPressureEquations(PressureMatrix &jacobian, const BVector &weights, const bool use_well_weights) const
+
+ +
+
+void addWellPressureEquationsStruct(PressureMatrix &jacobian) const
+
+ +
+
+inline void addWellPressureEquationsDomain(PressureMatrix &jacobian, const BVector &weights, const bool use_well_weights, const int domainIndex) const
+
+ +
+
+inline const std::vector<WellInterfacePtr> &localNonshutWells() const
+

Get list of local nonshut wells.

+
+ +
+
+inline const SparseTable<int> &well_local_cells() const
+
+ +
+
+inline const std::map<std::string, int> &well_domain() const
+
+ +
+
+inline auto begin() const
+
+ +
+
+inline auto end() const
+
+ +
+
+inline bool empty() const
+
+ +
+
+inline bool addMatrixContributions() const
+
+ +
+
+inline int numStrictIterations() const
+
+ +
+
+inline virtual int compressedIndexForInterior(int cartesian_cell_idx) const override
+

get compressed index for interior cells (-1, otherwise

+
+ +
+
+void recoverWellSolutionAndUpdateWellState(const BVector &x)
+
+ +
+
+void recoverWellSolutionAndUpdateWellStateDomain(const BVector &x, const int domainIdx)
+
+ +
+
+inline const Grid &grid() const
+
+ +
+
+inline const Simulator &simulator() const
+
+ +
+
+inline void setNlddAdapter(BlackoilWellModelNldd<TypeTag> *mod)
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr std::size_t pressureVarIndex = GetPropType<TypeTag, Properties::Indices>::pressureSwitchIdx
+
+ +
+
+static const int numEq = Indices::numEq
+
+ +
+
+static const int solventSaturationIdx = Indices::solventSaturationIdx
+
+ +
+
+static constexpr bool has_solvent_ = getPropValue<TypeTag, Properties::EnableSolvent>()
+
+ +
+
+static constexpr bool has_polymer_ = getPropValue<TypeTag, Properties::EnablePolymer>()
+
+ +
+
+static constexpr bool has_energy_ = getPropValue<TypeTag, Properties::EnableEnergy>()
+
+ +
+
+static constexpr bool has_micp_ = getPropValue<TypeTag, Properties::EnableMICP>()
+
+ +
+
+

Protected Functions

+
+
+void initializeWellState(const int timeStepIdx)
+
+ +
+
+virtual void createWellContainer(const int report_step) override
+
+ +
+
+WellInterfacePtr createWellPointer(const int wellID, const int report_step) const
+
+ +
+
+template<typename WellType>
std::unique_ptr<WellType> createTypedWellPointer(const int wellID, const int time_step) const
+
+ +
+
+WellInterfacePtr createWellForWellTest(const std::string &well_name, const int report_step, DeferredLogger &deferred_logger) const
+
+ +
+
+void doPreStepNetworkRebalance(DeferredLogger &deferred_logger)
+
+ +
+
+inline const EquilGrid &equilGrid() const
+
+ +
+
+inline const EclipseState &eclState() const
+
+ +
+
+void assemble(const int iterationIdx, const double dt)
+
+ +
+
+std::tuple<bool, bool, Scalar> updateWellControlsAndNetworkIteration(const bool mandatory_network_balance, const bool relax_network_tolerance, const bool optimize_gas_lift, const double dt, DeferredLogger &local_deferredLogger)
+
+ +
+
+bool updateWellControlsAndNetwork(const bool mandatory_network_balance, const double dt, DeferredLogger &local_deferredLogger)
+
+ +
+
+bool computeWellGroupThp(const double dt, DeferredLogger &local_deferredLogger)
+
+ +
+
+void initializeLocalWellStructure(const int reportStepIdx, const bool enableWellPIScaling)
+

Update rank’s notion of intersecting wells and their associate solution variables.

+
+
Parameters:
+
    +
  • reportStepIdx[in] Report step.

  • +
  • enableWellPIScaling[in] Whether or not to enable WELPI scaling. Typically enabled (i.e., true) only at the start of a report step.

  • +
+
+
+
+ +
+
+void initializeGroupStructure(const int reportStepIdx)
+

Initialize group control modes/constraints and group solution state.

+
+
Parameters:
+

reportStepIdx[in] Report step.

+
+
+
+ +
+
+void timeStepSucceeded(const double simulationTime, const double dt)
+
+ +
+
+void endReportStep()
+
+ +
+
+void updatePrimaryVariables(DeferredLogger &deferred_logger)
+
+ +
+
+void updateAverageFormationFactor()
+
+ +
+
+virtual void computePotentials(const std::size_t widx, const WellState<Scalar> &well_state_copy, std::string &exc_msg, ExceptionType::ExcEnum &exc_type, DeferredLogger &deferred_logger) override
+
+ +
+
+const std::vector<Scalar> &wellPerfEfficiencyFactors() const
+
+ +
+
+virtual void calculateProductivityIndexValuesShutWells(const int reportStepIdx, DeferredLogger &deferred_logger) override
+
+ +
+
+virtual void calculateProductivityIndexValues(DeferredLogger &deferred_logger) override
+
+ +
+
+void calculateProductivityIndexValues(const WellInterface<TypeTag> *wellPtr, DeferredLogger &deferred_logger)
+
+ +
+
+int numComponents() const
+
+ +
+
+int reportStepIndex() const
+
+ +
+
+void assembleWellEq(const double dt, DeferredLogger &deferred_logger)
+
+ +
+
+void prepareWellsBeforeAssembling(const double dt, DeferredLogger &deferred_logger)
+
+ +
+
+void assembleWellEqWithoutIteration(const double dt, DeferredLogger &deferred_logger)
+
+ +
+
+void extractLegacyCellPvtRegionIndex_()
+
+ +
+
+void extractLegacyDepth_()
+
+ +
+
+void updateWellTestState(const double &simulationTime, WellTestState &wellTestState) const
+

upate the wellTestState related to economic limits

+
+ +
+
+void wellTesting(const int timeStepIdx, const double simulationTime, DeferredLogger &deferred_logger)
+
+ +
+
+virtual void calcResvCoeff(const int fipnum, const int pvtreg, const std::vector<Scalar> &production_rates, std::vector<Scalar> &resv_coeff) override
+
+ +
+
+virtual void calcInjResvCoeff(const int fipnum, const int pvtreg, std::vector<Scalar> &resv_coeff) override
+
+ +
+
+void computeWellTemperature()
+
+ +
+
+

Protected Attributes

+
+
+Simulator &simulator_
+
+ +
+
+std::vector<WellInterfacePtr> well_container_ = {}
+
+ +
+
+std::vector<bool> is_cell_perforated_ = {}
+
+ +
+
+const ModelParameters param_
+
+ +
+
+std::size_t global_num_cells_ = {}
+
+ +
+
+std::size_t local_num_cells_ = {}
+
+ +
+
+Scalar gravity_ = {}
+
+ +
+
+std::vector<Scalar> depth_ = {}
+
+ +
+
+bool alternative_well_rate_init_ = {}
+
+ +
+
+std::map<std::string, Scalar> well_group_thp_calc_
+
+ +
+
+std::unique_ptr<RateConverterType> rateConverter_ = {}
+
+ +
+
+std::map<std::string, std::unique_ptr<AverageRegionalPressureType>> regionalAveragePressureCalculator_ = {}
+
+ +
+
+SimulatorReportSingle last_report_ = {}
+
+ +
+
+std::vector<Scalar> B_avg_ = {}
+
+ +
+
+

Private Functions

+
+
+BlackoilWellModel(Simulator &simulator, const PhaseUsage &pu)
+
+ +
+
+void assignWellTracerRates(data::Wells &wsrpt) const
+
+ +
+
+

Private Members

+
+
+BlackoilWellModelGasLift<TypeTag> gaslift_
+
+ +
+
+BlackoilWellModelNldd<TypeTag> *nldd_ = nullptr
+

NLDD well model adapter (not owned)

+
+ +
+
+mutable BVector x_local_
+
+ +
+
+ +
+
+template<class Scalar>
class BlackoilWellModelConstraints
+
+

Class for handling constraints for the blackoil well model.

+
+

Public Functions

+
+
+inline explicit BlackoilWellModelConstraints(const BlackoilWellModelGeneric<Scalar> &wellModel)
+

Constructor initializes reference to the well model.

+
+ +
+
+bool checkGroupConstraints(const Group &group, const int reportStepIdx, DeferredLogger &deferred_logger) const
+

Check the constraints of a well group.

+
+ +
+
+void actionOnBrokenConstraints(const Group &group, const Group::InjectionCMode &newControl, const Phase &controlPhase, GroupState<Scalar> &group_state, DeferredLogger &deferred_logger) const
+

Execute action for broken constraint for an injection well group.

+
+ +
+
+bool actionOnBrokenConstraints(const Group &group, const int reportStepIdx, const Group::GroupLimitAction group_limit_action, const Group::ProductionCMode &newControl, const WellState<Scalar> &well_state, std::optional<std::string> &worst_offending_well, GroupState<Scalar> &group_state, DeferredLogger &deferred_logger) const
+

Execute action on broken constraint for a production well group. Return true if a group control is changed.

+
+ +
+
+bool updateGroupIndividualControl(const Group &group, const int reportStepIdx, const int max_number_of_group_switch, std::map<std::string, std::array<std::vector<Group::InjectionCMode>, 3>> &switched_inj, std::map<std::string, std::vector<Group::ProductionCMode>> &switched_prod, std::map<std::string, std::pair<std::string, std::string>> &closed_offending_wells, GroupState<Scalar> &group_state, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) const
+

Update the individual controls for wells in a group. Return true if a group control is changed.

+
+ +
+
+

Private Functions

+
+
+std::pair<Group::InjectionCMode, Scalar> checkGroupInjectionConstraints(const Group &group, const int reportStepIdx, const Phase &phase) const
+

Check and return value and type of constraints for an injection well group.

+
+ +
+
+std::pair<Group::ProductionCMode, Scalar> checkGroupProductionConstraints(const Group &group, const int reportStepIdx, DeferredLogger &deferred_logger) const
+

Check and return value and type of constraints for a production well group.

+
+ +
+
+

Private Members

+
+
+const BlackoilWellModelGeneric<Scalar> &wellModel_
+

Reference to well model.

+
+ +
+
+ +
+
+template<typename TypeTag>
class BlackoilWellModelGasLift : public Opm::BlackoilWellModelGasLiftGeneric<GetPropType<TypeTag, Properties::Scalar>>
+
+

Class for handling the gaslift in the blackoil well model.

+
+

Public Types

+
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using GLiftEclWells = typename GasLiftGroupInfo<Scalar>::GLiftEclWells
+
+ +
+
+using GLiftOptWells = typename Base::GLiftOptWells
+
+ +
+
+using GLiftProdWells = typename Base::GLiftProdWells
+
+ +
+
+using GLiftSyncGroups = typename GasLiftSingleWellGeneric<Scalar>::GLiftSyncGroups
+
+ +
+
+using GLiftWellStateMap = typename Base::GLiftWellStateMap
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using WellInterfacePtr = std::shared_ptr<WellInterface<TypeTag>>
+
+ +
+
+

Public Functions

+
+
+inline BlackoilWellModelGasLift(bool terminal_output, const PhaseUsage &phase_usage)
+
+ +
+
+bool maybeDoGasLiftOptimize(const Simulator &simulator, const std::vector<WellInterfacePtr> &well_container, WellState<Scalar> &wellState, GroupState<Scalar> &groupState, DeferredLogger &deferred_logger)
+
+ +
+
+

Public Static Functions

+
+
+static void initGliftEclWellMap(const std::vector<WellInterfacePtr> &well_container, GLiftEclWells &ecl_well_map)
+
+ +
+
+

Private Types

+
+
+using Base = BlackoilWellModelGasLiftGeneric<GetPropType<TypeTag, Properties::Scalar>>
+
+ +
+
+

Private Functions

+
+
+void gasLiftOptimizationStage1(const Simulator &simulator, const std::vector<WellInterfacePtr> &well_container, WellState<Scalar> &wellState, GroupState<Scalar> &groupState, GLiftProdWells &prod_wells, GLiftOptWells &glift_wells, GasLiftGroupInfo<Scalar> &group_info, GLiftWellStateMap &state_map, DeferredLogger &deferred_logger)
+
+ +
+
+void gasLiftOptimizationStage1SingleWell(WellInterface<TypeTag> *well, const Simulator &simulator, WellState<Scalar> &wellState, GroupState<Scalar> &groupState, GLiftProdWells &prod_wells, GLiftOptWells &glift_wells, GasLiftGroupInfo<Scalar> &group_info, GLiftWellStateMap &state_map, GLiftSyncGroups &groups_to_sync, DeferredLogger &deferred_logger)
+
+ +
+
+

Private Members

+
+
+const PhaseUsage &phase_usage_
+
+ +
+
+ +
+
+template<class Scalar>
class BlackoilWellModelGasLiftGeneric
+
+
+

Public Types

+
+
+using GLiftOptWells = std::map<std::string, std::unique_ptr<GasLiftSingleWellGeneric<Scalar>>>
+
+ +
+
+using GLiftProdWells = std::map<std::string, const WellInterfaceGeneric<Scalar>*>
+
+ +
+
+using GLiftWellStateMap = std::map<std::string, std::unique_ptr<GasLiftWellState<Scalar>>>
+
+ +
+
+using GLiftEclWells = typename GasLiftGroupInfo<Scalar>::GLiftEclWells
+
+ +
+
+using GLiftSyncGroups = typename GasLiftSingleWellGeneric<Scalar>::GLiftSyncGroups
+
+ +
+
+

Public Functions

+
+
+inline explicit BlackoilWellModelGasLiftGeneric(bool terminal_output)
+
+ +
+
+void gliftDebug(const std::string &msg, DeferredLogger &deferred_logger) const
+
+ +
+
+inline bool terminalOutput() const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline bool operator==(const BlackoilWellModelGasLiftGeneric &that) const
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr bool glift_debug = false
+
+ +
+
+

Protected Functions

+
+
+void gliftDebugShowALQ(const std::vector<WellInterfaceGeneric<Scalar>*> &well_container, const WellState<Scalar> &wellState, DeferredLogger &deferred_logger)
+
+ +
+
+void gasLiftOptimizationStage2(const Parallel::Communication &comm, const Schedule &schedule, const SummaryState &summaryState, WellState<Scalar> &wellState, GroupState<Scalar> &groupState, GLiftProdWells &prod_wells, GLiftOptWells &glift_wells, GasLiftGroupInfo<Scalar> &group_info, GLiftWellStateMap &map, const int episodeIndex, DeferredLogger &deferred_logger)
+
+ +
+
+

Protected Attributes

+
+
+bool terminal_output_
+
+ +
+
+double last_glift_opt_time_ = -1.0
+
+ +
+
+ +
+
+template<class Scalar>
class BlackoilWellModelGeneric
+
+

Class for handling the blackoil well model.

+
+

Public Functions

+
+
+BlackoilWellModelGeneric(Schedule &schedule, BlackoilWellModelGasLiftGeneric<Scalar> &gaslift, const SummaryState &summaryState, const EclipseState &eclState, const PhaseUsage &phase_usage, const Parallel::Communication &comm)
+
+ +
+
+virtual ~BlackoilWellModelGeneric() = default
+
+ +
+
+int numLocalWells() const
+
+ +
+
+int numLocalWellsEnd() const
+
+ +
+
+int numLocalNonshutWells() const
+
+ +
+
+int numPhases() const
+
+ +
+
+bool wellsActive() const
+

return true if wells are available in the reservoir

+
+ +
+
+bool hasLocalWell(const std::string &wname) const
+

Returns true if well is defined and has connections on current rank.

+
+ +
+
+bool hasOpenLocalWell(const std::string &well_name) const
+

Returns true if well is defined, open and has connections on current rank.

+
+ +
+
+bool networkActive() const
+

return true if network is active (at least one network well in prediction mode)

+
+ +
+
+bool anyMSWellOpenLocal() const
+
+ +
+
+inline const std::vector<Well> &eclWells() const
+
+ +
+
+inline bool terminalOutput() const
+
+ +
+
+const Well &getWellEcl(const std::string &well_name) const
+
+ +
+
+std::vector<Well> getLocalWells(const int timeStepIdx) const
+
+ +
+
+inline const Schedule &schedule() const
+
+ +
+
+inline const PhaseUsage &phaseUsage() const
+
+ +
+
+inline const GroupState<Scalar> &groupState() const
+
+ +
+
+inline std::vector<const WellInterfaceGeneric<Scalar>*> genericWells() const
+
+ +
+
+inline std::vector<WellInterfaceGeneric<Scalar>*> genericWells()
+
+ +
+
+inline const WellState<Scalar> &wellState() const
+
+ +
+
+inline WellState<Scalar> &wellState()
+
+ +
+
+inline const WellState<Scalar> &nupcolWellState() const
+
+ +
+
+inline GroupState<Scalar> &groupState()
+
+ +
+
+inline WellTestState &wellTestState()
+
+ +
+
+inline const WellTestState &wellTestState() const
+
+ +
+
+Scalar wellPI(const int well_index) const
+
+ +
+
+Scalar wellPI(const std::string &well_name) const
+
+ +
+
+void updateEclWells(const int timeStepIdx, const SimulatorUpdate &sim_update, const SummaryState &st)
+
+ +
+
+void initFromRestartFile(const RestartValue &restartValues, std::unique_ptr<WellTestState> wtestState, const std::size_t numCells, bool handle_ms_well, bool enable_distributed_wells)
+
+ +
+
+void prepareDeserialize(int report_step, const std::size_t numCells, bool handle_ms_well, bool enable_distributed_wells)
+
+ +
+
+inline void commitWGState()
+
+ +
+
+data::GroupAndNetworkValues groupAndNetworkData(const int reportStepIdx) const
+
+ +
+
+void updateNetworkActiveState(const int report_step)
+

Checks if network is active (at least one network well on prediction).

+
+ +
+
+bool needPreStepNetworkRebalance(const int report_step) const
+

Checks if there are reasons to perform a pre-step network re-balance. (Currently, the only reasons are network well status changes.) (TODO: Consider if adding network change events would be helpful.)

+
+ +
+
+bool forceShutWellByName(const std::string &wellname, const double simulation_time, const bool dont_shut_grup_wells)
+

Shut down any single well Returns true if the well was actually found and shut.

+
+ +
+
+inline const std::vector<PerforationData<Scalar>> &perfData(const int well_idx) const
+
+ +
+
+inline const Parallel::Communication &comm() const
+
+ +
+
+inline const EclipseState &eclipseState() const
+
+ +
+
+inline const SummaryState &summaryState() const
+
+ +
+
+inline const GuideRate &guideRate() const
+
+ +
+
+inline const std::map<std::string, double> &wellOpenTimes() const
+
+ +
+
+inline const std::map<std::string, double> &wellCloseTimes() const
+
+ +
+
+inline const WellGroupEvents &reportStepStartEvents() const
+
+ +
+
+std::vector<int> getCellsForConnections(const Well &well) const
+
+ +
+
+inline bool reportStepStarts() const
+
+ +
+
+bool shouldBalanceNetwork(const int reportStepIndex, const int iterationIdx) const
+
+ +
+
+inline void updateClosedWellsThisStep(const std::string &well_name) const
+
+ +
+
+bool wasDynamicallyShutThisTimeStep(const std::string &well_name) const
+
+ +
+
+void logPrimaryVars() const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const BlackoilWellModelGeneric &rhs) const
+
+ +
+
+inline const ParallelWellInfo<Scalar> &parallelWellInfo(const std::size_t idx) const
+
+ +
+
+inline bool isOwner(const std::string &wname) const
+
+ +
+
+inline const ConnectionIndexMap &connectionIndexMap(const std::size_t idx)
+
+ +
+
+

Protected Types

+
+
+using WellTracerRates = std::unordered_map<int, std::vector<WellTracerRate<Scalar>>>
+
+ +
+
+using MswTracerRates = std::unordered_map<int, std::vector<MSWellTracerRate<Scalar>>>
+
+ +
+
+

Protected Functions

+
+
+inline const WellState<Scalar> &prevWellState() const
+
+ +
+
+inline const WGState<Scalar> &prevWGState() const
+
+ +
+
+inline void commitWGState(WGState<Scalar> wgstate)
+
+ +
+
+inline void resetWGState()
+
+ +
+
+inline void updateNupcolWGState()
+
+ +
+
+void reportGroupSwitching(DeferredLogger &local_deferredLogger) const
+
+ +
+
+std::vector<std::reference_wrapper<ParallelWellInfo<Scalar>>> createLocalParallelWellInfo(const std::vector<Well> &wells)
+

Create the parallel well information.

+
+
Parameters:
+

localWells – The local wells from ECL schedule

+
+
+
+ +
+
+void initializeWellProdIndCalculators()
+
+ +
+
+void initializeWellPerfData()
+
+ +
+
+bool wasDynamicallyShutThisTimeStep(const int well_index) const
+
+ +
+
+Scalar updateNetworkPressures(const int reportStepIdx, const Scalar damping_factor, const Scalar update_upper_bound)
+
+ +
+
+void updateWsolvent(const Group &group, const int reportStepIdx, const WellState<Scalar> &wellState)
+
+ +
+
+void setWsolvent(const Group &group, const int reportStepIdx, Scalar wsolvent)
+
+ +
+
+virtual void calcResvCoeff(const int fipnum, const int pvtreg, const std::vector<Scalar> &production_rates, std::vector<Scalar> &resv_coeff) = 0
+
+ +
+
+virtual void calcInjResvCoeff(const int fipnum, const int pvtreg, std::vector<Scalar> &resv_coeff) = 0
+
+ +
+
+void assignDynamicWellStatus(data::Wells &wsrpt, const int reportStepIdx) const
+

Assign dynamic well status for each well owned by current rank

+
+
Parameters:
+
    +
  • wsrpt[inout] Well solution object. On exit, holds current values for

    data::Well::dynamicStatus 
    +
    +
    +.

  • +
  • reportStepIdx[in] Zero-based index of current report step.

  • +
+
+
+
+ +
+
+void assignShutConnections(data::Wells &wsrpt, const int reportStepIndex) const
+

Assign basic result quantities for shut connections of wells owned by current rank.

+

Mostly provided for summary file output purposes. Applies to fully shut/stopped wells and shut connections of open/flowing wells.

+
+
Parameters:
+
    +
  • wsrpt[inout] Well solution object. On exit, also contains a few quantities, like the D factor, the Kh product and the CTF, for shut connections.

  • +
  • reportStepIdx[in] Zero-based index of current report step.

  • +
+
+
+
+ +
+
+void assignWellTargets(data::Wells &wsrpt) const
+
+ +
+
+void assignProductionWellTargets(const Well &well, data::WellControlLimits &limits) const
+
+ +
+
+void assignInjectionWellTargets(const Well &well, data::WellControlLimits &limits) const
+
+ +
+
+void assignGroupControl(const Group &group, data::GroupData &gdata) const
+
+ +
+
+void assignGroupValues(const int reportStepIdx, std::map<std::string, data::GroupData> &gvalues) const
+
+ +
+
+void assignNodeValues(std::map<std::string, data::NodeData> &nodevalues, const int reportStepIdx) const
+
+ +
+
+void calculateEfficiencyFactors(const int reportStepIdx)
+
+ +
+
+void checkGconsaleLimits(const Group &group, WellState<Scalar> &well_state, const int reportStepIdx, DeferredLogger &deferred_logger)
+
+ +
+
+void checkGEconLimits(const Group &group, const double simulation_time, const int report_step_idx, DeferredLogger &deferred_logger)
+
+ +
+
+bool checkGroupHigherConstraints(const Group &group, DeferredLogger &deferred_logger, const int reportStepIdx, const int max_number_of_group_switch)
+
+ +
+
+void updateAndCommunicateGroupData(const int reportStepIdx, const int iterationIdx, const Scalar tol_nupcol, DeferredLogger &deferred_logger)
+
+ +
+
+void inferLocalShutWells()
+
+ +
+
+void setRepRadiusPerfLength()
+
+ +
+
+virtual void computePotentials(const std::size_t widx, const WellState<Scalar> &well_state_copy, std::string &exc_msg, ExceptionType::ExcEnum &exc_type, DeferredLogger &deferred_logger) = 0
+
+ +
+
+void updateWellPotentials(const int reportStepIdx, const bool onlyAfterEvent, const SummaryConfig &summaryConfig, DeferredLogger &deferred_logger)
+
+ +
+
+void initInjMult()
+
+ +
+
+void updateInjMult(DeferredLogger &deferred_logger)
+
+ +
+
+void updateInjFCMult(DeferredLogger &deferred_logger)
+
+ +
+
+void updateFiltrationModelsPostStep(const double dt, const std::size_t water_index, DeferredLogger &deferred_logger)
+
+ +
+
+void updateFiltrationModelsPreStep(DeferredLogger &deferred_logger)
+
+ +
+
+virtual void createWellContainer(const int time_step) = 0
+
+ +
+
+virtual void initWellContainer(const int reportStepIdx) = 0
+
+ +
+
+virtual void calculateProductivityIndexValuesShutWells(const int reportStepIdx, DeferredLogger &deferred_logger) = 0
+
+ +
+
+virtual void calculateProductivityIndexValues(DeferredLogger &deferred_logger) = 0
+
+ +
+
+void runWellPIScaling(const int reportStepIdx, DeferredLogger &local_deferredLogger)
+
+ +
+
+virtual int compressedIndexForInterior(int cartesian_cell_idx) const = 0
+

get compressed index for interior cells (-1, otherwise

+
+ +
+
+std::vector<std::vector<int>> getMaxWellConnections() const
+
+ +
+
+std::vector<std::string> getWellsForTesting(const int timeStepIdx, const double simulationTime)
+
+ +
+
+void assignWellTracerRates(data::Wells &wsrpt, const WellTracerRates &wellTracerRates, const unsigned reportStep) const
+
+ +
+
+void assignMswTracerRates(data::Wells &wsrpt, const MswTracerRates &mswTracerRates, const unsigned reportStep) const
+
+ +
+
+void assignMassGasRate(data::Wells &wsrpt, const Scalar gasDensity) const
+
+ +
+
+

Protected Attributes

+
+
+Schedule &schedule_
+
+ +
+
+const SummaryState &summaryState_
+
+ +
+
+const EclipseState &eclState_
+
+ +
+
+const Parallel::Communication &comm_
+
+ +
+
+BlackoilWellModelGasLiftGeneric<Scalar> &gen_gaslift_
+
+ +
+
+BlackoilWellModelWBP<Scalar> wbp_
+
+ +
+
+PhaseUsage phase_usage_
+
+ +
+
+bool terminal_output_ = {false}
+
+ +
+
+bool wells_active_ = {false}
+
+ +
+
+bool network_active_ = {false}
+
+ +
+
+bool initial_step_ = {}
+
+ +
+
+bool report_step_starts_ = {}
+
+ +
+
+std::optional<int> last_run_wellpi_ = {}
+
+ +
+
+std::vector<Well> wells_ecl_
+
+ +
+
+std::vector<std::vector<PerforationData<Scalar>>> well_perf_data_
+
+ +
+
+std::map<std::string, double> well_open_times_
+
+ +
+
+std::map<std::string, double> well_close_times_
+
+ +
+
+std::vector<ConnectionIndexMap> conn_idx_map_ = {}
+
+ +
+
+std::function<bool(const Well&)> not_on_process_ = {}
+
+ +
+
+std::vector<WellInterfaceGeneric<Scalar>*> well_container_generic_ = {}
+
+ +
+
+std::vector<int> local_shut_wells_ = {}
+
+ +
+
+std::vector<ParallelWellInfo<Scalar>> parallel_well_info_
+
+ +
+
+std::vector<std::reference_wrapper<ParallelWellInfo<Scalar>>> local_parallel_well_info_
+
+ +
+
+std::vector<WellProdIndexCalculator<Scalar>> prod_index_calc_
+
+ +
+
+std::vector<int> pvt_region_idx_
+
+ +
+
+mutable std::unordered_set<std::string> closed_this_step_
+
+ +
+
+GuideRate guideRate_
+
+ +
+
+std::unique_ptr<VFPProperties<Scalar>> vfp_properties_ = {}
+
+ +
+
+std::map<std::string, Scalar> node_pressures_
+
+ +
+
+std::map<std::string, Scalar> last_valid_node_pressures_
+
+ +
+
+std::unordered_map<std::string, std::vector<Scalar>> prev_inj_multipliers_
+
+ +
+
+std::unordered_map<std::string, WellFilterCake<Scalar>> filter_cake_
+
+ +
+
+WGState<Scalar> active_wgstate_
+
+ +
+
+WGState<Scalar> last_valid_wgstate_
+
+ +
+
+WGState<Scalar> nupcol_wgstate_
+
+ +
+
+WellGroupEvents report_step_start_events_
+

Well group events at start of report step.

+
+ +
+
+bool wellStructureChangedDynamically_ = {false}
+
+ +
+
+std::map<std::string, std::vector<Group::ProductionCMode>> switched_prod_groups_
+
+ +
+
+std::map<std::string, std::array<std::vector<Group::InjectionCMode>, 3>> switched_inj_groups_
+
+ +
+
+std::map<std::string, std::pair<std::string, std::string>> closed_offending_wells_
+
+ +
+
+

Private Functions

+
+
+WellInterfaceGeneric<Scalar> *getGenWell(const std::string &well_name)
+
+ +
+
+template<typename Iter, typename Body>
void wellUpdateLoop(Iter first, Iter last, const int timeStepIdx, Body &&body)
+
+ +
+
+void updateEclWellsConstraints(const int timeStepIdx, const SimulatorUpdate &sim_update, const SummaryState &st)
+
+ +
+
+void updateEclWellsCTFFromAction(const int timeStepIdx, const SimulatorUpdate &sim_update)
+
+ +
+
+template<typename LoopBody>
void loopOwnedWells(LoopBody &&loopBody) const
+

Run caller-defined code for each well owned by current rank

+

‘const’ version.

+
+
Template Parameters:
+

LoopBody – Call-back type for user-defined code. Expected to support a function call operator of the form

void operator()(const std::size_t i, const Well& well) const
+
+
+ which will be invoked for each well owned by the local process. The parameters are the index into wells_ecl_ and the object at that index, respectively.

+
+
Parameters:
+

loopBody[in] Call-back function. Typically defined as a lambda expression.

+
+
+
+ +
+
+ +
+
+template<class Scalar>
class BlackoilWellModelGuideRates
+
+

Class for handling the guide rates in the blackoil well model.

+
+

Public Functions

+
+
+inline explicit BlackoilWellModelGuideRates(const BlackoilWellModelGeneric<Scalar> &wellModel)
+

Constructor initializes reference to the well model.

+
+ +
+
+void assignWellGuideRates(data::Wells &wsrpt, const int reportStepIdx) const
+

Assign well guide rates.

+
+ +
+
+std::unordered_map<std::string, data::GroupGuideRates> calculateAllGroupGuideRates(const int reportStepIdx) const
+

Calculates guide rate for all groups.

+
+ +
+
+void assignGroupGuideRates(const Group &group, const std::unordered_map<std::string, data::GroupGuideRates> &groupGuideRates, data::GroupData &gdata) const
+

Assign group guide rates.

+
+ +
+
+bool guideRateUpdateIsNeeded(const int reportStepIdx) const
+

Check if a guide rate update is needed.

+
+ +
+
+

Private Functions

+
+
+void getGuideRateValues(const GuideRate::RateVector &qs, const bool is_inj, const std::string &wgname, data::GuideRateValue &grval) const
+

Obtain guide rate values.

+
+ +
+
+data::GuideRateValue getGuideRateValues(const Well &well) const
+

Obtain guide rate values for well.

+
+ +
+
+data::GuideRateValue getGuideRateValues(const Group &group) const
+

Obtain guide rate values for group.

+
+ +
+
+data::GuideRateValue getGuideRateInjectionGroupValues(const Group &group) const
+

Obtain guide rate values for injection group.

+
+ +
+
+

Private Members

+
+
+const BlackoilWellModelGeneric<Scalar> &wellModel_
+

Reference to well model.

+
+ +
+
+ +
+
+template<typename TypeTag>
class BlackoilWellModelNldd : public Opm::BlackoilWellModelNlddGeneric<GetPropType<TypeTag, Properties::Scalar>>
+
+

Class for handling the blackoil well model in a NLDD solver.

+
+

Public Types

+
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using PressureMatrix = typename BlackoilWellModel<TypeTag>::PressureMatrix
+
+ +
+
+using BVector = typename BlackoilWellModel<TypeTag>::BVector
+
+ +
+
+using Domain = SubDomain<Grid>
+
+ +
+
+

Public Functions

+
+
+inline BlackoilWellModelNldd(BlackoilWellModel<TypeTag> &model)
+
+ +
+
+void addWellPressureEquations(PressureMatrix &jacobian, const BVector &weights, const bool use_well_weights, const int domainIndex) const
+
+ +
+
+void assemble(const int iterationIdx, const double dt, const Domain &domain)
+
+ +
+
+void updateWellControls(DeferredLogger &deferred_logger, const Domain &domain)
+
+ +
+
+void setupDomains(const std::vector<Domain> &domains)
+
+ +
+
+ConvergenceReport getWellConvergence(const Domain &domain, const std::vector<Scalar> &B_avg, DeferredLogger &local_deferredLogger) const
+
+ +
+
+void recoverWellSolutionAndUpdateWellState(const BVector &x, const int domainIdx)
+
+ +
+
+inline int numLocalWells() const
+
+ +
+
+inline int numLocalWellsEnd() const
+
+ +
+
+

Private Functions

+
+
+void assembleWellEq(const double dt, const Domain &domain, DeferredLogger &deferred_logger)
+
+ +
+
+

Private Members

+
+
+BlackoilWellModel<TypeTag> &wellModel_
+
+ +
+
+mutable BVector x_local_
+
+ +
+
+ +
+
+template<class Scalar>
class BlackoilWellModelNlddGeneric
+
+
+

Public Functions

+
+
+std::vector<Scalar> getPrimaryVarsDomain(const int domainIdx) const
+
+ +
+
+void setPrimaryVarsDomain(const int domainIdx, const std::vector<Scalar> &vars)
+
+ +
+
+inline const SparseTable<int> &well_local_cells() const
+
+ +
+
+inline const std::map<std::string, int> &well_domain() const
+
+ +
+
+

Protected Functions

+
+
+inline BlackoilWellModelNlddGeneric(BlackoilWellModelGeneric<Scalar> &model)
+
+ +
+
+void calcDomains(const std::vector<const SubDomainIndices*> &domains)
+
+ +
+
+

Private Functions

+
+
+void logDomains() const
+
+ +
+
+void findWellDomains(const std::vector<const SubDomainIndices*> &domains)
+
+ +
+
+void calcLocalIndices(const std::vector<const SubDomainIndices*> &domains)
+
+ +
+
+

Private Members

+
+
+BlackoilWellModelGeneric<Scalar> &genWellModel_
+
+ +
+
+std::map<std::string, int> well_domain_ = {}
+
+ +
+
+SparseTable<int> well_local_cells_ = {}
+
+ +
+
+ +
+
+template<class Scalar>
class BlackoilWellModelRestart
+
+

Class for restarting the blackoil well model.

+
+

Public Functions

+
+
+inline explicit BlackoilWellModelRestart(const BlackoilWellModelGeneric<Scalar> &wellModel)
+

Constructor initializes reference to the well model.

+
+ +
+
+void loadRestartGuideRates(const int report_step, const GuideRateModel::Target target, const data::Wells &rst_wells, GuideRate &guide_rate) const
+

Loads guide rates from restart structures.

+
+ +
+
+void loadRestartGuideRates(const int report_step, const GuideRateConfig &config, const std::map<std::string, data::GroupData> &rst_groups, GuideRate &guide_rate) const
+

Loads guide rates from restart structures.

+
+ +
+
+void loadRestartData(const data::Wells &rst_wells, const data::GroupAndNetworkValues &grpNwrkValues, const bool handle_ms_well, WellState<Scalar> &well_state, GroupState<Scalar> &grpState) const
+

Loads well data from restart structures.

+
+ +
+
+

Private Functions

+
+
+void loadRestartConnectionData(const std::vector<data::Rates::opt> &phs, const data::Well &rst_well, const std::vector<PerforationData<Scalar>> &old_perf_data, SingleWellState<Scalar> &ws) const
+

Loads per-connection data from restart structures.

+
+ +
+
+void loadRestartSegmentData(const std::string &well_name, const std::vector<data::Rates::opt> &phs, const data::Well &rst_well, SingleWellState<Scalar> &ws) const
+

Loads per-segment data from restart structures.

+
+ +
+
+void loadRestartWellData(const std::string &well_name, const bool handle_ms_well, const std::vector<data::Rates::opt> &phs, const data::Well &rst_well, const std::vector<PerforationData<Scalar>> &old_perf_data, SingleWellState<Scalar> &ws) const
+

Loads per-well data from restart structures.

+
+ +
+
+void loadRestartGroupData(const std::string &group, const data::GroupData &value, GroupState<Scalar> &grpState) const
+

Loads per-group data from restart structures.

+
+ +
+
+

Private Members

+
+
+const BlackoilWellModelGeneric<Scalar> &wellModel_
+

Reference to well model.

+
+ +
+
+ +
+
+template<class Scalar>
class BlackoilWellModelWBP
+
+

Class for handling the blackoil well model.

+
+

Public Functions

+
+
+explicit BlackoilWellModelWBP(BlackoilWellModelGeneric<Scalar> &well_model)
+
+ +
+
+void initializeSources(typename ParallelWBPCalculation<Scalar>::GlobalToLocal index, typename ParallelWBPCalculation<Scalar>::Evaluator eval)
+
+ +
+
+void registerOpenWellsForWBPCalculation()
+
+ +
+
+ParallelWBPCalculation<Scalar>::EvaluatorFactory makeWellSourceEvaluatorFactory(const std::vector<Well>::size_type wellIdx) const
+
+ +
+
+void initializeWBPCalculationService()
+
+ +
+
+data::WellBlockAveragePressures computeWellBlockAveragePressures(const Scalar gravity) const
+
+ +
+
+

Private Members

+
+
+BlackoilWellModelGeneric<Scalar> &well_model_
+
+ +
+
+mutable ParallelWBPCalculation<Scalar> wbpCalculationService_
+
+ +
+
+std::vector<WBPCalcID> wbpCalcMap_ = {}
+
+ +
+
+ +
+
+template<class Scalar>
class BlockedMatrix
+
+#include <BlockedMatrix.hpp>
+

This struct resembles a blocked csr matrix, like Dune::BCRSMatrix. The data is stored in contiguous memory, such that they can be copied to a device in one transfer.

+
+

Public Functions

+
+
+inline BlockedMatrix(int Nb_, int nnzbs_, unsigned int block_size_)
+

Allocate BlockedMatrix and data arrays with given sizes

+
+
Parameters:
+
    +
  • Nb[in] number of blockrows

  • +
  • nnzbs[in] number of nonzero blocks

  • +
  • block_size[in] the number of rows and columns for each block

  • +
+
+
+
+ +
+
+inline BlockedMatrix(const BlockedMatrix &M)
+

Allocate BlockedMatrix, but copy sparsity pattern instead of allocating new memory

+
+
Parameters:
+

M[in] matrix to be copied

+
+
+
+ +
+
+inline BlockedMatrix(int Nb_, int nnzbs_, unsigned int block_size_, Scalar *nnzValues_, int *colIndices_, int *rowPointers_)
+

Allocate BlockedMatrix, but let data arrays point to existing arrays

+
+
Parameters:
+
    +
  • Nb[in] number of blockrows

  • +
  • nnzbs[in] number of nonzero blocks

  • +
  • block_size[in] the number of rows and columns for each block

  • +
  • nnzValues[in] array of nonzero values, contains nnzb*block_size*block_size scalars

  • +
  • colIndices[in] array of column indices, contains nnzb entries

  • +
  • rowPointers[in] array of row pointers, contains Nb+1 entries

  • +
+
+
+
+ +
+
+inline ~BlockedMatrix()
+
+ +
+
+

Public Members

+
+
+Scalar *nnzValues
+
+ +
+
+int *colIndices
+
+ +
+
+int *rowPointers
+
+ +
+
+int Nb
+
+ +
+
+int nnzbs
+
+ +
+
+unsigned int block_size
+
+ +
+
+bool deleteNnzs
+
+ +
+
+bool deleteSparsity
+
+ +
+
+ +
+
+template<class TypeTag>
struct BlockExtractor
+
+#include <OutputExtractor.hpp>
+

Wrapping struct holding types used for block-level data extraction.

+
+

Public Types

+
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using FluidState = typename IntensiveQuantities::FluidState
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using AssignFunc = std::function<void(const Context&)>
+

Callback for extractors handling their own assignements.

+
+ +
+
+using ScalarFunc = std::function<Scalar(const Context&)>
+

Callback for extractors assigned to a scalar buffer Return value to store in buffer

+
+ +
+
+using PhaseFunc = std::function<Scalar(const unsigned, const Context&)>
+

Callback for extractors assigned to a phase buffer Returns value to store in buffer for requested phase

+
+ +
+
+using Entry = std::variant<ScalarEntry, PhaseEntry>
+

Descriptor for extractors.

+
+ +
+
+using ExecMap = std::unordered_map<int, std::vector<Exec>>
+

A map of extraction executors, keyed by cartesian cell index.

+
+ +
+
+

Public Static Functions

+
+
+template<std::size_t size>
static inline ExecMap setupExecMap(std::map<std::pair<std::string, int>, double> &blockData, const std::array<Entry, size> &handlers)
+

Setup an extractor executor map from a map of evaluations to perform.

+
+ +
+
+static inline void process(const std::vector<Exec> &blockExtractors, const Context &ectx)
+

Process a list of block extractors.

+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numPhases = FluidSystem::numPhases
+
+ +
+
+static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx
+
+ +
+
+static constexpr int gasPhaseIdx = FluidSystem::gasPhaseIdx
+
+ +
+
+static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx
+
+ +
+
+ +
+
+template<class Grid>
class CartesianIndexMapper
+
+ +
+
+template<>
class CartesianIndexMapper<Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>>
+
+

Interface class to access the logical Cartesian grid as used in industry standard simulator decks.

+
+

Public Types

+
+
+using Grid = Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming, Dune::ALUGridNoComm>
+
+ +
+
+using Grid = Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming, Dune::ALUGridNoComm>
+
+ +
+
+using Grid = Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming, Dune::ALUGridNoComm>
+
+ +
+
+using Grid = Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming, Dune::ALUGridNoComm>
+
+ +
+
+using Grid = Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming, Dune::ALUGridNoComm>
+
+ +
+
+

Public Functions

+
+
+inline CartesianIndexMapper(const Grid &grid, const std::array<int, dimension> &cartDims, const std::vector<int> &cartesianIndex)
+

constructor taking grid

+
+ +
+
+inline const std::array<int, dimension> &cartesianDimensions() const
+

return Cartesian dimensions, i.e. number of cells in each direction

+
+ +
+
+inline int cartesianSize() const
+

return total number of cells in the logical Cartesian grid

+
+ +
+
+inline int compressedSize() const
+

return number of cells in the active grid

+
+ +
+
+inline int cartesianIndex(const int compressedElementIndex) const
+

return index of the cells in the logical Cartesian grid

+
+ +
+
+inline int cartesianIndex(const std::array<int, dimension> &coords) const
+

return index of the cells in the logical Cartesian grid

+
+ +
+
+inline void cartesianCoordinate(const int compressedElementIndex, std::array<int, dimension> &coords) const
+

return Cartesian coordinate, i.e. IJK, for a given cell

+
+ +
+
+template<class GridView>
inline std::unique_ptr<GlobalIndexDataHandle<GridView>> dataHandle(const GridView &gridView)
+
+ +
+
+inline CartesianIndexMapper(const Grid &grid, const std::array<int, dimension> &cartDims, const std::vector<int> &cartesianIndex)
+

constructor taking grid

+
+ +
+
+inline const std::array<int, dimension> &cartesianDimensions() const
+

return Cartesian dimensions, i.e. number of cells in each direction

+
+ +
+
+inline int cartesianSize() const
+

return total number of cells in the logical Cartesian grid

+
+ +
+
+inline int compressedSize() const
+

return number of cells in the active grid

+
+ +
+
+inline int compressedLevelZeroSize() const
+

return number of cells in the active grid. Only for unifying calls with CpGrid and PolyhedralGrid specializations.

+
+ +
+
+inline int cartesianIndex(const int compressedElementIndex) const
+

return index of the cells in the logical Cartesian grid

+
+ +
+
+inline int cartesianIndex(const std::array<int, dimension> &coords) const
+

return index of the cells in the logical Cartesian grid

+
+ +
+
+inline void cartesianCoordinate(const int compressedElementIndex, std::array<int, dimension> &coords) const
+

return Cartesian coordinate, i.e. IJK, for a given cell

+
+ +
+
+inline <<<<<<< HEAD=======int compressedLevelZeroSize() const { return cartesianIndex_.size();} int cartesianIndexLevel(const int compressedElementIndex, const int level) const { if(level) { throw std::invalid_argument("Invalid level.\n");} return cartesianIndex(compressedElementIndex);} > > > > > > Delete period void cartesianCoordinateLevel (const int compressedElementIndex, std::array< int, dimension > &coords, int level) const
+
+ +
+
+template<class GridView>
inline std::unique_ptr<GlobalIndexDataHandle<GridView>> dataHandle(const GridView &gridView)
+
+ +
+
+inline CartesianIndexMapper(const Grid &grid, const std::array<int, dimension> &cartDims, const std::vector<int> &cartesianIndex)
+

constructor taking grid

+
+ +
+
+inline const std::array<int, dimension> &cartesianDimensions() const
+

return Cartesian dimensions, i.e. number of cells in each direction

+
+ +
+
+inline int cartesianSize() const
+

return total number of cells in the logical Cartesian grid

+
+ +
+
+inline int compressedSize() const
+

return number of cells in the active grid

+
+ +
+
+inline int cartesianIndex(const int compressedElementIndex) const
+

return index of the cells in the logical Cartesian grid

+
+ +
+
+inline int cartesianIndex(const std::array<int, dimension> &coords) const
+

return index of the cells in the logical Cartesian grid

+
+ +
+
+inline void cartesianCoordinate(const int compressedElementIndex, std::array<int, dimension> &coords) const
+

return Cartesian coordinate, i.e. IJK, for a given cell

+
+ +
+
+inline int compressedLevelZeroSize() const
+

Only for unifying calls with CpGrid specializations.

+
+ +
+
+inline int cartesianIndexLevel(const int compressedElementIndex, const int level) const
+

Only for unifying calls with CpGrid specializations.

+
+ +
+
+inline void cartesianCoordinateLevel(const int compressedElementIndex, std::array<int, dimension> &coords, int level) const
+

Only for unifying calls with CartesianIndexMapper<CpGrid> where levels are relevant.

+
+ +
+
+template<class GridView>
inline std::unique_ptr<GlobalIndexDataHandle<GridView>> dataHandle(const GridView &gridView)
+
+ +
+
+inline CartesianIndexMapper(const Grid &grid, const std::array<int, dimension> &cartDims, const std::vector<int> &cartesianIndex)
+

constructor taking grid

+
+ +
+
+inline const std::array<int, dimension> &cartesianDimensions() const
+

return Cartesian dimensions, i.e. number of cells in each direction

+
+ +
+
+inline int cartesianSize() const
+

return total number of cells in the logical Cartesian grid

+
+ +
+
+inline int compressedSize() const
+

return number of cells in the active grid

+
+ +
+
+inline int compressedLevelZeroSize() const
+

return number of cells in the active grid. Only for unifying calls with CpGrid and PolyhedralGrid specializations.

+
+ +
+
+inline int cartesianIndex(const int compressedElementIndex) const
+

return index of the cells in the logical Cartesian grid

+
+ +
+
+inline int cartesianIndex(const std::array<int, dimension> &coords) const
+

return index of the cells in the logical Cartesian grid

+
+ +
+
+inline void cartesianCoordinate(const int compressedElementIndex, std::array<int, dimension> &coords) const
+

return Cartesian coordinate, i.e. IJK, for a given cell

+
+ +
+
+inline void cartesianCoordinateLevel(const int compressedElementIndex, std::array<int, dimension> &coords, int level) const
+

Only for unifying calls with CartesianIndexMapper<CpGrid> where levels are relevant.

+
+ +
+
+template<class GridView>
inline std::unique_ptr<GlobalIndexDataHandle<GridView>> dataHandle(const GridView &gridView)
+
+ +
+
+inline CartesianIndexMapper(const Grid &grid, const std::array<int, dimension> &cartDims, const std::vector<int> &cartesianIndex)
+

constructor taking grid

+
+ +
+
+inline const std::array<int, dimension> &cartesianDimensions() const
+

return Cartesian dimensions, i.e. number of cells in each direction

+
+ +
+
+inline int cartesianSize() const
+

return total number of cells in the logical Cartesian grid

+
+ +
+
+inline int compressedSize() const
+

return number of cells in the active grid

+
+ +
+
+inline int cartesianIndex(const int compressedElementIndex) const
+

return index of the cells in the logical Cartesian grid

+
+ +
+
+inline int cartesianIndex(const std::array<int, dimension> &coords) const
+

return index of the cells in the logical Cartesian grid

+
+ +
+
+inline void cartesianCoordinate(const int compressedElementIndex, std::array<int, dimension> &coords) const
+

return Cartesian coordinate, i.e. IJK, for a given cell

+
+ +
+
+inline int compressedLevelZeroSize() const
+

Only for unifying calls with CpGrid specializations.

+
+ +
+
+inline int cartesianIndexLevel(const int compressedElementIndex, const int level) const
+

Only for unifying calls with CpGrid specializations.

+
+ +
+
+inline void cartesianCoordinateLevel(const int compressedElementIndex, std::array<int, dimension> &coords, int level) const
+

Only for unifying calls with CartesianIndexMapper<CpGrid> where levels are relevant.

+
+ +
+
+template<class GridView>
inline std::unique_ptr<GlobalIndexDataHandle<GridView>> dataHandle(const GridView &gridView)
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int dimension = Grid::dimension
+

dimension of the grid

+
+ +
+
+

Protected Functions

+
+
+inline int computeCartesianSize() const
+
+ +
+
+inline int computeCartesianSize() const
+
+ +
+
+inline int computeCartesianSize() const
+
+ +
+
+inline int computeCartesianSize() const
+
+ +
+
+inline int computeCartesianSize() const
+
+ +
+
+

Protected Attributes

+
+
+const Grid &grid_
+
+ +
+
+const std::array<int, dimension> cartesianDimensions_
+
+ +
+
+std::vector<int> cartesianIndex_
+
+ +
+
+const int cartesianSize_
+
+ +
+
+ +
+
+struct Cell
+
+#include <InterRegFlows.hpp>
+

Minimal characteristics of a cell from a simulation grid.

+
+

Public Members

+
+
+int activeIndex = {-1}
+

Cell’s active index on local rank.

+
+ +
+
+int cartesianIndex = {-1}
+

Cell’s global cell ID.

+
+ +
+
+bool isInterior = {true}
+

Whether or not cell is interior to local rank.

+
+ +
+
+ +
+
+struct CellValue
+
+

Minimal characteristics of a cell from a simulation grid.

+
+

Public Members

+
+
+double value = {0.0}
+

Function value.

+
+ +
+
+double sat = {0.0}
+

Phase saturation.

+
+ +
+
+double porv = {0.0}
+

Reservoir condition pore-volume.

+
+ +
+
+ +
+
+class Check
+
+

Call-back interface for an individual check.

+

Specific checks are expected to inherit from this base class.

+

Subclassed by Opm::Satfunc::PhaseChecks::PhaseCheckBase< Scalar >

+
+

Public Functions

+
+
+virtual ~Check() = default
+

Virtual destructor since class has virtual functions.

+
+ +
+
+virtual void test(const EclEpsScalingPointsInfo<Scalar> &endPoints) = 0
+

Run specific check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+virtual bool isViolated() const = 0
+

Whether or not last set of end-points violated this particular check.

+
+ +
+
+virtual bool isCritical() const = 0
+

Whether or not this check is critical to the simulator’s ability to run the case.

+

Violating critical checks should typically stop the run.

+
+ +
+
+virtual std::size_t numExportedCheckValues() const = 0
+

Number of Scalar values involved in the check.

+
+ +
+
+virtual void exportCheckValues(Scalar *exportedCheckValues) const = 0
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars. It is the responsibility of exportCheckValues() to populate this sequence with sensible values.

+
+
+
+ +
+
+virtual std::string description() const = 0
+

Descriptive textual summary of this check.

+

Might for instance be something along the lines of Oil-phase scaled end-points

+
+ +
+
+virtual std::string condition() const = 0
+

Textual representation of the consistency condition.

+
+ +
+
+virtual void columnNames(std::string *headers) const = 0
+

Retrieve names of the exported check values.

+

Order should match that of exportCheckValues().

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings. It is the responsibility of columnNames() to populate this sequence with sensible values.

+
+
+
+ +
+
+ +
+
+template<class Scalar>
class CheckDistributedWellConnections
+
+

Class checking that all connections are on active cells.

+

Works for distributed wells, too

+
+

Public Functions

+
+
+CheckDistributedWellConnections(const Well &well, const ParallelWellInfo<Scalar> &info)
+
+ +
+
+void connectionFound(std::size_t index)
+

Inidicate that the i-th completion was found.

+

in the local grid.

+
+
Parameters:
+

index – The index of the completion in Well::getConnections

+
+
+
+ +
+
+bool checkAllConnectionsFound()
+
+ +
+
+

Private Members

+
+
+std::vector<std::size_t> foundConnections_
+
+ +
+
+const Well &well_
+
+ +
+
+const ParallelWellInfo<Scalar> &pwinfo_
+
+ +
+
+ +
+
+struct CheckGroupConstraintsInnerWellIterations
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct CheckSatfuncConsistency
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct Co2InGasInput
+
+#include <FIPContainer.hpp>
+
+

Public Members

+
+
+double pv
+
+ +
+
+Scalar sg
+
+ +
+
+Scalar sgcr
+
+ +
+
+Scalar rhog
+
+ +
+
+Scalar xgW
+
+ +
+
+Scalar mM
+
+ +
+
+Scalar trappedGas
+
+ +
+
+Scalar strandedGas
+
+ +
+
+ +
+
+template<class Grid, class EquilGrid, class GridView>
class CollectDataOnIORank
+
+
+

Public Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator ioRank
+
+ +
+ +
+
+using CollectiveCommunication = typename Grid::Communication
+
+ +
+
+using P2PCommunicatorType = Dune::Point2PointCommunicator<Dune::SimpleMessageBuffer>
+
+ +
+
+using IndexMapType = std::vector<int>
+
+ +
+
+using IndexMapStorageType = std::vector<IndexMapType>
+
+ +
+
+

Public Functions

+
+
+CollectDataOnIORank(const Grid &grid, const EquilGrid *equilGrid, const GridView &gridView, const Dune::CartesianIndexMapper<Grid> &cartMapper, const Dune::CartesianIndexMapper<EquilGrid> *equilCartMapper, const std::set<std::string> &fipRegionsInterregFlow = {})
+
+ +
+
+void collect(const data::Solution &localCellData, const std::map<std::pair<std::string, int>, double> &localBlockData, std::map<std::pair<std::string, int>, double> &localExtraBlockData, const data::Wells &localWellData, const data::WellBlockAveragePressures &localWBPData, const data::GroupAndNetworkValues &localGroupAndNetworkData, const data::Aquifers &localAquiferData, const WellTestState &localWellTestState, const InterRegFlowMap &interRegFlows, const std::array<FlowsData<double>, 3> &localFlowsn, const std::array<FlowsData<double>, 3> &localFloresn)
+
+ +
+
+inline const std::map<std::pair<std::string, int>, double> &globalBlockData() const
+
+ +
+
+inline const data::Solution &globalCellData() const
+
+ +
+
+inline data::Solution &globalCellData()
+
+ +
+
+inline const data::Wells &globalWellData() const
+
+ +
+
+inline const data::WellBlockAveragePressures &globalWBPData() const
+
+ +
+
+inline const data::GroupAndNetworkValues &globalGroupAndNetworkData() const
+
+ +
+
+inline const data::Aquifers &globalAquiferData() const
+
+ +
+
+inline const WellTestState &globalWellTestState() const
+
+ +
+
+inline InterRegFlowMap &globalInterRegFlows()
+
+ +
+
+inline const InterRegFlowMap &globalInterRegFlows() const
+
+ +
+
+inline const std::array<FlowsData<double>, 3> &globalFlowsn() const
+
+ +
+
+inline const std::array<FlowsData<double>, 3> &globalFloresn() const
+
+ +
+
+inline bool isIORank() const
+
+ +
+
+inline bool isParallel() const
+
+ +
+
+int localIdxToGlobalIdx(unsigned localIdx) const
+
+ +
+
+inline const std::vector<int> &localIdxToGlobalIdxMapping() const
+
+ +
+
+inline bool doesNeedReordering() const
+
+ +
+
+inline std::size_t numCells() const
+
+ +
+
+inline const std::vector<int> &globalRanks() const
+
+ +
+
+bool isCartIdxOnThisRank(int cartIdx) const
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int dimension = Grid::dimension
+
+ +
+
+static const bool needsReordering = !std::is_same<Grid, EquilGrid>::value
+
+ +
+
+

Protected Attributes

+
+
+P2PCommunicatorType toIORankComm_
+
+ +
+
+InterRegFlowMap globalInterRegFlows_
+
+ +
+
+IndexMapType globalCartesianIndex_
+
+ +
+
+IndexMapType localIndexMap_
+
+ +
+
+IndexMapStorageType indexMaps_
+
+ +
+
+std::vector<int> globalRanks_
+
+ +
+
+data::Solution globalCellData_
+
+ +
+
+std::map<std::pair<std::string, int>, double> globalBlockData_
+
+ +
+
+data::Wells globalWellData_
+
+ +
+
+data::WellBlockAveragePressures globalWBPData_
+
+ +
+
+data::GroupAndNetworkValues globalGroupAndNetworkData_
+
+ +
+
+data::Aquifers globalAquiferData_
+
+ +
+
+WellTestState globalWellTestState_
+
+ +
+
+std::vector<int> localIdxToGlobalIdx_
+
+ +
+
+std::array<FlowsData<double>, 3> globalFlowsn_
+
+ +
+
+std::array<FlowsData<double>, 3> globalFloresn_
+
+ +
+
+std::vector<int> sortedCartesianIdx_
+

sorted list of cartesian indices present-

+

non-empty only when running in parallel

+
+ +
+
+ +
+
+template<class Scalar>
class CommunicateAboveBelow
+
+

Class to facilitate getting values associated with the above/below perforation.

+
+

Public Types

+
+
+enum Attribute
+

Values:

+
+
+enumerator owner
+
+ +
+
+enumerator overlap
+
+ +
+
+enumerator ownerAbove
+
+ +
+
+enumerator overlapAbove
+
+ +
+ +
+
+using LocalIndex = Dune::ParallelLocalIndex<Attribute>
+
+ +
+
+using IndexSet = Dune::ParallelIndexSet<int, LocalIndex, 50>
+
+ +
+
+

Public Functions

+
+
+explicit CommunicateAboveBelow(const Parallel::Communication &comm)
+
+ +
+
+void pushBackEclIndex(int above, int current, bool owner = true)
+

Adds information about original index of the perforations in ECL Schedule.

+
+

Warning

+

Theses indices need to be push in the same order as they appear in the ECL well specifiation. Use -1 if there is no perforation above.

+
+
+
Parameters:
+
    +
  • above – The ECL index of the next open perforation above.

  • +
  • current – The ECL index of the current open perforation.

  • +
+
+
+
+ +
+
+void clear()
+

Clear all the parallel information.

+
+ +
+
+void beginReset()
+

Indicates that we will add the index information.

+

+

See also

+

pushBackEclIndex

+
+

+
+ +
+
+int endReset()
+

Indicates that the index information is complete.

+

Sets up the commmunication structures to be used by communicate()

+
+
Returns:
+

The number of local perforations

+
+
+
+ +
+
+std::vector<Scalar> communicateAbove(Scalar first_value, const Scalar *current, std::size_t size)
+

Creates an array of values for the perforation above.

+
+
Parameters:
+
    +
  • first_value – Value to use for above of the first perforation

  • +
  • current – C-array of the values at the perforations

  • +
  • size – The size of the C-array and the returned vector

  • +
+
+
Returns:
+

a vector containing the values for the perforation above.

+
+
+
+ +
+
+std::vector<Scalar> communicateBelow(Scalar first_value, const Scalar *current, std::size_t size)
+

Creates an array of values for the perforation below.

+
+
Parameters:
+
    +
  • first_value – Value to use for above of the first perforation

  • +
  • current – C-array of the values at the perforations

  • +
  • size – The size of the C-array and the returned vector

  • +
+
+
Returns:
+

a vector containing the values for the perforation above.

+
+
+
+ +
+
+template<class RAIterator>
void partialSumPerfValues(RAIterator begin, RAIterator end) const
+

Do a (in place) partial sum on values attached to all perforations.

+

For distributed wells this may include perforations stored elsewhere. The result is stored in ther range given as the parameters

+
+
Parameters:
+
    +
  • begin – The start of the range

  • +
  • ebd – The end of the range

  • +
+
+
Template Parameters:
+

RAIterator – The type og random access iterator

+
+
+
+ +
+
+const IndexSet &getIndexSet() const
+

Get index set for the local perforations.

+
+ +
+
+int numLocalPerfs() const
+
+ +
+
+

Private Members

+
+
+Parallel::Communication comm_
+
+ +
+
+IndexSet current_indices_
+

Mapping of the local well index to ecl index.

+
+ +
+
+std::size_t num_local_perfs_ = {}
+
+ +
+
+ +
+
+template<class FluidSystem, class Indices>
class ComponentName
+
+#include <ComponentName.hpp>
+
+

Public Functions

+
+
+ComponentName()
+
+ +
+
+inline const std::string &name(const int compIdx) const
+
+ +
+
+

Private Members

+
+
+std::vector<std::string> names_ = {}
+
+ +
+
+ +
+
+template<class FluidSystem>
class CompositionalContainer
+
+
+

Public Types

+
+
+using AssignFunction = std::function<Scalar(const unsigned)>
+
+ +
+
+

Public Functions

+
+
+void allocate(const unsigned bufferSize, std::map<std::string, int> &rstKeywords)
+
+ +
+
+void assignGasFractions(const unsigned globalDofIdx, const AssignFunction &fractions)
+
+ +
+
+void assignMoleFractions(const unsigned globalDofIdx, const AssignFunction &fractions)
+
+ +
+
+void assignOilFractions(const unsigned globalDofIdx, const AssignFunction &fractions)
+
+ +
+
+void outputRestart(data::Solution &sol, ScalarBuffer &oil_saturation)
+
+ +
+
+inline bool allocated() const
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using ScalarBuffer = std::vector<Scalar>
+
+ +
+
+

Private Members

+
+
+bool allocated_ = false
+
+ +
+
+std::array<ScalarBuffer, numComponents> moleFractions_
+
+ +
+
+std::array<std::array<ScalarBuffer, numComponents>, numPhases> phaseMoleFractions_
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr int numComponents = FluidSystem::numComponents
+
+ +
+
+static constexpr int numPhases = FluidSystem::numPhases
+
+ +
+
+static constexpr int gasPhaseIdx = FluidSystem::gasPhaseIdx
+
+ +
+
+static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx
+
+ +
+
+static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx
+
+ +
+
+ +
+
+struct ConnData
+
+

Public Functions

+
+
+ConnData(const Connection &conn)
+
+ +
+
+

Public Members

+
+
+int I
+
+ +
+
+int J
+
+ +
+
+int K
+
+ +
+
+std::vector<Scalar> data
+
+ +
+
+ +
+
+class ConnectionIndexMap
+
+

Connection index mappings.

+
+

Public Functions

+
+
+inline explicit ConnectionIndexMap(const std::size_t numConns)
+

Constructor.

+
+
Parameters:
+

numConns[in] Total number of well connections, both open and closed/shut. Typically

WellConnections::size() 
+
+
+.

+
+
+
+ +
+
+inline void addActiveConnection(const int connIdx, const bool connIsOpen)
+

Enumerate/map new active connection.

+
+
Parameters:
+
    +
  • connIdx[in] Global well connection index. Must be an integer in the range 0..numConns-1.

  • +
  • connIsOpen[in] Whether or not the connection is open/flowing.

  • +
+
+
+
+ +
+
+inline const std::vector<int> &local() const
+

Get local connection IDs/indices of every existing well connection.

+

Negative value (-1) for connections that don’t intersect the current rank.

+
+ +
+
+inline int global(const int connIdx) const
+

Get global connection ID of local (on-rank) connection.

+
+
Parameters:
+

connIdx[in] Local connection index.

+
+
Returns:
+

Global connection ID of connIdx.

+
+
+
+ +
+
+inline int open(const int connIdx) const
+

Get open connection ID of local (on-rank) connection.

+
+
Parameters:
+

connIdx[in] Local connection index.

+
+
Returns:
+

Open connection ID of connIdx. Integer in the range 0..open connections - 1 if the connection is open or negative value (-1) otherwise.

+
+
+
+ +
+
+

Private Members

+
+
+std::vector<int> local_ = {}
+

Local connection IDs/indices of every existing well connection. Negative value (-1) for connections that don’t intersect the current rank.

+
+ +
+
+std::vector<int> global_ = {}
+

Global connection index of each on-rank reservoir connection. Reverse/transpose mapping of local_.

+
+ +
+
+std::vector<int> open_ = {}
+

Open connection index of each on-rank reservoir connection.

+
+ +
+
+int num_open_conns_ = {0}
+

Number of open connections on this rank.

+
+ +
+
+ +
+
+template<class Scalar>
struct ConnFiltrateData
+
+
+

Public Functions

+
+
+void resize(std::size_t num_perf)
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const ConnFiltrateData &rhs) const
+
+ +
+
+

Public Members

+
+
+std::vector<Scalar> rates
+
+ +
+
+std::vector<Scalar> total
+
+ +
+
+std::vector<Scalar> skin_factor
+
+ +
+
+std::vector<Scalar> thickness
+
+ +
+
+std::vector<Scalar> perm
+
+ +
+
+std::vector<Scalar> poro
+
+ +
+
+std::vector<Scalar> radius
+
+ +
+
+std::vector<Scalar> area_of_flow
+
+ +
+
+

Public Static Functions

+
+
+static ConnFiltrateData serializationTestObject()
+
+ +
+
+ +
+
+template<typename Scalar>
class ConnFracStatistics
+
+

Collection of fracturing statistics measures at the connection level.

+
+
Template Parameters:
+

Scalar – Statistics element type. Typically a built-in arithmetic type like float or double.

+
+
+
+

Public Types

+
+
+enum class Quantity : std::size_t
+

Known quantities for which this collection provides statistics measures.

+

Values:

+
+
+enumerator Pressure
+

Fracture pressure.

+
+ +
+
+enumerator FlowRate
+

Fracture flow rate.

+
+ +
+
+enumerator Width
+

Fracture width.

+
+ +
+
+enumerator NumQuantities
+
+ +
+ +
+
+using SamplePoint = std::array<Scalar, static_cast<std::underlying_type_t<Quantity>>(Quantity::NumQuantities)>
+

Sample point representation.

+

Client code must populate an object of this type in order to collect statistics.

+
+ +
+
+

Public Functions

+
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+

Convert between byte array and object representation.

+
+
Template Parameters:
+

Serializer – Byte array conversion protocol.

+
+
Parameters:
+

serializer[inout] Byte array conversion object.

+
+
+
+ +
+
+inline void reset()
+

Reset internal counters to prepare for calculating a new set of sample statistics.

+
+ +
+
+inline void addSamplePoint(const SamplePoint &samplePoint)
+

Include new element into sample.

+

Updates internal statistics counters.

+
+
Parameters:
+

samplePoint[in] Collection of sample values for the fracturing of the current well/reservoir connection.

+
+
+
+ +
+
+inline const RunningStatistics<Scalar> &statistics(const Quantity q) const
+

Retrieve collection of sample statistics for a single quantity.

+
+
Parameters:
+

q[in] Quantity for which to retrieve sample statistics.

+
+
Returns:
+

Sample statistics for quantity q.

+
+
+
+ +
+
+inline bool operator==(const ConnFracStatistics &that) const
+

Equality predicate.

+
+
Parameters:
+

that[in] Object against which

*this 
+
+
+ will be tested for equality.

+
+
Returns:
+

Whether or not

*this 
+
+
+ is the same as that.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static inline ConnFracStatistics serializationTestObject()
+

Create a serialisation test object.

+
+ +
+
+

Private Types

+
+
+using StatArray = std::array<RunningStatistics<Scalar>, static_cast<std::underlying_type_t<Quantity>>(Quantity::NumQuantities)>
+
+ +
+
+

Private Members

+
+
+StatArray quantity_ = {}
+

Collection of connection level fracturing statistics.

+
+ +
+
+ +
+
+template<class M, class X, class Y>
struct ConstructionTraits<MultithreadDILU<M, X, Y>>
+
+#include <ExtraSmoothers.hpp>
+

Policy for the construction of the MultithreadDILU smoother.

+
+

Public Types

+
+
+using Arguments = DefaultConstructionArgs<MultithreadDILU<M, X, Y>>
+
+ +
+
+

Public Static Functions

+
+
+static inline std::shared_ptr<MultithreadDILU<M, X, Y>> construct(Arguments &args)
+
+ +
+
+ +
+
+template<class M, class X, class Y, class C>
class ConstructionTraits<Opm::GhostLastMatrixAdapter<M, X, Y, C>>
+
+#include <WellOperators.hpp>
+
+

Public Types

+
+
+typedef ParallelOperatorArgs<M, C> Arguments
+
+ +
+
+

Public Static Functions

+
+
+static inline std::shared_ptr<Opm::GhostLastMatrixAdapter<M, X, Y, C>> construct(const Arguments &args)
+
+ +
+
+ +
+
+template<class Matrix, class Domain, class Range, class ParallelInfo>
struct ConstructionTraits<Opm::ParallelOverlappingILU0<Matrix, Domain, Range, ParallelInfo>>
+
+

Tells AMG how to construct the Opm::ParallelOverlappingILU0 smoother.

+
+
Template Parameters:
+
    +
  • Matrix – The type of the Matrix.

  • +
  • Domain – The type of the Vector representing the domain.

  • +
  • Range – The type of the Vector representing the range.

  • +
  • ParallelInfo – The type of the parallel information object used, e.g. Dune::OwnerOverlapCommunication

  • +
+
+
+
+

Public Types

+
+
+using T = Opm::ParallelOverlappingILU0<Matrix, Domain, Range, ParallelInfo>
+
+ +
+
+using Arguments = DefaultParallelConstructionArgs<T, ParallelInfo>
+
+ +
+
+using ParallelOverlappingILU0Pointer = std::shared_ptr<T>
+
+ +
+
+using T = Opm::ParallelOverlappingILU0<Matrix, Domain, Range, ParallelInfo>
+
+ +
+
+using Arguments = DefaultParallelConstructionArgs<T, ParallelInfo>
+
+ +
+
+using ParallelOverlappingILU0Pointer = T*
+
+ +
+
+typedef Opm::ParallelOverlappingILU0<Matrix, Domain, Range, ParallelInfo> T
+
+ +
+
+typedef DefaultParallelConstructionArgs<T, ParallelInfo> Arguments
+
+ +
+
+typedef T *ParallelOverlappingILU0Pointer
+
+ +
+
+using T = Opm::ParallelOverlappingILU0<Matrix, Domain, Range, ParallelInfo>
+
+ +
+
+using Arguments = DefaultParallelConstructionArgs<T, ParallelInfo>
+
+ +
+
+using ParallelOverlappingILU0Pointer = T*
+
+ +
+
+typedef Opm::ParallelOverlappingILU0<Matrix, Domain, Range, ParallelInfo> T
+
+ +
+
+typedef DefaultParallelConstructionArgs<T, ParallelInfo> Arguments
+
+ +
+
+typedef T *ParallelOverlappingILU0Pointer
+
+ +
+
+

Public Static Functions

+
+
+static inline ParallelOverlappingILU0Pointer construct(Arguments &args)
+
+ +
+
+static inline ParallelOverlappingILU0Pointer construct(Arguments &args)
+
+ +
+
+static inline void deconstruct(T *bp)
+
+ +
+
+static inline ParallelOverlappingILU0Pointer construct(Arguments &args)
+
+ +
+
+static inline void deconstruct(T *bp)
+
+ +
+
+static inline ParallelOverlappingILU0Pointer construct(Arguments &args)
+
+ +
+
+static inline void deconstruct(T *bp)
+
+ +
+
+static inline ParallelOverlappingILU0Pointer construct(Arguments &args)
+
+ +
+
+static inline void deconstruct(T *bp)
+
+ +
+
+ +
+
+template<class Range, class Domain, class ParallelInfo, class SeqPreconditioner>
struct ConstructionTraits<Opm::ParallelRestrictedOverlappingSchwarz<Range, Domain, ParallelInfo, SeqPreconditioner>>
+
+

Tells AMG how to construct the Opm::ParallelOverlappingILU0 smoother.

+
+
Template Parameters:
+
    +
  • Domain – The type of the Vector representing the domain.

  • +
  • Range – The type of the Vector representing the range.

  • +
  • ParallelInfo – The type of the parallel information object used, e.g. Dune::OwnerOverlapCommunication

  • +
  • SeqPreconditioner – The underlying sequential preconditioner to use.

  • +
+
+
+
+

Public Types

+
+
+typedef DefaultParallelConstructionArgs<SeqPreconditioner, ParallelInfo> Arguments
+
+ +
+
+typedef ConstructionTraits<SeqPreconditioner> SeqConstructionTraits
+
+ +
+
+typedef std::shared_ptr<Opm::ParallelRestrictedOverlappingSchwarz<Range, Domain, ParallelInfo, SeqPreconditioner>> ParallelRestrictedOverlappingSchwarzPointer
+

Construct a parallel restricted overlapping schwarz preconditioner.

+
+ +
+
+

Public Static Functions

+
+
+static inline ParallelRestrictedOverlappingSchwarzPointer construct(Arguments &args)
+
+ +
+
+static inline void deconstruct(Opm::ParallelRestrictedOverlappingSchwarz<Range, Domain, ParallelInfo, SeqPreconditioner> *bp)
+

Deconstruct and free a parallel restricted overlapping schwarz preconditioner.

+
+ +
+
+ +
+
+struct Context
+
+#include <OutputExtractor.hpp>
+

Context passed to element extractor functions.

+
+

Public Members

+
+
+unsigned globalDofIdx
+

Global degree-of-freedom index.

+
+ +
+
+unsigned dofIdx
+
+ +
+
+const FluidState &fs
+

Fluid state for cell.

+
+ +
+
+const IntensiveQuantities &intQuants
+

Intensive quantities for cell.

+
+ +
+
+const ElementContext &elemCtx
+
+ +
+
+ +
+
+struct Context
+
+#include <OutputExtractor.hpp>
+

Context passed to extractor functions.

+
+

Public Members

+
+
+unsigned globalDofIdx
+

Global degree-of-freedom index.

+
+ +
+
+unsigned pvtRegionIdx
+

pvt region for dof

+
+ +
+
+int episodeIndex
+

Current report step.

+
+ +
+
+const FluidState &fs
+

Fluid state for cell.

+
+ +
+
+const IntensiveQuantities &intQuants
+

Intensive quantities for cell.

+
+ +
+
+const HysteresisParams &hParams
+

Hysteresis parameters for cell.

+
+ +
+
+ +
+
+struct ConvergenceMonitoring
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct ConvergenceMonitoringCutOff
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 6
+
+ +
+
+ +
+
+template<class Scalar>
struct ConvergenceMonitoringDecayFactor
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.75
+
+ +
+
+ +
+
+struct ConvergenceMonitorParams
+
+

Struct holding convergence monitor params.

+
+

Public Members

+
+
+bool enabled_
+

Whether to enable convergence monitoring.

+
+ +
+
+int cutoff_
+

Cut-off limit for convergence monitoring.

+
+ +
+
+Scalar decay_factor_
+

Decay factor used in convergence monitoring.

+
+ +
+
+ +
+
+class ConvergenceOutputConfiguration
+
+

Parse comma separated option strings into a runtime configuration object for whether to output additional convergence information and, if so, what information to output.

+

Supported option string values are

+

    +
  • “none” &#8212; Dont want any additional convergence output.

  • +
  • ”steps” &#8212; Want additional convergence output pertaining to the converged solution at the end of each timestep.

  • +
  • ”iterations” &#8212; Want additional convergence output pertaining to each non-linar ieration in each timestep.

  • +
+

+

Option value “none” overrides all other options. In other words, if the user requests “none”, then there will be no additional convergence output, even if there are other options in the option string.

+
+

Public Types

+
+
+enum class Option : unsigned char
+

Option values.

+

None overrides all other options. In other words, if the user requests None, then there will be no additional convergence output, even if there are other options in the option string.

+

Values:

+
+
+enumerator None
+
+ +
+
+enumerator Steps
+
+ +
+
+enumerator Iterations
+
+ +
+ +
+
+

Public Functions

+
+
+explicit ConvergenceOutputConfiguration(std::string_view options, std::string_view optionName = "")
+

Constructor

+

Parses comma separated option string into runtime configuration option.

+
+
Parameters:
+
    +
  • options[in] Comma separated option string.

  • +
  • optionName[in] Name of command line option whose value is options. Used as diagnostic information only, and only if specified.

  • +
+
+
+
+ +
+
+inline bool any() const
+

Whether or not user wants any additional convergence output at all.

+
+ +
+
+inline bool want(const Option opt) const
+

Whether or not user wants specific convergence output.

+
+
Parameters:
+

opt[in] Specific convergence output type.

+
+
+
+ +
+
+

Private Members

+
+
+std::byte flag_ = {0}
+

Option flags. Treated as a small bitset.

+
+ +
+
+ +
+
+class ConvergenceOutputThread
+
+

Encapsulating object for thread processing producer’s convergence output requests.

+
+

Public Types

+
+
+using ComponentToPhaseName = std::function<std::string_view(int)>
+

Protocol for converting a phase/component ID into a human readable phase/component name.

+
+ +
+
+using ConvertToTimeUnits = std::function<double(double)>
+

Protocol for converting an SI elapsed time value into an equivalent time value in the run’s output conventions.

+

Will typically use

UnitSystem::from_si() 
+
+
+.

+
+ +
+
+

Public Functions

+
+
+explicit ConvergenceOutputThread(std::string_view outputDir, std::string_view baseName, ComponentToPhaseName getPhaseName, ConvertToTimeUnits convertTime, ConvergenceOutputConfiguration config, ConvergenceReportQueue &queue)
+

Constructor.

+
+
Parameters:
+
    +
  • outputDir[in] &#8212; Name of run’s output directory. Any file output will be written to this directory.

  • +
  • baseName[in] &#8212; Run’s base name. Output files will have this name and a type-specific file extension.

  • +
  • getPhaseName[in] &#8212; Callable object for converting component indices into human readable component names.

  • +
  • convertTime[in] &#8212; Callable object for converting SI elapsed time values into equivalent elapsed time values using run’s time conventions.

  • +
  • config[in] &#8212; Convergence output configuration options. Determines whether to output additional convergence information and, if so, what information to output.

  • +
  • queue[in] &#8212; Communication channel between producer thread and this output thread. User must form a valid queue prior to creating the output thread object.

  • +
+
+
+
+ +
+
+ConvergenceOutputThread(const ConvergenceOutputThread &src) = delete
+

Deleted copy constructor.

+
+ +
+
+ConvergenceOutputThread(ConvergenceOutputThread &&src)
+

Move constructor.

+
+ +
+
+ConvergenceOutputThread &operator=(const ConvergenceOutputThread &src) = delete
+

Deleted assignment operator.

+
+ +
+
+ConvergenceOutputThread &operator=(ConvergenceOutputThread &&src) = delete
+

Deleted move-assignment operator.

+
+ +
+
+~ConvergenceOutputThread()
+

Destructor.

+

Needed for pimpl idiom.

+
+ +
+
+void writeSynchronous(std::vector<ConvergenceReportQueue::OutputRequest> &&requests)
+

Perform synchronous file output of a sequence of requests.

+

Mostly for development and debugging purposes.

+
+
Parameters:
+

requests[in] Output request sequence. Thread takes ownership.

+
+
+
+ +
+
+void writeASynchronous()
+

Output thread worker function

+

This is the endpoint that users should associate to a

std::thread 
+
+
+ object.

+

Returns once last pending output request is written (cf.

ConvergenceReportQueue::signalLastOutputRequest() 
+
+
+.)

+
+ +
+
+

Private Members

+
+
+std::unique_ptr<Impl> pImpl_
+

Pointer to implementation.

+
+ +
+
+ +
+
+class ConvergenceReport
+
+

Represents the convergence status of the whole simulator, to make it possible to query and store the reasons for convergence failures.

+
+

Public Types

+
+
+enum Status
+

Values:

+
+
+enumerator AllGood
+
+ +
+
+enumerator ReservoirFailed
+
+ +
+
+enumerator WellFailed
+
+ +
+ +
+
+enum class Severity
+

Values:

+
+
+enumerator None
+
+ +
+
+enumerator Normal
+
+ +
+
+enumerator ConvergenceMonitorFailure
+
+ +
+
+enumerator TooLarge
+
+ +
+
+enumerator NotANumber
+
+ +
+ +
+
+using CnvPvSplit = std::pair<std::vector<double>, std::vector<int>>
+
+ +
+
+

Public Functions

+
+
+inline ConvergenceReport()
+
+ +
+
+inline explicit ConvergenceReport(const double reportTime)
+
+ +
+
+inline void clear()
+
+ +
+
+inline void setReservoirFailed(const ReservoirFailure &rf)
+
+ +
+
+inline void setWellFailed(const WellFailure &wf)
+
+ +
+
+template<typename ...Args>
inline void setReservoirConvergenceMetric(Args&&... args)
+
+ +
+
+template<typename ...Args>
inline void setWellConvergenceMetric(Args&&... args)
+
+ +
+
+inline void setWellGroupTargetsViolated(const bool wellGroupTargetsViolated)
+
+ +
+
+inline void setCnvPoreVolSplit(const CnvPvSplit &cnvPvSplit, const double eligiblePoreVolume)
+
+ +
+
+inline ConvergenceReport &operator+=(const ConvergenceReport &other)
+
+ +
+
+inline double reportTime() const
+
+ +
+
+inline double eligiblePoreVolume() const
+
+ +
+
+inline const CnvPvSplit &cnvPvSplit() const
+
+ +
+
+inline bool converged() const
+
+ +
+
+inline bool reservoirFailed() const
+
+ +
+
+inline bool wellFailed() const
+
+ +
+
+inline const std::vector<ReservoirFailure> &reservoirFailures() const
+
+ +
+
+inline const std::vector<ReservoirConvergenceMetric> &reservoirConvergence() const
+
+ +
+
+inline const std::vector<WellFailure> &wellFailures() const
+
+ +
+
+inline const std::vector<WellConvergenceMetric> &wellConvergence() const
+
+ +
+
+inline const PenaltyCard &getPenaltyCard() const
+
+ +
+
+inline void addNonConvergedPenalty()
+
+ +
+
+inline void addDistanceDecayPenalty()
+
+ +
+
+inline void addLargeWellResidualsPenalty()
+
+ +
+
+inline Severity severityOfWorstFailure() const
+
+ +
+
+template<typename Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Private Members

+
+
+double reportTime_
+
+ +
+
+Status status_
+
+ +
+
+std::vector<ReservoirFailure> res_failures_
+
+ +
+
+std::vector<WellFailure> well_failures_
+
+ +
+
+std::vector<ReservoirConvergenceMetric> res_convergence_
+
+ +
+
+std::vector<WellConvergenceMetric> well_convergence_
+
+ +
+
+bool wellGroupTargetsViolated_
+
+ +
+
+CnvPvSplit cnvPvSplit_ = {}
+
+ +
+
+double eligiblePoreVolume_ = {}
+
+ +
+
+PenaltyCard penaltyCard_
+
+ +
+
+ +
+
+class ConvergenceReportQueue
+
+

Communication channel between thread creating output requests and consumer thread writing those requests to a file.

+

Output thread has access to internal state. Producer thread uses public interface. Producer thread creates an object of this type and launches the output thread with a reference to that queue object.

+
+

Public Functions

+
+
+void enqueue(std::vector<OutputRequest> &&requests)
+

Push sequence of output requests, typically all substeps whether converged or not, of a single report step.

+
+
Parameters:
+

requests[in] Output request sequence. Queue takes ownership.

+
+
+
+ +
+
+void signalLastOutputRequest()
+

Signal end of output request stream.

+

No additional requests should be added to queue following a call to this member function. Output thread detects this signal, completes any pending output requests, and shuts down afterwards.

+
+ +
+
+

Private Members

+
+
+std::mutex mtx_ = {}
+

Mutex for critical sections protecting ‘requests_’.

+
+ +
+
+std::condition_variable cv_ = {}
+

Condition variable for threads waiting on changes to ‘requests_’.

+
+ +
+
+std::vector<OutputRequest> requests_ = {}
+

Pending convergence output requests.

+
+ +
+
+

Friends

+
+
+friend class ConvergenceOutputThread
+
+ +
+
+ +
+
+template<class Scalar>
struct CopyGatherScatter
+
+

Public Static Functions

+
+
+static inline const Scalar &gather(const Scalar *a, std::size_t i)
+
+ +
+
+static inline void scatter(Scalar *a, const Scalar &v, std::size_t i)
+
+ +
+
+ +
+
+template<class TypeTag>
class CpGridVanguard : public Opm::FlowBaseVanguard<TypeTag>, public Opm::GenericCpGridVanguard<GetPropType<TypeTag, Properties::ElementMapper>, GetPropType<TypeTag, Properties::GridView>, GetPropType<TypeTag, Properties::Scalar>>
+
+#include <CpGridVanguard.hpp>
+

Helper class for grid instantiation of ECL file-format using problems.

+

This class uses Dune::CpGrid as the simulation grid.

+
+

Public Types

+
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using CartesianIndexMapper = Dune::CartesianIndexMapper<Grid>
+
+ +
+
+using EquilGrid = GetPropType<TypeTag, Properties::EquilGrid>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using TransmissibilityType = Transmissibility<Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+

Public Functions

+
+
+inline explicit CpGridVanguard(Simulator &simulator)
+
+ +
+
+inline void checkConsistency()
+

Checking consistency of simulator

+
+ +
+
+inline void releaseGlobalTransmissibilities()
+

Free the memory occupied by the global transmissibility object.

+

After writing the initial solution, this array should not be necessary anymore.

+
+ +
+
+inline const TransmissibilityType &globalTransmissibility() const
+
+ +
+
+inline void loadBalance()
+

Distribute the simulation grid over multiple processes.

+

(For parallel simulation runs.)

+
+ +
+
+inline void addLgrs()
+

Add LGRs and update Leaf Grid View in the simulation grid.

+
+ +
+
+inline unsigned int gridEquilIdxToGridIdx(unsigned int elemIndex) const
+
+ +
+
+inline unsigned int gridIdxToEquilGridIdx(unsigned int elemIndex) const
+
+ +
+
+inline std::function<std::array<double, dimensionworld>(int)> cellCentroids() const
+

Get function to query cell centroids for a distributed grid.

+

Currently this only non-empty for a loadbalanced CpGrid. It is a function return the centroid for the given element index.

+
+ +
+
+inline const std::vector<int> &globalCell()
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int dimensionworld = Grid::dimensionworld
+
+ +
+
+static constexpr bool waterEnabled = Indices::waterEnabled
+
+ +
+
+static constexpr bool gasEnabled = Indices::gasEnabled
+
+ +
+
+static constexpr bool oilEnabled = Indices::oilEnabled
+
+ +
+
+

Protected Functions

+
+
+inline void createGrids_()
+
+ +
+
+inline virtual void allocTrans() override
+
+ +
+
+inline virtual double getTransmissibility(unsigned I, unsigned J) const override
+
+ +
+
+inline void filterConnections_()
+
+ +
+
+

Protected Attributes

+
+
+std::unique_ptr<TransmissibilityType> globalTrans_
+
+ +
+
+

Private Types

+
+
+using ParentType = FlowBaseVanguard<TypeTag>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+using Element = typename GridView::template Codim<0>::Entity
+
+ +
+
+

Friends

+
+
+friend class FlowBaseVanguard< TypeTag >
+
+ +
+
+ +
+
+struct CpGridVanguard
+
+#include <CpGridVanguard.hpp>
+
+

Public Types

+
+
+using InheritsFrom = std::tuple<FlowBaseVanguard>
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class CprCreation
+
+#include <CprCreation.hpp>
+

This class implements a Constrained Pressure Residual (CPR) preconditioner.

+

Subclassed by Opm::Accelerator::openclCPR< Scalar, block_size >, Opm::Accelerator::rocsparseCPR< Scalar, block_size >

+
+

Public Functions

+
+
+CprCreation()
+
+ +
+
+

Protected Types

+
+
+using DuneMat = Dune::BCRSMatrix<Dune::FieldMatrix<Scalar, 1, 1>>
+
+ +
+
+using DuneVec = Dune::BlockVector<Dune::FieldVector<Scalar, 1>>
+
+ +
+
+using MatrixOperator = Dune::MatrixAdapter<DuneMat, DuneVec, DuneVec>
+
+ +
+
+using DuneAmg = Dune::Amg::MatrixHierarchy<MatrixOperator, Dune::Amg::SequentialInformation>
+
+ +
+
+

Protected Functions

+
+
+void analyzeHierarchy()
+
+ +
+
+void analyzeAggregateMaps()
+
+ +
+
+void create_preconditioner_amg(BlockedMatrix<Scalar> *mat)
+
+ +
+
+

Protected Attributes

+
+
+int num_levels
+
+ +
+
+std::vector<Scalar> weights
+
+ +
+
+std::vector<Scalar> coarse_vals
+
+ +
+
+std::vector<Scalar> coarse_x
+
+ +
+
+std::vector<Scalar> coarse_y
+
+ +
+
+std::vector<Matrix<Scalar>> Amatrices
+
+ +
+
+std::vector<Matrix<Scalar>> Rmatrices
+
+ +
+
+std::vector<std::vector<int>> PcolIndices
+
+ +
+
+std::vector<std::vector<Scalar>> invDiags
+
+ +
+
+BlockedMatrix<Scalar> *mat = nullptr
+
+ +
+
+std::unique_ptr<DuneAmg> dune_amg
+
+ +
+
+std::unique_ptr<DuneMat> dune_coarse
+
+ +
+
+std::shared_ptr<MatrixOperator> dune_op
+
+ +
+
+std::vector<int> level_sizes
+
+ +
+
+std::vector<std::vector<int>> diagIndices
+
+ +
+
+std::conditional_t<std::is_same_v<Scalar, double>, Dune::UMFPack<DuneMat>, int> umfpack
+
+ +
+
+bool always_recalculate_aggregates = false
+
+ +
+
+bool recalculate_aggregates = true
+
+ +
+
+const int pressure_idx = 1
+
+ +
+
+unsigned num_pre_smooth_steps
+
+ +
+
+unsigned num_post_smooth_steps
+
+ +
+
+

Private Members

+
+
+int cprN
+
+ +
+
+int cprNb
+
+ +
+
+int cprnnz
+
+ +
+
+int cprnnzb
+
+ +
+
+ +
+
+struct CprReuseInterval
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 30
+
+ +
+
+ +
+
+struct CprReuseSetup
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 4
+
+ +
+
+ +
+
+struct CRS
+
+
+

Public Functions

+
+
+inline CRS()
+
+ +
+
+inline size_type rows() const
+
+ +
+
+inline size_type nonZeros() const
+
+ +
+
+inline void resize(const size_type nRows)
+
+ +
+
+inline void reserveAdditional(const size_type nonZeros)
+
+ +
+
+inline void push_back(const block_type &value, const size_type index)
+
+ +
+
+inline void clear()
+
+ +
+
+inline CRS()
+
+ +
+
+inline size_type rows() const
+
+ +
+
+inline size_type nonZeros() const
+
+ +
+
+inline void resize(const size_type nRows)
+
+ +
+
+inline void reserveAdditional(const size_type nonZeros)
+
+ +
+
+inline void push_back(const block_type &value, const size_type index)
+
+ +
+
+inline void clear()
+
+ +
+
+inline CRS()
+
+ +
+
+inline size_type rows() const
+
+ +
+
+inline size_type nonZeros() const
+
+ +
+
+inline void resize(const size_type nRows)
+
+ +
+
+inline void reserveAdditional(const size_type nonZeros)
+
+ +
+
+inline void push_back(const block_type &value, const size_type index)
+
+ +
+
+inline void clear()
+
+ +
+
+inline CRS()
+
+ +
+
+inline size_type rows() const
+
+ +
+
+inline size_type nonZeros() const
+
+ +
+
+inline void resize(const size_type nRows)
+
+ +
+
+inline void reserveAdditional(const size_type nonZeros)
+
+ +
+
+inline void push_back(const block_type &value, const size_type index)
+
+ +
+
+inline void clear()
+
+ +
+
+

Public Members

+
+
+std::vector<size_type> rows_
+
+ +
+
+std::vector<block_type> values_
+
+ +
+
+std::vector<size_type> cols_
+
+ +
+
+size_type nRows_
+
+ +
+
+ +
+
+class CuBlasHandle
+
+#include <CuBlasHandle.hpp>
+

The CuBlasHandle class provides a singleton for the simulator universal cuBlasHandle.

+

Example use:

#include <opm/simulators/linalg/gpuistl/detail/CuBlasHandle.hpp>
+void someFunction() {
+    auto& cublasHandle = ::Opm::gpuistl::detail::CuBlasHandle::getInstance();
+    int cuBlasVersion = -1;
+    OPM_CUBLAS_SAFE_CALL(cublasGetVersion(cublasHandle.get(), &cuBlasVersion));
+}
+
+
+

+
+

Public Functions

+
+
+CuBlasHandle(const CuBlasHandle&) = delete
+
+ +
+
+CuBlasHandle &operator=(const CuBlasHandle&) = delete
+
+ +
+
+~CuBlasHandle()
+

Calls cublasDestroy() on the handle

+
+ +
+
+cublasHandle_t get()
+

get returns the underlying cuBlas handle (to be used in calls to cublas)

+
+ +
+
+

Public Static Functions

+
+
+static CuBlasHandle &getInstance()
+

getInstance creates (if necessary) and returns the single unique instance of CuBlasHandle (singleton)

+
+ +
+
+

Private Functions

+
+
+CuBlasHandle()
+
+ +
+
+

Private Members

+
+
+cublasHandle_t m_handle
+
+ +
+
+ +
+
+struct CurveCollection
+

Association between points on a specific saturation function curves and the saturation function consistency checks to run on those points.

+
+

Public Functions

+
+
+explicit CurveCollection(std::unique_ptr<SatfuncCheckPointInterface<Scalar>> point, std::string_view pointName, const std::size_t numSamplePoints)
+

Constructor

+

Convenience only, as this enables constructing objects using vector<>::emplace_back().

+
+
Parameters:
+
    +
  • point[in] Callback protocol for defining and populating saturation function end-points on a single saturation function curve. Typically represents either a collection of per-region, tabulated and unscaled saturation functions or a collection of per-cell scaled saturation functions.

  • +
  • pointName[in] Name/category of the points in this set of checks. Might for instance be “Grid block” or “Saturation region”. Will be forwarded as a constructor argument to SatfuncConsistencyChecks from whence it will be used as a column header.

  • +
  • numSamplePoints[in] Upper bound on the number of end-point check violations to preserve for reporting purposes. Will be forwarded as a constructor argument to SatfuncConsistencyChecks.

  • +
+
+
+
+ +
+
+

Public Members

+
+
+std::unique_ptr<SatfuncCheckPointInterface<Scalar>> point
+

Callback protocol for defining and populating saturation function end-points on a single saturation function curve. Typically represents either a collection of per-region, tabulated and unscaled saturation functions or a collection of per-cell scaled saturation functions.

+
+ +
+
+SatfuncConsistencyChecks<Scalar> checks
+

Set of consistency checks to run against point.

+
+ +
+
+ +
+
+class CuSparseHandle
+
+#include <CuSparseHandle.hpp>
+

The CuSparseHandle class provides a singleton for the simulator universal cuSparseHandle.

+

Example use:

#include <opm/simulators/linalg/gpuistl/detail/CuSparseHandle.hpp>
+void someFunction() {
+    auto& cuSparseHandle = ::Opm::gpuistl::detail::CuSparseHandle::getInstance();
+    int cuSparseVersion = -1;
+    OPM_CUSPARSE_SAFE_CALL(cusparseGetVersion(cuSparseHandle.get(), &cuSparseVersion));
+}
+
+
+

+
+

Public Functions

+
+
+CuSparseHandle(const CuSparseHandle&) = delete
+
+ +
+
+CuSparseHandle &operator=(const CuSparseHandle&) = delete
+
+ +
+
+~CuSparseHandle()
+

Calls cuSparseDestroy on the handle

+
+ +
+
+cusparseHandle_t get()
+

get returns the underlying cuSparse handle (to be used in calls to cusparse)

+
+ +
+
+

Public Static Functions

+
+
+static CuSparseHandle &getInstance()
+

getInstance creates (if necessary) and returns the single unique instance of CuSparseHandle (singleton)

+
+ +
+
+

Private Functions

+
+
+CuSparseHandle()
+
+ +
+
+

Private Members

+
+
+cusparseHandle_t m_handle
+
+ +
+
+ +
+
+template<class T>
class CuSparseResource
+
+

The CuSparseResource class wraps a CuSparse resource in a proper RAII pattern.

+

Current we support the following types for T:

    +
  • bsrilu02Info_t

  • +
  • bsrsv2Info_t

  • +
  • cusparseMatDescr_t

  • +
+

+

More types are in principle supported by supplying a manual Creator and Destructor.

+

In addition to acting as an easier-to-use smart_ptr specialized for these types, it also adds error checking in the construction and deletion of these resources, which a plain std::smart_ptr would not support out of the box. It also solves the caveat of the pointer types of cuSparse resources not being exposed properly.

+

Example usage:

#include <opm/simulator/linalg/gpuistl/detail/CuSparseResource.hpp>
+
+void someFunction() {
+    auto resource = CuSparseResource<cuSparseMatDescr_t>();
+}
+
+
+

+
+

Public Types

+
+
+using CreatorType = typename std::function<cusparseStatus_t(T*)>
+
+ +
+
+using DeleterType = typename std::function<cusparseStatus_t(T)>
+
+ +
+
+

Public Functions

+
+
+CuSparseResource(CreatorType creator, DeleterType deleter)
+

CuSparseResource creates a new instance by calling creator, and will delete using deleter.

+
+

Note

+

Using this constructor it is possible to add support for new types not already accounted for.

+
+
+
Parameters:
+
    +
  • creator – a functor used to create an instance

  • +
  • deleter – a functor used to delete the instance

  • +
+
+
+
+ +
+
+CuSparseResource()
+

CuSparseResource will automatically select the proper creator and deleter based on the type (and throw an exception if not available)

+
+ +
+
+~CuSparseResource()
+

Calls the deleter functor

+
+ +
+
+CuSparseResource(const CuSparseResource&)
+
+ +
+
+CuSparseResource &operator=(const CuSparseResource&) = delete
+
+ +
+
+inline T get()
+

get returns the raw pointer to the resource.

+
+ +
+
+

Private Members

+
+
+T m_resource
+
+ +
+
+DeleterType m_deleter
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class cusparseSolverBackend : public Opm::Accelerator::GpuSolver<Scalar, block_size>
+
+

This class implements a cusparse-based ilu0-bicgstab solver on GPU.

+
+

Public Functions

+
+
+cusparseSolverBackend(int linear_solver_verbosity, int maxit, Scalar tolerance, unsigned int deviceID)
+

Construct a cusparseSolver

+
+
Parameters:
+
    +
  • linear_solver_verbosity[in] verbosity of cusparseSolver

  • +
  • maxit[in] maximum number of iterations for cusparseSolver

  • +
  • tolerance[in] required relative tolerance for cusparseSolver

  • +
  • deviceID[in] the device to be used

  • +
+
+
+
+ +
+
+~cusparseSolverBackend()
+

Destroy a cusparseSolver, and free memory.

+
+ +
+
+virtual SolverStatus solve_system(std::shared_ptr<BlockedMatrix<Scalar>> matrix, Scalar *b, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix, WellContributions<Scalar> &wellContribs, GpuResult &res) override
+

Solve linear system, A*x = b, matrix A must be in blocked-CSR format

+
+
Parameters:
+
    +
  • matrix[in] matrix A

  • +
  • b[in] input vector, contains N values

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
  • wellContribs[in] contains all WellContributions, to apply them separately, instead of adding them to matrix A

  • +
  • res[inout] summary of solver result

  • +
+
+
Returns:
+

status code

+
+
+
+ +
+
+virtual void get_result(Scalar *x) override
+

Get resulting vector x after linear solve, also includes post processing if necessary

+
+
Parameters:
+

x[inout] resulting x vector, caller must guarantee that x points to a valid array

+
+
+
+ +
+
+

Private Types

+
+
+using Base = GpuSolver<Scalar, block_size>
+
+ +
+
+

Private Functions

+
+
+void gpu_pbicgstab(WellContributions<Scalar> &wellContribs, GpuResult &res)
+

Solve linear system using ilu0-bicgstab

+
+
Parameters:
+
    +
  • wellContribs[in] contains all WellContributions, to apply them separately, instead of adding them to matrix A

  • +
  • res[inout] summary of solver result

  • +
+
+
+
+ +
+
+void initialize(std::shared_ptr<BlockedMatrix<Scalar>> matrix, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix)
+

Initialize GPU and allocate memory

+
+
Parameters:
+
    +
  • matrix[in] matrix for spmv

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
+
+
+
+ +
+
+void finalize()
+

Clean memory.

+
+ +
+
+void copy_system_to_gpu(std::shared_ptr<BlockedMatrix<Scalar>> matrix, Scalar *b, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix)
+

Copy linear system to GPU also copy matrix for preconditioner if needed

+
+
Parameters:
+
    +
  • matrix[in] matrix for spmv

  • +
  • b[in] input vector, contains N values

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
+
+
+
+ +
+
+void update_system_on_gpu(std::shared_ptr<BlockedMatrix<Scalar>> matrix, Scalar *b, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix)
+

Update linear system on GPU, don’t copy rowpointers and colindices, they stay the same also copy matrix for preconditioner if needed

+
+
Parameters:
+
    +
  • matrix[in] matrix for spmv

  • +
  • b[in] input vector, contains N values

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
+
+
+
+ +
+
+bool analyse_matrix()
+

Analyse sparsity pattern to extract parallelism

+
+
Returns:
+

true iff analysis was successful

+
+
+
+ +
+
+bool create_preconditioner()
+

Perform ilu0-decomposition

+
+
Returns:
+

true iff decomposition was successful

+
+
+
+ +
+
+void solve_system(WellContributions<Scalar> &wellContribs, GpuResult &res)
+

Solve linear system

+
+
Parameters:
+
    +
  • wellContribs[in] contains all WellContributions, to apply them separately, instead of adding them to matrix A

  • +
  • res[inout] summary of solver result

  • +
+
+
+
+ +
+
+

Private Members

+
+
+cublasHandle_t cublasHandle
+
+ +
+
+cusparseHandle_t cusparseHandle
+
+ +
+
+cudaStream_t stream
+
+ +
+
+cusparseMatDescr_t descr_B
+
+ +
+
+cusparseMatDescr_t descr_M
+
+ +
+
+cusparseMatDescr_t descr_L
+
+ +
+
+cusparseMatDescr_t descr_U
+
+ +
+
+bsrilu02Info_t info_M
+
+ +
+
+bsrsv2Info_t info_L
+
+ +
+
+bsrsv2Info_t info_U
+
+ +
+
+Scalar *d_bVals
+
+ +
+
+Scalar *d_mVals
+
+ +
+
+int *d_bCols
+
+ +
+
+int *d_mCols
+
+ +
+
+int *d_bRows
+
+ +
+
+int *d_mRows
+
+ +
+
+Scalar *d_x
+
+ +
+
+Scalar *d_b
+
+ +
+
+Scalar *d_r
+
+ +
+
+Scalar *d_rw
+
+ +
+
+Scalar *d_p
+
+ +
+
+Scalar *d_pw
+
+ +
+
+Scalar *d_s
+
+ +
+
+Scalar *d_t
+
+ +
+
+Scalar *d_v
+
+ +
+
+void *d_buffer
+
+ +
+
+Scalar *vals_contiguous
+
+ +
+
+bool analysis_done = false
+
+ +
+
+bool useJacMatrix = false
+
+ +
+
+int nnzbs_prec
+
+ +
+
+double c_copy = 0.0
+
+ +
+
+int N
+
+ +
+
+int Nb
+
+ +
+
+int nnz
+
+ +
+
+int nnzb
+
+ +
+
+int verbosity
+
+ +
+
+unsigned int deviceID
+
+ +
+
+int maxit
+
+ +
+
+Scalar tolerance
+
+ +
+
+bool initialized
+
+ +
+
+ +
+
+struct DamarisDaskFile
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = ""
+
+ +
+
+ +
+
+struct DamarisDedicatedCores
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 1
+
+ +
+
+ +
+
+struct DamarisDedicatedNodes
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 0
+
+ +
+
+ +
+
+struct DamarisLimitVariables
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = ""
+
+ +
+
+ +
+
+struct DamarisLogLevel
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "info"
+
+ +
+
+ +
+
+struct DamarisOutputHdfCollective
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct DamarisPythonParaviewScript
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = ""
+
+ +
+
+ +
+
+struct DamarisPythonScript
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = ""
+
+ +
+
+ +
+
+struct DamarisSaveMeshToHdf
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct DamarisSaveToHdf
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct DamarisSettings
+
+#include <DamarisKeywords.hpp>
+
+

Public Functions

+
+
+std::map<std::string, std::string> getKeywords(const Parallel::Communication &comm, const std::string &OutputDir)
+
+ +
+
+void SetRandString(void)
+
+ +
+
+

Public Members

+
+
+bool enableDamarisOutputCollective_ = true
+
+ +
+
+bool saveToDamarisHDF5_ = true
+
+ +
+
+bool saveMeshToHDF5_ = false
+
+ +
+
+std::string pythonFilename_
+
+ +
+
+std::string paraviewPythonFilename_
+
+ +
+
+std::string damarisSimName_
+
+ +
+
+std::string shmemName_
+
+ +
+
+std::string damarisLogLevel_ = "info"
+
+ +
+
+std::string damarisDaskFile_ = ""
+
+ +
+
+int nDamarisCores_ = 1
+
+ +
+
+int nDamarisNodes_ = 0
+
+ +
+
+long shmemSizeBytes_ = 536870912
+
+ +
+
+std::string rand_value_str_
+
+ +
+
+ +
+
+struct DamarisSharedMemoryName
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = ""
+
+ +
+
+ +
+
+struct DamarisSharedMemorySizeBytes
+
+
+

Public Static Attributes

+
+
+static constexpr long value = 536870912
+
+ +
+
+ +
+
+struct DamarisSimName
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = ""
+
+ +
+
+ +
+
+template<typename T>
class DamarisVar
+
+#include <DamarisVar.hpp>
+

class to store a Damaris variable representation for the XML file (can be used with class DamarisKeywords).

+

It is thought that the details stored in the object can be used to pass into an XML generation function e.g. DamarisKeywords

+
+

Public Functions

+
+
+DamarisVar(int dims, const std::vector<std::string> &param_names, const std::string &variable_name, int rank)
+

Constructor - sets private data values and dos not initialise the shared memory area.

+

N.B. These objects need a matching <variable …> and <paramater …> entries in the Damaris XML file

+

Two usages: Example XML definition: <parameter name=”my_param_name1” type=”int” value=”1” > <parameter name=”my_param_name2” type=”int” value=”1” > <layout name=”my_layout” type=”int” dimensions=”my_param_name1,my_param_name2” > <variable name=”MYVARNAME” layout=”my_layout” visualizable=”true”>

+

1/ The variable’s layout needs to be initialised via parameters : // Create the DamarisVar object: damaris::model::DamarisVar<int> MYVARNAME_2d(2,{std::string(“my_param_name1”), std::string(“my_param_name2”)}, {100, 25}, std::string(“MYVARNAME”), rank_); // sets the paramater sizes (so, here, my_param_name1 == 25 and my_param_name2 == 100) MYVARNAME_2d.SetDamarisParameterAndShmem( {25, 100 } }; // Get a pointer to the memeory and use it T * mymemory = MYVARNAME_2d.data(); … write data to mymemory …. // Damaris shared memory is tidied up when object MYVARNAME_2d is out of scope. or, 2/ The variable’s layout has been initialised via parameters in another variable (i.e. “my_param_name1” and “my_param_name2” have been previously set in the code) // Create the DamarisVar object: damaris::model::DamarisVar<int> MYVARNAME_2d(2, {std::string(“my_param_name1”), std::string(“my_param_name2”)}, std::string(“MYVARNAME”), rank_);

+

// explicitly state that the paramater values have been set somewhere else in the code previously. MYVARNAME_2d.ParameterIsSet();

+

N.B. This will not set the internal current_size_ value so the size() value will not be correct <- This is important to remember

+

MYVARNAME_2d.SetPointersToDamarisShmem() // Get a pointer to the memeory and use it T * mymemory = MYVARNAME_2d.data(); … write data to mymemory …. // Damaris shared memory is tidied up when object MYVARNAME_2d is out of scope.

+

/param [IN] dims Used to check that the inputs to SetDamarisPosition() have the same number of values - one value for each dimension /param [IN] param_names The name the Damaris paramaters. These names (in typical use) control a Damaris variables size (names are defined in the Damaris XML file). /param [IN] variable_name The name of the Damaris variable (defined in the Damaris XML file) /param [IN] rank The rank of the process. Used for error output.

+
+ +
+
+DamarisVar(int dims, const std::vector<std::string> &param_names, const std::vector<int> &param_values, const std::string &variable_name, int rank)
+

Constructor - Sets private data values and also initialises the Damaris shared memory area for writing (and reading) by specifying the values for the variables parameters . i.e. makes the data() pointer available and sets the size of the memory block it points to.

+

N.B. These objects need a matching <variable …> and <paramater …> entries in the Damaris XML file

+

Example use: Example XML definition: <parameter name=”my_param_name1” type=”int” value=”1” > <parameter name=”my_param_name2” type=”int” value=”1” > <layout name=”my_layout” type=”int” dimensions=”my_param_name1,my_param_name2” comment=”This

+

is a 2D variable” > <variable name=”MYVARNAME” layout=”my_layout” visualizable=”true”> // The paramaters are intialized in the constructor code damaris::model::DamarisVar<int> MYVARNAME_2d(2,{std::string(“my_param_name1”), std::string(“my_param_name2”)}, {100, 25}, std::string(“MYVARNAME”), rank_); T * mymemory = MYVARNAME_2d.data(); … write data to mymemory …. // Damaris shared memory is tidied up when object MYVARNAME_2d is out of scope.

+

+

/param [IN] dims Used to check that the inputs to SetDamarisPosition() have the same number of values - one value for each dimension /param [IN] param_names The name the Damaris paramaters. These names (in typical use) control a Damaris variables size (names are defined in the Damaris XML file). /param [IN] param_values The values of the paramaters - this defines how much memory we will have access to in the shared memory area (on the current and ongoing iterations, until later modified to new values) /param [IN] variable_name The name of the Damaris variable (defined in the Damaris XML file) /param [IN] rank The rank of the process. Used for error output.

+
+ +
+
+~DamarisVar()
+
+ +
+
+inline void parameterIsSet()
+

Allow a user to indicate that the Damaris variable has allocated a size - This method is usefull as a single parameter can control one or more layouts and a single layout can describe the size of multiple <variable> elements. i.e. Use when the current variable has had it’s paramater(s) set through via another variable.

+
+ +
+
+void printError() const
+
+ +
+
+inline bool hasError() const
+
+ +
+
+inline T *data()
+

Returns the data pointer to shared memory, or nullptr if it has not been allocated

+
+ +
+
+inline const std::string &variable_name() const
+
+ +
+
+std::string returnXMLForVariable()
+

Creates the XML representation of the variable from the available strings

+
+ +
+
+inline void setDamarisParameterAndShmem(const std::vector<int> &paramSizeVal)
+

Method to set the Damaris paramater values and set the shmem region data_ptr_

+

/param [IN] paramSizeVal : A vector of values to set the Damaris paramters to. One element per param_names_ string

+
+ +
+
+inline std::size_t size()
+

Returns the number of elements in the memory area. Used as a method for compatibility with std::vector

+
+ +
+
+void setDamarisParameter(const std::vector<int> &paramSizeVal)
+

Method to set the Damaris paramater values. Also calculates the total number of elements in the variable (current_size_) that is returned bt size() method.

+

/param [IN] paramSizeVal : An pointer to a value or array of values to set. One element per param_names_ string

+

/implicit : Implicitly uses the array of paramater names: param_names_

+
+ +
+
+void setDamarisPosition(const std::vector<int64_t> &positionsVals)
+

Method to set the Damaris position values.

+

/param [IN] positionsVals : An pointer to a value or array of values to set as the offset into the array. One element per dimension (one value for each dim_)

+

/implicit : Implicitly uses the variable name: variable_name_

+
+ +
+
+void setPointersToDamarisShmem()
+

Method to set the internal pointer (data_ptr_) to the Damaris shared memory area.

+

/implicit : Implicitly uses the Damaris variable name string variable_name_ /implicit : Implicitly uses the class data element : data_ptr_

+
+ +
+
+void commitVariableDamarisShmem()
+

Method to commit the memory of the data written to the Damaris variable - Indicates that we will not write any more data to data_ptr_

+

/implicit : Implicitly uses the variable name string variable_name_

+
+ +
+
+void clearVariableDamarisShmem()
+

Method to release the memory of the data written to the Damaris variable - Indicates that Damaris may take control of the shared memory area that was used for the variable data_ptr_

+

/implicit : Implicitly uses the variable name string variable_name_

+
+ +
+
+

Private Functions

+
+
+bool TestType(const std::string &variable_name)
+

Method to check that the template parameter T is the same as the requested type for the variable in the XML file

+
+ +
+
+void formatTypeError(const std::string &var_name, const std::string &type_name1, const std::string &type_name2)
+
+ +
+
+

Private Members

+
+
+int num_params_
+

Each paramater name string will need a value and they are set in SetDamarisParameter()

+
+ +
+
+std::vector<int> param_sizes_
+

The value for any paramaters that are being used to describe the size of the variables data array

+
+ +
+
+std::vector<int64_t> positions_
+

The offsets into the array that the data in the Variable starts from for this rank.

+
+ +
+
+bool parameters_set_
+

set to true after SetDamarisParameter() is call to ensure the variable has correct size for memory allocation in SetPointersToDamarisShmem()

+
+ +
+
+std::vector<std::string> param_names_
+

Contains one paramater name for each paramater that a variable depends on (via it’s Layout)

+
+ +
+
+std::string variable_name_
+

Reference string to the XML attribute name of the variable.

+
+ +
+
+int rank_
+

Rank of process - used for error reporting.

+
+ +
+
+int dam_err_
+

Set to != DAMARIS_OK if a Damaris error was returned by a Damaris API function call

+
+ +
+
+bool has_error_
+
+ +
+
+std::string dam_err_str_
+

Error string describing detected error.

+
+ +
+
+DamarisVarXMLAttributes xml_attributes_
+

The extra elements that need to be part of a Damaris <variable> type. They are simple string values that may reference other XML elements (and could be checked for existence etc.)

+
+ +
+
+T *data_ptr_
+

This pointer will be mapped to the Damaris shared memory area for the variable in the SetPointersToDamarisShmem() method. The type T will match the Layout type

+
+ +
+
+std::size_t current_size_
+

The total number of elements that may be held by this part of the variable - returned by the size() method. N.B. the actual size of the data area is dependent on how the <variable> XML is written, as paramaters can be augmented by basic maths relationships. This value may not even be initialised if ParameterIsSet() method is being used (e.g. in version 2/ of the constructor below).

+
+ +
+
+ +
+
+class DamarisVarXMLAttributes
+
+#include <DamarisVar.hpp>
+

This class contains the extra elements that need to be part of a Damaris <variable> type. They are simple string values that may reference other XML elements (and could be checked for existence etc.)

+
+

Public Functions

+
+
+DamarisVarXMLAttributes()
+
+ +
+
+std::string ReturnXMLForVariable()
+

Creates the XML representation of the variable from the available strings

+
+ +
+
+

Private Members

+
+
+std::string layout_
+

Reference string to the XML attribute layout being used to describe the shape of the variable. This is a required attribute.

+
+ +
+
+std::string mesh_
+

Reference string to the XML attribute mesh element - the mesh is used to define the spatial layout of data and is used by visualization backends to generate 2D/3D model images

+
+ +
+
+std::string type_
+

Reference string to the XML attribute type of data - “scalar” or “vector” (others tensor maybe). TODO: check if this attribute is used by the Damaris library anywhere.

+
+ +
+
+std::string visualizable_
+

Reference string to the XML attribute property that data can be sent to vis backends - “true” | “false”

+
+ +
+
+std::string unit_
+

Reference string to the XML attribute element denoting unit of the data

+
+ +
+
+std::string time_varying_
+

Reference string to the XML attribute to indicate if data changes over iterations - “true” | “false”

+
+ +
+
+std::string centering_
+

Reference string to the XML attribute to indicate where data aligns on a mesh - “zonal” | “nodal”

+
+ +
+
+std::string store_
+

Reference string to the XML attribute to indicate if data should be passed to I/O store (e.g. to HDF5 plugin)

+
+ +
+
+std::string script_
+

Reference string to the XML attribute to indicate if data should be published as Python NumPy data

+
+ +
+
+std::string select_mem_
+

Reference string to the XML attribute select. The referenced variables data is used as indices to select dat from memory to reorder output in the collective HDF5 data writer (Damaris version 1.8+)

+
+ +
+
+std::string select_file_
+

Reference string to the XML attribute select. The referenced variables data is used as indices to select positions in the dataset file to reorder output in the collective HDF5 data writer (Damaris version 1.8+)

+
+ +
+
+std::string select_subset_
+

Reference string to the XML attribute select. Used to specify the output dataset shape and how much data each rank contributes to it and the global offsets to the ranks data (Damaris version 1.8+)

+
+ +
+
+ +
+
+template<class TypeTag>
class DamarisWriter : public Opm::EclGenericWriter<GetPropType<TypeTag, Properties::Grid>, GetPropType<TypeTag, Properties::EquilGrid>, GetPropType<TypeTag, Properties::GridView>, GetPropType<TypeTag, Properties::ElementMapper>, GetPropType<TypeTag, Properties::Scalar>>
+
+#include <DamarisWriter.hpp>
+

Collects necessary output values and pass them to Damaris server processes.

+

Currently only passing through PRESSURE, GLOBAL_CELL_INDEX and MPI_RANK information. This class now passes through the 3D mesh information to Damaris to enable in situ visualization via Paraview or Ascent. And developed so that variables specified through the Eclipse input deck will be available to Damaris.

+
+

Public Functions

+
+
+inline explicit DamarisWriter(Simulator &simulator)
+
+ +
+
+inline void writeOutput(data::Solution &localCellData, bool isSubStep)
+

Writes localCellData through to Damaris servers. Sets up the unstructured mesh which is passed to Damaris.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+
+ +
+
+

Private Types

+
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using EquilGrid = GetPropType<TypeTag, Properties::EquilGrid>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using Element = typename GridView::template Codim<0>::Entity
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+using BaseType = EclGenericWriter<Grid, EquilGrid, GridView, ElementMapper, Scalar>
+
+ +
+
+using DamarisVarInt = DamarisOutput::DamarisVar<int>
+
+ +
+
+using DamarisVarChar = DamarisOutput::DamarisVar<char>
+
+ +
+
+using DamarisVarDbl = DamarisOutput::DamarisVar<double>
+
+ +
+
+

Private Functions

+
+
+inline void setGlobalIndexForDamaris()
+
+ +
+
+inline void writeDamarisGridOutput()
+
+ +
+
+inline void prepareLocalCellData(const bool isSubStep, const int reportStepNum)
+
+ +
+
+

Private Members

+
+
+int dam_err_
+
+ +
+
+int rank_
+
+ +
+
+int nranks_
+
+ +
+
+int numElements_
+

size of the unique vector elements

+
+ +
+
+std::unordered_set<std::string> wanted_vars_set_
+
+ +
+
+Simulator &simulator_
+
+ +
+
+std::unique_ptr<OutputBlackOilModule<TypeTag>> damarisOutputModule_
+
+ +
+
+std::vector<unsigned long long> elements_rank_offsets_
+
+ +
+
+bool damarisUpdate_ = false
+

Whenever this is true writeOutput() will set up Damaris mesh information and offsets of model fields.

+
+ +
+
+

Private Static Functions

+
+
+static inline bool enableDamarisOutput_()
+
+ +
+
+ +
+
+template<class Scalar>
struct DbhpMaxRel
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1.0
+
+ +
+
+ +
+
+struct DebugEmitCellPartition
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+class DeferredLogger
+
+#include <DeferredLogger.hpp>
+
+

Public Functions

+
+
+void info(const std::string &tag, const std::string &message)
+
+ +
+
+void warning(const std::string &tag, const std::string &message)
+
+ +
+
+void error(const std::string &tag, const std::string &message)
+
+ +
+
+void problem(const std::string &tag, const std::string &message)
+
+ +
+
+void bug(const std::string &tag, const std::string &message)
+
+ +
+
+void debug(const std::string &tag, const std::string &message)
+
+ +
+
+void note(const std::string &tag, const std::string &message)
+
+ +
+
+void info(const std::string &message)
+
+ +
+
+void warning(const std::string &message)
+
+ +
+
+void error(const std::string &message)
+
+ +
+
+void problem(const std::string &message)
+
+ +
+
+void bug(const std::string &message)
+
+ +
+
+void debug(const std::string &message)
+
+ +
+
+void note(const std::string &message)
+
+ +
+
+void logMessages()
+

Log all messages to the OpmLog backends, and clear the message container.

+
+ +
+
+void clearMessages()
+

Clear the message container without logging them.

+
+ +
+
+

Private Members

+
+
+std::vector<Message> messages_
+
+ +
+
+

Friends

+
+
+friend DeferredLogger gatherDeferredLogger(const DeferredLogger &local_deferredlogger, Parallel::Communication mpi_communicator)
+

Create a global log combining local logs.

+
+ +
+
+ +
+
+struct DensityPropertyFunctions
+
+
+

Public Members

+
+
+std::function<void(int, const std::vector<int>&, std::vector<Scalar>&)> mobility = {}
+
+ +
+
+std::function<void(int, const std::vector<int>&, std::vector<Scalar>&)> densityInCell = {}
+
+ +
+
+ +
+
+struct DestroyComm
+

Deleter that also frees custom MPI communicators.

+
+

Public Functions

+
+
+void operator()(Parallel::Communication *comm)
+
+ +
+
+ +
+
+template<class TypeTag, class MyTypeTag>
struct DiscNewtonMethod
+
+ +
+
+template<class TypeTag>
struct DiscreteFunction<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Types

+
+
+using BaseDiscretization = FvBaseDiscretization<TypeTag>
+
+ +
+
+using type = typename BaseDiscretization::BlockVectorWrapper
+
+ +
+
+ +
+
+template<typename Scalar>
class DisplacingOil_GO : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that critical saturation of displacing phase (oil/liquid) is strictly between critical and maximum gas saturations for the alternative (three point) horizontal scaling method (SCALECRS=YES) in the gas/oil two-phase system.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar swl_ = {}
+

Minimum (connate) water saturation.

+
+ +
+
+Scalar sogcr_ = {}
+

Critical oil saturation in two-phase gas/oil system.

+
+ +
+
+Scalar sgcr_ = {}
+

Critical gas saturation.

+
+ +
+
+Scalar sgu_ = {}
+

Maximum gas saturation.

+
+ +
+
+ +
+
+template<typename Scalar>
class DisplacingOil_OW : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that critical saturation of displacing phase (oil) is strictly between critical and maximum water saturations for the alternative (three point) horizontal scaling method (SCALECRS=YES) in the oil/water two-phase system.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar sgl_ = {}
+

Minimum gas saturation.

+
+ +
+
+Scalar sowcr_ = {}
+

Critical oil saturation in two-phase oil/water system.

+
+ +
+
+Scalar swcr_ = {}
+

Critical water saturation.

+
+ +
+
+Scalar swu_ = {}
+

Maximum water saturation.

+
+ +
+
+ +
+
+class DistributeIndexMapping : public P2PCommunicatorType::DataHandleInterface
+
+
+

Public Functions

+
+
+inline DistributeIndexMapping(const std::vector<int> &globalIndex, const std::vector<int> &distributedGlobalIndex, IndexMapType &localIndexMap, IndexMapStorageType &indexMaps, std::vector<int> &ranks, std::set<int> &recv, bool isIORank)
+
+ +
+
+inline ~DistributeIndexMapping()
+
+ +
+
+inline void pack(int link, MessageBufferType &buffer)
+
+ +
+
+inline void unpack(int link, MessageBufferType &buffer)
+
+ +
+
+

Protected Attributes

+
+
+const std::vector<int> &distributedGlobalIndex_
+
+ +
+
+IndexMapType &localIndexMap_
+
+ +
+
+IndexMapStorageType &indexMaps_
+
+ +
+
+std::map<int, int> globalPosition_
+
+ +
+
+std::set<int> &recv_
+
+ +
+
+std::vector<int> &ranks_
+
+ +
+
+ +
+
+struct DomainInfo
+
+#include <NlddReporting.hpp>
+

Struct holding information about domains used for printing a summary.

+
+

Public Functions

+
+
+inline explicit DomainInfo(std::size_t size)
+
+ +
+
+

Public Members

+
+
+std::vector<int> all_owned
+

All owned cells.

+
+ +
+
+std::vector<int> all_overlap
+

All overlap cells.

+
+ +
+
+std::vector<int> all_wells
+

All wells.

+
+ +
+
+std::vector<int> all_domains
+

All domains.

+
+ +
+
+ +
+
+template<class WellModel, class X, class Y>
class DomainWellModelAsLinearOperator : public Opm::WellModelAsLinearOperator<WellModel, X, Y>
+
+#include <WellOperators.hpp>
+
+

Public Types

+
+
+using WBase = WellModelAsLinearOperator<WellModel, X, Y>
+
+ +
+
+using field_type = typename WBase::field_type
+
+ +
+
+using PressureMatrix = typename WBase::PressureMatrix
+
+ +
+
+

Public Functions

+
+
+inline void setDomainIndex(int index)
+
+ +
+
+inline void apply(const X &x, Y &y) const override
+
+ +
+
+inline virtual void addWellPressureEquations(PressureMatrix &jacobian, const X &weights, const bool use_well_weights) const override
+
+ +
+
+

Private Members

+
+
+int domainIndex_ = -1
+
+ +
+
+ +
+
+template<class Scalar>
struct DpMaxRel
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.3
+
+ +
+
+ +
+
+template<class Scalar>
struct DsMax
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.2
+
+ +
+
+ +
+
+template<class TypeTag>
class DummyGradientCalculator
+
+

This is a “dummy” gradient calculator which does not do anything.

+

The blackoil simulator does not need any gradients: Volume fluxes are calculated via pressure differences instead of pressure gradients (i.e., transmissibilities instead of permeabilities), and an energy equation and molecular diffusion are not supported.

+
+

Public Functions

+
+
+template<bool prepareValues = true, bool prepareGradients = true>
inline void prepare(const ElementContext&, unsigned)
+
+ +
+
+template<class QuantityCallback, class QuantityType = Scalar>
inline QuantityType calculateValue(const ElementContext&, unsigned, const QuantityCallback&) const
+
+ +
+
+template<class QuantityCallback>
inline void calculateGradient(DimVector&, const ElementContext&, unsigned, const QuantityCallback&) const
+
+ +
+
+template<class QuantityCallback>
inline Scalar calculateBoundaryValue(const ElementContext&, unsigned, const QuantityCallback&)
+
+ +
+
+template<class QuantityCallback>
inline void calculateBoundaryGradient(DimVector&, const ElementContext&, unsigned, const QuantityCallback&) const
+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator dimWorld
+
+ +
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using DimVector = Dune::FieldVector<Scalar, dimWorld>
+
+ +
+
+ +
+
+template<class OriginalPreconditioner>
class DummyUpdatePreconditioner : public Dune::PreconditionerWithUpdate<OriginalPreconditioner::domain_type, OriginalPreconditioner::range_type>
+
+
+

Public Types

+
+
+using X = typename OriginalPreconditioner::domain_type
+
+ +
+
+using Y = typename OriginalPreconditioner::range_type
+
+ +
+
+

Public Functions

+
+
+template<class ...Args>
inline explicit DummyUpdatePreconditioner(Args&&... args)
+
+ +
+
+inline virtual void pre(X &x, Y &b) override
+
+ +
+
+inline virtual void apply(X &v, const Y &d) override
+
+ +
+
+inline virtual void post(X &x) override
+
+ +
+
+inline virtual SolverCategory::Category category() const override
+
+ +
+
+inline virtual void update() override
+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Private Members

+
+
+OriginalPreconditioner orig_precond_
+
+ +
+
+ +
+
+template<class Scalar>
struct DwellFractionMax
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.2
+
+ +
+
+ +
+
+template<class TypeTag>
class EcfvDiscretization
+
+ +
+
+struct EclDeckFileName
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = ""
+
+ +
+
+ +
+
+template<typename Scalar>
struct EclEpsScalingPointsInfo
+
+ +
+
+template<class Grid, class EquilGrid, class GridView, class ElementMapper, class Scalar>
class EclGenericWriter
+
+
+

Public Functions

+
+
+EclGenericWriter(const Schedule &schedule, const EclipseState &eclState, const SummaryConfig &summaryConfig, const Grid &grid, const EquilGrid *equilGrid, const GridView &gridView, const Dune::CartesianIndexMapper<Grid> &cartMapper, const Dune::CartesianIndexMapper<EquilGrid> *equilCartMapper, bool enableAsyncOutput, bool enableEsmry)
+
+ +
+
+const EclipseIO &eclIO() const
+
+ +
+
+void writeInit()
+
+ +
+
+inline void setTransmissibilities(const TransmissibilityType *globalTrans)
+
+ +
+
+inline void setSubStepReport(const SimulatorReportSingle &report)
+
+ +
+
+inline void setSimulationReport(const SimulatorReport &report)
+
+ +
+
+inline const std::vector<NNCdata> &getOutputNnc() const
+
+ +
+
+inline const CollectDataOnIORankType &collectOnIORank() const
+
+ +
+
+void extractOutputTransAndNNC(const std::function<unsigned int(unsigned int)> &map)
+
+ +
+
+

Protected Functions

+
+
+const TransmissibilityType &globalTrans() const
+
+ +
+
+unsigned int gridEquilIdxToGridIdx(unsigned int elemIndex) const
+
+ +
+
+void doWriteOutput(const int reportStepNum, const std::optional<int> timeStepNum, const bool isSubStep, data::Solution &&localCellData, data::Wells &&localWellData, data::GroupAndNetworkValues &&localGroupAndNetworkData, data::Aquifers &&localAquiferData, WellTestState &&localWTestState, const Action::State &actionState, const UDQState &udqState, const SummaryState &summaryState, const std::vector<Scalar> &thresholdPressure, Scalar curTime, Scalar nextStepSize, bool doublePrecision, bool isFlowsn, std::array<FlowsData<double>, 3> &&flowsn, bool isFloresn, std::array<FlowsData<double>, 3> &&floresn)
+
+ +
+
+void evalSummary(int reportStepNum, Scalar curTime, const data::Wells &localWellData, const data::WellBlockAveragePressures &localWBPData, const data::GroupAndNetworkValues &localGroupAndNetworkData, const std::map<int, data::AquiferData> &localAquiferData, const std::map<std::pair<std::string, int>, double> &blockData, const std::map<std::string, double> &miscSummaryData, const std::map<std::string, std::vector<double>> &regionData, const Inplace &inplace, const std::optional<Inplace> &initialInPlace, const InterRegFlowMap &interRegFlows, SummaryState &summaryState, UDQState &udqState)
+
+ +
+
+

Protected Attributes

+
+
+CollectDataOnIORankType collectOnIORank_
+
+ +
+
+const Grid &grid_
+
+ +
+
+const GridView &gridView_
+
+ +
+
+const Schedule &schedule_
+
+ +
+
+const EclipseState &eclState_
+
+ +
+
+std::unique_ptr<EclipseIO> eclIO_
+
+ +
+
+std::unique_ptr<TaskletRunner> taskletRunner_
+
+ +
+
+Scalar restartTimeStepSize_
+
+ +
+
+const TransmissibilityType *globalTrans_ = nullptr
+
+ +
+
+const Dune::CartesianIndexMapper<Grid> &cartMapper_
+
+ +
+
+const Dune::CartesianIndexMapper<EquilGrid> *equilCartMapper_
+
+ +
+
+const EquilGrid *equilGrid_
+
+ +
+
+SimulatorReportSingle sub_step_report_
+
+ +
+
+SimulatorReport simulation_report_
+
+ +
+
+mutable std::vector<NNCdata> outputNnc_
+
+ +
+
+mutable std::unique_ptr<data::Solution> outputTrans_
+
+ +
+
+

Private Types

+
+
+using CartesianIndexMapper = Dune::CartesianIndexMapper<Grid>
+
+ +
+
+using EquilCartesianIndexMapper = Dune::CartesianIndexMapper<EquilGrid>
+
+ +
+
+using CollectDataOnIORankType = CollectDataOnIORank<Grid, EquilGrid, GridView>
+
+ +
+
+using TransmissibilityType = Transmissibility<Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar>
+
+ +
+
+

Private Functions

+
+
+void computeTrans_(const std::unordered_map<int, int> &cartesianToActive, const std::function<unsigned int(unsigned int)> &map) const
+
+ +
+
+std::vector<NNCdata> exportNncStructure_(const std::unordered_map<int, int> &cartesianToActive, const std::function<unsigned int(unsigned int)> &map) const
+
+ +
+
+ +
+
+struct EclOutputDoublePrecision
+
+#include <EclWriter.hpp>
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct EclOutputInterval
+
+
+

Public Static Attributes

+
+
+static constexpr int value = -1
+
+ +
+
+ +
+
+template<class TypeTag, class OutputModule>
class EclWriter : public Opm::EclGenericWriter<GetPropType<TypeTag, Properties::Grid>, GetPropType<TypeTag, Properties::EquilGrid>, GetPropType<TypeTag, Properties::GridView>, GetPropType<TypeTag, Properties::ElementMapper>, GetPropType<TypeTag, Properties::Scalar>>
+
+#include <EclWriter.hpp>
+

Collects necessary output values and pass it to opm-common’s ECL output.

+

Caveats:

    +
  • For this class to do do anything meaningful, you will have to have the OPM module opm-common with ECL writing enabled.

  • +
  • The only DUNE grid which is currently supported is Dune::CpGrid from the OPM module “opm-grid”. Using another grid won’t fail at compile time but you will provoke a fatal exception as soon as you try to write an ECL output file.

  • +
  • This class requires to use the black oil model with the element centered finite volume discretization.

  • +
+

+
+

Public Functions

+
+
+inline explicit EclWriter(Simulator &simulator)
+
+ +
+
+inline ~EclWriter()
+
+ +
+
+inline const EquilGrid &globalGrid() const
+
+ +
+
+inline void evalSummaryState(bool isSubStep)
+

collect and pass data and pass it to eclIO writer

+
+ +
+
+inline void writeInitialFIPReport()
+

Writes the initial FIP report as configured in RPTSOL.

+
+ +
+
+inline void writeReports(const SimulatorTimer &timer)
+
+ +
+
+inline void writeOutput(data::Solution &&localCellData, bool isSubStep)
+
+ +
+
+inline void beginRestart()
+
+ +
+
+inline void endRestart()
+
+ +
+
+inline const OutputModule &outputModule() const
+
+ +
+
+inline OutputModule &mutableOutputModule() const
+
+ +
+
+inline Scalar restartTimeStepSize() const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableEnergy
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableMech
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableTemperature
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableSolvent
+
+ +
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Vanguard = GetPropType<TypeTag, Properties::Vanguard>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using EquilGrid = GetPropType<TypeTag, Properties::EquilGrid>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using Element = typename GridView::template Codim<0>::Entity
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+using ElementIterator = typename GridView::template Codim<0>::Iterator
+
+ +
+
+using BaseType = EclGenericWriter<Grid, EquilGrid, GridView, ElementMapper, Scalar>
+
+ +
+
+typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView> VertexMapper
+
+ +
+
+

Private Functions

+
+
+inline const EclipseState &eclState() const
+
+ +
+
+inline SummaryState &summaryState()
+
+ +
+
+inline Action::State &actionState()
+
+ +
+
+inline UDQState &udqState()
+
+ +
+
+inline const Schedule &schedule() const
+
+ +
+
+inline void prepareLocalCellData(const bool isSubStep, const int reportStepNum)
+
+ +
+
+inline void captureLocalFluxData()
+
+ +
+
+inline void writeWellspecReport(const SimulatorTimer &timer) const
+
+ +
+
+inline void writeWellflowReport(const SimulatorTimer &timer, const int simStep, const int wellsRequest) const
+
+ +
+
+inline int initialStep() const
+
+ +
+
+

Private Members

+
+
+Simulator &simulator_
+
+ +
+
+std::unique_ptr<OutputModule> outputModule_
+
+ +
+
+Scalar restartTimeStepSize_
+
+ +
+
+int rank_
+
+ +
+
+Inplace inplace_
+
+ +
+
+

Private Static Functions

+
+
+static inline bool enableEclOutput_()
+
+ +
+
+ +
+
+struct EdgeWeightsMethod
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "transmissibility"
+
+ +
+
+ +
+
+template<class Mapper>
class ElementIndexHandle
+
+

Communication handle to scatter the global index.

+
+

Public Types

+
+
+using DataType = int
+
+ +
+
+

Public Functions

+
+
+inline ElementIndexHandle(const Mapper &mapper, std::vector<int> &elementIndices)
+
+ +
+
+inline bool fixedSize(int, int)
+
+ +
+
+template<class T>
inline std::size_t size(const T&)
+
+ +
+
+template<class B, class T>
inline void gather(B &buffer, const T &t)
+
+ +
+
+template<class B, class T>
inline void scatter(B &buffer, const T &t, std::size_t)
+
+ +
+
+inline bool contains(int dim, int codim)
+
+ +
+
+

Private Members

+
+
+const Mapper &mapper_
+
+ +
+
+std::vector<int> &elementIndices_
+
+ +
+
+ +
+
+template<class EquilMapper, class Mapper>
class ElementIndexScatterHandle
+
+

Communication handle to scatter the global index.

+
+

Public Types

+
+
+using DataType = int
+
+ +
+
+

Public Functions

+
+
+inline ElementIndexScatterHandle(const EquilMapper &sendMapper, const Mapper &recvMapper, std::vector<int> &elementIndices)
+
+ +
+
+inline bool fixedSize(int, int)
+
+ +
+
+template<class T>
inline std::size_t size(const T&)
+
+ +
+
+template<class B, class T>
inline void gather(B &buffer, const T &t)
+
+ +
+
+template<class B, class T>
inline void scatter(B &buffer, const T &t, std::size_t)
+
+ +
+
+inline bool contains(int dim, int codim)
+
+ +
+
+

Private Members

+
+
+const EquilMapper &sendMapper_
+
+ +
+
+const Mapper &recvMapper_
+
+ +
+
+std::vector<int> &elementIndices_
+
+ +
+
+ +
+
+struct EnableAdaptiveTimeStepping
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class TypeTag, class MyTypeTag>
struct EnableApiTracking
+
+
+

Public Types

+
+
+using type = UndefinedProperty
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableApiTracking<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct EnableAsyncEclOutput
+
+#include <EclWriter.hpp>
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableBrine<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableConvectiveMixing<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableConvectiveMixing<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct EnableDamarisOutput
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag, class MyTypeTag>
struct EnableDebuggingChecks
+
+
+

Public Types

+
+
+using type = Properties::UndefinedProperty
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableDebuggingChecks<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableDebuggingChecks<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableDiffusion<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableDiffusion<TypeTag, TTag::FlowBaseProblemComp>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableDispersion<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableDispersion<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct EnableDriftCompensation
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct EnableDryRun
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "auto"
+
+ +
+
+ +
+
+struct EnableEclOutput
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = true
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct EnableEsmry
+
+#include <EclWriter.hpp>
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableExperiments<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableExtbo<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableFoam<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableFoam<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableMech<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableMICP<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableMICP<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct EnableOpmRstFile
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnablePolymer<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnablePolymer<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableSaltPrecipitation<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableSolvent<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableSolvent<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableTemperature<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableTemperature<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct EnableTerminalOutput
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class TypeTag, class MyTypeTag>
struct EnableThermalFluxBoundaries
+
+
+

Public Types

+
+
+using type = UndefinedProperty
+
+ +
+
+ +
+
+template<class TypeTag>
struct EnableThermalFluxBoundaries<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag, class MyTypeTag>
struct EnableTracerModel
+
+#include <TracerModel.hpp>
+
+

Public Types

+
+
+using type = UndefinedProperty
+
+ +
+
+ +
+
+struct EnableTuning
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct EnableWellOperabilityCheck
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct EnableWellOperabilityCheckIter
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct EnableWriteAllSolutions
+
+#include <EclWriter.hpp>
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct Entry
+
+#include <OutputExtractor.hpp>
+

Descriptor for extractors.

+
+

Public Members

+
+
+std::variant<AssignFunc, ScalarEntry, PhaseEntry> data
+

Extractor.

+
+ +
+
+bool condition = true
+

Additional condition for enabling extractor.

+
+ +
+
+ +
+
+template<class TypeTag, class MyTypeTag>
struct EquilGrid
+
+
+

Public Types

+
+
+using type = UndefinedProperty
+
+ +
+
+ +
+
+template<class TypeTag>
struct EquilGrid<TypeTag, TTag::AluGridVanguard>
+
+#include <AluGridVanguard.hpp>
+
+

Public Types

+
+
+using type = Dune::CpGrid
+
+ +
+
+ +
+
+template<class TypeTag>
struct EquilGrid<TypeTag, TTag::CpGridVanguard>
+
+#include <CpGridVanguard.hpp>
+
+

Public Types

+
+
+using type = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+ +
+
+template<class TypeTag>
struct EquilGrid<TypeTag, TTag::PolyhedralGridVanguard>
+
+
+

Public Types

+
+
+using type = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+ +
+
+template<class TypeTag>
class EquilInitializer
+
+

Computes the initial condition based on the EQUIL keyword from ECL.

+

So far, it uses the “initStateEquil()” function from opm-core. Since this method is very much glued into the opm-core data structures, it should be reimplemented in the medium to long term for some significant memory savings and less significant performance improvements.

+
+

Public Types

+
+
+using ScalarFluidState = BlackOilFluidState<Scalar, FluidSystem, enableTemperature, enableEnergy, enableDissolution, enableVapwat, enableBrine, enableSaltPrecipitation, has_disgas_in_water, Indices::numPhases>
+
+ +
+
+

Public Functions

+
+
+template<class EclMaterialLawManager>
inline EquilInitializer(const Simulator &simulator, EclMaterialLawManager &materialLawManager)
+
+ +
+
+inline const ScalarFluidState &initialFluidState(unsigned elemIdx) const
+

Return the initial thermodynamic state which should be used as the initial condition.

+

This is supposed to correspond to hydrostatic conditions.

+
+ +
+
+

Protected Attributes

+
+
+const Simulator &simulator_
+
+ +
+
+std::vector<ScalarFluidState> initialFluidStates_
+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator oilPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator gasPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator waterPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numComponents
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator oilCompIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator gasCompIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator waterCompIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator dimWorld
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableTemperature
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableEnergy
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableBrine
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableVapwat
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableSaltPrecipitation
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator has_disgas_in_water
+
+ +
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+ +
+
+template<class Scalar>
class EquilReg
+
+

Aggregate information base of an equilibration region.

+

Provides inquiry methods for retrieving depths of contacs and pressure values as well as a means of calculating fluid densities, dissolved gas-oil ratio and vapourised oil-gas ratios.

+
+
Template Parameters:
+

DensCalc – Type that provides access to a phase density calculation facility. Must implement an operator() declared as

std::vector<double> operator()(const double press,

+

const std::vector<double>& svol)

+
that calculates the phase densities of all phases in svol at fluid pressure press.

+
+
+
+

Public Types

+
+
+using CalcDissolution = Miscibility::RsFunction<Scalar>
+

Type of dissolved gas-oil ratio calculator.

+
+ +
+
+using CalcEvaporation = Miscibility::RsFunction<Scalar>
+

Type of vapourised oil-gas ratio calculator.

+
+ +
+
+using CalcWaterEvaporation = Miscibility::RsFunction<Scalar>
+

Type of vapourised water-gas ratio calculator.

+
+ +
+
+

Public Functions

+
+
+EquilReg(const EquilRecord &rec, std::shared_ptr<Miscibility::RsFunction<Scalar>> rs, std::shared_ptr<Miscibility::RsFunction<Scalar>> rv, std::shared_ptr<Miscibility::RsFunction<Scalar>> rvw, const TabulatedFunction &tempVdTable, const TabulatedFunction &saltVdTable, const int pvtIdx)
+

Constructor.

+
+
Parameters:
+
    +
  • rec[in] Equilibration data of current region.

  • +
  • rs[in] Calculator of dissolved gas-oil ratio.

  • +
  • rv[in] Calculator of vapourised oil-gas ratio.

  • +
  • rvw[in] Calculator of vapourised water-gas ratio.

  • +
  • pvtRegionIdx[in] The pvt region index

  • +
+
+
+
+ +
+
+Scalar datum() const
+

Datum depth in current region

+
+ +
+
+Scalar pressure() const
+

Pressure at datum depth in current region.

+
+ +
+
+Scalar zwoc() const
+

Depth of water-oil contact.

+
+ +
+
+Scalar pcowWoc() const
+

water-oil capillary pressure at water-oil contact.

+
+
Returns:
+

P_o - P_w at WOC.

+
+
+
+ +
+
+Scalar zgoc() const
+

Depth of gas-oil contact.

+
+ +
+
+Scalar pcgoGoc() const
+

Gas-oil capillary pressure at gas-oil contact.

+
+
Returns:
+

P_g - P_o at GOC.

+
+
+
+ +
+
+int equilibrationAccuracy() const
+

Accuracy/strategy for initial fluid-in-place calculation.

+
+
Returns:
+

zero (N=0) for centre-point method, negative (N<0) for the horizontal subdivision method with 2*(-N) intervals, and positive (N>0) for the tilted subdivision method with 2*N intervals.

+
+
+
+ +
+
+const CalcDissolution &dissolutionCalculator() const
+

Retrieve dissolved gas-oil ratio calculator of current region.

+
+ +
+
+const CalcEvaporation &evaporationCalculator() const
+

Retrieve vapourised oil-gas ratio calculator of current region.

+
+ +
+
+const CalcWaterEvaporation &waterEvaporationCalculator() const
+

Retrieve vapourised water-gas ratio calculator of current region.

+
+ +
+
+const TabulatedFunction &saltVdTable() const
+
+ +
+
+const TabulatedFunction &tempVdTable() const
+
+ +
+
+int pvtIdx() const
+

Retrieve pvtIdx of the region.

+
+ +
+
+

Private Types

+
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+

Private Members

+
+
+EquilRecord rec_
+

Equilibration data

+
+ +
+
+std::shared_ptr<Miscibility::RsFunction<Scalar>> rs_
+

RS calculator

+
+ +
+
+std::shared_ptr<Miscibility::RsFunction<Scalar>> rv_
+

RV calculator

+
+ +
+
+std::shared_ptr<Miscibility::RsFunction<Scalar>> rvw_
+

RVW calculator

+
+ +
+
+const TabulatedFunction &tempVdTable_
+
+ +
+
+const TabulatedFunction &saltVdTable_
+
+ +
+
+const int pvtIdx_
+
+ +
+
+ +
+
+struct EvaluationPoint
+

Convenience amalgamation of the deriveSaturations() input state. These values are almost always used in concert.

+
+

Public Members

+
+
+const Position *position = {nullptr}
+
+ +
+
+const Region *region = {nullptr}
+
+ +
+
+const PTable *ptable = {nullptr}
+
+ +
+
+ +
+
+struct Exec
+
+#include <OutputExtractor.hpp>
+

Descriptor for extractor execution.

+
+

Public Functions

+
+
+inline Exec(double *d, ScalarFunc &&e)
+

Move constructor.

+
+ +
+
+

Public Members

+
+
+double *data
+

Where to store output data.

+
+ +
+
+ScalarFunc extract
+

Extraction function to call.

+
+ +
+
+ +
+
+struct ExplicitRockCompaction
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class Scalar>
class ExtboContainer
+
+#include <ExtboContainer.hpp>
+
+

Public Functions

+
+
+void allocate(const unsigned bufferSize)
+
+ +
+
+void assignMassFractions(const unsigned globalDofIdx, const Scalar gas, const Scalar oil, const Scalar co2)
+
+ +
+
+void assignVolumes(const unsigned globalDofIdx, const Scalar xVolume, const Scalar yVolume)
+
+ +
+
+void assignZFraction(const unsigned globalDofIdx, const Scalar zFraction)
+
+ +
+
+void outputRestart(data::Solution &sol)
+
+ +
+
+inline bool allocated() const
+
+ +
+
+

Private Types

+
+
+using ScalarBuffer = std::vector<Scalar>
+
+ +
+
+

Private Members

+
+
+bool allocated_ = false
+
+ +
+
+ScalarBuffer X_volume_
+
+ +
+
+ScalarBuffer Y_volume_
+
+ +
+
+ScalarBuffer Z_fraction_
+
+ +
+
+ScalarBuffer mFracOil_
+
+ +
+
+ScalarBuffer mFracGas_
+
+ +
+
+ScalarBuffer mFracCo2_
+
+ +
+
+ +
+
+struct ExternalPartition
+
+
+

Public Static Attributes

+
+
+static constexpr auto *value = ""
+
+ +
+
+ +
+
+template<class TypeTag>
struct Extractor
+
+#include <OutputExtractor.hpp>
+

Wrapping struct holding types used for element-level data extraction.

+
+

Public Types

+
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using FluidState = typename IntensiveQuantities::FluidState
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using AssignFunc = std::function<void(const Context&)>
+

Callback for extractors handling their own assignements.

+
+ +
+
+using ScalarFunc = std::function<Scalar(const Context&)>
+

Callback for extractors assigned to a scalar buffer Return value to store in buffer

+
+ +
+
+using PhaseFunc = std::function<Scalar(const unsigned, const Context&)>
+

Callback for extractors assigned to a phase buffer Returns value to store in buffer for requested phase

+
+ +
+
+using ScalarBuffer = std::vector<Scalar>
+

A scalar buffer.

+
+ +
+
+using PhaseArray = std::array<ScalarBuffer, numPhases>
+

An array of buffers, one for each phase.

+
+ +
+
+

Public Static Functions

+
+
+template<std::size_t size>
static inline std::vector<Entry> removeInactive(std::array<Entry, size> &input)
+

Obtain vector of active extractors from an array of extractors.

+
+ +
+
+static inline void process(const Context &ectx, const std::vector<Entry> &extractors)
+

Process the given extractor entries.

+
+
Parameters:
+
    +
  • ectxContext for extractors

  • +
  • extractors – List of extractors to process

  • +
+
+
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numPhases = FluidSystem::numPhases
+
+ +
+
+ +
+
+struct FaceInfo
+
+
+

Public Members

+
+
+DimVector faceCenter
+
+ +
+
+int faceIdx
+
+ +
+
+unsigned elemIdx
+
+ +
+
+unsigned cartElemIdx
+
+ +
+
+ +
+
+template<typename TypeTag>
class FIBlackOilModel : public BlackOilModel<TypeTag>
+
+#include <FIBlackoilModel.hpp>
+
+

Public Functions

+
+
+inline explicit FIBlackOilModel(Simulator &simulator)
+
+ +
+
+inline void invalidateAndUpdateIntensiveQuantities(unsigned timeIdx) const
+
+ +
+
+inline void invalidateAndUpdateIntensiveQuantitiesOverlap(unsigned timeIdx) const
+
+ +
+
+template<class GridSubDomain>
inline void invalidateAndUpdateIntensiveQuantities(unsigned timeIdx, const GridSubDomain &gridSubDomain) const
+
+ +
+
+inline void updateFailed()
+

Called by the update() method if it was unsuccessful. This is primary a hook which the actual model can overload.

+
+ +
+
+inline const IntensiveQuantities &intensiveQuantities(unsigned globalIdx, unsigned timeIdx) const
+
+ +
+
+

Protected Attributes

+
+
+ElementChunks<GridView, Dune::Partitions::All> element_chunks_
+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numEq
+
+ +
+
+enumerator historySize
+
+ +
+ +
+
+using ParentType = BlackOilModel<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using ThreadManager = GetPropType<TypeTag, Properties::ThreadManager>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Element = typename GridView::template Codim<0>::Entity
+
+ +
+
+using ElementIterator = typename GridView::template Codim<0>::Iterator
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr bool gridIsUnchanging = std::is_same_v<GetPropType<TypeTag, Properties::Grid>, Dune::CpGrid>
+
+ +
+
+ +
+
+template<class FluidSystem>
class FIPContainer
+
+#include <FIPContainer.hpp>
+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using FIPMap = std::unordered_map<Inplace::Phase, std::vector<Scalar>>
+
+ +
+
+

Public Functions

+
+
+bool allocate(const std::size_t bufferSize, const SummaryConfig &summaryConfig, const bool forceAlloc, std::map<std::string, int> &rstKeywords)
+
+ +
+
+void add(const Inplace::Phase phase)
+
+ +
+
+const std::vector<Scalar> &get(const Inplace::Phase phase) const
+
+ +
+
+bool has(const Inplace::Phase phase) const
+
+ +
+
+bool hasCo2InGas() const
+
+ +
+
+void assignCo2InGas(const unsigned globalDofIdx, const Co2InGasInput &v)
+
+ +
+
+bool hasCo2InWater() const
+
+ +
+
+void assignCo2InWater(const unsigned globalDofIdx, const Scalar co2InWater, const Scalar mM)
+
+ +
+
+bool hasMicrobialMass() const
+
+ +
+
+void assignMicrobialMass(const unsigned globalDofIdx, const Scalar microbialMass)
+
+ +
+
+bool hasOxygenMass() const
+
+ +
+
+void assignOxygenMass(const unsigned globalDofIdx, const Scalar oxygenMass)
+
+ +
+
+bool hasUreaMass() const
+
+ +
+
+void assignUreaMass(const unsigned globalDofIdx, const Scalar ureaMass)
+
+ +
+
+bool hasBiofilmMass() const
+
+ +
+
+void assignBiofilmMass(const unsigned globalDofIdx, const Scalar biofilmMass)
+
+ +
+
+bool hasCalciteMass() const
+
+ +
+
+void assignCalciteMass(const unsigned globalDofIdx, const Scalar calciteMass)
+
+ +
+
+bool hasWaterMass() const
+
+ +
+
+void assignWaterMass(const unsigned globalDofIdx, const std::array<Scalar, numPhases> &fip, const Scalar rhoW)
+
+ +
+
+void assignGasWater(const unsigned globalDofIdx, const std::array<Scalar, numPhases> &fip, const Scalar gasInPlaceWater, const Scalar waterInPlaceGas)
+
+ +
+
+void assignOilGasDistribution(const unsigned globalDofIdx, const Scalar gasInPlaceLiquid, const Scalar oilInPlaceGas)
+
+ +
+
+void assignPoreVolume(const unsigned globalDofIdx, const Scalar value)
+
+ +
+
+void assignVolumesSurface(const unsigned globalDofIdx, const std::array<Scalar, numPhases> &fip)
+
+ +
+
+void assignVolumesReservoir(const unsigned globalDofIdx, const Scalar saltConcentration, const std::array<Scalar, numPhases> &fipr)
+
+ +
+
+void outputRestart(data::Solution &sol)
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr auto numPhases = FluidSystem::numPhases
+
+ +
+
+static constexpr auto gasPhaseIdx = FluidSystem::gasPhaseIdx
+
+ +
+
+static constexpr auto oilPhaseIdx = FluidSystem::oilPhaseIdx
+
+ +
+
+static constexpr auto waterPhaseIdx = FluidSystem::waterPhaseIdx
+
+ +
+
+

Private Members

+
+
+FIPMap fip_ = {}
+
+ +
+
+std::size_t bufferSize_ = 0
+
+ +
+
+struct Opm::FIPContainer::OutputRestart outputRestart_
+
+ +
+
+ +
+
+template<class Operator>
class FlexibleSolver : public Dune::InverseOperator<Operator::domain_type, Operator::range_type>
+
+#include <FlexibleSolver.hpp>
+

A solver class that encapsulates all needed objects for a linear solver (operator, scalar product, iterative solver and preconditioner) and sets them up based on runtime parameters, using the PreconditionerFactory for setting up preconditioners.

+
+

Public Types

+
+
+using VectorType = typename Operator::domain_type
+
+ +
+
+using AbstractPrecondType = Dune::PreconditionerWithUpdate<VectorType, VectorType>
+

Base class type of the contained preconditioner.

+
+ +
+
+

Public Functions

+
+
+FlexibleSolver(Operator &op, const Opm::PropertyTree &prm, const std::function<VectorType()> &weightsCalculator, std::size_t pressureIndex)
+

Create a sequential solver.

+
+ +
+
+template<class Comm>
FlexibleSolver(Operator &op, const Comm &comm, const Opm::PropertyTree &prm, const std::function<VectorType()> &weightsCalculator, std::size_t pressureIndex)
+

Create a parallel solver (if Comm is e.g. OwnerOverlapCommunication).

+
+ +
+
+virtual void apply(VectorType &x, VectorType &rhs, Dune::InverseOperatorResult &res) override
+
+ +
+
+virtual void apply(VectorType &x, VectorType &rhs, double reduction, Dune::InverseOperatorResult &res) override
+
+ +
+
+AbstractPrecondType &preconditioner()
+

Access the contained preconditioner.

+
+ +
+
+virtual Dune::SolverCategory::Category category() const override
+
+ +
+
+

Private Types

+
+
+using AbstractScalarProductType = Dune::ScalarProduct<VectorType>
+
+ +
+
+using AbstractSolverType = Dune::InverseOperator<VectorType, VectorType>
+
+ +
+
+

Private Functions

+
+
+template<class Comm>
void initOpPrecSp(Operator &op, const Opm::PropertyTree &prm, const std::function<VectorType()> weightsCalculator, const Comm &comm, std::size_t pressureIndex)
+
+ +
+
+void initOpPrecSp(Operator &op, const Opm::PropertyTree &prm, const std::function<VectorType()> weightsCalculator, const Dune::Amg::SequentialInformation&, std::size_t pressureIndex)
+
+ +
+
+template<class Comm>
void initSolver(const Opm::PropertyTree &prm, const Comm &comm)
+
+ +
+
+void recreateDirectSolver()
+
+ +
+
+template<class Comm>
void init(Operator &op, const Comm &comm, const Opm::PropertyTree &prm, const std::function<VectorType()> weightsCalculator, std::size_t pressureIndex)
+
+ +
+
+

Private Members

+
+
+Operator *linearoperator_for_solver_
+
+ +
+
+std::shared_ptr<AbstractPrecondType> preconditioner_
+
+ +
+
+std::shared_ptr<AbstractScalarProductType> scalarproduct_
+
+ +
+
+std::shared_ptr<AbstractSolverType> linsolver_
+
+ +
+
+bool direct_solver_ = false
+
+ +
+
+ +
+
+template<class Matrix, class Vector, class Comm>
struct FlexibleSolverInfo
+
+#include <ISTLSolver.hpp>
+
+

Public Types

+
+
+using AbstractSolverType = Dune::InverseOperator<Vector, Vector>
+
+ +
+
+using AbstractOperatorType = Dune::AssembledLinearOperator<Matrix, Vector, Vector>
+
+ +
+
+using AbstractPreconditionerType = Dune::PreconditionerWithUpdate<Vector, Vector>
+
+ +
+
+

Public Functions

+
+
+void create(const Matrix &matrix, bool parallel, const PropertyTree &prm, std::size_t pressureIndex, std::function<Vector()> weightCalculator, const bool forceSerial, Comm *comm)
+
+ +
+
+

Public Members

+
+
+std::unique_ptr<AbstractSolverType> solver_
+
+ +
+
+std::unique_ptr<AbstractOperatorType> op_
+
+ +
+
+std::unique_ptr<LinearOperatorExtra<Vector, Vector>> wellOperator_
+
+ +
+
+AbstractPreconditionerType *pre_ = nullptr
+
+ +
+
+std::size_t interiorCellNum_ = 0
+
+ +
+
+ +
+
+template<class TypeTag>
class FlowAluGridVanguard
+
+ +
+
+struct FlowBaseProblem
+
+
+

Public Types

+
+
+using InheritsFrom = std::tuple<CpGridVanguard>
+
+ +
+
+ +
+
+struct FlowBaseProblemBlackoil
+
+
+

Public Types

+
+
+using InheritsFrom = std::tuple<FlowBaseProblem>
+
+ +
+
+ +
+
+struct FlowBaseProblemComp
+
+
+

Public Types

+
+
+using InheritsFrom = std::tuple<FlowBaseProblem>
+
+ +
+
+ +
+
+template<class TypeTag>
class FlowBaseVanguard : public BaseVanguard<TypeTag>, public Opm::FlowGenericVanguard
+
+

Helper class for grid instantiation of ECL file-format using problems.

+

Subclassed by Opm::AluGridVanguard< TypeTag >, Opm::CpGridVanguard< TypeTag >, Opm::PolyhedralGridVanguard< TypeTag >

+
+

Public Types

+
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+

Public Functions

+
+
+inline explicit FlowBaseVanguard(Simulator &simulator)
+

Create the grid for problem data files which use the ECL file format.

+

This is the file format used by the commercial ECLiPSE simulator. Usually it uses a cornerpoint description of the grid.

+
+ +
+
+inline const CartesianIndexMapper &cartesianMapper() const
+
+ +
+
+inline const std::array<int, dimension> &cartesianDimensions() const
+

Returns the number of logically Cartesian cells in each direction.

+
+ +
+
+inline int cartesianSize() const
+

Returns the overall number of cells of the logically Cartesian grid.

+
+ +
+
+inline int equilCartesianSize() const
+

Returns the overall number of cells of the logically EquilCartesian grid.

+
+ +
+
+inline unsigned cartesianIndex(unsigned compressedCellIdx) const
+

Returns the Cartesian cell id for identifaction with ECL data.

+
+ +
+
+inline unsigned cartesianIndex(const std::array<int, dimension> &coords) const
+

Return the index of the cells in the logical Cartesian grid.

+
+ +
+
+inline int compressedIndex(int cartesianCellIdx) const
+

Return compressed index from cartesian index.

+
+
Returns:
+

compressed index of cell is in interior, -1 otherwise

+
+
+
+ +
+
+inline int compressedIndexForInterior(int cartesianCellIdx) const
+

Return compressed index from cartesian index only in interior.

+
+
Returns:
+

compressed index of cell is in interior, -1 otherwise

+
+
+
+ +
+
+inline void cartesianCoordinate(unsigned cellIdx, std::array<int, 3> &ijk) const
+

Extract Cartesian index triplet (i,j,k) of an active cell.

+
+
Parameters:
+
    +
  • cellIdx[in] Active cell index.

  • +
  • ijk[out] Cartesian index triplet

  • +
+
+
+
+ +
+
+inline unsigned equilCartesianIndex(unsigned compressedEquilCellIdx) const
+

Returns the Cartesian cell id given an element index for the grid used for equilibration.

+
+ +
+
+inline void equilCartesianCoordinate(unsigned cellIdx, std::array<int, 3> &ijk) const
+

Extract Cartesian index triplet (i,j,k) of an active cell of the grid used for EQUIL.

+
+
Parameters:
+
    +
  • cellIdx[in] Active cell index.

  • +
  • ijk[out] Cartesian index triplet

  • +
+
+
+
+ +
+
+inline Scalar cellCenterDepth(unsigned globalSpaceIdx) const
+

Returns the depth of a degree of freedom [m].

+

For ECL problems this is defined as the average of the depth of an element and is thus slightly different from the depth of an element’s centroid.

+
+ +
+
+inline const std::vector<Scalar> &cellCenterDepths() const
+
+ +
+
+inline Scalar cellThickness(unsigned globalSpaceIdx) const
+

Returns the thickness of a degree of freedom [m].

+

For ECL problems this is defined as the average of the depths of the top surface corners minus the average of the depths of the bottom surface corners The cell thickness is computed only when needed.

+
+ +
+
+inline std::size_t globalNumCells() const
+

Get the number of cells in the global leaf grid view. \warn This is a collective operation that needs to be called on all ranks.

+
+ +
+
+inline void setupCartesianToCompressed_()
+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register the common run-time parameters for all ECL simulator vanguards.

+
+ +
+
+

Protected Types

+
+
+using Element = typename GridView::template Codim<0>::Entity
+
+ +
+
+using CartesianIndexMapper = Dune::CartesianIndexMapper<Grid>
+
+ +
+
+

Protected Functions

+
+
+template<class CartMapper>
inline std::function<std::array<double, dimensionworld>(int)> cellCentroids_(const CartMapper &cartMapper, const bool &isCpGrid) const
+

Get function to query cell centroids for a distributed grid.

+

Currently this only non-empty for a loadbalanced CpGrid. It is a function return the centroid for the given element index.

+
+
Parameters:
+

cartMapper – The cartesian index mapper for lookup of cartesian indices

+
+
+
+ +
+
+inline void callImplementationInit()
+
+ +
+
+inline void updateCartesianToCompressedMapping_()
+
+ +
+
+inline void updateCellDepths_()
+
+ +
+
+inline void updateCellThickness_()
+
+ +
+
+

Protected Attributes

+
+
+std::unordered_map<int, int> cartesianToCompressed_
+

Mapping between cartesian and compressed cells. It is initialized the first time it is called.

+
+ +
+
+std::vector<Scalar> cellCenterDepth_
+

Cell center depths.

+
+ +
+
+std::vector<Scalar> cellThickness_
+

Cell thickness.

+
+ +
+
+std::vector<int> is_interior_
+

Whether a cells is in the interior.

+
+ +
+
+

Protected Static Attributes

+
+
+static const int dimension = Grid::dimension
+
+ +
+
+static const int dimensionworld = Grid::dimensionworld
+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableExperiments
+
+ +
+ +
+
+using ParentType = BaseVanguard<TypeTag>
+
+ +
+
+using Implementation = GetPropType<TypeTag, Properties::Vanguard>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+

Private Functions

+
+
+inline Scalar cellCenterDepth(const Element &element) const
+
+ +
+
+inline Scalar computeCellThickness(const typename GridView::template Codim<0>::Entity &element) const
+
+ +
+
+inline Implementation &asImp_()
+
+ +
+
+inline const Implementation &asImp_() const
+
+ +
+
+ +
+
+struct FlowBaseVanguard
+
+
+ +
+
+struct FlowEarlyBird
+
+#include <Main.hpp>
+
+

Public Types

+
+
+using InheritsFrom = std::tuple<FlowProblem>
+
+ +
+
+ +
+
+template<class GridView, class FluidSystem>
class FlowGenericProblem
+
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using TabulatedTwoDFunction = UniformXTabulated2DFunction<Scalar>
+
+ +
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+

Public Functions

+
+
+FlowGenericProblem(const EclipseState &eclState, const Schedule &schedule, const GridView &gridView)
+
+ +
+
+Scalar maxWaterSaturation(unsigned globalDofIdx) const
+

Returns an element’s historic maximum water phase saturation that was observed during the simulation.

+

In this context, “historic” means the the time before the current timestep began.

+

This is used for output of the maximum water saturation used as input for water induced rock compation ROCK2D/ROCK2DTR.

+
+ +
+
+Scalar minOilPressure(unsigned globalDofIdx) const
+

Returns an element’s historic minimum pressure of the oil phase that was observed during the simulation.

+

In this context, “historic” means the the time before the current timestep began.

+

This is used for output of the minimum pressure used as input for the irreversible rock compation option.

+
+ +
+
+Scalar overburdenPressure(unsigned elementIdx) const
+

Get the pressure of the overburden.

+

This method is mainly for output.

+
+ +
+
+inline Scalar referencePorosity(unsigned elementIdx, unsigned timeIdx) const
+

Returns the porosity of an element.

+

The reference porosity of an element is the porosity of the medium before modified by the current solution. Note that this method is not part of the generic eWoms problem API because it would bake the assumption that only the elements are the degrees of freedom into the interface.

+
+ +
+
+Scalar rockFraction(unsigned elementIdx, unsigned timeIdx) const
+

Returns the rockFraction of an element.

+

Usually 1 - porosity, but if pvmult is used to modify porosity we will apply the same multiplier to the rock fraction i.e. pvmult*(1 - porosity) and thus interpret multpv as a volume multiplier. This is to avoid negative rock volume for pvmult*porosity > 1

+
+ +
+
+inline void setPorosity(Scalar poro, unsigned elementIdx, unsigned timeIdx = 0)
+

Sets the porosity of an element.

+
+ +
+
+Scalar solventSaturation(unsigned elemIdx) const
+

Returns the initial solvent saturation for a given a cell index.

+
+ +
+
+Scalar solventRsw(unsigned elemIdx) const
+

Returns the initial solvent dissolved in water for a given a cell index.

+
+ +
+
+Scalar polymerConcentration(unsigned elemIdx) const
+

Returns the initial polymer concentration for a given a cell index.

+
+ +
+
+Scalar polymerMolecularWeight(const unsigned elemIdx) const
+

Returns the polymer molecule weight for a given cell index.

+
+ +
+
+Scalar microbialConcentration(unsigned elemIdx) const
+

Returns the initial microbial concentration for a given a cell index.

+
+ +
+
+Scalar oxygenConcentration(unsigned elemIdx) const
+

Returns the initial oxygen concentration for a given a cell index.

+
+ +
+
+Scalar ureaConcentration(unsigned elemIdx) const
+

Returns the initial urea concentration for a given a cell index.

+
+ +
+
+Scalar biofilmConcentration(unsigned elemIdx) const
+

Returns the initial biofilm concentration for a given a cell index.

+
+ +
+
+Scalar calciteConcentration(unsigned elemIdx) const
+

Returns the initial calcite concentration for a given a cell index.

+
+ +
+
+unsigned pvtRegionIndex(unsigned elemIdx) const
+

Returns the index the relevant PVT region given a cell index.

+
+ +
+
+unsigned satnumRegionIndex(unsigned elemIdx) const
+

Returns the index the relevant saturation function region given a cell index.

+
+ +
+
+unsigned miscnumRegionIndex(unsigned elemIdx) const
+

Returns the index the relevant MISC region given a cell index.

+
+ +
+
+unsigned plmixnumRegionIndex(unsigned elemIdx) const
+

Returns the index the relevant PLMIXNUM (for polymer module) region given a cell index.

+
+ +
+
+Scalar maxPolymerAdsorption(unsigned elemIdx) const
+

Returns the max polymer adsorption value.

+
+ +
+
+Scalar rockCompressibility(unsigned globalSpaceIdx) const
+

Direct access to rock compressibility.

+

While the above overload could be implemented in terms of this method, that would require always looking up the global space index, which is not always needed.

+
+ +
+
+Scalar porosity(unsigned globalSpaceIdx, unsigned timeIdx) const
+

Direct indexed access to the porosity.

+

For the FlowProblem, this method is identical to referencePorosity(). The intensive quantities object may apply various multipliers (e.g. ones which model rock compressibility and water induced rock compaction) to it which depend on the current physical conditions.

+
+ +
+
+bool vapparsActive(int episodeIdx) const
+
+ +
+
+inline int numPressurePointsEquil() const
+
+ +
+
+bool operator==(const FlowGenericProblem &rhs) const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Public Static Functions

+
+
+static FlowGenericProblem serializationTestObject(const EclipseState &eclState, const Schedule &schedule, const GridView &gridView)
+
+ +
+
+static std::string helpPreamble(int, const char **argv)
+
+ +
+
+static std::string briefDescription()
+
+ +
+
+static inline void setBriefDescription(const std::string &msg)
+

Specifies the string returned by briefDescription()

+

This string appears in the usage message.

+
+ +
+
+

Protected Types

+
+
+using Grid = std::remove_cv_t<typename std::remove_reference<decltype(gridView_.grid())>::type>
+
+ +
+
+using LookUpData = Opm::LookUpData<Grid, GridView>
+
+ +
+
+

Protected Functions

+
+
+void initFluidSystem_()
+
+ +
+
+inline bool shouldWriteOutput() const
+

Always returns true. The ecl output writer takes care of the rest.

+
+ +
+
+inline bool shouldWriteRestartFile() const
+

Returns true if an eWoms restart file should be written to disk.

+

The FlowProblem does not write any restart files using the ad-hoc format, only ones using the ECL format.

+
+ +
+
+bool beginEpisode_(bool enableExperiments, int episodeIdx)
+
+ +
+
+void beginTimeStep_(bool enableExperiments, int episodeIdx, int timeStepIndex, Scalar startTime, Scalar time, Scalar timeStepSize, Scalar endTime)
+
+ +
+
+void readRockParameters_(const std::vector<Scalar> &cellCenterDepths, std::function<std::array<int, 3>(const unsigned)> ijkIndex)
+
+ +
+
+void readRockCompactionParameters_()
+
+ +
+
+void readBlackoilExtentionsInitialConditions_(std::size_t numDof, bool enableSolvent, bool enablePolymer, bool enablePolymerMolarWeight, bool enableMICP)
+
+ +
+
+void updatePvtnum_()
+
+ +
+
+void updateSatnum_()
+
+ +
+
+void updateMiscnum_()
+
+ +
+
+void updatePlmixnum_()
+
+ +
+
+inline std::function<unsigned(unsigned)> lookupIdxOnLevelZeroAssigner_()
+
+ +
+
+

Protected Attributes

+
+
+const EclipseState &eclState_
+
+ +
+
+const Schedule &schedule_
+
+ +
+
+const GridView &gridView_
+
+ +
+
+std::array<std::vector<Scalar>, 2> referencePorosity_
+
+ +
+
+std::vector<int> pvtnum_
+
+ +
+
+std::vector<unsigned short> satnum_
+
+ +
+
+std::vector<unsigned short> miscnum_
+
+ +
+
+std::vector<unsigned short> plmixnum_
+
+ +
+
+std::vector<RockParams> rockParams_
+
+ +
+
+std::vector<unsigned short> rockTableIdx_
+
+ +
+
+std::vector<TabulatedTwoDFunction> rockCompPoroMultWc_
+
+ +
+
+std::vector<TabulatedTwoDFunction> rockCompTransMultWc_
+
+ +
+
+std::vector<TabulatedFunction> rockCompPoroMult_
+
+ +
+
+std::vector<TabulatedFunction> rockCompTransMult_
+
+ +
+
+std::vector<Scalar> rockCompTransMultVal_
+
+ +
+
+PolymerSolutionContainer<Scalar> polymer_
+
+ +
+
+std::vector<Scalar> maxOilSaturation_
+
+ +
+
+std::vector<Scalar> maxWaterSaturation_
+
+ +
+
+std::vector<Scalar> minRefPressure_
+
+ +
+
+std::vector<Scalar> overburdenPressure_
+
+ +
+
+std::vector<Scalar> solventSaturation_
+
+ +
+
+std::vector<Scalar> solventRsw_
+
+ +
+
+MICPSolutionContainer<Scalar> micp_
+
+ +
+
+bool enableTuning_
+
+ +
+
+Scalar initialTimeStepSize_
+
+ +
+
+Scalar maxTimeStepAfterWellEvent_
+
+ +
+
+int numPressurePointsEquil_
+
+ +
+
+bool enableDriftCompensation_
+
+ +
+
+bool explicitRockCompaction_
+
+ +
+
+const LookUpData lookUpData_
+
+ +
+
+

Protected Static Attributes

+
+
+static std::string briefDescription_
+
+ +
+
+

Private Functions

+
+
+template<class T>
void updateNum(const std::string &name, std::vector<T> &numbers, std::size_t num_regions)
+
+ +
+
+ +
+
+class FlowGenericVanguard
+
+

Subclassed by Opm::FlowBaseVanguard< TypeTag >

+
+

Public Types

+
+
+using ParallelWellStruct = std::vector<std::pair<std::string, bool>>
+
+ +
+
+

Public Functions

+
+
+FlowGenericVanguard()
+

Constructor.

+

Needs to be in compile unit.

+
+ +
+
+explicit FlowGenericVanguard(SimulationModelParams &&params)
+
+ +
+
+~FlowGenericVanguard()
+

Destructor.

+

Empty, but needs to be in compile unit.

+
+ +
+
+inline double setupTime()
+

Returns the wall time required to set up the simulator before it was born.

+
+ +
+
+void defineSimulationModel(SimulationModelParams &&params)
+

Set the simulation configuration objects.

+
+ +
+
+inline const EclipseState &eclState() const
+

Return a reference to the internalized ECL deck.

+
+ +
+
+inline EclipseState &eclState()
+
+ +
+
+inline const Schedule &schedule() const
+

Return a reference to the object that managages the ECL schedule.

+
+ +
+
+inline Schedule &schedule()
+
+ +
+
+inline const SummaryConfig &summaryConfig() const
+

Return a reference to the object that determines which quantities ought to be put into the ECL summary output.

+
+ +
+
+inline SummaryState &summaryState()
+

Returns the summary state.

+

The summary state is a small container object for computed, ready to use summary values. The values will typically be used by the UDQ, WTEST and ACTIONX calculations.

+
+ +
+
+inline const SummaryState &summaryState() const
+
+ +
+
+inline Action::State &actionState()
+

Returns the action state.

+

The ActionState keeps track of how many times the various actions have run.

+
+ +
+
+inline const Action::State &actionState() const
+
+ +
+
+inline UDQState &udqState()
+

Returns the udq state.

+

The UDQState keeps track of the result of UDQ evaluations.

+
+ +
+
+inline const UDQState &udqState() const
+
+ +
+
+inline std::unique_ptr<WellTestState> transferWTestState()
+
+ +
+
+inline const std::string &caseName() const
+

Returns the name of the case.

+

i.e., the all-uppercase version of the file name from which the deck is loaded with the “.DATA” suffix removed.

+
+ +
+
+inline Dune::EdgeWeightMethod edgeWeightsMethod() const
+

Parameter deciding the edge-weight strategy of the load balancer.

+
+ +
+
+inline int numJacobiBlocks() const
+

Number of blocks in the Block-Jacobi preconditioner.

+
+ +
+
+inline bool ownersFirst() const
+

Parameter that decide if cells owned by rank are ordered before ghost cells.

+
+ +
+
+inline bool enableDistributedWells() const
+

Whether perforations of a well might be distributed.

+
+ +
+
+inline bool enableEclOutput() const
+

Whether or not to emit result files that are compatible with a commercial reservoir simulator.

+
+ +
+
+inline const ParallelWellStruct &parallelWells() const
+

Retrieve collection (a vector of pairs) of well names and whether or not the corresponding well objects are perforated on the current rank.

+

Will only have usable values for CpGrid.

+
+ +
+
+template<class Serializer>
void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const FlowGenericVanguard &rhs) const
+
+ +
+
+

Public Static Functions

+
+
+static SimulationModelParams serializationTestParams()
+
+ +
+
+static std::string canonicalDeckPath(const std::string &caseName)
+

Returns the canonical path to a deck file.

+

The input can either be the canonical deck file name or the name of the case (i.e., without the .DATA extension)

+
+ +
+
+static void readDeck(const std::string &filename)
+

Read a deck.

+
+
Parameters:
+

filename – file to read

+
+
+
+ +
+
+static inline void setCommunication(std::unique_ptr<Opm::Parallel::Communication> comm)
+

Set global communication.

+
+ +
+
+static inline Parallel::Communication &comm()
+

Obtain global communicator.

+
+ +
+
+

Public Static Attributes

+
+
+static SimulationModelParams modelParams_
+
+ +
+
+

Protected Functions

+
+
+void updateOutputDir_(std::string outputDir, bool enableEclCompatFile)
+
+ +
+
+void updateNOSIM_(std::string_view enableDryRun)
+
+ +
+
+bool drsdtconEnabled() const
+
+ +
+
+std::unordered_map<std::size_t, const NumericalAquiferCell*> allAquiferCells() const
+
+ +
+
+void init()
+
+ +
+
+

Protected Attributes

+
+
+double setupTime_
+
+ +
+
+std::string caseName_
+
+ +
+
+std::string fileName_
+
+ +
+
+Dune::EdgeWeightMethod edgeWeightsMethod_
+
+ +
+
+bool ownersFirst_
+
+ +
+
+bool enableDistributedWells_
+
+ +
+
+bool enableEclOutput_
+
+ +
+
+bool allow_splitting_inactive_wells_
+
+ +
+
+std::string ignoredKeywords_
+
+ +
+
+std::optional<int> outputInterval_
+
+ +
+
+bool useMultisegmentWell_
+
+ +
+
+bool enableExperiments_
+
+ +
+
+std::unique_ptr<SummaryState> summaryState_
+
+ +
+
+std::unique_ptr<UDQState> udqState_
+
+ +
+
+std::unique_ptr<Action::State> actionState_
+
+ +
+
+std::unique_ptr<WellTestState> wtestState_
+
+ +
+
+std::shared_ptr<Python> python
+
+ +
+
+std::shared_ptr<EclipseState> eclState_
+
+ +
+
+std::shared_ptr<Schedule> eclSchedule_
+
+ +
+
+std::shared_ptr<SummaryConfig> eclSummaryConfig_
+
+ +
+
+ParallelWellStruct parallelWells_
+

Information about wells in parallel.

+

For each well in the model there is an entry with its name and a boolean indicating whether it perforates local cells.

+
+ +
+
+

Protected Static Functions

+
+
+template<class Scalar>
static void registerParameters_()
+
+ +
+
+

Protected Static Attributes

+
+
+static std::unique_ptr<Parallel::Communication> comm_
+
+ +
+
+ +
+
+struct FlowIstlSolver
+
+#include <ISTLSolver.hpp>
+
+

Public Types

+
+
+using InheritsFrom = std::tuple<FlowIstlSolverParams>
+
+ +
+
+ +
+
+struct FlowIstlSolverParams
+
+
+ +
+
+struct FlowLinearSolverParameters
+
+

This class carries all parameters for the NewtonIterationBlackoilInterleaved class.

+
+

Public Functions

+
+
+inline FlowLinearSolverParameters()
+
+ +
+
+void init(bool cprRequestedInDataFile)
+
+ +
+
+void reset()
+
+ +
+
+

Public Members

+
+
+double linear_solver_reduction_
+
+ +
+
+double relaxed_linear_solver_reduction_
+
+ +
+
+int linear_solver_maxiter_
+
+ +
+
+int linear_solver_restart_
+
+ +
+
+int linear_solver_verbosity_
+
+ +
+
+double ilu_relaxation_
+
+ +
+
+int ilu_fillin_level_
+
+ +
+
+MILU_VARIANT ilu_milu_
+
+ +
+
+bool ilu_redblack_
+
+ +
+
+bool ilu_reorder_sphere_
+
+ +
+
+bool newton_use_gmres_
+
+ +
+
+bool ignoreConvergenceFailure_
+
+ +
+
+bool scale_linear_system_
+
+ +
+
+bool is_nldd_local_solver_
+
+ +
+
+std::string linsolver_
+
+ +
+
+bool linear_solver_print_json_definition_
+
+ +
+
+int cpr_reuse_setup_
+
+ +
+
+int cpr_reuse_interval_
+
+ +
+
+std::string accelerator_mode_
+
+ +
+
+int gpu_device_id_
+
+ +
+
+int opencl_platform_id_
+
+ +
+
+bool opencl_ilu_parallel_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+
+ +
+
+ +
+
+template<class TypeTag>
class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>, public Opm::FlowGenericProblem<GetPropType<TypeTag, Properties::GridView>, GetPropType<TypeTag, Properties::FluidSystem>>
+
+#include <FlowProblem.hpp>
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+

Subclassed by Opm::FlowProblemBlackoil< TypeTag >, Opm::FlowProblemComp< TypeTag >

+
+

Public Functions

+
+
+inline explicit FlowProblem(Simulator &simulator)
+
+ +
+
+virtual ~FlowProblem() = default
+
+ +
+
+inline void prefetch(const Element &elem) const
+
+ +
+
+template<class Restarter>
inline void deserialize(Restarter &res)
+

This method restores the complete state of the problem and its sub-objects from disk.

+

The serialization format used by this method is ad-hoc. It is the inverse of the serialize() method.

+
+
Template Parameters:
+

Restarter – The deserializer type

+
+
Parameters:
+

res – The deserializer object

+
+
+
+ +
+
+template<class Restarter>
inline void serialize(Restarter &res)
+

This method writes the complete state of the problem and its subobjects to disk.

+

The file format used here is ad-hoc.

+
+ +
+
+inline int episodeIndex() const
+
+ +
+
+inline virtual void beginEpisode()
+

Called by the simulator before an episode begins.

+
+ +
+
+inline void beginTimeStep()
+

Called by the simulator before each time integration.

+
+ +
+
+inline void beginIteration()
+

Called by the simulator before each Newton-Raphson iteration.

+
+ +
+
+inline void endIteration()
+

Called by the simulator after each Newton-Raphson iteration.

+
+ +
+
+inline virtual void endTimeStep()
+

Called by the simulator after each time integration.

+
+ +
+
+inline virtual void endEpisode()
+

Called by the simulator after the end of an episode.

+
+ +
+
+inline virtual void writeOutput(bool verbose)
+

Write the requested quantities of the current solution into the output files.

+
+ +
+
+template<class Context>
inline const DimMatrix &intrinsicPermeability(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+
+ +
+
+inline const DimMatrix &intrinsicPermeability(unsigned globalElemIdx) const
+

This method returns the intrinsic permeability tensor given a global element index.

+

Its main (only?) usage is the ECL transmissibility calculation code…

+
+ +
+
+template<class Context>
inline Scalar transmissibility(const Context &context, unsigned fromDofLocalIdx, unsigned toDofLocalIdx) const
+
+ +
+
+inline Scalar transmissibility(unsigned globalCenterElemIdx, unsigned globalElemIdx) const
+

Direct access to the transmissibility between two elements.

+
+ +
+
+template<class Context>
inline Scalar diffusivity(const Context &context, unsigned fromDofLocalIdx, unsigned toDofLocalIdx) const
+
+ +
+
+inline Scalar diffusivity(const unsigned globalCellIn, const unsigned globalCellOut) const
+

give the transmissibility for a face i.e. pair. should be symmetric?

+
+ +
+
+inline Scalar dispersivity(const unsigned globalCellIn, const unsigned globalCellOut) const
+

give the dispersivity for a face i.e. pair.

+
+ +
+
+inline Scalar thermalTransmissibilityBoundary(const unsigned globalSpaceIdx, const unsigned boundaryFaceIdx) const
+

Direct access to a boundary transmissibility.

+
+ +
+
+template<class Context>
inline Scalar transmissibilityBoundary(const Context &elemCtx, unsigned boundaryFaceIdx) const
+
+ +
+
+inline Scalar transmissibilityBoundary(const unsigned globalSpaceIdx, const unsigned boundaryFaceIdx) const
+

Direct access to a boundary transmissibility.

+
+ +
+
+inline Scalar thermalHalfTransmissibility(const unsigned globalSpaceIdxIn, const unsigned globalSpaceIdxOut) const
+
+ +
+
+template<class Context>
inline Scalar thermalHalfTransmissibilityIn(const Context &context, unsigned faceIdx, unsigned timeIdx) const
+
+ +
+
+template<class Context>
inline Scalar thermalHalfTransmissibilityOut(const Context &context, unsigned faceIdx, unsigned timeIdx) const
+
+ +
+
+template<class Context>
inline Scalar thermalHalfTransmissibilityBoundary(const Context &elemCtx, unsigned boundaryFaceIdx) const
+
+ +
+
+inline const Vanguard::TransmissibilityType &eclTransmissibilities() const
+

Return a reference to the object that handles the “raw” transmissibilities.

+
+ +
+
+inline const TracerModel &tracerModel() const
+
+ +
+
+inline TracerModel &tracerModel()
+
+ +
+
+template<class Context>
inline Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

For the FlowProblem, this method is identical to referencePorosity(). The intensive quantities object may apply various multipliers (e.g. ones which model rock compressibility and water induced rock compaction) to it which depend on the current physical conditions.

+
+ +
+
+template<class Context>
inline Scalar dofCenterDepth(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

Returns the depth of an degree of freedom [m].

+

For ECL problems this is defined as the average of the depth of an element and is thus slightly different from the depth of an element’s centroid.

+
+ +
+
+inline Scalar dofCenterDepth(unsigned globalSpaceIdx) const
+

Direct indexed acces to the depth of an degree of freedom [m].

+

For ECL problems this is defined as the average of the depth of an element and is thus slightly different from the depth of an element’s centroid.

+
+ +
+
+template<class Context>
inline Scalar rockCompressibility(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+
+ +
+
+template<class Context>
inline Scalar rockReferencePressure(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+
+ +
+
+inline Scalar rockReferencePressure(unsigned globalSpaceIdx) const
+
+ +
+
+template<class Context>
inline const MaterialLawParams &materialLawParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+
+ +
+
+inline const MaterialLawParams &materialLawParams(unsigned globalDofIdx) const
+
+ +
+
+inline const MaterialLawParams &materialLawParams(unsigned globalDofIdx, FaceDir::DirEnum facedir) const
+
+ +
+
+template<class Context>
inline const SolidEnergyLawParams &solidEnergyLawParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

Return the parameters for the energy storage law of the rock.

+
+ +
+
+template<class Context>
inline const ThermalConductionLawParams &thermalConductionLawParams(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+
+ +
+
+inline std::shared_ptr<const EclMaterialLawManager> materialLawManager() const
+

Returns the ECL material law manager.

+

Note that this method is not part of the generic eWoms problem API because it would force all problens use the ECL material laws.

+
+ +
+
+template<class FluidState>
inline void updateRelperms(std::array<Evaluation, numPhases> &mobility, DirectionalMobilityPtr &dirMob, FluidState &fluidState, unsigned globalSpaceIdx) const
+
+ +
+
+inline std::shared_ptr<EclMaterialLawManager> materialLawManager()
+
+ +
+
+template<class Context>
inline unsigned pvtRegionIndex(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

Returns the index of the relevant region for thermodynmic properties.

+
+ +
+
+template<class Context>
inline unsigned satnumRegionIndex(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

Returns the index of the relevant region for thermodynmic properties.

+
+ +
+
+template<class Context>
inline unsigned miscnumRegionIndex(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

Returns the index of the relevant region for thermodynmic properties.

+
+ +
+
+template<class Context>
inline unsigned plmixnumRegionIndex(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

Returns the index of the relevant region for thermodynmic properties.

+
+ +
+
+template<class Context>
inline Scalar maxPolymerAdsorption(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

Returns the max polymer adsorption value.

+
+ +
+
+inline std::string name() const
+
+ +
+
+template<class Context>
inline Scalar temperature(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+
+ +
+
+inline Scalar temperature(unsigned globalDofIdx, unsigned) const
+
+ +
+
+inline const SolidEnergyLawParams &solidEnergyLawParams(unsigned globalSpaceIdx, unsigned) const
+
+ +
+
+inline const ThermalConductionLawParams &thermalConductionLawParams(unsigned globalSpaceIdx, unsigned) const
+
+ +
+
+inline Scalar maxOilSaturation(unsigned globalDofIdx) const
+

Returns an element’s historic maximum oil phase saturation that was observed during the simulation.

+

In this context, “historic” means the the time before the current timestep began.

+

This is a bit of a hack from the conceptional point of view, but it is required to match the results of the ‘flow’ and ECLIPSE 100 simulators.

+
+ +
+
+inline void setMaxOilSaturation(unsigned globalDofIdx, Scalar value)
+

Sets an element’s maximum oil phase saturation observed during the simulation.

+

In this context, “historic” means the the time before the current timestep began.

+

This a hack on top of the maxOilSaturation() hack but it is currently required to do restart externally. i.e. from the flow code.

+
+ +
+
+inline virtual void initialSolutionApplied()
+
+ +
+
+template<class Context>
inline void source(RateVector &rate, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

For this problem, the source term of all components is 0 everywhere.

+
+ +
+
+inline void source(RateVector &rate, unsigned globalDofIdx, unsigned timeIdx) const
+
+ +
+
+virtual void addToSourceDense(RateVector &rate, unsigned globalDofIdx, unsigned timeIdx) const = 0
+
+ +
+
+inline const WellModel &wellModel() const
+

Returns a reference to the ECL well manager used by the problem.

+

This can be used for inspecting wells outside of the problem.

+
+ +
+
+inline WellModel &wellModel()
+
+ +
+
+inline const AquiferModel &aquiferModel() const
+
+ +
+
+inline AquiferModel &mutableAquiferModel()
+
+ +
+
+inline bool nonTrivialBoundaryConditions() const
+
+ +
+
+inline Scalar nextTimeStepSize() const
+

Propose the size of the next time step to the simulator.

+

This method is only called if the Newton solver does converge, the simulator automatically cuts the time step in half without consultating this method again.

+
+ +
+
+template<class LhsEval>
inline LhsEval rockCompPoroMultiplier(const IntensiveQuantities &intQuants, unsigned elementIdx) const
+

Calculate the porosity multiplier due to water induced rock compaction.

+

TODO: The API of this is a bit ad-hoc, it would be better to use context objects.

+
+ +
+
+template<class LhsEval>
inline LhsEval rockCompTransMultiplier(const IntensiveQuantities &intQuants, unsigned elementIdx) const
+

Calculate the transmissibility multiplier due to water induced rock compaction.

+

TODO: The API of this is a bit ad-hoc, it would be better to use context objects.

+
+ +
+
+template<class LhsEval>
inline LhsEval wellTransMultiplier(const IntensiveQuantities &intQuants, unsigned elementIdx) const
+

Return the well transmissibility multiplier due to rock changes.

+
+ +
+
+inline std::pair<BCType, RateVector> boundaryCondition(const unsigned int globalSpaceIdx, const int directionId) const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+
+ +
+
+static inline int handlePositionalParameter(std::function<void(const std::string&, const std::string&)> addKey, std::set<std::string> &seenParams, std::string &errorMsg, int, const char **argv, int paramIdx, int)
+
+ +
+
+

Protected Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator dim
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator dimWorld
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numEq
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numComponents
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableConvectiveMixing
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableBrine
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableDiffusion
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableDispersion
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableEnergy
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableExperiments
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableExtbo
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableFoam
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableMICP
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enablePolymer
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enablePolymerMolarWeight
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableSaltPrecipitation
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableSolvent
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableTemperature
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableThermalFluxBoundaries
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator gasPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator oilPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator waterPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator gasCompIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator oilCompIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator waterCompIdx
+
+ +
+ +
+
+using BaseType = FlowGenericProblem<GetPropType<TypeTag, Properties::GridView>, GetPropType<TypeTag, Properties::FluidSystem>>
+
+ +
+
+using ParentType = GetPropType<TypeTag, Properties::BaseProblem>
+
+ +
+
+using Implementation = GetPropType<TypeTag, Properties::Problem>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Stencil = GetPropType<TypeTag, Properties::Stencil>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using GlobalEqVector = GetPropType<TypeTag, Properties::GlobalEqVector>
+
+ +
+
+using EqVector = GetPropType<TypeTag, Properties::EqVector>
+
+ +
+
+using Vanguard = GetPropType<TypeTag, Properties::Vanguard>
+
+ +
+
+using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Element = typename GridView::template Codim<0>::Entity
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using EclMaterialLawManager = typename GetProp<TypeTag, Properties::MaterialLaw>::EclMaterialLawManager
+
+ +
+
+using EclThermalLawManager = typename GetProp<TypeTag, Properties::SolidEnergyLaw>::EclThermalLawManager
+
+ +
+
+using MaterialLawParams = typename EclMaterialLawManager::MaterialLawParams
+
+ +
+
+using SolidEnergyLawParams = typename EclThermalLawManager::SolidEnergyLawParams
+
+ +
+
+using ThermalConductionLawParams = typename EclThermalLawManager::ThermalConductionLawParams
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using DofMapper = GetPropType<TypeTag, Properties::DofMapper>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using WellModel = GetPropType<TypeTag, Properties::WellModel>
+
+ +
+
+using AquiferModel = GetPropType<TypeTag, Properties::AquiferModel>
+
+ +
+
+using Toolbox = MathToolbox<Evaluation>
+
+ +
+
+using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>
+
+ +
+
+using TracerModel = GetPropType<TypeTag, Properties::TracerModel>
+
+ +
+
+using DirectionalMobilityPtr = Utility::CopyablePtr<DirectionalMobility<TypeTag>>
+
+ +
+
+

Protected Functions

+
+
+template<class UpdateFunc>
inline void updateProperty_(const std::string &failureMsg, UpdateFunc func)
+
+ +
+
+inline bool updateMaxOilSaturation_()
+
+ +
+
+inline bool updateMaxOilSaturation_(unsigned compressedDofIdx, const IntensiveQuantities &iq)
+
+ +
+
+inline bool updateMaxWaterSaturation_()
+
+ +
+
+inline bool updateMaxWaterSaturation_(unsigned compressedDofIdx, const IntensiveQuantities &iq)
+
+ +
+
+inline bool updateMinPressure_()
+
+ +
+
+inline bool updateMinPressure_(unsigned compressedDofIdx, const IntensiveQuantities &iq)
+
+ +
+
+inline std::function<std::vector<double>(const FieldPropsManager&, const std::string&)> fieldPropDoubleOnLeafAssigner_()
+
+ +
+
+template<typename IntType>
inline std::function<std::vector<IntType>(const FieldPropsManager&, const std::string&, bool)> fieldPropIntTypeOnLeafAssigner_()
+
+ +
+
+inline void readMaterialParameters_()
+
+ +
+
+inline void readThermalParameters_()
+
+ +
+
+inline void updateReferencePorosity_()
+
+ +
+
+inline virtual void readInitialCondition_()
+
+ +
+
+virtual void readEquilInitialCondition_() = 0
+
+ +
+
+virtual void readExplicitInitialCondition_() = 0
+
+ +
+
+inline bool updateHysteresis_()
+
+ +
+
+inline bool updateHysteresis_(unsigned compressedDofIdx, const IntensiveQuantities &iq)
+
+ +
+
+inline Scalar getRockCompTransMultVal(std::size_t dofIdx) const
+
+ +
+
+inline void updatePffDofData_()
+
+ +
+
+virtual void updateExplicitQuantities_(int episodeIdx, int timeStepSize, bool first_step_after_restart) = 0
+
+ +
+
+inline void readBoundaryConditions_()
+
+ +
+
+inline Scalar limitNextTimeStepSize_(Scalar dtNext) const
+
+ +
+
+inline int refPressurePhaseIdx_() const
+
+ +
+
+inline void updateRockCompTransMultVal_()
+
+ +
+
+template<class LhsEval>
inline LhsEval computeRockCompTransMultiplier_(const IntensiveQuantities &intQuants, unsigned elementIdx) const
+

Calculate the transmissibility multiplier due to water induced rock compaction.

+

TODO: The API of this is a bit ad-hoc, it would be better to use context objects.

+
+ +
+
+virtual void handleSolventBC(const BCProp::BCFace&, RateVector&) const = 0
+
+ +
+
+virtual void handlePolymerBC(const BCProp::BCFace&, RateVector&) const = 0
+
+ +
+
+virtual void handleMicrBC(const BCProp::BCFace&, RateVector&) const = 0
+
+ +
+
+virtual void handleOxygBC(const BCProp::BCFace&, RateVector&) const = 0
+
+ +
+
+virtual void handleUreaBC(const BCProp::BCFace&, RateVector&) const = 0
+
+ +
+
+

Protected Attributes

+
+
+Vanguard::TransmissibilityType transmissibilities_
+
+ +
+
+std::shared_ptr<EclMaterialLawManager> materialLawManager_
+
+ +
+
+std::shared_ptr<EclThermalLawManager> thermalLawManager_
+
+ +
+
+GlobalEqVector drift_
+
+ +
+
+WellModel wellModel_
+
+ +
+
+AquiferModel aquiferModel_
+
+ +
+
+PffGridVector<GridView, Stencil, PffDofData_, DofMapper> pffDofData_
+
+ +
+
+TracerModel tracerModel_
+
+ +
+
+BCData<int> bcindex_
+
+ +
+
+bool nonTrivialBoundaryConditions_ = false
+
+ +
+
+bool first_step_ = true
+
+ +
+
+

Private Functions

+
+
+inline Implementation &asImp_()
+
+ +
+
+inline const Implementation &asImp_() const
+
+ +
+
+ +
+
+struct FlowProblem
+
+
+

Public Types

+
+
+using InheritsFrom = std::tuple<FlowBaseProblemBlackoil, BlackOilModel>
+
+ +
+
+ +
+
+template<class TypeTag>
class FlowProblemBlackoil : public Opm::FlowProblem<TypeTag>
+
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+

Public Types

+
+
+using FlowProblemType = FlowProblem<TypeTag>
+
+ +
+
+

Public Functions

+
+
+inline explicit FlowProblemBlackoil(Simulator &simulator)
+
+ +
+
+inline virtual void beginEpisode() override
+

Called by the simulator before an episode begins.

+
+ +
+
+inline void finishInit()
+
+ +
+
+inline virtual void endTimeStep() override
+

Called by the simulator after each time integration.

+
+ +
+
+inline void endStepApplyAction()
+
+ +
+
+inline virtual void endEpisode() override
+

Called by the simulator after the end of an episode.

+
+ +
+
+inline void writeReports(const SimulatorTimer &timer)
+
+ +
+
+inline virtual void writeOutput(bool verbose) override
+

Write the requested quantities of the current solution into the output files.

+
+ +
+
+inline void finalizeOutput()
+
+ +
+
+inline virtual void initialSolutionApplied() override
+
+ +
+
+inline virtual void addToSourceDense(RateVector &rate, unsigned globalDofIdx, unsigned timeIdx) const override
+
+ +
+
+template<class LhsEval>
inline LhsEval permFactTransMultiplier(const IntensiveQuantities &intQuants, unsigned elementIdx) const
+

Calculate the transmissibility multiplier due to porosity reduction.

+

TODO: The API of this is a bit ad-hoc, it would be better to use context objects.

+
+ +
+
+inline const InitialFluidState &initialFluidState(unsigned globalDofIdx) const
+
+ +
+
+inline std::vector<InitialFluidState> &initialFluidStates()
+
+ +
+
+inline const std::vector<InitialFluidState> &initialFluidStates() const
+
+ +
+
+inline const EclipseIO &eclIO() const
+
+ +
+
+inline void setSubStepReport(const SimulatorReportSingle &report)
+
+ +
+
+inline void setSimulationReport(const SimulatorReport &report)
+
+ +
+
+inline InitialFluidState boundaryFluidState(unsigned globalDofIdx, const int directionId) const
+
+ +
+
+inline const EclWriterType &eclWriter() const
+
+ +
+
+inline EclWriterType &eclWriter()
+
+ +
+
+inline Scalar maxGasDissolutionFactor(unsigned timeIdx, unsigned globalDofIdx) const
+

Returns the maximum value of the gas dissolution factor at the current time for a given degree of freedom.

+
+ +
+
+inline Scalar maxOilVaporizationFactor(unsigned timeIdx, unsigned globalDofIdx) const
+

Returns the maximum value of the oil vaporization factor at the current time for a given degree of freedom.

+
+ +
+
+inline bool recycleFirstIterationStorage() const
+

Return if the storage term of the first iteration is identical to the storage term for the solution of the previous time step.

+

For quite technical reasons, the storage term cannot be recycled if either DRSDT or DRVDT are active. Nor if the porosity is changes between timesteps using a pore volume multiplier (i.e., poreVolumeMultiplier() != 1.0)

+
+ +
+
+template<class Context>
inline void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

The reservoir problem uses a constant boundary condition for the whole domain.

+
+ +
+
+inline Scalar drsdtcon(unsigned elemIdx, int episodeIdx) const
+
+ +
+
+inline bool drsdtconIsActive(unsigned elemIdx, int episodeIdx) const
+
+ +
+
+template<class Context>
inline void boundary(BoundaryRateVector &values, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

Reservoir simulation uses no-flow conditions as default for all boundaries.

+
+ +
+
+inline void readSolutionFromOutputModule(const int restart_step, bool fip_init)
+

Read simulator solution state from the outputmodule (used with restart)

+

fip_init is used when calculating original FIP from restart state

+
+
Parameters:
+
    +
  • restart_step – Step to read at

  • +
  • fip_init – True to do limited simulator initialization

  • +
+
+
+
+ +
+
+inline Scalar thresholdPressure(unsigned elem1Idx, unsigned elem2Idx) const
+
+ +
+
+inline const FlowThresholdPressure<TypeTag> &thresholdPressure() const
+
+ +
+
+inline FlowThresholdPressure<TypeTag> &thresholdPressure()
+
+ +
+
+inline const ModuleParams &moduleParams() const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+template<class Context>
inline Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

For the FlowProblem, this method is identical to referencePorosity(). The intensive quantities object may apply various multipliers (e.g. ones which model rock compressibility and water induced rock compaction) to it which depend on the current physical conditions.

+
+ +
+
+template<class Context>
inline unsigned pvtRegionIndex(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

Returns the index of the relevant region for thermodynmic properties.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+
+ +
+
+

Protected Functions

+
+
+inline virtual void updateExplicitQuantities_(int episodeIdx, int timeStepSize, const bool first_step_after_restart) override
+
+ +
+
+inline void updateMaxPolymerAdsorption_()
+
+ +
+
+inline bool updateMaxPolymerAdsorption_(unsigned compressedDofIdx, const IntensiveQuantities &iq)
+
+ +
+
+inline void computeAndSetEqWeights_()
+
+ +
+
+inline bool updateCompositionChangeLimits_()
+
+ +
+
+inline void readEclRestartSolution_()
+
+ +
+
+inline virtual void readEquilInitialCondition_() override
+
+ +
+
+inline virtual void readExplicitInitialCondition_() override
+
+ +
+
+inline void processRestartSaturations_(InitialFluidState &elemFluidState, Scalar &solventSaturation)
+
+ +
+
+inline virtual void readInitialCondition_() override
+
+ +
+
+inline virtual void handleSolventBC(const BCProp::BCFace &bc, RateVector &rate) const override
+
+ +
+
+inline virtual void handlePolymerBC(const BCProp::BCFace &bc, RateVector &rate) const override
+
+ +
+
+inline virtual void handleMicrBC(const BCProp::BCFace &bc, RateVector &rate) const override
+
+ +
+
+inline virtual void handleOxygBC(const BCProp::BCFace &bc, RateVector &rate) const override
+
+ +
+
+inline virtual void handleUreaBC(const BCProp::BCFace &bc, RateVector &rate) const override
+
+ +
+
+inline void updateExplicitQuantities_(const bool first_step_after_restart)
+
+ +
+
+inline bool satfuncConsistencyRequirementsMet() const
+
+ +
+
+

Protected Attributes

+
+
+FlowThresholdPressure<TypeTag> thresholdPressures_
+
+ +
+
+std::vector<InitialFluidState> initialFluidStates_
+
+ +
+
+bool enableEclOutput_
+
+ +
+
+std::unique_ptr<EclWriterType> eclWriter_
+
+ +
+
+const Scalar smallSaturationTolerance_ = 1.e-6
+
+ +
+
+MixingRateControls<FluidSystem> mixControls_
+
+ +
+
+ActionHandler<Scalar> actionHandler_
+
+ +
+
+ModuleParams moduleParams_
+
+ +
+
+

Private Types

+
+
+using BoundaryRateVector = GetPropType<TypeTag, Properties::BoundaryRateVector>
+
+ +
+
+using SolventModule = BlackOilSolventModule<TypeTag>
+
+ +
+
+using PolymerModule = BlackOilPolymerModule<TypeTag>
+
+ +
+
+using FoamModule = BlackOilFoamModule<TypeTag>
+
+ +
+
+using BrineModule = BlackOilBrineModule<TypeTag>
+
+ +
+
+using ExtboModule = BlackOilExtboModule<TypeTag>
+
+ +
+
+using MICPModule = BlackOilMICPModule<TypeTag>
+
+ +
+
+using DispersionModule = BlackOilDispersionModule<TypeTag, enableDispersion>
+
+ +
+
+using DiffusionModule = BlackOilDiffusionModule<TypeTag, enableDiffusion>
+
+ +
+
+using ConvectiveMixingModule = BlackOilConvectiveMixingModule<TypeTag, enableConvectiveMixing>
+
+ +
+
+using ModuleParams = typename BlackOilLocalResidualTPFA<TypeTag>::ModuleParams
+
+ +
+
+using InitialFluidState = typename EquilInitializer<TypeTag>::ScalarFluidState
+
+ +
+
+using EclWriterType = EclWriter<TypeTag, OutputBlackOilModule<TypeTag>>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using Vanguard = GetPropType<TypeTag, Properties::Vanguard>
+
+ +
+
+using GlobalEqVector = GetPropType<TypeTag, Properties::GlobalEqVector>
+
+ +
+
+using EqVector = GetPropType<TypeTag, Properties::EqVector>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>
+
+ +
+
+ +
+
+template<class TypeTag>
class FlowProblemComp : public Opm::FlowProblem<TypeTag>
+
+#include <FlowProblemComp.hpp>
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+

Public Functions

+
+
+inline Opm::CompositionalConfig::EOSType getEosType() const
+
+ +
+
+inline explicit FlowProblemComp(Simulator &simulator)
+
+ +
+
+inline void finishInit()
+
+ +
+
+inline virtual void endTimeStep() override
+

Called by the simulator after each time integration.

+
+ +
+
+inline void writeReports(const SimulatorTimer &timer)
+
+ +
+
+inline virtual void writeOutput(bool verbose) override
+

Write the requested quantities of the current solution into the output files.

+
+ +
+
+template<class Context>
inline void boundary(BoundaryRateVector &values, const Context &context, unsigned spaceIdx, unsigned) const
+

Reservoir simulation uses no-flow conditions as default for all boundaries.

+
+ +
+
+template<class Context>
inline void initial(PrimaryVariables &values, const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

The reservoir problem uses a constant boundary condition for the whole domain.

+
+ +
+
+inline virtual void addToSourceDense(RateVector&, unsigned, unsigned) const override
+
+ +
+
+inline const InitialFluidState &initialFluidState(unsigned globalDofIdx) const
+
+ +
+
+inline std::vector<InitialFluidState> &initialFluidStates()
+
+ +
+
+inline const std::vector<InitialFluidState> &initialFluidStates() const
+
+ +
+
+inline const FlowThresholdPressure<TypeTag> &thresholdPressure() const
+
+ +
+
+inline const EclWriterType &eclWriter() const
+
+ +
+
+inline EclWriterType &eclWriter()
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+template<class Context>
inline Scalar porosity(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

For the FlowProblem, this method is identical to referencePorosity(). The intensive quantities object may apply various multipliers (e.g. ones which model rock compressibility and water induced rock compaction) to it which depend on the current physical conditions.

+
+ +
+
+template<class Context>
inline unsigned pvtRegionIndex(const Context &context, unsigned spaceIdx, unsigned timeIdx) const
+

Returns the index of the relevant region for thermodynmic properties.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+
+ +
+
+

Protected Functions

+
+
+inline virtual void updateExplicitQuantities_(int, int, bool) override
+
+ +
+
+inline virtual void readEquilInitialCondition_() override
+
+ +
+
+inline void readEclRestartSolution_()
+
+ +
+
+inline virtual void readExplicitInitialCondition_() override
+
+ +
+
+inline void readExplicitInitialConditionCompositional_()
+
+ +
+
+

Private Types

+
+
+using FlowProblemType = FlowProblem<TypeTag>
+
+ +
+
+using BoundaryRateVector = GetPropType<TypeTag, Properties::BoundaryRateVector>
+
+ +
+
+using InitialFluidState = CompositionalFluidState<Scalar, FluidSystem>
+
+ +
+
+using EclWriterType = EclWriter<TypeTag, OutputCompositionalModule<TypeTag>>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using Vanguard = GetPropType<TypeTag, Properties::Vanguard>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+

Private Functions

+
+
+inline virtual void handleSolventBC(const BCProp::BCFace&, RateVector&) const override
+
+ +
+
+inline virtual void handlePolymerBC(const BCProp::BCFace&, RateVector&) const override
+
+ +
+
+inline virtual void handleMicrBC(const BCProp::BCFace&, RateVector&) const override
+
+ +
+
+inline virtual void handleOxygBC(const BCProp::BCFace&, RateVector&) const override
+
+ +
+
+inline virtual void handleUreaBC(const BCProp::BCFace&, RateVector&) const override
+
+ +
+
+

Private Members

+
+
+FlowThresholdPressure<TypeTag> thresholdPressures_
+
+ +
+
+std::vector<InitialFluidState> initialFluidStates_
+
+ +
+
+bool zmf_initialization_ = {false}
+
+ +
+
+bool enableEclOutput_ = {false}
+
+ +
+
+std::unique_ptr<EclWriterType> eclWriter_
+
+ +
+
+ +
+
+struct FlowProblemTPFA
+
+

Specialised type tag for simulations that can use the customised assembly process for TPFA discretisation schemes.

+

All properties are otherwise the same as for the regular FlowProblem.

+
+

Public Types

+
+
+using InheritsFrom = std::tuple<FlowProblem>
+
+ +
+
+ +
+
+template<class FluidSystem>
class FlowsContainer
+
+#include <FlowsContainer.hpp>
+
+

Public Functions

+
+
+FlowsContainer(const Schedule &schedule, const SummaryConfig &summaryConfig)
+
+ +
+
+void allocate(const std::size_t bufferSize, const unsigned numOutputNnc, const bool allocRestart, std::map<std::string, int> &rstKeywords)
+
+ +
+
+void assignFlores(const unsigned globalDofIdx, const int faceId, const unsigned nncId, const Scalar gas, const Scalar oil, const Scalar water)
+
+ +
+
+void assignFlows(const unsigned globalDofIdx, const int faceId, const unsigned nncId, const Scalar gas, const Scalar oil, const Scalar water)
+
+ +
+
+void outputRestart(data::Solution &sol)
+
+ +
+
+inline const std::array<FlowsData<double>, 3> &getFlowsn() const
+
+ +
+
+inline bool hasFlowsn() const
+
+ +
+
+inline bool hasFlows() const
+
+ +
+
+inline bool hasBlockFlows() const
+
+ +
+
+inline bool anyFlows() const
+
+ +
+
+inline const std::array<FlowsData<double>, 3> &getFloresn() const
+
+ +
+
+inline bool hasFloresn() const
+
+ +
+
+inline bool hasFlores() const
+
+ +
+
+inline bool anyFlores() const
+
+ +
+
+inline Scalar getFlow(const unsigned globalDofIdx, const FaceDir::DirEnum dir, const int comp_idx) const
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using ScalarBuffer = std::vector<Scalar>
+
+ +
+
+

Private Members

+
+
+bool anyFlows_ = {false}
+
+ +
+
+bool anyFlores_ = {false}
+
+ +
+
+bool blockFlows_ = {false}
+
+ +
+
+bool enableFlows_ = {false}
+
+ +
+
+bool enableFlores_ = {false}
+
+ +
+
+bool enableFlowsn_ = {false}
+
+ +
+
+bool enableFloresn_ = {false}
+
+ +
+
+std::array<std::array<ScalarBuffer, 6>, numPhases> flows_
+
+ +
+
+std::array<std::array<ScalarBuffer, 6>, numPhases> flores_
+
+ +
+
+std::array<FlowsData<double>, 3> floresn_
+
+ +
+
+std::array<FlowsData<double>, 3> flowsn_
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto numPhases = FluidSystem::numPhases
+
+ +
+
+static constexpr auto gasPhaseIdx = FluidSystem::gasPhaseIdx
+
+ +
+
+static constexpr auto oilPhaseIdx = FluidSystem::oilPhaseIdx
+
+ +
+
+static constexpr auto waterPhaseIdx = FluidSystem::waterPhaseIdx
+
+ +
+
+static constexpr auto gasCompIdx = FluidSystem::gasCompIdx
+
+ +
+
+static constexpr auto oilCompIdx = FluidSystem::oilCompIdx
+
+ +
+
+static constexpr auto waterCompIdx = FluidSystem::waterCompIdx
+
+ +
+
+ +
+
+template<class Scalar>
struct FlowsData
+
+#include <FlowsData.hpp>
+

Simple container for FLOWS data.

+
+

Public Functions

+
+
+inline void resize(const std::size_t size)
+

Resize data vectors.

+
+ +
+
+

Public Members

+
+
+std::string name
+

Associated name.

+
+ +
+
+std::vector<int> indices
+

Cell indices for values.

+
+ +
+
+std::vector<Scalar> values
+

Values.

+
+ +
+
+ +
+
+template<class TypeTag>
class FlowThresholdPressure : public Opm::GenericThresholdPressure<GetPropType<TypeTag, Properties::Grid>, GetPropType<TypeTag, Properties::GridView>, GetPropType<TypeTag, Properties::ElementMapper>, GetPropType<TypeTag, Properties::Scalar>>
+
+

This class calculates the threshold pressure for grid faces according to the Eclipse Reference Manual.

+

If the difference of the pressure potential between two cells is below the threshold pressure, the pressure potential difference is assumed to be zero, if it is larger than the threshold pressure, it is reduced by the threshold pressure.

+
+

Public Functions

+
+
+inline explicit FlowThresholdPressure(const Simulator &simulator)
+
+ +
+
+inline void finishInit()
+

Actually compute the threshold pressures over a face as a pre-compute step.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+using BaseType = GenericThresholdPressure<GetPropType<TypeTag, Properties::Grid>, GetPropType<TypeTag, Properties::GridView>, GetPropType<TypeTag, Properties::ElementMapper>, GetPropType<TypeTag, Properties::Scalar>>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+

Private Functions

+
+
+inline void computeDefaultThresholdPressures_()
+
+ +
+
+

Private Members

+
+
+const Simulator &simulator_
+
+ +
+
+ +
+
+template<class TypeTag>
struct FluxModule<TypeTag, TTag::FlowBaseProblemBlackoil>
+
+
+

Public Types

+
+
+using type = NewTranFluxModule<TypeTag>
+
+ +
+
+ +
+
+struct FoamCoefficients
+
+
+

Public Members

+
+
+Scalar fm_min = 1e-20
+
+ +
+
+Scalar fm_mob = 1.0
+
+ +
+
+Scalar fm_surf = 1.0
+
+ +
+
+Scalar ep_surf = 1.0
+
+ +
+
+Scalar fm_oil = 1.0
+
+ +
+
+Scalar fl_oil = 0.0
+
+ +
+
+Scalar ep_oil = 0.0
+
+ +
+
+Scalar fm_cap = 1.0
+
+ +
+
+Scalar ep_cap = 0.0
+
+ +
+
+Scalar fm_dry = 1.0
+
+ +
+
+Scalar ep_dry = 0.0
+
+ +
+
+ +
+
+struct ForceDisableFluidInPlaceOutput
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct ForceDisableResvFluidInPlaceOutput
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class Scalar>
class FractionCalculator
+
+
+

Public Functions

+
+
+FractionCalculator(const Schedule &schedule, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const SummaryState &summary_state, const int report_step, const GuideRate *guide_rate, const GuideRateModel::Target target, const PhaseUsage &pu, const bool is_producer, const Phase injection_phase)
+
+ +
+
+Scalar fraction(const std::string &name, const std::string &control_group_name, const bool always_include_this)
+
+ +
+
+Scalar localFraction(const std::string &name, const std::string &always_included_child)
+
+ +
+
+

Private Functions

+
+
+std::string parent(const std::string &name)
+
+ +
+
+std::pair<Scalar, int> guideRateSum(const Group &group, const std::string &always_included_child, const bool always_use_potentials)
+
+ +
+
+Scalar guideRate(const std::string &name, const std::string &always_included_child, const bool always_use_potentials)
+
+ +
+
+int groupControlledWells(const std::string &group_name, const std::string &always_included_child)
+
+ +
+
+GuideRate::RateVector getGroupRateVector(const std::string &group_name)
+
+ +
+
+

Private Members

+
+
+const Schedule &schedule_
+
+ +
+
+const WellState<Scalar> &well_state_
+
+ +
+
+const GroupState<Scalar> &group_state_
+
+ +
+
+const SummaryState &summary_state_
+
+ +
+
+int report_step_
+
+ +
+
+const GuideRate *guide_rate_
+
+ +
+
+GuideRateModel::Target target_
+
+ +
+
+const PhaseUsage &pu_
+
+ +
+
+bool is_producer_
+
+ +
+
+Phase injection_phase_
+
+ +
+
+ +
+
+struct FullTimeStepInitially
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class Fn>
class FunctionRunnerTasklet : public Opm::TaskletInterface
+
+#include <tasklets.hpp>
+

A simple tasklet that runs a function that returns void and does not take any arguments a given number of times.

+
+

Public Functions

+
+
+FunctionRunnerTasklet(const FunctionRunnerTasklet&) = default
+
+ +
+
+inline FunctionRunnerTasklet(int numInvocations, const Fn &fn)
+
+ +
+
+inline virtual void run() override
+
+ +
+
+

Private Members

+
+
+const Fn &fn_
+
+ +
+
+ +
+
+template<class FluidSystem, class RV, class RVW>
class Gas
+
+#include <InitStateEquil.hpp>
+
+

Public Functions

+
+
+Gas(const TabulatedFunction &tempVdTable, const RV &rv, const RVW &rvw, const int pvtRegionIdx, const Scalar normGrav)
+
+ +
+
+Scalar operator()(const Scalar depth, const Scalar press) const
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+

Private Functions

+
+
+Scalar density(const Scalar depth, const Scalar press) const
+
+ +
+
+

Private Members

+
+
+const TabulatedFunction &tempVdTable_
+
+ +
+
+const RV &rv_
+
+ +
+
+const RVW &rvw_
+
+ +
+
+const int pvtRegionIdx_
+
+ +
+
+const Scalar g_
+
+ +
+
+ +
+
+template<class Scalar>
class GasLiftCommon
+
+#include <GasLiftCommon.hpp>
+

Subclassed by Opm::GasLiftGroupInfo< Scalar >, Opm::GasLiftSingleWellGeneric< Scalar >, Opm::GasLiftStage2< Scalar >

+
+

Public Functions

+
+
+virtual ~GasLiftCommon() = default
+
+ +
+
+

Protected Types

+
+
+enum class MessageType
+

Values:

+
+
+enumerator INFO
+
+ +
+
+enumerator WARNING
+
+ +
+ +
+
+

Protected Functions

+
+
+GasLiftCommon(WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger, const Parallel::Communication &comm, bool glift_debug)
+
+ +
+
+int debugUpdateGlobalCounter_() const
+
+ +
+
+virtual void displayDebugMessage_(const std::string &msg) const = 0
+
+ +
+
+void displayDebugMessageOnRank0_(const std::string &msg) const
+
+ +
+
+void logMessage_(const std::string &prefix, const std::string &msg, MessageType msg_type = MessageType::INFO) const
+
+ +
+
+

Protected Attributes

+
+
+WellState<Scalar> &well_state_
+
+ +
+
+const GroupState<Scalar> &group_state_
+
+ +
+
+DeferredLogger &deferred_logger_
+
+ +
+
+const Parallel::Communication &comm_
+
+ +
+
+bool debug
+
+ +
+
+bool debug_output_only_on_rank0 = false
+
+ +
+
+ +
+
+template<class Scalar>
class GasLiftGroupInfo : public Opm::GasLiftCommon<Scalar>
+
+
+

Public Types

+
+
+enum class Rate
+

Values:

+
+
+enumerator oil
+
+ +
+
+enumerator gas
+
+ +
+
+enumerator water
+
+ +
+
+enumerator liquid
+
+ +
+ +
+
+using GLiftEclWells = std::map<std::string, std::pair<const Well*, int>>
+
+ +
+
+

Public Functions

+
+
+GasLiftGroupInfo(GLiftEclWells &ecl_wells, const Schedule &schedule, const SummaryState &summary_state, const int report_step_idx, const int iteration_idx, const PhaseUsage &phase_usage, DeferredLogger &deferred_logger, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Parallel::Communication &comm, bool glift_debug)
+
+ +
+
+std::vector<std::pair<std::string, Scalar>> &getWellGroups(const std::string &well_name)
+
+ +
+
+Scalar alqRate(const std::string &group_name)
+
+ +
+
+Scalar gasRate(const std::string &group_name) const
+
+ +
+
+Scalar gasPotential(const std::string &group_name) const
+
+ +
+
+Scalar waterPotential(const std::string &group_name) const
+
+ +
+
+Scalar oilPotential(const std::string &group_name) const
+
+ +
+
+int getGroupIdx(const std::string &group_name)
+
+ +
+
+Scalar getRate(Rate rate_type, const std::string &group_name) const
+
+ +
+
+Scalar getPotential(Rate rate_type, const std::string &group_name) const
+
+ +
+
+std::tuple<Scalar, Scalar, Scalar, Scalar> getRates(const int group_idx) const
+
+ +
+
+std::optional<Scalar> gasTarget(const std::string &group_name) const
+
+ +
+
+std::optional<Scalar> getTarget(Rate rate_type, const std::string &group_name) const
+
+ +
+
+const std::string &groupIdxToName(int group_idx) const
+
+ +
+
+bool hasAnyTarget(const std::string &group_name) const
+
+ +
+
+bool hasWell(const std::string &well_name)
+
+ +
+
+void initialize()
+
+ +
+
+std::optional<Scalar> liquidTarget(const std::string &group_name) const
+
+ +
+
+std::optional<Scalar> maxAlq(const std::string &group_name)
+
+ +
+
+std::optional<Scalar> maxTotalGasRate(const std::string &group_name)
+
+ +
+
+Scalar oilRate(const std::string &group_name) const
+
+ +
+
+std::optional<Scalar> oilTarget(const std::string &group_name) const
+
+ +
+
+Scalar waterRate(const std::string &group_name) const
+
+ +
+
+std::optional<Scalar> waterTarget(const std::string &group_name) const
+
+ +
+
+void update(const std::string &well_name, Scalar delta_oil, Scalar delta_gas, Scalar delta_water, Scalar delta_alq)
+
+ +
+
+void updateRate(int idx, Scalar oil_rate, Scalar gas_rate, Scalar water_rate, Scalar alq)
+
+ +
+
+inline const Well2GroupMap &wellGroupMap()
+
+ +
+
+

Public Static Functions

+
+
+static const std::string rateToString(Rate rate)
+
+ +
+
+

Protected Types

+
+
+using Well2GroupMap = std::map<std::string, std::vector<std::pair<std::string, Scalar>>>
+
+ +
+
+using GroupRateMap = std::map<std::string, GroupRates>
+
+ +
+
+using GroupIdxMap = std::map<std::string, int>
+
+ +
+
+using Communication = Dune::Communication<Dune::MPIHelper::MPICommunicator>
+
+ +
+
+

Protected Functions

+
+
+bool checkDoGasLiftOptimization_(const std::string &well_name)
+
+ +
+
+bool checkNewtonIterationIdxOk_(const std::string &well_name)
+
+ +
+
+void debugDisplayWellContribution_(const std::string &gr_name, const std::string &well_name, Scalar eff_factor, Scalar well_oil_rate, Scalar well_gas_rate, Scalar well_water_rate, Scalar well_alq, Scalar oil_rate, Scalar gas_rate, Scalar water_rate, Scalar alq) const
+
+ +
+
+void debugDisplayUpdatedGroupRates(const std::string &name, Scalar oil_rate, Scalar gas_rate, Scalar water_rate, Scalar alq) const
+
+ +
+
+void debugEndInitializeGroup(const std::string &name) const
+
+ +
+
+void debugStartInitializeGroup(const std::string &name) const
+
+ +
+
+virtual void displayDebugMessage_(const std::string &msg) const override
+
+ +
+
+void displayDebugMessage_(const std::string &msg, const std::string &well_name)
+
+ +
+
+std::tuple<Scalar, Scalar, Scalar, Scalar, Scalar, Scalar> getProducerWellRates_(const Well *well, const int index)
+
+ +
+
+std::tuple<Scalar, Scalar, Scalar, Scalar, Scalar, Scalar, Scalar> initializeGroupRatesRecursive_(const Group &group)
+
+ +
+
+void initializeWell2GroupMapRecursive_(const Group &group, std::vector<std::string> &group_names, std::vector<Scalar> &group_efficiency, Scalar cur_efficiency)
+
+ +
+
+void updateGroupIdxMap_(const std::string &group_name)
+
+ +
+
+

Protected Attributes

+
+
+GLiftEclWells &ecl_wells_
+
+ +
+
+const Schedule &schedule_
+
+ +
+
+const SummaryState &summary_state_
+
+ +
+
+const int report_step_idx_
+
+ +
+
+const int iteration_idx_
+
+ +
+
+const PhaseUsage &phase_usage_
+
+ +
+
+const GasLiftOpt &glo_
+
+ +
+
+GroupRateMap group_rate_map_
+
+ +
+
+Well2GroupMap well_group_map_
+
+ +
+
+GroupIdxMap group_idx_
+
+ +
+
+int next_group_idx_ = 0
+
+ +
+
+bool optimize_only_thp_wells_ = false
+
+ +
+
+

Protected Static Attributes

+
+
+static const int Water = BlackoilPhases::Aqua
+
+ +
+
+static const int Oil = BlackoilPhases::Liquid
+
+ +
+
+static const int Gas = BlackoilPhases::Vapour
+
+ +
+
+ +
+
+template<class TypeTag>
class GasLiftSingleWell : public Opm::GasLiftSingleWellGeneric<GetPropType<TypeTag, Properties::Scalar>>
+
+
+

Public Functions

+
+
+GasLiftSingleWell(const WellInterface<TypeTag> &well, const Simulator &simulator, const SummaryState &summary_state, DeferredLogger &deferred_logger, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, GasLiftGroupInfo<Scalar> &group_info, GLiftSyncGroups &sync_groups, const Parallel::Communication &comm, bool glift_debug)
+
+ +
+
+inline virtual const WellInterfaceGeneric<Scalar> &getWell() const override
+
+ +
+
+

Private Types

+
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using GLiftSyncGroups = typename GasLiftSingleWellGeneric<Scalar>::GLiftSyncGroups
+
+ +
+
+using BasicRates = typename GasLiftSingleWellGeneric<Scalar>::BasicRates
+
+ +
+
+

Private Functions

+
+
+std::optional<Scalar> computeBhpAtThpLimit_(Scalar alq, bool debug_ouput = true) const override
+
+ +
+
+BasicRates computeWellRates_(Scalar bhp, bool bhp_is_limited, bool debug_output = true) const override
+
+ +
+
+void setAlqMaxRate_(const GasLiftWell &well)
+
+ +
+
+void setupPhaseVariables_()
+
+ +
+
+virtual bool checkThpControl_() const override
+
+ +
+
+

Private Members

+
+
+const Simulator &simulator_
+
+ +
+
+const WellInterface<TypeTag> &well_
+
+ +
+
+ +
+
+template<class Scalar>
class GasLiftSingleWellGeneric : public Opm::GasLiftCommon<Scalar>
+
+
+

Public Types

+
+
+using GLiftSyncGroups = std::set<int>
+
+ +
+
+using Rate = typename GasLiftGroupInfo<Scalar>::Rate
+
+ +
+
+using MessageType = typename GasLiftCommon<Scalar>::MessageType
+
+ +
+
+

Public Functions

+
+
+inline const std::string &name() const
+
+ +
+
+std::optional<GradInfo> calcIncOrDecGradient(Scalar oil_rate, Scalar gas_rate, Scalar water_rate, Scalar alq, const std::string &gr_name_dont_limit, bool increase, bool debug_output = true) const
+
+ +
+
+std::unique_ptr<GasLiftWellState<Scalar>> runOptimize(const int iteration_idx)
+
+ +
+
+std::pair<Scalar, bool> wellTestALQ()
+
+ +
+
+virtual const WellInterfaceGeneric<Scalar> &getWell() const = 0
+
+ +
+
+

Protected Functions

+
+
+GasLiftSingleWellGeneric(DeferredLogger &deferred_logger, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Well &ecl_well, const SummaryState &summary_state, GasLiftGroupInfo<Scalar> &group_info, const PhaseUsage &phase_usage, const Schedule &schedule, const int report_step_idx, GLiftSyncGroups &sync_groups, const Parallel::Communication &comm, bool glift_debug)
+
+ +
+
+bool checkGroupALQrateExceeded(Scalar delta_alq, const std::string &gr_name_dont_limit = "") const
+
+ +
+
+bool checkGroupTotalRateExceeded(Scalar delta_alq, Scalar delta_gas_rate) const
+
+ +
+
+std::pair<std::optional<Scalar>, bool> addOrSubtractAlqIncrement_(Scalar alq, bool increase) const
+
+ +
+
+Scalar calcEcoGradient_(Scalar oil_rate, Scalar new_oil_rate, Scalar gas_rate, Scalar new_gas_rate, bool increase) const
+
+ +
+
+bool checkALQequal_(Scalar alq1, Scalar alq2) const
+
+ +
+
+bool checkGroupTargetsViolated(const BasicRates &rates, const BasicRates &new_rates) const
+
+ +
+
+bool checkInitialALQmodified_(Scalar alq, Scalar initial_alq) const
+
+ +
+
+virtual bool checkThpControl_() const = 0
+
+ +
+
+virtual std::optional<Scalar> computeBhpAtThpLimit_(Scalar alq, bool debug_output = true) const = 0
+
+ +
+
+std::pair<std::optional<Scalar>, Scalar> computeConvergedBhpAtThpLimitByMaybeIncreasingALQ_() const
+
+ +
+
+std::pair<std::optional<BasicRates>, Scalar> computeInitialWellRates_() const
+
+ +
+
+std::optional<LimitedRates> computeLimitedWellRatesWithALQ_(Scalar alq) const
+
+ +
+
+virtual BasicRates computeWellRates_(Scalar bhp, bool bhp_is_limited, bool debug_output = true) const = 0
+
+ +
+
+std::optional<BasicRates> computeWellRatesWithALQ_(Scalar alq) const
+
+ +
+
+void debugCheckNegativeGradient_(Scalar grad, Scalar alq, Scalar new_alq, Scalar oil_rate, Scalar new_oil_rate, Scalar gas_rate, Scalar new_gas_rate, bool increase) const
+
+ +
+
+void debugPrintWellStateRates() const
+
+ +
+
+void debugShowAlqIncreaseDecreaseCounts_()
+
+ +
+
+void debugShowBhpAlqTable_()
+
+ +
+
+void debugShowLimitingTargets_(const LimitedRates &rates) const
+
+ +
+
+void debugShowProducerControlMode() const
+
+ +
+
+void debugShowStartIteration_(Scalar alq, bool increase, Scalar oil_rate)
+
+ +
+
+void debugShowTargets_()
+
+ +
+
+virtual void displayDebugMessage_(const std::string &msg) const override
+
+ +
+
+void displayWarning_(const std::string &warning)
+
+ +
+
+std::pair<Scalar, bool> getBhpWithLimit_(Scalar bhp) const
+
+ +
+
+std::pair<Scalar, bool> getGasRateWithLimit_(const BasicRates &rates) const
+
+ +
+
+std::pair<Scalar, bool> getGasRateWithGroupLimit_(Scalar new_gas_rate, Scalar gas_rate, const std::string &gr_name_dont_limit) const
+
+ +
+
+std::pair<std::optional<LimitedRates>, Scalar> getInitialRatesWithLimit_() const
+
+ +
+
+LimitedRates getLimitedRatesFromRates_(const BasicRates &rates) const
+
+ +
+
+std::tuple<Scalar, Scalar, bool, bool> getLiquidRateWithGroupLimit_(const Scalar new_oil_rate, const Scalar oil_rate, const Scalar new_water_rate, const Scalar water_rate, const std::string &gr_name_dont_limit) const
+
+ +
+
+std::pair<Scalar, bool> getOilRateWithGroupLimit_(Scalar new_oil_rate, Scalar oil_rate, const std::string &gr_name_dont_limit) const
+
+ +
+
+std::pair<Scalar, bool> getOilRateWithLimit_(const BasicRates &rates) const
+
+ +
+
+std::pair<Scalar, std::optional<Rate>> getOilRateWithLimit2_(const BasicRates &rates) const
+
+ +
+
+Scalar getProductionTarget_(Rate rate) const
+
+ +
+
+Scalar getRate_(Rate rate_type, const BasicRates &rates) const
+
+ +
+
+std::pair<Scalar, std::optional<Rate>> getRateWithLimit_(Rate rate_type, const BasicRates &rates) const
+
+ +
+
+std::tuple<Scalar, const std::string*, Scalar> getRateWithGroupLimit_(Rate rate_type, const Scalar new_rate, const Scalar old_rate, const std::string &gr_name_dont_limit) const
+
+ +
+
+std::pair<Scalar, bool> getWaterRateWithGroupLimit_(Scalar new_water_rate, Scalar water_rate, const std::string &gr_name_dont_limit) const
+
+ +
+
+std::pair<Scalar, bool> getWaterRateWithLimit_(const BasicRates &rates) const
+
+ +
+
+std::pair<Scalar, std::optional<Rate>> getWaterRateWithLimit2_(const BasicRates &rates) const
+
+ +
+
+BasicRates getWellStateRates_() const
+
+ +
+
+bool hasProductionControl_(Rate rate) const
+
+ +
+
+std::pair<LimitedRates, Scalar> increaseALQtoPositiveOilRate_(Scalar alq, const LimitedRates &orig_rates) const
+
+ +
+
+std::pair<LimitedRates, Scalar> increaseALQtoMinALQ_(Scalar alq, const LimitedRates &orig_rates) const
+
+ +
+
+void logSuccess_(Scalar alq, const int iteration_idx)
+
+ +
+
+std::pair<LimitedRates, Scalar> maybeAdjustALQbeforeOptimizeLoop_(const LimitedRates &rates, Scalar alq, bool increase) const
+
+ +
+
+std::pair<LimitedRates, Scalar> reduceALQtoGroupAlqLimits_(Scalar alq, const LimitedRates &rates) const
+
+ +
+
+std::pair<LimitedRates, Scalar> reduceALQtoGroupTarget(Scalar alq, const LimitedRates &rates) const
+
+ +
+
+std::pair<LimitedRates, Scalar> reduceALQtoWellTarget_(Scalar alq, const LimitedRates &rates) const
+
+ +
+
+std::unique_ptr<GasLiftWellState<Scalar>> runOptimize1_()
+
+ +
+
+std::unique_ptr<GasLiftWellState<Scalar>> runOptimize2_()
+
+ +
+
+std::unique_ptr<GasLiftWellState<Scalar>> runOptimizeLoop_(bool increase)
+
+ +
+
+void setAlqMinRate_(const GasLiftWell &well)
+
+ +
+
+std::unique_ptr<GasLiftWellState<Scalar>> tryIncreaseLiftGas_()
+
+ +
+
+std::unique_ptr<GasLiftWellState<Scalar>> tryDecreaseLiftGas_()
+
+ +
+
+void updateGroupRates_(const LimitedRates &rates, const LimitedRates &new_rates, Scalar delta_alq) const
+
+ +
+
+LimitedRates updateRatesToGroupLimits_(const BasicRates &old_rates, const LimitedRates &rates, const std::string &gr_name = "") const
+
+ +
+
+void updateWellStateAlqFixedValue_(const GasLiftWell &well)
+
+ +
+
+bool useFixedAlq_(const GasLiftWell &well)
+
+ +
+
+void debugInfoGroupRatesExceedTarget(Rate rate_type, const std::string &gr_name, Scalar rate, Scalar target) const
+
+ +
+
+void warnMaxIterationsExceeded_()
+
+ +
+
+

Protected Attributes

+
+
+const Well &ecl_well_
+
+ +
+
+const SummaryState &summary_state_
+
+ +
+
+GasLiftGroupInfo<Scalar> &group_info_
+
+ +
+
+const PhaseUsage &phase_usage_
+
+ +
+
+GLiftSyncGroups &sync_groups_
+
+ +
+
+const WellProductionControls controls_
+
+ +
+
+Scalar increment_
+
+ +
+
+Scalar max_alq_
+
+ +
+
+Scalar min_alq_
+
+ +
+
+Scalar orig_alq_
+
+ +
+
+Scalar alpha_w_
+
+ +
+
+Scalar alpha_g_
+
+ +
+
+Scalar eco_grad_
+
+ +
+
+int gas_pos_
+
+ +
+
+int oil_pos_
+
+ +
+
+int water_pos_
+
+ +
+
+int max_iterations_
+
+ +
+
+std::string well_name_
+
+ +
+
+const GasLiftWell *gl_well_
+
+ +
+
+bool optimize_
+
+ +
+
+bool debug_limit_increase_decrease_
+
+ +
+
+bool debug_abort_if_decrease_and_oil_is_limited_ = false
+
+ +
+
+bool debug_abort_if_increase_and_gas_is_limited_ = false
+
+ +
+
+

Protected Static Attributes

+
+
+static constexpr int Water = BlackoilPhases::Aqua
+
+ +
+
+static constexpr int Oil = BlackoilPhases::Liquid
+
+ +
+
+static constexpr int Gas = BlackoilPhases::Vapour
+
+ +
+
+static constexpr int NUM_PHASES = 3
+
+ +
+
+static constexpr Scalar ALQ_EPSILON = 1e-8
+
+ +
+
+ +
+
+template<class Scalar>
class GasLiftStage2 : public Opm::GasLiftCommon<Scalar>
+
+#include <GasLiftStage2.hpp>
+
+

Public Functions

+
+
+GasLiftStage2(const int report_step_idx, const Parallel::Communication &comm, const Schedule &schedule, const SummaryState &summary_state, DeferredLogger &deferred_logger, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, GLiftProdWells &prod_wells, GLiftOptWells &glift_wells, GasLiftGroupInfo<Scalar> &group_info, GLiftWellStateMap &state_map, bool glift_debug)
+
+ +
+
+void runOptimize()
+
+ +
+
+

Protected Functions

+
+
+void addOrRemoveALQincrement_(GradMap &grad_map, const std::string &well_name, bool add)
+
+ +
+
+std::optional<GradInfo> calcIncOrDecGrad_(const std::string name, const GasLiftSingleWell &gs_well, const std::string &gr_name_dont_limit, bool increase)
+
+ +
+
+bool checkRateAlreadyLimited_(const std::string &well_name, GasLiftWellState<Scalar> &state, bool increase)
+
+ +
+
+GradInfo deleteDecGradItem_(const std::string &name)
+
+ +
+
+GradInfo deleteIncGradItem_(const std::string &name)
+
+ +
+
+GradInfo deleteGrad_(const std::string &name, bool increase)
+
+ +
+
+virtual void displayDebugMessage_(const std::string &msg) const override
+
+ +
+
+void displayDebugMessage2B_(const std::string &msg)
+
+ +
+
+void displayDebugMessage_(const std::string &msg, const std::string &group_name)
+
+ +
+
+void displayWarning_(const std::string &msg, const std::string &group_name)
+
+ +
+
+void displayWarning_(const std::string &msg)
+
+ +
+
+std::tuple<Scalar, Scalar, Scalar, Scalar> getCurrentGroupRates_(const Group &group)
+
+ +
+
+std::optional<Scalar> getGroupMaxALQ_(const Group &group)
+
+ +
+
+std::optional<Scalar> getGroupMaxTotalGas_(const Group &group)
+
+ +
+
+std::vector<GasLiftSingleWell*> getGroupGliftWells_(const Group &group)
+
+ +
+
+void getGroupGliftWellsRecursive_(const Group &group, std::vector<GasLiftSingleWell*> &wells)
+
+ +
+
+void optimizeGroup_(const Group &group)
+
+ +
+
+void optimizeGroupsRecursive_(const Group &group)
+
+ +
+
+void recalculateGradientAndUpdateData_(GradPairItr &grad_itr, const std::string &gr_name_dont_limit, bool increase, std::vector<GradPair> &grads, std::vector<GradPair> &other_grads)
+
+ +
+
+void redistributeALQ_(std::vector<GasLiftSingleWell*> &wells, const Group &group, std::vector<GradPair> &inc_grads, std::vector<GradPair> &dec_grads)
+
+ +
+
+void removeSurplusALQ_(const Group &group, std::vector<GradPair> &dec_grads)
+
+ +
+
+void saveGrad_(GradMap &map, const std::string &name, GradInfo &grad)
+
+ +
+
+void saveDecGrad_(const std::string &name, GradInfo &grad)
+
+ +
+
+void saveIncGrad_(const std::string &name, GradInfo &grad)
+
+ +
+
+void sortGradients_(std::vector<GradPair> &grads)
+
+ +
+
+std::optional<GradInfo> updateGrad_(const std::string &name, GradInfo &grad, bool increase)
+
+ +
+
+void updateGradVector_(const std::string &name, std::vector<GradPair> &grads, Scalar grad)
+
+ +
+
+void mpiSyncGlobalGradVector_(std::vector<GradPair> &grads_global) const
+
+ +
+
+void mpiSyncLocalToGlobalGradVector_(const std::vector<GradPair> &grads_local, std::vector<GradPair> &grads_global) const
+
+ +
+
+std::array<Scalar, 4> computeDelta(const std::string &name, bool add)
+
+ +
+
+void updateGroupInfo(const std::string &name, bool add)
+
+ +
+
+

Protected Attributes

+
+
+GLiftProdWells &prod_wells_
+
+ +
+
+GLiftOptWells &stage1_wells_
+
+ +
+
+GasLiftGroupInfo<Scalar> &group_info_
+
+ +
+
+GLiftWellStateMap &well_state_map_
+
+ +
+
+int report_step_idx_
+
+ +
+
+const SummaryState &summary_state_
+
+ +
+
+const Schedule &schedule_
+
+ +
+
+const GasLiftOpt &glo_
+
+ +
+
+GradMap inc_grads_
+
+ +
+
+GradMap dec_grads_
+
+ +
+
+int max_iterations_ = 1000
+
+ +
+
+

Private Types

+
+
+using GasLiftSingleWell = GasLiftSingleWellGeneric<Scalar>
+
+ +
+
+using GLiftOptWells = std::map<std::string, std::unique_ptr<GasLiftSingleWell>>
+
+ +
+
+using GLiftProdWells = std::map<std::string, const WellInterfaceGeneric<Scalar>*>
+
+ +
+
+using GLiftWellStateMap = std::map<std::string, std::unique_ptr<GasLiftWellState<Scalar>>>
+
+ +
+
+using GradPair = std::pair<std::string, Scalar>
+
+ +
+
+using GradPairItr = typename std::vector<GradPair>::iterator
+
+ +
+
+using GradInfo = typename GasLiftSingleWellGeneric<Scalar>::GradInfo
+
+ +
+
+using GradMap = std::map<std::string, GradInfo>
+
+ +
+
+using MessageType = typename GasLiftCommon<Scalar>::MessageType
+
+ +
+
+

Private Static Attributes

+
+
+static const int Water = BlackoilPhases::Aqua
+
+ +
+
+static const int Oil = BlackoilPhases::Liquid
+
+ +
+
+static const int Gas = BlackoilPhases::Vapour
+
+ +
+
+ +
+
+template<class Scalar>
class GasLiftWellState
+
+
+

Public Functions

+
+
+inline GasLiftWellState(Scalar oil_rate, bool oil_is_limited, Scalar gas_rate, bool gas_is_limited, Scalar alq, bool alq_is_limited, Scalar water_rate, bool water_is_limited, std::optional<bool> increase)
+
+ +
+
+inline Scalar alq() const
+
+ +
+
+inline bool alqChanged()
+
+ +
+
+inline bool alqIsLimited() const
+
+ +
+
+inline bool gasIsLimited() const
+
+ +
+
+inline Scalar gasRate() const
+
+ +
+
+inline std::pair<Scalar, Scalar> getRates()
+
+ +
+
+inline std::optional<bool> increase() const
+
+ +
+
+inline bool oilIsLimited() const
+
+ +
+
+inline Scalar oilRate() const
+
+ +
+
+inline Scalar waterRate() const
+
+ +
+
+inline bool waterIsLimited() const
+
+ +
+
+inline void update(Scalar oil_rate, bool oil_is_limited, Scalar gas_rate, bool gas_is_limited, Scalar alq, bool alq_is_limited, Scalar water_rate, Scalar water_is_limited, bool increase)
+
+ +
+
+

Private Members

+
+
+Scalar oil_rate_
+
+ +
+
+bool oil_is_limited_
+
+ +
+
+Scalar gas_rate_
+
+ +
+
+bool gas_is_limited_
+
+ +
+
+Scalar alq_
+
+ +
+
+bool alq_is_limited_
+
+ +
+
+Scalar water_rate_
+
+ +
+
+bool water_is_limited_
+
+ +
+
+std::optional<bool> increase_
+
+ +
+
+ +
+
+class General3rdOrderController : public Opm::TimeStepControlInterface
+
+#include <TimeStepControl.hpp>
+

General 3rd order controller

+
+

Public Functions

+
+
+General3rdOrderController(const double tolerance = 1e-3, const double safetyFactor = 0.8, const bool rejectCompletedStep = false, const bool verbose = false)
+
+ +
+
+virtual double computeTimeStepSize(const double dt, const int, const RelativeChangeInterface &relativeChange, const AdaptiveSimulatorTimer &substepTimer) const override
+

compute new time step size suggestions based on the PID controller

+
+
Parameters:
+
    +
  • dt – time step size used in the current step

  • +
  • iterations – number of iterations used (linear/nonlinear)

  • +
  • timeError – object to compute || u^n+1 - u^n || / || u^n+1 ||

  • +
+
+
Returns:
+

suggested time step size for the next step

+
+
+
+ +
+
+virtual bool timeStepAccepted(const double error) const override
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const General3rdOrderController&) const
+
+ +
+
+

Public Static Functions

+
+
+static General3rdOrderController serializationTestObject()
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr TimeStepControlType Type = TimeStepControlType::General3rdOrder
+
+ +
+
+

Protected Attributes

+
+
+const double tolerance_ = 1e-3
+
+ +
+
+const double safetyFactor_ = 0.8
+
+ +
+
+const bool rejectCompletedStep_ = false
+
+ +
+
+mutable std::vector<double> errors_ = {}
+
+ +
+
+mutable std::vector<double> timeSteps_ = {}
+
+ +
+
+mutable int counterSinceFailure_ = 0
+
+ +
+
+const bool verbose_ = false
+
+ +
+
+ +
+
+template<class OriginalPreconditioner>
struct GeneralPreconditionerMaker
+
+

Interface class ensuring make function is overriden.

+
+
Template Parameters:
+

OriginalPreconditioner – - An arbitrary Preconditioner type

+
+
+

Subclassed by Dune::PreconditionerMaker< OriginalPreconditioner, Args >

+
+

Public Functions

+
+
+virtual std::unique_ptr<Preconditioner<typename OriginalPreconditioner::domain_type, typename OriginalPreconditioner::range_type>> make() = 0
+
+ +
+
+virtual ~GeneralPreconditionerMaker() = default
+
+ +
+
+ +
+
+template<class ElementMapper, class GridView, class Scalar>
class GenericCpGridVanguard
+
+
+

Public Functions

+
+
+GenericCpGridVanguard()
+
+ +
+
+virtual ~GenericCpGridVanguard() = default
+
+ +
+
+inline Dune::CpGrid &grid()
+

Return a reference to the simulation grid.

+
+ +
+
+inline const Dune::CpGrid &grid() const
+

Return a reference to the simulation grid.

+
+ +
+
+const Dune::CpGrid &equilGrid() const
+

Returns a refefence to the grid which should be used by the EQUIL initialization code.

+

The EQUIL keyword is used to specify the initial condition of the reservoir in hydrostatic equilibrium. Since the code which does this is not accepting arbitrary DUNE grids (the code is part of the opm-core module), this is not necessarily the same as the grid which is used for the actual simulation.

+
+ +
+
+void releaseEquilGrid()
+

Indicates that the initial condition has been computed and the memory used by the EQUIL grid can be released.

+

Depending on the implementation, subsequent accesses to the EQUIL grid lead to crashes.

+
+ +
+
+const CartesianIndexMapper &cartesianIndexMapper() const
+

Returns the object which maps a global element index of the simulation grid to the corresponding element index of the logically Cartesian index.

+
+ +
+
+const LevelCartesianIndexMapper levelCartesianIndexMapper() const
+

Returns the object which maps a global element index of the simulation grid to the corresponding element index of the level logically Cartesian index.

+
+ +
+
+const CartesianIndexMapper &equilCartesianIndexMapper() const
+

Returns mapper from compressed to cartesian indices for the EQUIL grid.

+
+ +
+
+inline const std::vector<int> &cellPartition() const
+
+ +
+
+

Public Static Functions

+
+
+static inline void setExternalLoadBalancer(const std::function<std::vector<int>(const Dune::CpGrid&)> &loadBalancer)
+

Sets a function that returns external load balancing information when passed the grid.

+

The information is a vector of integers indication the partition index for each cell id.

+
+ +
+
+

Protected Types

+
+
+using CartesianIndexMapper = Dune::CartesianIndexMapper<Dune::CpGrid>
+
+ +
+
+using LevelCartesianIndexMapper = Opm::LevelCartesianIndexMapper<Dune::CpGrid>
+
+ +
+
+using Element = typename GridView::template Codim<0>::Entity
+
+ +
+
+

Protected Functions

+
+
+void allocCartMapper()
+

Distribute the simulation grid over multiple processes.

+

(For parallel simulation runs.)

+
+ +
+
+void doCreateGrids_(EclipseState &eclState)
+
+ +
+
+void addLgrsUpdateLeafView(const LgrCollection &lgrCollection, const int lgrsSize, Dune::CpGrid &grid)
+
+ +
+
+virtual void allocTrans() = 0
+
+ +
+
+virtual double getTransmissibility(unsigned I, unsigned J) const = 0
+
+ +
+
+void doFilterConnections_(Schedule &schedule)
+
+ +
+
+Scalar computeCellThickness(const Element &element) const
+
+ +
+
+

Protected Attributes

+
+
+std::unique_ptr<Dune::CpGrid> grid_
+
+ +
+
+std::unique_ptr<Dune::CpGrid> equilGrid_
+
+ +
+
+std::unique_ptr<CartesianIndexMapper> cartesianIndexMapper_
+
+ +
+
+std::unique_ptr<CartesianIndexMapper> equilCartesianIndexMapper_
+
+ +
+
+int mpiRank
+
+ +
+
+std::vector<int> cell_part_ = {}
+
+ +
+
+ +
+
+template<class FluidSystem>
class GenericOutputBlackoilModule
+
+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+

Public Functions

+
+
+virtual ~GenericOutputBlackoilModule()
+
+ +
+
+void outputTimeStamp(const std::string &lbl, double elapsed, int rstep, boost::posix_time::ptime currentDate)
+
+ +
+
+void prepareDensityAccumulation()
+

Clear internal arrays for parallel accumulation of per-region phase density averages.

+
+ +
+
+void accumulateDensityParallel()
+

Run cross-rank parallel accumulation of per-region phase density running sums (average values).

+
+ +
+
+void outputCumLog(std::size_t reportStepNum, const bool connData)
+
+ +
+
+void outputProdLog(std::size_t reportStepNum, const bool connData)
+
+ +
+
+void outputInjLog(std::size_t reportStepNum, const bool connData)
+
+ +
+
+void outputMSWLog(std::size_t reportStepNum)
+
+ +
+
+void calc_initial_inplace(const Parallel::Communication &comm)
+
+ +
+
+Inplace calc_inplace(std::map<std::string, double> &miscSummaryData, std::map<std::string, std::vector<double>> &regionData, const Parallel::Communication &comm)
+
+ +
+
+void outputWellspecReport(const std::vector<std::string> &changedWells, const std::size_t reportStepNum, const double elapsed, boost::posix_time::ptime currentDate) const
+
+ +
+
+void outputErrorLog(const Parallel::Communication &comm) const
+
+ +
+
+inline void addRftDataToWells(data::Wells &wellDatas, std::size_t reportStepNum, const Parallel::Communication &comm)
+
+ +
+
+void assignToSolution(data::Solution &sol)
+

Move all buffers to data::Solution.

+
+ +
+
+void setRestart(const data::Solution &sol, unsigned elemIdx, unsigned globalDofIndex)
+
+ +
+
+inline Scalar getSolventSaturation(unsigned elemIdx) const
+
+ +
+
+inline Scalar getSolventRsw(unsigned elemIdx) const
+
+ +
+
+inline Scalar getPolymerConcentration(unsigned elemIdx) const
+
+ +
+
+inline Scalar getFoamConcentration(unsigned elemIdx) const
+
+ +
+
+inline Scalar getSaltConcentration(unsigned elemIdx) const
+
+ +
+
+inline Scalar getSaltSaturation(unsigned elemIdx) const
+
+ +
+
+inline Scalar getPermFactor(unsigned elemIdx) const
+
+ +
+
+inline const std::vector<Scalar> &getFluidPressure() const
+
+ +
+
+inline const MICPContainer<Scalar> &getMICP() const
+
+ +
+
+inline const FlowsContainer<FluidSystem> &getFlows() const
+
+ +
+
+inline bool needInterfaceFluxes(const bool isSubStep) const
+
+ +
+
+inline const std::map<std::pair<std::string, int>, double> &getBlockData()
+
+ +
+
+inline std::map<std::pair<std::string, int>, double> &getExtraBlockData()
+
+ +
+
+inline const std::optional<Inplace> &initialInplace() const
+
+ +
+
+inline bool localDataValid() const
+
+ +
+
+inline void invalidateLocalData()
+
+ +
+
+inline void validateLocalData()
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline RSTConv &getConv()
+
+ +
+
+inline const RSTConv &getConv() const
+
+ +
+
+void assignGlobalFieldsToSolution(data::Solution &sol)
+

Assign fields that are in global numbering to the solution. \detail This is used to add fields that for some reason cannot be collected using the regular collect mechanism to the solution. In particular this is used with RPTRST CONV output.

+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Register all run-time parameters for the Vtk output module.

+
+ +
+
+

Protected Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numComponents
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator gasCompIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator oilCompIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator waterCompIdx
+
+ +
+ +
+
+using ScalarBuffer = std::vector<Scalar>
+
+ +
+
+using StringBuffer = std::vector<std::string>
+
+ +
+
+using Dir = FaceDir::DirEnum
+
+ +
+
+

Protected Functions

+
+
+GenericOutputBlackoilModule(const EclipseState &eclState, const Schedule &schedule, const SummaryConfig &summaryConfig, const SummaryState &summaryState, const std::string &moduleVersionName, RSTConv::LocalToGlobalCellFunc globalCell, const Parallel::Communication &comm, bool enableEnergy, bool enableTemperature, bool enableMech, bool enableSolvent, bool enablePolymer, bool enableFoam, bool enableBrine, bool enableSaltPrecipitation, bool enableExtbo, bool enableMICP)
+
+ +
+
+void doAllocBuffers(unsigned bufferSize, unsigned reportStepNum, const bool substep, const bool log, const bool isRestart, const EclHysteresisConfig *hysteresisConfig, unsigned numOutputNnc = 0, std::map<std::string, int> rstKeywords = {})
+
+ +
+
+void makeRegionSum(Inplace &inplace, const std::string &region_name, const Parallel::Communication &comm) const
+
+ +
+
+Inplace accumulateRegionSums(const Parallel::Communication &comm)
+
+ +
+
+void updateSummaryRegionValues(const Inplace &inplace, std::map<std::string, double> &miscSummaryData, std::map<std::string, std::vector<double>> &regionData) const
+
+ +
+
+void setupBlockData(std::function<bool(int)> isCartIdxOnThisRank)
+
+ +
+
+void setupExtraBlockData(const std::size_t reportStepNum, std::function<bool(int)> isCartIdxOnThisRank)
+
+ +
+
+virtual bool isDefunctParallelWell(const std::string &wname) const = 0
+
+ +
+
+virtual bool isOwnedByCurrentRank(const std::string &wname) const = 0
+
+ +
+
+

Protected Attributes

+
+
+const EclipseState &eclState_
+
+ +
+
+const Schedule &schedule_
+
+ +
+
+const SummaryState &summaryState_
+
+ +
+
+SummaryConfig summaryConfig_
+
+ +
+
+InterRegFlowMap interRegionFlows_
+
+ +
+
+LogOutputHelper<Scalar> logOutput_
+
+ +
+
+bool enableEnergy_ = {false}
+
+ +
+
+bool enableTemperature_ = {false}
+
+ +
+
+bool enableMech_ = {false}
+
+ +
+
+bool enableSolvent_ = {false}
+
+ +
+
+bool enablePolymer_ = {false}
+
+ +
+
+bool enableFoam_ = {false}
+
+ +
+
+bool enableBrine_ = {false}
+
+ +
+
+bool enableSaltPrecipitation_ = {false}
+
+ +
+
+bool enableExtbo_ = {false}
+
+ +
+
+bool enableMICP_ = {false}
+
+ +
+
+bool forceDisableFipOutput_ = {false}
+
+ +
+
+bool forceDisableFipresvOutput_ = {false}
+
+ +
+
+bool computeFip_ = {false}
+
+ +
+
+FIPContainer<FluidSystem> fipC_
+
+ +
+
+std::unordered_map<std::string, std::vector<int>> regions_
+
+ +
+
+std::unordered_map<Inplace::Phase, std::vector<SummaryConfigNode>> regionNodes_
+
+ +
+
+std::vector<SummaryConfigNode> RPRNodes_
+
+ +
+
+std::vector<SummaryConfigNode> RPRPNodes_
+
+ +
+
+std::vector<int> failedCellsPb_
+
+ +
+
+std::vector<int> failedCellsPd_
+
+ +
+
+ScalarBuffer gasFormationVolumeFactor_
+
+ +
+
+ScalarBuffer hydrocarbonPoreVolume_
+
+ +
+
+ScalarBuffer pressureTimesPoreVolume_
+
+ +
+
+ScalarBuffer pressureTimesHydrocarbonVolume_
+
+ +
+
+ScalarBuffer dynamicPoreVolume_
+
+ +
+
+ScalarBuffer rPorV_
+
+ +
+
+ScalarBuffer fluidPressure_
+
+ +
+
+ScalarBuffer temperature_
+
+ +
+
+ScalarBuffer rs_
+
+ +
+
+ScalarBuffer rsw_
+
+ +
+
+ScalarBuffer rv_
+
+ +
+
+ScalarBuffer rvw_
+
+ +
+
+ScalarBuffer overburdenPressure_
+
+ +
+
+ScalarBuffer oilSaturationPressure_
+
+ +
+
+ScalarBuffer drsdtcon_
+
+ +
+
+ScalarBuffer sSol_
+
+ +
+
+ScalarBuffer rswSol_
+
+ +
+
+ScalarBuffer cPolymer_
+
+ +
+
+ScalarBuffer cFoam_
+
+ +
+
+ScalarBuffer cSalt_
+
+ +
+
+ScalarBuffer pSalt_
+
+ +
+
+ScalarBuffer permFact_
+
+ +
+
+ExtboContainer<Scalar> extboC_
+
+ +
+
+ScalarBuffer soMax_
+
+ +
+
+ScalarBuffer swMax_
+
+ +
+
+ScalarBuffer sgmax_
+
+ +
+
+ScalarBuffer shmax_
+
+ +
+
+ScalarBuffer somin_
+
+ +
+
+ScalarBuffer swmin_
+
+ +
+
+ScalarBuffer ppcw_
+
+ +
+
+ScalarBuffer gasDissolutionFactor_
+
+ +
+
+ScalarBuffer oilVaporizationFactor_
+
+ +
+
+ScalarBuffer gasDissolutionFactorInWater_
+
+ +
+
+ScalarBuffer waterVaporizationFactor_
+
+ +
+
+ScalarBuffer bubblePointPressure_
+
+ +
+
+ScalarBuffer dewPointPressure_
+
+ +
+
+ScalarBuffer rockCompPorvMultiplier_
+
+ +
+
+ScalarBuffer minimumOilPressure_
+
+ +
+
+ScalarBuffer saturatedOilFormationVolumeFactor_
+
+ +
+
+ScalarBuffer rockCompTransMultiplier_
+
+ +
+
+MICPContainer<Scalar> micpC_
+
+ +
+
+ScalarBuffer pcgw_
+
+ +
+
+ScalarBuffer pcow_
+
+ +
+
+ScalarBuffer pcog_
+
+ +
+
+MechContainer<Scalar> mech_
+
+ +
+
+std::array<ScalarBuffer, numPhases> saturation_
+
+ +
+
+std::array<ScalarBuffer, numPhases> invB_
+
+ +
+
+std::array<ScalarBuffer, numPhases> density_
+
+ +
+
+std::array<ScalarBuffer, numPhases> viscosity_
+
+ +
+
+std::array<ScalarBuffer, numPhases> relativePermeability_
+
+ +
+
+TracerContainer<FluidSystem> tracerC_
+
+ +
+
+std::array<ScalarBuffer, numPhases> residual_
+
+ +
+
+FlowsContainer<FluidSystem> flowsC_
+
+ +
+
+RFTContainer<FluidSystem> rftC_
+
+ +
+
+RSTConv rst_conv_
+

Helper class for RPTRST CONV.

+
+ +
+
+std::map<std::pair<std::string, int>, double> blockData_
+
+ +
+
+std::map<std::pair<std::string, int>, double> extraBlockData_
+
+ +
+
+std::optional<Inplace> initialInplace_
+
+ +
+
+bool local_data_valid_ = {false}
+
+ +
+
+std::optional<RegionPhasePoreVolAverage> regionAvgDensity_
+
+ +
+
+

Protected Static Functions

+
+
+static bool isOutputCreationDirective_(const std::string &keyword)
+
+ +
+
+static ScalarBuffer regionSum(const ScalarBuffer &property, const std::vector<int> &regionId, const std::size_t maxNumberOfRegions, const Parallel::Communication &comm)
+
+ +
+
+static int regionMax(const std::vector<int> &region, const Parallel::Communication &comm)
+
+ +
+
+static void update(Inplace &inplace, const std::string &region_name, const Inplace::Phase phase, const std::size_t ntFip, const ScalarBuffer &values)
+
+ +
+
+static Scalar sum(const ScalarBuffer &v)
+
+ +
+
+

Protected Static Attributes

+
+
+static constexpr int gasPhaseIdx = FluidSystem::gasPhaseIdx
+
+ +
+
+static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx
+
+ +
+
+static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx
+
+ +
+
+ +
+
+template<class Grid, class GridView, class ElementMapper, class Scalar>
class GenericThresholdPressure
+
+
+

Public Types

+
+
+using CartesianIndexMapper = Dune::CartesianIndexMapper<Grid>
+
+ +
+
+using LookUpData = Opm::LookUpData<Grid, GridView>
+
+ +
+
+using LookUpCartesianData = Opm::LookUpCartesianData<Grid, GridView>
+
+ +
+
+

Public Functions

+
+
+GenericThresholdPressure(const CartesianIndexMapper &cartMapper, const GridView &gridView, const ElementMapper &elementMapper, const EclipseState &eclState)
+
+ +
+
+Scalar thresholdPressure(int elem1Idx, int elem2Idx) const
+

Returns the theshold pressure [Pa] for the intersection between two elements.

+

This is tailor made for the E100 threshold pressure mechanism and it is thus quite a hack: First of all threshold pressures in general are unphysical, and second, they should be different for the fluid phase but are not. Anyway, this seems to be E100’s way of doing things, so we do it the same way.

+
+ +
+
+inline const std::vector<Scalar> &data() const
+

Return the raw array with the threshold pressures.

+

This is used for the restart capability.

+
+ +
+
+inline void setFromRestart(const std::vector<double> &values)
+

Set the threshold pressures from a raw array.

+

This is used for the restart capability.

+
+ +
+
+std::vector<Scalar> getRestartVector() const
+

Returns a fully expanded vector for restart file writing.

+

Returns the union of explicitly configured entries and defaulted values.

+
+ +
+
+bool enableThresholdPressure() const
+
+ +
+
+

Protected Functions

+
+
+void finishInit()
+

Actually compute the threshold pressures over a face as a pre-compute step.

+
+ +
+
+void applyExplicitThresholdPressures_()
+
+ +
+
+void configureThpresft_()
+
+ +
+
+void logPressures()
+
+ +
+
+

Protected Attributes

+
+
+const CartesianIndexMapper &cartMapper_
+
+ +
+
+const GridView &gridView_
+
+ +
+
+const ElementMapper &elementMapper_
+
+ +
+
+const LookUpData lookUpData_
+
+ +
+
+const LookUpCartesianData lookUpCartesianData_
+
+ +
+
+const EclipseState &eclState_
+
+ +
+
+std::vector<Scalar> thpresDefault_
+
+ +
+
+std::vector<Scalar> thpres_
+
+ +
+
+unsigned numEquilRegions_ = {}
+
+ +
+
+std::vector<unsigned short> elemEquilRegion_
+
+ +
+
+std::vector<Scalar> thpresftValues_
+
+ +
+
+std::vector<int> cartElemFaultIdx_
+
+ +
+
+bool enableThresholdPressure_ = {false}
+
+ +
+
+bool restart_ = {false}
+
+ +
+
+ +
+
+template<class Grid, class GridView, class DofMapper, class Stencil, class FluidSystem, class Scalar>
class GenericTracerModel
+
+
+

Public Types

+
+
+using TracerVectorSingle = Dune::BlockVector<Dune::FieldVector<Scalar, 1>>
+
+ +
+
+using TracerMatrix = Dune::BCRSMatrix<Opm::MatrixBlock<Scalar, 2, 2>>
+
+ +
+
+using TracerVector = Dune::BlockVector<Dune::FieldVector<Scalar, 2>>
+
+ +
+
+using CartesianIndexMapper = Dune::CartesianIndexMapper<Grid>
+
+ +
+
+

Public Functions

+
+
+int numTracers() const
+

Return the number of tracers considered by the tracerModel.

+
+ +
+
+const std::string &name(int tracerIdx) const
+

Return the tracer name.

+
+ +
+
+std::string fname(int tracerIdx) const
+
+ +
+
+std::string sname(int tracerIdx) const
+
+ +
+
+std::string wellfname(int tracerIdx) const
+
+ +
+
+std::string wellsname(int tracerIdx) const
+
+ +
+
+Phase phase(int tracerIdx) const
+
+ +
+
+const std::vector<bool> &enableSolTracers() const
+
+ +
+
+Scalar freeTracerConcentration(int tracerIdx, int globalDofIdx) const
+

Return the tracer concentration for tracer index and global DofIdx.

+
+ +
+
+Scalar solTracerConcentration(int tracerIdx, int globalDofIdx) const
+
+ +
+
+void setFreeTracerConcentration(int tracerIdx, int globalDofIdx, Scalar value)
+
+ +
+
+void setSolTracerConcentration(int tracerIdx, int globalDofIdx, Scalar value)
+
+ +
+
+void setEnableSolTracers(int tracerIdx, bool enableSolTracer)
+
+ +
+
+inline const std::unordered_map<int, std::vector<WellTracerRate<Scalar>>> &getWellTracerRates() const
+

Return well tracer rates.

+
+ +
+
+inline const std::unordered_map<int, std::vector<WellTracerRate<Scalar>>> &getWellFreeTracerRates() const
+
+ +
+
+inline const std::unordered_map<int, std::vector<WellTracerRate<Scalar>>> &getWellSolTracerRates() const
+
+ +
+
+inline const std::unordered_map<int, std::vector<MSWellTracerRate<Scalar>>> &getMswTracerRates() const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int dimWorld = Grid::dimensionworld
+
+ +
+
+

Protected Types

+
+
+enum TracerTypeIdx
+

Tracer type index.

+

Values:

+
+
+enumerator Free
+
+ +
+
+enumerator Solution
+
+ +
+ +
+
+

Protected Functions

+
+
+GenericTracerModel(const GridView &gridView, const EclipseState &eclState, const CartesianIndexMapper &cartMapper, const DofMapper &dofMapper, const std::function<std::array<double, dimWorld>(int)> centroids)
+
+ +
+
+void doInit(bool rst, std::size_t numGridDof, std::size_t gasPhaseIdx, std::size_t oilPhaseIdx, std::size_t waterPhaseIdx)
+

Initialize all internal data structures needed by the tracer module.

+
+ +
+
+bool linearSolve_(const TracerMatrix &M, TracerVector &x, TracerVector &b)
+
+ +
+
+bool linearSolveBatchwise_(const TracerMatrix &M, std::vector<TracerVector> &x, std::vector<TracerVector> &b)
+
+ +
+
+Scalar currentConcentration_(const Well &eclWell, const std::string &name) const
+
+ +
+
+

Protected Attributes

+
+
+const GridView &gridView_
+
+ +
+
+const EclipseState &eclState_
+
+ +
+
+const CartesianIndexMapper &cartMapper_
+
+ +
+
+const DofMapper &dofMapper_
+
+ +
+
+std::vector<int> tracerPhaseIdx_
+
+ +
+
+std::vector<bool> enableSolTracers_
+
+ +
+
+std::vector<TracerVector> tracerConcentration_
+
+ +
+
+std::unique_ptr<TracerMatrix> tracerMatrix_
+
+ +
+
+std::vector<TracerVectorSingle> freeTracerConcentration_
+
+ +
+
+std::vector<TracerVectorSingle> solTracerConcentration_
+
+ +
+
+std::unordered_map<int, std::vector<WellTracerRate<Scalar>>> wellTracerRate_
+
+ +
+
+std::unordered_map<int, std::vector<WellTracerRate<Scalar>>> wellFreeTracerRate_
+
+ +
+
+std::unordered_map<int, std::vector<WellTracerRate<Scalar>>> wellSolTracerRate_
+
+ +
+
+std::unordered_map<int, std::vector<MSWellTracerRate<Scalar>>> mSwTracerRate_
+
+ +
+
+std::function<std::array<double, dimWorld>(int)> centroids_
+

Function returning the cell centers.

+
+ +
+
+ +
+
+template<class M, class X, class Y, class C>
class GhostLastMatrixAdapter : public Dune::AssembledLinearOperator<M, X, Y>
+
+#include <WellOperators.hpp>
+

Dune linear operator that assumes ghost rows are ordered after interior rows. Avoids some computations because of this.

+

This is similar to WellModelGhostLastMatrixAdapter, with the difference that here we do not have a well model, and also do calcilate the interiorSize using the parallel index set. Created for use in AMG/CPR smoothers.

+
+

Public Types

+
+
+typedef M matrix_type
+
+ +
+
+typedef X domain_type
+
+ +
+
+typedef Y range_type
+
+ +
+
+typedef X::field_type field_type
+
+ +
+
+typedef C communication_type
+
+ +
+
+

Public Functions

+
+
+inline Dune::SolverCategory::Category category() const override
+
+ +
+
+inline GhostLastMatrixAdapter(const M &A, const communication_type &comm)
+

constructor: just store a reference to a matrix

+
+ +
+
+inline GhostLastMatrixAdapter(const std::shared_ptr<M> A, const communication_type &comm)
+
+ +
+
+inline virtual void apply(const X &x, Y &y) const override
+
+ +
+
+inline virtual void applyscaleadd(field_type alpha, const X &x, Y &y) const override
+
+ +
+
+inline virtual const matrix_type &getmat() const override
+
+ +
+
+inline size_t getInteriorSize() const
+
+ +
+
+

Private Functions

+
+
+inline void ghostLastProject(Y &y) const
+
+ +
+
+inline size_t setInteriorSize(const communication_type &comm) const
+
+ +
+
+

Private Members

+
+
+const std::shared_ptr<const matrix_type> A_
+
+ +
+
+const communication_type &comm_
+
+ +
+
+size_t interiorSize_
+
+ +
+
+ +
+
+template<class GridView>
class GlobalCellIndex
+
+

Public Functions

+
+
+inline GlobalCellIndex()
+
+ +
+
+inline GlobalCellIndex &operator=(const int index)
+
+ +
+
+inline int index() const
+
+ +
+
+inline GlobalCellIndex()
+
+ +
+
+inline GlobalCellIndex &operator=(const int index)
+
+ +
+
+inline int index() const
+
+ +
+
+inline GlobalCellIndex()
+
+ +
+
+inline GlobalCellIndex &operator=(const int index)
+
+ +
+
+inline int index() const
+
+ +
+
+inline GlobalCellIndex()
+
+ +
+
+inline GlobalCellIndex &operator=(const int index)
+
+ +
+
+inline int index() const
+
+ +
+
+inline GlobalCellIndex()
+
+ +
+
+inline GlobalCellIndex &operator=(const int index)
+
+ +
+
+inline int index() const
+
+ +
+
+

Private Members

+
+
+int idx_
+
+ +
+
+ +
+
+class GlobalCellIndex
+
+
+

Public Functions

+
+
+inline GlobalCellIndex()
+
+ +
+
+inline void setGhost()
+
+ +
+
+inline void setId(int globalId)
+
+ +
+
+inline void setIndex(int localIndex)
+
+ +
+
+inline int localIndex() const
+
+ +
+
+inline int id() const
+
+ +
+
+inline bool isInterior() const
+
+ +
+
+

Private Members

+
+
+int globalId_
+
+ +
+
+int localIndex_
+
+ +
+
+bool isInterior_
+
+ +
+
+ +
+
+template<>
class GlobalIndexDataHandle : public Dune::CommDataHandleIF<GlobalIndexDataHandle<GridView>, int>, public Dune::CommDataHandleIF<GlobalIndexDataHandle<GridView>, int>, public Dune::CommDataHandleIF<GlobalIndexDataHandle<GridView>, int>, public Dune::CommDataHandleIF<GlobalIndexDataHandle<GridView>, int>, public Dune::CommDataHandleIF<GlobalIndexDataHandle<GridView>, int>
+
+
+

Public Functions

+
+
+inline GlobalIndexDataHandle(const GridView &gridView, std::vector<int> &cartesianIndex)
+
+ +
+
+GlobalIndexDataHandle(const GlobalIndexDataHandle &other) = delete
+
+ +
+
+inline ~GlobalIndexDataHandle()
+
+ +
+
+inline bool contains(int, int codim) const
+
+ +
+
+inline bool fixedsize(int, int) const
+
+ +
+
+template<class MessageBufferImp, class EntityType>
inline void gather(MessageBufferImp &buff, const EntityType &element) const
+

loop over all internal data handlers and call gather for given entity

+
+ +
+
+template<class MessageBufferImp, class EntityType>
inline void scatter(MessageBufferImp &buff, const EntityType &element, std::size_t)
+

loop over all internal data handlers and call scatter for given entity

+
+ +
+
+template<class EntityType>
inline std::size_t size(const EntityType&) const
+

loop over all internal data handlers and return sum of data size of given entity

+
+ +
+
+inline GlobalIndexDataHandle(const GridView &gridView, std::vector<int> &cartesianIndex)
+
+ +
+
+GlobalIndexDataHandle(const GlobalIndexDataHandle &other) = delete
+
+ +
+
+inline ~GlobalIndexDataHandle()
+
+ +
+
+inline bool contains(int, int codim) const
+
+ +
+
+inline bool fixedsize(int, int) const
+
+ +
+
+template<class MessageBufferImp, class EntityType>
inline void gather(MessageBufferImp &buff, const EntityType &element) const
+

loop over all internal data handlers and call gather for given entity

+
+ +
+
+template<class MessageBufferImp, class EntityType>
inline void scatter(MessageBufferImp &buff, const EntityType &element, std::size_t)
+

loop over all internal data handlers and call scatter for given entity

+
+ +
+
+template<class EntityType>
inline std::size_t size(const EntityType&) const
+

loop over all internal data handlers and return sum of data size of given entity

+
+ +
+
+inline GlobalIndexDataHandle(const GridView &gridView, std::vector<int> &cartesianIndex)
+
+ +
+
+GlobalIndexDataHandle(const GlobalIndexDataHandle &other) = delete
+
+ +
+
+inline ~GlobalIndexDataHandle()
+
+ +
+
+inline bool contains(int, int codim) const
+
+ +
+
+inline bool fixedsize(int, int) const
+
+ +
+
+template<class MessageBufferImp, class EntityType>
inline void gather(MessageBufferImp &buff, const EntityType &element) const
+

loop over all internal data handlers and call gather for given entity

+
+ +
+
+template<class MessageBufferImp, class EntityType>
inline void scatter(MessageBufferImp &buff, const EntityType &element, std::size_t)
+

loop over all internal data handlers and call scatter for given entity

+
+ +
+
+template<class EntityType>
inline std::size_t size(const EntityType&) const
+

loop over all internal data handlers and return sum of data size of given entity

+
+ +
+
+inline GlobalIndexDataHandle(const GridView &gridView, std::vector<int> &cartesianIndex)
+
+ +
+
+GlobalIndexDataHandle(const GlobalIndexDataHandle &other) = delete
+
+ +
+
+inline ~GlobalIndexDataHandle()
+
+ +
+
+inline bool contains(int, int codim) const
+
+ +
+
+inline bool fixedsize(int, int) const
+
+ +
+
+template<class MessageBufferImp, class EntityType>
inline void gather(MessageBufferImp &buff, const EntityType &element) const
+

loop over all internal data handlers and call gather for given entity

+
+ +
+
+template<class MessageBufferImp, class EntityType>
inline void scatter(MessageBufferImp &buff, const EntityType &element, std::size_t)
+

loop over all internal data handlers and call scatter for given entity

+
+ +
+
+template<class EntityType>
inline std::size_t size(const EntityType&) const
+

loop over all internal data handlers and return sum of data size of given entity

+
+ +
+
+inline GlobalIndexDataHandle(const GridView &gridView, std::vector<int> &cartesianIndex)
+
+ +
+
+GlobalIndexDataHandle(const GlobalIndexDataHandle &other) = delete
+
+ +
+
+inline ~GlobalIndexDataHandle()
+
+ +
+
+inline bool contains(int, int codim) const
+
+ +
+
+inline bool fixedsize(int, int) const
+
+ +
+
+template<class MessageBufferImp, class EntityType>
inline void gather(MessageBufferImp &buff, const EntityType &element) const
+

loop over all internal data handlers and call gather for given entity

+
+ +
+
+template<class MessageBufferImp, class EntityType>
inline void scatter(MessageBufferImp &buff, const EntityType &element, std::size_t)
+

loop over all internal data handlers and call scatter for given entity

+
+ +
+
+template<class EntityType>
inline std::size_t size(const EntityType&) const
+

loop over all internal data handlers and return sum of data size of given entity

+
+ +
+
+

Protected Functions

+
+
+inline void initialize()
+
+ +
+
+inline void finalize()
+
+ +
+
+inline void initialize()
+
+ +
+
+inline void finalize()
+
+ +
+
+inline void initialize()
+
+ +
+
+inline void finalize()
+
+ +
+
+inline void initialize()
+
+ +
+
+inline void finalize()
+
+ +
+
+inline void initialize()
+
+ +
+
+inline void finalize()
+
+ +
+
+

Protected Attributes

+
+
+GridView gridView_
+
+ +
+
+GlobalIndexContainer globalIndex_
+
+ +
+
+std::vector<int> &cartesianIndex_
+
+ +
+
+

Private Types

+
+
+using GlobalIndexContainer = typename Dune::PersistentContainer<Grid, GlobalCellIndex>
+
+ +
+
+using GlobalIndexContainer = typename Dune::PersistentContainer<Grid, GlobalCellIndex>
+
+ +
+
+using GlobalIndexContainer = typename Dune::PersistentContainer<Grid, GlobalCellIndex>
+
+ +
+
+using GlobalIndexContainer = typename Dune::PersistentContainer<Grid, GlobalCellIndex>
+
+ +
+
+using GlobalIndexContainer = typename Dune::PersistentContainer<Grid, GlobalCellIndex>
+
+ +
+
+ +
+
+template<class Scalar>
class GlobalPerfContainerFactory
+
+

A factory for creating a global data representation for distributed wells.

+

Unfortunately, there are occassion where we need to compute sequential on a well even if the data is distributed. This class is supposed to help with that by computing the global data arrays for the well and copy computed values back to the distributed representation.

+
+

Public Types

+
+
+using IndexSet = typename CommunicateAboveBelow<Scalar>::IndexSet
+
+ +
+
+using Attribute = typename CommunicateAboveBelow<Scalar>::Attribute
+
+ +
+
+using GlobalIndex = typename IndexSet::IndexPair::GlobalIndex
+
+ +
+
+

Public Functions

+
+
+GlobalPerfContainerFactory(const IndexSet &local_indices, const Parallel::Communication comm, int num_local_perfs)
+

Constructor.

+
+
Parameters:
+

local_indices – completely set up index set for map ecl index to local index

+
+
+
+ +
+
+std::vector<Scalar> createGlobal(const std::vector<Scalar> &local_perf_container, std::size_t num_components) const
+

Creates a container that holds values for all perforations.

+
+
Parameters:
+
    +
  • local_perf_container – Container with values attached to the local perforations.

  • +
  • num_components – the number of components per perforation.

  • +
+
+
Returns:
+

A container with values attached to all perforations of a well. Values are ordered by the index of the perforation in the ECL schedule.

+
+
+
+ +
+
+void copyGlobalToLocal(const std::vector<Scalar> &global, std::vector<Scalar> &local, std::size_t num_components) const
+

Copies the values of the global perforation to the local representation.

+
+
Parameters:
+
    +
  • global – values attached to all peforations of a well (as if the well would live on one process)

  • +
  • num_components – the number of components per perforation.

  • +
  • local[out] The values attached to the local perforations only.

  • +
+
+
+
+ +
+
+int numGlobalPerfs() const
+
+ +
+
+int globalToLocal(const int globalIndex) const
+
+ +
+
+int localToGlobal(std::size_t localIndex) const
+
+ +
+
+

Private Functions

+
+
+void buildLocalToGlobalMap() const
+
+ +
+
+void buildGlobalToLocalMap() const
+
+ +
+
+

Private Members

+
+
+mutable std::unordered_map<std::size_t, int> local_to_global_map_
+
+ +
+
+mutable std::unordered_map<int, std::size_t> global_to_local_map_
+
+ +
+
+mutable bool l2g_map_built_ = false
+
+ +
+
+mutable bool g2l_map_built_ = false
+
+ +
+
+const IndexSet &local_indices_
+
+ +
+
+Parallel::Communication comm_
+
+ +
+
+int num_global_perfs_
+
+ +
+
+std::vector<int> sizes_
+

sizes for allgatherv

+
+ +
+
+std::vector<int> displ_
+

displacement for allgatherv

+
+ +
+
+std::vector<int> map_received_
+

Mapping for storing gathered local values at the correct index.

+
+ +
+
+std::vector<int> perf_ecl_index_
+

The index of a perforation in the schedule of ECL.

+

This is is sorted.

+
+ +
+
+ +
+
+template<class Scalar>
class GlobalWellInfo
+
+#include <GlobalWellInfo.hpp>
+
+

Public Functions

+
+
+template<typename Comm>
inline void communicate(const Comm &comm)
+
+ +
+
+GlobalWellInfo(const Schedule &sched, std::size_t report_step, const std::vector<Well> &local_wells)
+
+ +
+
+bool in_producing_group(const std::string &wname) const
+
+ +
+
+bool in_injecting_group(const std::string &wname) const
+
+ +
+
+bool is_open(const std::string &wname) const
+
+ +
+
+std::size_t well_index(const std::string &wname) const
+
+ +
+
+const std::string &well_name(std::size_t well_index) const
+
+ +
+
+void update_injector(std::size_t well_index, WellStatus well_status, WellInjectorCMode injection_cmode)
+
+ +
+
+void update_producer(std::size_t well_index, WellStatus well_status, WellProducerCMode production_cmode)
+
+ +
+
+void update_efficiency_scaling_factor(std::size_t well_index, const Scalar efficiency_scaling_factor)
+
+ +
+
+Scalar efficiency_scaling_factor(const std::string &wname) const
+
+ +
+
+void clear()
+
+ +
+
+bool isRank0() const
+
+ +
+
+

Private Members

+
+
+std::vector<std::size_t> local_map
+
+ +
+
+std::map<std::string, std::size_t> name_map
+
+ +
+
+std::vector<int> m_in_injecting_group
+
+ +
+
+std::vector<int> m_in_producing_group
+
+ +
+
+std::vector<int> m_is_open
+
+ +
+
+std::vector<Scalar> m_efficiency_scaling_factors
+
+ +
+
+bool is_rank0_ = {true}
+
+ +
+
+ +
+
+struct GPU_storage
+
+

Public Members

+
+
+cl::Buffer invDiagVals
+
+ +
+
+cl::Buffer diagIndex
+
+ +
+
+cl::Buffer rowsPerColor
+
+ +
+
+cl::Buffer rowIndices
+
+ +
+
+cl::Buffer LUvals
+
+ +
+
+cl::Buffer LUcols
+
+ +
+
+cl::Buffer LUrows
+
+ +
+
+ +
+
+template<class field_type, int block_size, class OwnerOverlapCopyCommunicationType>
class GPUAwareMPISender : public Opm::gpuistl::GPUSender<field_type, OwnerOverlapCopyCommunicationType>
+
+

Derived class of GPUSender that handles MPI made with CUDA aware MPI The copOwnerToAll function uses MPI calls refering to data that resides on the GPU in order to send it directly to other GPUs, skipping the staging step on the CPU.

+
+
Template Parameters:
+
    +
  • field_type – is float or double

  • +
  • block_size – is the blocksize of the blockelements in the matrix

  • +
  • OwnerOverlapCopyCommunicationType – is typically a Dune::LinearOperator::communication_type

  • +
+
+
+
+

Public Types

+
+
+using X = GpuVector<field_type>
+
+ +
+
+

Public Functions

+
+
+inline explicit GPUAwareMPISender(const OwnerOverlapCopyCommunicationType &cpuOwnerOverlapCopy)
+
+ +
+
+inline virtual void copyOwnerToAll(const X &source, X &dest) const override
+

copyOwnerToAll will copy source to the CPU, then call OwnerOverlapCopyCommunicationType::copyOwnerToAll on the copied data, and copy the result back to the GPU

+
+
Parameters:
+
    +
  • source[in]

  • +
  • dest[out]

  • +
+
+
+
+ +
+
+

Private Types

+
+
+using InformationMap = std::map<int, std::pair<MessageInformation, MessageInformation>>
+
+ +
+
+using IM = std::map<int, std::pair<std::vector<int>, std::vector<int>>>
+
+ +
+
+

Private Functions

+
+
+inline void buildCommPairIdxs() const
+
+ +
+
+inline virtual void initIndexSet() const override
+
+ +
+
+

Private Members

+
+
+mutable std::unique_ptr<GpuVector<int>> m_commpairIndicesCopy
+
+ +
+
+mutable std::unique_ptr<GpuVector<int>> m_commpairIndicesOwner
+
+ +
+
+mutable std::unique_ptr<GpuVector<field_type>> m_GPUSendBuf
+
+ +
+
+mutable std::unique_ptr<GpuVector<field_type>> m_GPURecvBuf
+
+ +
+
+mutable InformationMap m_messageInformation
+
+ +
+
+mutable IM m_im
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr int m_commTag = 0
+
+ +
+
+ +
+
+template<class X, class Y, class C, class P = Dune::PreconditionerWithUpdate<X, Y>>
class GpuBlockPreconditioner : public Dune::PreconditionerWithUpdate<X, Y>, public Opm::gpuistl::PreconditionerHolder<X, Y>
+
+

Is an adaptation of Dune::BlockPreconditioner that works within the CuISTL framework.

+
+

Note

+

We aim to intgrate this into OwningBlockPreconditioner (or a relative thereof).

+
+
+

Public Types

+
+
+using domain_type = X
+
+ +
+
+using range_type = Y
+
+ +
+
+using field_type = typename X::field_type
+
+ +
+
+using communication_type = C
+
+ +
+
+

Public Functions

+
+
+inline GpuBlockPreconditioner(const std::shared_ptr<P> &p, const std::shared_ptr<const communication_type> &c)
+

Constructor.

+

constructor gets all parameters to operate the prec.

+
+
Parameters:
+
    +
  • p – The sequential preconditioner.

  • +
  • c – The communication object for syncing overlap and copy data points. (E.~g. OwnerOverlapCopyCommunication )

  • +
+
+
+
+ +
+
+inline GpuBlockPreconditioner(const std::shared_ptr<P> &p, const communication_type &c)
+
+ +
+
+inline virtual void pre(X &x, Y &b) override
+

Prepare the preconditioner.

+
+ +
+
+inline virtual void apply(X &v, const Y &d) override
+

Apply the preconditioner.

+
+ +
+
+inline virtual void update() override
+
+ +
+
+inline virtual void post(X &x) override
+
+ +
+
+inline virtual Dune::SolverCategory::Category category() const override
+

Category of the preconditioner (see SolverCategory::Category)

+
+ +
+
+inline virtual std::shared_ptr<Dune::PreconditionerWithUpdate<X, Y>> getUnderlyingPreconditioner() override
+

getUnderlyingPreconditioner gets the underlying preconditioner (preconditioner being held)

+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Public Static Functions

+
+
+static inline constexpr bool shouldCallPre()
+
+ +
+
+static inline constexpr bool shouldCallPost()
+
+ +
+
+

Private Members

+
+
+std::shared_ptr<P> m_preconditioner
+

a sequential preconditioner

+
+ +
+
+std::shared_ptr<const communication_type> m_communication
+

the communication object

+
+ +
+
+ +
+
+template<class BridgeMatrix, class BridgeVector, int block_size>
class GpuBridge
+
+#include <GpuBridge.hpp>
+

GpuBridge acts as interface between opm-simulators with the GpuSolvers.

+
+

Public Functions

+
+
+GpuBridge(std::string accelerator_mode, int linear_solver_verbosity, int maxit, Scalar tolerance, unsigned int platformID, unsigned int deviceID, bool opencl_ilu_parallel, std::string linsolver)
+

Construct a GpuBridge

+
+
Parameters:
+
    +
  • accelerator_mode[in] to select if an accelerated solver is used, is passed via command-line: ‘&#8212;accelerator-mode=[none|cusparse|opencl|amgcl|rocalution|rocsparse]’

  • +
  • linear_solver_verbosity[in] verbosity of GpuSolver

  • +
  • maxit[in] maximum number of iterations for GpuSolver

  • +
  • tolerance[in] required relative tolerance for GpuSolver

  • +
  • platformID[in] the OpenCL platform ID to be used

  • +
  • deviceID[in] the device ID to be used by the cusparse- and openclSolvers, too high values could cause runtime errors

  • +
  • opencl_ilu_parallel[in] whether to parallelize the ILU decomposition and application in OpenCL with level_scheduling

  • +
  • linsolver[in] indicating the preconditioner, equal to the &#8212;linear-solver cmdline argument

  • +
+
+
+
+ +
+
+void solve_system(BridgeMatrix *bridgeMat, BridgeMatrix *jacMat, int numJacobiBlocks, BridgeVector &b, WellContributions<Scalar> &wellContribs, InverseOperatorResult &result)
+

Solve linear system, A*x = b

+
+

Warning

+

Values of A might get overwritten!

+
+
+
Parameters:
+
    +
  • bridgeMat[in] matrix A, should be of type Dune::BCRSMatrix

  • +
  • jacMat[in] matrix A, but modified for the preconditioner, should be of type Dune::BCRSMatrix

  • +
  • numJacobiBlocks[in] number of jacobi blocks in jacMat

  • +
  • b[in] vector b, should be of type Dune::BlockVector

  • +
  • wellContribs[in] contains all WellContributions, to apply them separately, instead of adding them to matrix A

  • +
  • result[inout] summary of solver result

  • +
+
+
+
+ +
+
+void get_result(BridgeVector &x)
+

Get the resulting x vector

+
+
Parameters:
+

x[inout] vector x, should be of type Dune::BlockVector

+
+
+
+ +
+
+inline bool getUseGpu()
+

Return whether the GpuBridge will use the GPU or not return whether the GpuBridge will use the GPU or not

+
+ +
+
+void initWellContributions(WellContributions<Scalar> &wellContribs, unsigned N)
+

Initialize the WellContributions object with opencl context and queue those must be set before calling BlackOilWellModel::getWellContributions() in ISTL

+
+
Parameters:
+
    +
  • wellContribs[in] container to hold all WellContributions

  • +
  • N[in] number of rows in scalar vector that wellContribs will be applied on

  • +
+
+
+
+ +
+
+inline std::string getAccleratorName()
+

Return the selected accelerator mode, this is input via the command-line.

+
+ +
+
+

Public Static Functions

+
+
+static void copySparsityPatternFromISTL(const BridgeMatrix &mat, std::vector<int> &h_rows, std::vector<int> &h_cols)
+

Store sparsity pattern into vectors

+
+
Parameters:
+
    +
  • mat[in] input matrix, probably BCRSMatrix

  • +
  • h_rows[out] rowpointers

  • +
  • h_cols[out] columnindices

  • +
+
+
+
+ +
+
+

Private Types

+
+
+using Scalar = typename BridgeVector::field_type
+
+ +
+
+

Private Members

+
+
+int verbosity = 0
+
+ +
+
+bool use_gpu = false
+
+ +
+
+std::string accelerator_mode
+
+ +
+
+std::unique_ptr<Accelerator::GpuSolver<Scalar, block_size>> backend
+
+ +
+
+std::shared_ptr<Accelerator::BlockedMatrix<Scalar>> matrix
+
+ +
+
+std::shared_ptr<Accelerator::BlockedMatrix<Scalar>> jacMatrix
+
+ +
+
+std::vector<int> h_rows
+
+ +
+
+std::vector<int> h_cols
+
+ +
+
+std::vector<int> h_jacRows
+
+ +
+
+std::vector<int> h_jacCols
+
+ +
+
+std::vector<typename BridgeMatrix::size_type> diagIndices
+
+ +
+
+std::vector<typename BridgeMatrix::size_type> jacDiagIndices
+
+ +
+
+ +
+
+struct GpuDeviceId
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 0
+
+ +
+
+ +
+
+template<class CPUMatrixT, class X, class Y, int l = 1>
class GpuDILU : public Dune::PreconditionerWithUpdate<X, Y>
+
+#include <GpuDILU.hpp>
+

DILU preconditioner on the GPU.

+

+
+Todo:
+

Remove the reliance on CPUMatrix. We should be able to use the GPU matrix type directly.

+
+ +

+
+

Note

+

We assume X and Y are both GpuVector<real_type>, but we leave them as template arguments in case of future additions.

+
+
+
Template Parameters:
+
    +
  • CPUMatrixT – Type of the matrix on the CPU

  • +
  • X – Type of the update

  • +
  • Y – Type of the defect

  • +
  • l – Ignored. Just there to have the same number of template arguments as other preconditioners.

  • +
+
+
+
+

Public Types

+
+
+using domain_type = X
+

The domain type of the preconditioner.

+
+ +
+
+using range_type = Y
+

The range type of the preconditioner.

+
+ +
+
+using field_type = typename X::field_type
+

The field type of the preconditioner.

+
+ +
+
+using GPUMatrix = GpuSparseMatrix<field_type>
+
+ +
+
+using FloatMat = GpuSparseMatrix<float>
+
+ +
+
+using FloatVec = GpuVector<float>
+
+ +
+
+using matrix_type = GPUMatrix
+

The matrix type the preconditioner is for.

+
+ +
+
+

Public Functions

+
+
+explicit GpuDILU(const GPUMatrix &gpuMatrix, const CPUMatrixT &cpuMatrix, bool splitMatrix, bool tuneKernels, int mixedPrecisionScheme)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+
+ +
+
+void pre(X &x, Y &b) override
+

Prepare the preconditioner.

+
+

Note

+

Does nothing at the time being.

+
+
+ +
+
+void apply(X &v, const Y &d) override
+

Apply the preconditoner.

+
+ +
+
+void post(X &x) override
+

Post processing.

+
+

Note

+

Does nothing at the moment

+
+
+ +
+
+Dune::SolverCategory::Category category() const override
+

Category of the preconditioner (see SolverCategory::Category)

+
+ +
+
+virtual void update() final
+

Updates the matrix data.

+
+ +
+
+void reorderAndSplitMatrix(int moveThreadBlockSize)
+

perform matrix splitting and reordering

+
+ +
+
+void computeDiagonal(int factorizationThreadBlockSize)
+

Compute the diagonal of the DILU, and update the data of the reordered matrix.

+
+ +
+
+void tuneThreadBlockSizes()
+

function that will experimentally tune the thread block sizes of the important cuda kernels

+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Public Static Functions

+
+
+static inline constexpr bool shouldCallPre()
+
+
Returns:
+

false

+
+
+
+ +
+
+static inline constexpr bool shouldCallPost()
+
+
Returns:
+

false

+
+
+
+ +
+
+

Private Functions

+
+
+void apply(X &v, const Y &d, int lowerSolveThreadBlockSize, int upperSolveThreadBlockSize)
+

Apply the preconditoner.

+
+ +
+
+void update(int moveThreadBlockSize, int factorizationThreadBlockSize)
+

Updates the matrix data.

+
+ +
+
+

Private Members

+
+
+Opm::SparseTable<size_t> m_levelSets
+

SparseTable storing each row by level.

+
+ +
+
+std::vector<int> m_reorderedToNatural
+

converts from index in reordered structure to index natural ordered structure

+
+ +
+
+std::vector<int> m_naturalToReordered
+

converts from index in natural ordered structure to index reordered strucutre

+
+ +
+
+const GPUMatrix &m_gpuMatrix
+

The A matrix stored on the gpu, and its reordred version.

+
+ +
+
+std::unique_ptr<GPUMatrix> m_gpuMatrixReordered
+

Stores the matrix in its entirety reordered. Optional in case splitting is used.

+
+ +
+
+std::unique_ptr<GPUMatrix> m_gpuMatrixReorderedLower
+

If matrix splitting is enabled, then we store the lower and upper part separately.

+
+ +
+
+std::unique_ptr<GPUMatrix> m_gpuMatrixReorderedUpper
+
+ +
+
+std::unique_ptr<GpuVector<field_type>> m_gpuMatrixReorderedDiag
+

If matrix splitting is enabled, we also store the diagonal separately.

+
+ +
+
+std::unique_ptr<FloatMat> m_gpuMatrixReorderedLowerFloat
+

If mixed precision is enabled, store a float matrix.

+
+ +
+
+std::unique_ptr<FloatMat> m_gpuMatrixReorderedUpperFloat
+
+ +
+
+std::unique_ptr<FloatVec> m_gpuMatrixReorderedDiagFloat
+
+ +
+
+std::unique_ptr<FloatVec> m_gpuDInvFloat
+
+ +
+
+GpuVector<int> m_gpuNaturalToReorder
+

row conversion from natural to reordered matrix indices stored on the GPU

+
+ +
+
+GpuVector<int> m_gpuReorderToNatural
+

row conversion from reordered to natural matrix indices stored on the GPU

+
+ +
+
+GpuVector<field_type> m_gpuDInv
+

Stores the inverted diagonal that we use in DILU.

+
+ +
+
+bool m_splitMatrix
+

Bool storing whether or not we should store matrices in a split format.

+
+ +
+
+bool m_tuneThreadBlockSizes
+

Bool storing whether or not we will tune the threadblock sizes. Only used for AMD cards.

+
+ +
+
+const MatrixStorageMPScheme m_mixedPrecisionScheme
+

Enum describing how we should store the factorized matrix.

+
+ +
+
+int m_upperSolveThreadBlockSize = -1
+

variables storing the threadblocksizes to use if using the tuned sizes and AMD cards The default value of -1 indicates that we have not calibrated and selected a value yet

+
+ +
+
+int m_lowerSolveThreadBlockSize = -1
+
+ +
+
+int m_moveThreadBlockSize = -1
+
+ +
+
+int m_DILUFactorizationThreadBlockSize = -1
+
+ +
+
+std::map<std::pair<field_type*, const field_type*>, GPUGraph> m_apply_graphs
+
+ +
+
+std::map<std::pair<field_type*, const field_type*>, GPUGraphExec> m_executableGraphs
+
+ +
+
+GPUStream m_stream = {}
+
+ +
+
+GPUEvent m_before = {}
+
+ +
+
+GPUEvent m_after = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr const size_t blocksize_ = CPUMatrixT::block_type::cols
+

size_t describing the dimensions of the square block elements

+
+ +
+
+ +
+
+template<class M, class X, class Y, int l = 1>
class GpuJac : public Dune::PreconditionerWithUpdate<X, Y>
+
+#include <GpuJac.hpp>
+

Jacobi preconditioner on the GPU.

+
+

Note

+

This is a fast but weak preconditioner

+
+
+

Note

+

We assume X and Y are both GpuVector<real_type>, but we leave them as template arguments in case of future additions.

+
+
+
Template Parameters:
+
    +
  • M – The matrix type to operate on

  • +
  • X – Type of the update

  • +
  • Y – Type of the defect

  • +
  • l – Ignored. Just there to have the same number of template arguments as other preconditioners.

  • +
+
+
+
+

Public Types

+
+
+using matrix_type = typename std::remove_const<M>::type
+

The matrix type the preconditioner is for.

+
+ +
+
+using domain_type = X
+

The domain type of the preconditioner.

+
+ +
+
+using range_type = Y
+

The range type of the preconditioner.

+
+ +
+
+using field_type = typename X::field_type
+

The field type of the preconditioner.

+
+ +
+
+

Public Functions

+
+
+GpuJac(const M &A, field_type w)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • w – The relaxation factor.

  • +
+
+
+
+ +
+
+virtual void pre(X &x, Y &b) override
+

Prepare the preconditioner.

+
+

Note

+

Does nothing at the time being.

+
+
+ +
+
+virtual void apply(X &v, const Y &d) override
+

Apply the preconditoner.

+
+ +
+
+virtual void post(X &x) override
+

Post processing.

+
+

Note

+

Does nothing at the moment

+
+
+ +
+
+virtual Dune::SolverCategory::Category category() const override
+

Category of the preconditioner (see SolverCategory::Category)

+
+ +
+
+virtual void update() override
+

Updates the matrix data.

+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Public Static Functions

+
+
+static inline constexpr bool shouldCallPre()
+
+
Returns:
+

false

+
+
+
+ +
+
+static inline constexpr bool shouldCallPost()
+
+
Returns:
+

false

+
+
+
+ +
+
+

Private Functions

+
+
+void invertDiagonalAndFlatten()
+
+ +
+
+template<int blocksize>
void dispatchInvertDiagonalAndFlatten()
+
+ +
+
+

Private Members

+
+
+const M &m_matrix
+

Reference to the underlying matrix.

+
+ +
+
+const field_type m_relaxationFactor
+

The relaxation factor to use.

+
+ +
+
+GpuVector<field_type> m_diagInvFlattened
+

the diagonal of cuMatrix inverted, and then flattened to fit in a vector

+
+ +
+
+ +
+
+template<class field_type, int block_size, class OwnerOverlapCopyCommunicationType>
class GPUObliviousMPISender : public Opm::gpuistl::GPUSender<field_type, OwnerOverlapCopyCommunicationType>
+
+

Derived class of GPUSender that handles MPI calls that should NOT use GPU direct communicatoin The implementation moves data fromthe GPU to the CPU and then sends it using regular MPI.

+
+
Template Parameters:
+
    +
  • field_type – is float or double

  • +
  • block_size – is the blocksize of the blockelements in the matrix

  • +
  • OwnerOverlapCopyCommunicationType – is typically a Dune::LinearOperator::communication_type

  • +
+
+
+
+

Public Types

+
+
+using X = GpuVector<field_type>
+
+ +
+
+

Public Functions

+
+
+inline explicit GPUObliviousMPISender(const OwnerOverlapCopyCommunicationType &cpuOwnerOverlapCopy)
+
+ +
+
+inline virtual void copyOwnerToAll(const X &source, X &dest) const override
+

copyOwnerToAll will copy source to the CPU, then call OwnerOverlapCopyCommunicationType::copyOwnerToAll on the copied data, and copy the result back to the GPU

+
+
Parameters:
+
    +
  • source[in]

  • +
  • dest[out]

  • +
+
+
+
+ +
+
+

Private Functions

+
+
+inline virtual void initIndexSet() const override
+
+ +
+
+ +
+
+template<class field_type, int block_size, class OwnerOverlapCopyCommunicationType>
class GpuOwnerOverlapCopy
+
+

CUDA compatiable variant of Dune::OwnerOverlapCopyCommunication.

+

This class can essentially be seen as an adapter around Dune::OwnerOverlapCopyCommunication, and should work as a Dune::OwnerOverlapCopyCommunication on GpuVectors

+
+

Note

+

This currently only has the functionality to parallelize the linear solve.

+
+
+
Template Parameters:
+
    +
  • field_type – should be a field_type supported by GpuVector (double, float)

  • +
  • block_size – the block size used (this is relevant for say figuring out the correct indices)

  • +
  • OwnerOverlapCopyCommunicationType – should mimic Dune::OwnerOverlapCopyCommunication.

  • +
+
+
+
+

Public Types

+
+
+using X = GpuVector<field_type>
+
+ +
+
+

Public Functions

+
+
+inline explicit GpuOwnerOverlapCopy(std::shared_ptr<GPUSender<field_type, OwnerOverlapCopyCommunicationType>> sender)
+
+ +
+
+inline void copyOwnerToAll(const X &source, X &dest) const
+
+ +
+
+inline void dot(const X &x, const X &y, field_type &output) const
+
+ +
+
+inline field_type norm(const X &x) const
+
+ +
+
+inline void project(X &x) const
+
+ +
+
+

Private Members

+
+
+std::shared_ptr<GPUSender<field_type, OwnerOverlapCopyCommunicationType>> m_sender
+
+ +
+
+ +
+
+class GpuResult
+
+#include <GpuResult.hpp>
+

This class is based on InverseOperatorResult struct from dune/istl/solver.hh It is needed to prevent a compile error in basearray.hh, the nvcc compiler might not support all features in there

+
+

Public Members

+
+
+int iterations = 0
+
+ +
+
+double reduction = 0.0
+
+ +
+
+bool converged = false
+
+ +
+
+double conv_rate = 0.0
+
+ +
+
+double elapsed = 0.0
+
+ +
+
+ +
+
+template<class field_type, class OwnerOverlapCopyCommunicationType>
class GPUSender
+
+

GPUSender is a wrapper class for classes which will implement copOwnerToAll This is implemented with the intention of creating communicators with generic GPUSender To hide implementation that will either use GPU aware MPI or not.

+
+
Template Parameters:
+
    +
  • field_type – is float or double

  • +
  • OwnerOverlapCopyCommunicationType – is typically a Dune::LinearOperator::communication_type

  • +
+
+
+

Subclassed by Opm::gpuistl::GPUAwareMPISender< field_type, block_size, OwnerOverlapCopyCommunicationType >, Opm::gpuistl::GPUObliviousMPISender< field_type, block_size, OwnerOverlapCopyCommunicationType >

+
+

Public Types

+
+
+using X = GpuVector<field_type>
+
+ +
+
+

Public Functions

+
+
+inline GPUSender(const OwnerOverlapCopyCommunicationType &cpuOwnerOverlapCopy)
+
+ +
+
+virtual ~GPUSender() = default
+
+ +
+
+virtual void copyOwnerToAll(const X &source, X &dest) const = 0
+

copyOwnerToAll will copy source to the CPU, then call OwnerOverlapCopyCommunicationType::copyOwnerToAll on the copied data, and copy the result back to the GPU

+
+
Parameters:
+
    +
  • source[in]

  • +
  • dest[out]

  • +
+
+
+
+ +
+
+virtual void initIndexSet() const = 0
+
+ +
+
+inline void project(X &x) const
+

project will project x to the owned subspace

+

For each component i which is not owned, x_i will be set to 0

+
+
Parameters:
+

x[inout] the vector to project

+
+
+
+ +
+
+inline void dot(const X &x, const X &y, field_type &output) const
+

dot will carry out the dot product between x and y on the owned indices, then sum up the result across MPI processes.

+
+

Note

+

This uses the same interface as its DUNE equivalent.

+
+
+
Parameters:
+

output[out] result will be stored here

+
+
+
+ +
+
+inline field_type norm(const X &x) const
+

norm computes the l^2-norm of x across processes.

+

This will compute the dot product of x with itself on owned indices, then sum the result across process and return the square root of the sum.

+
+ +
+
+

Protected Attributes

+
+
+mutable std::once_flag m_initializedIndices
+
+ +
+
+mutable std::unique_ptr<GpuVector<int>> m_indicesOwner
+
+ +
+
+mutable std::unique_ptr<GpuVector<int>> m_indicesCopy
+
+ +
+
+const OwnerOverlapCopyCommunicationType &m_cpuOwnerOverlapCopy
+
+ +
+
+ +
+
+template<class M, class X, class Y, int l = 1>
class GpuSeqILU0 : public Dune::PreconditionerWithUpdate<X, Y>
+
+#include <GpuSeqILU0.hpp>
+

Sequential ILU0 preconditioner on the GPU through the CuSparse library.

+

This implementation calls the CuSparse functions, which in turn essentially does a level decomposition to get some parallelism.

+
+

Note

+

This is not expected to be a fast preconditioner.

+
+
+

Note

+

We assume X and Y are both GpuVector<real_type>, but we leave them as template arguments in case of future additions.

+
+
+
Template Parameters:
+
    +
  • M – The matrix type to operate on

  • +
  • X – Type of the update

  • +
  • Y – Type of the defect

  • +
  • l – Ignored. Just there to have the same number of template arguments as other preconditioners.

  • +
+
+
+
+

Public Types

+
+
+using matrix_type = typename std::remove_const<M>::type
+

The matrix type the preconditioner is for.

+
+ +
+
+using domain_type = X
+

The domain type of the preconditioner.

+
+ +
+
+using range_type = Y
+

The range type of the preconditioner.

+
+ +
+
+using field_type = typename X::field_type
+

The field type of the preconditioner.

+
+ +
+
+

Public Functions

+
+
+template<typename T = M, typename std::enable_if_t<is_gpu_matrix_v<T>, int> = 0>
GpuSeqILU0(const M &A, field_type w)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • w – The relaxation factor.

  • +
+
+
+
+ +
+
+template<typename T = M, typename std::enable_if_t<!is_gpu_matrix_v<T>, int> = 0>
GpuSeqILU0(const M &A, field_type w)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • w – The relaxation factor.

  • +
+
+
+
+ +
+
+virtual void pre(X &x, Y &b) override
+

Prepare the preconditioner.

+
+

Note

+

Does nothing at the time being.

+
+
+ +
+
+virtual void apply(X &v, const Y &d) override
+

Apply the preconditoner.

+
+ +
+
+virtual void post(X &x) override
+

Post processing.

+
+

Note

+

Does nothing at the moment

+
+
+ +
+
+virtual Dune::SolverCategory::Category category() const override
+

Category of the preconditioner (see SolverCategory::Category)

+
+ +
+
+virtual void update() override
+

Updates the matrix data.

+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Public Static Functions

+
+
+static inline constexpr bool shouldCallPre()
+
+
Returns:
+

false

+
+
+
+ +
+
+static inline constexpr bool shouldCallPost()
+
+
Returns:
+

false

+
+
+
+ +
+
+

Private Functions

+
+
+void analyzeMatrix()
+
+ +
+
+size_t findBufferSize()
+
+ +
+
+void createILU()
+
+ +
+
+void updateILUConfiguration()
+
+ +
+
+

Private Members

+
+
+const M &m_underlyingMatrix
+

Reference to the underlying matrix.

+
+ +
+
+field_type m_w
+

The relaxation factor to use.

+
+ +
+
+GpuSparseMatrix<field_type> m_LU
+

This is the storage for the LU composition. Initially this will have the values of A, but will be modified in the constructor to be the proper LU decomposition.

+
+ +
+
+GpuVector<field_type> m_temporaryStorage
+
+ +
+
+detail::GpuSparseMatrixDescriptionPtr m_descriptionL
+
+ +
+
+detail::GpuSparseMatrixDescriptionPtr m_descriptionU
+
+ +
+
+detail::CuSparseResource<bsrsv2Info_t> m_infoL
+
+ +
+
+detail::CuSparseResource<bsrsv2Info_t> m_infoU
+
+ +
+
+detail::CuSparseResource<bsrilu02Info_t> m_infoM
+
+ +
+
+std::unique_ptr<GpuVector<field_type>> m_buffer
+
+ +
+
+detail::CuSparseHandle &m_cuSparseHandle
+
+ +
+
+bool m_analysisDone = false
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class GpuSolver
+
+#include <GpuSolver.hpp>
+

This class serves to simplify choosing between different backend solvers, such as cusparseSolver and openclSolver This class is abstract, no instantiations can of it can be made, only of its children

+

Subclassed by Opm::Accelerator::amgclSolverBackend< Scalar, block_size >, Opm::Accelerator::cusparseSolverBackend< Scalar, block_size >, Opm::Accelerator::openclSolverBackend< Scalar, block_size >, Opm::Accelerator::rocalutionSolverBackend< Scalar, block_size >, Opm::Accelerator::rocsparseSolverBackend< Scalar, block_size >

+
+

Public Functions

+
+
+inline GpuSolver(int linear_solver_verbosity, int max_it, Scalar tolerance_)
+

Construct a GpuSolver

+
+
Parameters:
+
    +
  • linear_solver_verbosity[in] verbosity of solver

  • +
  • maxit[in] maximum number of iterations for solver

  • +
  • tolerance[in] required relative tolerance for solver

  • +
  • platformID[in] the OpenCL platform to be used, only used in openclSolver

  • +
  • deviceID[in] the device to be used

  • +
+
+
+
+ +
+
+inline GpuSolver(int linear_solver_verbosity, int max_it, Scalar tolerance_, unsigned int deviceID_)
+
+ +
+
+inline GpuSolver(int linear_solver_verbosity, int max_it, double tolerance_, unsigned int platformID_, unsigned int deviceID_)
+
+ +
+
+virtual ~GpuSolver() = default
+

Define virtual destructor, so that the derivedclass destructor will be called.

+
+ +
+
+virtual SolverStatus solve_system(std::shared_ptr<BlockedMatrix<Scalar>> matrix, Scalar *b, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix, WellContributions<Scalar> &wellContribs, GpuResult &res) = 0
+

Define as pure virtual functions, so derivedclass must implement them.

+
+ +
+
+virtual void get_result(Scalar *x) = 0
+
+ +
+
+

Protected Attributes

+
+
+int verbosity = 0
+
+ +
+
+int maxit = 200
+
+ +
+
+Scalar tolerance = 1e-2
+
+ +
+
+int N
+
+ +
+
+int Nb
+
+ +
+
+int nnz
+
+ +
+
+int nnzb
+
+ +
+
+unsigned int platformID = 0
+
+ +
+
+unsigned int deviceID = 0
+
+ +
+
+bool initialized = false
+
+ +
+
+ +
+
+template<class Matrix, class Vector>
struct GpuSolverInfo
+
+
+

Public Types

+
+
+using Scalar = typename Vector::field_type
+
+ +
+
+using WellContribFunc = std::function<void(WellContributions<Scalar>&)>
+
+ +
+
+using Bridge = GpuBridge<Matrix, Vector, Matrix::block_type::rows>
+
+ +
+
+

Public Functions

+
+
+GpuSolverInfo(const std::string &accelerator_mode, const int linear_solver_verbosity, const int maxit, const Scalar tolerance, const int platformID, const int deviceID, const bool opencl_ilu_parallel, const std::string &linsolver)
+
+ +
+
+~GpuSolverInfo()
+
+ +
+
+template<class Grid>
void prepare(const Grid &grid, const Dune::CartesianIndexMapper<Grid> &cartMapper, const std::vector<Well> &wellsForConn, const std::unordered_map<std::string, std::set<int>> &possibleFutureConnections, const std::vector<int> &cellPartition, const std::size_t nonzeroes, const bool useWellConn)
+
+ +
+
+bool apply(Vector &rhs, const bool useWellConn, WellContribFunc getContribs, const int rank, Matrix &matrix, Vector &x, Dune::InverseOperatorResult &result)
+
+ +
+
+bool gpuActive()
+
+ +
+
+

Public Members

+
+
+int numJacobiBlocks_ = 0
+
+ +
+
+

Private Functions

+
+
+template<class Grid>
void blockJacobiAdjacency(const Grid &grid, const std::vector<int> &cell_part, std::size_t nonzeroes)
+

Create sparsity pattern for block-Jacobi matrix based on partitioning of grid. Do not initialize the values, that is done in copyMatToBlockJac()

+
+ +
+
+void copyMatToBlockJac(const Matrix &mat, Matrix &blockJac)
+
+ +
+
+

Private Members

+
+
+std::unique_ptr<Bridge> bridge_
+
+ +
+
+std::string accelerator_mode_
+
+ +
+
+std::unique_ptr<Matrix> blockJacobiForGPUILU0_
+
+ +
+
+std::vector<std::set<int>> wellConnectionsGraph_
+
+ +
+
+ +
+
+template<typename T>
class GpuSparseMatrix
+
+#include <GpuSparseMatrix.hpp>
+

The GpuSparseMatrix class simple wrapper class for a CuSparse matrix.

+
+

Note

+

we currently only support simple raw primitives for T (double and float). Block size is handled through the block size parameter

+
+
+

Note

+

we only support square matrices.

+
+
+

Note

+

We only support Block Compressed Sparse Row Format (BSR) for now.

+
+
+
Template Parameters:
+

T – the type to store. Can be either float, double or int.

+
+
+
+

Public Types

+
+
+using field_type = T
+
+ +
+
+

Public Functions

+
+
+GpuSparseMatrix(const T *nonZeroElements, const int *rowIndices, const int *columnIndices, size_t numberOfNonzeroBlocks, size_t blockSize, size_t numberOfRows)
+

Create the sparse matrix specified by the raw data.

+
+

Note

+

Prefer to use the constructor taking a const reference to a matrix instead.

+
+
+

Note

+

We assume numberOfNonzeroBlocks, blockSize and numberOfRows all are representable as int due to restrictions in the current version of cusparse. This might change in future versions.

+
+
+
Parameters:
+
    +
  • nonZeroElements[in] the non-zero values of the matrix

  • +
  • rowIndices[in] the row indices of the non-zero elements

  • +
  • columnIndices[in] the column indices of the non-zero elements

  • +
  • numberOfNonzeroElements[in] number of nonzero elements

  • +
  • blockSize[in] size of each block matrix (typically 3)

  • +
  • numberOfRows[in] the number of rows

  • +
+
+
+
+ +
+
+GpuSparseMatrix(const GpuVector<int> &rowIndices, const GpuVector<int> &columnIndices, size_t blockSize)
+

Create a sparse matrix by copying the sparsity structure of another matrix, not filling in the values

+
+

Note

+

Prefer to use the constructor taking a const reference to a matrix instead.

+
+
+

Note

+

We assume numberOfNonzeroBlocks, blockSize and numberOfRows all are representable as int due to restrictions in the current version of cusparse. This might change in future versions.

+
+
+
Parameters:
+
    +
  • rowIndices[in] the row indices of the non-zero elements

  • +
  • columnIndices[in] the column indices of the non-zero elements

  • +
  • blockSize[in] size of each block matrix (typically 3)

  • +
+
+
+
+ +
+
+GpuSparseMatrix(const GpuSparseMatrix&)
+
+ +
+
+GpuSparseMatrix &operator=(const GpuSparseMatrix&) = delete
+
+ +
+
+virtual ~GpuSparseMatrix()
+
+ +
+
+void setUpperTriangular()
+

setUpperTriangular sets the CuSparse flag that this is an upper diagonal (with unit diagonal) matrix.

+
+ +
+
+void setLowerTriangular()
+

setLowerTriangular sets the CuSparse flag that this is an lower diagonal (with non-unit diagonal) matrix.

+
+ +
+
+void setUnitDiagonal()
+

setUnitDiagonal sets the CuSparse flag that this has unit diagional.

+
+ +
+
+void setNonUnitDiagonal()
+

setNonUnitDiagonal sets the CuSparse flag that this has non-unit diagional.

+
+ +
+
+inline size_t N() const
+

N returns the number of rows (which is equal to the number of columns)

+
+ +
+
+inline size_t nonzeroes() const
+

nonzeroes behaves as the Dune::BCRSMatrix::nonzeros() function and returns the number of non zero blocks

+
+
Returns:
+

number of non zero blocks.

+
+
+
+ +
+
+inline GpuVector<T> &getNonZeroValues()
+

getNonZeroValues returns the GPU vector containing the non-zero values (ordered by block)

+
+

Note

+

Read the CuSPARSE documentation on Block Compressed Sparse Row Format (BSR) for the exact ordering.

+
+
+ +
+
+inline const GpuVector<T> &getNonZeroValues() const
+

getNonZeroValues returns the GPU vector containing the non-zero values (ordered by block)

+
+

Note

+

Read the CuSPARSE documentation on Block Compressed Sparse Row Format (BSR) for the exact ordering.

+
+
+ +
+
+inline GpuVector<int> &getRowIndices()
+

getRowIndices returns the row indices used to represent the BSR structure.

+
+

Note

+

Read the CuSPARSE documentation on Block Compressed Sparse Row Format (BSR) for the exact ordering.

+
+
+ +
+
+inline const GpuVector<int> &getRowIndices() const
+

getRowIndices returns the row indices used to represent the BSR structure.

+
+

Note

+

Read the CuSPARSE documentation on Block Compressed Sparse Row Format (BSR) for the exact ordering.

+
+
+ +
+
+inline GpuVector<int> &getColumnIndices()
+

getColumnIndices returns the column indices used to represent the BSR structure.

+
+
Returns:
+

Read the CuSPARSE documentation on Block Compressed Sparse Row Format (BSR) for the exact ordering.

+
+
+
+ +
+
+inline const GpuVector<int> &getColumnIndices() const
+

getColumnIndices returns the column indices used to represent the BSR structure.

+
+
Returns:
+

Read the CuSPARSE documentation on Block Compressed Sparse Row Format (BSR) for the exact ordering.

+
+
+
+ +
+
+inline size_t dim() const
+

dim returns the dimension of the vector space on which this matrix acts

+

This is equivalent to matrix.N() * matrix.blockSize()

+
+
Returns:
+

matrix.N() * matrix.blockSize()

+
+
+
+ +
+
+inline size_t blockSize() const
+

blockSize size of the blocks

+
+ +
+
+inline detail::GpuSparseMatrixDescription &getDescription()
+

getDescription the cusparse matrix description.

+

This description is needed for most calls to the CuSparse library

+
+ +
+
+virtual void mv(const GpuVector<T> &x, GpuVector<T> &y) const
+

mv performs matrix vector multiply y = Ax

+
+

Note

+

Due to limitations of CuSparse, this is only supported for block sizes greater than 1.

+
+
+
Parameters:
+
    +
  • x[in] the vector to multiply the matrix with

  • +
  • y[out] the output vector

  • +
+
+
+
+ +
+
+virtual void umv(const GpuVector<T> &x, GpuVector<T> &y) const
+

umv computes y=Ax+y

+
+

Note

+

Due to limitations of CuSparse, this is only supported for block sizes greater than 1.

+
+
+
Parameters:
+
    +
  • x[in] the vector to multiply with A

  • +
  • y[inout] the vector to add and store the output in

  • +
+
+
+
+ +
+
+virtual void usmv(T alpha, const GpuVector<T> &x, GpuVector<T> &y) const
+

umv computes y=alpha * Ax + y

+
+

Note

+

Due to limitations of CuSparse, this is only supported for block sizes greater than 1.

+
+
+
Parameters:
+
    +
  • x[in] the vector to multiply with A

  • +
  • y[inout] the vector to add and store the output in

  • +
+
+
+
+ +
+
+template<class MatrixType>
void updateNonzeroValues(const MatrixType &matrix, bool copyNonZeroElementsDirectly = false)
+

updateNonzeroValues updates the non-zero values by using the non-zero values of the supplied matrix

+
+

Note

+

This assumes the given matrix has the same sparsity pattern.

+
+
+
Parameters:
+
    +
  • matrix – the matrix to extract the non-zero values from

  • +
  • copyNonZeroElementsDirectly – if true will do a memcpy from matrix[0][0][0][0], otherwise will build up the non-zero elements by looping over the matrix. Note that setting this to true will yield a performance increase, but might not always yield correct results depending on how the matrix matrix has been initialized. If unsure, leave it as false.

  • +
+
+
Template Parameters:
+

MatrixType – is assumed to be a Dune::BCRSMatrix compatible matrix.

+
+
+
+ +
+
+void updateNonzeroValues(const GpuSparseMatrix<T> &matrix)
+

updateNonzeroValues updates the non-zero values by using the non-zero values of the supplied matrix

+
+

Note

+

This assumes the given matrix has the same sparsity pattern.

+
+
+
Parameters:
+

matrix – the matrix to extract the non-zero values from

+
+
+
+ +
+
+

Public Static Functions

+
+
+template<class MatrixType>
static GpuSparseMatrix<T> fromMatrix(const MatrixType &matrix, bool copyNonZeroElementsDirectly = false)
+

fromMatrix creates a new matrix with the same block size and values as the given matrix

+
+
Parameters:
+
    +
  • matrix – the matrix to copy from

  • +
  • copyNonZeroElementsDirectly – if true will do a memcpy from matrix[0][0][0][0], otherwise will build up the non-zero elements by looping over the matrix. Note that setting this to true will yield a performance increase, but might not always yield correct results depending on how the matrix has been initialized. If unsure, leave it as false.

  • +
+
+
Template Parameters:
+

MatrixType – is assumed to be a Dune::BCRSMatrix compatible matrix.

+
+
+
+ +
+
+

Private Functions

+
+
+template<class VectorType>
void assertSameSize(const VectorType &vector) const
+
+ +
+
+

Private Members

+
+
+GpuVector<T> m_nonZeroElements
+
+ +
+
+GpuVector<int> m_columnIndices
+
+ +
+
+GpuVector<int> m_rowIndices
+
+ +
+
+const int m_numberOfNonzeroBlocks
+
+ +
+
+const int m_numberOfRows
+
+ +
+
+const int m_blockSize
+
+ +
+
+detail::GpuSparseMatrixDescriptionPtr m_matrixDescription
+
+ +
+
+detail::CuSparseHandle &m_cusparseHandle
+
+ +
+
+ +
+
+template<typename T>
class GpuView
+
+#include <GpuView.hpp>
+

The GpuView class is provides a view of some data allocated on the GPU Essenstially is only stores a pointer and a size.

+

This class supports being used from inside a CUDA/HIP Kernel. Implementations are placed in this headerfile for functions that may be called inside a kernel to avoid expensive RDC (relocatable device code)

+

The view will typically provide a view into a GpuBuffer and be able to manipulate the data within it

+
+
Param T:
+

Type of the data we store, typically int/float/double w/o const specifier

+
+
+
+

Public Types

+
+
+using value_type = T
+
+ +
+
+

Public Functions

+
+
+explicit GpuView() = default
+

Default constructor that will initialize cublas and allocate 0 bytes of memory.

+
+ +
+
+GpuView(std::vector<T> &data)
+

constructor based on std::vectors, this will make a view on the CPU

+
+
Parameters:
+

data – std vector to pr

+
+
+
+ +
+
+inline __host__ __device__ T & operator[] (size_t idx)
+

operator[] to retrieve a reference to an item in the buffer

+
+
Parameters:
+

idx – The index of the element

+
+
+
+ +
+
+inline __host__ __device__ T operator[] (size_t idx) const
+

operator[] to retrieve a copy of an item in the buffer

+
+
Parameters:
+

idx – The index of the element

+
+
+
+ +
+
+inline GpuView(T *dataOnHost, size_t numberOfElements)
+

GpuView allocates new GPU memory of size numberOfElements * sizeof(T) and copies numberOfElements from data.

+
+

Note

+

This assumes the data is on the CPU.

+
+
+
Parameters:
+
    +
  • numberOfElements – number of T elements to allocate

  • +
  • dataOnHost – data on host/CPU

  • +
+
+
+
+ +
+
+~GpuView() = default
+

~GpuView calls cudaFree

+
+ +
+
+inline __host__ __device__ T * data ()
+
+
Returns:
+

the raw pointer to the GPU data

+
+
+
+ +
+
+inline __host__ __device__ const T * data () const
+
+
Returns:
+

the raw pointer to the GPU data

+
+
+
+ +
+
+inline __host__ __device__ T & front ()
+
+
Returns:
+

fetch the first element in a GpuView

+
+
+
+ +
+
+inline __host__ __device__ T & back ()
+
+
Returns:
+

fetch the last element in a GpuView

+
+
+
+ +
+
+inline __host__ __device__ T front () const
+
+
Returns:
+

fetch the first element in a GpuView

+
+
+
+ +
+
+inline __host__ __device__ T back () const
+
+
Returns:
+

fetch the last element in a GpuView

+
+
+
+ +
+
+void copyFromHost(const T *dataPointer, size_t numberOfElements)
+

copyFromHost copies numberOfElements from the CPU memory dataPointer

+
+

Note

+

This does synchronous transfer.

+
+
+

Note

+

assumes that this view has numberOfElements elements

+
+
+
Parameters:
+
    +
  • dataPointer – raw pointer to CPU memory

  • +
  • numberOfElements – number of elements to copy

  • +
+
+
+
+ +
+
+void copyToHost(T *dataPointer, size_t numberOfElements) const
+

copyFromHost copies numberOfElements to the CPU memory dataPointer

+
+

Note

+

This does synchronous transfer.

+
+
+

Note

+

assumes that this view has numberOfElements elements

+
+
+
Parameters:
+
    +
  • dataPointer – raw pointer to CPU memory

  • +
  • numberOfElements – number of elements to copy

  • +
+
+
+
+ +
+
+void copyFromHost(const std::vector<T> &data)
+

copyToHost copies data from an std::vector

+
+

Note

+

This does synchronous transfer.

+
+
+

Note

+

This assumes that the size of this view is equal to the size of the input vector.

+
+
+
Parameters:
+

data – the vector to copy from

+
+
+
+ +
+
+void copyToHost(std::vector<T> &data) const
+

copyToHost copies data to an std::vector

+
+

Note

+

This does synchronous transfer.

+
+
+

Note

+

This assumes that the size of this view is equal to the size of the input vector.

+
+
+
Parameters:
+

data – the vector to copy to

+
+
+
+ +
+
+inline __host__ __device__ size_t size () const
+

size returns the size (number of T elements) in the vector

+
+
Returns:
+

number of elements

+
+
+
+ +
+
+std::vector<T> asStdVector() const
+

creates an std::vector of the same size and copies the GPU data to this std::vector

+
+
Returns:
+

an std::vector containing the elements copied from the GPU.

+
+
+
+ +
+
+inline __host__ __device__ iterator begin ()
+

Get an iterator pointing to the first element of the buffer.

+
+
Parameters:
+

iterator – to traverse the buffer

+
+
+
+ +
+
+inline __host__ __device__ iterator begin () const
+

Get a const iterator pointing to the first element of the buffer.

+
+
Parameters:
+

iterator – to traverse the buffer

+
+
+
+ +
+
+inline __host__ __device__ iterator end ()
+

Get an iterator pointing to the address after the last element of the buffer.

+
+
Parameters:
+

iterator – pointing to the first value after the end of the buffer

+
+
+
+ +
+
+inline __host__ __device__ iterator end () const
+

Get a const iterator pointing to the address after the last element of the buffer.

+
+
Parameters:
+

iterator – pointing to the first value after the end of the buffer

+
+
+
+ +
+
+

Private Functions

+
+
+inline __host__ __device__ void assertSameSize (const GpuView< T > &other) const
+

Helper function to assert if another view has the same size.

+
+
Parameters:
+

other – view

+
+
+
+ +
+
+inline __host__ __device__ void assertSameSize (size_t size) const
+

Helper function to assert if the size of this view equal to a given value.

+
+
Parameters:
+

size – The value to compare with the size of this view

+
+
+
+ +
+
+inline __host__ __device__ void assertHasElements () const
+

Helper function to assert that the view has at least one element.

+
+ +
+
+inline __host__ __device__ void assertInRange (size_t idx) const
+

Helper function to determine if an index is within the range of valid indexes in the view.

+
+ +
+
+

Private Members

+
+
+T *m_dataPtr
+
+ +
+
+size_t m_numberOfElements
+
+ +
+
+ +
+
+template<class TypeTag>
struct GradientCalculator<TypeTag, TTag::FlowBaseProblemBlackoil>
+
+
+

Public Types

+
+
+using type = DummyGradientCalculator<TypeTag>
+
+ +
+
+ +
+
+struct GradInfo
+
+
+

Public Functions

+
+
+GradInfo() = default
+
+ +
+
+inline GradInfo(Scalar grad_, Scalar new_oil_rate_, bool oil_is_limited_, Scalar new_gas_rate_, bool gas_is_limited_, Scalar new_water_rate_, bool water_is_limited_, Scalar alq_, bool alq_is_limited_)
+
+ +
+
+

Public Members

+
+
+Scalar grad
+
+ +
+
+Scalar new_oil_rate
+
+ +
+
+bool oil_is_limited
+
+ +
+
+Scalar new_gas_rate
+
+ +
+
+bool gas_is_limited
+
+ +
+
+Scalar new_water_rate
+
+ +
+
+bool water_is_limited
+
+ +
+
+Scalar alq
+
+ +
+
+bool alq_is_limited
+
+ +
+
+ +
+
+template<class TypeTag>
struct Grid<TypeTag, TTag::AluGridVanguard>
+
+#include <AluGridVanguard.hpp>
+
+

Public Types

+
+
+using type = Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming, Dune::ALUGridNoComm>
+
+ +
+
+ +
+
+template<class TypeTag>
struct Grid<TypeTag, TTag::CpGridVanguard>
+
+#include <CpGridVanguard.hpp>
+
+

Public Types

+
+
+using type = Dune::CpGrid
+
+ +
+
+ +
+
+template<class TypeTag>
struct Grid<TypeTag, TTag::PolyhedralGridVanguard>
+
+
+

Public Types

+
+
+using type = Dune::PolyhedralGrid<3, 3>
+
+ +
+
+ +
+
+template<class TypeTag>
struct GridView<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Types

+
+
+using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView
+
+ +
+
+ +
+
+template<class Scalar>
class GroupEconomicLimitsChecker
+
+
+

Public Functions

+
+
+GroupEconomicLimitsChecker(const BlackoilWellModelGeneric<Scalar> &well_model, WellTestState &well_test_state, const Group &group, const double simulation_time, const int report_step_idx, DeferredLogger &deferred_logger)
+
+ +
+
+void closeWells()
+
+ +
+
+bool minGasRate()
+
+ +
+
+bool minOilRate()
+
+ +
+
+bool waterCut()
+
+ +
+
+bool GOR()
+
+ +
+
+bool WGR()
+
+ +
+
+void doWorkOver()
+
+ +
+
+bool endRun()
+
+ +
+
+int numProducersOpenInitially()
+
+ +
+
+int numProducersOpen()
+
+ +
+
+void activateEndRun()
+
+ +
+
+inline std::string message_separator(const char sep_char = ' *', const size_t sep_length = 110) const
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int NUM_PHASES = 3
+
+ +
+
+

Private Functions

+
+
+void displayDebugMessage(const std::string &msg) const
+
+ +
+
+void addPrintMessage(const std::string &msg, const Scalar value, const Scalar limit, const UnitSystem::measure measure)
+
+ +
+
+bool closeWellsRecursive(const Group &group, int level = 0)
+
+ +
+
+void throwNotImplementedError(const std::string &error) const
+
+ +
+
+

Private Members

+
+
+const BlackoilWellModelGeneric<Scalar> &well_model_
+
+ +
+
+const Group &group_
+
+ +
+
+const double simulation_time_
+
+ +
+
+const int report_step_idx_
+
+ +
+
+DeferredLogger &deferred_logger_
+
+ +
+
+const std::string date_string_
+
+ +
+
+const UnitSystem &unit_system_
+
+ +
+
+const WellState<Scalar> &well_state_
+
+ +
+
+WellTestState &well_test_state_
+
+ +
+
+const Schedule &schedule_
+
+ +
+
+GroupEconProductionLimits::GEconGroupProp gecon_props_
+
+ +
+
+bool debug_ = true
+
+ +
+
+std::array<Scalar, NUM_PHASES> production_rates_
+
+ +
+
+std::map<int, BlackoilPhases::PhaseIndex> phase_idx_map_ = {{0, BlackoilPhases::Liquid}, {1, BlackoilPhases::Vapour}, {2, BlackoilPhases::Aqua}}
+
+ +
+
+std::map<BlackoilPhases::PhaseIndex, int> phase_idx_reverse_map_
+
+ +
+
+std::string message_
+
+ +
+
+ +
+
+class GroupRates
+
+
+

Public Functions

+
+
+inline GroupRates(Scalar oil_rate, Scalar gas_rate, Scalar water_rate, Scalar alq, Scalar oil_potential, Scalar gas_potential, Scalar water_potential, std::optional<Scalar> oil_target, std::optional<Scalar> gas_target, std::optional<Scalar> water_target, std::optional<Scalar> liquid_target, std::optional<Scalar> total_gas, std::optional<Scalar> max_alq)
+
+ +
+
+inline Scalar alq() const
+
+ +
+
+inline void assign(Scalar oil_rate, Scalar gas_rate, Scalar water_rate, Scalar alq)
+
+ +
+
+inline Scalar gasRate() const
+
+ +
+
+inline Scalar waterRate() const
+
+ +
+
+inline std::optional<Scalar> gasTarget() const
+
+ +
+
+inline std::optional<Scalar> waterTarget() const
+
+ +
+
+inline std::optional<Scalar> maxAlq() const
+
+ +
+
+inline std::optional<Scalar> maxTotalGasRate() const
+
+ +
+
+inline Scalar oilRate() const
+
+ +
+
+inline std::optional<Scalar> oilTarget() const
+
+ +
+
+inline std::optional<Scalar> liquidTarget() const
+
+ +
+
+inline Scalar oilPotential() const
+
+ +
+
+inline Scalar gasPotential() const
+
+ +
+
+inline Scalar waterPotential() const
+
+ +
+
+inline void update(Scalar delta_oil, Scalar delta_gas, Scalar delta_water, Scalar delta_alq)
+
+ +
+
+

Private Members

+
+
+Scalar oil_rate_
+
+ +
+
+Scalar gas_rate_
+
+ +
+
+Scalar water_rate_
+
+ +
+
+Scalar alq_
+
+ +
+
+Scalar oil_potential_
+
+ +
+
+Scalar gas_potential_
+
+ +
+
+Scalar water_potential_
+
+ +
+
+std::optional<Scalar> oil_target_
+
+ +
+
+std::optional<Scalar> gas_target_
+
+ +
+
+std::optional<Scalar> water_target_
+
+ +
+
+std::optional<Scalar> liquid_target_
+
+ +
+
+std::optional<Scalar> total_gas_
+
+ +
+
+std::optional<Scalar> max_alq_
+
+ +
+
+ +
+
+template<class Scalar>
class GroupState
+
+#include <GroupState.hpp>
+
+

Public Functions

+
+
+GroupState() = default
+
+ +
+
+explicit GroupState(std::size_t num_phases)
+
+ +
+
+bool operator==(const GroupState &other) const
+
+ +
+
+bool has_production_rates(const std::string &gname) const
+
+ +
+
+void update_production_rates(const std::string &gname, const std::vector<Scalar> &rates)
+
+ +
+
+void update_network_leaf_node_production_rates(const std::string &gname, const std::vector<Scalar> &rates)
+
+ +
+
+const std::vector<Scalar> &production_rates(const std::string &gname) const
+
+ +
+
+const std::vector<Scalar> &network_leaf_node_production_rates(const std::string &gname) const
+
+ +
+
+void update_well_group_thp(const std::string &gname, const double &thp)
+
+ +
+
+Scalar well_group_thp(const std::string &gname) const
+
+ +
+
+bool is_autochoke_group(const std::string &gname) const
+
+ +
+
+bool has_production_reduction_rates(const std::string &gname) const
+
+ +
+
+void update_production_reduction_rates(const std::string &gname, const std::vector<Scalar> &rates)
+
+ +
+
+const std::vector<Scalar> &production_reduction_rates(const std::string &gname) const
+
+ +
+
+bool has_injection_reduction_rates(const std::string &gname) const
+
+ +
+
+void update_injection_reduction_rates(const std::string &gname, const std::vector<Scalar> &rates)
+
+ +
+
+const std::vector<Scalar> &injection_reduction_rates(const std::string &gname) const
+
+ +
+
+bool has_injection_reservoir_rates(const std::string &gname) const
+
+ +
+
+void update_injection_reservoir_rates(const std::string &gname, const std::vector<Scalar> &rates)
+
+ +
+
+const std::vector<Scalar> &injection_reservoir_rates(const std::string &gname) const
+
+ +
+
+bool has_injection_surface_rates(const std::string &gname) const
+
+ +
+
+void update_injection_surface_rates(const std::string &gname, const std::vector<Scalar> &rates)
+
+ +
+
+const std::vector<Scalar> &injection_surface_rates(const std::string &gname) const
+
+ +
+
+void update_injection_rein_rates(const std::string &gname, const std::vector<Scalar> &rates)
+
+ +
+
+const std::vector<Scalar> &injection_rein_rates(const std::string &gname) const
+
+ +
+
+void update_injection_vrep_rate(const std::string &gname, Scalar rate)
+
+ +
+
+Scalar injection_vrep_rate(const std::string &gname) const
+
+ +
+
+void update_grat_sales_target(const std::string &gname, Scalar target)
+
+ +
+
+Scalar grat_sales_target(const std::string &gname) const
+
+ +
+
+bool has_grat_sales_target(const std::string &gname) const
+
+ +
+
+void update_gpmaint_target(const std::string &gname, Scalar target)
+
+ +
+
+Scalar gpmaint_target(const std::string &gname) const
+
+ +
+
+bool has_gpmaint_target(const std::string &gname) const
+
+ +
+
+bool has_production_control(const std::string &gname) const
+
+ +
+
+void production_control(const std::string &gname, Group::ProductionCMode cmode)
+
+ +
+
+Group::ProductionCMode production_control(const std::string &gname) const
+
+ +
+
+bool has_injection_control(const std::string &gname, Phase phase) const
+
+ +
+
+void injection_control(const std::string &gname, Phase phase, Group::InjectionCMode cmode)
+
+ +
+
+Group::InjectionCMode injection_control(const std::string &gname, Phase phase) const
+
+ +
+
+void update_gconsump(const Schedule &schedule, const int report_step, const SummaryState &summary_state)
+
+ +
+
+const std::pair<Scalar, Scalar> &gconsump_rates(const std::string &gname) const
+
+ +
+
+std::size_t data_size() const
+
+ +
+
+std::size_t collect(Scalar *data) const
+
+ +
+
+std::size_t distribute(const Scalar *data)
+
+ +
+
+GPMaint::State &gpmaint(const std::string &gname)
+
+ +
+
+template<class Comm>
inline void communicate_rates(const Comm &comm)
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Public Static Functions

+
+
+static GroupState serializationTestObject()
+
+ +
+
+

Private Members

+
+
+std::size_t num_phases = {}
+
+ +
+
+std::map<std::string, std::vector<Scalar>> m_production_rates
+
+ +
+
+std::map<std::string, std::vector<Scalar>> m_network_leaf_node_production_rates
+
+ +
+
+std::map<std::string, Group::ProductionCMode> production_controls
+
+ +
+
+std::map<std::string, std::vector<Scalar>> prod_red_rates
+
+ +
+
+std::map<std::string, std::vector<Scalar>> inj_red_rates
+
+ +
+
+std::map<std::string, std::vector<Scalar>> inj_surface_rates
+
+ +
+
+std::map<std::string, std::vector<Scalar>> inj_resv_rates
+
+ +
+
+std::map<std::string, std::vector<Scalar>> inj_rein_rates
+
+ +
+
+std::map<std::string, Scalar> inj_vrep_rate
+
+ +
+
+std::map<std::string, Scalar> m_grat_sales_target
+
+ +
+
+std::map<std::string, Scalar> m_gpmaint_target
+
+ +
+
+std::map<std::string, Scalar> group_thp
+
+ +
+
+std::map<std::pair<Phase, std::string>, Group::InjectionCMode> injection_controls
+
+ +
+
+WellContainer<GPMaint::State> gpmaint_state
+
+ +
+
+std::map<std::string, std::pair<Scalar, Scalar>> m_gconsump_rates
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr std::pair<Scalar, Scalar> zero_pair = {0.0, 0.0}
+
+ +
+
+ +
+
+class HardcodedTimeStepControl : public Opm::TimeStepControlInterface
+
+#include <TimeStepControl.hpp>
+

HardcodedTimeStepControl Input generated from summary file using the ert application:

+

ecl_summary DECK TIME > filename

+

Assumes time is given in days

+
+

Public Functions

+
+
+HardcodedTimeStepControl() = default
+
+ +
+
+explicit HardcodedTimeStepControl(const std::string &filename)
+

constructor

+
+
Parameters:
+

filename – filename contaning the timesteps

+
+
+
+ +
+
+virtual double computeTimeStepSize(const double dt, const int, const RelativeChangeInterface&, const AdaptiveSimulatorTimer &substepTimer) const override
+

compute new time step size suggestions based on the PID controller

+
+
Parameters:
+
    +
  • dt – time step size used in the current step

  • +
  • iterations – number of iterations used (linear/nonlinear)

  • +
  • timeError – object to compute || u^n+1 - u^n || / || u^n+1 ||

  • +
+
+
Returns:
+

suggested time step size for the next step

+
+
+
+ +
+
+inline virtual bool timeStepAccepted(const double) const override
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const HardcodedTimeStepControl&) const
+
+ +
+
+

Public Static Functions

+
+
+static HardcodedTimeStepControl serializationTestObject()
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr TimeStepControlType Type = TimeStepControlType::HardCodedTimeStep
+
+ +
+
+

Protected Attributes

+
+
+std::vector<double> subStepTime_
+
+ +
+
+ +
+
+template<typename T>
class has_communication
+
+#include <has_function.hpp>
+

The has_communication class checks if the type has the member function getCommunication.

+

This is used in the SolverAdapter to check if the operator has a communication, and it will then select a different path accordingly.

+
+

Public Static Attributes

+
+
+static constexpr bool value = std::is_same_v<decltype(test<T>(0)), std::true_type>
+
+ +
+
+

Private Static Functions

+
+
+template<typename U>
static std::true_type test(decltype(&U::getCommunication))
+
+ +
+
+template<typename U>
static std::false_type test(...)
+
+ +
+
+ +
+
+template<typename, class = void>
struct has_name : public std::false_type
+
+#include <parametersystem.hpp>
+
+ +
+
+template<typename T>
struct has_name<T, std::void_t<decltype(std::declval<T>().name)>> : public std::true_type
+
+#include <parametersystem.hpp>
+
+ +
+
+template<typename T>
class has_should_call_post
+
+#include <has_function.hpp>
+

The has_should_call_post class detects the presence of the method shouldCallPost.

+

Usage:

+
if constexpr (has_should_call_post<decltype(preconditioner)>::value) {
+    // We know that the function shouldCallPost is present:
+    auto shouldCallPost = preconditioner.shouldCallPost();
+}
+
+
+
+

Note

+

This is mainly done in the GPU preconditioner to avoid having to copy data in the post step.

+
+
+

Public Static Attributes

+
+
+static constexpr bool value = std::is_same_v<decltype(test<T>(0)), std::true_type>
+
+ +
+
+

Private Static Functions

+
+
+template<typename U>
static std::true_type test(decltype(&U::shouldCallPost))
+
+ +
+
+template<typename U>
static std::false_type test(...)
+
+ +
+
+ +
+
+template<typename T>
class has_should_call_pre
+
+#include <has_function.hpp>
+

The has_should_call_pre class detects the presence of the method shouldCallPre.

+

Usage:

+
if constexpr (has_should_call_pre<decltype(preconditioner)>::value) {
+    // We know that the function shouldCallPre is present:
+    auto shouldCallPre = preconditioner.shouldCallPre();
+}
+
+
+
+

Note

+

This is mainly done in the GPU preconditioner to avoid having to copy data in the pre step.

+
+
+

Public Static Attributes

+
+
+static constexpr bool value = std::is_same_v<decltype(test<T>(0)), std::true_type>
+
+ +
+
+

Private Static Functions

+
+
+template<typename U>
static std::true_type test(decltype(&U::shouldCallPre))
+
+ +
+
+template<typename U>
static std::false_type test(...)
+
+ +
+
+ +
+
+template<typename, class = void>
struct HasGeoMech : public std::false_type
+
+ +
+
+template<typename Problem>
struct HasGeoMech<Problem, std::void_t<decltype(std::declval<Problem>().geoMechModel())>> : public std::true_type
+
+ +
+
+class HDF5File
+
+#include <HDF5File.hpp>
+

Class handling simple output to HDF5.

+
+

Public Types

+
+
+enum class OpenMode
+

Enumeration of file opening modes.

+

Values:

+
+
+enumerator APPEND
+

Append to an existing file (creates new if not)

+
+ +
+
+enumerator OVERWRITE
+

Overwrite and write to an existing file.

+
+ +
+
+enumerator READ
+

Open existing file for reading.

+
+ +
+ +
+
+enum class DataSetMode
+

Enumeration of dataset modes.

+

Values:

+
+
+enumerator ROOT_ONLY
+

A single dataset created at the root process.

+
+ +
+
+enumerator PROCESS_SPLIT
+

One separate data set for each parallel process.

+
+ +
+ +
+
+

Public Functions

+
+
+HDF5File(const std::string &fileName, OpenMode mode, Parallel::Communication comm)
+

Opens HDF5 file for I/O.

+
+
Parameters:
+
    +
  • fileName – Name of file to open

  • +
  • mode – Open mode for file

  • +
+
+
+
+ +
+
+~HDF5File()
+

Destructor clears up any opened files.

+
+ +
+
+void write(const std::string &group, const std::string &dset, const std::vector<char> &buffer, DataSetMode mode = DataSetMode::PROCESS_SPLIT) const
+

Write a char buffer to a specified location in file.

+

+Throws exception on failure

+
+
Parameters:
+
    +
  • group – Group (“directory”) to write data to

  • +
  • dset – Data set (“file”) to write data to

  • +
  • buffer – Data to write

  • +
+
+
+
+ +
+
+void read(const std::string &group, const std::string &dset, std::vector<char> &buffer, DataSetMode Mode = DataSetMode::PROCESS_SPLIT) const
+

Read a char buffer from a specified location in file.

+

+Throws exception on failure

+
+
Parameters:
+
    +
  • group – Group (“directory”) to read data from

  • +
  • dset – Data set (“file”) to read data from

  • +
  • buffer – Vector to store read data in

  • +
+
+
+
+ +
+
+std::vector<std::string> list(const std::string &group) const
+

Lists the entries in a given group.

+

Note: Both datasets and subgroups are returned

+
+ +
+
+

Private Functions

+
+
+void writeSplit(hid_t grp, const std::vector<char> &buffer, const std::string &dset) const
+

Write data from each process to a separate dataset.

+
+
Parameters:
+
    +
  • grp – Handle for group to store dataset in

  • +
  • buffer – Data to write

  • +
  • dset – Name of dataset

  • +
+
+
+
+ +
+
+void writeRootOnly(hid_t grp, const std::vector<char> &buffer, const std::string &group, const std::string &dset) const
+

Write data from root process only.

+
+
Parameters:
+
    +
  • grp – Handle for group to store dataset in

  • +
  • buffer – Data to write

  • +
  • dset – Name of dataset

  • +
+
+
+
+ +
+
+hid_t getCompression(hsize_t size) const
+

Return a dataset creation properly list with compression settings.

+
+
Parameters:
+

size – Size of dataset

+
+
+
+ +
+
+void writeDset(int rank, hid_t dataset_id, hid_t dxpl, hsize_t size, const void *data) const
+

Helper function to write a dataset.

+
+
Parameters:
+
    +
  • rank – Process rank that should write

  • +
  • dataset_id – Handle for dataset to write

  • +
  • dxpl – Dataset transfer property list

  • +
  • size – Size of dataset

  • +
  • data – Data to write

  • +
+
+
+
+ +
+
+

Private Members

+
+
+hid_t m_file = H5I_INVALID_HID
+

File handle.

+
+ +
+
+Parallel::Communication comm_
+
+ +
+
+ +
+
+class HDF5Serializer : public Serializer<Serialization::MemPacker>
+
+#include <HDF5Serializer.hpp>
+

Class for (de-)serializing using HDF5.

+
+

Public Functions

+
+
+inline HDF5Serializer(const std::string &fileName, HDF5File::OpenMode mode, Parallel::Communication comm)
+
+ +
+
+template<class T>
inline void write(T &data, const std::string &group, const std::string &dset, HDF5File::DataSetMode mode = HDF5File::DataSetMode::PROCESS_SPLIT)
+

Serialize and write data to restart file.

+
+
Template Parameters:
+

T – Type of class to write

+
+
Parameters:
+

data – Class to write restart data for

+
+
+
+ +
+
+void writeHeader(const std::string &simulator_name, const std::string &module_version, const std::string &time_stamp, const std::string &case_name, const std::string &params, int num_procs)
+

Writes a header to the file.

+
+
Parameters:
+
    +
  • simulator_name – Name of simulator used

  • +
  • module_version – Version of simulator used

  • +
  • time_stamp – Build time-stamp for simulator used

  • +
  • case_name – Name of case file is associated with

  • +
  • params – List of parameter values

  • +
  • num_procs – Number of processes used

  • +
+
+
+
+ +
+
+template<class T>
inline void read(T &data, const std::string &group, const std::string &dset, HDF5File::DataSetMode mode = HDF5File::DataSetMode::PROCESS_SPLIT)
+

Read data and deserialize from restart file.

+
+
Template Parameters:
+

T – Type of class to read

+
+
Parameters:
+

data – Class to read restart data for

+
+
+
+ +
+
+int lastReportStep() const
+

Returns the last report step stored in file.

+
+ +
+
+std::vector<int> reportSteps() const
+

Returns a list of report steps stored in restart file.

+
+ +
+
+

Private Members

+
+
+const Serialization::MemPacker m_packer_priv = {}
+

Packer instance.

+
+ +
+
+HDF5File m_h5file
+

HDF5 backend for the serializer.

+
+ +
+
+ +
+
+template<class Scalar>
class HipKernels
+
+#include <hipKernels.hpp>
+
+

Public Static Functions

+
+
+static void init(int verbosity)
+

Initialize verbosity level for the HIP kernels

+
+
Parameters:
+

verbosity[in] verbosity level

+
+
+
+ +
+
+static void full_to_pressure_restriction(const Scalar *fine_y, Scalar *weights, Scalar *coarse_y, int Nb, hipStream_t stream)
+

Transform blocked vector to scalar vector using pressure-weights, where every workitem handles one blockrow

+
+
Parameters:
+
    +
  • fine_y[in] Input y vector

  • +
  • weights[in] Weights used to combine cells

  • +
  • course_y[out] Output y vector

  • +
  • Nb[in] Number of blocks in the original matrix

  • +
  • stream[in] Hip stream to use for the computations

  • +
+
+
+
+ +
+
+static void add_coarse_pressure_correction(Scalar *coarse_x, Scalar *fine_x, int pressure_idx, int Nb, hipStream_t stream)
+

Add the coarse pressure solution back to the finer, complete solution; every workitem handles one blockrow

+
+
Parameters:
+
    +
  • coarse_x[in] Input scalar x vector

  • +
  • fine_x[out] Output blocked x vector

  • +
  • pressure_idx[in] Pressure index

  • +
  • Nb[in] Number of blocks in the original matrix

  • +
  • stream[in] Hip stream to use for the computations

  • +
+
+
+
+ +
+
+static void vmul(const Scalar alpha, Scalar *in1, Scalar *in2, Scalar *out, int N, hipStream_t stream)
+

Function to multiply vector with another vector and a scalar, element-wise and add the result to a third vector (out = alpha * in1 + in2)

+
+
Parameters:
+
    +
  • alpha[in] Input scalar

  • +
  • in1[in] First input vector

  • +
  • in2[in] Second input vector

  • +
  • out[out] Output vector

  • +
  • N[in] Size of the vector

  • +
  • stream[in] Hip stream to use for the computations

  • +
+
+
+
+ +
+
+static void prolongate_vector(const Scalar *in, Scalar *out, const int *cols, int N, hipStream_t stream)
+

Function to prolongate vector during amg cycle, every workitem handles one row

+
+
Parameters:
+
    +
  • in[in] Input fine-grained vector

  • +
  • out[out] Output course-graned vector

  • +
  • cols[in] Column indexes

  • +
  • N[in] Size of the vector

  • +
  • stream[in] Hip stream to use for the computations

  • +
+
+
+
+ +
+
+static void residual(Scalar *vals, int *cols, int *rows, Scalar *x, const Scalar *rhs, Scalar *out, int Nb, unsigned int block_size, hipStream_t stream)
+

Function to perform res = rhs - mat * x

+
+
Parameters:
+
    +
  • vals[in] Matrix values

  • +
  • cols[in] Column indexes

  • +
  • rows[in] Row pointers

  • +
  • x[in] X vector

  • +
  • rhs[in] Rhs vector

  • +
  • out[out] Output res vector

  • +
  • Nb[in] Number of non-zero blocks in the original matrix

  • +
  • block_size[in] Block size

  • +
  • stream[in] Hip stream to use for the computations

  • +
+
+
+
+ +
+
+static void spmv(Scalar *vals, int *cols, int *rows, Scalar *x, Scalar *y, int Nb, unsigned int block_size, hipStream_t stream)
+

Function to perform sparse matrix vector multipliation

+
+
Parameters:
+
    +
  • vals[in] Matrix values

  • +
  • cols[in] Column indexes

  • +
  • rows[in] Row pointers

  • +
  • x[in] Input x vector

  • +
  • y[out] Output y vector

  • +
  • Nb[in] Number of non-zero blocks in the original matrix

  • +
  • block_size[in] Block size

  • +
  • stream[in] Hip stream to use for the computations

  • +
+
+
+
+ +
+
+

Private Functions

+
+
+HipKernels()
+
+ +
+
+

Private Static Attributes

+
+
+static int verbosity = 0
+
+ +
+
+static bool initialized = false
+
+ +
+
+ +
+
+template<class M, class X, class Y>
class HyprePreconditioner : public Dune::PreconditionerWithUpdate<X, Y>
+
+

Wrapper for Hypre’s BoomerAMG preconditioner.

+

This class provides an interface to the BoomerAMG preconditioner from the Hypre library. It is designed to work with matrices, update vectors, and defect vectors specified by the template parameters.

+
+
Template Parameters:
+
    +
  • M – The matrix type the preconditioner is for.

  • +
  • X – The type of the update vector.

  • +
  • Y – The type of the defect vector.

  • +
+
+
+
+

Public Functions

+
+
+inline HyprePreconditioner(const M &A, const Opm::PropertyTree prm)
+

Constructor for the HyprePreconditioner class.

+

Initializes the preconditioner with the given matrix and property tree.

+
+
Parameters:
+
    +
  • A – The matrix for which the preconditioner is constructed.

  • +
  • prm – The property tree containing configuration parameters.

  • +
+
+
+
+ +
+
+inline ~HyprePreconditioner()
+

Destructor for the HyprePreconditioner class.

+

Cleans up resources allocated by the preconditioner.

+
+ +
+
+inline virtual void update() override
+

Updates the preconditioner with the current matrix values.

+

This method should be called whenever the matrix values change.

+
+ +
+
+inline void pre(X&, Y&) override
+

Pre-processing step before applying the preconditioner.

+

This method is currently a no-op.

+
+
Parameters:
+
    +
  • v – The update vector.

  • +
  • d – The defect vector.

  • +
+
+
+
+ +
+
+inline void apply(X &v, const Y &d) override
+

Applies the preconditioner to a vector.

+

Performs one AMG V-cycle to solve the system.

+
+
Parameters:
+
    +
  • v – The update vector.

  • +
  • d – The defect vector.

  • +
+
+
+
+ +
+
+inline void post(X&) override
+

Post-processing step after applying the preconditioner.

+

This method is currently a no-op.

+
+
Parameters:
+

v – The update vector.

+
+
+
+ +
+
+inline Dune::SolverCategory::Category category() const override
+

Returns the solver category.

+
+
Returns:
+

The solver category, which is sequential.

+
+
+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+

Checks if the preconditioner has a perfect update.

+
+
Returns:
+

True, indicating that the preconditioner can be perfectly updated.

+
+
+
+ +
+
+

Private Functions

+
+
+inline void setupSparsityPattern()
+

Sets up the sparsity pattern for the Hypre matrix.

+

Allocates and initializes arrays required by Hypre.

+
+ +
+
+inline void copyMatrixToHypre()
+

Copies the matrix values to the Hypre matrix.

+

This method transfers the matrix data from the host to the Hypre matrix. It assumes that the values of the matrix are stored in a contiguous array. If GPU is used, the data is transferred to the device.

+
+ +
+
+inline void copyVectorsToHypre(const X &v, const Y &d)
+

Copies vectors to the Hypre format.

+

Transfers the update and defect vectors to Hypre. If GPU is used, the data is transferred from the host to the device.

+
+
Parameters:
+
    +
  • v – The update vector.

  • +
  • d – The defect vector.

  • +
+
+
+
+ +
+
+inline void copyVectorFromHypre(X &v)
+

Copies the solution vector from Hypre.

+

Transfers the solution vector from Hypre back to the host. If GPU is used, the data is transferred from the device to the host.

+
+
Parameters:
+

v – The update vector.

+
+
+
+ +
+
+

Private Members

+
+
+const M &A_
+

The matrix for which the preconditioner is constructed.

+
+ +
+
+bool use_gpu_ = false
+

Flag indicating whether to use GPU acceleration.

+
+ +
+
+HYPRE_Solver solver_ = nullptr
+

The Hypre solver object.

+
+ +
+
+HYPRE_IJMatrix A_hypre_ = nullptr
+

The Hypre matrix object.

+
+ +
+
+HYPRE_ParCSRMatrix parcsr_A_ = nullptr
+

The parallel CSR matrix object.

+
+ +
+
+HYPRE_IJVector x_hypre_ = nullptr
+

The Hypre solution vector.

+
+ +
+
+HYPRE_IJVector b_hypre_ = nullptr
+

The Hypre right-hand side vector.

+
+ +
+
+HYPRE_ParVector par_x_ = nullptr
+

The parallel solution vector.

+
+ +
+
+HYPRE_ParVector par_b_ = nullptr
+

The parallel right-hand side vector.

+
+ +
+
+std::vector<HYPRE_Int> ncols_
+

Number of columns per row.

+
+ +
+
+std::vector<HYPRE_BigInt> rows_
+

Row indices.

+
+ +
+
+std::vector<HYPRE_BigInt> cols_
+

Column indices.

+
+ +
+
+HYPRE_Int *ncols_device_ = nullptr
+

Device array for number of columns per row.

+
+ +
+
+HYPRE_BigInt *rows_device_ = nullptr
+

Device array for row indices.

+
+ +
+
+HYPRE_BigInt *cols_device_ = nullptr
+

Device array for column indices.

+
+ +
+
+HYPRE_Real *values_device_ = nullptr
+

Device array for matrix values.

+
+ +
+
+std::vector<HYPRE_BigInt> indices_
+

Indices vector for copying vectors to/from Hypre.

+
+ +
+
+HYPRE_BigInt *indices_device_ = nullptr
+

Device array for indices.

+
+ +
+
+HYPRE_Int N_ = -1
+

Number of rows in the matrix.

+
+ +
+
+HYPRE_Int nnz_ = -1
+

Number of non-zero elements in the matrix.

+
+ +
+
+HYPRE_Real *x_values_device_ = nullptr
+

Device array for solution vector values.

+
+ +
+
+HYPRE_Real *b_values_device_ = nullptr
+

Device array for right-hand side vector values.

+
+ +
+
+ +
+
+struct HysteresisParams
+
+#include <OutputExtractor.hpp>
+

Struct holding hysteresis parameters.

+
+

Public Members

+
+
+Scalar somax = {}
+

Max oil saturation.

+
+ +
+
+Scalar swmax = {}
+

Max water saturation.

+
+ +
+
+Scalar swmin = {}
+

Min water saturation.

+
+ +
+
+Scalar sgmax = {}
+

Max gas saturation.

+
+ +
+
+Scalar shmax = {}
+

Max something.

+
+ +
+
+Scalar somin = {}
+

Min oil saturation.

+
+ +
+
+ +
+
+struct IgnoreKeywords
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = ""
+
+ +
+
+ +
+
+template<class Matrix, class Vector, class Scalar>
class ILU
+
+ +
+
+struct IluFillinLevel
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 0
+
+ +
+
+ +
+
+struct IluRedblack
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct IluRelaxation
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 0.9
+
+ +
+
+ +
+
+struct IluReorderSpheres
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class Scalar>
struct ImbalanceTol
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1.1
+
+ +
+
+ +
+
+class Impl
+
+

Public Functions

+
+
+explicit Impl(std::string_view outputDir, std::string_view baseName, ComponentToPhaseName getPhaseName, ConvertToTimeUnits convertTime, ConvergenceOutputConfiguration config, ConvergenceReportQueue &queue)
+
+ +
+
+inline ConvergenceReportQueue &queue()
+
+ +
+
+void write(const std::vector<ConvergenceReportQueue::OutputRequest> &requests)
+
+ +
+
+inline bool finalRequestWritten() const
+
+ +
+
+

Private Functions

+
+
+void writeIterInfo(const std::vector<ConvergenceReportQueue::OutputRequest> &requests)
+
+ +
+
+

Private Members

+
+
+std::reference_wrapper<ConvergenceReportQueue> queue_
+
+ +
+
+ComponentToPhaseName getPhaseName_ = {}
+
+ +
+
+ConvertToTimeUnits convertTime_ = {}
+
+ +
+
+std::optional<std::ofstream> infoIter_ = {}
+
+ +
+
+std::string::size_type firstColSize_ = {0}
+
+ +
+
+std::string::size_type colSize_ = {0}
+
+ +
+
+bool haveOutputIterHeader_ = {false}
+
+ +
+
+bool finalRequestWritten_ = {false}
+
+ +
+
+ +
+
+struct InitCond
+
+#include <InitStateEquil.hpp>
+
+

Public Members

+
+
+Scalar depth
+
+ +
+
+Scalar pressure
+
+ +
+
+ +
+
+template<class FluidSystem, class Grid, class GridView, class ElementMapper, class CartesianIndexMapper>
class InitialStateComputer
+
+#include <InitStateEquil.hpp>
+
+

Public Types

+
+
+using Vec = std::vector<Scalar>
+
+ +
+
+using PVec = std::vector<Vec>
+
+ +
+
+

Public Functions

+
+
+template<class MaterialLawManager>
InitialStateComputer(MaterialLawManager &materialLawManager, const EclipseState &eclipseState, const Grid &grid, const GridView &gridView, const CartesianIndexMapper &cartMapper, const Scalar grav, const int num_pressure_points = 2000, const bool applySwatInit = true)
+
+ +
+
+inline const Vec &temperature() const
+
+ +
+
+inline const Vec &saltConcentration() const
+
+ +
+
+inline const Vec &saltSaturation() const
+
+ +
+
+inline const PVec &press() const
+
+ +
+
+inline const PVec &saturation() const
+
+ +
+
+inline const Vec &rs() const
+
+ +
+
+inline const Vec &rv() const
+
+ +
+
+inline const Vec &rvw() const
+
+ +
+
+

Private Types

+
+
+using Element = typename GridView::template Codim<0>::Entity
+
+ +
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+

Private Functions

+
+
+template<class RMap>
void updateInitialTemperature_(const EclipseState &eclState, const RMap &reg)
+
+ +
+
+template<class RMap>
void updateInitialSaltConcentration_(const EclipseState &eclState, const RMap &reg)
+
+ +
+
+template<class RMap>
void updateInitialSaltSaturation_(const EclipseState &eclState, const RMap &reg)
+
+ +
+
+void updateCellProps_(const GridView &gridView, const NumericalAquifers &aquifer)
+
+ +
+
+void applyNumericalAquifers_(const GridView &gridView, const NumericalAquifers &aquifer, const bool co2store_or_h2store)
+
+ +
+
+template<class RMap>
void setRegionPvtIdx(const EclipseState &eclState, const RMap &reg)
+
+ +
+
+template<class RMap, class MaterialLawManager, class Comm>
void calcPressSatRsRv(const RMap &reg, const std::vector<EquilRecord> &rec, MaterialLawManager &materialLawManager, const Comm &comm, const Scalar grav)
+
+ +
+
+template<class CellRange, class EquilibrationMethod>
void cellLoop(const CellRange &cells, EquilibrationMethod &&eqmethod)
+
+ +
+
+template<class CellRange, class PressTable, class PhaseSat>
void equilibrateCellCentres(const CellRange &cells, const EquilReg<Scalar> &eqreg, const PressTable &ptable, PhaseSat &psat)
+
+ +
+
+template<class CellRange, class PressTable, class PhaseSat>
void equilibrateHorizontal(const CellRange &cells, const EquilReg<Scalar> &eqreg, const int acc, const PressTable &ptable, PhaseSat &psat)
+
+ +
+
+

Private Members

+
+
+std::vector<std::shared_ptr<Miscibility::RsFunction<Scalar>>> rsFunc_
+
+ +
+
+std::vector<std::shared_ptr<Miscibility::RsFunction<Scalar>>> rvFunc_
+
+ +
+
+std::vector<std::shared_ptr<Miscibility::RsFunction<Scalar>>> rvwFunc_
+
+ +
+
+std::vector<TabulatedFunction> tempVdTable_
+
+ +
+
+std::vector<TabulatedFunction> saltVdTable_
+
+ +
+
+std::vector<TabulatedFunction> saltpVdTable_
+
+ +
+
+std::vector<int> regionPvtIdx_
+
+ +
+
+Vec temperature_
+
+ +
+
+Vec saltConcentration_
+
+ +
+
+Vec saltSaturation_
+
+ +
+
+PVec pp_
+
+ +
+
+PVec sat_
+
+ +
+
+Vec rs_
+
+ +
+
+Vec rv_
+
+ +
+
+Vec rvw_
+
+ +
+
+const CartesianIndexMapper &cartesianIndexMapper_
+
+ +
+
+Vec swatInit_
+
+ +
+
+Vec cellCenterDepth_
+
+ +
+
+std::vector<std::pair<Scalar, Scalar>> cellZSpan_
+
+ +
+
+std::vector<std::pair<Scalar, Scalar>> cellZMinMax_
+
+ +
+
+int num_pressure_points_
+
+ +
+
+ +
+
+struct InitialTimeStepInDays
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 1.0
+
+ +
+
+ +
+
+template<class Scalar>
class InjectionTargetCalculator
+
+

Based on a group control mode, extract or calculate rates, and provide other conveniences.

+
+

Public Functions

+
+
+InjectionTargetCalculator(const Group::InjectionCMode &cmode, const PhaseUsage &pu, const std::vector<Scalar> &resv_coeff, const std::string &group_name, const Scalar sales_target, const GroupState<Scalar> &group_state, const Phase &injection_phase, const bool use_gpmaint, DeferredLogger &deferred_logger)
+
+ +
+
+template<typename RateVec>
inline auto calcModeRateFromRates(const RateVec &rates) const
+
+ +
+
+Scalar groupTarget(const std::optional<Group::InjectionControls> &ctrl, DeferredLogger &deferred_logger) const
+
+ +
+
+GuideRateModel::Target guideTargetMode() const
+
+ +
+
+

Private Members

+
+
+Group::InjectionCMode cmode_
+
+ +
+
+const PhaseUsage &pu_
+
+ +
+
+const std::vector<Scalar> &resv_coeff_
+
+ +
+
+const std::string &group_name_
+
+ +
+
+Scalar sales_target_
+
+ +
+
+const GroupState<Scalar> &group_state_
+
+ +
+
+bool use_gpmaint_
+
+ +
+
+int pos_
+
+ +
+
+GuideRateModel::Target target_
+
+ +
+
+ +
+
+template<class Scalar>
struct InjMultDampMult
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.9
+
+ +
+
+ +
+
+template<class Scalar>
struct InjMultMinDampFactor
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.05
+
+ +
+
+ +
+
+template<class Scalar>
struct InjMultOscThreshold
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.1
+
+ +
+
+ +
+
+struct InputSkipMode
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "100"
+
+ +
+
+ +
+
+template<class Scalar>
struct InterpData
+
+#include <VFPHelpers.hpp>
+

Helper struct for linear interpolation

+
+

Public Functions

+
+
+inline InterpData()
+
+ +
+
+

Public Members

+
+
+int ind_[2]
+
+ +
+
+Scalar inv_dist_
+
+ +
+
+Scalar factor_
+
+ +
+
+ +
+
+class InterRegFlowMap
+
+#include <InterRegFlows.hpp>
+

Inter-region flow accumulation maps for all region definition arrays.

+
+

Public Types

+
+
+using Cell = InterRegFlowMapSingleFIP::Cell
+

Characteristics of a cell from a simulation grid.

+
+ +
+
+

Public Functions

+
+
+InterRegFlowMap() = default
+

Default constructor.

+
+ +
+
+explicit InterRegFlowMap(const std::size_t numCells, const std::vector<SingleRegion> &regions, const std::size_t declaredMaxRegID = 0)
+

Constructor.

+
+
Parameters:
+
    +
  • numCells[in] Number of cells on local MPI rank, including overlap cells if applicable.

  • +
  • regions[in] All applicable region definition arrays.

  • +
  • declaredMaxRegID[in] Declared maximum region ID in the run-typically from the TABDIMS and/or REGDIMS keywords. Used for sizing internal data structures if greater than zero.

  • +
+
+
+
+ +
+
+InterRegFlowMap(const InterRegFlowMap &rhs) = default
+
+ +
+
+InterRegFlowMap(InterRegFlowMap &&rhs) noexcept = default
+
+ +
+
+InterRegFlowMap &operator=(const InterRegFlowMap &rhs) = default
+
+ +
+
+InterRegFlowMap &operator=(InterRegFlowMap &&rhs) noexcept = default
+
+ +
+
+void addConnection(const Cell &source, const Cell &destination, const data::InterRegFlowMap::FlowRates &rates)
+

Add flow rate connection between regions for all region definitions.

+

+If both cells are in the same region, or if neither cell is interior to this MPI rank, then this function does nothing. If one cell is interior to this MPI rank and the other isn’t, then this function will include the flow rate contribution if and only if the cell with the smallest associate region ID is interior to this MPI rank.

+
+
Parameters:
+
    +
  • source[in] Cell from which the flow nominally originates.

  • +
  • destination[in] Cell into which flow nominally goes.

  • +
  • rates[in] Flow rates associated to single connection.

  • +
+
+
+
+ +
+
+void compress()
+

Form CSR adjacency matrix representation of input graph from connections established in previous calls to addConnection().

+

Number of rows in the CSR representation is the maximum FIP region ID.

+
+ +
+
+void clear()
+

Clear all internal buffers, but preserve allocated capacity.

+
+ +
+
+const std::vector<std::string> &names() const
+

Names of all applicable region definition arrays.

+

Mostly intended for summary output purposes.

+
+ +
+
+std::vector<data::InterRegFlowMap> getInterRegFlows() const
+

Get read-only access to the underlying CSR representation.

+

Mostly intended for summary output purposes.

+
+ +
+
+std::vector<std::size_t> getLocalMaxRegionID() const
+

Retrieve maximum FIP region ID on local MPI rank.

+
+ +
+
+bool assignGlobalMaxRegionID(const std::vector<std::size_t> &regID)
+

Assign maximum FIP region ID across all MPI ranks.

+

Fails if global maximum is smaller than local maximum region ID.

+
+
Parameters:
+

regID[in] Global maximum FIP region ID for this FIP definition array across all MPI ranks.

+
+
Returns:
+

Whether or not assignment succeeded.

+
+
+
+ +
+
+bool readIsConsistent() const
+

Whether or not previous read() operation succeeded.

+
+ +
+
+inline bool wantInterRegflowSummary() const
+
+ +
+
+template<class MessageBufferType>
inline void write(MessageBufferType &buffer) const
+

Serialise internal representation to MPI message buffer

+
+
Template Parameters:
+

MessageBufferType – Linear MPI message buffer. API should be similar to Dune::MessageBufferIF

+
+
Parameters:
+

buffer[inout] Linear MPI message buffer instance. Function appends a partially linearised representation of

*this 
+
+
+ to the buffer contents.

+
+
+
+ +
+
+template<class MessageBufferType>
inline void read(MessageBufferType &buffer)
+

Reconstitute internal object representation from MPI message buffer

+

This object (

*this 
+
+
+) is not usable in subsequent calls to
addConnection() 
+
+
+ following a call to member function
read() 
+
+
+.

+
+
Template Parameters:
+

MessageBufferType – Linear MPI message buffer. API should be similar to Dune::MessageBufferIF

+
+
Parameters:
+

buffer[inout] Linear MPI message buffer instance. Function reads a partially linearised representation of

*this 
+
+
+ from the buffer contents and advances the buffer’s read position.

+
+
+
+ +
+
+

Public Static Functions

+
+
+static InterRegFlowMap createMapFromNames(std::vector<std::string> names)
+

Special purpose constructor for global object being collected on the I/O rank.

+

Only knows about the FIP region set names.

+
+
Parameters:
+

names[in] Sorted sequence of FIP region names.

+
+
+
+ +
+
+

Private Functions

+
+
+template<class MessageBufferType>
inline std::vector<std::string> readNames(MessageBufferType &buffer) const
+

Retrieve array names from an input stream.

+

Needed for consistency checks.

+
+ +
+
+

Private Members

+
+
+std::vector<InterRegFlowMapSingleFIP> regionMaps_ = {}
+

Inter-region flow accumulators. One accumulator map for each region definition array.

+
+ +
+
+std::vector<std::string> names_
+

Names of region definition arrays. Typically “FIPNUM” and other “FIPXYZ” array names.

+
+ +
+
+std::size_t numCells_ = {0}
+

Number of cells, including overlap, reachable from this MPI rank.

+
+ +
+
+bool readIsConsistent_ = {true}
+

Wheter or not read() successfully updated this object from an input stream.

+
+ +
+
+ +
+
+class InterRegFlowMapSingleFIP
+
+#include <InterRegFlows.hpp>
+

Form CSR adjacency matrix representation of inter-region flow rate graph provided as a list of connections between regions on local MPI rank. Pertains to a single FIP definition array (e.g., FIPNUM).

+
+

Public Functions

+
+
+explicit InterRegFlowMapSingleFIP(const std::vector<int> &region)
+

Constructor

+
+
Parameters:
+

region[in] Local rank’s FIP region definition array.

+
+
+
+ +
+
+void addConnection(const Cell &source, const Cell &destination, const data::InterRegFlowMap::FlowRates &rates)
+

Add flow rate connection between regions.

+

+If both cells are in the same region, or if neither cell is interior to this MPI rank, then this function does nothing. If one cell is interior to this MPI rank and the other isn’t, then this function will include the flow rate contribution if and only if the cell with the smallest associate region ID is interior to this MPI rank.

+
+
Parameters:
+
    +
  • source[in] Cell from which the flow nominally originates.

  • +
  • destination[in] Cell into which flow nominally goes.

  • +
  • rates[in] Flow rates associated to single connection.

  • +
+
+
+
+ +
+
+void compress()
+

Form CSR adjacency matrix representation of input graph from connections established in previous calls to addConnection().

+

Number of rows in the CSR representation is the maximum FIP region ID.

+
+ +
+
+void clear()
+

Clear all internal buffers, but preserve allocated capacity.

+
+ +
+
+const data::InterRegFlowMap &getInterRegFlows() const
+

Get read-only access to the underlying CSR representation.

+

Mostly intended for summary output purposes.

+
+ +
+
+std::size_t getLocalMaxRegionID() const
+

Retrieve maximum FIP region ID on local MPI rank.

+
+ +
+
+bool assignGlobalMaxRegionID(const std::size_t regID)
+

Assign maximum FIP region ID across all MPI ranks.

+

Fails if global maximum is smaller than local maximum region ID.

+
+
Parameters:
+

regID[in] Global maximum FIP region ID for this FIP definition array across all MPI ranks.

+
+
Returns:
+

Whether or not assignment succeeded.

+
+
+
+ +
+
+template<class MessageBufferType>
inline void write(MessageBufferType &buffer) const
+

Serialise internal representation to MPI message buffer

+
+
Template Parameters:
+

MessageBufferType – Linear MPI message buffer. API should be similar to Dune::MessageBufferIF

+
+
Parameters:
+

buffer[inout] Linear MPI message buffer instance. Function appends a partially linearised representation of

*this 
+
+
+ to the buffer contents.

+
+
+
+ +
+
+template<class MessageBufferType>
inline void read(MessageBufferType &buffer)
+

Reconstitute internal object representation from MPI message buffer

+

This object (

*this 
+
+
+) is not usable in subsequent calls to
addConnection() 
+
+
+ following a call to member function
read() 
+
+
+.

+
+
Template Parameters:
+

MessageBufferType – Linear MPI message buffer. API should be similar to Dune::MessageBufferIF

+
+
Parameters:
+

buffer[inout] Linear MPI message buffer instance. Function reads a partially linearised representation of

*this 
+
+
+ from the buffer contents and advances the buffer’s read position.

+
+
+
+ +
+
+

Private Functions

+
+
+InterRegFlowMapSingleFIP() = default
+

Default constructor.

+
+ +
+
+

Private Members

+
+
+std::vector<int> region_ = {}
+

Zero-based FIP region IDs on local MPI rank.

+
+ +
+
+std::size_t maxLocalRegionID_ = {0}
+

Maximum one-based FIP region ID on local MPI rank.

+
+ +
+
+std::size_t maxGlobalRegionID_ = {0}
+

Maximum one-based FIP region ID for this FIP region definition array across all MPI ranks.

+
+ +
+
+data::InterRegFlowMap iregFlow_ = {}
+

Rank-local inter-regional flow map.

+
+ +
+
+bool isReadFromStream_ = {false}
+

Whether or not this object contains contributions deserialised from a stream. For error detection.

+
+ +
+
+

Friends

+
+
+friend class InterRegFlowMap
+
+ +
+
+ +
+
+template<typename T>
class is_a_well_operator
+
+#include <has_function.hpp>
+

The is_a_well_operator class tries to guess if the operator is a well type operator.

+
+

Note

+

This is mainly done in the solver adapter to detect incompatible runtime arguments. When the GPU linear solve paths supports wells, this class can be removed.

+
+
+

Public Static Attributes

+
+
+static constexpr bool value = std::is_same_v<decltype(test<T>(0)), std::true_type>
+
+ +
+
+

Private Static Functions

+
+
+template<typename U>
static std::true_type test(decltype(&U::addWellPressureEquations))
+
+ +
+
+template<typename U>
static std::false_type test(...)
+
+ +
+
+ +
+
+struct is_bool_convertible
+
+
+

Public Functions

+
+
+inline is_bool_convertible()
+
+ +
+
+inline bool operator()(const std::string &value) const
+
+ +
+
+ +
+
+template<typename T>
struct is_gpu_matrix
+
+#include <is_gpu_operator.hpp>
+

Check if a given operator is a GPU matrix.

+

This is used to check if the matrix is a GPU matrix, which is used in say the preconditioners to specialize

+
+
Template Parameters:
+

T – The type of the matrix to check.

+
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<typename T>
struct is_gpu_operator
+
+#include <is_gpu_operator.hpp>
+

Check if a given operator is a GPU operator.

+

This is used to check if the operator is a GPU operator, which is used in say the preconditioner factory to specialize the StandardPreconditioners class

+
+
Template Parameters:
+

T – The type of the operator to check.

+
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class Grid>
struct IsNumericalAquiferCell
+
+
+

Public Functions

+
+
+inline explicit IsNumericalAquiferCell(const Grid&)
+
+ +
+
+template<class T>
inline bool operator()(const T&) const
+
+ +
+
+ +
+
+template<>
struct IsNumericalAquiferCell<Dune::CpGrid>
+
+
+

Public Functions

+
+
+inline explicit IsNumericalAquiferCell(const Dune::CpGrid &grid)
+
+ +
+
+template<class T>
inline bool operator()(const T &elem) const
+
+ +
+
+

Private Members

+
+
+const Dune::CpGrid &grid_
+
+ +
+
+ +
+
+template<class TypeTag>
class ISTLSolver
+
+#include <ISTLSolver.hpp>
+

This class solves the fully implicit black-oil system by solving the reduced system (after eliminating well variables) as a block-structured matrix (one block for all cell variables) for a fixed number of cell variables np .

+

Subclassed by Opm::ISTLSolverGpuBridge< TypeTag >

+
+

Public Types

+
+
+using AssembledLinearOperatorType = Dune::AssembledLinearOperator<Matrix, Vector, Vector>
+
+ +
+
+

Public Functions

+
+
+inline ISTLSolver(const Simulator &simulator, const FlowLinearSolverParameters &parameters, bool forceSerial = false)
+

Construct a system solver.

+
+
Parameters:
+
    +
  • simulator[in] The opm-models simulator object

  • +
  • parameters[in] Explicit parameters for solver setup, do not read them from command line parameters.

  • +
  • forceSerial[in] If true, will set up a serial linear solver only, local to the current rank, instead of creating a parallel (MPI distributed) linear solver.

  • +
+
+
+
+ +
+
+inline explicit ISTLSolver(const Simulator &simulator)
+

Construct a system solver.

+
+
Parameters:
+

simulator[in] The opm-models simulator object

+
+
+
+ +
+
+inline void initialize()
+
+ +
+
+inline void eraseMatrix()
+
+ +
+
+inline void setActiveSolver(const int num)
+
+ +
+
+inline int numAvailableSolvers()
+
+ +
+
+inline void initPrepare(const Matrix &M, Vector &b)
+
+ +
+
+inline void prepare(const SparseMatrixAdapter &M, Vector &b)
+
+ +
+
+inline void prepare(const Matrix &M, Vector &b)
+
+ +
+
+inline void setResidual(Vector&)
+
+ +
+
+inline void getResidual(Vector &b) const
+
+ +
+
+inline void setMatrix(const SparseMatrixAdapter&)
+
+ +
+
+inline int getSolveCount() const
+
+ +
+
+inline void resetSolveCount()
+
+ +
+
+inline bool solve(Vector &x)
+
+ +
+
+inline int iterations() const
+

Solve the system of linear equations Ax = b, with A being the combined derivative matrix of the residual and b being the residual itself.

+
+
Parameters:
+

residual[in] residual object containing A and b.

+
+
Returns:
+

the solution x

+
+
+
+ +
+
+inline const std::any &parallelInformation() const
+
+ +
+
+inline const CommunicationType *comm() const
+
+ +
+
+inline void setDomainIndex(const int index)
+
+ +
+
+inline bool isNlddLocalSolver() const
+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+
+ +
+
+

Protected Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator enablePolymerMolarWeight
+
+ +
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>
+
+ +
+
+using Vector = GetPropType<TypeTag, Properties::GlobalEqVector>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using WellModel = GetPropType<TypeTag, Properties::WellModel>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Matrix = typename SparseMatrixAdapter::IstlMatrix
+
+ +
+
+using ThreadManager = GetPropType<TypeTag, Properties::ThreadManager>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using AbstractSolverType = Dune::InverseOperator<Vector, Vector>
+
+ +
+
+using AbstractOperatorType = Dune::AssembledLinearOperator<Matrix, Vector, Vector>
+
+ +
+
+using AbstractPreconditionerType = Dune::PreconditionerWithUpdate<Vector, Vector>
+
+ +
+
+using WellModelOperator = WellModelAsLinearOperator<WellModel, Vector, Vector>
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+using CommunicationType = Dune::Communication<int>
+
+ +
+
+

Protected Functions

+
+
+inline void checkConvergence(const Dune::InverseOperatorResult &result) const
+
+ +
+
+inline bool isParallel() const
+
+ +
+
+inline void prepareFlexibleSolver()
+
+ +
+
+inline bool shouldCreateSolver() const
+

Return true if we should (re)create the whole solver, instead of just calling update() on the preconditioner.

+
+ +
+
+inline std::function<Vector()> getWeightsCalculator(const PropertyTree &prm, const Matrix &matrix, std::size_t pressIndex) const
+
+ +
+
+inline Matrix &getMatrix()
+
+ +
+
+inline const Matrix &getMatrix() const
+
+ +
+
+

Protected Attributes

+
+
+const Simulator &simulator_
+
+ +
+
+mutable int iterations_
+
+ +
+
+mutable int solveCount_
+
+ +
+
+mutable bool converged_
+
+ +
+
+std::any parallelInformation_
+
+ +
+
+Matrix *matrix_
+
+ +
+
+Vector *rhs_
+
+ +
+
+int activeSolverNum_ = 0
+
+ +
+
+std::vector<detail::FlexibleSolverInfo<Matrix, Vector, CommunicationType>> flexibleSolver_
+
+ +
+
+std::vector<int> overlapRows_
+
+ +
+
+std::vector<int> interiorRows_
+
+ +
+
+int domainIndex_ = -1
+
+ +
+
+bool useWellConn_
+
+ +
+
+std::vector<FlowLinearSolverParameters> parameters_
+
+ +
+
+bool forceSerial_ = false
+
+ +
+
+std::vector<PropertyTree> prm_
+
+ +
+
+std::shared_ptr<CommunicationType> comm_
+
+ +
+
+

Protected Static Attributes

+
+
+static constexpr std::size_t pressureIndex = GetPropType<TypeTag, Properties::Indices>::pressureSwitchIdx
+
+ +
+
+static constexpr bool isIncompatibleWithCprw = enablePolymerMolarWeight
+
+ +
+
+ +
+
+template<class TypeTag>
class ISTLSolverGpuBridge : public Opm::ISTLSolver<TypeTag>
+
+

This class solves the fully implicit black-oil system by solving the reduced system (after eliminating well variables) as a block-structured matrix (one block for all cell variables) for a fixed number of cell variables np .

+
+

Public Types

+
+
+using AssembledLinearOperatorType = Dune::AssembledLinearOperator<Matrix, Vector, Vector>
+
+ +
+
+

Public Functions

+
+
+inline ISTLSolverGpuBridge(const Simulator &simulator, const FlowLinearSolverParameters &parameters)
+

Construct a system solver.

+
+
Parameters:
+
    +
  • simulator[in] The opm-models simulator object

  • +
  • parameters[in] Explicit parameters for solver setup, do not read them from command line parameters.

  • +
+
+
+
+ +
+
+inline explicit ISTLSolverGpuBridge(const Simulator &simulator)
+

Construct a system solver.

+
+
Parameters:
+

simulator[in] The opm-models simulator object

+
+
+
+ +
+
+inline void initializeGpu()
+
+ +
+
+inline void prepare(const Matrix &M, Vector &b)
+
+ +
+
+inline void setResidual(Vector&)
+
+ +
+
+inline void getResidual(Vector &b) const
+
+ +
+
+inline void setMatrix(const SparseMatrixAdapter&)
+
+ +
+
+inline bool solve(Vector &x)
+
+ +
+
+

Protected Types

+
+
+using ParentType = ISTLSolver<TypeTag>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>
+
+ +
+
+using Vector = GetPropType<TypeTag, Properties::GlobalEqVector>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using WellModel = GetPropType<TypeTag, Properties::WellModel>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Matrix = typename SparseMatrixAdapter::IstlMatrix
+
+ +
+
+using ThreadManager = GetPropType<TypeTag, Properties::ThreadManager>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using AbstractSolverType = Dune::InverseOperator<Vector, Vector>
+
+ +
+
+using AbstractOperatorType = Dune::AssembledLinearOperator<Matrix, Vector, Vector>
+
+ +
+
+using AbstractPreconditionerType = Dune::PreconditionerWithUpdate<Vector, Vector>
+
+ +
+
+using WellModelOperator = WellModelAsLinearOperator<WellModel, Vector, Vector>
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+using CommunicationType = Dune::Communication<int>
+
+ +
+
+

Protected Attributes

+
+
+std::unique_ptr<detail::GpuSolverInfo<Matrix, Vector>> gpuBridge_
+
+ +
+
+

Protected Static Attributes

+
+
+static constexpr std::size_t pressureIndex = GetPropType<TypeTag, Properties::Indices>::pressureSwitchIdx
+
+ +
+
+ +
+
+class iterator
+
+#include <GpuView.hpp>
+

Iterator class to make GpuViews more similar to std containers.

+
+

Public Types

+
+
+using iterator_category = std::forward_iterator_tag
+
+ +
+
+using difference_type = std::ptrdiff_t
+
+ +
+
+using value_type = T
+
+ +
+
+using pointer = T*
+
+ +
+
+using reference = T&
+
+ +
+
+

Public Functions

+
+
+inline __host__ __device__ iterator (T *ptr)
+

Create iterator from a pointer.

+
+
Parameters:
+

ptr – provided pointer that will become an iterator

+
+
Returns:
+

// the created iterator object

+
+
+
+ +
+
+inline __host__ __device__ reference operator* () const
+

Dereference operator.

+
+
Returns:
+

retrieve what the iterator points at

+
+
+
+ +
+
+inline __host__ __device__ iterator & operator++ ()
+

Pre-increment operator.

+
+
Returns:
+

return the pointer after it is incremented

+
+
+
+ +
+
+inline __host__ __device__ iterator operator++ (int)
+

Post-increment operator.

+
+
Parameters:
+

no – parameter, int is placeholder for c++ implementation to differentiate from pre-increment

+
+
Returns:
+

Iterator before it is incremented

+
+
+
+ +
+
+inline __host__ __device__ iterator & operator-- ()
+

Pre-decrement operator.

+
+
Returns:
+

return the pointer after it is decremented

+
+
+
+ +
+
+inline __host__ __device__ iterator operator-- (int)
+

Post-decrement operator.

+
+
Parameters:
+

no – parameter, int is placeholder for c++ implementation to differentiate from pre-decrement

+
+
Returns:
+

Iterator before it is decremented

+
+
+
+ +
+
+inline __host__ __device__ bool operator!= (const iterator &other) const
+

Inequality comparison operator.

+
+
Returns:
+

boolean value that is true if the pointers contains different addresses

+
+
+
+ +
+
+inline __host__ __device__ bool operator== (const iterator &other) const
+

Inequality comparison operator.

+
+
Returns:
+

boolean value that is true if the pointers contains the same address

+
+
+
+ +
+
+inline __host__ __device__ difference_type operator- (const iterator &other) const
+

subtraction operator

+
+
Parameters:
+

other – iterator to subtract

+
+
Returns:
+

diffptr that represents difference between the iterators

+
+
+
+ +
+
+inline __host__ __device__ iterator operator- (difference_type n) const
+

Subtraction of given number of elements from iterator.

+
+
Parameters:
+

n – the number of elements to step backwards

+
+
Returns:
+

An iterator pointing to a location n steps behind

+
+
+
+ +
+
+inline __host__ __device__ iterator operator+ (difference_type n) const
+

Addition operator with diffptr.

+
+
Parameters:
+

n – diffptr to add

+
+
Returns:
+

new iterator with diffptr added

+
+
+
+ +
+
+inline __host__ __device__ bool operator< (const iterator &other) const
+

Less than comparison.

+
+
Parameters:
+

other – iterator

+
+
Returns:
+

true if this objects iterator is less than the other iterator

+
+
+
+ +
+
+inline __host__ __device__ bool operator> (const iterator &other) const
+

Greater than comparison.

+
+
Parameters:
+

other – iterator

+
+
Returns:
+

true if this objects iterator is greater than than the other iterator

+
+
+
+ +
+
+

Private Members

+
+
+T *m_ptr
+
+ +
+
+ +
+
+class KeywordValidator
+
+
+

Public Functions

+
+
+inline KeywordValidator(const UnsupportedKeywords &unsupported_keywords, const SupportedKeywords &partially_supported_keywords, const SupportedKeywords &fully_supported_keywords, const std::unordered_map<std::string, ValidationFunction> &special_validation)
+
+ +
+
+void validateDeck(const Deck &deck, const ParseContext &parse_context, const bool treat_critical_as_noncritical, ErrorGuard &error_guard) const
+
+ +
+
+void validateDeckKeyword(const DeckKeyword &keyword, std::vector<ValidationError> &errors) const
+
+ +
+
+

Private Functions

+
+
+template<typename T>
void validateKeywordItem(const DeckKeyword &keyword, const SupportedKeywordProperties<T> &properties, const bool multiple_records, const std::size_t record_number, const std::size_t item_number, const T &item_value, std::vector<ValidationError> &errors) const
+
+ +
+
+void validateKeywordItems(const DeckKeyword &keyword, const SupportedKeywords &keyword_items, std::vector<ValidationError> &errors) const
+
+ +
+
+template<typename T>
void validateKeywordItems(const DeckKeyword &keyword, const SupportedKeywordItems<T> &supported_options, std::vector<ValidationError> &errors) const
+
+ +
+
+

Private Members

+
+
+const UnsupportedKeywords m_unsupported_keywords
+
+ +
+
+const SupportedKeywords m_partially_supported_keywords
+
+ +
+
+const SupportedKeywords m_fully_supported_keywords
+
+ +
+
+const std::unordered_map<std::string, ValidationFunction> m_special_validation
+
+ +
+
+ +
+
+template<typename Grid>
class LevelCartesianIndexMapper
+
+ +
+
+template<>
class LevelCartesianIndexMapper<Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>>
+
+
+

Public Functions

+
+
+inline explicit LevelCartesianIndexMapper(const Dune::CartesianIndexMapper<Grid> &cartesianIndexMapper)
+
+ +
+
+inline const std::array<int, 3> &cartesianDimensions(int level) const
+
+ +
+
+inline int cartesianSize(int level) const
+
+ +
+
+inline int compressedSize(int level) const
+
+ +
+
+inline int cartesianIndex(const int compressedElementIndex, const int level) const
+
+ +
+
+inline void cartesianCoordinate(const int compressedElementIndex, std::array<int, dimension> &coords, int level) const
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int dimension = 3
+
+ +
+
+

Private Types

+
+
+using Grid = Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming, Dune::ALUGridNoComm>
+
+ +
+
+

Private Functions

+
+
+inline void throwIfLevelPositive(int level) const
+
+ +
+
+

Private Members

+
+
+std::unique_ptr<Dune::CartesianIndexMapper<Grid>> cartesianIndexMapper_
+
+ +
+
+ +
+
+struct LimitedRates : public Opm::GasLiftSingleWellGeneric<Scalar>::BasicRates
+
+
+

Public Types

+
+
+enum class LimitType
+

Values:

+
+
+enumerator well
+
+ +
+
+enumerator group
+
+ +
+
+enumerator none
+
+ +
+ +
+
+

Public Functions

+
+
+inline LimitedRates(Scalar oil_, Scalar gas_, Scalar water_, bool oil_is_limited_, bool gas_is_limited_, bool water_is_limited_, bool bhp_is_limited_, std::optional<Rate> oil_limiting_target_, std::optional<Rate> water_limiting_target_)
+
+ +
+
+inline LimitedRates(const BasicRates &rates, bool oil_is_limited_, bool gas_is_limited_, bool water_is_limited_)
+
+ +
+
+inline bool limited() const
+
+ +
+
+

Public Members

+
+
+LimitType limit_type
+
+ +
+
+bool oil_is_limited
+
+ +
+
+bool gas_is_limited
+
+ +
+
+bool water_is_limited
+
+ +
+
+std::optional<Rate> oil_limiting_target
+
+ +
+
+std::optional<Rate> water_limiting_target
+
+ +
+
+

Private Functions

+
+
+inline void set_initial_limit_type_()
+
+ +
+
+ +
+
+template<class X, class Y>
class LinearOperatorExtra : public Dune::LinearOperator<X, Y>
+
+#include <WellOperators.hpp>
+

Linear operator wrapper for well model.

+

This class is intended to hide the actual type of the well model (which depends on a TypeTag) by making a simple linear operator wrapper. That way the WellModelMatrixAdapter template does not need the concrete WellModel type, and we can avoid instantiating WellModelMatrixAdapter separately for each TypeTag, as it will only depend on the matrix and vector types involved, which typically are just one for each block size with block sizes 1-4.

+

Subclassed by Opm::WellModelAsLinearOperator< WellModel, X, Y >

+
+

Public Types

+
+
+using field_type = typename X::field_type
+
+ +
+
+using PressureMatrix = Dune::BCRSMatrix<MatrixBlock<field_type, 1, 1>>
+
+ +
+
+

Public Functions

+
+
+virtual void addWellPressureEquations(PressureMatrix &jacobian, const X &weights, const bool use_well_weights) const = 0
+
+ +
+
+virtual void addWellPressureEquationsStruct(PressureMatrix &jacobian) const = 0
+
+ +
+
+virtual int getNumberOfExtraEquations() const = 0
+
+ +
+
+ +
+
+struct LinearSolver
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "cprw"
+
+ +
+
+ +
+
+template<class TypeTag>
struct LinearSolverBackend<TypeTag, TTag::FlowIstlSolverParams>
+
+
+

Public Types

+
+
+using type = ISTLSolver<TypeTag>
+
+ +
+
+ +
+
+struct LinearSolverIgnoreConvergenceFailure
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct LinearSolverMaxIter
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 200
+
+ +
+
+ +
+
+struct LinearSolverPrintJsonDefinition
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = true
+
+ +
+
+ +
+
+struct LinearSolverReduction
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 1e-2
+
+ +
+
+ +
+
+struct LinearSolverRestart
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 40
+
+ +
+
+ +
+
+template<class TypeTag>
struct LinearSolverSplice<TypeTag, TTag::FlowProblem>
+
+
+

Public Types

+
+
+using type = TTag::FlowIstlSolver
+
+ +
+
+ +
+
+struct LoadFile
+
+
+

Public Static Attributes

+
+
+static constexpr auto *value = ""
+
+ +
+
+ +
+
+struct LoadStep
+
+
+

Public Static Attributes

+
+
+static constexpr int value = -1
+
+ +
+
+ +
+
+class LocalConnSet
+

Callable wrapper for the local, per-well reservoir connections.

+
+

Public Functions

+
+
+explicit LocalConnSet(const std::vector<int> &localConnIdx)
+

Constructor.

+
+
Parameters:
+

localConnIdx[in] Local (on-rank) connection index. Sized according to total number of connections of a well, but with a non-negative entry only for those active connections that intersect the current rank. If

localConnIdx[i] == j
+
+
+, then the i-th global connection is the j-th active connection on the current rank. Use a negative value to identify a connection that is either not flowing or which does not intersect the current MPI rank.

+
+
+
+ +
+
+int localIndex(const std::size_t connIdx) const
+

Retrieve local, on-rank connection index of a well’s global connection index.

+
+
Parameters:
+

connIdx[in] Well’s global connection index

+
+
Returns:
+

Local, on-rank, connection index of well’s global index. Negative value if connIdx does not intersect the current rank.

+
+
+
+ +
+
+

Private Members

+
+
+std::vector<int> localConnIdx_ = {}
+

Local (on-rank) connection index. Sized according to total number of connections of a well, but with a non-negative entry only for those active connections that intersect the current rank. If

localConnIdx[i] == j 
+
+
+, then the i-th global connection is the j-th active connection on the current rank. Use a negative value to identify a connection that is either not flowing or which does not intersect the current MPI rank.

+
+ +
+
+ +
+
+struct LocalDomainsOrderingMeasure
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "maxpressure"
+
+ +
+
+ +
+
+template<class Scalar>
struct LocalDomainsPartitioningImbalance
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1.03
+
+ +
+
+ +
+
+struct LocalDomainsPartitioningMethod
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "zoltan"
+
+ +
+
+ +
+
+struct LocalDomainsPartitionWellNeighborLevels
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 1
+
+ +
+
+ +
+
+template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Types

+
+
+using type = TTag::AutoDiffLocalLinearizer
+
+ +
+
+ +
+
+struct LocalLocation
+

Identifier for local source term element.

+
+

Public Members

+
+
+std::size_t ix = {}
+

Source term element index.

+
+ +
+
+int cell = {}
+

Local cell index for this source term (0..#active on rank - 1).

+
+ +
+
+ +
+
+template<class Scalar>
class LocalMatrix
+
+ +
+
+struct LocalSolveApproach
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "gauss-seidel"
+
+ +
+
+ +
+
+template<class Scalar>
struct LocalToleranceScalingCnv
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.1
+
+ +
+
+ +
+
+template<class Scalar>
struct LocalToleranceScalingMb
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1.0
+
+ +
+
+ +
+
+template<class Scalar>
class LocalVector
+
+ +
+
+struct LocalWellSolveControlSwitching
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class Scalar>
class LogOutputHelper
+
+#include <LogOutputHelper.hpp>
+
+

Public Functions

+
+
+LogOutputHelper(const EclipseState &eclState, const Schedule &schedule, const SummaryState &st, const std::string &moduleVersionName)
+
+ +
+
+void cumulative(const std::size_t reportStepNum, const bool withConns) const
+

Write cumulative production and injection reports to output.

+
+ +
+
+void error(const std::vector<int> &failedCellsPbub, const std::vector<int> &failedCellsPdew) const
+

Write error report to output.

+
+ +
+
+void fip(const Inplace &inplace, const Inplace &initialInplace, const std::string &name) const
+

Write fluid-in-place reports to output.

+
+ +
+
+void fipResv(const Inplace &inplace, const std::string &name) const
+

Write fluid-in-place reservoir reports to output.

+
+ +
+
+void injection(const std::size_t reportStepNum, const std::map<std::pair<std::string, int>, double> &block_pressures) const
+

Write injection report to output.

+
+ +
+
+void msw(const std::size_t reportStepNum) const
+

Write msw report to output.

+
+ +
+
+void production(const std::size_t reportStepNum, const std::map<std::pair<std::string, int>, double> &block_pressures) const
+

Write production report to output.

+
+ +
+
+void wellSpecification(const std::vector<std::string> &changedWells, const std::size_t reportStepNum) const
+

Write well specification report to output.

+
+
Parameters:
+
    +
  • changedWells[in] List of wells whose structure changed at this time.

  • +
  • reportStepNum[in] Report step index (1-based).

  • +
+
+
+
+ +
+
+void timeStamp(const std::string &lbl, double elapsed, int rstep, boost::posix_time::ptime currentDate) const
+
+ +
+
+

Private Functions

+
+
+void beginCumulativeReport_() const
+
+ +
+
+void endCumulativeReport_() const
+
+ +
+
+void outputCumulativeReportRecord_(const std::vector<Scalar> &wellCum, const std::vector<std::string> &wellCumNames, const std::vector<ConnData> &connData) const
+
+ +
+
+void outputRegionFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> oip, std::unordered_map<Inplace::Phase, Scalar> cip, const Scalar pav, const std::string &name, const int reg) const
+
+ +
+
+void outputResvFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> cipr, const int reg) const
+
+ +
+
+void beginInjectionReport_() const
+
+ +
+
+void endInjectionReport_() const
+
+ +
+
+void outputInjectionReportRecord_(const std::vector<Scalar> &wellInj, const std::vector<std::string> &wellInjNames, const std::vector<ConnData> &connData) const
+
+ +
+
+void beginMSWReport_() const
+
+ +
+
+void endMSWReport_() const
+
+ +
+
+void outputMSWReportRecord_(const Well &well) const
+
+ +
+
+void beginProductionReport_() const
+
+ +
+
+void endProductionReport_() const
+
+ +
+
+void outputProductionReportRecord_(const std::vector<Scalar> &wellProd, const std::vector<std::string> &wellProdNames, const std::vector<ConnData> &connData) const
+
+ +
+
+void fipUnitConvert_(std::unordered_map<Inplace::Phase, Scalar> &fip) const
+
+ +
+
+void pressureUnitConvert_(Scalar &pav) const
+
+ +
+
+

Private Members

+
+
+const EclipseState &eclState_
+
+ +
+
+const Schedule &schedule_
+
+ +
+
+const SummaryState &summaryState_
+
+ +
+
+std::string flowVersionName_
+
+ +
+
+ +
+
+template<typename Grid, typename GridView>
class LookUpCartesianData
+
+ +
+
+template<typename Grid, typename GridView>
struct LookUpCellCentroid
+
+ +
+
+template<typename Grid, typename GridView>
class LookUpData
+
+ +
+
+class Main
+
+#include <Main.hpp>
+
+

Public Functions

+
+
+Main(int argc, char **argv, bool ownMPI = true)
+
+ +
+
+explicit Main(const std::string &filename, bool mpi_init = true, bool mpi_finalize = true)
+
+ +
+
+Main(const std::string &filename, std::shared_ptr<EclipseState> eclipseState, std::shared_ptr<Schedule> schedule, std::shared_ptr<SummaryConfig> summaryConfig, bool mpi_init = true, bool mpi_finalize = true)
+
+ +
+
+~Main()
+
+ +
+
+void setArgvArgc_(const std::string &filename)
+
+ +
+
+void maybeSaveReservoirCouplingSlaveLogFilename_()
+
+ +
+
+void maybeRedirectReservoirCouplingSlaveOutput_()
+
+ +
+
+void initMPI()
+
+ +
+
+inline int runDynamic()
+

Run simulation.

+

Selects an appropriate simulator based on runtime information in the input deck.

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+template<class TypeTag>
inline int runStatic()
+

Run simulation.

+

Uses staticially configured simulator defined at call site.

+
+
Template Parameters:
+

TypeTag – Simulation type’s statically configured properties.

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+inline int justInitialize()
+

Used for test_outputdir.

+
+ +
+
+

Protected Functions

+
+
+template<class TypeTagEarlyBird>
inline bool initialize_(int &exitCode, bool keepKeywords = false)
+

Initialize.

+
+
Parameters:
+
    +
  • exitCode – The exitCode of the program.

  • +
  • keepKeywords – Keep Schedule keywords even if there are no actions

  • +
+
+
Returns:
+

Whether to actually run the simulator. I.e. true if parsing of command line was successful and no &#8212;help, &#8212;print-properties, or &#8212;print-parameters have been found.

+
+
+
+ +
+
+void setupVanguard()
+
+ +
+
+

Protected Attributes

+
+
+int argc_ = {0}
+
+ +
+
+char **argv_ = {nullptr}
+
+ +
+
+bool outputCout_ = {false}
+
+ +
+
+bool outputFiles_ = {false}
+
+ +
+
+

Private Functions

+
+
+void handleVersionCmdLine_(int argc, char **argv, std::string_view moduleVersionName)
+
+ +
+
+void handleTestSplitCommunicatorCmdLine_()
+
+ +
+
+int dispatchDynamic_()
+

Dispatch to actual simulation functions based on input deck’s setup.

+

Called from runDynamic()

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+template<class TypeTag>
inline int dispatchStatic_()
+

Dispatch to actual simulation function based on statically configured simulation type.

+

Called from runStatic()

+
+
Template Parameters:
+

TypeTag – Simulation type’s statically configured properties.

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+int runMICP(const Phases &phases)
+

Run a simulation with MICP effects.

+

Called from dispatchDynamic_()

+
+
Parameters:
+

phases[in] Run’s active phases. Needed to determine whether or not the run’s phase setup is supported.

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+int runTwoPhase(const Phases &phases)
+

Run a simulation with two active phases.

+

Called from dispatchDynamic_()

+
+
Parameters:
+

phases[in] Run’s active phases. Needed to determine whether or not the run’s phase setup is supported.

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+int runPolymer(const Phases &phases)
+

Run a simulation with polymers.

+

Called from dispatchDynamic_()

+
+
Parameters:
+

phases[in] Run’s active phases. Needed to determine whether or not the run’s phase setup is supported.

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+int runFoam()
+

Run a simulation with foam.

+

Called from dispatchDynamic_()

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+int runWaterOnly(const Phases &phases)
+

Run a single phase, water-only simulation.

+

Called from dispatchDynamic_()

+
+
Parameters:
+

phases[in] Run’s active phases. Needed to determine whether or not the run’s phase setup is supported.

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+int runWaterOnlyEnergy(const Phases &phases)
+

Run a single phase, water-only simulation with themal/energy effects.

+

Called from dispatchDynamic_()

+
+
Parameters:
+

phases[in] Run’s active phases. Needed to determine whether or not the run’s phase setup is supported.

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+int runBrine(const Phases &phases)
+

Run a simulation with brine, typically in a CCS workflow

+

Called from dispatchDynamic_()

+
+
Parameters:
+

phases[in] Run’s active phases. Needed to determine whether or not the run’s phase setup is supported.

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+int runSolvent(const Phases &phases)
+

Run a simulation with solvents.

+

Called from dispatchDynamic_()

+
+
Parameters:
+

phases[in] Run’s active phases. Needed to determine whether or not the run’s phase setup is supported.

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+int runExtendedBlackOil()
+

Run a simulation with the extended black-oil model.

+

Called from dispatchDynamic_()

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+int runThermal(const Phases &phases)
+

Run a three-phase simulation with thermal effects.

+

Called from dispatchDynamic_()

+
+
Parameters:
+

phases[in] Run’s active phases. Needed to determine whether or not the run’s phase setup is supported.

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+int runBlackOil()
+

Run a regular three-phase simulation without thermal effects.

+

Called from dispatchDynamic_()

+
+
Returns:
+

Simulation’s status/exit code.

+
+
+
+ +
+
+void readDeck(const std::string &deckFilename, const std::string &outputDir, const std::string &outputMode, const bool init_from_restart_file, const bool allRanksDbgPrtLog, const std::string &parsingStrictness, const std::string &actionParsingStrictness, const std::string &inputSkipMode, const bool keepKeywords, const std::size_t numThreads, const int output_param, const bool slaveMode, const std::string &parameters, std::string_view moduleVersion, std::string_view compileTimestamp)
+
+ +
+
+

Private Members

+
+
+bool ownMPI_ = {true}
+

True if we “own” MPI and should init / finalize.

+
+ +
+
+double setupTime_ = {0.0}
+
+ +
+
+std::string deckFilename_ = {}
+
+ +
+
+std::string flowProgName_ = {}
+
+ +
+
+char *saveArgs_[3] = {nullptr}
+
+ +
+
+std::unique_ptr<UDQState> udqState_ = {}
+
+ +
+
+std::unique_ptr<Action::State> actionState_ = {}
+
+ +
+
+std::unique_ptr<WellTestState> wtestState_ = {}
+
+ +
+
+std::shared_ptr<EclipseState> eclipseState_ = {}
+
+ +
+
+std::shared_ptr<Schedule> schedule_ = {}
+
+ +
+
+std::shared_ptr<SummaryConfig> summaryConfig_ = {}
+
+ +
+
+bool mpi_init_ = {true}
+

True if MPI_Init should be called.

+
+ +
+
+bool mpi_finalize_ = {true}
+

True if MPI_Finalize should be called.

+
+ +
+
+bool test_split_comm_ = false
+
+ +
+
+bool isSimulationRank_ = true
+
+ +
+
+

Private Static Functions

+
+
+static inline int getNumThreads()
+
+ +
+
+ +
+
+template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Types

+
+
+using EclMaterialLawManager = ::Opm::EclMaterialLawManager<Traits>
+
+ +
+
+using type = typename EclMaterialLawManager::MaterialLaw
+
+ +
+
+

Private Types

+
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using Traits = ThreePhaseMaterialTraits<Scalar, FluidSystem::waterPhaseIdx, FluidSystem::oilPhaseIdx, FluidSystem::gasPhaseIdx>
+
+ +
+
+ +
+
+template<class TypeTag>
struct MaterialLaw<TypeTag, TTag::FlowBaseProblemComp>
+
+
+

Public Types

+
+
+using EclMaterialLawManager = ::Opm::EclMaterialLawManager<Traits>
+
+ +
+
+using type = typename EclMaterialLawManager::MaterialLaw
+
+ +
+
+

Private Types

+
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using Traits = ThreePhaseMaterialTraits<Scalar, FluidSystem::waterPhaseIdx, FluidSystem::oilPhaseIdx, FluidSystem::gasPhaseIdx>
+
+ +
+
+ +
+
+template<class Scalar>
class Matrix
+
+#include <Matrix.hpp>
+

This struct resembles a csr matrix, only doubles are supported The data is stored in contiguous memory, such that they can be copied to a device in one transfer.

+
+

Public Functions

+
+
+inline Matrix(int N_, int nnzs_)
+

Allocate square Matrix and data arrays with given sizes

+
+
Parameters:
+
    +
  • N[in] number of rows

  • +
  • nnzs[in] number of nonzeros

  • +
+
+
+
+ +
+
+inline Matrix(int N_, int M_, int nnzs_)
+

Allocate rectangular Matrix and data arrays with given sizes

+
+
Parameters:
+
    +
  • N[in] number of rows

  • +
  • M[in] number of columns

  • +
  • nnzs[in] number of nonzeros

  • +
+
+
+
+ +
+
+

Public Members

+
+
+std::vector<Scalar> nnzValues
+
+ +
+
+std::vector<int> colIndices
+
+ +
+
+std::vector<int> rowPointers
+
+ +
+
+int N
+
+ +
+
+int M
+
+ +
+
+int nnzs
+
+ +
+
+ +
+
+struct MatrixAddWellContributions
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<typename T, int i, int j>
class MatrixBlock
+
+ +
+
+struct MaximumNumberOfGroupSwitches
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 3
+
+ +
+
+ +
+
+struct MaximumNumberOfWellSwitches
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 3
+
+ +
+
+ +
+
+template<class Scalar>
struct MaximumWaterSaturation
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1.0
+
+ +
+
+ +
+
+struct MaxInnerIterMsWells
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 100
+
+ +
+
+ +
+
+struct MaxInnerIterWells
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 50
+
+ +
+
+ +
+
+struct MaxLocalSolveIterations
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 20
+
+ +
+
+ +
+
+struct MaxNewtonIterationsWithInnerWellIterations
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 8
+
+ +
+
+ +
+
+template<class Scalar>
struct MaxPressureChangeMsWells
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 10 * 1e5
+
+ +
+
+ +
+
+template<class Scalar>
struct MaxResidualAllowed
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e7
+
+ +
+
+ +
+
+template<class Scalar>
struct MaxSinglePrecisionDays
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 20.0
+
+ +
+
+ +
+
+template<class Scalar>
struct MaxTemperatureChange
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 5.0
+
+ +
+
+ +
+
+struct MaxWelleqIter
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 30
+
+ +
+
+ +
+
+template<class Scalar>
class MechContainer
+
+#include <MechContainer.hpp>
+
+

Public Functions

+
+
+void allocate(const std::size_t bufferSize, std::map<std::string, int> &rstKeywords)
+
+ +
+
+void assignDisplacement(const unsigned globalDofIdx, const Dune::FieldVector<Scalar, 3> &disp)
+
+ +
+
+void assignDelStress(const unsigned globalDofIdx, const Dune::FieldVector<Scalar, 6> &delStress)
+
+ +
+
+void assignPotentialForces(const unsigned globalDofIdx, const Scalar force, const Scalar pressForce, const Scalar tempForce)
+
+ +
+
+void assignFracStress(const unsigned globalDofIdx, const Dune::FieldVector<Scalar, 6> &fracStress)
+
+ +
+
+void assignLinStress(const unsigned globalDofIdx, const Dune::FieldVector<Scalar, 6> &linStress)
+
+ +
+
+void assignStrain(const unsigned globalDofIdx, const Dune::FieldVector<Scalar, 6> &strain)
+
+ +
+
+void assignStress(const unsigned globalDofIdx, const Dune::FieldVector<Scalar, 6> &stress)
+
+ +
+
+void outputRestart(data::Solution &sol)
+
+ +
+
+inline bool allocated() const
+
+ +
+
+

Private Types

+
+
+using ScalarBuffer = std::vector<Scalar>
+
+ +
+
+

Private Members

+
+
+bool allocated_ = false
+
+ +
+
+ScalarBuffer potentialForce_
+
+ +
+
+ScalarBuffer potentialPressForce_
+
+ +
+
+ScalarBuffer potentialTempForce_
+
+ +
+
+std::array<ScalarBuffer, 3> disp_
+
+ +
+
+VoigtArray<Scalar> delstress_
+
+ +
+
+VoigtArray<Scalar> fracstress_
+
+ +
+
+VoigtArray<Scalar> linstress_
+
+ +
+
+VoigtArray<Scalar> strain_
+
+ +
+
+VoigtArray<Scalar> stress_
+
+ +
+
+ +
+
+struct Message
+
+#include <DeferredLogger.hpp>
+
+

Public Members

+
+
+int64_t flag
+
+ +
+
+std::string tag
+
+ +
+
+std::string text
+
+ +
+
+ +
+
+struct MessageInformation
+
+

Public Functions

+
+
+inline MessageInformation()
+
+ +
+
+inline MessageInformation(size_t start, size_t size)
+
+ +
+
+

Public Members

+
+
+size_t m_start
+
+ +
+
+size_t m_size
+
+ +
+
+ +
+
+struct MetisParams
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "default"
+
+ +
+
+ +
+
+template<class Scalar>
class MICPContainer
+
+#include <MICPContainer.hpp>
+
+

Public Functions

+
+
+void allocate(const unsigned bufferSize)
+
+ +
+
+void assign(const unsigned globalDofIdx, const Scalar microbialConcentration, const Scalar oxygenConcentration, const Scalar ureaConcentration, const Scalar biofilmConcentration, const Scalar calciteConcentration)
+
+ +
+
+MICPSolutionContainer<Scalar> getSolution() const
+
+ +
+
+void outputRestart(data::Solution &sol)
+
+ +
+
+void readRestart(const unsigned globalDofIdx, const unsigned elemIdx, const data::Solution &sol)
+
+ +
+
+inline bool allocated() const
+
+ +
+
+

Private Types

+
+
+using ScalarBuffer = std::vector<Scalar>
+
+ +
+
+

Private Members

+
+
+bool allocated_ = false
+
+ +
+
+ScalarBuffer cMicrobes_
+
+ +
+
+ScalarBuffer cOxygen_
+
+ +
+
+ScalarBuffer cUrea_
+
+ +
+
+ScalarBuffer cBiofilm_
+
+ +
+
+ScalarBuffer cCalcite_
+
+ +
+
+ +
+
+template<class Scalar>
struct MICPSolutionContainer
+
+

Struct holding MICP extension data.

+
+

Public Functions

+
+
+void resize(const unsigned numElems)
+

Resize vectors and zero initialize.

+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const MICPSolutionContainer &rhs) const
+
+ +
+
+

Public Members

+
+
+std::vector<Scalar> microbialConcentration
+
+ +
+
+std::vector<Scalar> oxygenConcentration
+
+ +
+
+std::vector<Scalar> ureaConcentration
+
+ +
+
+std::vector<Scalar> biofilmConcentration
+
+ +
+
+std::vector<Scalar> calciteConcentration
+
+ +
+
+

Public Static Functions

+
+
+static MICPSolutionContainer serializationTestObject()
+
+ +
+
+ +
+
+struct MiluVariant
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "ILU"
+
+ +
+
+ +
+
+struct MinStrictCnvIter
+
+
+

Public Static Attributes

+
+
+static constexpr int value = -1
+
+ +
+
+ +
+
+struct MinStrictMbIter
+
+
+

Public Static Attributes

+
+
+static constexpr int value = -1
+
+ +
+
+ +
+
+struct MinTimeStepBasedOnNewtonIterations
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 0.0
+
+ +
+
+ +
+
+struct MinTimeStepBeforeShuttingProblematicWellsInDays
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 0.01
+
+ +
+
+ +
+
+template<class FluidSystem>
class MixingRateControls
+
+

Class handling mixing rate controls for a FlowProblemBlackoil.

+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+

Public Functions

+
+
+explicit MixingRateControls(const Schedule &schedule)
+
+ +
+
+MixingRateControls(const MixingRateControls &rhs)
+
+ +
+
+bool operator==(const MixingRateControls &rhs) const
+
+ +
+
+MixingRateControls &operator=(const MixingRateControls &rhs)
+
+ +
+
+void init(std::size_t numDof, int episodeIdx, const unsigned ntpvt)
+
+ +
+
+bool drsdtActive(int episodeIdx) const
+
+ +
+
+bool drvdtActive(int episodeIdx) const
+
+ +
+
+bool drsdtConvective(int episodeIdx) const
+
+ +
+
+bool drsdtActive(int episodeIdx, std::size_t pvtRegionIdx) const
+
+ +
+
+bool drvdtActive(int episodeIdx, std::size_t pvtRegionIdx) const
+
+ +
+
+bool drsdtConvective(int episodeIdx, std::size_t pvtRegionIdx) const
+
+ +
+
+Scalar drsdtcon(const unsigned elemIdx, int episodeIdx, const int pvtRegionIdx) const
+

Returns the dynamic drsdt convective mixing value.

+
+ +
+
+Scalar maxGasDissolutionFactor(unsigned timeIdx, unsigned globalDofIdx, const int episodeIdx, const int pvtRegionIdx) const
+

Returns the maximum value of the gas dissolution factor at the current time for a given degree of freedom.

+
+ +
+
+Scalar maxOilVaporizationFactor(const unsigned timeIdx, const unsigned globalDofIdx, const int episodeIdx, const int pvtRegionIdx) const
+

Returns the maximum value of the oil vaporization factor at the current time for a given degree of freedom.

+
+ +
+
+void updateExplicitQuantities(const int episodeIdx, const Scalar timeStepSize)
+
+ +
+
+void updateLastValues(const unsigned elemIdx, const Scalar Rs, const Scalar Rv)
+
+ +
+
+void updateMaxValues(const int episodeIdx, const Scalar timeStepSize)
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+template<class IntensiveQuantities>
inline void update(unsigned compressedDofIdx, const IntensiveQuantities &iq, const int episodeIdx, const Scalar gravity, const Scalar permZ, const Scalar distZ, const int pvtRegionIdx)
+
+ +
+
+

Public Static Functions

+
+
+static MixingRateControls serializationTestObject(const Schedule &schedule)
+
+ +
+
+

Private Functions

+
+
+void updateConvectiveDRsDt_(const unsigned compressedDofIdx, const Scalar t, const Scalar p, const Scalar pg, const Scalar rs, const Scalar sg, const Scalar poro, const Scalar permz, const Scalar distZ, const Scalar gravity, const Scalar salt, const Scalar Xhi, const Scalar Psi, const Scalar omegainn, const int pvtRegionIndex)
+
+ +
+
+

Private Members

+
+
+std::vector<Scalar> lastRv_
+
+ +
+
+std::vector<Scalar> maxDRv_
+
+ +
+
+std::vector<Scalar> convectiveDrs_
+
+ +
+
+std::vector<Scalar> lastRs_
+
+ +
+
+std::vector<Scalar> maxDRs_
+
+ +
+
+std::vector<bool> dRsDtOnlyFreeGas_
+
+ +
+
+const Schedule &schedule_
+
+ +
+
+ +
+
+template<typename T, int i, int j, typename A>
struct mm_block_structure_header<BCRSMatrix<Opm::MatrixBlock<T, i, j>, A>>
+
+
+

Public Types

+
+
+using M = BCRSMatrix<Opm::MatrixBlock<T, i, j>, A>
+
+ +
+
+

Public Static Functions

+
+
+static inline void print(std::ostream &os, const M&)
+
+ +
+
+ +
+
+template<typename T, int i, int j, typename A>
struct mm_header_printer<BCRSMatrix<Opm::MatrixBlock<T, i, j>, A>>
+
+
+

Public Static Functions

+
+
+static inline void print(std::ostream &os)
+
+ +
+
+ +
+
+template<typename T, int i, int j, typename A>
struct mm_multipliers<BCRSMatrix<Opm::MatrixBlock<T, i, j>, A>>
+
+
+

Public Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator rows
+
+ +
+
+enumerator cols
+
+ +
+ +
+
+ +
+
+template<typename Scalar>
class MobileOil_GO_SGcr : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that critical oil saturation in gas/oil system is strictly smaller than oil saturation at critical gas saturation.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar swl_ = {}
+

Minimum water saturation.

+
+ +
+
+Scalar sgcr_ = {}
+

Critical gas saturation.

+
+ +
+
+Scalar sogcr_ = {}
+

Critical oil saturation in gas/oil system.

+
+ +
+
+ +
+
+template<typename Scalar>
class MobileOil_GO_SGmin : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that critical oil saturation in gas/oil system is strictly smaller than maximum oil saturation.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar swl_ = {}
+

Minimum water saturation.

+
+ +
+
+Scalar sgl_ = {}
+

Minimum gas saturation.

+
+ +
+
+Scalar sogcr_ = {}
+

Critical oil saturation in gas/oil system.

+
+ +
+
+ +
+
+template<typename Scalar>
class MobileOil_OW_SWcr : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that critical oil saturation in oil/water system is strictly smaller than oil saturation at critical water saturation.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar sgl_ = {}
+

Minimum gas saturation. Typically zero.

+
+ +
+
+Scalar swcr_ = {}
+

Critical water saturation.

+
+ +
+
+Scalar sowcr_ = {}
+

Critical oil saturation in oil/water system.

+
+ +
+
+ +
+
+template<typename Scalar>
class MobileOil_OW_SWmin : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that critical oil saturation in oil/water system is strictly smaller than maximum oil saturation.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar swl_ = {}
+

Minimum (connate) water saturation.

+
+ +
+
+Scalar sgl_ = {}
+

Minimum gas saturation. Typically zero.

+
+ +
+
+Scalar sowcr_ = {}
+

Critical oil saturation in oil/water system.

+
+ +
+
+ +
+
+template<class TypeTag>
struct Model<TypeTag, TTag::FlowBaseProblemBlackoil>
+
+
+

Public Types

+
+
+using type = FIBlackOilModel<TypeTag>
+
+ +
+
+ +
+
+class MpiSerializer : public Serializer<Mpi::Packer>
+
+#include <MPISerializer.hpp>
+

Class for serializing and broadcasting data using MPI.

+
+

Public Functions

+
+
+inline explicit MpiSerializer(Parallel::Communication comm)
+
+ +
+
+template<typename ...Args>
inline void broadcast(RootRank rootrank, Args&&... args)
+
+ +
+
+template<class T>
inline void append(T &data, int root = 0)
+

Serialize and broadcast on root process, de-serialize and append on others.

+
+
Template Parameters:
+

T – Type of class to broadcast

+
+
Parameters:
+
    +
  • data – Class to broadcast

  • +
  • root – Process to broadcast from

  • +
+
+
+
+ +
+
+

Private Functions

+
+
+inline void broadcast_chunked(int root)
+
+ +
+
+

Private Members

+
+
+const Mpi::Packer m_packer
+

Packer instance.

+
+ +
+
+Parallel::Communication m_comm
+

Communicator to use.

+
+ +
+
+ +
+
+template<class Scalar>
struct MSWellTracerRate
+
+#include <WellTracerRate.hpp>
+
+

Public Functions

+
+
+MSWellTracerRate() = default
+
+ +
+
+inline MSWellTracerRate(const std::string &n)
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline bool operator==(const MSWellTracerRate &that) const
+
+ +
+
+

Public Members

+
+
+std::string name = {}
+
+ +
+
+std::unordered_map<int, Scalar> rate = {}
+
+ +
+
+ +
+
+template<typename TypeTag>
class MultisegmentWell : public Opm::WellInterface<TypeTag>, public Opm::MultisegmentWellEval<GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::Indices>>
+
+
+

Public Types

+
+
+using Base = WellInterface<TypeTag>
+
+ +
+
+using MSWEval = MultisegmentWellEval<GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::Indices>>
+
+ +
+
+using FSInfo = std::tuple<Scalar, typename std::decay<decltype(std::declval<decltype(std::declval<const Simulator&>().model().intensiveQuantities(0, 0).fluidState())>().saltConcentration())>::type, int>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using ModelParameters = typename Base::ModelParameters
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using RateConverterType = typename WellInterfaceFluidSystem<FluidSystem>::RateConverterType
+
+ +
+
+using SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>
+
+ +
+
+FluidState = BlackOilFluidState< Eval, FluidSystem, has_temperature, has_energy, Indices::compositionSwitchIdx >=0, has_watVapor, has_brine, has_saltPrecip, has_disgas_in_water, Indices::numPhases >
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using BVector = Dune::BlockVector<VectorBlockType>
+
+ +
+
+using Eval = typename Base::Eval
+
+ +
+
+using PressureMatrix = Dune::BCRSMatrix<Opm::MatrixBlock<Scalar, 1, 1>>
+
+ +
+
+

Public Functions

+
+
+MultisegmentWell(const Well &well, const ParallelWellInfo<Scalar> &pw_info, const int time_step, const ModelParameters &param, const RateConverterType &rate_converter, const int pvtRegionIdx, const int num_components, const int num_phases, const int index_of_well, const std::vector<PerforationData<Scalar>> &perf_data)
+
+ +
+
+void init(const PhaseUsage *phase_usage_arg, const std::vector<Scalar> &depth_arg, const Scalar gravity_arg, const std::vector<Scalar> &B_avg, const bool changed_to_open_this_step) override
+
+ +
+
+void updateWellStateWithTarget(const Simulator &simulator, const GroupState<Scalar> &group_state, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) const override
+

updating the well state based the current control mode

+
+ +
+
+ConvergenceReport getWellConvergence(const Simulator &simulator, const WellState<Scalar> &well_state, const std::vector<Scalar> &B_avg, DeferredLogger &deferred_logger, const bool relax_tolerance) const override
+

check whether the well equations get converged for this well

+
+ +
+
+virtual void apply(const BVector &x, BVector &Ax) const override
+

Ax = Ax - C D^-1 B x.

+
+ +
+
+virtual void apply(BVector &r) const override
+

r = r - C D^-1 Rw

+
+ +
+
+void recoverWellSolutionAndUpdateWellState(const Simulator &simulator, const BVector &x, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+

using the solution x to recover the solution xw for wells and applying xw to update Well State

+
+ +
+
+void computeWellPotentials(const Simulator &simulator, const WellState<Scalar> &well_state, std::vector<Scalar> &well_potentials, DeferredLogger &deferred_logger) override
+

computing the well potentials for group control

+
+ +
+
+void updatePrimaryVariables(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+
+ +
+
+void solveEqAndUpdateWellState(const Simulator &simulator, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+
+ +
+
+void calculateExplicitQuantities(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+
+ +
+
+void updateIPRImplicit(const Simulator &simulator, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+
+ +
+
+void updateProductivityIndex(const Simulator &simulator, const WellProdIndexCalculator<Scalar> &wellPICalc, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) const override
+
+ +
+
+virtual Scalar connectionDensity(const int globalConnIdx, const int openConnIdx) const override
+
+ +
+
+virtual void addWellContributions(SparseMatrixAdapter &jacobian) const override
+
+ +
+
+void addWellPressureEquations(PressureMatrix &mat, const BVector &x, const int pressureVarIndex, const bool use_well_weights, const WellState<Scalar> &well_state) const override
+
+ +
+
+virtual std::vector<Scalar> computeCurrentWellRates(const Simulator &simulator, DeferredLogger &deferred_logger) const override
+

Compute well rates based on current reservoir conditions and well variables. Used in updateWellStateRates().

+
+ +
+
+std::optional<Scalar> computeBhpAtThpLimitProdWithAlq(const Simulator &simulator, const SummaryState &summary_state, const Scalar alq_value, DeferredLogger &deferred_logger, bool iterate_if_no_solution) const override
+
+ +
+
+virtual std::vector<Scalar> getPrimaryVars() const override
+
+ +
+
+int setPrimaryVars(typename std::vector<Scalar>::const_iterator it) override
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr bool has_solvent
+
+ +
+
+static constexpr bool has_polymer
+
+ +
+
+

Protected Functions

+
+
+void updateWellState(const Simulator &simulator, const BVectorWell &dwells, WellState<Scalar> &well_state, DeferredLogger &deferred_logger, const Scalar relaxation_factor = 1.0)
+
+ +
+
+void computeInitialSegmentFluids(const Simulator &simulator)
+
+ +
+
+void computePerfCellPressDiffs(const Simulator &simulator)
+
+ +
+
+template<class Value>
void computePerfRate(const IntensiveQuantities &int_quants, const std::vector<Value> &mob_perfcells, const std::vector<Scalar> &Tw, const int seg, const int perf, const Value &segment_pressure, const bool &allow_cf, std::vector<Value> &cq_s, Value &perf_press, PerforationRates<Scalar> &perf_rates, DeferredLogger &deferred_logger) const
+
+ +
+
+template<class Value>
void computePerfRate(const Value &pressure_cell, const Value &rs, const Value &rv, const std::vector<Value> &b_perfcells, const std::vector<Value> &mob_perfcells, const std::vector<Scalar> &Tw, const int perf, const Value &segment_pressure, const Value &segment_density, const bool &allow_cf, const std::vector<Value> &cmix_s, std::vector<Value> &cq_s, Value &perf_press, PerforationRates<Scalar> &perf_rates, DeferredLogger &deferred_logger) const
+
+ +
+
+void computeSegmentFluidProperties(const Simulator &simulator, DeferredLogger &deferred_logger)
+
+ +
+
+template<class Value>
void getMobility(const Simulator &simulator, const int local_perf_index, std::vector<Value> &mob, DeferredLogger &deferred_logger) const
+
+ +
+
+void computeWellRatesAtBhpLimit(const Simulator &simulator, std::vector<Scalar> &well_flux, DeferredLogger &deferred_logger) const
+
+ +
+
+void computeWellRatesWithBhp(const Simulator &simulator, const Scalar &bhp, std::vector<Scalar> &well_flux, DeferredLogger &deferred_logger) const override
+
+ +
+
+void computeWellRatesWithBhpIterations(const Simulator &simulator, const Scalar &bhp, std::vector<Scalar> &well_flux, DeferredLogger &deferred_logger) const override
+
+ +
+
+std::vector<Scalar> computeWellPotentialWithTHP(const WellState<Scalar> &well_state, const Simulator &simulator, DeferredLogger &deferred_logger) const
+
+ +
+
+bool computeWellPotentialsImplicit(const Simulator &simulator, const WellState<Scalar> &well_state, std::vector<Scalar> &well_potentials, DeferredLogger &deferred_logger) const
+
+ +
+
+virtual Scalar getRefDensity() const override
+
+ +
+
+bool iterateWellEqWithControl(const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger) override
+
+ +
+
+bool iterateWellEqWithSwitching(const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger, const bool fixed_control = false, const bool fixed_status = false) override
+
+ +
+
+void assembleWellEqWithoutIteration(const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger) override
+
+ +
+
+void updateWaterThroughput(const double dt, WellState<Scalar> &well_state) const override
+
+ +
+
+EvalWell getSegmentSurfaceVolume(const Simulator &simulator, const int seg_idx) const
+
+ +
+
+bool openCrossFlowAvoidSingularity(const Simulator &simulator) const
+
+ +
+
+bool allDrawDownWrongDirection(const Simulator &simulator) const
+
+ +
+
+std::optional<Scalar> computeBhpAtThpLimitProd(const WellState<Scalar> &well_state, const Simulator &ebos_simulator, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
+
+ +
+
+std::optional<Scalar> computeBhpAtThpLimitInj(const Simulator &ebos_simulator, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
+
+ +
+
+Scalar maxPerfPress(const Simulator &simulator) const
+
+ +
+
+void checkOperabilityUnderBHPLimit(const WellState<Scalar> &well_state, const Simulator &ebos_simulator, DeferredLogger &deferred_logger) override
+
+ +
+
+void checkOperabilityUnderTHPLimit(const Simulator &ebos_simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+
+ +
+
+virtual void updateIPR(const Simulator &ebos_simulator, DeferredLogger &deferred_logger) const override
+
+ +
+
+FSInfo getFirstPerforationFluidStateInfo(const Simulator &simulator) const
+
+ +
+
+

Protected Attributes

+
+
+bool regularize_
+
+ +
+
+std::vector<std::vector<Scalar>> segment_fluid_initial_
+
+ +
+
+mutable int debug_cost_counter_ = 0
+
+ +
+
+ +
+
+template<class FluidSystem, class Indices>
class MultisegmentWellAssemble
+
+

Class handling assemble of the equation system for MultisegmentWell.

+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using Equations = MultisegmentWellEquations<Scalar, numWellEq, Indices::numEq>
+
+ +
+
+using PrimaryVariables = MultisegmentWellPrimaryVariables<FluidSystem, Indices>
+
+ +
+
+using EvalWell = DenseAd::Evaluation<Scalar, numWellEq + Indices::numEq>
+
+ +
+
+

Public Functions

+
+
+inline explicit MultisegmentWellAssemble(const WellInterfaceIndices<FluidSystem, Indices> &well)
+

Constructor initializes reference to well.

+
+ +
+
+void assembleControlEq(const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const Scalar rho, const PrimaryVariables &primary_variables, Equations &eqns, const bool stopped_or_zero_target, DeferredLogger &deferred_logger) const
+

Assemble control equation.

+
+ +
+
+void assembleAccelerationTerm(const int seg_target, const int seg, const int seg_upwing, const EvalWell &accelerationTerm, Equations &eqns1) const
+

Assemble piece of the acceleration term.

+
+ +
+
+void assembleHydroPressureLoss(const int seg, const int seg_density, const EvalWell &hydro_pressure_drop_seg, Equations &eqns1) const
+

Assemble hydraulic pressure term.

+
+ +
+
+void assemblePressureEqExtraDerivatives(const int seg, const int seg_upwind, const EvalWell &extra_derivatives, Equations &eqns1) const
+

Assemble additional derivatives due to reverse flow.

+
+ +
+
+void assemblePressureEq(const int seg, const int seg_upwind, const int outlet_segment_index, const EvalWell &pressure_equation, const EvalWell &outlet_pressure, Equations &eqns) const
+

Assemble pressure terms.

+
+ +
+
+void assembleTrivialEq(const int seg, const Scalar value, Equations &eqns) const
+

Assembles a trivial equation.

+
+ +
+
+void assembleAccumulationTerm(const int seg, const int comp_idx, const EvalWell &accumulation_term, Equations &eqns1) const
+

Assemble accumulation term.

+
+ +
+
+void assembleOutflowTerm(const int seg, const int seg_upwind, const int comp_idx, const EvalWell &segment_rate, Equations &eqns1) const
+

Assemble outflow term.

+
+ +
+
+void assembleInflowTerm(const int seg, const int inlet, const int inlet_upwind, const int comp_idx, const EvalWell &inlet_rate, Equations &eqns) const
+

Assemble inflow term.

+
+ +
+
+void assemblePerforationEq(const int seg, const int local_perf_index, const int comp_idx, const EvalWell &cq_s_effective, Equations &eqns) const
+

Assemble equation for a perforation.

+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numWellEq = Indices::numPhases + 1
+
+ +
+
+

Private Members

+
+
+const WellInterfaceIndices<FluidSystem, Indices> &well_
+

Reference to well.

+
+ +
+
+

Private Static Attributes

+
+
+static constexpr int WQTotal = 0
+
+ +
+
+static constexpr bool has_wfrac_variable = Indices::waterEnabled && Indices::oilEnabled
+
+ +
+
+static constexpr bool has_gfrac_variable = Indices::gasEnabled && Indices::numPhases > 1
+
+ +
+
+static constexpr int WFrac = has_wfrac_variable ? 1 : -1000
+
+ +
+
+static constexpr int GFrac = has_gfrac_variable ? has_wfrac_variable + 1 : -1000
+
+ +
+
+static constexpr int SPres = has_wfrac_variable + has_gfrac_variable + 1
+
+ +
+
+ +
+
+template<class Scalar>
class MultisegmentWellContribution
+
+

This class serves to duplicate the functionality of the MultisegmentWell A MultisegmentWell uses C, D and B and performs y -= (C^T * (D^-1 * (B*x))) B and C are matrices, with M rows and N columns, where N is the size of the matrix. They contain blocks of MultisegmentWell::numEq by MultisegmentWell::numWellEq. D is a MxM matrix, the square blocks have size MultisegmentWell::numWellEq. B*x and D*B*x are a vector with M*numWellEq doubles C*D*B*x is a vector with N*numEq doubles.

+
+

Public Types

+
+
+using UMFPackIndex = SuiteSparse_long
+
+ +
+
+

Public Functions

+
+
+MultisegmentWellContribution(unsigned int dim, unsigned int dim_wells, unsigned int Mb, std::vector<Scalar> &Bvalues, std::vector<unsigned int> &BcolIndices, std::vector<unsigned int> &BrowPointers, unsigned int DnumBlocks, Scalar *Dvalues, UMFPackIndex *DcolPointers, UMFPackIndex *DrowIndices, std::vector<Scalar> &Cvalues)
+

Create a new MultisegmentWellContribution Matrices C and B are passed in Blocked CSR, matrix D in CSC The variables representing C, B and D will go out of scope when MultisegmentWell::addWellContribution() ends

+
+
Parameters:
+
    +
  • dim[in] size of blocks in blockvectors x and y, equal to MultisegmentWell::numEq

  • +
  • dim_wells[in] size of blocks of C, B and D, equal to MultisegmentWell::numWellEq

  • +
  • Mb[in] number of blockrows in C, B and D

  • +
  • Bvalues[in] nonzero values of matrix B

  • +
  • BcolIndices[in] columnindices of blocks of matrix B

  • +
  • BrowPointers[in] rowpointers of matrix B

  • +
  • DnumBlocks[in] number of blocks in D

  • +
  • Dvalues[in] nonzero values of matrix D

  • +
  • DcolPointers[in] columnpointers of matrix D

  • +
  • DrowIndices[in] rowindices of matrix D

  • +
  • Cvalues[in] nonzero values of matrix C

  • +
+
+
+
+ +
+
+~MultisegmentWellContribution()
+

Destroy a MultisegmentWellContribution, and free memory.

+
+ +
+
+void apply(Scalar *h_x, Scalar *h_y)
+

Apply the MultisegmentWellContribution on CPU performs y -= (C^T * (D^-1 * (B*x))) for MultisegmentWell

+
+
Parameters:
+
    +
  • h_x[in] vector x, must be on CPU

  • +
  • h_y[inout] vector y, must be on CPU

  • +
+
+
+
+ +
+
+

Private Functions

+
+
+unsigned int getColIdx(unsigned int idx)
+

Translate the columnIndex if needed Some preconditioners reorder the rows of the matrix, this means the columnIndices of the wellcontributions need to be reordered as well

+
+ +
+
+

Private Members

+
+
+unsigned int dim
+
+ +
+
+unsigned int dim_wells
+
+ +
+
+unsigned int M
+
+ +
+
+unsigned int Mb
+
+ +
+
+unsigned int DnumBlocks
+
+ +
+
+std::vector<Scalar> Cvals
+
+ +
+
+std::vector<Scalar> Dvals
+
+ +
+
+std::vector<Scalar> Bvals
+
+ +
+
+std::vector<int> Dcols
+
+ +
+
+std::vector<unsigned int> Bcols
+
+ +
+
+std::vector<int> Drows
+
+ +
+
+std::vector<unsigned int> Brows
+
+ +
+
+std::vector<Scalar> z1
+
+ +
+
+std::vector<Scalar> z2
+
+ +
+
+void *UMFPACK_Symbolic
+
+ +
+
+void *UMFPACK_Numeric
+
+ +
+
+ +
+
+template<class Scalar, int numWellEq, int numEq>
class MultisegmentWellEquationAccess
+

Class administering assembler access to equation system.

+
+

Public Types

+
+
+using BVectorWell = typename MultisegmentWellEquations<Scalar, numWellEq, numEq>::BVectorWell
+
+ +
+
+using DiagMatWell = typename MultisegmentWellEquations<Scalar, numWellEq, numEq>::DiagMatWell
+
+ +
+
+using OffDiatMatWell = typename MultisegmentWellEquations<Scalar, numWellEq, numEq>::OffDiagMatWell
+
+ +
+
+

Public Functions

+
+
+inline explicit MultisegmentWellEquationAccess(MultisegmentWellEquations<Scalar, numWellEq, numEq> &eqns)
+

Constructor initializes reference to the equation system.

+
+ +
+
+inline BVectorWell &residual()
+

Returns a reference to residual vector.

+
+ +
+
+inline OffDiatMatWell &B()
+

Returns a reference to B matrix.

+
+ +
+
+inline OffDiatMatWell &C()
+

Returns a reference to C matrix.

+
+ +
+
+inline DiagMatWell &D()
+

Returns a reference to D matrix.

+
+ +
+
+

Private Members

+
+
+MultisegmentWellEquations<Scalar, numWellEq, numEq> &eqns_
+

Reference to equation system.

+
+ +
+
+ +
+
+template<class Scalar, int numWellEq, int numEq>
class MultisegmentWellEquations
+
+
+

Public Types

+
+
+using VectorBlockWellType = Dune::FieldVector<Scalar, numWellEq>
+
+ +
+
+using BVectorWell = Dune::BlockVector<VectorBlockWellType>
+
+ +
+
+using VectorBlockType = Dune::FieldVector<Scalar, numEq>
+
+ +
+
+using BVector = Dune::BlockVector<VectorBlockType>
+
+ +
+
+using DiagMatrixBlockWellType = Dune::FieldMatrix<Scalar, numWellEq, numWellEq>
+
+ +
+
+using DiagMatWell = Dune::BCRSMatrix<DiagMatrixBlockWellType>
+
+ +
+
+using OffDiagMatrixBlockWellType = Dune::FieldMatrix<Scalar, numWellEq, numEq>
+
+ +
+
+using OffDiagMatWell = Dune::BCRSMatrix<OffDiagMatrixBlockWellType>
+
+ +
+
+

Public Functions

+
+
+MultisegmentWellEquations(const MultisegmentWellGeneric<Scalar> &well, const ParallelWellInfo<Scalar> &pw_info)
+
+ +
+
+void init(const int numPerfs, const std::vector<int> &cells, const std::vector<std::vector<int>> &segment_inlets, const std::vector<std::vector<int>> &segment_perforations)
+

Setup sparsity pattern for the matrices.

+
+
Parameters:
+
    +
  • numPerfs – Number of perforations

  • +
  • cells – Cell indices for perforations

  • +
  • segment_inlets – Cell indices for segment inlets

  • +
  • segment_perforations – Cell indices for segment perforations

  • +
+
+
+
+ +
+
+void clear()
+

Set all coefficients to 0.

+
+ +
+
+void apply(const BVector &x, BVector &Ax) const
+

Apply linear operator to vector.

+
+ +
+
+void apply(BVector &r) const
+

Apply linear operator to vector.

+
+ +
+
+void createSolver()
+

Compute the LU-decomposition of D matrix.

+
+ +
+
+BVectorWell solve() const
+

Apply inverted D matrix to residual and return result.

+
+ +
+
+BVectorWell solve(const BVectorWell &rhs) const
+

Apply inverted D matrix to rhs and return result.

+
+ +
+
+void recoverSolutionWell(const BVector &x, BVectorWell &xw) const
+

Recover well solution.

+

xw = inv(D)*(rw - C*x)

+
+ +
+
+template<class SparseMatrixAdapter>
void extract(SparseMatrixAdapter &jacobian) const
+

Add the matrices of this well to the sparse matrix adapter.

+
+ +
+
+template<class PressureMatrix>
void extractCPRPressureMatrix(PressureMatrix &jacobian, const BVector &weights, const int pressureVarIndex, const bool, const WellInterfaceGeneric<Scalar> &well, const int seg_pressure_var_ind, const WellState<Scalar> &well_state) const
+

Extract CPR pressure matrix.

+
+ +
+
+void sumDistributed(Parallel::Communication comm)
+

Sum with off-process contribution.

+
+ +
+
+inline const BVectorWell &residual() const
+

Returns a const reference to the residual.

+
+ +
+
+

Private Members

+
+
+OffDiagMatWell duneB_
+
+ +
+
+OffDiagMatWell duneC_
+
+ +
+
+DiagMatWell duneD_
+
+ +
+
+mutable std::shared_ptr<Dune::UMFPack<DiagMatWell>> duneDSolver_
+

solver for diagonal matrix

+

This is a shared_ptr as MultisegmentWell is copied in computeWellPotentials…

+
+ +
+
+BVectorWell resWell_
+
+ +
+
+const MultisegmentWellGeneric<Scalar> &well_
+

Reference to well.

+
+ +
+
+std::vector<int> cells_
+
+ +
+
+const ParallelWellInfo<Scalar> &pw_info_
+
+ +
+
+mswellhelpers::ParallellMSWellB<OffDiagMatWell> parallelB_
+
+ +
+
+

Friends

+
+
+friend class MultisegmentWellEquationAccess< Scalar, numWellEq, numEq >
+
+ +
+
+ +
+
+template<typename FluidSystem, typename Indices>
class MultisegmentWellEval : public Opm::MultisegmentWellGeneric<FluidSystem::Scalar>
+
+
+

Public Functions

+
+
+inline const Equations &linSys() const
+

Returns a const reference to equation system.

+
+ +
+
+

Public Members

+
+
+const ParallelWellInfo<Scalar> &pw_info_
+
+ +
+
+

Protected Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using PrimaryVariables = MultisegmentWellPrimaryVariables<FluidSystem, Indices>
+
+ +
+
+using Equations = MultisegmentWellEquations<Scalar, numWellEq, Indices::numEq>
+
+ +
+
+using MSWSegments = MultisegmentWellSegments<FluidSystem, Indices>
+
+ +
+
+using BVector = typename Equations::BVector
+
+ +
+
+using BVectorWell = typename Equations::BVectorWell
+
+ +
+
+using EvalWell = typename PrimaryVariables::EvalWell
+
+ +
+
+using Eval = DenseAd::Evaluation<Scalar, Indices::numEq>
+
+ +
+
+

Protected Functions

+
+
+MultisegmentWellEval(WellInterfaceIndices<FluidSystem, Indices> &baseif, const ParallelWellInfo<Scalar> &pw_info)
+
+ +
+
+void initMatrixAndVectors()
+
+ +
+
+void assembleDefaultPressureEq(const int seg, WellState<Scalar> &well_state, const bool use_average_density)
+
+ +
+
+void assembleICDPressureEq(const int seg, const UnitSystem &unit_system, WellState<Scalar> &well_state, const SummaryState &summary_state, const bool use_average_density, DeferredLogger &deferred_logger)
+
+ +
+
+void assembleAccelerationAndHydroPressureLosses(const int seg, WellState<Scalar> &well_state, const bool use_average_density)
+
+ +
+
+void assemblePressureEq(const int seg, const UnitSystem &unit_system, WellState<Scalar> &well_state, const SummaryState &summary_state, const bool use_average_density, DeferredLogger &deferred_logger)
+
+ +
+
+ConvergenceReport getWellConvergence(const WellState<Scalar> &well_state, const std::vector<Scalar> &B_avg, DeferredLogger &deferred_logger, const Scalar max_residual_allowed, const Scalar tolerance_wells, const Scalar relaxed_inner_tolerance_flow_ms_well, const Scalar tolerance_pressure_ms_wells, const Scalar relaxed_inner_tolerance_pressure_ms_well, const bool relax_tolerance, const bool well_is_stopped) const
+

check whether the well equations get converged for this well

+
+ +
+
+std::pair<bool, std::vector<Scalar>> getFiniteWellResiduals(const std::vector<Scalar> &B_avg, DeferredLogger &deferred_logger) const
+
+ +
+
+Scalar getControlTolerance(const WellState<Scalar> &well_state, const Scalar tolerance_wells, const Scalar tolerance_pressure_ms_wells, DeferredLogger &deferred_logger) const
+
+ +
+
+Scalar getResidualMeasureValue(const WellState<Scalar> &well_state, const std::vector<Scalar> &residuals, const Scalar tolerance_wells, const Scalar tolerance_pressure_ms_wells, DeferredLogger &deferred_logger) const
+
+ +
+
+void assembleAccelerationPressureLoss(const int seg, WellState<Scalar> &well_state)
+
+ +
+
+EvalWell pressureDropAutoICD(const int seg, const UnitSystem &unit_system) const
+
+ +
+
+EvalWell extendEval(const Eval &in) const
+
+ +
+
+

Protected Attributes

+
+
+const WellInterfaceIndices<FluidSystem, Indices> &baseif_
+
+ +
+
+Equations linSys_
+

The equation system.

+
+ +
+
+PrimaryVariables primary_variables_
+

The primary variables.

+
+ +
+
+MSWSegments segments_
+

Segment properties.

+
+ +
+
+std::vector<Scalar> cell_perforation_depth_diffs_
+
+ +
+
+std::vector<Scalar> cell_perforation_pressure_diffs_
+
+ +
+
+

Protected Static Attributes

+
+
+static constexpr int numWellEq = PrimaryVariables::numWellEq
+
+ +
+
+static constexpr int SPres = PrimaryVariables::SPres
+
+ +
+
+static constexpr int WQTotal = PrimaryVariables::WQTotal
+
+ +
+
+ +
+
+template<typename Scalar>
class MultisegmentWellGeneric
+
+
+

Public Functions

+
+
+const WellSegments &segmentSet() const
+
+ +
+
+int segmentNumberToIndex(const int segment_number) const
+
+ +
+
+int numberOfSegments() const
+

number of segments for this well

+
+ +
+
+

Protected Functions

+
+
+explicit MultisegmentWellGeneric(WellInterfaceGeneric<Scalar> &baseif)
+
+ +
+
+void scaleSegmentRatesWithWellRates(const std::vector<std::vector<int>> &segment_inlets, const std::vector<std::vector<int>> &segment_perforations, WellState<Scalar> &well_state) const
+
+ +
+
+void scaleSegmentPressuresWithBhp(WellState<Scalar> &well_state) const
+
+ +
+
+WellSegmentCompPressureDrop compPressureDrop() const
+
+ +
+
+bool update_relaxation_factor(const std::vector<Scalar> &measure_history, Scalar &relaxation_factor, bool &regularize, DeferredLogger &deferred_logger) const
+

Detect oscillation or stagnation based on the residual measure history.

+
+ +
+
+bool repeatedStagnation(const std::vector<Scalar> &measure_history, bool &regularize, DeferredLogger &deferred_logger) const
+
+ +
+
+bool accelerationalPressureLossConsidered() const
+
+ +
+
+bool frictionalPressureLossConsidered() const
+
+ +
+
+Scalar getSegmentDp(const int seg, const Scalar density, const std::vector<Scalar> &seg_dp) const
+
+ +
+
+

Protected Attributes

+
+
+const WellInterfaceGeneric<Scalar> &baseif_
+
+ +
+
+ +
+
+template<class FluidSystem, class Indices>
class MultisegmentWellPrimaryVariables
+
+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using EvalWell = DenseAd::Evaluation<Scalar, Indices::numEq + numWellEq>
+
+ +
+
+using Equations = MultisegmentWellEquations<Scalar, numWellEq, Indices::numEq>
+
+ +
+
+using BVectorWell = typename Equations::BVectorWell
+
+ +
+
+

Public Functions

+
+
+inline explicit MultisegmentWellPrimaryVariables(const WellInterfaceIndices<FluidSystem, Indices> &well)
+
+ +
+
+void resize(const int numSegments)
+

Resize values and evaluations.

+
+ +
+
+void update(const WellState<Scalar> &well_state, const bool stop_or_zero_rate_target)
+

Copy values from well state.

+
+ +
+
+void updateNewton(const BVectorWell &dwells, const Scalar relaxation_factor, const Scalar DFLimit, const bool stop_or_zero_rate_target, const Scalar max_pressure_change)
+

Update values from newton update vector.

+
+ +
+
+void copyToWellState(const MultisegmentWellGeneric<Scalar> &mswell, const Scalar rho, WellState<Scalar> &well_state, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
+

Copy values to well state.

+
+ +
+
+EvalWell volumeFractionScaled(const int seg, const int compIdx) const
+

Returns scaled volume fraction for a component in a segment.

+

F_p / g_p, the basic usage of this value is because Q_p = G_t * F_p / G_p

+
+ +
+
+EvalWell surfaceVolumeFraction(const int seg, const int compIdx) const
+

Returns surface volume fraction for a component in a segment.

+

basically Q_p / \sigma_p Q_p

+
+ +
+
+EvalWell getSegmentRateUpwinding(const int seg, const int seg_upwind, const int comp_idx) const
+

Returns upwinding rate for a component in a segment.

+
+ +
+
+EvalWell getBhp() const
+

Get bottomhole pressure.

+
+ +
+
+EvalWell getSegmentPressure(const int seg) const
+

Get pressure for a segment.

+
+ +
+
+EvalWell getSegmentRate(const int seg, const int comp_idx) const
+

Get rate for a component in a segment.

+
+ +
+
+EvalWell getQs(const int comp_idx) const
+

Returns scaled rate for a component.

+
+ +
+
+EvalWell getWQTotal() const
+

Get WQTotal.

+
+ +
+
+inline const std::array<EvalWell, numWellEq> &eval(const int idx) const
+

Returns a const ref to an array of evaluations.

+
+ +
+
+inline const std::array<Scalar, numWellEq> &value(const int idx) const
+

Returns a value array.

+
+ +
+
+inline void setValue(const int idx, const std::array<Scalar, numWellEq> &val)
+

Set a value array. Note that this does not also set the corresponding evaluation.

+
+ +
+
+void outputLowLimitPressureSegments(DeferredLogger &deferred_logger) const
+

output the segments with pressure close to lower pressure limit for debugging purpose

+
+ +
+
+

Public Static Attributes

+
+
+static constexpr bool has_wfrac_variable = Indices::waterEnabled && Indices::oilEnabled
+
+ +
+
+static constexpr bool has_gfrac_variable = Indices::gasEnabled && Indices::numPhases > 1
+
+ +
+
+static constexpr int WQTotal = 0
+
+ +
+
+static constexpr int WFrac = has_wfrac_variable ? 1 : -1000
+
+ +
+
+static constexpr int GFrac = has_gfrac_variable ? has_wfrac_variable + 1 : -1000
+
+ +
+
+static constexpr int SPres = has_wfrac_variable + has_gfrac_variable + 1
+
+ +
+
+static constexpr int numWellEq = Indices::numPhases + 1
+
+ +
+
+

Private Functions

+
+
+void setEvaluationsFromValues()
+

Initialize evaluations from values.

+
+ +
+
+void processFractions(const int seg)
+

Handle non-reasonable fractions due to numerical overshoot.

+
+ +
+
+EvalWell volumeFraction(const int seg, const int compIdx) const
+

Returns volume fraction for component in a segment.

+
+ +
+
+

Private Members

+
+
+std::vector<std::array<Scalar, numWellEq>> value_
+

The values for the primary variables.

+

Based on different solution strategies, the wells can have different primary variables

+
+ +
+
+std::vector<std::array<EvalWell, numWellEq>> evaluation_
+

The Evaluation for the well primary variables.

+

Contains derivatives and are used in AD calculation

+
+ +
+
+const WellInterfaceIndices<FluidSystem, Indices> &well_
+

Reference to well interface.

+
+ +
+
+

Private Static Attributes

+
+
+static constexpr double bhp_lower_limit = 1. * unit::barsa - 1. * unit::Pascal
+
+ +
+
+static constexpr double seg_pres_lower_limit = 0.
+
+ +
+
+ +
+
+template<typename FluidSystem, typename Indices>
class MultisegmentWellSegments
+
+
+

Public Functions

+
+
+MultisegmentWellSegments(const int numSegments, const ParallelWellInfo<Scalar> &parallel_well_info, WellInterfaceGeneric<Scalar> &well)
+
+ +
+
+void computeFluidProperties(const EvalWell &temperature, const EvalWell &saltConcentration, const PrimaryVariables &primary_variables, int pvt_region_index, DeferredLogger &deferred_logger)
+
+ +
+
+void updateUpwindingSegments(const PrimaryVariables &primary_variables)
+

Update upwinding segments.

+
+ +
+
+EvalWell getHydroPressureLoss(const int seg, const int seg_side) const
+
+ +
+
+Scalar getPressureDiffSegLocalPerf(const int seg, const int local_perf_index) const
+

Pressure difference between segment and perforation.

+
+ +
+
+EvalWell getSurfaceVolume(const EvalWell &temperature, const EvalWell &saltConcentration, const PrimaryVariables &primary_variables, const int pvt_region_index, const int seg_idx) const
+
+ +
+
+EvalWell getFrictionPressureLoss(const int seg, const bool extra_reverse_flow_derivatives = false) const
+
+ +
+
+EvalWell pressureDropSpiralICD(const int seg, const bool extra_reverse_flow_derivatives = false) const
+
+ +
+
+EvalWell pressureDropAutoICD(const int seg, const UnitSystem &unit_system, const bool extra_reverse_flow_derivatives = false) const
+
+ +
+
+EvalWell pressureDropValve(const int seg, const SummaryState &st, const bool extra_reverse_flow_derivatives = false) const
+
+ +
+
+EvalWell accelerationPressureLossContribution(const int seg, const Scalar area, const bool extra_reverse_flow_derivatives = false) const
+
+ +
+
+inline const std::vector<std::vector<int>> &inlets() const
+
+ +
+
+inline const std::vector<int> &inlets(const int seg) const
+
+ +
+
+inline const std::vector<std::vector<int>> &perforations() const
+
+ +
+
+inline int upwinding_segment(const int seg) const
+
+ +
+
+inline Scalar getRefDensity() const
+
+ +
+
+inline const EvalWell &density(const int seg) const
+
+ +
+
+inline Scalar local_perforation_depth_diff(const int local_perf_index) const
+
+ +
+
+void copyPhaseDensities(const PhaseUsage &pu, SegmentState<Scalar> &segSol) const
+
+ +
+
+

Private Types

+
+
+using PrimaryVariables = MultisegmentWellPrimaryVariables<FluidSystem, Indices>
+
+ +
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using EvalWell = typename PrimaryVariables::EvalWell
+
+ +
+
+

Private Functions

+
+
+void copyPhaseDensities(const unsigned phaseIdx, const std::size_t stride, Scalar *dens) const
+
+ +
+
+Scalar mixtureDensity(const int seg) const
+
+ +
+
+Scalar mixtureDensityWithExponents(const int seg) const
+
+ +
+
+Scalar mixtureDensityWithExponents(const AutoICD &aicd, const int seg) const
+
+ +
+
+

Private Members

+
+
+std::vector<std::vector<int>> perforations_
+
+ +
+
+std::vector<Scalar> local_perforation_depth_diffs_
+
+ +
+
+std::vector<std::vector<int>> inlets_
+
+ +
+
+std::vector<Scalar> depth_diffs_
+
+ +
+
+std::vector<EvalWell> densities_
+
+ +
+
+std::vector<EvalWell> mass_rates_
+
+ +
+
+std::vector<EvalWell> viscosities_
+
+ +
+
+std::vector<int> upwinding_segments_
+
+ +
+
+std::vector<std::vector<EvalWell>> phase_densities_
+
+ +
+
+std::vector<std::vector<EvalWell>> phase_fractions_
+
+ +
+
+std::vector<std::vector<EvalWell>> phase_viscosities_
+
+ +
+
+WellInterfaceGeneric<Scalar> &well_
+
+ +
+
+ +
+
+template<class M, class X, class Y>
class MultithreadDILU : public Dune::PreconditionerWithUpdate<X, Y>
+
+#include <DILU.hpp>
+

The OpenMP thread parallelized DILU preconditioner.

+

Safe to run serially without OpenMP. When run in parallel the matrix is assumed to be symmetric.

+
+
Template Parameters:
+
    +
  • M – The matrix type to operate on

  • +
  • X – Type of the update

  • +
  • Y – Type of the defect

  • +
+
+
+
+

Public Types

+
+
+using matrix_type = M
+

The matrix type the preconditioner is for.

+
+ +
+
+using domain_type = X
+

The domain type of the preconditioner.

+
+ +
+
+using range_type = Y
+

The range type of the preconditioner.

+
+ +
+
+using field_type = typename X::field_type
+

The field type of the preconditioner.

+
+ +
+
+

Public Functions

+
+
+inline explicit MultithreadDILU(const M &A)
+

scalar type underlying the field_type

+

Constructor gets all parameters to operate the prec.

+
+
Parameters:
+

A – The matrix to operate on.

+
+
+
+ +
+
+inline virtual void update() override
+

Update the preconditioner.

+
+ +
+
+inline void pre(X &v, Y &d) override
+

Prepare the preconditioner.

+
+ +
+
+inline void apply(X &v, const Y &d) override
+

Apply the preconditioner.

+
+ +
+
+inline void post(X &x) override
+

Clean up.

+
+ +
+
+inline std::vector<typename M::block_type> getDiagonal()
+
+ +
+
+inline virtual SolverCategory::Category category() const override
+

Category of the preconditioner (see SolverCategory::Category)

+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Private Functions

+
+
+inline void serialUpdate()
+
+ +
+
+inline void parallelUpdate()
+
+ +
+
+inline void serialApply(X &v, const Y &d)
+
+ +
+
+inline void parallelApply(X &v, const Y &d)
+
+ +
+
+

Private Members

+
+
+const M &A_
+

The matrix we operate on.

+
+ +
+
+std::optional<M> A_reordered_
+

Copy of A_ that is reordered to store rows that can be computed simultaneously next to each other to increase cache usage when multithreading.

+
+ +
+
+std::vector<typename M::block_type> Dinv_
+

The inverse of the diagnal matrix.

+
+ +
+
+Opm::SparseTable<std::size_t> level_sets_
+

SparseTable storing each row by level.

+
+ +
+
+std::vector<std::size_t> reordered_to_natural_
+

converts from index in reordered structure to index natural ordered structure

+
+ +
+
+std::vector<std::size_t> natural_to_reorder_
+

converts from index in natural ordered structure to index reordered strucutre

+
+ +
+
+bool use_multithreading = {false}
+

Boolean value describing whether or not to use multithreaded version of functions.

+
+ +
+
+ +
+
+struct NetworkMaxOuterIterations
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 10
+
+ +
+
+ +
+
+template<class Scalar>
struct NetworkMaxPressureUpdateInBars
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 5.0
+
+ +
+
+ +
+
+struct NetworkMaxStrictOuterIterations
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 10
+
+ +
+
+ +
+
+struct NetworkMaxSubIterations
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 20
+
+ +
+
+ +
+
+template<class Scalar>
struct NetworkPressureUpdateDampingFactor
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.1
+
+ +
+
+ +
+
+template<class Scalar>
struct NewtonMaxError
+
+

The maximum error which may occur in a simulation before the Newton method for the time step is aborted

+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e100
+
+ +
+
+ +
+
+struct NewtonMaxIterations
+
+

Number of maximum iterations for the Newton method.

+
+

Public Static Attributes

+
+
+static constexpr int value = 20
+
+ +
+
+ +
+
+template<class Scalar>
struct NewtonMaxRelax
+
+#include <NonlinearSolver.hpp>
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.5
+
+ +
+
+ +
+
+template<class Scalar>
struct NewtonMethodParams
+
+

Struct holding the parameters for NewtonMethod.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool verbose_
+
+ +
+
+bool writeConvergence_
+
+ +
+
+int targetIterations_
+

Optimal number of iterations we want to achieve.

+
+ +
+
+int maxIterations_
+

Maximum number of iterations we do before giving up.

+
+ +
+
+Scalar tolerance_
+
+ +
+
+Scalar maxError_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+struct NewtonMinIterations
+
+#include <NonlinearSolver.hpp>
+
+

Public Static Attributes

+
+
+static constexpr int value = 2
+
+ +
+
+ +
+
+struct NewtonRelaxationType
+
+#include <NonlinearSolver.hpp>
+
+

Public Static Attributes

+
+
+static constexpr auto value = "dampen"
+
+ +
+
+ +
+
+struct NewtonTargetIterations
+
+

The number of iterations at which the Newton method should aim at.

+

This is used to control the time-step size. The heuristic used is to scale the last time-step size by the deviation of the number of iterations used from the target steps.

+
+

Public Static Attributes

+
+
+static constexpr int value = 10
+
+ +
+
+ +
+
+template<class Scalar>
struct NewtonTolerance
+
+

The value for the error below which convergence is declared.

+

This value can (and for the porous media models will) be changed to account for grid scaling and other effects.

+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-8
+
+ +
+
+ +
+
+struct NewtonVerbose
+
+

Specifies whether the Newton method should print messages or not.

+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct NewtonWriteConvergence
+
+

Specifies whether the convergence rate and the global residual gets written out to disk for every Newton iteration

+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class TypeTag>
class NewTranBaseProblem
+
+

Provides the defaults for the parameters required by the transmissibility based volume flux calculation.

+
+ +
+
+template<class TypeTag>
class NewTranExtensiveQuantities
+
+

Provides the ECL flux module.

+
+

Public Functions

+
+
+inline const DimMatrix &intrinsicPermeability() const
+

Return the intrinsic permeability tensor at a face [m^2].

+
+ +
+
+inline const EvalDimVector &potentialGrad(unsigned) const
+

Return the pressure potential gradient of a fluid phase at the face’s integration point [Pa/m].

+
+
Parameters:
+

phaseIdx – The index of the fluid phase

+
+
+
+ +
+
+inline const Evaluation &pressureDifference(unsigned phaseIdx) const
+

Return the gravity corrected pressure difference between the interior and the exterior of a face.

+
+
Parameters:
+

phaseIdx – The index of the fluid phase

+
+
+
+ +
+
+inline const EvalDimVector &filterVelocity(unsigned) const
+

Return the filter velocity of a fluid phase at the face’s integration point [m/s].

+
+
Parameters:
+

phaseIdx – The index of the fluid phase

+
+
+
+ +
+
+inline const Evaluation &volumeFlux(unsigned phaseIdx) const
+

Return the volume flux of a fluid phase at the face’s integration point \([m^3/s / m^2]\).

+

This is the fluid volume of a phase per second and per square meter of face area.

+
+
Parameters:
+

phaseIdx – The index of the fluid phase

+
+
+
+ +
+
+

Public Static Functions

+
+
+static inline void volumeAndPhasePressureDifferences(std::array<short, numPhases> &upIdx, std::array<short, numPhases> &dnIdx, Evaluation (&volumeFlux)[numPhases], Evaluation (&pressureDifferences)[numPhases], const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
+
+ +
+
+template<class EvalType>
static inline void calculatePhasePressureDiff_(short &upIdx, short &dnIdx, EvalType &pressureDifference, const IntensiveQuantities &intQuantsIn, const IntensiveQuantities &intQuantsEx, const unsigned phaseIdx, const unsigned interiorDofIdx, const unsigned exteriorDofIdx, const Scalar Vin, const Scalar Vex, const unsigned globalIndexIn, const unsigned globalIndexEx, const Scalar distZg, const Scalar thpres, const ModuleParams &moduleParams)
+
+ +
+
+template<class Problem, class FluidState, class EvaluationContainer>
static inline void calculateBoundaryGradients_(const Problem &problem, const unsigned globalSpaceIdx, const IntensiveQuantities &intQuantsIn, const unsigned bfIdx, const double faceArea, const double zEx, const FluidState &exFluidState, std::array<short, numPhases> &upIdx, std::array<short, numPhases> &dnIdx, EvaluationContainer &volumeFlux, EvaluationContainer &pressureDifference)
+

Update the required gradients for boundary faces.

+
+ +
+
+

Protected Functions

+
+
+inline unsigned upstreamIndex_(unsigned phaseIdx) const
+

Returns the local index of the degree of freedom in which is in upstream direction.

+

i.e., the DOF which exhibits a higher effective pressure for the given phase.

+
+ +
+
+inline unsigned downstreamIndex_(unsigned phaseIdx) const
+

Returns the local index of the degree of freedom in which is in downstream direction.

+

i.e., the DOF which exhibits a lower effective pressure for the given phase.

+
+ +
+
+inline void updateSolvent(const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
+
+ +
+
+inline void updatePolymer(const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
+
+ +
+
+inline void calculateGradients_(const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx)
+

Update the required gradients for interior faces.

+
+ +
+
+template<class FluidState>
inline void calculateBoundaryGradients_(const ElementContext &elemCtx, unsigned scvfIdx, unsigned timeIdx, const FluidState &exFluidState)
+

Update the required gradients for boundary faces.

+
+ +
+
+inline void calculateFluxes_(const ElementContext&, unsigned, unsigned)
+

Update the volumetric fluxes for all fluid phases on the interior faces of the context.

+
+ +
+
+inline void calculateBoundaryFluxes_(const ElementContext&, unsigned, unsigned)
+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator dimWorld
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator gasPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableSolvent
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableExtbo
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableEnergy
+
+ +
+ +
+
+using Implementation = GetPropType<TypeTag, Properties::ExtensiveQuantities>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using Toolbox = MathToolbox<Evaluation>
+
+ +
+
+using DimVector = Dune::FieldVector<Scalar, dimWorld>
+
+ +
+
+using EvalDimVector = Dune::FieldVector<Evaluation, dimWorld>
+
+ +
+
+using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>
+
+ +
+
+using ConvectiveMixingModule = BlackOilConvectiveMixingModule<TypeTag, enableConvectiveMixing>
+
+ +
+
+using ModuleParams = typename BlackOilLocalResidualTPFA<TypeTag>::ModuleParams
+
+ +
+
+

Private Functions

+
+
+inline Implementation &asImp_()
+
+ +
+
+inline const Implementation &asImp_() const
+
+ +
+
+

Private Members

+
+
+Evaluation volumeFlux_[numPhases]
+
+ +
+
+Evaluation pressureDifference_[numPhases]
+
+ +
+
+std::array<short, numPhases> upIdx_
+
+ +
+
+std::array<short, numPhases> dnIdx_
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr bool enableConvectiveMixing = getPropValue<TypeTag, Properties::EnableConvectiveMixing>()
+
+ +
+
+ +
+
+template<class TypeTag>
struct NewTranFluxModule
+
+

Specifies a flux module which uses ECL transmissibilities.

+
+

Public Types

+
+
+using FluxIntensiveQuantities = NewTranIntensiveQuantities<TypeTag>
+
+ +
+
+using FluxExtensiveQuantities = NewTranExtensiveQuantities<TypeTag>
+
+ +
+
+using FluxBaseProblem = NewTranBaseProblem<TypeTag>
+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the flux module.

+
+ +
+
+ +
+
+template<class TypeTag>
class NewTranIntensiveQuantities
+
+

Provides the intensive quantities for the ECL flux module.

+
+

Protected Functions

+
+
+inline void update_(const ElementContext&, unsigned, unsigned)
+
+ +
+
+

Private Types

+
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+ +
+
+struct NlddLocalLinearSolver
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "ilu0"
+
+ +
+
+ +
+
+struct NlddLocalLinearSolverMaxIter
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 200
+
+ +
+
+ +
+
+struct NlddLocalLinearSolverReduction
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 1e-2
+
+ +
+
+ +
+
+struct NlddNumInitialNewtonIter
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 1
+
+ +
+
+ +
+
+template<class Scalar>
class NoMixing : public Opm::EQUIL::Miscibility::RsFunction<Scalar>
+
+

Type that implements “no phase mixing” policy.

+
+

Public Functions

+
+
+inline virtual Scalar operator()(const Scalar, const Scalar, const Scalar, const Scalar = 0.0) const override
+

Function call.

+
+
Parameters:
+
    +
  • depth[in] Depth at which to calculate RS value.

  • +
  • press[in] Pressure at which to calculate RS value.

  • +
  • temp[in] Temperature at which to calculate RS value.

  • +
+
+
Returns:
+

Dissolved gas-oil ratio (RS) at depth depth and pressure press

. In “no mixing

+

policy”, this is identically zero.

+

+
+
+
+ +
+
+ +
+
+template<class TypeTag, class PhysicalModel>
class NonlinearSolver
+
+#include <NonlinearSolver.hpp>
+

A nonlinear solver class suitable for general fully-implicit models, as well as pressure, transport and sequential models.

+
+

Public Types

+
+
+using SolverParameters = NonlinearSolverParameters<Scalar>
+
+ +
+
+

Public Functions

+
+
+inline NonlinearSolver(const SolverParameters &param, std::unique_ptr<PhysicalModel> model)
+

Construct solver for a given model.

+

The model is a std::unique_ptr because the object to which model points to is not allowed to be deleted as long as the NonlinearSolver object exists.

+
+
Parameters:
+
    +
  • param[in] parameters controlling nonlinear process

  • +
  • model[inout] physical simulation model.

  • +
+
+
+
+ +
+
+inline SimulatorReportSingle step(const SimulatorTimerInterface &timer, const TimeStepControlInterface *timeStepControl)
+
+ +
+
+inline const SimulatorReportSingle &failureReport() const
+

return the statistics if the step() method failed

+
+ +
+
+inline int linearizations() const
+

Number of linearizations used in all calls to step().

+
+ +
+
+inline int nonlinearIterations() const
+

Number of full nonlinear solver iterations used in all calls to step().

+
+ +
+
+inline int linearIterations() const
+

Number of linear solver iterations used in all calls to step().

+
+ +
+
+inline int wellIterations() const
+

Number of well iterations used in all calls to step().

+
+ +
+
+inline int nonlinearIterationsLastStep() const
+

Number of nonlinear solver iterations used in the last call to step().

+
+ +
+
+inline int linearIterationsLastStep() const
+

Number of linear solver iterations used in the last call to step().

+
+ +
+
+inline int wellIterationsLastStep() const
+

Number of well iterations used in all calls to step().

+
+ +
+
+inline std::vector<std::vector<Scalar>> computeFluidInPlace(const std::vector<int> &fipnum) const
+
+ +
+
+inline const PhysicalModel &model() const
+

Reference to physical model.

+
+ +
+
+inline PhysicalModel &model()
+

Mutable reference to physical model.

+
+ +
+
+inline void detectOscillations(const std::vector<std::vector<Scalar>> &residualHistory, const int it, bool &oscillate, bool &stagnate) const
+

Detect oscillation or stagnation in a given residual history.

+
+ +
+
+template<class BVector>
inline void stabilizeNonlinearUpdate(BVector &dx, BVector &dxOld, const Scalar omega) const
+

Apply a stabilization to dx, depending on dxOld and relaxation parameters. Implemention for Dune block vectors.

+
+ +
+
+inline Scalar relaxMax() const
+

The greatest relaxation factor (i.e. smallest factor) allowed.

+
+ +
+
+inline Scalar relaxIncrement() const
+

The step-change size for the relaxation factor.

+
+ +
+
+inline NonlinearRelaxType relaxType() const
+

The relaxation type (Dampen or SOR).

+
+ +
+
+inline Scalar relaxRelTol() const
+

The relaxation relative tolerance.

+
+ +
+
+inline int maxIter() const
+

The maximum number of nonlinear iterations allowed.

+
+ +
+
+inline int minIter() const
+

The minimum number of nonlinear iterations allowed.

+
+ +
+
+inline void setParameters(const SolverParameters &param)
+

Set parameters to override those given at construction time.

+
+ +
+
+

Private Types

+
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+

Private Members

+
+
+SimulatorReportSingle failureReport_
+
+ +
+
+SolverParameters param_
+
+ +
+
+std::unique_ptr<PhysicalModel> model_
+
+ +
+
+int linearizations_
+
+ +
+
+int nonlinearIterations_
+
+ +
+
+int linearIterations_
+
+ +
+
+int wellIterations_
+
+ +
+
+int nonlinearIterationsLast_
+
+ +
+
+int linearIterationsLast_
+
+ +
+
+int wellIterationsLast_
+
+ +
+
+ +
+
+struct NonlinearSolver
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "newton"
+
+ +
+
+ +
+
+template<class Scalar>
struct NonlinearSolverParameters
+
+#include <NonlinearSolver.hpp>
+
+

Public Functions

+
+
+NonlinearSolverParameters()
+
+ +
+
+void reset()
+
+ +
+
+

Public Members

+
+
+NonlinearRelaxType relaxType_
+
+ +
+
+Scalar relaxMax_
+
+ +
+
+Scalar relaxIncrement_
+
+ +
+
+Scalar relaxRelTol_
+
+ +
+
+int maxIter_
+
+ +
+
+int minIter_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+
+ +
+
+ +
+
+template<class TypeTag, class MyTypeTag>
struct NonlinearSystem
+
+
+

Public Types

+
+
+using type = UndefinedProperty
+
+ +
+
+ +
+
+template<class TypeTag>
struct NonlinearSystem<TypeTag, TTag::FlowBaseProblemBlackoil>
+
+
+

Public Types

+
+
+using type = BlackoilModel<TypeTag>
+
+ +
+
+ +
+
+struct NoReorderer : public Opm::detail::Reorderer
+
+#include <MILU.hpp>
+
+

Public Functions

+
+
+inline virtual std::size_t operator[](std::size_t i) const override
+
+ +
+
+ +
+
+struct NumLocalDomains
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 0
+
+ +
+
+ +
+
+struct NumOverlap
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 1
+
+ +
+
+ +
+
+struct NumPressurePointsEquil
+
+
+

Public Static Attributes

+
+
+static constexpr int value = ParserKeywords::EQLDIMS::DEPTH_NODES_P::defaultValue
+
+ +
+
+ +
+
+struct NumSatfuncConsistencySamplePoints
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 5
+
+ +
+
+ +
+
+template<class Scalar>
struct NupcolGroupRateTolerance
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.001
+
+ +
+
+ +
+
+template<class FluidSystem, class RS>
class Oil
+
+#include <InitStateEquil.hpp>
+
+

Public Functions

+
+
+Oil(const TabulatedFunction &tempVdTable, const RS &rs, const int pvtRegionIdx, const Scalar normGrav)
+
+ +
+
+Scalar operator()(const Scalar depth, const Scalar press) const
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+

Private Functions

+
+
+Scalar density(const Scalar depth, const Scalar press) const
+
+ +
+
+

Private Members

+
+
+const TabulatedFunction &tempVdTable_
+
+ +
+
+const RS &rs_
+
+ +
+
+const int pvtRegionIdx_
+
+ +
+
+const Scalar g_
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class openclBILU0 : public Opm::Accelerator::openclPreconditioner<Scalar, block_size>
+
+#include <openclBILU0.hpp>
+

This class implements a Blocked ILU0 preconditioner The decomposition is done on GPU, using exact decomposition, or ChowPatel decomposition The preconditioner is applied via two exact triangular solves

+
+

Public Functions

+
+
+openclBILU0(bool opencl_ilu_parallel, int verbosity)
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat) override
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) override
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat) override
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) override
+
+ +
+
+virtual void apply(const cl::Buffer &y, cl::Buffer &x) override
+
+ +
+
+inline std::tuple<std::vector<int>, std::vector<int>, std::vector<int>> get_preconditioner_structure()
+
+ +
+
+inline std::pair<cl::Buffer, cl::Buffer> get_preconditioner_data()
+
+ +
+
+

Private Types

+
+
+using Base = openclPreconditioner<Scalar, block_size>
+
+ +
+
+

Private Members

+
+
+std::unique_ptr<BlockedMatrix<Scalar>> LUmat = {}
+
+ +
+
+std::vector<Scalar> invDiagVals
+
+ +
+
+std::vector<int> diagIndex
+
+ +
+
+std::vector<int> rowsPerColor
+
+ +
+
+std::vector<int> rowsPerColorPrefix
+
+ +
+
+std::vector<int> toOrder
+
+ +
+
+std::vector<int> fromOrder
+
+ +
+
+int numColors
+
+ +
+
+std::once_flag pattern_uploaded
+
+ +
+
+bool opencl_ilu_parallel
+
+ +
+
+GPU_storage s
+
+ +
+
+std::shared_ptr<cl::Context> context
+
+ +
+
+std::shared_ptr<cl::CommandQueue> queue
+
+ +
+
+std::vector<cl::Event> events
+
+ +
+
+cl_int err
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class openclBISAI : public Opm::Accelerator::openclPreconditioner<Scalar, block_size>
+
+#include <openclBISAI.hpp>
+

This class implements a Blocked version of the Incomplete Sparse Approximate Inverse (ISAI) preconditioner. Inspired by the paper “Incomplete Sparse Approximate Inverses for Parallel Preconditioning” by Anzt et. al.

+
+

Public Functions

+
+
+openclBISAI(bool opencl_ilu_parallel, int verbosity)
+
+ +
+
+virtual void setOpencl(std::shared_ptr<cl::Context> &context, std::shared_ptr<cl::CommandQueue> &queue) override
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat) override
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) override
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat) override
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) override
+
+ +
+
+virtual void apply(const cl::Buffer &y, cl::Buffer &x) override
+
+ +
+
+

Private Types

+
+
+using Base = openclPreconditioner<Scalar, block_size>
+
+ +
+
+

Private Functions

+
+
+void buildLowerSubsystemsStructures()
+

An approximate inverse for L is computed by solving a small lower triangular system for each column of the main matrix. This function finds the structure of each of these subsystems and fills the ‘lower’ struct.

+
+ +
+
+void buildUpperSubsystemsStructures()
+

An approximate inverse for U is computed by solving a small upper triangular system for each column of the main matrix. This function finds the structure of each of theses subsystems and fills the ‘upper’ struct.

+
+ +
+
+

Private Members

+
+
+std::once_flag initialize
+
+ +
+
+std::vector<int> colPointers
+
+ +
+
+std::vector<int> rowIndices
+
+ +
+
+std::vector<int> diagIndex
+
+ +
+
+std::vector<int> csrToCscOffsetMap
+
+ +
+
+std::vector<Scalar> invLvals
+
+ +
+
+std::vector<Scalar> invUvals
+
+ +
+
+cl::Buffer d_colPointers
+
+ +
+
+cl::Buffer d_rowIndices
+
+ +
+
+cl::Buffer d_csrToCscOffsetMap
+
+ +
+
+cl::Buffer d_diagIndex
+
+ +
+
+cl::Buffer d_LUvals
+
+ +
+
+cl::Buffer d_invDiagVals
+
+ +
+
+cl::Buffer d_invLvals
+
+ +
+
+cl::Buffer d_invUvals
+
+ +
+
+cl::Buffer d_invL_x
+
+ +
+
+bool opencl_ilu_parallel
+
+ +
+
+std::unique_ptr<openclBILU0<Scalar, block_size>> bilu0
+
+ +
+
+subsystemStructure lower
+
+ +
+
+subsystemStructure upper
+
+ +
+
+subsystemStructureGPU d_lower
+
+ +
+
+subsystemStructureGPU d_upper
+
+ +
+
+std::shared_ptr<cl::Context> context
+
+ +
+
+std::shared_ptr<cl::CommandQueue> queue
+
+ +
+
+std::vector<cl::Event> events
+
+ +
+
+cl_int err
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class openclCPR : public Opm::Accelerator::openclPreconditioner<Scalar, block_size>, public Opm::Accelerator::CprCreation<Scalar, block_size>
+
+#include <openclCPR.hpp>
+

This class implements a Constrained Pressure Residual (CPR) preconditioner.

+
+

Public Functions

+
+
+openclCPR(bool opencl_ilu_parallel, int verbosity)
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat) override
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) override
+
+ +
+
+virtual void setOpencl(std::shared_ptr<cl::Context> &context, std::shared_ptr<cl::CommandQueue> &queue) override
+
+ +
+
+virtual void apply(const cl::Buffer &y, cl::Buffer &x) override
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat) override
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) override
+
+ +
+
+

Private Types

+
+
+using Base = openclPreconditioner<Scalar, block_size>
+
+ +
+
+

Private Functions

+
+
+void init_opencl_buffers()
+
+ +
+
+void opencl_upload()
+
+ +
+
+void apply_amg(const cl::Buffer &y, cl::Buffer &x)
+
+ +
+
+void amg_cycle_gpu(const int level, cl::Buffer &y, cl::Buffer &x)
+
+ +
+
+

Private Members

+
+
+std::vector<OpenclMatrix<Scalar>> d_Amatrices
+
+ +
+
+std::vector<OpenclMatrix<Scalar>> d_Rmatrices
+
+ +
+
+std::vector<cl::Buffer> d_PcolIndices
+
+ +
+
+std::vector<cl::Buffer> d_invDiags
+
+ +
+
+std::vector<cl::Buffer> d_t
+
+ +
+
+std::vector<cl::Buffer> d_f
+
+ +
+
+std::vector<cl::Buffer> d_u
+
+ +
+
+std::unique_ptr<cl::Buffer> d_rs
+
+ +
+
+std::unique_ptr<cl::Buffer> d_weights
+
+ +
+
+std::unique_ptr<OpenclMatrix<Scalar>> d_mat
+
+ +
+
+std::unique_ptr<cl::Buffer> d_coarse_y
+
+ +
+
+std::unique_ptr<cl::Buffer> d_coarse_x
+
+ +
+
+std::once_flag opencl_buffers_allocated
+
+ +
+
+std::unique_ptr<openclBILU0<Scalar, block_size>> bilu0
+
+ +
+
+std::unique_ptr<openclSolverBackend<Scalar, 1>> coarse_solver
+
+ +
+
+bool opencl_ilu_parallel
+
+ +
+
+std::shared_ptr<cl::Context> context
+
+ +
+
+std::shared_ptr<cl::CommandQueue> queue
+
+ +
+
+std::vector<cl::Event> events
+
+ +
+
+cl_int err
+
+ +
+
+ +
+
+struct OpenclIluParallel
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class Scalar>
class OpenclKernels
+
+#include <openclKernels.hpp>
+
+

Public Static Functions

+
+
+static void init(cl::Context *context, cl::CommandQueue *queue, std::vector<cl::Device> &devices, int verbosity)
+
+ +
+
+static Scalar dot(cl::Buffer &in1, cl::Buffer &in2, cl::Buffer &out, int N)
+
+ +
+
+static Scalar norm(cl::Buffer &in, cl::Buffer &out, int N)
+
+ +
+
+static void axpy(cl::Buffer &in, const Scalar a, cl::Buffer &out, int N)
+
+ +
+
+static void scale(cl::Buffer &in, const Scalar a, int N)
+
+ +
+
+static void vmul(const Scalar alpha, cl::Buffer &in1, cl::Buffer &in2, cl::Buffer &out, int N)
+
+ +
+
+static void custom(cl::Buffer &p, cl::Buffer &v, cl::Buffer &r, const Scalar omega, const Scalar beta, int N)
+
+ +
+
+static void full_to_pressure_restriction(const cl::Buffer &fine_y, cl::Buffer &weights, cl::Buffer &coarse_y, int Nb)
+
+ +
+
+static void add_coarse_pressure_correction(cl::Buffer &coarse_x, cl::Buffer &fine_x, int pressure_idx, int Nb)
+
+ +
+
+static void prolongate_vector(const cl::Buffer &in, cl::Buffer &out, const cl::Buffer &cols, int N)
+
+ +
+
+static void spmv(cl::Buffer &vals, cl::Buffer &cols, cl::Buffer &rows, const cl::Buffer &x, cl::Buffer &b, int Nb, unsigned int block_size, bool reset = true, bool add = false)
+
+ +
+
+static void residual(cl::Buffer &vals, cl::Buffer &cols, cl::Buffer &rows, cl::Buffer &x, const cl::Buffer &rhs, cl::Buffer &out, int Nb, unsigned int block_size)
+
+ +
+
+static void ILU_apply1(cl::Buffer &rowIndices, cl::Buffer &vals, cl::Buffer &cols, cl::Buffer &rows, cl::Buffer &diagIndex, const cl::Buffer &y, cl::Buffer &x, cl::Buffer &rowsPerColor, int color, int Nb, unsigned int block_size)
+
+ +
+
+static void ILU_apply2(cl::Buffer &rowIndices, cl::Buffer &vals, cl::Buffer &cols, cl::Buffer &rows, cl::Buffer &diagIndex, cl::Buffer &invDiagVals, cl::Buffer &x, cl::Buffer &rowsPerColor, int color, int Nb, unsigned int block_size)
+
+ +
+
+static void ILU_decomp(int firstRow, int lastRow, cl::Buffer &rowIndices, cl::Buffer &vals, cl::Buffer &cols, cl::Buffer &rows, cl::Buffer &diagIndex, cl::Buffer &invDiagVals, int Nb, unsigned int block_size)
+
+ +
+
+static void apply_stdwells(cl::Buffer &d_Cnnzs_ocl, cl::Buffer &d_Dnnzs_ocl, cl::Buffer &d_Bnnzs_ocl, cl::Buffer &d_Ccols_ocl, cl::Buffer &d_Bcols_ocl, cl::Buffer &d_x, cl::Buffer &d_y, int dim, int dim_wells, cl::Buffer &d_val_pointers_ocl, int num_std_wells)
+
+ +
+
+static void isaiL(cl::Buffer &diagIndex, cl::Buffer &colPointers, cl::Buffer &mapping, cl::Buffer &nvc, cl::Buffer &luIdxs, cl::Buffer &xxIdxs, cl::Buffer &dxIdxs, cl::Buffer &LUvals, cl::Buffer &invLvals, unsigned int Nb)
+
+ +
+
+static void isaiU(cl::Buffer &diagIndex, cl::Buffer &colPointers, cl::Buffer &rowIndices, cl::Buffer &mapping, cl::Buffer &nvc, cl::Buffer &luIdxs, cl::Buffer &xxIdxs, cl::Buffer &dxIdxs, cl::Buffer &LUvals, cl::Buffer &invDiagVals, cl::Buffer &invUvals, unsigned int Nb)
+
+ +
+
+

Public Static Attributes

+
+
+static const std::string axpy_str
+
+ +
+
+static const std::string scale_str
+
+ +
+
+static const std::string vmul_str
+
+ +
+
+static const std::string dot_1_str
+
+ +
+
+static const std::string norm_str
+
+ +
+
+static const std::string custom_str
+
+ +
+
+static const std::string full_to_pressure_restriction_str
+
+ +
+
+static const std::string add_coarse_pressure_correction_str
+
+ +
+
+static const std::string prolongate_vector_str
+
+ +
+
+static const std::string spmv_blocked_str
+
+ +
+
+static const std::string spmv_blocked_add_str
+
+ +
+
+static const std::string spmv_str
+
+ +
+
+static const std::string spmv_noreset_str
+
+ +
+
+static const std::string residual_blocked_str
+
+ +
+
+static const std::string residual_str
+
+ +
+
+static const std::string ILU_apply1_fm_str
+
+ +
+
+static const std::string ILU_apply2_fm_str
+
+ +
+
+static const std::string stdwell_apply_str
+
+ +
+
+static const std::string ILU_decomp_str
+
+ +
+
+static const std::string isaiL_str
+
+ +
+
+static const std::string isaiU_str
+
+ +
+
+

Private Functions

+
+
+inline OpenclKernels()
+
+ +
+
+

Private Static Attributes

+
+
+static int verbosity
+
+ +
+
+static cl::CommandQueue *queue
+
+ +
+
+static std::vector<Scalar> tmp
+
+ +
+
+static bool initialized = false
+
+ +
+
+static std::size_t preferred_workgroup_size_multiple = 0
+
+ +
+
+static std::unique_ptr<cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int, cl::LocalSpaceArg>> dot_k
+
+ +
+
+static std::unique_ptr<cl::KernelFunctor<cl::Buffer&, cl::Buffer&, const unsigned int, cl::LocalSpaceArg>> norm_k
+
+ +
+
+static std::unique_ptr<cl::KernelFunctor<cl::Buffer&, const Scalar, cl::Buffer&, const unsigned int>> axpy_k
+
+ +
+
+static std::unique_ptr<cl::KernelFunctor<cl::Buffer&, const Scalar, const unsigned int>> scale_k
+
+ +
+
+static std::unique_ptr<cl::KernelFunctor<const Scalar, cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int>> vmul_k
+
+ +
+
+static std::unique_ptr<cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, const Scalar, const Scalar, const unsigned int>> custom_k
+
+ +
+
+static std::unique_ptr<cl::KernelFunctor<const cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int>> full_to_pressure_restriction_k
+
+ +
+
+static std::unique_ptr<cl::KernelFunctor<cl::Buffer&, cl::Buffer&, const unsigned int, const unsigned int>> add_coarse_pressure_correction_k
+
+ +
+
+static std::unique_ptr<cl::KernelFunctor<const cl::Buffer&, cl::Buffer&, const cl::Buffer&, const unsigned int>> prolongate_vector_k
+
+ +
+
+static std::unique_ptr<spmv_blocked_kernel_type> spmv_blocked_k
+
+ +
+
+static std::unique_ptr<spmv_blocked_kernel_type> spmv_blocked_add_k
+
+ +
+
+static std::unique_ptr<spmv_kernel_type> spmv_k
+
+ +
+
+static std::unique_ptr<spmv_kernel_type> spmv_noreset_k
+
+ +
+
+static std::unique_ptr<residual_blocked_kernel_type> residual_blocked_k
+
+ +
+
+static std::unique_ptr<residual_kernel_type> residual_k
+
+ +
+
+static std::unique_ptr<ilu_apply1_kernel_type> ILU_apply1_k
+
+ +
+
+static std::unique_ptr<ilu_apply2_kernel_type> ILU_apply2_k
+
+ +
+
+static std::unique_ptr<stdwell_apply_kernel_type> stdwell_apply_k
+
+ +
+
+static std::unique_ptr<ilu_decomp_kernel_type> ilu_decomp_k
+
+ +
+
+static std::unique_ptr<isaiL_kernel_type> isaiL_k
+
+ +
+
+static std::unique_ptr<isaiU_kernel_type> isaiU_k
+
+ +
+
+ +
+
+template<class Scalar>
class OpenclMatrix
+
+#include <OpenclMatrix.hpp>
+

This struct resembles a csr matrix, only doubles are supported The matrix data is stored in OpenCL Buffers

+
+

Public Functions

+
+
+inline OpenclMatrix(cl::Context *context, int Nb_, int Mb_, int nnzbs_, unsigned int block_size_)
+
+ +
+
+void upload(cl::CommandQueue *queue, Scalar *vals, int *cols, int *rows)
+
+ +
+
+void upload(cl::CommandQueue *queue, Matrix<Scalar> *matrix)
+
+ +
+
+void upload(cl::CommandQueue *queue, BlockedMatrix<Scalar> *matrix)
+
+ +
+
+

Public Members

+
+
+cl::Buffer nnzValues
+
+ +
+
+cl::Buffer colIndices
+
+ +
+
+cl::Buffer rowPointers
+
+ +
+
+int Nb
+
+ +
+
+int Mb
+
+ +
+
+int nnzbs
+
+ +
+
+unsigned int block_size
+
+ +
+
+ +
+
+struct OpenclPlatformId
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 0
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class openclPreconditioner : public Opm::Accelerator::Preconditioner<Scalar, block_size, cl::Buffer>
+
+

Subclassed by Opm::Accelerator::openclBILU0< Scalar, block_size >, Opm::Accelerator::openclBISAI< Scalar, block_size >, Opm::Accelerator::openclCPR< Scalar, block_size >

+
+

Public Functions

+
+
+virtual void setOpencl(std::shared_ptr<cl::Context> &context, std::shared_ptr<cl::CommandQueue> &queue)
+
+ +
+
+

Public Static Functions

+
+
+static std::unique_ptr<openclPreconditioner<Scalar, block_size>> create(PreconditionerType type, int verbosity, bool opencl_ilu_parallel)
+
+ +
+
+

Protected Functions

+
+
+inline openclPreconditioner(int verbosity_)
+
+ +
+
+

Protected Attributes

+
+
+std::shared_ptr<cl::Context> context
+
+ +
+
+std::shared_ptr<cl::CommandQueue> queue
+
+ +
+
+std::vector<cl::Event> events
+
+ +
+
+cl_int err
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class openclSolverBackend : public Opm::Accelerator::GpuSolver<Scalar, block_size>
+
+

This class implements a opencl-based ilu0-bicgstab solver on GPU.

+
+

Public Functions

+
+
+openclSolverBackend(int linear_solver_verbosity, int maxit, Scalar tolerance, unsigned int platformID, unsigned int deviceID, bool opencl_ilu_parallel, std::string linsolver)
+

Construct a openclSolver

+
+
Parameters:
+
    +
  • linear_solver_verbosity[in] verbosity of openclSolver

  • +
  • maxit[in] maximum number of iterations for openclSolver

  • +
  • tolerance[in] required relative tolerance for openclSolver

  • +
  • platformID[in] the OpenCL platform to be used

  • +
  • deviceID[in] the device to be used

  • +
  • opencl_ilu_parallel[in] whether to parallelize the ILU decomposition and application in OpenCL with level_scheduling

  • +
  • linsolver[in] indicating the preconditioner, equal to the &#8212;linear-solver cmdline argument only ilu0, cpr_quasiimpes and isai are supported

  • +
+
+
+
+ +
+
+openclSolverBackend(int linear_solver_verbosity, int maxit, Scalar tolerance, bool opencl_ilu_parallel)
+

For the CPR coarse solver.

+
+ +
+
+virtual SolverStatus solve_system(std::shared_ptr<BlockedMatrix<Scalar>> matrix, Scalar *b, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix, WellContributions<Scalar> &wellContribs, GpuResult &res) override
+

Solve linear system, A*x = b, matrix A must be in blocked-CSR format

+
+
Parameters:
+
    +
  • matrix[in] matrix A

  • +
  • b[in] input vector, contains N values

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
  • wellContribs[in] WellContributions, to apply them separately, instead of adding them to matrix A

  • +
  • res[inout] summary of solver result

  • +
+
+
Returns:
+

status code

+
+
+
+ +
+
+virtual void get_result(Scalar *x) override
+

Solve scalar linear system, for example a coarse system of an AMG preconditioner Data is already on the GPU Get result after linear solve, and peform postprocessing if necessary

+
+
Parameters:
+

x[inout] resulting x vector, caller must guarantee that x points to a valid array

+
+
+
+ +
+
+void setOpencl(std::shared_ptr<cl::Context> &context, std::shared_ptr<cl::CommandQueue> &queue)
+

Set OpenCL objects This class either creates them based on platformID and deviceID or receives them through this function

+
+
Parameters:
+
    +
  • context[in] the opencl context to be used

  • +
  • queue[in] the opencl queue to be used

  • +
+
+
+
+ +
+
+

Public Members

+
+
+std::shared_ptr<cl::Context> context = {}
+
+ +
+
+std::shared_ptr<cl::CommandQueue> queue = {}
+
+ +
+
+

Private Types

+
+
+using Base = GpuSolver<Scalar, block_size>
+
+ +
+
+

Private Functions

+
+
+void gpu_pbicgstab(WellContributions<Scalar> &wellContribs, GpuResult &res)
+

Solve linear system using ilu0-bicgstab

+
+
Parameters:
+
    +
  • wellContribs[in] WellContributions, to apply them separately, instead of adding them to matrix A

  • +
  • res[inout] summary of solver result

  • +
+
+
+
+ +
+
+void initialize(std::shared_ptr<BlockedMatrix<Scalar>> matrix, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix)
+

Initialize GPU and allocate memory

+
+
Parameters:
+
    +
  • matrix[in] matrix A

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
+
+
+
+ +
+
+void copy_system_to_gpu()
+

Copy linear system to GPU.

+
+ +
+
+void update_system(Scalar *vals, Scalar *b)
+

Reassign pointers, in case the addresses of the Dune variables have changed

+
+
Parameters:
+
    +
  • vals[in] array of nonzeroes, each block is stored row-wise and contiguous, contains nnz values

  • +
  • b[in] input vector b, contains N values

  • +
+
+
+
+ +
+
+void update_system_on_gpu()
+

Update linear system on GPU, don’t copy rowpointers and colindices, they stay the same.

+
+ +
+
+bool analyze_matrix()
+

Analyze sparsity pattern to extract parallelism

+
+
Returns:
+

true iff analysis was successful

+
+
+
+ +
+
+bool create_preconditioner()
+

Create the preconditioner, only done once per linear solve

+
+
Returns:
+

true iff decomposition was successful

+
+
+
+ +
+
+void solve_system(WellContributions<Scalar> &wellContribs, GpuResult &res)
+

Solve linear system

+
+
Parameters:
+
    +
  • wellContribs[in] WellContributions, to apply them separately, instead of adding them to matrix A could be empty

  • +
  • res[inout] summary of solver result

  • +
+
+
+
+ +
+
+

Private Members

+
+
+Scalar *h_b = nullptr
+
+ +
+
+std::vector<Scalar> vals_contiguous
+
+ +
+
+cl::Buffer d_Avals
+
+ +
+
+cl::Buffer d_Acols
+
+ +
+
+cl::Buffer d_Arows
+
+ +
+
+cl::Buffer d_x
+
+ +
+
+cl::Buffer d_b
+
+ +
+
+cl::Buffer d_rb
+
+ +
+
+cl::Buffer d_r
+
+ +
+
+cl::Buffer d_rw
+
+ +
+
+cl::Buffer d_p
+
+ +
+
+cl::Buffer d_pw
+
+ +
+
+cl::Buffer d_s
+
+ +
+
+cl::Buffer d_t
+
+ +
+
+cl::Buffer d_v
+
+ +
+
+cl::Buffer d_tmp
+
+ +
+
+std::vector<cl::Device> devices
+
+ +
+
+bool useJacMatrix = false
+
+ +
+
+std::unique_ptr<openclPreconditioner<Scalar, block_size>> prec
+
+ +
+
+bool is_root
+
+ +
+
+bool analysis_done = false
+
+ +
+
+std::shared_ptr<BlockedMatrix<Scalar>> mat = {}
+
+ +
+
+std::shared_ptr<BlockedMatrix<Scalar>> jacMat = {}
+
+ +
+
+bool opencl_ilu_parallel
+
+ +
+
+std::vector<cl::Event> events
+
+ +
+
+cl_int err
+
+ +
+
+int N
+
+ +
+
+int Nb
+
+ +
+
+int nnz
+
+ +
+
+int nnzb
+
+ +
+
+int verbosity
+
+ +
+
+unsigned int platformID
+
+ +
+
+unsigned int deviceID
+
+ +
+
+int maxit
+
+ +
+
+Scalar tolerance
+
+ +
+
+bool initialized
+
+ +
+
+ +
+
+struct OperabilityStatus
+
+
+

Public Functions

+
+
+inline bool isOperableAndSolvable() const
+
+ +
+
+inline bool isOperableUnderBHPLimit() const
+
+ +
+
+inline bool isOperableUnderTHPLimit() const
+
+ +
+
+inline void resetOperability()
+
+ +
+
+

Public Members

+
+
+bool operable_under_only_bhp_limit = true
+
+ +
+
+bool obey_thp_limit_under_bhp_limit = true
+
+ +
+
+bool can_obtain_bhp_with_thp_limit = true
+
+ +
+
+bool obey_bhp_limit_with_thp_limit = true
+
+ +
+
+bool solvable = true
+
+ +
+
+bool has_negative_potentials = false
+
+ +
+
+mutable bool thp_limit_violated_but_not_switched = false
+
+ +
+
+bool use_vfpexplicit = false
+
+ +
+
+ +
+
+template<class CPUMatrixT, class X, class Y, int l = 1>
class OpmGpuILU0 : public Dune::PreconditionerWithUpdate<X, Y>
+
+#include <OpmGpuILU0.hpp>
+

ILU0 preconditioner on the GPU.

+

+
+Todo:
+

Remove the reliance on CPUMatrix. We should be able to use the GPU matrix type directly.

+
+ +

+
+

Note

+

We assume X and Y are both GpuVector<real_type>, but we leave them as template arguments in case of future additions.

+
+
+
Template Parameters:
+
    +
  • CPUMatrixT – Type of the matrix on the CPU

  • +
  • X – Type of the update

  • +
  • Y – Type of the defect

  • +
  • l – Ignored. Just there to have the same number of template arguments as other preconditioners.

  • +
+
+
+
+

Public Types

+
+
+using domain_type = X
+

The domain type of the preconditioner.

+
+ +
+
+using range_type = Y
+

The range type of the preconditioner.

+
+ +
+
+using field_type = typename X::field_type
+

The field type of the preconditioner.

+
+ +
+
+using GpuMatrix = GpuSparseMatrix<field_type>
+

The GPU matrix type.

+
+ +
+
+using FloatMat = GpuSparseMatrix<float>
+

The Float matrix type for mixed precision.

+
+ +
+
+using matrix_type = GpuMatrix
+

The matrix type the preconditioner is for.

+
+ +
+
+

Public Functions

+
+
+explicit OpmGpuILU0(const GpuMatrix &gpuMatrix, const CPUMatrixT &cpuMatrix, bool splitMatrix, bool tuneKernels, int mixedPrecisionScheme)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • w – The relaxation factor.

  • +
+
+
+
+ +
+
+void pre(X &x, Y &b) override
+

Prepare the preconditioner.

+
+

Note

+

Does nothing at the time being.

+
+
+ +
+
+void apply(X &v, const Y &d) override
+

Apply the preconditoner.

+
+ +
+
+void post(X &x) override
+

Post processing.

+
+

Note

+

Does nothing at the moment

+
+
+ +
+
+Dune::SolverCategory::Category category() const override
+

Category of the preconditioner (see SolverCategory::Category)

+
+ +
+
+virtual void update() final
+

Updates the matrix data.

+
+ +
+
+void reorderAndSplitMatrix(int moveThreadBlockSize)
+

perform matrix splitting and reordering

+
+ +
+
+void LUFactorizeMatrix(int factorizationThreadBlockSize)
+

Compute LU factorization, and update the data of the reordered matrix.

+
+ +
+
+void tuneThreadBlockSizes()
+

function that will experimentally tune the thread block sizes of the important cuda kernels

+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Public Static Functions

+
+
+static inline constexpr bool shouldCallPre()
+
+
Returns:
+

false

+
+
+
+ +
+
+static inline constexpr bool shouldCallPost()
+
+
Returns:
+

false

+
+
+
+ +
+
+

Private Functions

+
+
+void apply(X &v, const Y &d, int lowerSolveThreadBlockSize, int upperSolveThreadBlockSize)
+

Apply the preconditoner.

+
+ +
+
+void update(int moveThreadBlockSize, int factorizationThreadBlockSize)
+

Updates the matrix data.

+
+ +
+
+

Private Members

+
+
+Opm::SparseTable<size_t> m_levelSets
+

SparseTable storing each row by level.

+
+ +
+
+std::vector<int> m_reorderedToNatural
+

converts from index in reordered structure to index natural ordered structure

+
+ +
+
+std::vector<int> m_naturalToReordered
+

converts from index in natural ordered structure to index reordered strucutre

+
+ +
+
+const GpuMatrix &m_gpuMatrix
+

The A matrix stored on the gpu, and its reordred version.

+
+ +
+
+std::unique_ptr<GpuMatrix> m_gpuReorderedLU
+
+ +
+
+std::unique_ptr<GpuMatrix> m_gpuMatrixReorderedLower
+

If matrix splitting is enabled, then we store the lower and upper part separately.

+
+ +
+
+std::unique_ptr<GpuMatrix> m_gpuMatrixReorderedUpper
+
+ +
+
+std::unique_ptr<FloatMat> m_gpuMatrixReorderedLowerFloat
+

If mixed precision is enabled, store a float matrix.

+
+ +
+
+std::unique_ptr<FloatMat> m_gpuMatrixReorderedUpperFloat
+
+ +
+
+std::optional<GpuVector<float>> m_gpuMatrixReorderedDiagFloat
+
+ +
+
+std::optional<GpuVector<field_type>> m_gpuMatrixReorderedDiag
+

If matrix splitting is enabled, we also store the diagonal separately.

+
+ +
+
+GpuVector<int> m_gpuNaturalToReorder
+

row conversion from natural to reordered matrix indices stored on the GPU

+
+ +
+
+GpuVector<int> m_gpuReorderToNatural
+

row conversion from reordered to natural matrix indices stored on the GPU

+
+ +
+
+GpuVector<field_type> m_gpuDInv
+

Stores the inverted diagonal that we use in ILU0.

+
+ +
+
+bool m_splitMatrix
+

Bool storing whether or not we should store matrices in a split format.

+
+ +
+
+bool m_tuneThreadBlockSizes
+

Bool storing whether or not we will tune the threadblock sizes. Only used for AMD cards.

+
+ +
+
+const MatrixStorageMPScheme m_mixedPrecisionScheme
+

Enum storing how we should store the factorized matrix.

+
+ +
+
+int m_upperSolveThreadBlockSize = -1
+

variables storing the threadblocksizes to use if using the tuned sizes and AMD cards The default value of -1 indicates that we have not calibrated and selected a value yet

+
+ +
+
+int m_lowerSolveThreadBlockSize = -1
+
+ +
+
+int m_moveThreadBlockSize = -1
+
+ +
+
+int m_ILU0FactorizationThreadBlockSize = -1
+
+ +
+
+std::map<std::pair<field_type*, const field_type*>, GPUGraph> m_apply_graphs
+
+ +
+
+std::map<std::pair<field_type*, const field_type*>, GPUGraphExec> m_executableGraphs
+
+ +
+
+GPUStream m_stream = {}
+
+ +
+
+GPUEvent m_before = {}
+
+ +
+
+GPUEvent m_after = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr const size_t blocksize_ = CPUMatrixT::block_type::cols
+

size_t describing the dimensions of the square block elements

+
+ +
+
+ +
+
+struct OptimizeState
+
+
+

Public Functions

+
+
+inline OptimizeState(GasLiftSingleWellGeneric &parent_, bool increase_)
+
+ +
+
+std::pair<std::optional<Scalar>, bool> addOrSubtractAlqIncrement(Scalar alq)
+
+ +
+
+Scalar calcEcoGradient(Scalar oil_rate, Scalar new_oil_rate, Scalar gas_rate, Scalar new_gas_rate)
+
+ +
+
+bool checkAlqOutsideLimits(Scalar alq, Scalar oil_rate)
+
+ +
+
+bool checkEcoGradient(Scalar gradient)
+
+ +
+
+bool checkOilRateExceedsTarget(Scalar oil_rate)
+
+ +
+
+bool checkRatesViolated(const LimitedRates &rates) const
+
+ +
+
+void debugShowIterationInfo(Scalar alq)
+
+ +
+
+Scalar getBhpWithLimit()
+
+ +
+
+inline void warn_(const std::string &msg)
+
+ +
+
+

Public Members

+
+
+GasLiftSingleWellGeneric &parent
+
+ +
+
+bool increase
+
+ +
+
+int it
+
+ +
+
+bool stop_iteration
+
+ +
+
+Scalar bhp
+
+ +
+
+ +
+
+struct OptimizeState
+
+#include <GasLiftStage2.hpp>
+
+

Public Types

+
+
+using GradInfo = typename GasLiftStage2::GradInfo
+
+ +
+
+using GradPair = typename GasLiftStage2::GradPair
+
+ +
+
+using GradPairItr = typename GasLiftStage2::GradPairItr
+
+ +
+
+using GradMap = typename GasLiftStage2::GradMap
+
+ +
+
+

Public Functions

+
+
+inline OptimizeState(GasLiftStage2 &parent_, const Group &group_)
+
+ +
+
+void calculateEcoGradients(std::vector<GasLiftSingleWell*> &wells, std::vector<GradPair> &inc_grads, std::vector<GradPair> &dec_grads)
+
+ +
+
+bool checkAtLeastTwoWells(std::vector<GasLiftSingleWell*> &wells)
+
+ +
+
+void debugShowIterationInfo()
+
+ +
+
+std::pair<std::optional<GradPairItr>, std::optional<GradPairItr>> getEcoGradients(std::vector<GradPair> &inc_grads, std::vector<GradPair> &dec_grads)
+
+ +
+
+void recalculateGradients(std::vector<GradPair> &inc_grads, std::vector<GradPair> &dec_grads, GradPairItr &min_dec_grad_itr, GradPairItr &max_inc_grad_itr)
+
+ +
+
+void redistributeALQ(GradPairItr &min_dec_grad, GradPairItr &max_inc_grad)
+
+ +
+
+

Public Members

+
+
+GasLiftStage2 &parent
+
+ +
+
+const Group &group
+
+ +
+
+int it
+
+ +
+
+

Private Functions

+
+
+void displayDebugMessage_(const std::string &msg)
+
+ +
+
+void displayWarning_(const std::string &msg)
+
+ +
+
+ +
+
+template<class TypeTag>
class OutputBlackOilModule : public Opm::GenericOutputBlackoilModule<GetPropType<TypeTag, Properties::FluidSystem>>
+
+

Output module for the results black oil model writing in ECL binary format.

+
+

Public Functions

+
+
+inline OutputBlackOilModule(const Simulator &simulator, const SummaryConfig &smryCfg, const CollectDataOnIORankType &collectOnIORank)
+
+ +
+
+inline void allocBuffers(const unsigned bufferSize, const unsigned reportStepNum, const bool substep, const bool log, const bool isRestart)
+

Allocate memory for the scalar fields we would like to write to ECL output files.

+
+ +
+
+inline void setupExtractors(const bool isSubStep, const int reportStepNum)
+

Setup list of active element-level data extractors.

+
+ +
+
+inline void clearExtractors()
+

Clear list of active element-level data extractors.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx)
+

Modify the internal buffers according to the intensive quanties relevant for an element.

+
+ +
+
+inline void processElementBlockData(const ElementContext &elemCtx)
+
+ +
+
+inline void outputFipAndResvLog(const Inplace &inplace, const std::size_t reportStepNum, double elapsed, boost::posix_time::ptime currentDate, const bool substep, const Parallel::Communication &comm)
+
+ +
+
+template<class ActiveIndex, class CartesianIndex>
inline void processFluxes(const ElementContext &elemCtx, ActiveIndex &&activeIndex, CartesianIndex &&cartesianIndex)
+

Capture connection fluxes, particularly to account for inter-region flows.

+
+
Template Parameters:
+
    +
  • ActiveIndex – Callable type, typically a lambda, that enables retrieving the active index, on the local MPI rank, of a particular cell/element. Must support a function call operator of the form

    int operator()(const Element& elem) const
    +
    +
    +

  • +
  • CartesianIndex – Callable type, typically a lambda, that enables retrieving the globally unique Cartesian index of a particular cell/element given its active index on the local MPI rank. Must support a function call operator of the form

    int operator()(const int activeIndex) const
    +
    +
    +

  • +
+
+
Parameters:
+
    +
  • elemCtx[in] Primary lookup structure for per-cell/element dynamic information.

  • +
  • activeIndex[in] Mapping from cell/elements to linear indices on local MPI rank.

  • +
  • cartesianIndex[in] Mapping from active index on local MPI rank to globally unique Cartesian cell/element index.

  • +
+
+
+
+ +
+
+inline void initializeFluxData()
+

Prepare for capturing connection fluxes, particularly to account for inter-region flows.

+
+ +
+
+inline void finalizeFluxData()
+

Finalize capturing connection fluxes.

+
+ +
+
+inline const InterRegFlowMap &getInterRegFlows() const
+

Get read-only access to collection of inter-region flows.

+
+ +
+
+template<class FluidState>
inline void assignToFluidState(FluidState &fs, unsigned elemIdx) const
+
+ +
+
+inline void initHysteresisParams(Simulator &simulator, unsigned elemIdx) const
+
+ +
+
+inline void updateFluidInPlace(const ElementContext &elemCtx)
+
+ +
+
+inline void updateFluidInPlace(const unsigned globalDofIdx, const IntensiveQuantities &intQuants, const double totVolume)
+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableEnergy
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableMICP
+
+ +
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Discretization = GetPropType<TypeTag, Properties::Discretization>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using MaterialLawParams = GetPropType<TypeTag, Properties::MaterialLawParams>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using FluidState = typename IntensiveQuantities::FluidState
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Element = typename GridView::template Codim<0>::Entity
+
+ +
+
+using ElementIterator = typename GridView::template Codim<0>::Iterator
+
+ +
+
+using BaseType = GenericOutputBlackoilModule<FluidSystem>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using Dir = FaceDir::DirEnum
+
+ +
+
+using BlockExtractor = detail::BlockExtractor<TypeTag>
+
+ +
+
+using Extractor = detail::Extractor<TypeTag>
+
+ +
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using EquilGrid = GetPropType<TypeTag, Properties::EquilGrid>
+
+ +
+
+using CollectDataOnIORankType = CollectDataOnIORank<Grid, EquilGrid, GridView>
+
+ +
+
+template<typename T>
using RemoveCVR = std::remove_cv_t<std::remove_reference_t<T>>
+
+ +
+
+

Private Functions

+
+
+inline virtual bool isDefunctParallelWell(const std::string &wname) const override
+
+ +
+
+inline virtual bool isOwnedByCurrentRank(const std::string &wname) const override
+
+ +
+
+inline void updateFluidInPlace_(const ElementContext &elemCtx, const unsigned dofIdx)
+
+ +
+
+inline void updateFluidInPlace_(const unsigned globalDofIdx, const IntensiveQuantities &intQuants, const double totVolume)
+
+ +
+
+inline void createLocalRegion_(std::vector<int> &region)
+
+ +
+
+template<typename FluidState>
inline void aggregateAverageDensityContributions_(const FluidState &fs, const unsigned int globalDofIdx, const double porv)
+
+ +
+
+inline data::InterRegFlowMap::FlowRates getComponentSurfaceRates(const ElementContext &elemCtx, const Scalar faceArea, const std::size_t scvfIdx, const std::size_t timeIdx) const
+

Compute surface level component flow rates across a single intersection.

+
+
Parameters:
+
    +
  • elemCtx[in] Primary lookup structure for per-cell/element dynamic information.

  • +
  • scvfIdx[in] Linear index of current interior bulk connection.

  • +
  • timeIdx[in] Historical time-point at which to evaluate dynamic quantities (e.g., reciprocal FVF or dissolved gas concentration). Zero for the current time.

  • +
+
+
Returns:
+

Surface level component flow rates.

+
+
+
+ +
+
+template<typename FluidState>
inline Scalar hydroCarbonFraction(const FluidState &fs) const
+
+ +
+
+inline void updateTotalVolumesAndPressures_(const unsigned globalDofIdx, const IntensiveQuantities &intQuants, const double totVolume)
+
+ +
+
+inline void updatePhaseInplaceVolumes_(const unsigned globalDofIdx, const IntensiveQuantities &intQuants, const double totVolume)
+
+ +
+
+template<typename FluidState, typename FIPArray>
inline void updateOilGasDistribution(const unsigned globalDofIdx, const FluidState &fs, const FIPArray &fip)
+
+ +
+
+template<typename FluidState, typename FIPArray>
inline void updateGasWaterDistribution(const unsigned globalDofIdx, const FluidState &fs, const FIPArray &fip)
+
+ +
+
+template<typename IntensiveQuantities>
inline void updateCO2InGas(const unsigned globalDofIdx, const double pv, const IntensiveQuantities &intQuants)
+
+ +
+
+template<typename FluidState>
inline void updateCO2InWater(const unsigned globalDofIdx, const double pv, const FluidState &fs)
+
+ +
+
+template<typename FluidState>
inline Scalar co2InWaterFromWater(const FluidState &fs, const double pv) const
+
+ +
+
+template<typename FluidState>
inline Scalar co2InWaterFromOil(const FluidState &fs, const double pv) const
+
+ +
+
+template<typename FluidState, typename FIPArray>
inline void updateWaterMass(const unsigned globalDofIdx, const FluidState &fs, const FIPArray &fip)
+
+ +
+
+template<typename IntensiveQuantities>
inline void updateMicrobialMass(const unsigned globalDofIdx, const IntensiveQuantities &intQuants, const double surfVolWat)
+
+ +
+
+template<typename IntensiveQuantities>
inline void updateOxygenMass(const unsigned globalDofIdx, const IntensiveQuantities &intQuants, const double surfVolWat)
+
+ +
+
+template<typename IntensiveQuantities>
inline void updateUreaMass(const unsigned globalDofIdx, const IntensiveQuantities &intQuants, const double surfVolWat)
+
+ +
+
+template<typename IntensiveQuantities>
inline void updateBiofilmMass(const unsigned globalDofIdx, const IntensiveQuantities &intQuants, const double totVolume)
+
+ +
+
+template<typename IntensiveQuantities>
inline void updateCalciteMass(const unsigned globalDofIdx, const IntensiveQuantities &intQuants, const double totVolume)
+
+ +
+
+inline void setupElementExtractors_()
+

Setup extractors for element-level data.

+
+ +
+
+inline void setupBlockExtractors_(const bool isSubStep, const int reportStepNum)
+

Setup extractor execution map for block data.

+
+ +
+
+

Private Members

+
+
+const Simulator &simulator_
+
+ +
+
+const CollectDataOnIORankType &collectOnIORank_
+
+ +
+
+std::vector<typename Extractor::Entry> extractors_
+
+ +
+
+BlockExtractor::ExecMap blockExtractors_
+
+ +
+
+BlockExtractor::ExecMap extraBlockExtractors_
+
+ +
+
+

Private Static Functions

+
+
+template<int idx, class VectorType>
static inline Scalar value_or_zero(const VectorType &v)
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr int conti0EqIdx = Indices::conti0EqIdx
+
+ +
+
+static constexpr int numPhases = FluidSystem::numPhases
+
+ +
+
+static constexpr int oilPhaseIdx = FluidSystem::oilPhaseIdx
+
+ +
+
+static constexpr int gasPhaseIdx = FluidSystem::gasPhaseIdx
+
+ +
+
+static constexpr int waterPhaseIdx = FluidSystem::waterPhaseIdx
+
+ +
+
+static constexpr int gasCompIdx = FluidSystem::gasCompIdx
+
+ +
+
+static constexpr int oilCompIdx = FluidSystem::oilCompIdx
+
+ +
+
+static constexpr int waterCompIdx = FluidSystem::waterCompIdx
+
+ +
+
+ +
+
+template<class TypeTag>
class OutputCompositionalModule : public Opm::GenericOutputBlackoilModule<GetPropType<TypeTag, Properties::FluidSystem>>
+
+

Output module for the results black oil model writing in ECL binary format.

+
+

Public Functions

+
+
+template<class CollectDataToIORankType>
inline OutputCompositionalModule(const Simulator &simulator, const SummaryConfig &smryCfg, const CollectDataToIORankType &collectToIORank)
+
+ +
+
+inline void allocBuffers(const unsigned bufferSize, const unsigned reportStepNum, const bool substep, const bool log, const bool isRestart)
+

Allocate memory for the scalar fields we would like to write to ECL output files.

+
+ +
+
+inline void assignToSolution(data::Solution &sol)
+
+ +
+
+inline void setupExtractors(const bool, const std::size_t)
+

Setup list of active element-level data extractors.

+
+ +
+
+inline void clearExtractors()
+

Clear list of active element-level data extractors.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx)
+

Modify the internal buffers according to the intensive quanties relevant for an element.

+
+ +
+
+inline void processElementFlows(const ElementContext&)
+
+ +
+
+inline void processElementBlockData(const ElementContext&)
+
+ +
+
+template<class ActiveIndex, class CartesianIndex>
inline void processFluxes(const ElementContext&, ActiveIndex&&, CartesianIndex&&)
+

Capture connection fluxes, particularly to account for inter-region flows.

+
+
Template Parameters:
+
    +
  • ActiveIndex – Callable type, typically a lambda, that enables retrieving the active index, on the local MPI rank, of a particular cell/element. Must support a function call operator of the form

    int operator()(const Element& elem) const
    +
    +
    +

  • +
  • CartesianIndex – Callable type, typically a lambda, that enables retrieving the globally unique Cartesian index of a particular cell/element given its active index on the local MPI rank. Must support a function call operator of the form

    int operator()(const int activeIndex) const
    +
    +
    +

  • +
+
+
Parameters:
+
    +
  • elemCtx[in] Primary lookup structure for per-cell/element dynamic information.

  • +
  • activeIndex[in] Mapping from cell/elements to linear indices on local MPI rank.

  • +
  • cartesianIndex[in] Mapping from active index on local MPI rank to globally unique Cartesian cell/element index.

  • +
+
+
+
+ +
+
+inline void initializeFluxData()
+

Prepare for capturing connection fluxes, particularly to account for inter-region flows.

+
+ +
+
+inline void finalizeFluxData()
+

Finalize capturing connection fluxes.

+
+ +
+
+inline const InterRegFlowMap &getInterRegFlows() const
+

Get read-only access to collection of inter-region flows.

+
+ +
+
+inline void updateFluidInPlace(const unsigned, const IntensiveQuantities&, const double)
+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numComponents
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator oilPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator gasPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator waterPhaseIdx
+
+ +
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Discretization = GetPropType<TypeTag, Properties::Discretization>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using BaseType = GenericOutputBlackoilModule<FluidSystem>
+
+ +
+
+using Extractor = detail::Extractor<TypeTag>
+
+ +
+
+

Private Functions

+
+
+inline virtual bool isDefunctParallelWell(const std::string &wname) const override
+
+ +
+
+inline virtual bool isOwnedByCurrentRank(const std::string &wname) const override
+
+ +
+
+inline void createLocalRegion_(std::vector<int> &region)
+
+ +
+
+

Private Members

+
+
+const Simulator &simulator_
+
+ +
+
+CompositionalContainer<FluidSystem> compC_
+
+ +
+
+std::vector<typename Extractor::Entry> extractors_
+
+ +
+
+ +
+
+struct OutputExtraConvergenceInfo
+
+
+

Public Static Attributes

+
+
+static constexpr auto *value = "none"
+
+ +
+
+ +
+
+struct OutputMode
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "all"
+
+ +
+
+ +
+
+struct OutputRequest
+
+

Single output request.

+

Associates non-linear iteration convergence information to single report and timestep.

+
+

Public Members

+
+
+int reportStep = {-1}
+

Current report step.

+
+ +
+
+int currentStep = {-1}
+

Current timestep within reportStep. Expected to be a small integer.

+
+ +
+
+std::vector<ConvergenceReport> reports = {}
+

Convergence metrics for each non-linear ieration in the currentStep.

+
+ +
+
+ +
+
+struct OutputRestart
+
+

Public Functions

+
+
+inline void clearBits()
+
+ +
+
+inline explicit operator bool() const
+
+ +
+
+

Public Members

+
+
+bool noPrefix = {false}
+

Whether or not run requests (surface condition) fluid-in-place restart file output using the ‘FIP’ mnemonic.

+
+ +
+
+bool surface = {false}
+

Whether or not run requests surface condition fluid-in-place restart file output using the ‘SFIP’ mnemonic.

+
+ +
+
+bool reservoir = {false}
+

Whether or not run requests reservoir condition fluid-in-place restart file output using the ‘RFIP’ mnemonic.

+
+ +
+
+ +
+
+struct OwnerCellsFirst
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class OriginalPreconditioner, class Comm>
class OwningBlockPreconditioner : public Dune::PreconditionerWithUpdate<OriginalPreconditioner::domain_type, OriginalPreconditioner::range_type>
+
+
+

Public Types

+
+
+using X = typename OriginalPreconditioner::domain_type
+
+ +
+
+using Y = typename OriginalPreconditioner::range_type
+
+ +
+
+

Public Functions

+
+
+template<class ...Args>
inline OwningBlockPreconditioner(const Comm &comm, Args&&... args)
+
+ +
+
+inline virtual void pre(X &x, Y &b) override
+
+ +
+
+inline virtual void apply(X &v, const Y &d) override
+
+ +
+
+inline virtual void post(X &x) override
+
+ +
+
+inline virtual SolverCategory::Category category() const override
+
+ +
+
+inline virtual void update() override
+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Private Members

+
+
+OriginalPreconditioner orig_precond_
+
+ +
+
+BlockPreconditioner<X, Y, Comm, OriginalPreconditioner> block_precond_
+
+ +
+
+ +
+
+template<class OperatorType, class VectorType, class LevelTransferPolicy, class Communication = Dune::Amg::SequentialInformation>
class OwningTwoLevelPreconditioner : public Dune::PreconditionerWithUpdate<VectorType, VectorType>
+
+

A version of the two-level preconditioner that is:

    +
  • Self-contained, because it owns its policy components.

  • +
  • Flexible, because it uses the runtime-flexible solver and preconditioner factory.

  • +
+

+
+

Public Types

+
+
+using MatrixType = typename OperatorType::matrix_type
+
+ +
+
+using PrecFactory = Opm::PreconditionerFactory<OperatorType, Communication>
+
+ +
+
+using AbstractOperatorType = Dune::AssembledLinearOperator<MatrixType, VectorType, VectorType>
+
+ +
+
+

Public Functions

+
+
+inline OwningTwoLevelPreconditioner(const OperatorType &linearoperator, const Opm::PropertyTree &prm, const std::function<VectorType()> weightsCalculator, std::size_t pressureIndex)
+
+ +
+
+inline OwningTwoLevelPreconditioner(const OperatorType &linearoperator, const Opm::PropertyTree &prm, const std::function<VectorType()> weightsCalculator, std::size_t pressureIndex, const Communication &comm)
+
+ +
+
+inline virtual void pre(VectorType &x, VectorType &b) override
+
+ +
+
+inline virtual void apply(VectorType &v, const VectorType &d) override
+
+ +
+
+inline virtual void post(VectorType &x) override
+
+ +
+
+inline virtual void update() override
+
+ +
+
+inline virtual Dune::SolverCategory::Category category() const override
+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Private Types

+
+
+using CoarseOperator = typename LevelTransferPolicy::CoarseOperator
+
+ +
+
+using CoarseSolverPolicy = Dune::Amg::PressureSolverPolicy<CoarseOperator, FlexibleSolver<CoarseOperator>, LevelTransferPolicy>
+
+ +
+
+using TwoLevelMethod = Dune::Amg::TwoLevelMethodCpr<OperatorType, CoarseSolverPolicy, Dune::PreconditionerWithUpdate<VectorType, VectorType>>
+
+ +
+
+

Private Functions

+
+
+template<class Comm>
inline void updateImpl(const Comm*)
+
+ +
+
+inline void updateImpl(const Dune::Amg::SequentialInformation*)
+
+ +
+
+

Private Members

+
+
+const OperatorType &linear_operator_
+
+ +
+
+std::shared_ptr<PreconditionerWithUpdate<VectorType, VectorType>> finesmoother_
+
+ +
+
+const Communication *comm_
+
+ +
+
+std::function<VectorType()> weightsCalculator_
+
+ +
+
+VectorType weights_
+
+ +
+
+LevelTransferPolicy levelTransferPolicy_
+
+ +
+
+CoarseSolverPolicy coarseSolverPolicy_
+
+ +
+
+TwoLevelMethod twolevel_method_
+
+ +
+
+Opm::PropertyTree prm_
+
+ +
+
+Communication dummy_comm_
+
+ +
+
+ +
+
+struct Packer
+
+#include <MPIPacker.hpp>
+

Struct handling packing of serialization for MPI communication.

+
+

Public Functions

+
+
+inline explicit Packer(Parallel::Communication comm)
+

Constructor.

+
+
Parameters:
+

comm – The communicator to use

+
+
+
+ +
+
+template<class T>
inline std::size_t packSize(const T &data) const
+

Calculates the pack size for a variable.

+
+
Template Parameters:
+

T – The type of the data to be packed

+
+
Parameters:
+

data – The data to pack

+
+
+
+ +
+
+template<class T>
inline std::size_t packSize(const T *data, std::size_t n) const
+

Calculates the pack size for an array.

+
+
Template Parameters:
+

T – The type of the data to be packed

+
+
Parameters:
+
    +
  • data – The array to pack

  • +
  • n – Length of array

  • +
+
+
+
+ +
+
+template<class T>
inline void pack(const T &data, std::vector<char> &buffer, std::size_t &position) const
+

Pack a variable.

+
+
Template Parameters:
+

T – The type of the data to be packed

+
+
Parameters:
+
    +
  • data – The variable to pack

  • +
  • buffer – Buffer to pack into

  • +
  • position – Position in buffer to use

  • +
+
+
+
+ +
+
+template<class T>
inline void pack(const T *data, std::size_t n, std::vector<char> &buffer, std::size_t &position) const
+

Pack an array.

+
+
Template Parameters:
+

T – The type of the data to be packed

+
+
Parameters:
+
    +
  • data – The array to pack

  • +
  • n – Length of array

  • +
  • buffer – Buffer to pack into

  • +
  • position – Position in buffer to use

  • +
+
+
+
+ +
+
+template<class T>
inline void unpack(T &data, const std::vector<char> &buffer, std::size_t &position) const
+

Unpack a variable.

+
+
Template Parameters:
+

T – The type of the data to be unpacked

+
+
Parameters:
+
    +
  • data – The variable to unpack

  • +
  • buffer – Buffer to unpack from

  • +
  • position – Position in buffer to use

  • +
+
+
+
+ +
+
+template<class T>
inline void unpack(T *data, std::size_t n, const std::vector<char> &buffer, std::size_t &position) const
+

Unpack an array.

+
+
Template Parameters:
+

T – The type of the data to be unpacked

+
+
Parameters:
+
    +
  • data – The array to unpack

  • +
  • n – Length of array

  • +
  • buffer – Buffer to unpack from

  • +
  • position – Position in buffer to use

  • +
+
+
+
+ +
+
+

Private Members

+
+
+Parallel::Communication m_comm
+

Communicator to use.

+
+ +
+
+ +
+
+template<bool pod, class T>
struct Packing
+
+#include <MPIPacker.hpp>
+

Abstract struct for packing which is (partially) specialized for specific types.

+
+

Public Static Functions

+
+
+static std::size_t packSize(const T&, Parallel::MPIComm)
+
+ +
+
+static void pack(const T&, std::vector<char>&, std::size_t&, Parallel::MPIComm)
+
+ +
+
+static void unpack(T&, const std::vector<char>&, std::size_t&, Parallel::MPIComm)
+
+ +
+
+ +
+
+template<>
struct Packing<false, boost::gregorian::date>
+
+
+

Public Static Functions

+
+
+static std::size_t packSize(const boost::gregorian::date &data)
+
+ +
+
+static void pack(const boost::gregorian::date &data, std::vector<char> &buffer, std::size_t &position)
+
+ +
+
+static void unpack(boost::gregorian::date &data, const std::vector<char> &buffer, std::size_t &position)
+
+ +
+
+ +
+
+template<std::size_t Size>
struct Packing<false, std::bitset<Size>>
+
+#include <MPIPacker.hpp>
+

Specialization for std::bitset.

+
+

Public Static Functions

+
+
+static std::size_t packSize(const std::bitset<Size>&, Opm::Parallel::MPIComm)
+
+ +
+
+static void pack(const std::bitset<Size>&, std::vector<char>&, std::size_t&, Opm::Parallel::MPIComm)
+
+ +
+
+static void unpack(std::bitset<Size>&, const std::vector<char>&, std::size_t&, Opm::Parallel::MPIComm)
+
+ +
+
+ +
+
+template<class T>
struct Packing<false, T>
+
+#include <MPIPacker.hpp>
+

Default handling for unsupported types.

+
+

Public Static Functions

+
+
+static inline std::size_t packSize(const T&, Parallel::MPIComm)
+
+ +
+
+static inline void pack(const T&, std::vector<char>&, std::size_t&, Parallel::MPIComm)
+
+ +
+
+static inline void unpack(T&, const std::vector<char>&, std::size_t&, Parallel::MPIComm)
+
+ +
+
+ +
+
+template<class T>
struct Packing<true, T>
+
+#include <MPIPacker.hpp>
+

Packaging for pod data.

+
+

Public Static Functions

+
+
+static inline std::size_t packSize(const T &data, Parallel::MPIComm comm)
+

Calculates the pack size for a POD.

+
+
Parameters:
+
    +
  • data – The data to pack

  • +
  • comm – The communicator to use

  • +
+
+
+
+ +
+
+static inline std::size_t packSize(const T*, std::size_t n, Parallel::MPIComm comm)
+

Calculates the pack size for an array of POD.

+
+
Parameters:
+
    +
  • data – The array to pack

  • +
  • n – Length of array

  • +
  • comm – The communicator to use

  • +
+
+
+
+ +
+
+static inline void pack(const T &data, std::vector<char> &buffer, std::size_t &position, Parallel::MPIComm comm)
+

Pack a POD.

+
+
Parameters:
+
    +
  • data – The variable to pack

  • +
  • buffer – Buffer to pack into

  • +
  • position – Position in buffer to use

  • +
  • comm – The communicator to use

  • +
+
+
+
+ +
+
+static inline void pack(const T *data, std::size_t n, std::vector<char> &buffer, std::size_t &position, Parallel::MPIComm comm)
+

Pack an array of POD.

+
+
Parameters:
+
    +
  • data – The array to pack

  • +
  • n – Length of array

  • +
  • buffer – Buffer to pack into

  • +
  • position – Position in buffer to use

  • +
  • comm – The communicator to use

  • +
+
+
+
+ +
+
+static inline void unpack(T &data, const std::vector<char> &buffer, std::size_t &position, Parallel::MPIComm comm)
+

Unpack a POD.

+
+
Parameters:
+
    +
  • data – The variable to unpack

  • +
  • buffer – Buffer to unpack from

  • +
  • position – Position in buffer to use

  • +
  • comm – The communicator to use

  • +
+
+
+
+ +
+
+static inline void unpack(T *data, std::size_t n, const std::vector<char> &buffer, std::size_t &position, Parallel::MPIComm comm)
+

Unpack an array of POD.

+
+
Parameters:
+
    +
  • data – The array to unpack

  • +
  • n – Length of array

  • +
  • buffer – Buffer to unpack from

  • +
  • position – Position in buffer to use

  • +
  • comm – The communicator to use

  • +
+
+
+
+ +
+
+ +
+
+class PackUnPackAquiferData : public P2PCommunicatorType::DataHandleInterface
+
+
+

Public Functions

+
+
+inline PackUnPackAquiferData(const data::Aquifers &localAquiferData, data::Aquifers &globalAquiferData, bool isIORank)
+
+ +
+
+inline void pack(int link, MessageBufferType &buffer)
+
+ +
+
+inline void unpack(int, MessageBufferType &buffer)
+
+ +
+
+

Private Functions

+
+
+inline void unpackCommon(const data::AquiferData &data, data::AquiferData &aq)
+
+ +
+
+inline void unpackAquFet(const data::FetkovichData &aquFet, data::AquiferData &aq)
+
+ +
+
+inline void unpackCarterTracy(const data::CarterTracyData &aquCT, data::AquiferData &aq)
+
+ +
+
+inline void unpackNumericAquifer(const data::NumericAquiferData &aquNum, data::AquiferData &aq)
+
+ +
+
+

Private Members

+
+
+const data::Aquifers &localAquiferData_
+
+ +
+
+data::Aquifers &globalAquiferData_
+
+ +
+
+ +
+
+class PackUnPackBlockData : public P2PCommunicatorType::DataHandleInterface
+
+
+

Public Functions

+
+
+inline PackUnPackBlockData(const std::map<std::pair<std::string, int>, double> &localBlockData, std::map<std::pair<std::string, int>, double> &globalBlockValues, bool isIORank)
+
+ +
+
+inline void pack(int link, MessageBufferType &buffer)
+
+ +
+
+inline void unpack(int, MessageBufferType &buffer)
+
+ +
+
+

Private Members

+
+
+const std::map<std::pair<std::string, int>, double> &localBlockData_
+
+ +
+
+std::map<std::pair<std::string, int>, double> &globalBlockValues_
+
+ +
+
+ +
+
+class PackUnPackCellData : public P2PCommunicatorType::DataHandleInterface
+
+
+

Public Functions

+
+
+inline PackUnPackCellData(const data::Solution &localCellData, data::Solution &globalCellData, const IndexMapType &localIndexMap, const IndexMapStorageType &indexMaps, std::size_t globalSize, bool isIORank)
+
+ +
+
+inline void pack(int link, MessageBufferType &buffer)
+
+ +
+
+inline void doUnpack(const IndexMapType &indexMap, MessageBufferType &buffer)
+
+ +
+
+inline void unpack(int link, MessageBufferType &buffer)
+
+ +
+
+

Protected Functions

+
+
+template<class Vector>
inline void write(MessageBufferType &buffer, const IndexMapType &localIndexMap, const Vector &vector, unsigned int offset = 0, unsigned int stride = 1) const
+
+ +
+
+template<class Vector>
inline void read(MessageBufferType &buffer, const IndexMapType &indexMap, Vector &vector, unsigned int offset = 0, unsigned int stride = 1) const
+
+ +
+
+

Private Members

+
+
+const data::Solution &localCellData_
+
+ +
+
+data::Solution &globalCellData_
+
+ +
+
+const IndexMapType &localIndexMap_
+
+ +
+
+const IndexMapStorageType &indexMaps_
+
+ +
+
+ +
+
+class PackUnpackFlows : public P2PCommunicatorType::DataHandleInterface
+
+
+

Public Functions

+
+
+inline PackUnpackFlows(const std::array<FlowsData<double>, 3> &localFlows, std::array<FlowsData<double>, 3> &globalFlows, const bool isIORank)
+
+ +
+
+inline void pack(int link, MessageBufferType &buffer)
+
+ +
+
+inline void unpack(int, MessageBufferType &buffer)
+
+ +
+
+

Private Members

+
+
+const std::array<FlowsData<double>, 3> &localFlows_
+
+ +
+
+std::array<FlowsData<double>, 3> &globalFlows_
+
+ +
+
+ +
+
+class PackUnPackGroupAndNetworkValues : public P2PCommunicatorType::DataHandleInterface
+
+
+

Public Functions

+
+
+inline PackUnPackGroupAndNetworkValues(const data::GroupAndNetworkValues &localGroupAndNetworkData, data::GroupAndNetworkValues &globalGroupAndNetworkData, const bool isIORank)
+
+ +
+
+inline void pack(int link, MessageBufferType &buffer)
+
+ +
+
+inline void unpack(int, MessageBufferType &buffer)
+
+ +
+
+

Private Members

+
+
+const data::GroupAndNetworkValues &localGroupAndNetworkData_
+
+ +
+
+data::GroupAndNetworkValues &globalGroupAndNetworkData_
+
+ +
+
+ +
+
+class PackUnpackInterRegFlows : public P2PCommunicatorType::DataHandleInterface
+
+
+

Public Functions

+
+
+inline PackUnpackInterRegFlows(const InterRegFlowMap &localInterRegFlows, InterRegFlowMap &globalInterRegFlows, const bool isIORank)
+
+ +
+
+inline void pack(int link, MessageBufferType &buffer)
+
+ +
+
+inline void unpack(int, MessageBufferType &buffer)
+
+ +
+
+

Private Members

+
+
+const InterRegFlowMap &localInterRegFlows_
+
+ +
+
+InterRegFlowMap &globalInterRegFlows_
+
+ +
+
+ +
+
+class PackUnPackWBPData : public P2PCommunicatorType::DataHandleInterface
+
+
+

Public Functions

+
+
+inline PackUnPackWBPData(const data::WellBlockAveragePressures &localWBPData, data::WellBlockAveragePressures &globalWBPValues, const bool isIORank)
+
+ +
+
+inline void pack(int link, MessageBufferType &buffer)
+
+ +
+
+inline void unpack(const int link, MessageBufferType &buffer)
+
+ +
+
+

Private Members

+
+
+const data::WellBlockAveragePressures &localWBPData_
+
+ +
+
+data::WellBlockAveragePressures &globalWBPValues_
+
+ +
+
+ +
+
+class PackUnPackWellData : public P2PCommunicatorType::DataHandleInterface
+
+
+

Public Functions

+
+
+inline PackUnPackWellData(const data::Wells &localWellData, data::Wells &globalWellData, bool isIORank)
+
+ +
+
+inline void pack(int link, MessageBufferType &buffer)
+
+ +
+
+inline void unpack(int, MessageBufferType &buffer)
+
+ +
+
+

Private Members

+
+
+const data::Wells &localWellData_
+
+ +
+
+data::Wells &globalWellData_
+
+ +
+
+ +
+
+class PackUnPackWellTestState : public P2PCommunicatorType::DataHandleInterface
+
+
+

Public Functions

+
+
+inline PackUnPackWellTestState(const WellTestState &localWTestState, WellTestState &globalWTestState, bool isIORank)
+
+ +
+
+inline void pack(int link, MessageBufferType &buffer)
+
+ +
+
+inline void unpack(int, MessageBufferType &buffer)
+
+ +
+
+

Private Members

+
+
+const WellTestState &local_
+
+ +
+
+WellTestState &global_
+
+ +
+
+ +
+
+class ParallelEclipseState : public EclipseState
+
+

Parallel frontend to the EclipseState.

+

This is a parallel frontend to the mpi-unaware EclipseState in opm-common. It extends the eclipse state class with serialization support, and contains methods to switch between full global field properties, and distributed field properties for consumption in the simulator. Additionally, it has a few sanity checks to ensure that the data that is only available on the root process is not attempted to be accessed on non-root processes.

+
+

Public Functions

+
+
+ParallelEclipseState(Parallel::Communication comm)
+

Default constructor.

+
+ +
+
+ParallelEclipseState(const Deck &deck)
+

Construct from a deck instance.

+

+Only called on root process

+
+
Parameters:
+

deck – The deck to construct from

+
+
+
+ +
+
+ParallelEclipseState(const Deck &deck, Parallel::Communication comm)
+

Construct from a deck instance.

+

EXPERIMENTAL FUNCTION TO ADD COMM AS INPUT.

+

Only called on root process

+

+
+
Parameters:
+

deck – The deck to construct from

+
+
+
+ +
+
+void switchToGlobalProps()
+

Switch to global field properties.

+

Called on root process to use the global field properties

+
+ +
+
+void switchToDistributedProps()
+

Switch to distributed field properies.

+

Called on root process to use the distributed field properties. setupLocalProps must be called prior to this.

+
+ +
+
+const FieldPropsManager &fieldProps() const override
+

Returns a const ref to current field properties.

+
+ +
+
+const FieldPropsManager &globalFieldProps() const override
+

Returns a const ref to global field properties.

+

Can only be called on root process.

+
+ +
+
+void computeFipRegionStatistics() override
+

Compute basic descriptive statistics about all FIP region sets.

+

MPI-aware version which knows how to compute statistics across all ranks.

+
+ +
+
+const EclipseGrid &getInputGrid() const override
+

Returns a const ref to the eclipse grid.

+

Can only be called on root process.

+
+ +
+
+template<class T>
inline void resetCartesianMapper(const T *mapper)
+

Resets the underlying cartesian mapper \detail This has to be the cartesian mapper of the distributed grid. It will be used to autocreate properties not explicitly stored.

+
+
Template Parameters:
+

T – The type of the cartesian mapper

+
+
Parameters:
+

mapper – The cartesian mapper of the distributed grid

+
+
+
+ +
+
+

Private Members

+
+
+bool m_parProps = false
+
+ +
+
+ParallelFieldPropsManager m_fieldProps
+

True to use distributed properties on root process.

+

The parallel field properties

+
+ +
+
+Parallel::Communication m_comm
+

Collective communication handler.

+
+ +
+
+

Friends

+
+
+friend class PropsDataHandle
+
+ +
+
+ +
+
+class ParallelFieldPropsManager : public FieldPropsManager
+
+

Parallel frontend to the field properties.

+

This is a parallel frontend to the mpi-unaware FieldPropsManager in opm-common. It contains process-local field properties on each process using compressed indexing.

+
+

Public Functions

+
+
+explicit ParallelFieldPropsManager(FieldPropsManager &manager)
+

Constructor.

+
+
Parameters:
+

manager – The field property manager to wrap.

+
+
+
+ +
+
+ParallelFieldPropsManager(FieldPropsManager &manager, Parallel::Communication comm)
+

Constructor.

+
+
Parameters:
+

manager – The field property manager to wrap.

+
+
+
+ +
+
+std::vector<int> actnum() const override
+

Returns actnum vector.

+

If called on non-root process an empty vector is returned

+
+ +
+
+void reset_actnum(const std::vector<int> &actnum) override
+

Reset the actnum vector.

+

Can only be called on root process

+
+ +
+
+std::vector<double> porv(bool global = false) const override
+

Returns the pore volume vector.

+
+ +
+
+const std::vector<int> &get_int(const std::string &keyword) const override
+

Returns an int property using compressed indices.

+
+
Parameters:
+

keyword – Name of property

+
+
+
+ +
+
+const std::vector<double> &get_double(const std::string &keyword) const override
+

Returns a double property using compressed indices.

+
+
Parameters:
+

keyword – Name of property

+
+
+
+ +
+
+std::vector<int> get_global_int(const std::string &keyword) const override
+

Returns an int property using global cartesian indices.

+

+The vector is broadcast from root process

+
+
Parameters:
+

keyword – Name of property

+
+
+
+ +
+
+std::vector<double> get_global_double(const std::string &keyword) const override
+

Returns a double property using global cartesian indices.

+

+The vector is broadcast from root process

+
+
Parameters:
+

keyword – Name of property

+
+
+
+ +
+
+bool has_int(const std::string &keyword) const override
+

Check if an integer property is available.

+
+
Parameters:
+

keyword – Name of property

+
+
+
+ +
+
+bool has_double(const std::string &keyword) const override
+

Check if a double property is available.

+
+
Parameters:
+

keyword – Name of property

+
+
+
+ +
+
+std::vector<std::string> fip_regions() const override
+

Returns a list of registered FIP regions.

+
+ +
+
+template<class T>
inline void resetCartesianMapper(const T *mapper)
+

Resets the underlying cartesian mapper \detail This has to be the cartesian mapper of the distributed grid. It will be used to autocreate properties not explicitly stored.

+
+
Template Parameters:
+

T – The type of the cartesian mapper

+
+
Parameters:
+

mapper – The cartesian mapper of the distributed grid

+
+
+
+ +
+
+bool tran_active(const std::string &keyword) const override
+
+ +
+
+void apply_tran(const std::string &keyword, std::vector<double> &trans) const override
+
+ +
+
+inline void copyTran(const FieldPropsManager &from)
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Protected Attributes

+
+
+std::map<std::string, Fieldprops::FieldData<int>> m_intProps
+

Map of integer properties in process-local compressed indices.

+
+ +
+
+std::map<std::string, Fieldprops::FieldData<double>> m_doubleProps
+

Map of double properties in process-local compressed indices.

+
+ +
+
+FieldPropsManager &m_manager
+

Underlying field property manager (only used on root process).

+
+ +
+
+Parallel::Communication m_comm
+

Collective communication handler.

+
+ +
+
+std::function<int(void)> m_activeSize
+

active size function of the grid

+
+ +
+
+std::function<int(const int)> m_local2Global
+

mapping from local to global cartesian indices

+
+ +
+
+std::unordered_map<std::string, Fieldprops::TranCalculator> m_tran
+

calculators map

+
+ +
+
+

Friends

+
+
+friend class ParallelEclipseState
+
+ +
+
+friend class PropsDataHandle
+
+ +
+
+ +
+
+class ParallelFileMerger
+
+

A functor that merges multiple files of a parallel run to one file.

+

Without care multiple processes might log messages in a parallel run. Non-root processes will do that to seperate files <basename>.<rank>.<extension. This functor will append those file to usual ones and delete the other files.

+
+

Public Functions

+
+
+ParallelFileMerger(const fs::path &output_dir, const std::string &deckname, bool show_fallout = false)
+

Constructor.

+
+
Parameters:
+
    +
  • output_dir – The output directory to use for reading/Writing.

  • +
  • deckname – The name of the deck.

  • +
+
+
+
+ +
+
+void operator()(const fs::path &file)
+
+ +
+
+

Private Functions

+
+
+void appendFile(std::ofstream &of, const fs::path &file, const std::string &rank)
+

Append contents of a file to a stream.

+

of The output stream to use.

+

file The file whose content to append.

+

rank The rank that wrote the file.

+
+ +
+
+

Private Members

+
+
+std::regex debugFileRegex_
+

Regex to capture *.DBG.

+
+ +
+
+std::regex logFileRegex_
+

Regex to capture *.PRT.

+
+ +
+
+std::regex fileWarningRegex_
+

Regex to capture CASENAME.[0-9]+.[A-Z]+.

+
+ +
+
+std::unique_ptr<std::ofstream> debugStream_
+

Stream to *.DBG file.

+
+ +
+
+std::unique_ptr<std::ofstream> logStream_
+

Stream to *.PRT file.

+
+ +
+
+bool show_fallout_
+

Whether to show any logging fallout.

+
+ +
+
+ +
+
+template<class MatrixType>
class ParallellMSWellB
+
+#include <MSWellHelpers.hpp>
+

A wrapper around the B matrix for distributed MS wells.

+

For wells the B matrix, is basically a multiplication of the equation of the perforated cells followed by a reduction (summation) of these to the well equations.

+

This class does that in the functions mv and mmv (from the DUNE matrix interface.

+
+
Template Parameters:
+

MatrixType – The MatrixType of the Matrix B. From this, we deduce the Scalar used for the computation.

+
+
+
+

Public Types

+
+
+using Scalar = typename MatrixType::field_type
+
+ +
+
+

Public Functions

+
+
+ParallellMSWellB(const MatrixType &B, const ParallelWellInfo<Scalar> &parallel_well_info)
+
+ +
+
+template<class X, class Y>
void mv(const X &x, Y &y) const
+

y = A x

+
+ +
+
+template<class X, class Y>
void mmv(const X &x, Y &y) const
+

y = A x

+
+ +
+
+

Private Members

+
+
+const MatrixType &B_
+
+ +
+
+const ParallelWellInfo<Scalar> &parallel_well_info_
+
+ +
+
+ +
+
+class ParallelNLDDPartitioningZoltan
+
+

Partition connectivity graph into non-overlapping domains using the Zoltan graph partitioning software package. Primarily intended for use in NLDD-based non-linear solves.

+
+

Public Types

+
+
+using GlobalCellID = std::function<int(int)>
+

Callback type for mapping a vertex/cell ID to a globally unique ID.

+
+ +
+
+using ZoltanParamMap = std::map<std::string, std::string>
+

Collection of parameters to control the partitioning procedure.

+
+ +
+
+

Public Functions

+
+
+inline explicit ParallelNLDDPartitioningZoltan(const Parallel::Communication comm, const std::size_t numElements, const GlobalCellID &globalCell)
+

Constructor.

+
+
Parameters:
+
    +
  • comm[in] MPI communication object. Needed by Zoltan.

  • +
  • numElements[in] Number of potential vertices in connectivity graph. Typically the total number of cells on the current rank, i.e., both owned cells and overlap cells.

  • +
  • globalCell[in] Callback for mapping (local) vertex IDs to globally unique vertex IDs.

  • +
+
+
+
+ +
+
+inline void registerConnection(std::size_t c1, std::size_t c2)
+

Insert directed graph edge between two vertices.

+
+
Parameters:
+
    +
  • c1[in] Source vertex.

  • +
  • ]in] – c2 Sink/destination vertex.

  • +
+
+
+
+ +
+
+std::vector<int> partitionElements(const ZoltanParamMap &params) const
+

Partition connectivity graph using Zoltan graph partitioning package.

+

Honours any prescribed requirement that certain cells be placed in a single domain/block.

+
+
Parameters:
+

params[in] Parameters for Zoltan. Override default settings.

+
+
Returns:
+

Partition vector of size numElements. Reachable vertices/cells are partitioned into N blocks numbered 0..N-1. Unreachable vertices get a block ID of -1.

+
+
+
+ +
+
+void addVertexGroup(const std::vector<int> &vertices)
+

Add a group of vertices that should be merged together. Must be called before compress().

+
+
Parameters:
+

vertices[in] Vector of vertex IDs to merge

+
+
+
+ +
+
+

Private Types

+
+
+using Connection = std::pair<std::size_t, std::size_t>
+

Connection/graph edge.

+
+ +
+
+

Private Members

+
+
+std::vector<std::vector<int>> vertexGroups_ = {}
+
+ +
+
+Parallel::Communication comm_ = {}
+

MPI communication object. Needed by Zoltan.

+
+ +
+
+std::size_t numElements_ = {}
+

Maximum number of vertices in connectivity graph. Needed to size partition vector return value.

+
+ +
+
+GlobalCellID globalCell_ = {}
+

Callback for mapping (local) vertex/cell IDs to globally unique vertex/cell IDs.

+
+ +
+
+std::vector<Connection> conns_ = {}
+

Connectivity graph edges.

+
+ +
+
+ +
+
+template<class Matrix, class Domain, class Range, class ParallelInfoT>
class ParallelOverlappingILU0 : public Dune::PreconditionerWithUpdate<Domain, Range>, public Dune::PreconditionerWithUpdate<Domain, Range>, public Dune::PreconditionerWithUpdate<Domain, Range>, public Dune::PreconditionerWithUpdate<Domain, Range>
+
+

A two-step version of an overlapping Schwarz preconditioner using one step ILU0 as.

+

This preconditioner differs from a ParallelRestrictedOverlappingSchwarz with Dune:SeqILU0 in the following way: During apply we make sure that the current residual is consistent (i.e. each process knows the same value for each index. Then we solve Ly = d for y and make y consistent again. Last we solve Ux = y and make sure that x is consistent. In contrast for ParallelRestrictedOverlappingSchwarz

we solve (LU)x = d for x without forcing consistency between the two steps.

+

This preconditioner differs from a

+ParallelRestrictedOverlappingSchwarz with Dune:SeqILU0 in the follwing way: During apply we make sure that the current residual is consistent (i.e. each process knows the same value for each index. The we solve Ly= d for y and make y consistent again. Last we solve Ux = y and make sure that x is consistent. In contrast for ParallelRestrictedOverlappingSchwarz we solve (LU)x = d for x without forcing consistency between the two steps.

+
+
Template Parameters:
+
    +
  • Matrix – The type of the Matrix.

  • +
  • Domain – The type of the Vector representing the domain.

  • +
  • Range – The type of the Vector representing the range.

  • +
  • ParallelInfo – The type of the parallel information object used, e.g. Dune::OwnerOverlapCommunication

  • +
  • Matrix – The type of the Matrix.

  • +
  • Domain – The type of the Vector representing the domain.

  • +
  • Range – The type of the Vector representing the range.

  • +
  • ParallelInfo – The type of the parallel information object used, e.g. Dune::OwnerOverlapCommunication

  • +
+
+
+
+

Public Types

+
+
+using matrix_type = typename std::remove_const<Matrix>::type
+

The matrix type the preconditioner is for.

+
+ +
+
+using domain_type = Domain
+

The domain type of the preconditioner.

+
+ +
+
+using range_type = Range
+

The range type of the preconditioner.

+
+ +
+
+using field_type = typename Domain::field_type
+

The field type of the preconditioner.

+
+ +
+
+using block_type = typename matrix_type::block_type
+
+ +
+
+using size_type = typename matrix_type::size_type
+
+ +
+
+typedef std::remove_const<Matrix>::type matrix_type
+

The matrix type the preconditioner is for.

+
+ +
+
+typedef Domain domain_type
+

The domain type of the preconditioner.

+
+ +
+
+typedef Range range_type
+

The range type of the preconditioner.

+
+ +
+
+typedef Domain::field_type field_type
+

The field type of the preconditioner.

+
+ +
+
+typedef matrix_type::block_type block_type
+
+ +
+
+typedef matrix_type::size_type size_type
+
+ +
+
+using matrix_type = typename std::remove_const<Matrix>::type
+

The matrix type the preconditioner is for.

+
+ +
+
+using domain_type = Domain
+

The domain type of the preconditioner.

+
+ +
+
+using range_type = Range
+

The range type of the preconditioner.

+
+ +
+
+using field_type = typename Domain::field_type
+

The field type of the preconditioner.

+
+ +
+
+using block_type = typename matrix_type::block_type
+
+ +
+
+using size_type = typename matrix_type::size_type
+
+ +
+
+typedef std::remove_const<Matrix>::type matrix_type
+

The matrix type the preconditioner is for.

+
+ +
+
+typedef Domain domain_type
+

The domain type of the preconditioner.

+
+ +
+
+typedef Range range_type
+

The range type of the preconditioner.

+
+ +
+
+typedef Domain::field_type field_type
+

The field type of the preconditioner.

+
+ +
+
+typedef matrix_type::block_type block_type
+
+ +
+
+typedef matrix_type::size_type size_type
+
+ +
+
+

Public Functions

+
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+Dune::SolverCategory::Category category() const override
+
+ +
+
+ParallelOverlappingILU0(const Matrix &A, const int n, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+ParallelOverlappingILU0(const Matrix &A, const ParallelInfo &comm, const int n, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor gets all parameters to operate the prec.

+

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • comm – communication object, e.g. Dune::OwnerOverlapCopyCommunication

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+ParallelOverlappingILU0(const Matrix &A, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+ParallelOverlappingILU0(const Matrix &A, const ParallelInfo &comm, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • comm – communication object, e.g. Dune::OwnerOverlapCopyCommunication

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+ParallelOverlappingILU0(const Matrix &A, const ParallelInfo &comm, const field_type w, MILU_VARIANT milu, size_type interiorSize, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • interiorSize – The number of interior/owner rows in the matrix.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+inline void pre(Domain&, Range&) override
+

Prepare the preconditioner.

+
+ +
+
+void apply(Domain &v, const Range &d) override
+

Apply the preconditoner.

+
+ +
+
+template<class V>
void copyOwnerToAll(V &v) const
+
+ +
+
+inline void post(Range&) override
+

Clean up.

+
+ +
+
+virtual void update() override
+
+ +
+
+inline Dune::SolverCategory::Category category() const override
+
+ +
+
+template<class BlockType, class Alloc>
inline ParallelOverlappingILU0(const Dune::BCRSMatrix<BlockType, Alloc> &A, const int n, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+template<class BlockType, class Alloc>
inline ParallelOverlappingILU0(const Dune::BCRSMatrix<BlockType, Alloc> &A, const ParallelInfo &comm, const int n, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor gets all parameters to operate the prec.

+

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • comm – communication object, e.g. Dune::OwnerOverlapCopyCommunication

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+template<class BlockType, class Alloc>
inline ParallelOverlappingILU0(const Dune::BCRSMatrix<BlockType, Alloc> &A, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+template<class BlockType, class Alloc>
inline ParallelOverlappingILU0(const Dune::BCRSMatrix<BlockType, Alloc> &A, const ParallelInfo &comm, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • comm – communication object, e.g. Dune::OwnerOverlapCopyCommunication

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+template<class BlockType, class Alloc>
inline ParallelOverlappingILU0(const Dune::BCRSMatrix<BlockType, Alloc> &A, const ParallelInfo &comm, const field_type w, MILU_VARIANT milu, size_type interiorSize, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • interiorSize – The number of interior/owner rows in the matrix.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+inline virtual void pre(Domain &x, Range &b) override
+

Prepare the preconditioner.

+
+ +
+
+inline virtual void apply(Domain &v, const Range &d) override
+

Apply the preconditoner.

+
+ +
+
+template<class V>
inline void copyOwnerToAll(V &v) const
+
+ +
+
+inline virtual void post(Range &x) override
+

Clean up.

+
+ +
+
+inline virtual void update() override
+
+ +
+
+Dune::SolverCategory::Category category() const override
+
+ +
+
+ParallelOverlappingILU0(const Matrix &A, const int n, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+ParallelOverlappingILU0(const Matrix &A, const ParallelInfo &comm, const int n, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor gets all parameters to operate the prec.

+

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • comm – communication object, e.g. Dune::OwnerOverlapCopyCommunication

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+ParallelOverlappingILU0(const Matrix &A, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+ParallelOverlappingILU0(const Matrix &A, const ParallelInfo &comm, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • comm – communication object, e.g. Dune::OwnerOverlapCopyCommunication

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+ParallelOverlappingILU0(const Matrix &A, const ParallelInfo &comm, const field_type w, MILU_VARIANT milu, size_type interiorSize, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • interiorSize – The number of interior/owner rows in the matrix.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+inline void pre(Domain&, Range&) override
+

Prepare the preconditioner.

+
+ +
+
+void apply(Domain &v, const Range &d) override
+

Apply the preconditoner.

+
+ +
+
+template<class V>
void copyOwnerToAll(V &v) const
+
+ +
+
+inline void post(Range&) override
+

Clean up.

+
+ +
+
+virtual void update() override
+
+ +
+
+inline Dune::SolverCategory::Category category() const override
+
+ +
+
+template<class BlockType, class Alloc>
inline ParallelOverlappingILU0(const Dune::BCRSMatrix<BlockType, Alloc> &A, const int n, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+template<class BlockType, class Alloc>
inline ParallelOverlappingILU0(const Dune::BCRSMatrix<BlockType, Alloc> &A, const ParallelInfo &comm, const int n, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor gets all parameters to operate the prec.

+

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • comm – communication object, e.g. Dune::OwnerOverlapCopyCommunication

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+template<class BlockType, class Alloc>
inline ParallelOverlappingILU0(const Dune::BCRSMatrix<BlockType, Alloc> &A, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+template<class BlockType, class Alloc>
inline ParallelOverlappingILU0(const Dune::BCRSMatrix<BlockType, Alloc> &A, const ParallelInfo &comm, const field_type w, MILU_VARIANT milu, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • comm – communication object, e.g. Dune::OwnerOverlapCopyCommunication

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+template<class BlockType, class Alloc>
inline ParallelOverlappingILU0(const Dune::BCRSMatrix<BlockType, Alloc> &A, const ParallelInfo &comm, const field_type w, MILU_VARIANT milu, size_type interiorSize, bool redblack = false, bool reorder_sphere = true)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+

See also

+

MILU_VARIANT.

+
+

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • n – ILU fill in level (for testing). This does not work in parallel.

  • +
  • w – The relaxation factor.

  • +
  • milu – The modified ILU variant to use. 0 means traditional ILU.

  • +
  • interiorSize – The number of interior/owner rows in the matrix.

  • +
  • redblack – Whether to use a red-black ordering.

  • +
  • reorder_sphere – If true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

  • +
+
+
+
+ +
+
+inline virtual void pre(Domain &x, Range &b) override
+

Prepare the preconditioner.

+
+ +
+
+inline virtual void apply(Domain &v, const Range &d) override
+

Apply the preconditoner.

+
+ +
+
+template<class V>
inline void copyOwnerToAll(V &v) const
+
+ +
+
+inline virtual void post(Range &x) override
+

Clean up.

+
+ +
+
+inline virtual void update() override
+
+ +
+
+

Protected Functions

+
+
+Range &reorderD(const Range &d)
+

Reorder D if needed and return a reference to it.

+
+ +
+
+Domain &reorderV(Domain &v)
+

Reorder V if needed and return a reference to it.

+
+ +
+
+void reorderBack(const Range &reorderedV, Range &v)
+
+ +
+
+inline Range &reorderD(const Range &d)
+

Reorder D if needed and return a reference to it.

+
+ +
+
+inline Domain &reorderV(Domain &v)
+

Reorder V if needed and return a reference to it.

+
+ +
+
+inline void reorderBack(const Range &reorderedV, Range &v)
+
+ +
+
+Range &reorderD(const Range &d)
+

Reorder D if needed and return a reference to it.

+
+ +
+
+Domain &reorderV(Domain &v)
+

Reorder V if needed and return a reference to it.

+
+ +
+
+void reorderBack(const Range &reorderedV, Range &v)
+
+ +
+
+inline Range &reorderD(const Range &d)
+

Reorder D if needed and return a reference to it.

+
+ +
+
+inline Domain &reorderV(Domain &v)
+

Reorder V if needed and return a reference to it.

+
+ +
+
+inline void reorderBack(const Range &reorderedV, Range &v)
+
+ +
+
+

Protected Attributes

+
+
+std::unique_ptr<Matrix> ILU_
+

The ILU0 decomposition of the matrix.

+
+ +
+
+CRS lower_
+

The ILU0 decomposition of the matrix.

+
+ +
+
+CRS upper_
+
+ +
+
+std::vector<block_type> inv_
+
+ +
+
+std::vector<std::size_t> ordering_
+

the reordering of the unknowns

+
+ +
+
+Range reorderedD_
+

The reordered right hand side.

+
+ +
+
+Domain reorderedV_
+

The reordered left hand side.

+
+ +
+
+const ParallelInfo *comm_
+
+ +
+
+const field_type w_
+

The relaxation factor to use.

+
+ +
+
+const bool relaxation_
+
+ +
+
+size_type interiorSize_
+
+ +
+
+const Matrix *A_
+
+ +
+
+int iluIteration_
+
+ +
+
+MILU_VARIANT milu_
+
+ +
+
+bool redBlack_
+
+ +
+
+bool reorderSphere_
+
+ +
+
+

Private Types

+
+
+using ParallelInfo = ParallelInfoT
+
+ +
+
+typedef ParallelInfoT ParallelInfo
+
+ +
+
+using ParallelInfo = ParallelInfoT
+
+ +
+
+typedef ParallelInfoT ParallelInfo
+
+ +
+
+ +
+
+template<class F>
class ParallelOverlappingILU0Args : public Dune::Amg::DefaultSmootherArgs<F>, public Dune::Amg::DefaultSmootherArgs<F>, public Dune::Amg::DefaultSmootherArgs<F>, public Dune::Amg::DefaultSmootherArgs<F>, public Dune::Amg::DefaultSmootherArgs<F>
+
+
+

Public Functions

+
+
+inline explicit ParallelOverlappingILU0Args(MILU_VARIANT milu = MILU_VARIANT::ILU)
+
+ +
+
+inline void setMilu(MILU_VARIANT milu)
+
+ +
+
+inline MILU_VARIANT getMilu() const
+
+ +
+
+inline void setN(int n)
+
+ +
+
+inline int getN() const
+
+ +
+
+inline ParallelOverlappingILU0Args(MILU_VARIANT milu = MILU_VARIANT::ILU)
+
+ +
+
+inline void setMilu(MILU_VARIANT milu)
+
+ +
+
+inline MILU_VARIANT getMilu() const
+
+ +
+
+inline void setN(int n)
+
+ +
+
+inline int getN() const
+
+ +
+
+inline ParallelOverlappingILU0Args(MILU_VARIANT milu = MILU_VARIANT::ILU)
+
+ +
+
+inline void setMilu(MILU_VARIANT milu)
+
+ +
+
+inline MILU_VARIANT getMilu() const
+
+ +
+
+inline void setN(int n)
+
+ +
+
+inline int getN() const
+
+ +
+
+inline ParallelOverlappingILU0Args(MILU_VARIANT milu = MILU_VARIANT::ILU)
+
+ +
+
+inline void setMilu(MILU_VARIANT milu)
+
+ +
+
+inline MILU_VARIANT getMilu() const
+
+ +
+
+inline void setN(int n)
+
+ +
+
+inline int getN() const
+
+ +
+
+inline ParallelOverlappingILU0Args(MILU_VARIANT milu = MILU_VARIANT::ILU)
+
+ +
+
+inline void setMilu(MILU_VARIANT milu)
+
+ +
+
+inline MILU_VARIANT getMilu() const
+
+ +
+
+inline void setN(int n)
+
+ +
+
+inline int getN() const
+
+ +
+
+

Private Members

+
+
+MILU_VARIANT milu_
+
+ +
+
+int n_
+
+ +
+
+ +
+
+template<class Scalar>
class ParallelPAvgCalculator : public PAvgCalculator<Scalar>
+
+

Facility for deriving well-level pressure values from selected block-averaging procedures. Applicable to stopped wells which don’t have a flowing bottom-hole pressure. Mainly useful for reporting.

+

Parallel edition. Handles distributed wells.

+
+

Public Functions

+
+
+ParallelPAvgCalculator(const Parallel::Communication &comm, const GridDims &cellIndexMap, const WellConnections &connections)
+

Constructor

+
+
Parameters:
+
    +
  • comm[in] MPI communication object. Typically

    ParallelWellInfo::communication() 
    +
    +
    +.

  • +
  • cellIndexMap[in] Cell index triple map ((I,J,K) <-> global).

  • +
  • connections[in] List of reservoir connections for single well.

  • +
+
+
+
+ +
+
+

Private Types

+
+
+using Accumulator = typename PAvgCalculator<Scalar>::Accumulator
+
+ +
+
+

Private Functions

+
+
+void collectGlobalContributions() override
+

Communicate local contributions and collect global (off-rank) contributions.

+

Reads from and writes to base class data members accumCTF_ and accumPV_.

+
+ +
+
+

Private Members

+
+
+std::reference_wrapper<const Parallel::Communication> comm_
+

MPI communication object.

+
+ +
+
+ +
+
+template<class Scalar>
class ParallelPAvgDynamicSourceData : public PAvgDynamicSourceData<Scalar>
+
+

Dynamic source data for block-average pressure calculations. Specialisation for parallel runs.

+
+

Public Types

+
+
+using GlobalToLocal = std::function<int(const std::size_t)>
+

Translate globally unique, linearised Cartesian cell indices to local, on-rank, cell indices. Assumed to return a negative value result if the input cell index is not owned by the current rank.

+
+ +
+
+template<typename T>
using SourceDataSpan = typename PAvgDynamicSourceData<Scalar>::template SourceDataSpan<T>
+

Fixed-width span/view of a underlying range of contiguous elements.

+

Interface type for populating or providing dynamic source information for a specified location (typically a cell).

+
+
Template Parameters:
+

T – Element type. Const or non-const as needed. Typically Scalar or

const Scalar 
+
+
+.

+
+
+
+ +
+
+using Evaluator = std::function<void(int, SourceDataSpan<Scalar>)>
+

Collect source term contributions from local, on-rank, cell.

+

Called as

eval(cellIndex, sourceTerm)
+
+
+ in which cellIndex is the local, on-rank, cell index in the range 0 to #active cells on rank - 1. Function eval is expected to fill in/assign all sourceTerm items for this cell.

+
+ +
+
+

Public Functions

+
+
+ParallelPAvgDynamicSourceData(const Parallel::Communication &comm, const std::vector<std::size_t> &sourceLocations, GlobalToLocal localCellIdx)
+

Constructor

+
+
Parameters:
+
    +
  • comm[in] MPI communication object. Typically

    grid.comm() 
    +
    +
    + from the main simulation grid.

  • +
  • sourceLocations[in] Known locations, typically linearised global call IDs, for which to enable collecting/reporting dynamic source data. Typically

    allWBPCells() 
    +
    +
    + from a PAvgCalculatorCollection.

  • +
  • localCellIdx[in] Translation from global, Cartesian cell indices to local, on-rank, cell indices.

  • +
+
+
+
+ +
+
+void setToZero()
+

Clear contents of local source term contributions.

+

Mostly useful when collecting source term contributions along the well bore.

+
+ +
+
+void reconstruct(const std::vector<std::size_t> &sourceLocations, GlobalToLocal localCellIdx)
+

Reconstruct Source Data backing storage and internal mapping tables

+

Effectively replaces the original object formed by the constructor. Mainly intended for updating objects as new wells and/or new reservoir connections are introduced.

+
+
Parameters:
+
    +
  • sourceLocations[in] Known locations, typically linearised global call IDs, for which to enable collecting/reporting dynamic source data. Typically

    allWBPCells() 
    +
    +
    + from a PAvgCalculatorCollection.

  • +
  • localCellIdx[in] Translation from global, Cartesian cell indices to local, on-rank, cell indices.

  • +
+
+
+
+ +
+
+void collectLocalSources(Evaluator eval)
+

Compute local, on-rank, contributions to the collection of source terms.

+
+
Parameters:
+

eval[in] Source term evaluator object.

+
+
+
+ +
+
+void synchroniseSources()
+

Exchange local contributions to build full, global view of all source terms.

+
+ +
+
+

Private Functions

+
+
+std::vector<Scalar>::size_type storageIndex(typename std::vector<Scalar>::size_type elemIndex) const override
+

Translate element index into storage index.

+

Customisation point.

+
+
Parameters:
+

elemIndex[in] Source element index.

+
+
Returns:
+

Storage (starting) index in PAvgDynamicSourceData::src_.

+
+
+
+ +
+
+void finaliseConstruction(const std::vector<std::size_t> &sourceLocations, GlobalToLocal localCellIdx)
+

Identify local source term elements on rank and build communication pattern for all source terms.

+

Assigns storageIndex_, allSizes_, and startPointers_.

+
+
Parameters:
+
    +
  • sourceLocations[in] Known locations, typically linearised global call IDs, for which to enable collecting/reporting dynamic source data. Typically

    allWBPCells() 
    +
    +
    + from a PAvgCalculatorCollection.

  • +
  • localCellIdx[in] Translation from global, Cartesian cell indices to local, on-rank, cell indices.

  • +
+
+
+
+ +
+
+SourceDataSpan<Scalar> localSourceTerm(const std::size_t localIx)
+

Form mutable data span into non-default backing store.

+
+
Parameters:
+

localIx[in] Logical element index into localSrc_.

+
+
Returns:
+

Mutable view into localSrc_.

+
+
+
+ +
+
+void defineCommunication()
+

Build communication pattern for all source terms.

+

Assigns storageIndex_, allSizes_, and startPointers_.

+
+ +
+
+

Private Members

+
+
+std::reference_wrapper<const Parallel::Communication> comm_
+

MPI communication object.

+
+ +
+
+std::vector<LocalLocation> locations_ = {}
+

Subset of source locations owned by current rank.

+
+ +
+
+std::vector<Scalar> localSrc_ = {}
+

Source data values owned by current rank.

+
+ +
+
+std::vector<typename std::vector<Scalar>::size_type> storageIndex_ = {}
+

Translation map from element index to storage index in PAvgDynamicSourceData::src_.

+
+ +
+
+std::vector<int> allSizes_ = {}
+

Receive size from all ranks (allgatherv()).

+
+ +
+
+std::vector<int> startPointers_ = {}
+

Receive displacements for all ranks (allgatherv()).

+
+ +
+
+ +
+
+template<class Range, class Domain, class ParallelInfo, class SeqPreconditioner = Dune::Preconditioner<Range, Domain>>
class ParallelRestrictedOverlappingSchwarz : public Dune::Preconditioner<Range, Domain>
+
+

Block parallel preconditioner.

+

This is essentially a wrapper that takes a sequential preconditioner. In each step the sequential preconditioner is applied to the whole subdomain and then all owner data points are updated on all other processes from the processor that knows the complete matrix row for this data point (in dune-istl speak that is the one that owns the data).

+

Note that this is different from the usual approach in dune-istl where the application of the sequential preconditioner only takes place on the (owner) partition of the process disregarding any overlap/ghost region.

+

For more information see https://www.cs.colorado.edu/~cai/papers/rash.pdf

+
+
Template Parameters:
+
    +
  • Domain – The type of the Vector representing the domain.

  • +
  • Range – The type of the Vector representing the range.

  • +
  • ParallelInfo – The type of the parallel information object used, e.g. Dune::OwnerOverlapCommunication

  • +
  • SeqPreconditioner – The underlying sequential preconditioner to use.

  • +
+
+
+
+

Public Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator category
+

The category the precondtioner is part of.

+
+ +
+ +
+
+typedef Domain domain_type
+

The domain type of the preconditioner.

+
+ +
+
+typedef Range range_type
+

The range type of the preconditioner.

+
+ +
+
+typedef Domain::field_type field_type
+

The field type of the preconditioner.

+
+ +
+
+typedef ParallelInfo communication_type
+

The type of the communication object.

+
+ +
+
+

Public Functions

+
+
+inline ParallelRestrictedOverlappingSchwarz(SeqPreconditioner &p, const communication_type &c)
+

Constructor.

+

constructor gets all parameters to operate the prec.

+
+
Parameters:
+
    +
  • p – The sequential preconditioner.

  • +
  • c – The communication object for syncing overlap and copy data points. (E.~g. OwnerOverlapCommunication )

  • +
+
+
+
+ +
+
+inline virtual void pre(Domain &x, Range &b)
+

Prepare the preconditioner.

+
+ +
+
+inline virtual void apply(Domain &v, const Range &d)
+

Apply the preconditioner.

+
+ +
+
+template<bool forward>
inline void apply(Domain &v, const Range &d)
+
+ +
+
+inline virtual void post(Range &x)
+

Clean up.

+
+ +
+
+

Private Members

+
+
+SeqPreconditioner &preconditioner_
+

a sequential preconditioner

+
+ +
+
+const communication_type &communication_
+

the communication object

+
+ +
+
+

Friends

+
+
+friend class Dune::Amg ::ConstructionTraits< ParallelRestrictedOverlappingSchwarz< Range, Domain, ParallelInfo, SeqPreconditioner > >
+
+ +
+
+ +
+
+template<typename Scalar>
class ParallelStandardWellB
+
+#include <WellHelpers.hpp>
+

A wrapper around the B matrix for distributed wells.

+

For standard wells the B matrix, is basically a multiplication of the equation of the perforated cells followed by a reduction (summation) of these to the well equations.

+

This class does that in the functions mv and mmv (from the DUNE matrix interface.

+
+
Template Parameters:
+

Scalar – The scalar used for the computation.

+
+
+
+

Public Types

+
+
+using Block = Dune::DynamicMatrix<Scalar>
+
+ +
+
+using Matrix = Dune::BCRSMatrix<Block>
+
+ +
+
+

Public Functions

+
+
+ParallelStandardWellB(const Matrix &B, const ParallelWellInfo<Scalar> &parallel_well_info)
+
+ +
+
+template<class X, class Y>
void mv(const X &x, Y &y) const
+

y = A x

+
+ +
+
+template<class X, class Y>
void mmv(const X &x, Y &y) const
+

y = A x

+
+ +
+
+

Private Members

+
+
+const Matrix &B_
+
+ +
+
+const ParallelWellInfo<Scalar> &parallel_well_info_
+
+ +
+
+ +
+
+template<class Scalar>
class ParallelWBPCalculation
+
+

Parallel facility for managing the on-rank collection and global distribution of WBPn source values as well as local calculation and distributed reduction of the inferred WBPn report values.

+
+

Public Types

+
+
+using GlobalToLocal = typename ParallelPAvgDynamicSourceData<Scalar>::GlobalToLocal
+

Callback for inferring the source locations which are active on the current MPI rank.

+
+ +
+
+using Evaluator = typename ParallelPAvgDynamicSourceData<Scalar>::Evaluator
+

Callback for evaluating WBPn source terms on the current MPI rank.

+
+ +
+
+using EvaluatorFactory = std::function<Evaluator()>
+

Callback for constructing a source term evaluation function on the current MPI rank. Needed for deferred construction of per-well source term evaluation functions.

+
+ +
+
+

Public Functions

+
+
+explicit ParallelWBPCalculation(const GridDims &cellIndexMap, const Parallel::Communication &gridComm)
+

Constructor.

+
+
Parameters:
+
    +
  • cellIndexMap[in] Cell index triple map ((I,J,K) <-> global).

  • +
  • gridComm[in] Main, grid level, global communicator.

  • +
+
+
+
+ +
+
+ParallelWBPCalculation &localCellIndex(GlobalToLocal localCellIdx)
+

Assign translation function for inferring the on-rank IDs of the known source locations.

+
+
Parameters:
+

localCellIdx[in] Translation from global, Cartesian cell indices to local, on-rank, cell indices.

+
+
Returns:
+

*this 
+
+
+

+
+
+
+ +
+
+ParallelWBPCalculation &evalCellSource(Evaluator evalCellSrc)
+

Assign evaluation function for computing the on-rank, cell level WBPn source terms.

+
+
Parameters:
+

evalCellSrc[in] Source term evaluation function.

+
+
Returns:
+

*this 
+
+
+

+
+
+
+ +
+
+std::size_t createCalculator(const Well &well, const ParallelWellInfo<Scalar> &parallelWellInfo, const std::vector<int> &localConnIdx, EvaluatorFactory makeWellSourceEvaluator)
+

Create, or reassign, a WBPn calculation object for a particular well.

+
+
Parameters:
+
    +
  • well[in] Well for which to create a WBPn calculation object.

  • +
  • parallelWellInfo[in] Communicator object for the ranks sharing this well.

  • +
  • localConnIdx[in] Local (on-rank) connection index. Sized according to

    well.getConnections().size() 
    +
    +
    +, but with a non-negative entry only for those active connections that intersect the current rank. If
    localConnIdx[i] == j
    +
    +
    +, then the i-th global connection is the j-th active connection on the current rank. Use a negative value to identify a connection that is either not flowing or which does not intersect the current MPI rank.

  • +
  • makeWellSourceEvaluator[in] Factory function to support deferred creation of an evaluation function for the per-connection WBP source terms.

  • +
+
+
Returns:
+

Calculator object index. Must be used in subsequent calls to inferBlockAveragePressures() and averagePressures() for this well.

+
+
+
+ +
+
+void defineCommunication()
+

Set up communication patterns for both cell and connection level source terms and partial/intermediate WBPn results.

+

Clients must call this function once all calculation objects have been created, and strictly before the first call to member function collectDynamicValues().

+
+ +
+
+void collectDynamicValues()
+

Collect all on-rank source term value and distribute those on-rank values to all other MPI ranks.

+

Will call the registered source term evaluation functions for all on-rank source locations. Once this function returns, all ranks have a full view of all cell level source term values, and all ranks which share an individual well have a full view of the per-connection source term values for that well.

+

Will throw an object of type

std::logic_error 
+
+
+ if the communication patterns have not been fully defined through a prior call to member function defineCommunication().

+
+ +
+
+void inferBlockAveragePressures(const std::size_t calcIndex, const PAvg &controls, const Scalar gravity, const Scalar refDepth)
+

Compute WBPn report values for a single well.

+
+
Parameters:
+
    +
  • calcIndex[in] Calculator object index. Return value from a previous call to member function createCalculator().

  • +
  • controls[in] Pressure averaging procedure controls for this well.

  • +
  • gravity[in] Strength of gravity acceleration.

  • +
  • refDepth[in] WBPn reference depth. Typically

    Well::getWPaveRefDepth() 
    +
    +
    +.

  • +
+
+
+
+ +
+
+const PAvgCalculatorResult<Scalar> &averagePressures(const std::size_t calcIndex) const
+

Retrieve results from most recent WBPn value calculation for specified well.

+
+
Parameters:
+

calcIndex[in] Calculator object index. Return value from a previous call to member function createCalculator().

+
+
Returns:
+

Result set from most recent call to member function inferBlockAveragePressures() for calcIndex.

+
+
+
+ +
+
+

Private Types

+
+
+using WellID = typename std::vector<SourceData>::size_type
+

Calculation object IDs.

+
+ +
+
+

Private Functions

+
+
+void pruneInactiveWBPCells()
+

Eliminate inactive cells from the source locations backing reservoirSrc_.

+
+ +
+
+void pruneInactiveWBPCellsSerial()
+

Serial implementation of pruneInactiveWBPCells().

+
+ +
+
+void pruneInactiveWBPCellsParallel()
+

Parallel implementation of pruneInactiveWBPCells().

+
+ +
+
+void defineReservoirCommunication()
+

Define communication patterns for reservoirSrc_.

+
+ +
+
+void defineWellCommunication(const std::size_t well)
+

Define communication patterns for source terms pertaining to the reservoir connections of a single well.

+
+
Parameters:
+

well[in] Well for which to define communication pattern.

+
+
+
+ +
+
+PAvgCalculator<Scalar>::Sources makeEvaluationSources(const WellID well) const
+

Aggregate pertinent source terms for the WBPn calculation object of a single well.

+
+
Parameters:
+

well[in] Well for which to aggregate the pertient source terms.

+
+
Returns:
+

WBPn source terms aggregated for well.

+
+
+
+ +
+
+

Private Members

+
+
+std::reference_wrapper<const GridDims> cellIndexMap_
+

Cell index triple map ((I,J,K) <-> global).

+
+ +
+
+SourceData reservoirSrc_
+

Source term object for the reservoir cells.

+
+ +
+
+PAvgCalculatorCollection<Scalar> calculators_ = {}
+

Collection of WBPn calculation objects. One object for each well on rank.

+
+ +
+
+std::vector<SourceData> wellConnSrc_ = {}
+

Source term objects for each well on rank.

+
+ +
+
+std::vector<LocalConnSet> localConnSet_ = {}
+

Local connection indices for each well on rank.

+
+ +
+
+ +
+
+template<class Scalar>
class ParallelWellInfo
+
+

Class encapsulating some information about parallel wells.

+

e.g. It provides a communicator for well information

+
+

Public Functions

+
+
+explicit ParallelWellInfo(const std::string &name = {""}, bool hasLocalCells = true)
+

Constructs object using MPI_COMM_SELF.

+
+ +
+
+ParallelWellInfo(const std::pair<std::string, bool> &well_info, Parallel::Communication allComm)
+

Constructs object with communication between all rank sharing a well.

+
+
Parameters:
+
    +
  • well_info – Pair of well name and whether local cells might be perforated on this rank

  • +
  • allComm – The communication object with all MPI ranks active in the simulation. Default is the one with all ranks available.

  • +
+
+
+
+ +
+
+inline const Parallel::Communication &communication() const
+
+ +
+
+void communicateFirstPerforation(bool hasFirst)
+

Collectively decide which rank has first perforation.

+
+ +
+
+void setActiveToLocalMap(const std::unordered_map<int, int> active_to_local_map) const
+
+ +
+
+int activeToLocal(const int activeIndex) const
+
+ +
+
+int localToActive(std::size_t localIndex) const
+
+ +
+
+int globalToLocal(const int globalIndex) const
+
+ +
+
+int localToGlobal(std::size_t localIndex) const
+
+ +
+
+template<class T>
T broadcastFirstPerforationValue(const T &t) const
+

If the well does not have any open connections the member rankWithFirstPerf is not initialized, and no broadcast is performed. In this case the argument is returned unmodified.

+
+ +
+
+std::vector<Scalar> communicateAboveValues(Scalar first_value, const Scalar *current, std::size_t size) const
+

Creates an array of values for the perforation above.

+
+
Parameters:
+
    +
  • first_value – Value to use for above of the first perforation

  • +
  • current – C-array of the values at the perforations

  • +
  • size – The size of the C-array and the returned vector

  • +
+
+
Returns:
+

a vector containing the values for the perforation above.

+
+
+
+ +
+
+std::vector<Scalar> communicateAboveValues(Scalar first_value, const std::vector<Scalar> &current) const
+

Creates an array of values for the perforation above.

+
+
Parameters:
+
    +
  • first_value – Value to use for above of the first perforation

  • +
  • current – vector of current values

  • +
+
+
+
+ +
+
+std::vector<Scalar> communicateBelowValues(Scalar last_value, const Scalar *current, std::size_t size) const
+

Creates an array of values for the perforation below.

+
+
Parameters:
+
    +
  • last_value – Value to use for below of the last perforation

  • +
  • current – C-array of the values at the perforations

  • +
  • size – The size of the C-array and the returned vector

  • +
+
+
Returns:
+

a vector containing the values for the perforation above.

+
+
+
+ +
+
+std::vector<Scalar> communicateBelowValues(Scalar last_value, const std::vector<Scalar> &current) const
+

Creates an array of values for the perforation above.

+
+
Parameters:
+
    +
  • last_value – Value to use for below of the last perforation

  • +
  • current – vector of current values

  • +
+
+
+
+ +
+
+void pushBackEclIndex(int above, int current)
+

Adds information about the ecl indices of the perforations.

+
+

Warning

+

Theses indices need to be push in the same order as they appear in the ECL well specifiation. Use -1 if there is no perforation above.

+
+
+
Parameters:
+
    +
  • above – The ECL index of the next open perforation above.

  • +
  • current – The ECL index of the current open perforation.

  • +
+
+
+
+ +
+
+inline const std::string &name() const
+

Name of the well.

+
+ +
+
+inline bool hasLocalCells() const
+

Whether local cells are perforated somewhen.

+
+ +
+
+inline bool isOwner() const
+
+ +
+
+void beginReset()
+

Inidicate that we will reset the ecl index information.

+

+

See also

+

pushBackEclIndex;

+
+

+
+ +
+
+void endReset()
+

Inidicate completion of reset of the ecl index information.

+
+ +
+
+template<typename It>
It::value_type sumPerfValues(It begin, It end) const
+

Sum all the values of the perforations.

+
+ +
+
+template<class RAIterator>
inline void partialSumPerfValues(RAIterator begin, RAIterator end) const
+

Do a (in place) partial sum on values attached to all perforations.

+

For distributed wells this may include perforations stored elsewhere. The result is stored in ther range given as the parameters

+
+
Parameters:
+
    +
  • begin – The start of the range

  • +
  • ebd – The end of the range

  • +
+
+
Template Parameters:
+

RAIterator – The type og random access iterator

+
+
+
+ +
+
+void clear()
+

Free data of communication data structures.

+
+ +
+
+const GlobalPerfContainerFactory<Scalar> &getGlobalPerfContainerFactory() const
+

Get a factor to create a global representation of peforation data.

+

That is a container that holds data for every perforation no matter where it is stored. Container is ordered via ascendings index of the perforations in the ECL schedule.

+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int INVALID_ECL_INDEX = -1
+
+ +
+
+

Private Members

+
+
+std::string name_
+

Name of the well.

+
+ +
+
+bool hasLocalCells_
+

Whether local cells are perforated somewhen.

+
+ +
+
+bool isOwner_
+

Whether we own the well and should do reports etc.

+
+ +
+
+int rankWithFirstPerf_
+

Rank with the first perforation on it, -1 for wells with no open connections.

+
+ +
+
+std::unique_ptr<Parallel::Communication, DestroyComm> comm_
+

Communication object for the well.

+

Contains only ranks where this well will perforate local cells.

+
+ +
+
+std::unique_ptr<CommunicateAboveBelow<Scalar>> commAboveBelow_
+

used to communicate the values for the perforation above.

+
+ +
+
+std::unique_ptr<GlobalPerfContainerFactory<Scalar>> globalPerfCont_
+
+ +
+
+mutable std::unordered_map<int, int> active_to_local_map_
+
+ +
+
+mutable std::unordered_map<int, int> local_to_active_map_
+
+ +
+
+ +
+
+struct Parameter
+
+#include <parametersystem.hpp>
+

A struct holding the key-value pair for a parameter.

+
+

Public Functions

+
+
+inline Parameter(const std::string &k, const std::string &v)
+
+ +
+
+inline bool operator==(const Parameter &setting) const
+
+ +
+
+inline bool operator!=(const Parameter &setting) const
+
+ +
+
+

Public Members

+
+
+std::string key
+
+ +
+
+std::string value
+
+ +
+
+

Friends

+
+
+inline friend std::ostream &operator<<(std::ostream &os, const Parameter &param)
+
+ +
+
+ +
+
+struct ParsingStrictness
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "normal"
+
+ +
+
+ +
+
+struct PartitionMethod
+
+

0: simple, 1: Zoltan, 2: METIS, 3: Zoltan with a all cells of a well represented by one vertex in the graph, see GridEnums.hpp

+
+

Public Static Attributes

+
+
+static constexpr auto value = "zoltanwell"
+
+ +
+
+ +
+
+template<class FluidSystem>
class PBVD : public Opm::EQUIL::Miscibility::RsFunction<FluidSystem::Scalar>
+
+

Type that implements “dissolved gas-oil ratio” tabulated as a function of depth policy. Data typically from keyword ‘PBVD’.

+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+

Public Functions

+
+
+PBVD(const int pvtRegionIdx, const std::vector<Scalar> &depth, const std::vector<Scalar> &pbub)
+

Constructor.

+
+
Parameters:
+
    +
  • pvtRegionIdx[in] The pvt region index

  • +
  • depth[in] Depth nodes.

  • +
  • pbub[in] Bubble-point pressure at depth.

  • +
+
+
+
+ +
+
+virtual Scalar operator()(const Scalar depth, const Scalar cellPress, const Scalar temp, const Scalar satGas = 0.0) const override
+

Function call.

+
+
Parameters:
+
    +
  • depth[in] Depth at which to calculate RS value.

  • +
  • Pressure[in] in the cell

  • +
  • temp[in] Temperature at which to calculate RS value.

  • +
+
+
Returns:
+

Dissolved gas-oil ratio (RS) at depth depth and pressure press.

+
+
+
+ +
+
+

Private Types

+
+
+using PbubVsDepthFunc = Tabulated1DFunction<Scalar>
+
+ +
+
+

Private Functions

+
+
+Scalar satRs(const Scalar press, const Scalar temp) const
+
+ +
+
+

Private Members

+
+
+const int pvtRegionIdx_
+
+ +
+
+PbubVsDepthFunc pbubVsDepth_
+
+ +
+
+ +
+
+template<class FluidSystem, class MaterialLawManager>
struct PcEq
+
+

Functor for inverting capillary pressure function. Function represented is f(s) = pc(s) - targetPc

+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+

Public Functions

+
+
+PcEq(const MaterialLawManager &materialLawManager, const int phase, const int cell, const Scalar targetPc)
+
+ +
+
+Scalar operator()(Scalar s) const
+
+ +
+
+

Private Members

+
+
+const MaterialLawManager &materialLawManager_
+
+ +
+
+const int phase_
+
+ +
+
+const int cell_
+
+ +
+
+const Scalar targetPc_
+
+ +
+
+ +
+
+template<class FluidSystem, class MaterialLawManager>
struct PcEqSum
+
+

Functor for inverting a sum of capillary pressure functions. Function represented is f(s) = pc1(s) + pc2(1 - s) - targetPc

+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+

Public Functions

+
+
+PcEqSum(const MaterialLawManager &materialLawManager, const int phase1, const int phase2, const int cell, const Scalar targetPc)
+
+ +
+
+Scalar operator()(Scalar s) const
+
+ +
+
+

Private Members

+
+
+const MaterialLawManager &materialLawManager_
+
+ +
+
+const int phase1_
+
+ +
+
+const int phase2_
+
+ +
+
+const int cell_
+
+ +
+
+const Scalar targetPc_
+
+ +
+
+ +
+
+template<class FluidSystem>
class PDVD : public Opm::EQUIL::Miscibility::RsFunction<FluidSystem::Scalar>
+
+

Type that implements “vaporized oil-gas ratio” tabulated as a function of depth policy. Data taken from keyword ‘PDVD’.

+
+

Public Functions

+
+
+PDVD(const int pvtRegionIdx, const std::vector<Scalar> &depth, const std::vector<Scalar> &pdew)
+

Constructor.

+
+
Parameters:
+
    +
  • pvtRegionIdx[in] The pvt region index

  • +
  • depth[in] Depth nodes.

  • +
  • pbub[in] Dew-point pressure at depth.

  • +
+
+
+
+ +
+
+virtual Scalar operator()(const Scalar depth, const Scalar cellPress, const Scalar temp, const Scalar satOil = 0.0) const override
+

Function call.

+
+
Parameters:
+
    +
  • depth[in] Depth at which to calculate RV value.

  • +
  • cellPress[in] Pressure in the cell

  • +
  • temp[in] Temperature at which to calculate RV value.

  • +
+
+
Returns:
+

Vaporized oil-gas ratio (RV) at depth depth and pressure press.

+
+
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using PdewVsDepthFunc = Tabulated1DFunction<Scalar>
+
+ +
+
+

Private Functions

+
+
+Scalar satRv(const Scalar press, const Scalar temp) const
+
+ +
+
+

Private Members

+
+
+const int pvtRegionIdx_
+
+ +
+
+PdewVsDepthFunc pdewVsDepth_
+
+ +
+
+ +
+
+struct PenaltyCard
+
+
+

Public Functions

+
+
+inline int total() const
+
+ +
+
+inline void reset()
+
+ +
+
+inline PenaltyCard &operator+=(const PenaltyCard &other)
+
+ +
+
+template<typename Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Public Members

+
+
+int nonConverged = {0}
+
+ +
+
+int distanceDecay = {0}
+
+ +
+
+int largeWellResiduals = {0}
+
+ +
+
+ +
+
+template<class Scalar>
class PerfData
+
+#include <PerfData.hpp>
+
+

Public Functions

+
+
+PerfData() = default
+
+ +
+
+PerfData(std::size_t num_perf, Scalar pressure_first_connection_, bool injector_, std::size_t num_phases)
+
+ +
+
+std::size_t size() const
+
+ +
+
+bool empty() const
+
+ +
+
+bool try_assign(const PerfData &other)
+
+ +
+
+void prepareInjectorContainers()
+

Make containers valid for injectors.

+

Needed if a producer is switched to an injector,

+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const PerfData&) const
+
+ +
+
+

Public Members

+
+
+Scalar pressure_first_connection = {}
+
+ +
+
+std::vector<Scalar> pressure = {}
+
+ +
+
+std::vector<Scalar> rates = {}
+
+ +
+
+std::vector<Scalar> phase_rates = {}
+
+ +
+
+std::vector<std::array<Scalar, 4>> phase_mixing_rates = {}
+
+ +
+
+std::vector<Scalar> solvent_rates = {}
+
+ +
+
+std::vector<Scalar> polymer_rates = {}
+
+ +
+
+std::vector<Scalar> brine_rates = {}
+
+ +
+
+std::vector<Scalar> prod_index = {}
+
+ +
+
+std::vector<Scalar> microbial_rates = {}
+
+ +
+
+std::vector<Scalar> oxygen_rates = {}
+
+ +
+
+std::vector<Scalar> urea_rates = {}
+
+ +
+
+std::vector<std::size_t> cell_index = {}
+
+ +
+
+std::vector<Scalar> connection_transmissibility_factor = {}
+
+ +
+
+std::vector<Scalar> connection_d_factor = {}
+
+ +
+
+std::vector<Scalar> connection_compaction_tmult = {}
+
+ +
+
+std::vector<int> satnum_id = {}
+
+ +
+
+std::vector<std::size_t> ecl_index = {}
+
+ +
+
+std::vector<Scalar> gas_mass_rates = {}
+
+ +
+
+std::vector<Scalar> wat_mass_rates = {}
+
+ +
+
+std::vector<Scalar> water_throughput = {}
+
+ +
+
+std::vector<Scalar> skin_pressure = {}
+
+ +
+
+std::vector<Scalar> water_velocity = {}
+
+ +
+
+ConnFiltrateData<Scalar> filtrate_data = {}
+
+ +
+
+std::vector<ConnFracStatistics<Scalar>> connFracStatistics = {}
+
+ +
+
+

Public Static Functions

+
+
+static PerfData serializationTestObject()
+
+ +
+
+

Private Members

+
+
+bool injector = {false}
+
+ +
+
+ +
+
+template<class Scalar>
struct PerforationData
+
+#include <PerforationData.hpp>
+

Static data associated with a well perforation.

+
+

Public Members

+
+
+int cell_index = {}
+
+ +
+
+Scalar connection_transmissibility_factor = {}
+
+ +
+
+Scalar connection_d_factor = {}
+
+ +
+
+int satnum_id = {}
+
+ +
+
+std::size_t ecl_index = {}
+

The original index of the perforation in ECL Schedule.

+
+ +
+
+ +
+
+template<class Scalar>
struct PerforationRates
+
+#include <PerforationData.hpp>
+
+

Public Members

+
+
+Scalar dis_gas = 0.0
+
+ +
+
+Scalar dis_gas_in_water = 0.0
+
+ +
+
+Scalar vap_oil = 0.0
+
+ +
+
+Scalar vap_wat = 0.0
+
+ +
+
+ +
+
+struct PffDofData_
+
+#include <FlowProblem.hpp>
+
+

Public Members

+
+
+ConditionalStorage<enableEnergy, Scalar> thermalHalfTransIn
+
+ +
+
+ConditionalStorage<enableEnergy, Scalar> thermalHalfTransOut
+
+ +
+
+ConditionalStorage<enableDiffusion, Scalar> diffusivity
+
+ +
+
+ConditionalStorage<enableDispersion, Scalar> dispersivity
+
+ +
+
+Scalar transmissibility
+
+ +
+
+ +
+
+struct Phase
+
+

Compile-time disambiguation type for phases.

+
+

Public Members

+
+
+unsigned int ix
+

Phase index.

+
+ +
+
+ +
+
+template<typename Scalar>
class PhaseCheckBase : public Opm::SatfuncConsistencyChecks<Scalar>::Check
+
+#include <PhaseCheckBase.hpp>
+

Base class for all phase saturation function consistency checks.

+

Provides common implementation of parts of the public Check interface in terms of packed flags.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+

Subclassed by Opm::Satfunc::PhaseChecks::Gas::SGcr< Scalar >, Opm::Satfunc::PhaseChecks::Gas::SGmax< Scalar >, Opm::Satfunc::PhaseChecks::Gas::SGmin< Scalar >, Opm::Satfunc::PhaseChecks::Oil::MobileOil_GO_SGcr< Scalar >, Opm::Satfunc::PhaseChecks::Oil::MobileOil_GO_SGmin< Scalar >, Opm::Satfunc::PhaseChecks::Oil::MobileOil_OW_SWcr< Scalar >, Opm::Satfunc::PhaseChecks::Oil::MobileOil_OW_SWmin< Scalar >, Opm::Satfunc::PhaseChecks::Oil::SOcr_GO< Scalar >, Opm::Satfunc::PhaseChecks::Oil::SOcr_OW< Scalar >, Opm::Satfunc::PhaseChecks::Oil::SOmin_GO< Scalar >, Opm::Satfunc::PhaseChecks::Oil::SOmin_OW< Scalar >, Opm::Satfunc::PhaseChecks::ThreePointHorizontal::DisplacingOil_GO< Scalar >, Opm::Satfunc::PhaseChecks::ThreePointHorizontal::DisplacingOil_OW< Scalar >, Opm::Satfunc::PhaseChecks::Water::SWcr< Scalar >, Opm::Satfunc::PhaseChecks::Water::SWmax< Scalar >, Opm::Satfunc::PhaseChecks::Water::SWmin< Scalar >

+
+

Public Functions

+
+
+virtual void test(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run specific check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+virtual bool isViolated() const override
+

Whether or not last set of end-points violated this particular check.

+
+ +
+
+virtual bool isCritical() const override
+

Whether or not this check is critical to the simulator’s ability to run the case.

+

Violating critical checks should typically stop the run.

+
+ +
+
+

Protected Functions

+
+
+void setViolated()
+

Mark check as violated.

+

Intended to be called by derived types only.

+
+ +
+
+void setCritical()
+

Mark check as violated at critical level.

+

Intended to be called by derived types only.

+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) = 0
+

Run specific check against a set of saturation function end-points.

+

Actual test function. Implemented in derived types and called from the test() member function.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+unsigned char flags_ = {0}
+

Collection of violation flags.

+

Packed bit fields.

+
+ +
+
+ +
+
+struct PhaseEntry
+
+#include <OutputExtractor.hpp>
+
+

Public Members

+
+
+std::variant<std::array<std::string_view, numPhases>, std::array<std::array<std::string_view, numPhases>, 2>> kw
+

One or two lists of names for the keyword for each phase.

+
+ +
+
+PhaseFunc extract
+

Associated extraction lambda.

+
+ +
+
+ +
+
+struct PhaseEntry
+
+#include <OutputExtractor.hpp>
+

A phase buffer extractor descriptor.

+
+

Public Members

+
+
+PhaseArray *data
+

Array of buffers to store data in.

+
+ +
+
+PhaseFunc extract
+

Function to call for extraction.

+
+ +
+
+ +
+
+template<class Scalar>
struct PhaseQuantityValue
+
+#include <InitStateEquil.hpp>
+

Simple set of per-phase (named by primary component) quantities.

+
+

Public Functions

+
+
+inline PhaseQuantityValue &axpy(const PhaseQuantityValue &rhs, const Scalar a)
+
+ +
+
+inline PhaseQuantityValue &operator/=(const Scalar x)
+
+ +
+
+inline void reset()
+
+ +
+
+

Public Members

+
+
+Scalar oil = {0.0}
+
+ +
+
+Scalar gas = {0.0}
+
+ +
+
+Scalar water = {0.0}
+
+ +
+
+ +
+
+template<class MaterialLawManager, class FluidSystem, class Region, typename CellID>
class PhaseSaturations
+
+#include <InitStateEquil.hpp>
+

Calculator for phase saturations

+

Computes saturation values at arbitrary depths.

+
+
Template Parameters:
+
    +
  • MaterialLawManager – Container for material laws. Typically a specialization of the

    Opm::EclMaterialLawManager<> 
    +
    +
    + template.

  • +
  • FluidSystem – An OPM fluid system type. Typically a specialization of the

    Opm::BlackOilFluidSystem<> 
    +
    +
    + template.

  • +
  • Region – Representation of an equilibration region. Typically

    Opm::EQUIL::EquilReg 
    +
    +
    + from the equilibrationhelpers.

  • +
  • CellID – Representation an equilibration region’s cell IDs. Typically

    std::size_t 
    +
    +
    +.

  • +
+
+
+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using PTable = PressureTable<FluidSystem, Region>
+

Convenience type alias.

+
+ +
+
+

Public Functions

+
+
+explicit PhaseSaturations(MaterialLawManager &matLawMgr, const std::vector<Scalar> &swatInit)
+

Constructor

+
+
Parameters:
+
    +
  • matLawMgr[inout] Read/write reference to a material law container. Mutated by member functions.

  • +
  • swatInit[in] Initial water saturation array (from SWATINIT data). Empty if SWATINIT is not used in this simulation model.

  • +
+
+
+
+ +
+
+PhaseSaturations(const PhaseSaturations &rhs)
+

Copy constructor.

+
+
Parameters:
+

rhs[in] Source object.

+
+
+
+ +
+
+PhaseSaturations &operator=(const PhaseSaturations&) = delete
+

Disabled assignment operator.

+
+ +
+
+PhaseSaturations &operator=(PhaseSaturations&&) = delete
+

Disabled move-assignment operator.

+
+ +
+
+const PhaseQuantityValue<Scalar> &deriveSaturations(const Position &x, const Region &reg, const PTable &ptable)
+

Calculate phase saturations at particular point of the simulation model geometry.

+
+
Parameters:
+
    +
  • x[in] Specific geometric point (depth within a specific cell).

  • +
  • reg[in] Equilibration information for a single equilibration region; notably contact depths.

  • +
  • ptable[in] Previously equilibrated phase pressure table pertaining to the equilibration region reg.

  • +
+
+
Returns:
+

Set of phase saturation values defined at particular point.

+
+
+
+ +
+
+inline const PhaseQuantityValue<Scalar> &correctedPhasePressures() const
+

Retrieve saturation-corrected phase pressures

+

Values associated with evaluation point of previous call to

deriveSaturations() 
+
+
+.

+
+ +
+
+

Private Types

+
+
+using FluidState = ::Opm::SimpleModularFluidState<Scalar, 3, 3, FluidSystem, false, false, false, false, true, false, false, false>
+

Simplified fluid state object that contains only the pieces of information needed to calculate the capillary pressure values from the current set of material laws.

+
+ +
+
+using MaterialLaw = typename MaterialLawManager::MaterialLaw
+

Convenience type alias.

+
+ +
+
+using PhaseIdx = std::remove_cv_t<std::remove_reference_t<decltype(FluidSystem::oilPhaseIdx)>>
+

Fluid system’s representation of phase indices.

+
+ +
+
+

Private Functions

+
+
+void setEvaluationPoint(const Position &x, const Region &reg, const PTable &ptable)
+

Capture the input evaluation point information in internal state.

+
+
Parameters:
+
    +
  • x[in] Specific geometric point (depth within a specific cell).

  • +
  • reg[in] Equilibration information for a single equilibration region; notably contact depths.

  • +
  • ptable[in] Previously equilibrated phase pressure table pertaining to the equilibration region reg.

  • +
+
+
+
+ +
+
+void initializePhaseQuantities()
+

Initialize phase saturation and phase pressure values.

+

Looks up phase pressure values from the input pressure table.

+
+ +
+
+void deriveOilSat()
+

Derive phase saturation for oil.

+

Calculated as 1 - Sw - Sg.

+
+ +
+
+void deriveGasSat()
+

Derive phase saturation for gas.

+

Inverts capillary pressure curve if non-constant or uses a simple depth consideration with respect to G/O contact depth otherwise.

+
+ +
+
+void deriveWaterSat()
+

Derive phase saturation for water.

+

Uses input data if simulation model is defined in terms of SWATINIT. Otherwise, inverts capillary pressure curve if non-constant or uses a simple depth consideration with respect to the O/W contact depth if capillary pressure curve is constant within the current cell.

+
+ +
+
+void fixUnphysicalTransition()
+

Correct phase saturation and pressure values to account for overlapping transition zones between G/O and O/W systems.

+
+ +
+
+void accountForScaledSaturations()
+

Re-adjust phase pressure values to account for phase saturations outside permissible ranges.

+
+ +
+
+std::pair<Scalar, bool> applySwatInit(const Scalar pcow)
+

Derive water saturation from SWATINIT data.

+

Uses SWATINIT array data from current cell directly. Also updates the material law container’s internal notion of the maximum attainable O/W capillary pressure value.

+
+
Parameters:
+

pcow[in] O/W capillary pressure value (Po - Pw).

+
+
Returns:
+

Water saturation value.

+
+
+
+ +
+
+std::pair<Scalar, bool> applySwatInit(const Scalar pc, const Scalar sw)
+

Derive water saturation from SWATINIT data.

+

Uses explicitly passed-in saturation value. Also updates the material law container’s internal notion of the maximum attainable O/W capillary pressure value.

+
+
Parameters:
+
    +
  • pc[in] x/W capillary pressure value (Px - Pw; x in {O, G}).

  • +
  • sw[in] Water saturation value.

  • +
+
+
Returns:
+

Water saturation value. Input value, possibly mollified by current set of material laws.

+
+
+
+ +
+
+void computeMaterialLawCapPress()
+

Invoke material law container’s capillary pressure calculator on current fluid state.

+
+ +
+
+Scalar materialLawCapPressGasOil() const
+

Extract gas/oil capillary pressure value (Pg - Po) from current fluid state.

+
+ +
+
+Scalar materialLawCapPressOilWater() const
+

Extract oil/water capillary pressure value (Po - Pw) from current fluid state.

+
+ +
+
+Scalar materialLawCapPressGasWater() const
+

Extract gas/water capillary pressure value (Pg - Pw) from current fluid state.

+
+ +
+
+bool isConstCapPress(const PhaseIdx phaseIdx) const
+

Predicate for whether specific phase has constant capillary pressure curve in current cell.

+
+
Parameters:
+

phaseIdx[in] Phase. Typically gas or water.

+
+
Returns:
+

Whether or not phaseIdx has constant capillary pressure curve in current cell.

+
+
+
+ +
+
+bool isOverlappingTransition() const
+

Predicate for whether or not the G/O and O/W transition zones overlap in the current cell.

+

This is the case when inverting the capillary pressure curves produces a negative oil saturation&#8212;i.e., when Sg + Sw > 1.

+
+ +
+
+Scalar fromDepthTable(const Scalar contactdepth, const PhaseIdx phasePos, const bool isincr) const
+

Derive phase saturation value from simple depth consideration.

+

Assumes that the pertinent capillary pressure curve is constant (typically zero) in the current cell&#8212;i.e., that there is a sharp interface between the two phases.

+
+
Parameters:
+
    +
  • contactdepth[in] Depth of relevant phase separation contact.

  • +
  • Position – of phase in three-phase enumeration. Typically

    gasPos() 
    +
    +
    + or
    waterPos() 
    +
    +
    +.

  • +
  • isincr[in] Whether the capillary pressure curve is normally increasing as a function of phase saturation (e.g., Pcgo(Sg) = Pg

      +
    • Po) or if the curve is normally decreasing as a function of increasing phase saturation (e.g., Pcow(Sw) = Po - Pw). True for capillary pressure functions that are normally increasing as a function of phase saturation.

    • +
    +

  • +
+
+
Returns:
+

Phase saturation.

+
+
+
+ +
+
+Scalar invertCapPress(const Scalar pc, const PhaseIdx phasePos, const bool isincr) const
+

Derive phase saturation by inverting non-constant capillary pressure curve.

+
+
Parameters:
+
    +
  • pc[in] Target capillary pressure value.

  • +
  • Position – of phase in three-phase enumeration. Typically

    gasPos() 
    +
    +
    + or
    waterPos() 
    +
    +
    +.

  • +
  • isincr[in] Whether the capillary pressure curve is normally increasing as a function of phase saturation (e.g., Pcgo(Sg) = Pg

      +
    • Po) or if the curve is normally decreasing as a function of increasing phase saturation (e.g., Pcow(Sw) = Po - Pw). True for capillary pressure functions that are normally increasing as a function of phase saturation.

    • +
    +

  • +
+
+
Returns:
+

Phase saturation at which capillary pressure attains target value.

+
+
+
+ +
+
+inline PhaseIdx oilPos() const
+

Position of oil in fluid system’s three-phase enumeration.

+
+ +
+
+inline PhaseIdx gasPos() const
+

Position of gas in fluid system’s three-phase enumeration.

+
+ +
+
+inline PhaseIdx waterPos() const
+

Position of water in fluid system’s three-phase enumeration.

+
+ +
+
+

Private Members

+
+
+MaterialLawManager &matLawMgr_
+

Read/write reference to client’s material law container.

+
+ +
+
+const std::vector<Scalar> &swatInit_
+

Client’s SWATINIT data.

+
+ +
+
+PhaseQuantityValue<Scalar> sat_
+

Evaluated phase saturations.

+
+ +
+
+PhaseQuantityValue<Scalar> press_
+

Saturation-corrected phase pressure values.

+
+ +
+
+EvaluationPoint evalPt_
+

Current evaluation point.

+
+ +
+
+FluidState fluidState_
+

Capillary pressure fluid state.

+
+ +
+
+std::array<Scalar, FluidSystem::numPhases> matLawCapPress_
+

Evaluated capillary pressures from current set of material laws.

+
+ +
+
+ +
+
+struct PhaseUsage : public Opm::BlackoilPhases
+
+#include <BlackoilPhases.hpp>
+
+

Public Functions

+
+
+PhaseUsage() = default
+
+ +
+
+explicit PhaseUsage(std::vector<BlackoilPhases::PhaseIndex> phases)
+
+ +
+
+

Public Members

+
+
+std::array<int, MaxNumPhases + NumCryptoPhases> phase_used
+
+ +
+
+std::array<int, MaxNumPhases + NumCryptoPhases> phase_pos
+
+ +
+
+int num_phases
+
+ +
+
+bool has_solvent = {}
+
+ +
+
+bool has_polymer = {}
+
+ +
+
+bool has_energy = {}
+
+ +
+
+bool has_polymermw = {}
+
+ +
+
+bool has_foam = {}
+
+ +
+
+bool has_brine = {}
+
+ +
+
+bool has_zFraction = {}
+
+ +
+
+bool has_micp = {}
+
+ +
+
+bool has_co2_or_h2store = {}
+
+ +
+
+ +
+
+class PIDAndIterationCountTimeStepControl : public Opm::PIDTimeStepControl
+
+#include <TimeStepControl.hpp>
+

PID controller based adaptive time step control as above that also takes an target iteration into account.

+
+

Public Functions

+
+
+explicit PIDAndIterationCountTimeStepControl(const int target_iterations = 20, const double decayDampingFactor = 1.0, const double growthDampingFactor = 1.0 / 1.2, const double tol = 1e-3, const double minTimeStepBasedOnIterations = 0., const bool verbose = false)
+

constructor

+
+
Parameters:
+
    +
  • target_iterations – number of desired iterations per time step

  • +
  • tol – tolerance for the relative changes of the numerical solution to be accepted in one time step (default is 1e-3)

  • +
  • verbose – if true get some output (default = false)

  • +
+
+
+
+ +
+
+virtual double computeTimeStepSize(const double dt, const int iterations, const RelativeChangeInterface &relativeChange, const AdaptiveSimulatorTimer&) const override
+

compute new time step size suggestions based on the PID controller

+
+
Parameters:
+
    +
  • dt – time step size used in the current step

  • +
  • iterations – number of iterations used (linear/nonlinear)

  • +
  • timeError – object to compute || u^n+1 - u^n || / || u^n+1 ||

  • +
+
+
Returns:
+

suggested time step size for the next step

+
+
+
+ +
+
+inline virtual bool timeStepAccepted(const double) const override
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const PIDAndIterationCountTimeStepControl&) const
+
+ +
+
+

Public Static Functions

+
+
+static PIDAndIterationCountTimeStepControl serializationTestObject()
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr TimeStepControlType Type = TimeStepControlType::PIDAndIterationCount
+
+ +
+
+

Protected Attributes

+
+
+const int target_iterations_
+
+ +
+
+const double decayDampingFactor_
+
+ +
+
+const double growthDampingFactor_
+
+ +
+
+const double minTimeStepBasedOnIterations_
+
+ +
+
+

Private Types

+
+
+typedef PIDTimeStepControl BaseType
+
+ +
+
+ +
+
+class PIDTimeStepControl : public Opm::TimeStepControlInterface
+
+#include <TimeStepControl.hpp>
+

PID controller based adaptive time step control as suggested in: Turek and Kuzmin. Algebraic Flux Correction III. Incompressible Flow Problems. Uni Dortmund.

+

See also: D. Kuzmin and S.Turek. Numerical simulation of turbulent bubbly flows. Techreport Uni Dortmund. 2004

+

and the original article: Valli, Coutinho, and Carey. Adaptive Control for Time Step Selection in Finite Element Simulation of Coupled Viscous Flow and Heat Transfer. Proc of the 10th International Conference on Numerical Methods in Fluids. 1998.

+

Subclassed by Opm::PIDAndIterationCountTimeStepControl

+
+

Public Functions

+
+
+explicit PIDTimeStepControl(const double tol = 1e-3, const bool verbose = false)
+

constructor

+
+
Parameters:
+
    +
  • tol – tolerance for the relative changes of the numerical solution to be accepted in one time step (default is 1e-3)

  • +
  • verbose – if true get some output (default = false)

  • +
+
+
+
+ +
+
+virtual double computeTimeStepSize(const double dt, const int, const RelativeChangeInterface &relativeChange, const AdaptiveSimulatorTimer&) const override
+

compute new time step size suggestions based on the PID controller

+
+
Parameters:
+
    +
  • dt – time step size used in the current step

  • +
  • iterations – number of iterations used (linear/nonlinear)

  • +
  • timeError – object to compute || u^n+1 - u^n || / || u^n+1 ||

  • +
+
+
Returns:
+

suggested time step size for the next step

+
+
+
+ +
+
+inline virtual bool timeStepAccepted(const double) const override
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const PIDTimeStepControl&) const
+
+ +
+
+

Public Static Functions

+
+
+static PIDTimeStepControl serializationTestObject()
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr TimeStepControlType Type = TimeStepControlType::PID
+
+ +
+
+

Protected Attributes

+
+
+const double tol_ = 1e-3
+
+ +
+
+mutable std::vector<double> errors_ = {}
+
+ +
+
+const bool verbose_ = false
+
+ +
+
+ +
+
+struct PlyvmhCoefficients
+
+
+

Public Members

+
+
+Scalar k_mh
+
+ +
+
+Scalar a_mh
+
+ +
+
+Scalar gamma
+
+ +
+
+Scalar kappa
+
+ +
+
+ +
+
+template<class T>
class PointerView
+
+

A view towards a smart pointer to GPU-allocated memory.

+

This will emulate a smart pointer to GPU-allocated memory, but without ownership semantics, and being compatible with the requirements of the GPU kernels. This is useful when we want to pass a smart pointer to a GPU kernel, but we do not want to transfer the ownership of the memory.

+
+

Public Functions

+
+
+PointerView(const PointerView &other) = default
+
+ +
+
+inline PointerView(const std::shared_ptr<T> &ptr)
+
+ +
+
+template<class Deleter>
inline PointerView(const std::unique_ptr<T, Deleter> &ptr)
+
+ +
+
+inline PointerView(T *ptr)
+
+ +
+
+inline OPM_HOST_DEVICE T * get () const
+
+ +
+
+inline OPM_HOST_DEVICE T & operator* () const
+
+ +
+
+inline OPM_HOST_DEVICE T * operator-> () const
+
+ +
+
+

Private Members

+
+
+T *ptr_
+
+ +
+
+ +
+
+template<class TypeTag>
class PolyhedralGridVanguard : public Opm::FlowBaseVanguard<TypeTag>
+
+

Helper class for grid instantiation of ECL file-format using problems.

+

This class uses Dune::PolyhedralGrid as the simulation grid.

+
+

Public Types

+
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using EquilGrid = GetPropType<TypeTag, Properties::EquilGrid>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using CartesianIndexMapper = Dune::CartesianIndexMapper<Grid>
+
+ +
+
+using LevelCartesianIndexMapper = Opm::LevelCartesianIndexMapper<Grid>
+
+ +
+
+using EquilCartesianIndexMapper = Dune::CartesianIndexMapper<EquilGrid>
+
+ +
+
+using TransmissibilityType = Transmissibility<Grid, GridView, ElementMapper, CartesianIndexMapper, Scalar>
+
+ +
+
+

Public Functions

+
+
+inline explicit PolyhedralGridVanguard(Simulator &simulator)
+
+ +
+
+inline Grid &grid()
+

Return a reference to the simulation grid.

+
+ +
+
+inline const Grid &grid() const
+

Return a reference to the simulation grid.

+
+ +
+
+inline const EquilGrid &equilGrid() const
+

Returns a refefence to the grid which should be used by the EQUIL initialization code.

+

The EQUIL keyword is used to specify the initial condition of the reservoir in hydrostatic equilibrium. Since the code which does this is not accepting arbitrary DUNE grids (the code is part of the opm-core module), this is not necessarily the same as the grid which is used for the actual simulation.

+
+ +
+
+inline void releaseEquilGrid()
+

Indicates that the initial condition has been computed and the memory used by the EQUIL grid can be released.

+

Depending on the implementation, subsequent accesses to the EQUIL grid lead to crashes.

+
+ +
+
+inline void loadBalance()
+

Distribute the simulation grid over multiple processes.

+

(For parallel simulation runs.)

+
+ +
+
+inline void addLgrs()
+
+ +
+
+inline const CartesianIndexMapper &cartesianIndexMapper() const
+

Returns the object which maps a global element index of the simulation grid to the corresponding element index of the logically Cartesian index.

+
+ +
+
+inline const LevelCartesianIndexMapper levelCartesianIndexMapper() const
+

Returns the object which maps a global element index of the simulation grid to the corresponding element index of the level logically Cartesian index. No refinement is supported for AluGrid so it coincides with CartesianIndexMapper.

+
+ +
+
+inline const CartesianIndexMapper &equilCartesianIndexMapper() const
+

Returns mapper from compressed to cartesian indices for the EQUIL grid.

+

Since PolyhedralGrid is not parallel, that’s always the same as cartesianIndexMapper().

+
+ +
+
+inline const std::vector<int> &globalCell()
+
+ +
+
+inline unsigned int gridEquilIdxToGridIdx(unsigned int elemIndex) const
+
+ +
+
+inline unsigned int gridIdxToEquilGridIdx(unsigned int elemIndex) const
+
+ +
+
+inline void releaseGlobalTransmissibilities()
+

Free the memory occupied by the global transmissibility object.

+

After writing the initial solution, this array should not be necessary anymore.

+
+ +
+
+inline std::unordered_set<std::string> defunctWellNames() const
+
+ +
+
+inline const TransmissibilityType &globalTransmissibility() const
+
+ +
+
+inline std::function<std::array<double, FlowBaseVanguard<TypeTag>::dimensionworld>(int)> cellCentroids() const
+

Get function to query cell centroids for a distributed grid.

+

Currently this only non-empty for a loadbalanced CpGrid. It is a function return the centroid for the given element index.

+
+ +
+
+inline std::vector<int> cellPartition() const
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int dimension = Grid::dimension
+
+ +
+
+static constexpr int dimensionworld = Grid::dimensionworld
+
+ +
+
+

Protected Functions

+
+
+inline void createGrids_()
+
+ +
+
+inline void filterConnections_()
+
+ +
+
+

Protected Attributes

+
+
+Simulator &simulator_
+
+ +
+
+std::unique_ptr<Grid> grid_
+
+ +
+
+std::unique_ptr<CartesianIndexMapper> cartesianIndexMapper_
+
+ +
+
+std::unordered_set<std::string> defunctWellNames_
+
+ +
+
+std::vector<int> globalcell_
+
+ +
+
+

Private Types

+
+
+using ParentType = FlowBaseVanguard<TypeTag>
+
+ +
+
+using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using GridPointer = Grid*
+
+ +
+
+using EquilGridPointer = EquilGrid*
+
+ +
+
+

Friends

+
+
+friend class FlowBaseVanguard< TypeTag >
+
+ +
+
+ +
+
+struct PolyhedralGridVanguard
+
+
+

Public Types

+
+
+using InheritsFrom = std::tuple<FlowBaseVanguard>
+
+ +
+
+ +
+
+template<class Scalar>
struct PolymerSolutionContainer
+
+

Struct holding polymer extension data.

+
+

Public Functions

+
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const PolymerSolutionContainer &rhs) const
+
+ +
+
+

Public Members

+
+
+std::vector<Scalar> maxAdsorption
+
+ +
+
+std::vector<Scalar> concentration
+
+ +
+
+std::vector<Scalar> moleWeight
+
+ +
+
+

Public Static Functions

+
+
+static PolymerSolutionContainer serializationTestObject()
+
+ +
+
+ +
+
+struct Position
+
+#include <InitStateEquil.hpp>
+

Evaluation point within a model geometry.

+

Associates a particular depth to specific cell.

+
+

Public Members

+
+
+CellID cell
+
+ +
+
+Scalar depth
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size, class ApplyScalar = Scalar>
class Preconditioner
+
+#include <Preconditioner.hpp>
+

Subclassed by Opm::Accelerator::rocsparsePreconditioner< Scalar, block_size >

+
+

Public Functions

+
+
+virtual ~Preconditioner() = default
+
+ +
+
+virtual void apply(const ApplyScalar &y, ApplyScalar &x) = 0
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat) = 0
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) = 0
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat) = 0
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) = 0
+
+ +
+
+

Public Static Functions

+
+
+static std::unique_ptr<Preconditioner> create(PreconditionerType type, bool opencl_ilu_parallel, int verbosity)
+
+ +
+
+

Protected Functions

+
+
+inline Preconditioner(int verbosity_)
+
+ +
+
+

Protected Attributes

+
+
+int N = 0
+
+ +
+
+int Nb = 0
+
+ +
+
+int nnz = 0
+
+ +
+
+int nnzb = 0
+
+ +
+
+int verbosity = 0
+
+ +
+
+ +
+
+template<class X, class Y, class CudaPreconditionerType>
class PreconditionerAdapter : public Dune::PreconditionerWithUpdate<X, Y>, public Opm::gpuistl::PreconditionerHolder<GpuVector<X::field_type>, GpuVector<Y::field_type>>
+
+

Makes a CUDA preconditioner available to a CPU simulator.

+

The use case for this adapter is to use a CUDA preconditioner during a linear solver that works on the CPU. The motivation for this is benchmarking new preconditioners on the GPU.

+
+
Template Parameters:
+
    +
  • X – the domain type (should be on the CPU). Typicall a Dune::BlockVector

  • +
  • Y – the range type (should be on the CPU). Typicall a Dune::BlockVector

  • +
  • CudaPreconditionerType – the preconditioner taking GpuVector<real_type> as arguments to apply

  • +
+
+
+
+

Public Types

+
+
+using domain_type = X
+

The domain type of the preconditioner.

+
+ +
+
+using range_type = Y
+

The range type of the preconditioner.

+
+ +
+
+using field_type = typename X::field_type
+

The field type of the preconditioner.

+
+ +
+
+

Public Functions

+
+
+inline explicit PreconditionerAdapter(std::shared_ptr<CudaPreconditionerType> preconditioner)
+

Constructor.

+

Constructor gets all parameters to operate the prec.

+
+
Parameters:
+
    +
  • A – The matrix to operate on.

  • +
  • w – The relaxation factor.

  • +
+
+
+
+ +
+
+inline virtual void pre(X &x, Y &b) override
+

Prepare the preconditioner.

+

Currently not supported.

+
+ +
+
+inline virtual void apply(X &v, const Y &d) override
+

Apply the preconditoner.

+
+ +
+
+inline virtual void post(X &x) override
+

Clean up.

+

Currently not supported.

+
+ +
+
+inline Dune::SolverCategory::Category category() const override
+

Category of the preconditioner (see SolverCategory::Category)

+
+ +
+
+inline virtual void update() override
+

Calls update on the underlying CUDA preconditioner.

+
+ +
+
+inline virtual std::shared_ptr<Dune::PreconditionerWithUpdate<GpuVector<field_type>, GpuVector<field_type>>> getUnderlyingPreconditioner() override
+

getUnderlyingPreconditioner gets the underlying preconditioner (preconditioner being held)

+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Public Static Functions

+
+
+static inline constexpr bool shouldCallPre()
+
+ +
+
+static inline constexpr bool shouldCallPost()
+
+ +
+
+

Private Members

+
+
+std::shared_ptr<CudaPreconditionerType> m_underlyingPreconditioner
+

the underlying preconditioner to use

+
+ +
+
+std::unique_ptr<GpuVector<field_type>> m_inputBuffer
+
+ +
+
+std::unique_ptr<GpuVector<field_type>> m_outputBuffer
+
+ +
+
+ +
+
+template<class CudaPreconditionerType, class M, class X, class Y, int l = 1>
class PreconditionerConvertFieldTypeAdapter : public Dune::PreconditionerWithUpdate<X, Y>
+
+

Converts the field type (eg. double to float) to benchmark single precision preconditioners.

+

+To use this, use something like the following code:

#include <opm/simulators/linalg/gpuistl/PreconditionerConvertFieldTypeAdapter.hpp>
+#include <opm/simulators/linalg/ParallelOverlappingILU0.hpp>
+
+using XDouble = Dune::BlockVector<Dune::FieldVector<double, 2>>;
+using MDouble = Dune::FieldMatrix<double, 2, 2>;
+using SpMatrixDouble = Dune::BCRSMatrix<MDouble>;
+using XFloat = Dune::BlockVector<Dune::FieldVector<float, 2>>;
+using MFloat = Dune::FieldMatrix<float, 2, 2>;
+using SpMatrixFloat = Dune::BCRSMatrix<MFloat>;
+
+template<class ParallelInfo>
+void applyILU0AsFloat(const MDouble& matrix, const XDouble& x, XDouble& y) {
+
+    using FloatILU0 = typename Opm::ParallelOverlappingILU0<MFloat, XFloat, XFloat, ParallelInfo>;
+    using DoubleToFloatConverter = typename Opm::gpuistl::PreconditionerConvertFieldTypeAdapter<FloatILU0, MDouble,
+    XDouble, XDouble>;
+
+    // Note that we do not need to make a new instance for every invocation, this
+    // is just done for this example
+    auto doubleToFloatConverter = DoubleToFloatConverter(matrix);
+    const auto& convertedMatrix = doubleToFloatConverter.getConvertedMatrix();
+
+    auto floatILU0 = std::make_shared<FloatILU0>(convertedMatrix, 0, 1.0, 0);
+
+    doubleToFloatConverter.setUnderlyingPreconditioner(floatILU0);
+
+    // This will convert x and y to float, then call floatILU0.apply on the converted arguments
+    doubleToFloatConverter.apply(x, y);
+}
+
+
+

+
+

Note

+

This is not a fast conversion, it is simply meant to benchmark the potential of some preconditioners on consumer grade GPUs where the double precision performance is often artificially limited.

+
+
+

Note

+

In theory this can do any field_type conversion that is meaningful, but it is only tested on double to float conversion.

+
+
+

Note

+

Remember to set the underlying preconditioner with setUnderlyingPreconditioner (should use the matrix from getConvertedMatrix())

+
+
+

Note

+

One could simply change the constructor design by accepting a creator function for the underlying preconditioner. For the current use cases this is however not needed.

+
+
+

Public Types

+
+
+using matrix_type = typename std::remove_const<M>::type
+

The matrix type the preconditioner is for.

+
+ +
+
+using domain_type = X
+

The domain type of the preconditioner.

+
+ +
+
+using range_type = Y
+

The range type of the preconditioner.

+
+ +
+
+using field_type = typename X::field_type
+

The field type of the preconditioner.

+
+ +
+
+using domain_type_to = typename CudaPreconditionerType::domain_type
+
+ +
+
+using range_type_to = typename CudaPreconditionerType::range_type
+

The range type of the preconditioner.

+
+ +
+
+using field_type_to = typename domain_type_to::field_type
+

The field type of the preconditioner.

+
+ +
+
+using block_type = typename domain_type::block_type
+
+ +
+
+using XTo = Dune::BlockVector<Dune::FieldVector<field_type_to, block_type::dimension>>
+
+ +
+
+using YTo = Dune::BlockVector<Dune::FieldVector<field_type_to, block_type::dimension>>
+
+ +
+
+using matrix_type_to = typename Dune::BCRSMatrix<Dune::FieldMatrix<field_type_to, block_type::dimension, block_type::dimension>>
+
+ +
+
+

Public Functions

+
+
+inline explicit PreconditionerConvertFieldTypeAdapter(const M &matrix)
+

Constructor.

+
+

Note

+

After the PreconditionerConvertFieldTypeAdapter you can get the converted matrix by calling getConvertedMatrix(), which in turn can be used to create the underlying preconditioner. Once the underlying preconditioner has been called, this must be supplied to setUnderlyingPreconditioner.

+
+
+
Parameters:
+

A – The matrix to operate on.

+
+
+
+ +
+
+inline virtual void pre(X &x, Y &b) override
+

Not used at the moment.

+
+ +
+
+inline virtual void apply(X &v, const Y &d) override
+

Apply the preconditoner.

+
+ +
+
+inline virtual void post(X &x) override
+

Not used at the moment.

+
+ +
+
+inline virtual Dune::SolverCategory::Category category() const override
+

Category of the preconditioner (see SolverCategory::Category)

+
+ +
+
+inline virtual void update() override
+
+ +
+
+inline const matrix_type_to &getConvertedMatrix() const
+
+ +
+
+inline void setUnderlyingPreconditioner(const std::shared_ptr<CudaPreconditionerType> &conditioner)
+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Private Functions

+
+
+inline void updateMatrix()
+
+ +
+
+inline matrix_type_to createConvertedMatrix()
+
+ +
+
+

Private Members

+
+
+const M &m_matrix
+
+ +
+
+matrix_type_to m_convertedMatrix
+
+ +
+
+std::shared_ptr<CudaPreconditionerType> m_underlyingPreconditioner
+

the underlying preconditioner to use

+
+ +
+
+ +
+
+template<class X, class Y, class CudaPreconditionerType, class CPUMatrixType>
class PreconditionerCPUMatrixToGPUMatrix : public Dune::PreconditionerWithUpdate<X, Y>
+
+

Convert a CPU matrix to a GPU matrix and use a CUDA preconditioner on the GPU.

+

The use case is having a CPU matrix created by a CPU simulator being solved by a GPU BICGSTAB solver.

+
+
Template Parameters:
+
    +
  • X – the domain type (should be on the GPU). Typicall a GpuVector

  • +
  • Y – the range type (should be on the GPU). Typicall a GpuVector

  • +
  • CudaPreconditionerType – the preconditioner taking GpuVector<real_type> as arguments to apply and expecting a GPU matrix as the first argument to its constructor.

  • +
  • CPUMatrixType – the type of the CPU matrix. This is the type that will be copied to the GPU.

  • +
+
+
+
+

Public Types

+
+
+using domain_type = X
+

The domain type of the preconditioner.

+
+ +
+
+using range_type = Y
+

The range type of the preconditioner.

+
+ +
+
+using field_type = typename X::field_type
+

The field type of the preconditioner.

+
+ +
+
+

Public Functions

+
+
+template<typename ...Args>
inline explicit PreconditionerCPUMatrixToGPUMatrix(const CPUMatrixType &A, Args&&... args)
+
+ +
+
+inline void pre(X &x, Y &b) override
+

Prepare the preconditioner.

+

Currently not supported.

+
+ +
+
+inline void apply(X &v, const Y &d) override
+

Apply the preconditoner.

+
+ +
+
+inline void post(X &x) override
+

Clean up.

+

Currently not supported.

+
+ +
+
+inline Dune::SolverCategory::Category category() const override
+

Category of the preconditioner (see SolverCategory::Category)

+
+ +
+
+inline virtual void update() override
+

Copies the CPU matrix to the GPU matrix then calls the GPU preconditioner update function

+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Public Static Functions

+
+
+static inline constexpr bool shouldCallPre()
+
+ +
+
+static inline constexpr bool shouldCallPost()
+
+ +
+
+

Private Members

+
+
+const CPUMatrixType &m_cpuMatrix
+
+ +
+
+GpuSparseMatrix<field_type> m_gpuMatrix
+
+ +
+
+CudaPreconditionerType m_underlyingPreconditioner
+

the underlying preconditioner to use

+
+ +
+
+ +
+
+template<class Operator, class Comm>
class PreconditionerFactory
+
+

This is an object factory for creating preconditioners. The user need only interact with the factory through the static methods addStandardPreconditioners() and create(). In addition a user can call the addCreator() static method to add further preconditioners.

+
+

Public Types

+
+
+using Matrix = typename Operator::matrix_type
+

Linear algebra types.

+
+ +
+
+using Vector = typename Operator::domain_type
+
+ +
+
+using PrecPtr = std::shared_ptr<Dune::PreconditionerWithUpdate<Vector, Vector>>
+

The type of pointer returned by create().

+
+ +
+
+using Creator = std::function<PrecPtr(const Operator&, const PropertyTree&, const std::function<Vector()>&, std::size_t)>
+

The type of creator functions passed to addCreator().

+
+ +
+
+using ParCreator = std::function<PrecPtr(const Operator&, const PropertyTree&, const std::function<Vector()>&, std::size_t, const Comm&)>
+
+ +
+
+using CriterionBase = Dune::Amg::AggregationCriterion<Dune::Amg::SymmetricDependency<Matrix, Dune::Amg::FirstDiagonal>>
+
+ +
+
+using Criterion = Dune::Amg::CoarsenCriterion<CriterionBase>
+
+ +
+
+

Public Static Functions

+
+
+static PrecPtr create(const Operator &op, const PropertyTree &prm, const std::function<Vector()> &weightsCalculator = {}, std::size_t pressureIndex = std::numeric_limits<std::size_t>::max())
+

Create a new serial preconditioner and return a pointer to it.

+
+
Parameters:
+
    +
  • op – operator to be preconditioned.

  • +
  • prm – parameters for the preconditioner, in particular its type.

  • +
  • weightsCalculator – Calculator for weights used in CPR.

  • +
+
+
Returns:
+

(smart) pointer to the created preconditioner.

+
+
+
+ +
+
+static PrecPtr create(const Operator &op, const PropertyTree &prm, const std::function<Vector()> &weightsCalculator, const Comm &comm, std::size_t pressureIndex = std::numeric_limits<std::size_t>::max())
+

Create a new parallel preconditioner and return a pointer to it.

+
+
Parameters:
+
    +
  • op – operator to be preconditioned.

  • +
  • prm – parameters for the preconditioner, in particular its type.

  • +
  • comm – communication object (typically OwnerOverlapCopyCommunication).

  • +
  • weightsCalculator – Calculator for weights used in CPR.

  • +
+
+
Returns:
+

(smart) pointer to the created preconditioner.

+
+
+
+ +
+
+static PrecPtr create(const Operator &op, const PropertyTree &prm, const Comm &comm, std::size_t pressureIndex = std::numeric_limits<std::size_t>::max())
+

Create a new parallel preconditioner and return a pointer to it.

+
+
Parameters:
+
    +
  • op – operator to be preconditioned.

  • +
  • prm – parameters for the preconditioner, in particular its type.

  • +
  • comm – communication object (typically OwnerOverlapCopyCommunication).

  • +
+
+
Returns:
+

(smart) pointer to the created preconditioner.

+
+
+
+ +
+
+static void addCreator(const std::string &type, Creator creator)
+

Add a creator for a serial preconditioner to the PreconditionerFactory. After the call, the user may obtain a preconditioner by calling create() with the given type string as a parameter contained in the property_tree.

+
+
Parameters:
+
    +
  • type – the type string we want the PreconditionerFactory to associate with the preconditioner.

  • +
  • creator – a function or lambda creating a preconditioner.

  • +
+
+
+
+ +
+
+static void addCreator(const std::string &type, ParCreator creator)
+

Add a creator for a parallel preconditioner to the PreconditionerFactory. After the call, the user may obtain a preconditioner by calling create() with the given type string as a parameter contained in the property_tree.

+
+
Parameters:
+
    +
  • type – the type string we want the PreconditionerFactory to associate with the preconditioner.

  • +
  • creator – a function or lambda creating a preconditioner.

  • +
+
+
+
+ +
+
+

Private Functions

+
+
+PreconditionerFactory()
+
+ +
+
+PrecPtr doCreate(const Operator &op, const PropertyTree &prm, const std::function<Vector()> weightsCalculator, std::size_t pressureIndex)
+
+ +
+
+PrecPtr doCreate(const Operator &op, const PropertyTree &prm, const std::function<Vector()> weightsCalculator, std::size_t pressureIndex, const Comm &comm)
+
+ +
+
+void doAddCreator(const std::string &type, Creator c)
+
+ +
+
+void doAddCreator(const std::string &type, ParCreator c)
+
+ +
+
+

Private Members

+
+
+std::map<std::string, Creator> creators_
+
+ +
+
+std::map<std::string, ParCreator> parallel_creators_
+
+ +
+
+bool defAdded_ = false
+

True if defaults creators have been added.

+
+ +
+
+

Private Static Functions

+
+
+static PreconditionerFactory &instance()
+
+ +
+
+ +
+
+template<class X, class Y>
class PreconditionerHolder
+
+

Common interface for adapters that hold preconditioners.

+
+

Note

+

The goal is that this class will be made useless after further restructuring of the solver interfaces (FlexibleSolver and friends), but for this is needed as an intermediate layer. See specifically SolverAdapter.hpp for how this is used.

+
+

Subclassed by Opm::gpuistl::GpuBlockPreconditioner< X, Y, C, P >

+
+

Public Functions

+
+
+virtual std::shared_ptr<Dune::PreconditionerWithUpdate<X, Y>> getUnderlyingPreconditioner() = 0
+

getUnderlyingPreconditioner gets the underlying preconditioner (preconditioner being held)

+
+ +
+
+ +
+
+template<class OriginalPreconditioner, class ...Args>
struct PreconditionerMaker : public Dune::GeneralPreconditionerMaker<OriginalPreconditioner>
+
+

Struct implementing a make function which creates a preconditioner Can create arbitrary preconditioners using parameter packs as template arguments.

+
+
Template Parameters:
+
    +
  • OriginalPreconditioner – - An arbitrary preconditioner type

  • +
  • ...Args – - All arguments needed to construct the preconditioner of choice

  • +
+
+
+
+

Public Types

+
+
+using GenericPreconditioner = Preconditioner<typename OriginalPreconditioner::domain_type, typename OriginalPreconditioner::range_type>
+
+ +
+
+

Public Functions

+
+
+inline explicit PreconditionerMaker(Args&&... args)
+
+ +
+
+inline virtual std::unique_ptr<GenericPreconditioner> make() override
+
+ +
+
+

Public Members

+
+
+std::tuple<Args...> args_
+
+ +
+
+ +
+
+template<class X, class Y>
class PreconditionerWithUpdate : public Preconditioner<X, Y>
+
+

Interface class adding the update() method to the preconditioner interface.

+

Subclassed by Amgx::AmgxPreconditioner< M, X, Y >, Dune::MultithreadDILU< M, X, Y >, Hypre::HyprePreconditioner< M, X, Y >, Opm::gpuistl::GpuBlockPreconditioner< X, Y, C, P >, Opm::gpuistl::GpuDILU< CPUMatrixT, X, Y, l >, Opm::gpuistl::GpuJac< M, X, Y, l >, Opm::gpuistl::GpuSeqILU0< M, X, Y, l >, Opm::gpuistl::OpmGpuILU0< CPUMatrixT, X, Y, l >, Opm::gpuistl::PreconditionerAdapter< X, Y, CudaPreconditionerType >, Opm::gpuistl::PreconditionerCPUMatrixToGPUMatrix< X, Y, CudaPreconditionerType, CPUMatrixType >, Opm::gpuistl::PreconditionerConvertFieldTypeAdapter< CudaPreconditionerType, M, X, Y, l >

+
+

Public Functions

+
+
+virtual void update() = 0
+
+ +
+
+virtual bool hasPerfectUpdate() const = 0
+
+ +
+
+ +
+
+struct PreSolveNetwork
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class FineOperator, class Communication, class Scalar, bool transpose = false>
class PressureBhpTransferPolicy : public Dune::Amg::LevelTransferPolicyCpr<FineOperator, Details::CoarseOperatorType<Scalar, Communication>>
+
+
+

Public Types

+
+
+using CoarseOperator = typename Details::CoarseOperatorType<Scalar, Communication>
+
+ +
+
+using ParentType = Dune::Amg::LevelTransferPolicyCpr<FineOperator, CoarseOperator>
+
+ +
+
+using ParallelInformation = Communication
+
+ +
+
+using FineVectorType = typename FineOperator::domain_type
+
+ +
+
+

Public Functions

+
+
+inline PressureBhpTransferPolicy(const Communication &comm, const FineVectorType &weights, const PropertyTree &prm, const std::size_t pressureIndex)
+
+ +
+
+inline void createCoarseLevelSystem(const FineOperator &fineOperator) override
+
+ +
+
+inline void calculateCoarseEntries(const FineOperator &fineOperator) override
+
+ +
+
+inline void moveToCoarseLevel(const typename ParentType::FineRangeType &fine) override
+
+ +
+
+inline void moveToFineLevel(typename ParentType::FineDomainType &fine) override
+
+ +
+
+inline PressureBhpTransferPolicy *clone() const override
+
+ +
+
+inline const Communication &getCoarseLevelCommunication() const
+
+ +
+
+

Private Members

+
+
+Communication *communication_
+
+ +
+
+const FineVectorType &weights_
+
+ +
+
+PropertyTree prm_
+
+ +
+
+const int pressure_var_index_
+
+ +
+
+std::shared_ptr<Communication> coarseLevelCommunication_
+
+ +
+
+std::shared_ptr<typename CoarseOperator::matrix_type> coarseLevelMatrix_
+
+ +
+
+ +
+
+template<class ODE>
class PressureFunction
+
+

Public Functions

+
+
+explicit PressureFunction(const ODE &ode, const InitCond &ic, const int nsample, const VSpan &span)
+
+ +
+
+PressureFunction(const PressureFunction &rhs)
+
+ +
+
+PressureFunction(PressureFunction &&rhs) = default
+
+ +
+
+PressureFunction &operator=(const PressureFunction &rhs)
+
+ +
+
+PressureFunction &operator=(PressureFunction &&rhs)
+
+ +
+
+Scalar value(const Scalar depth) const
+
+ +
+
+

Private Types

+
+
+enum Direction
+

Values:

+
+
+enumerator Up
+
+ +
+
+enumerator Down
+
+ +
+
+enumerator NumDir
+
+ +
+ +
+
+using Distribution = Details::RK4IVP<Scalar, ODE>
+
+ +
+
+using DistrPtr = std::unique_ptr<Distribution>
+
+ +
+
+

Private Members

+
+
+InitCond initial_
+
+ +
+
+std::array<DistrPtr, Direction::NumDir> value_
+
+ +
+
+ +
+
+struct PressureInverseOperator : public Dune::InverseOperator<X, X>
+

A wrapper that makes an inverse operator out of AMG.

+

The operator will use one step of AMG to approximately solve the coarse level system.

+
+

Public Functions

+
+
+inline PressureInverseOperator(Operator &op, const Opm::PropertyTree &prm, const SequentialInformation&)
+
+ +
+
+inline Dune::SolverCategory::Category category() const override
+
+ +
+
+inline bool hasPerfectUpdate() const
+
+ +
+
+inline void apply(X &x, X &b, double reduction, Dune::InverseOperatorResult &res) override
+
+ +
+
+inline void apply(X &x, X &b, Dune::InverseOperatorResult &res) override
+
+ +
+
+inline void updatePreconditioner()
+
+ +
+
+

Private Members

+
+
+std::unique_ptr<Solver> linsolver_
+
+ +
+
+ +
+
+template<class Scalar>
struct PressureMax
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e99
+
+ +
+
+ +
+
+template<class Scalar>
struct PressureMin
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = -1e99
+
+ +
+
+ +
+
+struct PressurePropertyFunctions
+
+
+

Public Members

+
+
+std::function<Scalar(int, int)> getTemperature = {}
+
+ +
+
+std::function<Scalar(int)> getSaltConcentration = {}
+
+ +
+
+std::function<int(int)> pvtRegionIdx = {}
+
+ +
+
+std::function<Scalar(int)> solventInverseFormationVolumeFactor = {}
+
+ +
+
+std::function<Scalar(int)> solventRefDensity = {}
+
+ +
+
+ +
+
+template<class OperatorType, class Solver, class LevelTransferPolicy>
class PressureSolverPolicy
+
+
+

Public Types

+
+
+using Operator = OperatorType
+

The type of the linear operator used.

+
+ +
+
+using CoarseLevelSolver = PressureInverseOperator
+

The type of solver constructed for the coarse level.

+
+ +
+
+

Public Functions

+
+
+inline explicit PressureSolverPolicy(const Opm::PropertyTree &prm)
+

Constructs the coarse solver policy.

+
+
Parameters:
+

prm – Parameter tree specifying the solver details.

+
+
+
+ +
+
+template<class LTP>
inline void setCoarseOperator(LTP &transferPolicy)
+

Constructs a coarse level solver.

+
+
Parameters:
+

transferPolicy – The policy describing the transfer between levels.

+
+
Returns:
+

A pointer to the constructed coarse level solver.

+
+
+
+ +
+
+template<class LTP>
inline CoarseLevelSolver *createCoarseLevelSolver(LTP &transferPolicy)
+
+ +
+
+

Private Types

+
+
+using X = typename Operator::range_type
+
+ +
+
+

Private Members

+
+
+std::shared_ptr<Operator> coarseOperator_
+

The coarse level operator.

+
+ +
+
+Opm::PropertyTree prm_
+
+ +
+
+ +
+
+template<class FluidSystem, class Region>
class PressureTable
+
+#include <InitStateEquil.hpp>
+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using VSpan = std::array<Scalar, 2>
+
+ +
+
+

Public Functions

+
+
+explicit PressureTable(const Scalar gravity, const int samplePoints = 2000)
+

Constructor

+
+
Parameters:
+
    +
  • gravity[in] Norm of gravity vector (acceleration strength due to gravity). Normally the standardised value at Tellus equator (9.80665 m/s^2).

  • +
  • samplePoints[in] Number of equally spaced depth sample points in each internal phase pressure table.

  • +
+
+
+
+ +
+
+PressureTable(const PressureTable &rhs)
+

Copy constructor

+
+
Parameters:
+

rhs[in] Source object for copy initialization.

+
+
+
+ +
+
+PressureTable(PressureTable &&rhs)
+

Move constructor

+
+
Parameters:
+

rhs[inout] Source object for move initialization. On output, left in a moved-from (“valid but unspecified”) state. Internal pointers in rhs are null (unique_ptr guarantee).

+
+
+
+ +
+
+PressureTable &operator=(const PressureTable &rhs)
+

Assignment operator

+
+
Parameters:
+

rhs[in] Source object.

+
+
Returns:
+

*this 
+
+
+.

+
+
+
+ +
+
+PressureTable &operator=(PressureTable &&rhs)
+

Move-assignment operator

+
+
Parameters:
+

rhs[in]

Source object. On output, left in a moved-from (“valid

+

but unspecified”) state. Internal pointers in

+rhs are null (unique_ptr guarantee).

+
+
Returns:
+

*this 
+
+
+.

+
+
+
+ +
+
+void equilibrate(const Region &reg, const VSpan &span)
+
+ +
+
+bool oilActive() const
+

Predicate for whether or not oil is an active phase.

+
+ +
+
+bool gasActive() const
+

Predicate for whether or not gas is an active phase.

+
+ +
+
+bool waterActive() const
+

Predicate for whether or not water is an active phase.

+
+ +
+
+Scalar oil(const Scalar depth) const
+

Evaluate oil phase pressure at specified depth.

+
+
Parameters:
+

depth[in] Depth of evaluation point. Should generally be within the span from the previous call to

equilibrate()
+
+
+.

+
+
Returns:
+

Oil phase pressure at specified depth.

+
+
+
+ +
+
+Scalar gas(const Scalar depth) const
+

Evaluate gas phase pressure at specified depth.

+
+
Parameters:
+

depth[in] Depth of evaluation point. Should generally be within the span from the previous call to

equilibrate()
+
+
+.

+
+
Returns:
+

Gas phase pressure at specified depth.

+
+
+
+ +
+
+Scalar water(const Scalar depth) const
+

Evaluate water phase pressure at specified depth.

+
+
Parameters:
+

depth[in] Depth of evaluation point. Should generally be within the span from the previous call to

equilibrate()
+
+
+.

+
+
Returns:
+

Water phase pressure at specified depth.

+
+
+
+ +
+
+

Private Types

+
+
+using OilPressODE = PhasePressODE::Oil<FluidSystem, typename Region::CalcDissolution>
+
+ +
+
+using GasPressODE = PhasePressODE::Gas<FluidSystem, typename Region::CalcEvaporation, typename Region::CalcWaterEvaporation>
+
+ +
+
+using WatPressODE = PhasePressODE::Water<FluidSystem>
+
+ +
+
+using OPress = PressureFunction<OilPressODE>
+
+ +
+
+using GPress = PressureFunction<GasPressODE>
+
+ +
+
+using WPress = PressureFunction<WatPressODE>
+
+ +
+
+using Strategy = void (PressureTable::*)(const Region&, const VSpan&)
+
+ +
+
+

Private Functions

+
+
+template<typename PressFunc>
void checkPtr(const PressFunc *phasePress, const std::string &phaseName) const
+
+ +
+
+Strategy selectEquilibrationStrategy(const Region &reg) const
+
+ +
+
+void copyInPointers(const PressureTable &rhs)
+
+ +
+
+void equil_WOG(const Region &reg, const VSpan &span)
+
+ +
+
+void equil_GOW(const Region &reg, const VSpan &span)
+
+ +
+
+void equil_OWG(const Region &reg, const VSpan &span)
+
+ +
+
+void makeOilPressure(const typename OPress::InitCond &ic, const Region &reg, const VSpan &span)
+
+ +
+
+void makeGasPressure(const typename GPress::InitCond &ic, const Region &reg, const VSpan &span)
+
+ +
+
+void makeWatPressure(const typename WPress::InitCond &ic, const Region &reg, const VSpan &span)
+
+ +
+
+

Private Members

+
+
+Scalar gravity_
+
+ +
+
+int nsample_
+
+ +
+
+std::unique_ptr<OPress> oil_ = {}
+
+ +
+
+std::unique_ptr<GPress> gas_ = {}
+
+ +
+
+std::unique_ptr<WPress> wat_ = {}
+
+ +
+
+ +
+
+template<class FineOperator, class Communication, class Scalar, bool transpose = false>
class PressureTransferPolicy : public Dune::Amg::LevelTransferPolicyCpr<FineOperator, Details::CoarseOperatorType<Scalar, Communication>>
+
+
+

Public Types

+
+
+using CoarseOperator = typename Details::CoarseOperatorType<Scalar, Communication>
+
+ +
+
+using ParentType = Dune::Amg::LevelTransferPolicyCpr<FineOperator, CoarseOperator>
+
+ +
+
+using ParallelInformation = Communication
+
+ +
+
+using FineVectorType = typename FineOperator::domain_type
+
+ +
+
+

Public Functions

+
+
+inline PressureTransferPolicy(const Communication &comm, const FineVectorType &weights, const PropertyTree&, int pressure_var_index)
+
+ +
+
+inline void createCoarseLevelSystem(const FineOperator &fineOperator) override
+
+ +
+
+inline void calculateCoarseEntries(const FineOperator &fineOperator) override
+
+ +
+
+inline void moveToCoarseLevel(const typename ParentType::FineRangeType &fine) override
+
+ +
+
+inline void moveToFineLevel(typename ParentType::FineDomainType &fine) override
+
+ +
+
+inline PressureTransferPolicy *clone() const override
+
+ +
+
+inline const Communication &getCoarseLevelCommunication() const
+
+ +
+
+inline std::size_t getPressureIndex() const
+
+ +
+
+

Private Members

+
+
+Communication *communication_
+
+ +
+
+const FineVectorType &weights_
+
+ +
+
+const std::size_t pressure_var_index_
+
+ +
+
+std::shared_ptr<Communication> coarseLevelCommunication_
+
+ +
+
+std::shared_ptr<typename CoarseOperator::matrix_type> coarseLevelMatrix_
+
+ +
+
+ +
+
+template<class Scalar>
struct PriVarOscilationThreshold
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-5
+
+ +
+
+ +
+
+template<class TypeTag>
struct Problem<TypeTag, TTag::FlowBaseProblemBlackoil>
+
+
+

Public Types

+
+
+using type = FlowProblemBlackoil<TypeTag>
+
+ +
+
+ +
+
+template<class TypeTag>
struct Problem<TypeTag, TTag::FlowBaseProblemComp>
+
+
+

Public Types

+
+
+using type = FlowProblemComp<TypeTag>
+
+ +
+
+ +
+
+struct ProjectSaturations
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct Properties
+
+
+

Public Members

+
+
+std::vector<Scalar> b_perf = {}
+
+ +
+
+std::vector<Scalar> rsmax_perf = {}
+
+ +
+
+std::vector<Scalar> rvmax_perf = {}
+
+ +
+
+std::vector<Scalar> rvwmax_perf = {}
+
+ +
+
+std::vector<Scalar> rswmax_perf = {}
+
+ +
+
+std::vector<Scalar> surf_dens_perf = {}
+
+ +
+
+ +
+
+class PropertyTree
+
+#include <PropertyTree.hpp>
+

Hierarchical collection of key/value pairs.

+
+

Public Functions

+
+
+PropertyTree()
+

Default constructor.

+

Should typically be populated in put() before use.

+
+ +
+
+explicit PropertyTree(const std::string &jsonFile)
+

Constructor

+

Loads a property tree from an external source expected to be a text file in JSON.

+
+
Parameters:
+

jsonFile[in] Name of file containing external property tree, linearised into JSON format.

+
+
+
+ +
+
+PropertyTree(const PropertyTree &tree)
+

Copy constructor.

+
+
Parameters:
+

tree[in] Source object.

+
+
+
+ +
+
+~PropertyTree()
+

Destructor.

+
+ +
+
+PropertyTree &operator=(const PropertyTree &tree)
+

Assignment operator

+
+
Parameters:
+

tree[in] Source object.

+
+
Returns:
+

*this 
+
+
+.

+
+
+
+ +
+
+template<class T>
void put(const std::string &key, const T &data)
+

Insert key/value pair into property tree

+
+
Template Parameters:
+

T – Value type

+
+
Parameters:
+
    +
  • key[in] Property key. Expected to be in hierarchical notation for subtrees&#8212;i.e., using periods (‘.’) to separate hierarchy levels.

  • +
  • data[in] Property value corresponding to key.

  • +
+
+
+
+ +
+
+template<class T>
T get(const std::string &key) const
+

Retrieve property value given hierarchical property key.

+
+
Template Parameters:
+

T – Value type

+
+
Parameters:
+

key[in] Property key. Expected to be in hierarchical notation for subtrees&#8212;i.e., using periods (‘.’) to separate hierarchy levels.

+
+
Returns:
+

Copy of internal property value for key.

+
+
+
+ +
+
+template<class T>
T get(const std::string &key, const T &defValue) const
+

Retrieve property value given hierarchical property key.

+
+
Template Parameters:
+

T – Value type

+
+
Parameters:
+
    +
  • key[in] Property key. Expected to be in hierarchical notation for subtrees&#8212;i.e., using periods (‘.’) to separate hierarchy levels.

  • +
  • defValue[in] Default value for when key is not in the property tree.

  • +
+
+
Returns:
+

Copy of internal property value for key, or a copy of defValue if the key is not in the property tree.

+
+
+
+ +
+
+PropertyTree get_child(const std::string &key) const
+

Retrieve copy of sub tree rooted at node.

+

Throws an exception if no sub tree exists at given root.

+
+
Parameters:
+

Property[in] key. Expected to be in hierarchical notation for subtrees&#8212;i.e., using periods (‘.’) to separate hierarchy levels.

+
+
Returns:
+

Copy of property sub tree rooted at key.

+
+
+
+ +
+
+std::optional<PropertyTree> get_child_optional(const std::string &key) const
+

Retrieve copy of sub tree rooted at node.

+
+
Parameters:
+

Property[in] key. Expected to be in hierarchical notation for subtrees&#8212;i.e., using periods (‘.’) to separate hierarchy levels.

+
+
Returns:
+

Copy of property sub tree rooted at key. Nullopt if no sub tree exists that is rooted at key.

+
+
+
+ +
+
+template<typename T>
std::optional<std::vector<T>> get_child_items_as_vector(const std::string &child) const
+

Retrieve node items as linearised vector.

+

Assumes that the node’s child is an array type of homongeneous elements.

+
+
Template Parameters:
+

T – Array element type.

+
+
Parameters:
+

child[in] Property key. Expected to be in hierarchical notation for subtrees&#8212;i.e., using periods (‘.’) to separate hierarchy levels.

+
+
Returns:
+

Array of property values. Nullopt if no node named by child exists.

+
+
+
+ +
+
+void write_json(std::ostream &os, bool pretty) const
+

Emit a textual representation of the property tree in JSON form

+
+
Parameters:
+
    +
  • os[inout] Output stream. Typically a stream opened on a file.

  • +
  • pretty[in] Whether or not to pretty-print the JSON output&#8212;i.e., whether or not to insert new lines and spaces for human readability.

  • +
+
+
+
+ +
+
+

Protected Functions

+
+
+PropertyTree(const boost::property_tree::ptree &tree)
+

Converting constructor.

+

Forms a property tree object from a Boost ptree.

+
+
Parameters:
+

tree[in] Source object represented as a Boost ptree.

+
+
+
+ +
+
+

Protected Attributes

+
+
+std::unique_ptr<boost::property_tree::ptree> tree_
+

Internal representation of the property tree.

+
+ +
+
+ +
+
+class PyBlackOilSimulator
+
+
+

Public Functions

+
+
+PyBlackOilSimulator(const std::string &deckFilename, const std::vector<std::string> &args)
+
+ +
+
+PyBlackOilSimulator(std::shared_ptr<Opm::Deck> deck, std::shared_ptr<Opm::EclipseState> state, std::shared_ptr<Opm::Schedule> schedule, std::shared_ptr<Opm::SummaryConfig> summary_config)
+
+ +
+
+void advance(int report_step)
+
+ +
+
+bool checkSimulationFinished()
+
+ +
+
+int currentStep()
+
+ +
+
+py::array_t<double> getFluidStateVariable(const std::string &name) const
+
+ +
+
+py::array_t<double> getCellVolumes()
+
+ +
+
+double getDT()
+
+ +
+
+py::array_t<double> getPorosity()
+
+ +
+
+py::array_t<double> getPrimaryVariable(const std::string &variable) const
+
+ +
+
+py::array_t<int> getPrimaryVarMeaning(const std::string &variable) const
+
+ +
+
+std::map<std::string, int> getPrimaryVarMeaningMap(const std::string &variable) const
+
+ +
+
+int run()
+
+ +
+
+void setPorosity(py::array_t<double, py::array::c_style | py::array::forcecast> array)
+
+ +
+
+void setPrimaryVariable(const std::string &idx_name, py::array_t<double, py::array::c_style | py::array::forcecast> array)
+
+ +
+
+void setupMpi(bool init_mpi, bool finalize_mpi)
+
+ +
+
+int step()
+
+ +
+
+int stepCleanup()
+
+ +
+
+int stepInit()
+
+ +
+
+

Private Types

+
+
+using TypeTag = Opm::Properties::TTag::FlowProblemTPFA
+
+ +
+
+using Simulator = Opm::GetPropType<TypeTag, Opm::Properties::Simulator>
+
+ +
+
+

Private Functions

+
+
+Opm::FlowMain<TypeTag> &getFlowMain() const
+
+ +
+
+PyFluidState<TypeTag> &getFluidState() const
+
+ +
+
+PyMaterialState<TypeTag> &getMaterialState() const
+
+ +
+
+

Private Members

+
+
+const std::string deck_filename_
+
+ +
+
+bool has_run_init_ = false
+
+ +
+
+bool has_run_cleanup_ = false
+
+ +
+
+bool mpi_init_ = true
+
+ +
+
+bool mpi_finalize_ = true
+
+ +
+
+std::unique_ptr<Opm::PyMain> main_
+
+ +
+
+std::unique_ptr<Opm::FlowMain<TypeTag>> flow_main_
+
+ +
+
+Simulator *simulator_
+
+ +
+
+std::unique_ptr<PyFluidState<TypeTag>> fluid_state_
+
+ +
+
+std::unique_ptr<PyMaterialState<TypeTag>> material_state_
+
+ +
+
+std::shared_ptr<Opm::Deck> deck_
+
+ +
+
+std::shared_ptr<Opm::EclipseState> eclipse_state_
+
+ +
+
+std::shared_ptr<Opm::Schedule> schedule_
+
+ +
+
+std::shared_ptr<Opm::SummaryConfig> summary_config_
+
+ +
+
+std::vector<std::string> args_
+
+ +
+
+ +
+
+template<class TypeTag>
class PyFluidState
+
+#include <PyFluidState.hpp>
+
+

Public Functions

+
+
+PyFluidState(Simulator *simulator)
+
+ +
+
+std::vector<double> getFluidStateVariable(const std::string &name) const
+
+ +
+
+std::vector<int> getPrimaryVarMeaning(const std::string &variable) const
+
+ +
+
+std::map<std::string, int> getPrimaryVarMeaningMap(const std::string &variable) const
+
+ +
+
+std::vector<double> getPrimaryVariable(const std::string &idx_name) const
+
+ +
+
+void setPrimaryVariable(const std::string &idx_name, const double *data, std::size_t size)
+
+ +
+
+

Private Types

+
+
+enum class VariableType
+

Values:

+
+
+enumerator Sw
+
+ +
+
+enumerator Sg
+
+ +
+
+enumerator So
+
+ +
+
+enumerator pw
+
+ +
+
+enumerator pg
+
+ +
+
+enumerator po
+
+ +
+
+enumerator Rs
+
+ +
+
+enumerator Rv
+
+ +
+
+enumerator rho_w
+
+ +
+
+enumerator rho_g
+
+ +
+
+enumerator rho_o
+
+ +
+
+enumerator T
+
+ +
+ +
+
+using Simulator = GetPropType<TypeTag, Opm::Properties::Simulator>
+
+ +
+
+using Problem = GetPropType<TypeTag, Opm::Properties::Problem>
+
+ +
+
+using Model = GetPropType<TypeTag, Opm::Properties::Model>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Opm::Properties::ElementContext>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Opm::Properties::FluidSystem>
+
+ +
+
+using Indices = GetPropType<TypeTag, Opm::Properties::Indices>
+
+ +
+
+using GridView = GetPropType<TypeTag, Opm::Properties::GridView>
+
+ +
+
+using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>
+
+ +
+
+

Private Functions

+
+
+std::size_t getPrimaryVarIndex_(const std::string &idx_name) const
+
+ +
+
+int getVariableMeaning_(PrimaryVariables &primary_vars, const std::string &variable) const
+
+ +
+
+VariableType getVariableType_(const std::string &name) const
+
+ +
+
+template<class FluidState>
double getVariableValue_(FluidState &fs, VariableType var_type, const std::string &name) const
+
+ +
+
+void variableNotFoundError_(const std::string &name) const
+
+ +
+
+

Private Members

+
+
+Simulator *simulator_
+
+ +
+
+ +
+
+template<class TypeTag>
class PyMaterialState
+
+#include <PyMaterialState.hpp>
+
+

Public Functions

+
+
+inline PyMaterialState(Simulator *simulator)
+
+ +
+
+std::vector<double> getCellVolumes()
+
+ +
+
+std::vector<double> getPorosity()
+
+ +
+
+void setPorosity(const double *poro, std::size_t size)
+
+ +
+
+

Private Types

+
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Problem = GetPropType<TypeTag, Properties::Problem>
+
+ +
+
+using Model = GetPropType<TypeTag, Properties::Model>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+

Private Members

+
+
+Simulator *simulator_
+
+ +
+
+ +
+
+template<class Value>
class RatioCalculator
+
+#include <RatioCalculator.hpp>
+
+

Public Types

+
+
+using Scalar = decltype(getValue(Value{}))
+
+ +
+
+

Public Functions

+
+
+RatioCalculator(int gasCompIdx, int oilCompIdx, int waterCompIdx, std::string_view name)
+
+ +
+
+void disOilVapWatVolumeRatio(Value &volumeRatio, const Value &rvw, const Value &rsw, const Value &pressure, const std::vector<Value> &cmix_s, const std::vector<Value> &b_perfcells_dense, DeferredLogger &deferred_logger) const
+
+ +
+
+void gasOilPerfRateInj(const std::vector<Value> &cq_s, PerforationRates<Scalar> &perf_rates, const Value &rv, const Value &rs, const Value &pressure, const Value &rvw, const bool waterActive, DeferredLogger &deferred_logger) const
+
+ +
+
+void gasOilPerfRateProd(std::vector<Value> &cq_s, PerforationRates<Scalar> &perf_rates, const Value &rv, const Value &rs, const Value &rvw, const bool waterActive, const bool isProducer) const
+
+ +
+
+void gasOilVolumeRatio(Value &volumeRatio, const Value &rv, const Value &rs, const Value &pressure, const std::vector<Value> &cmix_s, const std::vector<Value> &b_perfcells_dense, DeferredLogger &deferred_logger) const
+
+ +
+
+void gasWaterPerfRateInj(const std::vector<Value> &cq_s, PerforationRates<Scalar> &perf_rates, const Value &rvw, const Value &rsw, const Value &pressure, DeferredLogger &deferred_logger) const
+
+ +
+
+void gasWaterPerfRateProd(std::vector<Value> &cq_s, PerforationRates<Scalar> &perf_rates, const Value &rvw, const Value &rsw, const bool isProducer) const
+
+ +
+
+

Private Members

+
+
+int gasComp_
+
+ +
+
+int oilComp_
+
+ +
+
+int waterComp_
+
+ +
+
+std::string name_
+
+ +
+
+ +
+
+struct RatioLimitCheckReport
+
+

Public Members

+
+
+bool ratio_limit_violated = false
+
+ +
+
+int worst_offending_completion = INVALIDCOMPLETION
+
+ +
+
+Scalar violation_extent = 0.0
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int INVALIDCOMPLETION = std::numeric_limits<int>::max()
+
+ +
+
+ +
+
+struct RealReorderer : public Opm::detail::Reorderer
+
+#include <MILU.hpp>
+
+

Public Functions

+
+
+inline explicit RealReorderer(const std::vector<std::size_t> &ordering)
+
+ +
+
+inline virtual std::size_t operator[](std::size_t i) const override
+
+ +
+
+

Public Members

+
+
+const std::vector<std::size_t> *ordering_
+
+ +
+
+ +
+
+template<class OriginalPreconditioner>
class RebuildOnUpdatePreconditioner : public Dune::PreconditionerWithUpdate<OriginalPreconditioner::domain_type, OriginalPreconditioner::range_type>
+
+

Wrapper class of preconditioners that should be reconstructed on update.

+
+
Template Parameters:
+

OriginalPreconditioner – - Preconditioner of your choice

+
+
+
+

Public Types

+
+
+using X = typename OriginalPreconditioner::domain_type
+
+ +
+
+using Y = typename OriginalPreconditioner::range_type
+
+ +
+
+

Public Functions

+
+
+template<class ...Args>
inline explicit RebuildOnUpdatePreconditioner(Args... args)
+
+ +
+
+inline void pre(X &x, Y &b) override
+
+ +
+
+inline void apply(X &v, const Y &d) override
+
+ +
+
+inline void post(X &x) override
+
+ +
+
+inline SolverCategory::Category category() const override
+
+ +
+
+inline virtual void update() override
+
+ +
+
+inline virtual bool hasPerfectUpdate() const override
+
+ +
+
+

Private Types

+
+
+using AbstractMakerType = GeneralPreconditionerMaker<OriginalPreconditioner>
+
+ +
+
+using GenericPreconditioner = Preconditioner<typename OriginalPreconditioner::domain_type, typename OriginalPreconditioner::range_type>
+
+ +
+
+

Private Members

+
+
+std::unique_ptr<AbstractMakerType> preconditioner_maker_
+
+ +
+
+std::unique_ptr<GenericPreconditioner> orig_precond_
+
+ +
+
+ +
+
+struct Region
+
+

Compile-time disambiguation type for regions.

+
+

Public Members

+
+
+unsigned int ix
+

Region index.

+
+ +
+
+ +
+
+template<typename RegionId, class Attributes>
class RegionAttributes
+
+

Provide mapping from Region IDs to user-specified collection of per-region attributes.

+
+
Template Parameters:
+
    +
  • RegionId – Region identifier type. Must be hashable by

    std::hash<> 
    +
    +
    +. Typically a built-in integer type&#8212;e.g., int.

  • +
  • Attributes – User-defined type that represents collection of attributes that have meaning in a per-region aggregate sense. Must be copy-constructible.

  • +
+
+
+
+

Public Types

+
+
+using RegionID = typename Select::RegionIDParameter<RegionId, std::is_integral<RegionId>::value>::type
+

Expose RegionId as a vocabulary type for use in query methods.

+
+ +
+
+using ID = typename std::remove_reference<RegionId>::type
+
+ +
+
+using AttributeMap = std::unordered_map<ID, std::unique_ptr<Value>>
+
+ +
+
+

Public Functions

+
+
+template<class RMap>
inline RegionAttributes(const RMap &rmap, const Attributes &attr)
+

Constructor.

+
+
Template Parameters:
+

RMap – Class type that implements the RegionMapping protocol. Typically an instantiation of

Opm::RegionMapping<> 
+
+
+.

+
+
Parameters:
+
    +
  • rmap[in] Specific region mapping that provides reverse lookup from regions to cells.

  • +
  • attr[in] Pre-constructed initialiser for Attributes.

  • +
+
+
+
+ +
+
+inline int cell(const RegionID reg) const
+

Retrieve representative cell in region.

+
+
Parameters:
+

reg[in] Specific region.

+
+
Returns:
+

Representative cell in region reg.

+
+
+
+ +
+
+inline bool has(const RegionID reg) const
+
+ +
+
+inline void insert(const RegionID r, const Attributes &attr)
+
+ +
+
+inline const AttributeMap &attributes() const
+

Request read-only access to region’s attributes.

+
+
Returns:
+

Read-only access to all regions attributes.

+
+
+
+ +
+
+inline const Attributes &attributes(const RegionID reg) const
+

Request read-only access to region’s attributes.

+
+
Parameters:
+

reg[in] Specific region.

+
+
Returns:
+

Read-only access to region reg's per-region attributes.

+
+
+
+ +
+
+inline Attributes &attributes(const RegionID reg)
+

Request modifiable access to region’s attributes.

+
+
Parameters:
+

reg[in] Specific region.

+
+
Returns:
+

Read-write access to region reg's per-region attributes.

+
+
+
+ +
+
+

Private Functions

+
+
+inline const Value &find(const RegionID reg) const
+

Read-only access to region’s properties.

+
+ +
+
+inline Value &find(const RegionID reg)
+

Read-write access to region’s properties.

+
+ +
+
+

Private Members

+
+
+AttributeMap attr_
+
+ +
+
+ +
+
+template<class RegionID, bool>
struct RegionIDParameter
+
+
+

Public Types

+
+
+using type = typename std::remove_reference<RegionID>::type&
+
+ +
+
+ +
+
+template<class RegionID>
struct RegionIDParameter<RegionID, true>
+
+
+

Public Types

+
+
+using type = RegionID
+
+ +
+
+ +
+
+class RegionPhasePoreVolAverage
+
+

Facility for calculating volume-weighted average function values over user-defined regions in parallel. Defaults to phase-filled pore-volume averages, but falls back to simple pore-volume averages if the saturation is identically zero in a region&#8212;i.e., calculates what the average value would be if the phase fully occupied the available pore-volume in this case.

+
+

Public Types

+
+
+using RegionArrayAccessor = std::function<const std::vector<int>&(const std::string&)>
+

Call-back function type for accessing region arrays&#8212;typically the FIP* arrays.

+
+ +
+
+

Public Functions

+
+
+explicit RegionPhasePoreVolAverage(const Parallel::Communication &comm, std::size_t numPhases, const std::vector<std::string> &regionNames, RegionArrayAccessor getRegionArray)
+

Constructor.

+
+
Parameters:
+
    +
  • comm[in] Grid level global communicator.

  • +
  • numPhases[in] Number of phases for which to calculate average values.

  • +
  • regionNames[in] List of region sets. Typically contains one or more of the FIP* array names and, possibly, the PVTNUM region set as well.

  • +
  • getRegionArray[in] Call-back function for accessing region definition from region set names.

  • +
+
+
+
+ +
+
+double fieldValue(const Phase &p) const
+

Retrieve field-level average function value for specific phase.

+
+
Parameters:
+

p[in] Phase for which to retrieve the field-level average function value.

+
+
Returns:
+

Field-level average function value for phase p.

+
+
+
+ +
+
+double value(std::string_view rset, const Phase &p, const Region &r) const
+

Retrieve region-level average function value for specific phase in specific region of named region set.

+
+
Parameters:
+
    +
  • rset[in] Named region set&#8212;e.g., “FIPNUM”.

  • +
  • p[in] Phase for which to retrieve the region-level average function value.

  • +
  • r[in] Region ID for which to retrieve the region-level average function value.

  • +
+
+
Returns:
+

Region-level average function value.

+
+
+
+ +
+
+void prepareAccumulation()
+

Clear internal arrays in preparation of accumulating region-level averages from per-cell contributions.

+
+ +
+
+void addCell(std::size_t activeCell, const Phase &p, const CellValue &cv)
+

Incorporate contributions from a single cell.

+
+
Parameters:
+
    +
  • activeCell[in] Per-rank active cell ID&#8212;typically one of the rank’s interior cells.

  • +
  • p[in] Phase for which to incorporate the per-cell contribution.

  • +
  • cv[in] Single cell function value contribution.

  • +
+
+
+
+ +
+
+void accumulateParallel()
+

Accumulate region-level average values across MPI ranks.

+

Typically the last step in calculating the region-level average values. It is typically an error to call this function multiple times without an intervening call to prepareAccumulation().

+
+ +
+
+

Private Types

+
+
+enum AvgType
+

Kinds of weighting functions.

+

Values:

+
+
+enumerator SatPV
+
+ +
+
+enumerator PV
+
+ +
+
+enumerator NumTypes
+
+ +
+ +
+
+enum Element
+

Elements/items collected per average type.

+

Values:

+
+
+enumerator Value
+
+ +
+
+enumerator Weight
+
+ +
+
+enumerator NumElem
+
+ +
+ +
+
+using Ix = std::vector<double>::size_type
+

Index type for value array.

+
+ +
+
+

Private Functions

+
+
+double averageValueWithFallback(Ix start) const
+

Compute final average value for a single region and phase.

+

Prefers the average value weighted by phase-filled pore-volume, but falls back to average value weighted by total pore-volume if saturation is identically zero throughout the region.

+
+
Parameters:
+

start[in] Offset into linearised value array (x_) corresponding to the first average value type of a particular phase in a particular region. Usually calculated by fieldStartIx() or rsetStartIx().

+
+
Returns:
+

Weighted average function value.

+
+
+
+ +
+
+double averageValue(Ix start, AvgType type) const
+

Compute average function value for a single region and phase.

+
+
Parameters:
+
    +
  • start[in] Offset into linearised value array (x_) corresponding to the first average value type of a particular phase in a particular region. Usually calculated by fieldStartIx() or rsetStartIx().

  • +
  • type[in] Which kind of average value to compute.

  • +
+
+
Returns:
+

Weighted average function value.

+
+
+
+ +
+
+Ix fieldStartIx(unsigned int phase) const
+

Compute linearised value array offset for field-level average function values of a single phase.

+
+
Parameters:
+

phase[in] Phase index for which to compute array offset.

+
+
Returns:
+

Value array offset for field-level averages of phase.

+
+
+
+ +
+
+Ix rsetStartIx(std::size_t rset, int region, unsigned int phase) const
+

Compute linearised value array offset for region-level average function values of a single phase.

+
+
Parameters:
+
    +
  • rset[in] Enumerated region set.

  • +
  • region[in] Region index within rset.

  • +
  • phase[in] Phase index for which to compute array offset.

  • +
+
+
Returns:
+

Value array offset for region-level averages of phase.

+
+
+
+ +
+
+Ix startIx(std::size_t offset, unsigned int phase) const
+

Compute linearised value array offset for average function values of a single phase.

+
+
Parameters:
+
    +
  • offset[in] Field or region base offset.

  • +
  • phase[in] Phase index for which to compute array offset.

  • +
+
+
Returns:
+

Value array offset for weighted averages of phase.

+
+
+
+ +
+
+int regionIndex(std::size_t rset, std::size_t activeCell) const
+

Compute region ID of single active cell within particular region set.

+
+
Parameters:
+
    +
  • rset[in] Enumerated region set.

  • +
  • activeCell[in] Per-rank active cell ID&#8212;typically one of the rank’s interior cells.

  • +
+
+
Returns:
+

Region ID of activeCell within rset.

+
+
+
+ +
+
+void add(Ix start, const CellValue &cv)
+

Incorporate per-cell contribution into all average function types.

+
+
Parameters:
+
    +
  • start[in] Offset into linearised value array (x_) corresponding to the first average value type of a particular phase in a particular region. Usually calculated by fieldStartIx() or rsetStartIx().

  • +
  • cv[in] Single cell function value contribution.

  • +
+
+
+
+ +
+
+void add(Ix start, AvgType type, double x, double w)
+

Incorporate per-cell contribution into specific function type.

+
+
Parameters:
+
    +
  • start[in] Offset into linearised value array (x_) corresponding to the first average value type of a particular phase in a particular region. Usually calculated by fieldStartIx() or rsetStartIx().

  • +
  • type[in] Which kind of average value to accumulate.

  • +
  • x[in] Function value.

  • +
  • w[in] Function weight.

  • +
+
+
+
+ +
+
+double &value(Ix start, AvgType type)
+

Mutable access to value item of specific average value type

+
+
Parameters:
+
    +
  • start[in] Offset into linearised value array (x_) corresponding to the first average value type of a particular phase in a particular region. Usually calculated by fieldStartIx() or rsetStartIx().

  • +
  • type[in] Which kind of average value to accumulate.

  • +
+
+
Returns:
+

Reference to mutable element of linearised value array corresponding to the running sum of function values.

+
+
+
+ +
+
+double &weight(Ix start, AvgType type)
+

Mutable access to weight item of specific average value type

+
+
Parameters:
+
    +
  • start[in] Offset into linearised value array (x_) corresponding to the first average value type of a particular phase in a particular region. Usually calculated by fieldStartIx() or rsetStartIx().

  • +
  • type[in] Which kind of average value to accumulate.

  • +
+
+
Returns:
+

Reference to mutable element of linearised value array corresponding to the running sum of function weights.

+
+
+
+ +
+
+double value(Ix start, AvgType type) const
+

Read-only access to value item of specific average value type

+
+
Parameters:
+
    +
  • start[in] Offset into linearised value array (x_) corresponding to the first average value type of a particular phase in a particular region. Usually calculated by fieldStartIx() or rsetStartIx().

  • +
  • type[in] Which kind of average value to accumulate.

  • +
+
+
Returns:
+

Running sum of function value.

+
+
+
+ +
+
+double weight(Ix start, AvgType type) const
+

Read-only access to weight item of specific average value type

+
+
Parameters:
+
    +
  • start[in] Offset into linearised value array (x_) corresponding to the first average value type of a particular phase in a particular region. Usually calculated by fieldStartIx() or rsetStartIx().

  • +
  • type[in] Which kind of average value to accumulate.

  • +
+
+
Returns:
+

Running sum of function weights.

+
+
+
+ +
+
+Ix valueArrayIndex(Ix start, AvgType type, Element element) const
+

Compute value array index of particular item of particular average value

+
+
Parameters:
+
    +
  • start[in] Offset into linearised value array (x_) corresponding to the first average value type of a particular phase in a particular region. Usually calculated by fieldStartIx() or rsetStartIx().

  • +
  • type[in] Which kind of average value to reference.

  • +
  • element[in] Which running sum element to reference for this particular average value.

  • +
+
+
Returns:
+

Index into linearised value array x_ corresponding to this particular element of this particular average function type.

+
+
+
+ +
+
+

Private Members

+
+
+std::reference_wrapper<const Parallel::Communication> comm_
+

MPI communication object.

+
+ +
+
+std::size_t np_ = {}
+

Number of phases for which to accumulate function value averages.

+
+ +
+
+std::vector<std::string> rsetNames_ = {}
+

Named region sets.

+
+ +
+
+RegionArrayAccessor getRegionArray_
+

Call-back function for accessing region set arrays.

+
+ +
+
+std::vector<Ix> rsStart_ = {}
+

Start pointers for average values of each named region set. In particular,

rsStart_[i] 
+
+
+ identifies the offset into x_ of the first average type of the first phase of the first region in region set
rsetNames_[i] 
+
+
+.

+
+ +
+
+std::vector<double> x_ = {}
+

All elements&#8212;i.e., running sums&#8212;that go into calculating the field- and region-level weighted function averages per phase. We store all elements in a single linear array, and track numerators and denominators in separate elements, in order to simplify cross-rank reduction in parallel simulation runs. See accumulateParallel() for details on this reduction process.

+

There are np_ base entries for each region in each region set (+ FIELD). Each base entry has

AvgType::NumTypes 
+
+
+ different average types, and each average type comprises
Element::NumElem 
+
+
+ separate elements in x_.

+

You should typically access this array through the value() and weight() member functions, and the start index to both of those should be the return value from fieldStartIx() or rsetStartIx().

+
+ +
+
+ +
+
+template<class Scalar>
struct RegularizationFactorWells
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 100.0
+
+ +
+
+ +
+
+class RelativeChangeInterface
+
+

RelativeChangeInterface

+
+

Public Functions

+
+
+virtual double relativeChange() const = 0
+
+
Returns:
+

|| u^n+1 - u^n || / || u^n+1 ||

+
+
+
+ +
+
+inline virtual ~RelativeChangeInterface()
+

virtual destructor (empty)

+
+ +
+
+

Protected Functions

+
+
+inline RelativeChangeInterface()
+
+ +
+
+ +
+
+struct RelaxedLinearSolverReduction
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 1e-2
+
+ +
+
+ +
+
+template<class Scalar>
struct RelaxedMaxPvFraction
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.03
+
+ +
+
+ +
+
+template<class Scalar>
struct RelaxedPressureTolMsw
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e4
+
+ +
+
+ +
+
+template<class Scalar>
struct RelaxedWellFlowTol
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-3
+
+ +
+
+ +
+
+class RelpermDiagnostics
+
+

This class is intend to be a relperm diagnostics, to detect wrong input of relperm table and endpoints.

+
+

Public Functions

+
+
+template<class LevelCartesianIndexMapper>
void diagnosis(const EclipseState &eclState, const LevelCartesianIndexMapper &levelCartesianIndexMapper)
+

This function is used to diagnosis relperm in eclipse data file. Errors and warings will be output if they’re found.

+
+
Parameters:
+
    +
  • eclState[in] eclipse state.

  • +
  • grid[in] unstructured grid.

  • +
+
+
+
+ +
+
+

Private Types

+
+
+enum FluidSystem
+

Values:

+
+
+enumerator OilWater
+
+ +
+
+enumerator OilGas
+
+ +
+
+enumerator WaterGas
+
+ +
+
+enumerator BlackOil
+
+ +
+
+enumerator Solvent
+
+ +
+ +
+
+enum SaturationFunctionFamily
+

Values:

+
+
+enumerator FamilyI
+
+ +
+
+enumerator FamilyII
+
+ +
+
+enumerator FamilyIII
+
+ +
+
+enumerator NoFamily
+
+ +
+ +
+
+

Private Functions

+
+
+bool phaseCheck_(const EclipseState &es)
+

Check the phase that used. return false if one-phase system

+
+ +
+
+void satFamilyCheck_(const EclipseState &eclState)
+

Check saturation family I and II.

+
+ +
+
+void tableCheck_(const EclipseState &eclState)
+

Check saturation tables.

+
+ +
+
+void unscaledEndPointsCheck_(const EclipseState &eclState)
+

Check endpoints in the saturation tables.

+
+ +
+
+template<class LevelCartesianIndexMapper>
void scaledEndPointsCheck_(const EclipseState &eclState, const LevelCartesianIndexMapper &levelCartesianIndexMapper)
+
+ +
+
+void swofTableCheck_(const SwofTable &swofTables, const int satnumIdx)
+

For every table, need to deal with case by case.

+
+ +
+
+void sgofTableCheck_(const SgofTable &sgofTables, const int satnumIdx)
+
+ +
+
+void slgofTableCheck_(const SlgofTable &slgofTables, const int satnumIdx)
+
+ +
+
+void swfnTableCheck_(const SwfnTable &swfnTables, const int satnumIdx)
+
+ +
+
+void sgfnTableCheck_(const SgfnTable &sgfnTables, const int satnumIdx)
+
+ +
+
+void wsfTableCheck_(const WsfTable &wsfTables, const int satnumIdx)
+
+ +
+
+void gsfTableCheck_(const GsfTable &gsfTables, const int satnumIdx)
+
+ +
+
+void sof3TableCheck_(const Sof3Table &sof3Tables, const int satnumIdx)
+
+ +
+
+void sof2TableCheck_(const Sof2Table &sof2Tables, const int satnumIdx)
+
+ +
+
+void sgwfnTableCheck_(const SgwfnTable &sgwfnTables, const int satnumIdx)
+
+ +
+
+void sgcwmisTableCheck_(const SgcwmisTable &sgcwmisTables, const int satnumIdx)
+

Tables for solvent model.

+
+ +
+
+void sorwmisTableCheck_(const SorwmisTable &sorwmisTables, const int satnumIdx)
+
+ +
+
+void ssfnTableCheck_(const SsfnTable &ssfnTables, const int satnumIdx)
+
+ +
+
+void miscTableCheck_(const MiscTable &miscTables, const int miscnumIdx)
+
+ +
+
+void msfnTableCheck_(const MsfnTable &msfnTables, const int satnumIdx)
+
+ +
+
+

Private Members

+
+
+FluidSystem fluidSystem_
+
+ +
+
+SaturationFunctionFamily satFamily_ = {NoFamily}
+
+ +
+
+std::vector<EclEpsScalingPointsInfo<double>> unscaledEpsInfo_ = {}
+
+ +
+
+std::vector<EclEpsScalingPointsInfo<double>> scaledEpsInfo_ = {}
+
+ +
+
+ +
+
+struct Reorderer
+
+#include <MILU.hpp>
+

Subclassed by Opm::detail::NoReorderer, Opm::detail::RealReorderer

+
+

Public Functions

+
+
+virtual std::size_t operator[](std::size_t i) const = 0
+
+ +
+
+inline virtual ~Reorderer()
+
+ +
+
+ +
+
+class ReservoirConvergenceMetric
+
+
+

Public Functions

+
+
+ReservoirConvergenceMetric() = default
+
+ +
+
+inline ReservoirConvergenceMetric(ReservoirFailure::Type t, int phase, double value, double tolerance)
+
+ +
+
+inline ReservoirFailure::Type type() const
+
+ +
+
+inline int phase() const
+
+ +
+
+inline double value() const
+
+ +
+
+inline double tolerance() const
+
+ +
+
+template<typename Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Private Members

+
+
+ReservoirFailure::Type type_ = {ReservoirFailure::Type::Invalid}
+
+ +
+
+int phase_ = {-1}
+
+ +
+
+double value_ = {0.0}
+
+ +
+
+double tolerance_ = {0.0}
+
+ +
+
+ +
+
+class ReservoirCouplingMaster
+
+
+

Public Types

+
+
+using MessageTag = ReservoirCoupling::MessageTag
+
+ +
+
+using Seconds = ReservoirCoupling::Seconds
+
+ +
+
+

Public Functions

+
+
+ReservoirCouplingMaster(const Parallel::Communication &comm, const Schedule &schedule, int argc, char **argv)
+
+ +
+
+inline bool activated()
+
+ +
+
+inline void addSlaveCommunicator(MPI_Comm comm)
+
+ +
+
+inline void addSlaveName(const std::string &name)
+
+ +
+
+inline void addSlaveNextReportTimeOffset(double offset)
+
+ +
+
+inline void addSlaveStartDate(std::time_t date)
+
+ +
+
+inline double getActivationDate() const
+
+ +
+
+inline int getArgc() const
+
+ +
+
+inline char *getArgv(int index) const
+
+ +
+
+inline char **getArgv() const
+
+ +
+
+inline const Parallel::Communication &getComm() const
+
+ +
+
+inline double getSimulationStartDate() const
+
+ +
+
+inline MPI_Comm getSlaveComm(int index) const
+
+ +
+
+inline const std::string &getSlaveName(int index) const
+
+ +
+
+inline const double *getSlaveStartDates()
+
+ +
+
+double maybeChopSubStep(double suggested_timestep, double current_time) const
+
+ +
+
+void maybeSpawnSlaveProcesses(int report_step)
+
+ +
+
+std::size_t numSlavesStarted() const
+
+ +
+
+void receiveNextReportDateFromSlaves()
+
+ +
+
+inline void resizeSlaveStartDates(int size)
+
+ +
+
+inline void resizeNextReportDates(int size)
+
+ +
+
+void sendNextTimeStepToSlaves(double next_time_step)
+
+ +
+
+inline void setSlaveStartDate(int index, std::time_t date)
+
+ +
+
+inline void setSlaveNextReportTimeOffset(int index, double offset)
+
+ +
+
+

Private Functions

+
+
+double getMasterActivationDate_() const
+
+ +
+
+

Private Members

+
+
+const Parallel::Communication &comm_
+
+ +
+
+const Schedule &schedule_
+
+ +
+
+int argc_
+
+ +
+
+char **argv_
+
+ +
+
+std::vector<MPI_Comm> master_slave_comm_
+
+ +
+
+std::vector<std::string> slave_names_
+
+ +
+
+std::vector<double> slave_start_dates_
+
+ +
+
+std::vector<double> slave_next_report_time_offsets_
+
+ +
+
+double activation_date_ = {0.0}
+
+ +
+
+ +
+
+class ReservoirCouplingSlave
+
+
+

Public Types

+
+
+using MessageTag = ReservoirCoupling::MessageTag
+
+ +
+
+

Public Functions

+
+
+ReservoirCouplingSlave(const Parallel::Communication &comm, const Schedule &schedule, const SimulatorTimer &timer)
+
+ +
+
+inline bool activated() const
+
+ +
+
+void maybeActivate(int report_step)
+
+ +
+
+void sendActivationDateToMasterProcess() const
+
+ +
+
+void sendNextReportDateToMasterProcess() const
+
+ +
+
+void sendSimulationStartDateToMasterProcess() const
+
+ +
+
+void receiveMasterGroupNamesFromMasterProcess()
+
+ +
+
+double receiveNextTimeStepFromMaster()
+
+ +
+
+

Private Functions

+
+
+void checkGrupSlavGroupNames_()
+
+ +
+
+double getGrupSlavActivationDate_() const
+
+ +
+
+void saveMasterGroupNamesAsMap_(const std::vector<char> &group_names)
+
+ +
+
+

Private Members

+
+
+const Parallel::Communication &comm_
+
+ +
+
+const Schedule &schedule_
+
+ +
+
+const SimulatorTimer &timer_
+
+ +
+
+MPI_Comm slave_master_comm_ = {MPI_COMM_NULL}
+
+ +
+
+std::map<std::string, std::string> master_group_names_
+
+ +
+
+bool activated_ = {false}
+
+ +
+
+ +
+
+class ReservoirCouplingSpawnSlaves
+
+
+

Public Types

+
+
+using MessageTag = ReservoirCoupling::MessageTag
+
+ +
+
+

Public Functions

+
+
+ReservoirCouplingSpawnSlaves(ReservoirCouplingMaster &master, const ReservoirCoupling::CouplingInfo &rescoup)
+
+ +
+
+void spawn()
+
+ +
+
+

Private Functions

+
+
+std::pair<std::vector<char>, std::size_t> getMasterGroupNamesForSlave_(const std::string &slave_name) const
+
+ +
+
+std::vector<char*> getSlaveArgv_(const std::filesystem::path &data_file, const std::string &slave_name, std::string &log_filename) const
+
+ +
+
+void prepareTimeStepping_()
+
+ +
+
+void receiveActivationDateFromSlaves_()
+
+ +
+
+void receiveSimulationStartDateFromSlaves_()
+
+ +
+
+void sendMasterGroupNamesToSlaves_()
+
+ +
+
+std::pair<std::vector<char>, std::size_t> serializeStrings_(std::vector<std::string> data) const
+
+ +
+
+void spawnSlaveProcesses_()
+
+ +
+
+

Private Members

+
+
+ReservoirCouplingMaster &master_
+
+ +
+
+const ReservoirCoupling::CouplingInfo &rescoup_
+
+ +
+
+const Parallel::Communication &comm_
+
+ +
+
+ +
+
+class ReservoirFailure
+
+
+

Public Types

+
+
+enum class Type
+

Values:

+
+
+enumerator Invalid
+
+ +
+
+enumerator MassBalance
+
+ +
+
+enumerator Cnv
+
+ +
+
+enumerator ConvergenceMonitorFailure
+
+ +
+ +
+
+

Public Functions

+
+
+ReservoirFailure() = default
+
+ +
+
+inline ReservoirFailure(Type t, Severity s, int phase)
+
+ +
+
+inline Type type() const
+
+ +
+
+inline Severity severity() const
+
+ +
+
+inline int phase() const
+
+ +
+
+template<typename Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Private Members

+
+
+Type type_ = {Type::Invalid}
+
+ +
+
+Severity severity_ = {Severity::None}
+
+ +
+
+int phase_ = {-1}
+
+ +
+
+ +
+
+class Restart
+
+#include <restart.hpp>
+

Load or save a state of a problem to/from the harddisk.

+
+

Public Functions

+
+
+inline const std::string &fileName() const
+

Returns the name of the file which is (de-)serialized.

+
+ +
+
+template<class Simulator>
inline void serializeBegin(Simulator &simulator)
+

Write the current state of the model to disk.

+
+ +
+
+inline std::ostream &serializeStream()
+

The output stream to write the serialized data.

+
+ +
+
+void serializeSectionBegin(const std::string &cookie)
+

Start a new section in the serialized output.

+
+ +
+
+void serializeSectionEnd()
+

End of a section in the serialized output.

+
+ +
+
+template<int codim, class Serializer, class GridView>
inline void serializeEntities(Serializer &serializer, const GridView &gridView)
+

Serialize all leaf entities of a codim in a gridView.

+

The actual work is done by Serializer::serialize(Entity)

+
+ +
+
+void serializeEnd()
+

Finish the restart file.

+
+ +
+
+template<class Simulator, class Scalar>
inline void deserializeBegin(Simulator &simulator, Scalar t)
+

Start reading a restart file at a certain simulated time.

+
+ +
+
+inline std::istream &deserializeStream()
+

The input stream to read the data which ought to be deserialized.

+
+ +
+
+void deserializeSectionBegin(const std::string &cookie)
+

Start reading a new section of the restart file.

+
+ +
+
+void deserializeSectionEnd()
+

End of a section in the serialized output.

+
+ +
+
+template<int codim, class Deserializer, class GridView>
inline void deserializeEntities(Deserializer &deserializer, const GridView &gridView)
+

Deserialize all leaf entities of a codim in a grid.

+

The actual work is done by Deserializer::deserialize(Entity)

+
+ +
+
+void deserializeEnd()
+

Stop reading the restart file.

+
+ +
+
+

Private Functions

+
+
+void openInputStream(const std::string &cookie)
+

Open input stream and check for magic cookie.

+
+
Parameters:
+

cookie – Magic cookie to check for

+
+
+
+ +
+
+void openOutputStream(const std::string &cookie)
+

Open output stream and write magic cookie.

+
+
Parameters:
+

cookie – Magic cookie to write

+
+
+
+ +
+
+

Private Members

+
+
+std::string fileName_
+
+ +
+
+std::ifstream inStream_
+
+ +
+
+std::ofstream outStream_
+
+ +
+
+

Private Static Functions

+
+
+template<class GridView>
static inline std::string magicRestartCookie_(const GridView &gridView)
+

Create a magic cookie for restart files, so that it is unlikely to load a restart file for an incorrectly.

+
+ +
+
+static std::string restartFileName_(int rank, const std::string &outputDir, const std::string &simName, double t)
+

Return the restart file name.

+
+ +
+
+ +
+
+struct RestartWritingInterval
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 0xffffff
+
+ +
+
+ +
+
+template<class FluidSystem>
class RFTContainer
+
+#include <RFTContainer.hpp>
+
+

Public Types

+
+
+using AssignmentFunc = std::function<Scalar()>
+
+ +
+
+using WellQueryFunc = std::function<bool(const std::string&)>
+
+ +
+
+

Public Functions

+
+
+inline RFTContainer(const EclipseState &eclState, const Schedule &schedule, const WellQueryFunc &wellQuery)
+
+ +
+
+void addToWells(data::Wells &wellDatas, const std::size_t reportStepNum, const Parallel::Communication &comm)
+
+ +
+
+void allocate(const std::size_t reportStepNum)
+
+ +
+
+void assign(const unsigned cartesianIndex, const AssignmentFunc &oil, const AssignmentFunc &water, const AssignmentFunc &gas)
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using ScalarBuffer = std::vector<Scalar>
+
+ +
+
+

Private Members

+
+
+const EclipseState &eclState_
+
+ +
+
+const Schedule &schedule_
+
+ +
+
+WellQueryFunc wellQuery_
+
+ +
+
+std::map<std::size_t, Scalar> oilConnectionPressures_
+
+ +
+
+std::map<std::size_t, Scalar> waterConnectionSaturations_
+
+ +
+
+std::map<std::size_t, Scalar> gasConnectionSaturations_
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto gasPhaseIdx = FluidSystem::gasPhaseIdx
+
+ +
+
+static constexpr auto oilPhaseIdx = FluidSystem::oilPhaseIdx
+
+ +
+
+static constexpr auto waterPhaseIdx = FluidSystem::waterPhaseIdx
+
+ +
+
+ +
+
+template<class Scalar, class RHS>
class RK4IVP
+
+#include <InitStateEquil.hpp>
+
+

Public Functions

+
+
+RK4IVP(const RHS &f, const std::array<Scalar, 2> &span, const Scalar y0, const int N)
+
+ +
+
+Scalar operator()(const Scalar x) const
+
+ +
+
+

Private Functions

+
+
+Scalar stepsize() const
+
+ +
+
+

Private Members

+
+
+int N_
+
+ +
+
+std::array<Scalar, 2> span_
+
+ +
+
+std::vector<Scalar> y_
+
+ +
+
+std::vector<Scalar> f_
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class rocalutionSolverBackend : public Opm::Accelerator::GpuSolver<Scalar, block_size>
+
+

This class implements a rocalution based linear solver solver on GPU It uses ilu0-bicgstab

+
+

Public Functions

+
+
+rocalutionSolverBackend(int linear_solver_verbosity, int maxit, Scalar tolerance)
+

Construct a rocalutionSolver also initialize rocalution library and rocalution variables

+
+
Parameters:
+
    +
  • linear_solver_verbosity[in] verbosity of rocalutionSolver

  • +
  • maxit[in] maximum number of iterations for rocalutionSolver

  • +
  • tolerance[in] required relative tolerance for rocalutionSolver

  • +
+
+
+
+ +
+
+~rocalutionSolverBackend()
+

Destroy a rocalutionSolver, and free memory.

+
+ +
+
+virtual SolverStatus solve_system(std::shared_ptr<BlockedMatrix<Scalar>> matrix, Scalar *b, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix, WellContributions<Scalar> &wellContribs, GpuResult &res) override
+

Solve linear system, A*x = b, matrix A must be in blocked-CSR format

+
+
Parameters:
+
    +
  • matrix[in] matrix A

  • +
  • b[in] input vector, contains N values

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
  • wellContribs[in] WellContributions, to apply them separately, instead of adding them to matrix A

  • +
  • res[inout] summary of solver result

  • +
+
+
Returns:
+

status code

+
+
+
+ +
+
+virtual void get_result(Scalar *x) override
+

Get result after linear solve, and peform postprocessing if necessary

+
+
Parameters:
+

x[inout] resulting x vector, caller must guarantee that x points to a valid array

+
+
+
+ +
+
+

Private Types

+
+
+using Base = GpuSolver<Scalar, block_size>
+
+ +
+
+using Mat = rocalution::LocalMatrix<Scalar>
+
+ +
+
+using Vec = rocalution::LocalVector<Scalar>
+
+ +
+
+

Private Functions

+
+
+void initialize(BlockedMatrix<Scalar> *matrix)
+

Initialize sizes and allocate memory

+
+
Parameters:
+

matrix[in] matrix A

+
+
+
+ +
+
+void convert_matrix(BlockedMatrix<Scalar> *matrix)
+

Convert matrix to rocalution format copy matrix to raw pointers, which are given to and freed by rocalution

+
+
Parameters:
+

matrix[in] matrix A

+
+
+
+ +
+
+

Private Members

+
+
+std::vector<Scalar> h_x
+
+ +
+
+int *tmp_rowpointers
+
+ +
+
+int *tmp_colindices
+
+ +
+
+Scalar *tmp_nnzvalues
+
+ +
+
+std::unique_ptr<rocalution::ILU<Mat, Vec, Scalar>> roc_prec
+
+ +
+
+std::unique_ptr<rocalution::BiCGStab<Mat, Vec, Scalar>> roc_solver
+
+ +
+
+int N
+
+ +
+
+int Nb
+
+ +
+
+int nnz
+
+ +
+
+int nnzb
+
+ +
+
+int verbosity
+
+ +
+
+unsigned int platformID
+
+ +
+
+unsigned int deviceID
+
+ +
+
+int maxit
+
+ +
+
+Scalar tolerance
+
+ +
+
+bool initialized
+
+ +
+
+ +
+
+struct RockParams
+
+
+

Public Members

+
+
+Scalar referencePressure
+
+ +
+
+Scalar compressibility
+
+ +
+
+ +
+
+template<class Scalar>
class RocmMatrix
+
+#include <rocsparseMatrix.hpp>
+

This struct resembles a csr matrix.

+
+

Public Functions

+
+
+RocmMatrix(int Nb_, int Mb_, int nnzbs_, unsigned int block_size_)
+
+ +
+
+void upload(Scalar *vals, int *cols, int *rows, hipStream_t stream)
+
+ +
+
+void upload(Matrix<Scalar> *matrix, hipStream_t stream)
+
+ +
+
+void upload(BlockedMatrix<Scalar> *matrix, hipStream_t stream)
+
+ +
+
+

Public Members

+
+
+Scalar *nnzValues
+
+ +
+
+int *colIndices
+
+ +
+
+int *rowPointers
+
+ +
+
+int Nb
+
+ +
+
+int Mb
+
+ +
+
+int nnzbs
+
+ +
+
+unsigned int block_size
+
+ +
+
+ +
+
+template<typename Scalar>
class RocmVector
+
+#include <rocsparseMatrix.hpp>
+
+

Public Functions

+
+
+RocmVector(int N)
+
+ +
+
+void upload(Scalar *vals, hipStream_t stream)
+
+ +
+
+void upload(Matrix<Scalar> *matrix, hipStream_t stream)
+
+ +
+
+

Public Members

+
+
+Scalar *nnzValues
+
+ +
+
+int size
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class rocsparseBILU0 : public Opm::Accelerator::rocsparsePreconditioner<Scalar, block_size>
+
+#include <rocsparseBILU0.hpp>
+

This class implements a Blocked ILU0 preconditioner The decomposition is done on GPU, using exact decomposition, or ChowPatel decomposition The preconditioner is applied via two exact triangular solves

+
+

Public Functions

+
+
+rocsparseBILU0(int verbosity_)
+
+ +
+
+virtual bool initialize(std::shared_ptr<BlockedMatrix<Scalar>> matrix, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix, rocsparse_int *d_Arows, rocsparse_int *d_Acols) override
+

Initialize GPU and allocate memory

+
+
Parameters:
+
    +
  • matrix[in] matrix A

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
+
+
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat) override
+

Analysis, extract parallelism if specified

+
+
Parameters:
+

mat[in] matrix A

+
+
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) override
+

Analysis, extract parallelism if specified

+
+
Parameters:
+
    +
  • mat[in] matrix A

  • +
  • jacMat[in] matrix for preconditioner, analyze this as well

  • +
+
+
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat) override
+

ILU decomposition

+
+
Parameters:
+

mat[in] matrix A to decompose

+
+
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) override
+

ILU decomposition

+
+
Parameters:
+
    +
  • mat[in] matrix A

  • +
  • jacMat[in] matrix for preconditioner, decompose this one if used

  • +
+
+
+
+ +
+
+void apply(const Scalar &y, Scalar &x) override
+

Apply preconditioner, x = prec(y) via Lz = y and Ux = z

+
+
Parameters:
+
    +
  • y[in] Input y vector

  • +
  • x[out] Output x vector

  • +
+
+
+
+ +
+
+virtual void copy_system_to_gpu(Scalar *mVals) override
+

Copy matrix A values to GPU

+
+
Parameters:
+

mVals[in] Input values

+
+
+
+ +
+
+virtual void update_system_on_gpu(Scalar *b) override
+

Reassign pointers, in case the addresses of the Dune variables have changed –> TODO: check when/if we need this method.

+

Update GPU values after a new assembly is done

+
+
Parameters:
+

b[in] New b vector

+
+
+
+ +
+
+

Private Types

+
+
+typedef rocsparsePreconditioner<Scalar, block_size> Base
+
+ +
+
+

Private Members

+
+
+rocsparse_mat_descr descr_M
+
+ +
+
+rocsparse_mat_descr descr_L
+
+ +
+
+rocsparse_mat_descr descr_U
+
+ +
+
+rocsparse_mat_info ilu_info
+
+ +
+
+rocsparse_int *d_Mrows
+
+ +
+
+rocsparse_int *d_Mcols
+
+ +
+
+Scalar *d_Mvals
+
+ +
+
+Scalar *d_t
+
+ +
+
+void *d_buffer
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class rocsparseCPR : public Opm::Accelerator::rocsparsePreconditioner<Scalar, block_size>, public Opm::Accelerator::CprCreation<Scalar, block_size>
+
+#include <rocsparseCPR.hpp>
+

This class implements a Constrained Pressure Residual (CPR) preconditioner.

+
+

Public Functions

+
+
+rocsparseCPR(int verbosity)
+
+ +
+
+virtual bool initialize(std::shared_ptr<BlockedMatrix<Scalar>> matrix, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix, rocsparse_int *d_Arows, rocsparse_int *d_Acols) override
+

Initialize GPU and allocate memory

+
+
Parameters:
+
    +
  • matrix[in] matrix A

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
+
+
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat) override
+

Analysis, extract parallelism if specified

+
+
Parameters:
+

mat[in] matrix A

+
+
+
+ +
+
+virtual bool analyze_matrix(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) override
+

Analysis, extract parallelism if specified

+
+
Parameters:
+
    +
  • mat[in] matrix A

  • +
  • jacMat[in] matrix for preconditioner, analyze this as well

  • +
+
+
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat) override
+

Create AMG preconditioner and perform ILU decomposition

+
+
Parameters:
+

mat[in] matrix A

+
+
+
+ +
+
+virtual bool create_preconditioner(BlockedMatrix<Scalar> *mat, BlockedMatrix<Scalar> *jacMat) override
+

Create AMG preconditioner and perform ILU decomposition

+
+
Parameters:
+
    +
  • mat[in] matrix A

  • +
  • jacMat[in] matrix for preconditioner, decompose this one if used

  • +
+
+
+
+ +
+
+void apply(const Scalar &y, Scalar &x) override
+

Apply preconditioner, x = prec(y) applies blocked ilu0 also applies amg for pressure component

+
+
Parameters:
+
    +
  • y[in] Input y vector

  • +
  • x[out] Output x vector

  • +
+
+
+
+ +
+
+virtual void copy_system_to_gpu(Scalar *b) override
+

Copy matrix A values to GPU

+
+
Parameters:
+

mVals[in] Input values

+
+
+
+ +
+
+virtual void update_system_on_gpu(Scalar *b) override
+

Reassign pointers, in case the addresses of the Dune variables have changed –> TODO: check when/if we need this method

+
+
Parameters:
+
    +
  • vals[in] array of nonzeroes, each block is stored row-wise and contiguous, contains nnz values

  • +
  • b[in] input vector b, contains N values Update linear system to GPU

  • +
  • b[in] input vector, contains N values

  • +
+
+
+
+ +
+
+

Private Types

+
+
+typedef rocsparsePreconditioner<Scalar, block_size> Base
+
+ +
+
+

Private Functions

+
+
+void init_rocm_buffers()
+
+ +
+
+void rocm_upload()
+
+ +
+
+void apply_amg(const Scalar &y, Scalar &x)
+
+ +
+
+void amg_cycle_gpu(const int level, Scalar &y, Scalar &x)
+
+ +
+
+

Private Members

+
+
+std::vector<RocmMatrix<Scalar>> d_Amatrices
+
+ +
+
+std::vector<RocmMatrix<Scalar>> d_Rmatrices
+
+ +
+
+std::vector<RocmVector<int>> d_PcolIndices
+
+ +
+
+std::vector<RocmVector<Scalar>> d_invDiags
+
+ +
+
+std::vector<RocmVector<Scalar>> d_t
+
+ +
+
+std::vector<RocmVector<Scalar>> d_f
+
+ +
+
+std::vector<RocmVector<Scalar>> d_u
+
+ +
+
+std::vector<RocmVector<Scalar>> d_rs
+
+ +
+
+std::vector<RocmVector<Scalar>> d_weights
+
+ +
+
+std::unique_ptr<RocmMatrix<Scalar>> d_mat
+
+ +
+
+std::vector<RocmVector<Scalar>> d_coarse_y
+
+ +
+
+std::vector<RocmVector<Scalar>> d_coarse_x
+
+ +
+
+std::once_flag rocm_buffers_allocated
+
+ +
+
+std::unique_ptr<rocsparseBILU0<Scalar, block_size>> bilu0
+
+ +
+
+std::unique_ptr<rocsparseSolverBackend<Scalar, 1>> coarse_solver
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class rocsparsePreconditioner : public Opm::Accelerator::Preconditioner<Scalar, block_size>
+
+

Subclassed by Opm::Accelerator::rocsparseBILU0< Scalar, block_size >, Opm::Accelerator::rocsparseCPR< Scalar, block_size >

+
+

Public Functions

+
+
+virtual bool initialize(std::shared_ptr<BlockedMatrix<Scalar>> matrix, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix, rocsparse_int *d_Arows, rocsparse_int *d_Acols) = 0
+
+ +
+
+virtual void copy_system_to_gpu(Scalar *b) = 0
+
+ +
+
+virtual void update_system_on_gpu(Scalar *b) = 0
+

Update linear system to GPU

+
+
Parameters:
+

b[in] input vector, contains N values

+
+
+
+ +
+
+void set_matrix_analysis(rocsparse_mat_descr descr_L, rocsparse_mat_descr descr_U)
+
+ +
+
+void set_context(rocsparse_handle handle, rocsparse_direction dir, rocsparse_operation operation, hipStream_t stream)
+
+ +
+
+void setJacMat(const BlockedMatrix<Scalar> &jacMat)
+
+ +
+
+

Public Members

+
+
+int nnzbs_prec = 0
+
+ +
+
+bool useJacMatrix = false
+
+ +
+
+std::shared_ptr<BlockedMatrix<Scalar>> jacMat = {}
+
+ +
+
+

Public Static Functions

+
+
+static std::unique_ptr<rocsparsePreconditioner<Scalar, block_size>> create(PreconditionerType type, int verbosity)
+
+ +
+
+

Protected Functions

+
+
+inline rocsparsePreconditioner(int verbosity_)
+
+ +
+
+

Protected Attributes

+
+
+rocsparse_handle handle
+
+ +
+
+rocsparse_direction dir = rocsparse_direction_row
+
+ +
+
+rocsparse_operation operation = rocsparse_operation_none
+
+ +
+
+rocsparse_mat_descr descr_L
+
+ +
+
+rocsparse_mat_descr descr_U
+
+ +
+
+hipStream_t stream
+
+ +
+
+ +
+
+template<class Scalar, unsigned int block_size>
class rocsparseSolverBackend : public Opm::Accelerator::GpuSolver<Scalar, block_size>
+
+

This class implements a rocsparse-based ilu0-bicgstab solver on GPU.

+
+

Public Functions

+
+
+rocsparseSolverBackend(int linear_solver_verbosity, int maxit, Scalar tolerance, unsigned int platformID, unsigned int deviceID, std::string linsolver)
+

Construct a rocsparseSolver

+
+
Parameters:
+
    +
  • linear_solver_verbosity[in] verbosity of rocsparseSolver

  • +
  • maxit[in] maximum number of iterations for rocsparseSolver

  • +
  • tolerance[in] required relative tolerance for rocsparseSolver

  • +
  • platformID[in] the OpenCL platform to be used

  • +
  • deviceID[in] the device to be used

  • +
  • linsolver[in] indicating the preconditioner, equal to the &#8212;linear-solver cmdline argument

  • +
+
+
+
+ +
+
+rocsparseSolverBackend(int linear_solver_verbosity, int maxit, Scalar tolerance, bool opencl_ilu_reorder)
+

For the CPR coarse solver.

+
+ +
+
+~rocsparseSolverBackend()
+

Destroy a openclSolver, and free memory.

+
+ +
+
+virtual SolverStatus solve_system(std::shared_ptr<BlockedMatrix<Scalar>> matrix, Scalar *b, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix, WellContributions<Scalar> &wellContribs, GpuResult &res) override
+

Solve linear system, A*x = b, matrix A must be in blocked-CSR format

+
+
Parameters:
+
    +
  • matrix[in] matrix A

  • +
  • b[in] input vector, contains N values

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
  • wellContribs[in] WellContributions, to apply them separately, instead of adding them to matrix A

  • +
  • res[inout] summary of solver result

  • +
+
+
Returns:
+

status code

+
+
+
+ +
+
+virtual void get_result(Scalar *x) override
+

Get result after linear solve, and peform postprocessing if necessary

+
+
Parameters:
+

x[inout] resulting x vector, caller must guarantee that x points to a valid array

+
+
+
+ +
+
+

Private Types

+
+
+using Base = GpuSolver<Scalar, block_size>
+
+ +
+
+

Private Functions

+
+
+void gpu_pbicgstab(WellContributions<Scalar> &wellContribs, GpuResult &res)
+

Solve linear system using ilu0-bicgstab

+
+
Parameters:
+
    +
  • wellContribs[in] WellContributions, to apply them separately, instead of adding them to matrix A

  • +
  • res[inout] summary of solver result

  • +
+
+
+
+ +
+
+void initialize(std::shared_ptr<BlockedMatrix<Scalar>> matrix, std::shared_ptr<BlockedMatrix<Scalar>> jacMatrix)
+

Initialize GPU and allocate memory

+
+
Parameters:
+
    +
  • matrix[in] matrix A

  • +
  • jacMatrix[in] matrix for preconditioner

  • +
+
+
+
+ +
+
+void copy_system_to_gpu(Scalar *b)
+

Copy linear system to GPU

+
+
Parameters:
+

b[in] input vector, contains N values

+
+
+
+ +
+
+void update_system_on_gpu(Scalar *b)
+

Update linear system to GPU

+
+
Parameters:
+

b[in] input vector, contains N values

+
+
+
+ +
+
+bool analyze_matrix()
+

Analyze sparsity pattern to extract parallelism

+
+
Returns:
+

true iff analysis was successful

+
+
+
+ +
+
+bool create_preconditioner()
+

Perform ilu0-decomposition

+
+
Returns:
+

true iff decomposition was successful

+
+
+
+ +
+
+void solve_system(WellContributions<Scalar> &wellContribs, GpuResult &res)
+

Solve linear system

+
+
Parameters:
+
    +
  • wellContribs[in] WellContributions, to apply them separately, instead of adding them to matrix A

  • +
  • res[inout] summary of solver result

  • +
+
+
+
+ +
+
+

Private Members

+
+
+double c_copy = 0.0
+
+ +
+
+bool useJacMatrix = false
+
+ +
+
+bool analysis_done = false
+
+ +
+
+std::shared_ptr<BlockedMatrix<Scalar>> mat = {}
+
+ +
+
+rocsparse_direction dir = rocsparse_direction_row
+
+ +
+
+rocsparse_operation operation = rocsparse_operation_none
+
+ +
+
+rocsparse_handle handle
+
+ +
+
+rocblas_handle blas_handle
+
+ +
+
+rocsparse_mat_descr descr_A
+
+ +
+
+hipStream_t stream
+
+ +
+
+rocsparse_int *d_Arows
+
+ +
+
+rocsparse_int *d_Acols
+
+ +
+
+Scalar *d_Avals
+
+ +
+
+Scalar *d_x
+
+ +
+
+Scalar *d_b
+
+ +
+
+Scalar *d_r
+
+ +
+
+Scalar *d_rw
+
+ +
+
+Scalar *d_p
+
+ +
+
+Scalar *d_pw
+
+ +
+
+Scalar *d_s
+
+ +
+
+Scalar *d_t
+
+ +
+
+Scalar *d_v
+
+ +
+
+int ver
+
+ +
+
+char rev[64]
+
+ +
+
+std::unique_ptr<rocsparsePreconditioner<Scalar, block_size>> prec
+
+ +
+
+int N
+
+ +
+
+int Nb
+
+ +
+
+int nnz
+
+ +
+
+int nnzb
+
+ +
+
+int verbosity
+
+ +
+
+unsigned int platformID
+
+ +
+
+unsigned int deviceID
+
+ +
+
+int maxit
+
+ +
+
+Scalar tolerance
+
+ +
+
+bool initialized
+
+ +
+
+ +
+
+struct RootRank
+
+#include <MPISerializer.hpp>
+

Avoid mistakes in calls to broadcast() by wrapping the root argument in an explicit type.

+
+

Public Members

+
+
+int value
+
+ +
+
+ +
+
+template<class Scalar>
class RsFunction
+
+

Base class for phase mixing functions.

+

Subclassed by Opm::EQUIL::Miscibility::NoMixing< Scalar >

+
+

Public Functions

+
+
+virtual ~RsFunction() = default
+
+ +
+
+virtual Scalar operator()(const Scalar depth, const Scalar press, const Scalar temp, const Scalar sat = 0.0) const = 0
+

Function call operator.

+
+
Parameters:
+
    +
  • depth[in] Depth at which to calculate RS value.

  • +
  • press[in] Pressure at which to calculate RS value.

  • +
  • temp[in] Temperature at which to calculate RS value.

  • +
+
+
Returns:
+

Dissolved gas-oil ratio (RS) at depth depth and pressure press.

+
+
+
+ +
+
+ +
+
+template<class FluidSystem>
class RsSatAtContact : public Opm::EQUIL::Miscibility::RsFunction<FluidSystem::Scalar>
+
+

Class that implements “dissolved gas-oil ratio” (Rs) as function of depth and pressure as follows:

+

    +
  1. The Rs at the gas-oil contact is equal to the saturated Rs value, RsSatContact.

  2. +
  3. The Rs elsewhere is equal to RsSatContact, but constrained to the saturated value as given by the local pressure.

  4. +
+

+

This should yield Rs-values that are constant below the contact, and decreasing above the contact.

+
+

Public Functions

+
+
+RsSatAtContact(const int pvtRegionIdx, const Scalar pContact, const Scalar T_contact)
+

Constructor.

+
+
Parameters:
+
    +
  • pvtRegionIdx[in] The pvt region index

  • +
  • pContact[in] oil pressure at the contact

  • +
  • T_contact[in] temperature at the contact

  • +
+
+
+
+ +
+
+virtual Scalar operator()(const Scalar, const Scalar press, const Scalar temp, const Scalar satGas = 0.0) const override
+

Function call.

+
+
Parameters:
+
    +
  • depth[in] Depth at which to calculate RS value.

  • +
  • press[in] Pressure at which to calculate RS value.

  • +
  • temp[in] Temperature at which to calculate RS value.

  • +
+
+
Returns:
+

Dissolved gas-oil ratio (RS) at depth depth and pressure press.

+
+
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+

Private Functions

+
+
+Scalar satRs(const Scalar press, const Scalar temp) const
+
+ +
+
+

Private Members

+
+
+const int pvtRegionIdx_
+
+ +
+
+Scalar rsSatContact_
+
+ +
+
+ +
+
+class RSTConv
+
+#include <RSTConv.hpp>
+

Class computing RPTRST CONV output.

+
+

Public Types

+
+
+using LocalToGlobalCellFunc = std::function<int(const int)>
+
+ +
+
+

Public Functions

+
+
+inline RSTConv(LocalToGlobalCellFunc globalCell, Parallel::Communication comm)
+

Constructor.

+
+
Parameters:
+
    +
  • globalCell – Mapping from local to global cell indices

  • +
  • commParallel communicator

  • +
+
+
+
+ +
+
+void init(const std::size_t numCells, const RSTConfig &rst_config, const std::array<int, 6> &compIdx)
+

Init state at beginning of step.

+
+
Parameters:
+
    +
  • numCells – Global number of active cells in the model

  • +
  • rst_config – RPTRST configuration

  • +
  • compIdx – Component index for phases {OIL, GAS, WAT, POLYMER, BRINE, SOLVENT}, negative if inactive

  • +
+
+
+
+ +
+
+void outputRestart(data::Solution &sol)
+

Inserts the CONV output into the restart output container.

+
+ +
+
+template<class ResidualVector>
void update(const ResidualVector &resid)
+

Adds the CONV output for given residual vector.

+
+ +
+
+inline const std::vector<std::vector<int>> &getData() const
+

Obtain a const-ref to the accumulated data.

+
+ +
+
+

Private Functions

+
+
+template<class ResidualVector>
void gatherAndAccumulate(const std::vector<int> &lIdx, const ResidualVector &resid, int comp)
+

Gathers and accumulates results to the CONV arrays.

+

+Handles parallel reduction

+
+
Parameters:
+
    +
  • lIdx – Vector of local indices (N first is used)

  • +
  • resid – Residual vector

  • +
  • comp – Component to consider

  • +
+
+
+
+ +
+
+

Private Members

+
+
+LocalToGlobalCellFunc globalCell_
+

Global cell indices.

+
+ +
+
+Parallel::Communication comm_
+

Communicator.

+
+ +
+
+std::vector<std::vector<int>> cnv_X_ = {}
+

Counts of worst cells for RPTRST CONV.

+
+ +
+
+std::array<int, 6> compIdx_ = {}
+

Component indices.

+
+ +
+
+int N_ = 0
+

Number of cells to consider.

+
+ +
+
+ +
+
+template<class FluidSystem>
class RsVD : public Opm::EQUIL::Miscibility::RsFunction<FluidSystem::Scalar>
+
+

Type that implements “dissolved gas-oil ratio” tabulated as a function of depth policy. Data typically taken from keyword ‘RSVD’.

+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+

Public Functions

+
+
+RsVD(const int pvtRegionIdx, const std::vector<Scalar> &depth, const std::vector<Scalar> &rs)
+

Constructor.

+
+
Parameters:
+
    +
  • pvtRegionIdx[in] The pvt region index

  • +
  • depth[in] Depth nodes.

  • +
  • rs[in] Dissolved gas-oil ratio at depth.

  • +
+
+
+
+ +
+
+virtual Scalar operator()(const Scalar depth, const Scalar press, const Scalar temp, const Scalar satGas = 0.0) const override
+

Function call.

+
+
Parameters:
+
    +
  • depth[in] Depth at which to calculate RS value.

  • +
  • press[in] Pressure at which to calculate RS value.

  • +
  • temp[in] Temperature at which to calculate RS value.

  • +
+
+
Returns:
+

Dissolved gas-oil ratio (RS) at depth depth and pressure press.

+
+
+
+ +
+
+

Private Types

+
+
+using RsVsDepthFunc = Tabulated1DFunction<Scalar>
+
+ +
+
+

Private Functions

+
+
+Scalar satRs(const Scalar press, const Scalar temp) const
+
+ +
+
+

Private Members

+
+
+const int pvtRegionIdx_
+
+ +
+
+RsVsDepthFunc rsVsDepth_
+
+ +
+
+ +
+
+template<typename Scalar>
class RunningStatistics
+
+

Facility for calculating simple sample statistics without having full sample available.

+
+
Template Parameters:
+

Scalar – Sample element type. Typically a built-in arithmetic type like float or double.

+
+
+
+

Public Functions

+
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+

Convert between byte array and object representation.

+
+
Template Parameters:
+

Serializer – Byte array conversion protocol.

+
+
Parameters:
+

serializer[inout] Byte array conversion object.

+
+
+
+ +
+
+inline bool operator==(const RunningStatistics &that) const
+

Equality predicate.

+
+
Parameters:
+

that[in] Object against which

*this 
+
+
+ will be tested for equality.

+
+
Returns:
+

Whether or not

*this 
+
+
+ is the same as that.

+
+
+
+ +
+
+inline void reset()
+

Reset internal counters to prepare for calculating a new set of sample statistics.

+
+ +
+
+inline void addSamplePoint(const Scalar x)
+

Include new element into sample.

+

Updates internal statistics counters.

+
+
Parameters:
+

x[in] Sample point.

+
+
+
+ +
+
+inline std::size_t sampleSize() const
+

Retrieve current sample size.

+

Effectively returns the number of calls to addSamplePoint() since object was constructed or since the previous call to reset().

+
+ +
+
+inline Scalar min() const
+

Retrieve smallest sample value seen so far.

+
+ +
+
+inline Scalar max() const
+

Retrieve largest sample value seen so far.

+
+ +
+
+inline Scalar mean() const
+

Retrieve arithmetic average of all sample points seen so far.

+
+ +
+
+inline std::optional<Scalar> stdev() const
+

Retrieve unbiased standard deviation of all sample points seen so far.

+

Returns nullopt if number of sample points is less than two.

+
+ +
+
+

Public Static Functions

+
+
+static inline RunningStatistics serializationTestObject()
+

Create a serialisation test object.

+
+ +
+
+

Private Members

+
+
+std::size_t sampleSize_ = {}
+

Current sample size.

+
+ +
+
+Scalar min_ = {std::numeric_limits<Scalar>::max()}
+

Smallest sample value seen so far.

+
+ +
+
+Scalar max_ = {std::numeric_limits<Scalar>::lowest()}
+

Largest sample value seen so far.

+
+ +
+
+Scalar mean_ = {}
+

Arithmetic average of all sample points seen so far.

+
+ +
+
+Scalar totalVariance_ = {}
+

Variance measure. In particular, N-1 * Var{x_i}.

+
+ +
+
+ +
+
+struct RuntimePerforation
+
+

Simple model of a well connection created at runtime, possibly as a result of a geo-mechanical fracturing process.

+
+

Public Members

+
+
+int cell = {}
+

Active cell index, on current rank, that is dynamically perforated by a well.

+
+ +
+
+double ctf = {}
+

Connection’s transmissibility factor.

+
+ +
+
+double depth = {}
+

Depth at which the new connection is created.

+
+ +
+
+ +
+
+template<class FluidSystem>
class RvSatAtContact : public Opm::EQUIL::Miscibility::RsFunction<FluidSystem::Scalar>
+
+

Class that implements “vaporized oil-gas ratio” (Rv) as function of depth and pressure as follows:

+

    +
  1. The Rv at the gas-oil contact is equal to the saturated Rv value, RvSatContact.

  2. +
  3. The Rv elsewhere is equal to RvSatContact, but constrained to the saturated value as given by the local pressure.

  4. +
+

+

This should yield Rv-values that are constant below the contact, and decreasing above the contact.

+
+

Public Functions

+
+
+RvSatAtContact(const int pvtRegionIdx, const Scalar pContact, const Scalar T_contact)
+

Constructor.

+
+
Parameters:
+
    +
  • pvtRegionIdx[in] The pvt region index

  • +
  • pContact[in] oil pressure at the contact

  • +
  • T_contact[in] temperature at the contact

  • +
+
+
+
+ +
+
+virtual Scalar operator()(const Scalar, const Scalar press, const Scalar temp, const Scalar satOil = 0.0) const override
+

Function call.

+
+
Parameters:
+
    +
  • depth[in] Depth at which to calculate RV value.

  • +
  • press[in] Pressure at which to calculate RV value.

  • +
  • temp[in] Temperature at which to calculate RV value.

  • +
+
+
Returns:
+

Dissolved oil-gas ratio (RV) at depth depth and pressure press.

+
+
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+

Private Functions

+
+
+Scalar satRv(const Scalar press, const Scalar temp) const
+
+ +
+
+

Private Members

+
+
+const int pvtRegionIdx_
+
+ +
+
+Scalar rvSatContact_
+
+ +
+
+ +
+
+template<class FluidSystem>
class RvVD : public Opm::EQUIL::Miscibility::RsFunction<FluidSystem::Scalar>
+
+

Type that implements “vaporized oil-gas ratio” tabulated as a function of depth policy. Data typically taken from keyword ‘RVVD’.

+
+

Public Functions

+
+
+RvVD(const int pvtRegionIdx, const std::vector<Scalar> &depth, const std::vector<Scalar> &rv)
+

Constructor.

+
+
Parameters:
+
    +
  • pvtRegionIdx[in] The pvt region index

  • +
  • depth[in] Depth nodes.

  • +
  • rv[in] Dissolved gas-oil ratio at depth.

  • +
+
+
+
+ +
+
+virtual Scalar operator()(const Scalar depth, const Scalar press, const Scalar temp, const Scalar satOil = 0.0) const override
+

Function call.

+
+
Parameters:
+
    +
  • depth[in] Depth at which to calculate RV value.

  • +
  • press[in] Pressure at which to calculate RV value.

  • +
  • temp[in] Temperature at which to calculate RV value.

  • +
+
+
Returns:
+

Vaporized oil-gas ratio (RV) at depth depth and pressure press.

+
+
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using RvVsDepthFunc = Tabulated1DFunction<Scalar>
+
+ +
+
+

Private Functions

+
+
+Scalar satRv(const Scalar press, const Scalar temp) const
+
+ +
+
+

Private Members

+
+
+const int pvtRegionIdx_
+
+ +
+
+RvVsDepthFunc rvVsDepth_
+
+ +
+
+ +
+
+template<class FluidSystem>
class RvwSatAtContact : public Opm::EQUIL::Miscibility::RsFunction<FluidSystem::Scalar>
+
+

Class that implements “vaporized water-gas ratio” (Rvw) as function of depth and pressure as follows:

+

    +
  1. The Rvw at the gas-water contact is equal to the saturated Rv value, RvwSatContact.

  2. +
  3. The Rvw elsewhere is equal to RvwSatContact, but constrained to the saturated value as given by the local pressure.

  4. +
+

+

This should yield Rvw-values that are constant below the contact, and decreasing above the contact.

+
+

Public Functions

+
+
+RvwSatAtContact(const int pvtRegionIdx, const Scalar pContact, const Scalar T_contact)
+

Constructor.

+
+
Parameters:
+
    +
  • pvtRegionIdx[in] The pvt region index

  • +
  • pContact[in] oil pressure at the contact

  • +
  • T_contact[in] temperature at the contact

  • +
+
+
+
+ +
+
+virtual Scalar operator()(const Scalar, const Scalar press, const Scalar temp, const Scalar satWat = 0.0) const override
+

Function call.

+
+
Parameters:
+
    +
  • depth[in] Depth at which to calculate RVW value.

  • +
  • press[in] Pressure at which to calculate RVW value.

  • +
  • temp[in] Temperature at which to calculate RVW value.

  • +
+
+
Returns:
+

Dissolved water-gas ratio (RVW) at depth depth and pressure press.

+
+
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+

Private Functions

+
+
+Scalar satRvw(const Scalar press, const Scalar temp) const
+
+ +
+
+

Private Members

+
+
+const int pvtRegionIdx_
+
+ +
+
+Scalar rvwSatContact_
+
+ +
+
+ +
+
+template<class FluidSystem>
class RvwVD : public Opm::EQUIL::Miscibility::RsFunction<FluidSystem::Scalar>
+
+

Type that implements “vaporized water-gas ratio” tabulated as a function of depth policy. Data typically taken from keyword ‘RVWVD’.

+
+

Public Functions

+
+
+RvwVD(const int pvtRegionIdx, const std::vector<Scalar> &depth, const std::vector<Scalar> &rvw)
+

Constructor.

+
+
Parameters:
+
    +
  • pvtRegionIdx[in] The pvt region index

  • +
  • depth[in] Depth nodes.

  • +
  • rvw[in] Evaporized water-gasl ratio at depth.

  • +
+
+
+
+ +
+
+virtual Scalar operator()(const Scalar depth, const Scalar press, const Scalar temp, const Scalar satWat = 0.0) const override
+

Function call.

+
+
Parameters:
+
    +
  • depth[in] Depth at which to calculate RVW value.

  • +
  • press[in] Pressure at which to calculate RVW value.

  • +
  • temp[in] Temperature at which to calculate RVW value.

  • +
+
+
Returns:
+

Vaporized water-gas ratio (RVW) at depth depth and pressure press.

+
+
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using RvwVsDepthFunc = Tabulated1DFunction<Scalar>
+
+ +
+
+

Private Functions

+
+
+Scalar satRvw(const Scalar press, const Scalar temp) const
+
+ +
+
+

Private Members

+
+
+const int pvtRegionIdx_
+
+ +
+
+RvwVsDepthFunc rvwVsDepth_
+
+ +
+
+ +
+
+template<typename Scalar>
struct SatfuncCheckPointInterface
+
+

Callback protocol for single saturation function consistency check point.

+

Intended to be used as a base class.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+

Subclassed by Opm::Satfunc::PhaseChecks::ScaledSatfuncCheckPoint< Scalar >, Opm::Satfunc::PhaseChecks::UnscaledSatfuncCheckPoint< Scalar >

+
+

Public Functions

+
+
+virtual ~SatfuncCheckPointInterface() = default
+

Virtual destructor for public inheritance.

+
+ +
+
+virtual std::optional<std::size_t> pointID(const int cellIdx) const = 0
+

Compute locally unique, i.e., per MPI rank, ID of this check for a particular cell index.

+

Common examples include the drainage or imbibition region ID (i.e., SATNUM or IMBNUM) or the Cartesian block index of a cell.

+
+
Parameters:
+

cellIdx[in] Active cell index on current rank.

+
+
Returns:
+

Locally unique point ID for cellIdx. Nullopt if this check point does not apply to cellIdx. A common cause of the latter is running a region based check and the region already having been visited.

+
+
+
+ +
+
+virtual void populateCheckPoint(const int cellIdx, EclEpsScalingPointsInfo<Scalar> &endPoints) const = 0
+

Populate check point values for a particular cell.

+
+
Parameters:
+
    +
  • cellIdx[in] Active cell index on current rank.

  • +
  • endPoints[out] Set of saturation function end-points. Member function populateCheckPoint() assigns all data members and derived classes must abide by this requirement.

  • +
+
+
+
+ +
+
+ +
+
+template<typename Scalar>
class SatfuncConsistencyCheckManager
+
+

Define and execute saturation function consistency checks for all cells in model.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Types

+
+
+using LocalToGlobal = std::function<std::size_t(int)>
+

Callback for translating active cell index to globally unique point ID.

+
+ +
+
+using ReportRecordOutput = typename SatfuncConsistencyChecks<Scalar>::ReportRecordOutput
+

Call-back function type for outputting a single record of a consistency condition violation report.

+
+ +
+
+using ViolationLevel = typename SatfuncConsistencyChecks<Scalar>::ViolationLevel
+

Severity level for consistency condition violation.

+
+ +
+
+

Public Functions

+
+
+explicit SatfuncConsistencyCheckManager(const std::size_t numSamplePoints, const EclipseState &eclipseState, const LocalToGlobal &localToGlobal)
+

Constructor

+

Creates a collection of saturation function checks based on the characteristics of the simulation model, e.g., whether or not end-point scaling is active or whether or not the run uses the alternative (three-point) scaling method.

+
+
Parameters:
+
    +
  • numSamplePoints[in] Upper bound on the number of end-point check violations to preserve for reporting purposes. Should normally be a small number like 5 or 10.

  • +
  • eclipseState[in] Container of static properties such as the scaled saturation function end-points.

  • +
  • localToGlobal[in] Callback for translating active cell indices to globally unique point IDs.

  • +
+
+
+
+ +
+
+inline SatfuncConsistencyCheckManager &collectFailuresTo(const int root)
+

Set rank to which failure reports should be collected

+
+
Parameters:
+

root[in] Failure report destination rank. Should normally be the run’s I/O rank.

+
+
Returns:
+

*this 
+
+
+

+
+
+
+ +
+
+template<typename GridView, typename GetCellIndex>
inline void run(const GridView &gv, GetCellIndex &&getCellIndex)
+

Execute collection of saturation function consistency checks for all cells in simulation model.

+
+
Template Parameters:
+
    +
  • GridViewDune grid view type.

  • +
  • GetCellIndex – Callback function type for translating an active cell object into a numeric index. Assumed to support a function call operator of the form

    int operator()(const Element& e)
    +
    +
    + in which Element is the type representing a co-dimension zero entity in the grid view.

  • +
+
+
Parameters:
+
    +
  • gv[in] Grid view for which to analyse the saturation function consistency. Each MPI rank will analyse its interior cells only, and any failure reports will be subsequently gathered on the root process defined by collectFailuresTo().

  • +
  • getCellIndex[in] Callback function for computing a numeric lookup index associated to each interior element of the grid view.

  • +
+
+
+
+ +
+
+bool anyFailedStandardChecks() const
+

Whether or not any checks failed at the Standard level.

+
+ +
+
+bool anyFailedCriticalChecks() const
+

Whether or not any checks failed at the Critical level.

+
+ +
+
+void reportFailures(const ViolationLevel level, const ReportRecordOutput &emitReportRecord) const
+

Generate textual summary output of all failed consistency checks at specific level.

+

Reports only those conditions/checks for which there is at least one violation.

+

In a parallel run this function does nothing on ranks other than the root process defined by collectFailuresTo().

+
+
Parameters:
+
    +
  • level[in] Report’s severity level.

  • +
  • emitReportRecord[in] Call-back function for outputting a single record/line of a violation report. Typically a wrapper of

    OpmLog::info() 
    +
    +
    +. It is the responsibility of emitReportRecord() to properly display the text lines to end users.

  • +
+
+
+
+ +
+
+

Private Functions

+
+
+void warnIfDirectionalOrIrreversibleEPS() const
+

Issue a warning on the root_ rank if the run uses directional or irreversible end-point scaling.

+

Those scaled curves are currently not included in the saturation function consistency analysis.

+
+ +
+
+void runCellChecks(const int cellIdx)
+

Run all configured saturation function checks for a single active cell.

+
+
Parameters:
+

cellIdx[in] Numeric lookup index associated to an interior element/cell of a grid view.

+
+
+
+ +
+
+void configureCurveChecks(const std::size_t numSamplePoints)
+

Configure all pertinent saturation function consistency checks.

+
+
Parameters:
+

numSamplePoints[in] Upper bound on the number of end-point check violations to preserve for reporting purposes.

+
+
+
+ +
+
+std::unique_ptr<UnscaledSatfuncCheckPoint<Scalar>> configureUnscaledCurveChecks(const std::string &regionName, const std::size_t numSamplePoints)
+

Configure saturation function consistency checks for per-region, unscaled saturation functions.

+
+
Parameters:
+
    +
  • regionName[in] Region set for which to configure consistency checks. Typically a well-known saturation function region property name like SATNUM or IMBNUM.

  • +
  • numSamplePoints[in] Upper bound on the number of end-point check violations to preserve for reporting purposes.

  • +
+
+
Returns:
+

Callbacks for inferring the unscaled end-points of the saturation region regionName. Nullptr if the region index property array does not exist. This should, arguably, be an optional<> instead to better reflect the intended semantics, but then we would also need to include the header for class template UnscaledSatfuncCheckPoint<> here.

+
+
+
+ +
+
+void configureScaledCurveChecks(const UnscaledSatfuncCheckPoint<Scalar> &unscaledChecks, const bool useImbibition, const std::size_t numSamplePoints)
+

Configure saturation function consistency checks for per-cell, scaled saturation functions.

+
+
Parameters:
+
    +
  • unscaledChecks[in] Callbacks for inferring the unscaled end-points of the underlying saturation region. Typically the return value from a previous call to member function configureUnscaledCurveChecks().

  • +
  • useImbibition[in] Whether or not to configure consistency checks for the imbibition curves.

  • +
  • numSamplePoints[in] Upper bound on the number of end-point check violations to preserve for reporting purposes.

  • +
+
+
+
+ +
+
+void addChecks()
+

Add set of particular end-point checks to each configured curve.

+
+ +
+
+void collectFailures(const Parallel::Communication &comm)
+

Collect consistency violations from all ranks in MPI communicator.

+

Incorporates violation counts and sampled failure points into the internal structures on each rank. Aggregate results useful for subsequent call to reportFailures() on root process.

+
+
Parameters:
+

comm[in] MPI communication object.

+
+
+
+ +
+
+template<typename Body>
void curveLoop(Body &&body)
+

Run a function for each configured curve.

+

Mutable version.

+
+
Template Parameters:
+

Body – Callback function type representing a block of code to run for each configured curve. Typically a class generated by a lambda expression.

+
+
Parameters:
+

body[in] Block of code to run for each configured curve. May mutate curves in place.

+
+
+
+ +
+
+template<typename Body>
void curveLoop(Body &&body) const
+

Run a function for each configured curve.

+

Immutable version.

+
+
Template Parameters:
+

Body – Callback function type representing a block of code to run for each configured curve. Typically a class generated by a lambda expression.

+
+
Parameters:
+

body[in] Block of code to run for each configured curve. May not mutate curves in place.

+
+
+
+ +
+
+

Private Members

+
+
+std::reference_wrapper<const EclipseState> eclipseState_
+

Container of static properties such as the scaled saturation function end-points.

+

Also used to query if and which end-point scaling behaviour is active in the run.

+
+ +
+
+LocalToGlobal localToGlobal_
+

Callback for translating active cell indices to globally unique point IDs.

+

Mostly stored for convenience. Could arguably be forwarded to the per-cell checks instead.

+
+ +
+
+satfunc::RawTableEndPoints rtep_ = {}
+

Raw table end-points.

+

Minimum, critical, and maximum saturation points for each phase for all tabulated saturation functions.

+
+ +
+
+satfunc::RawFunctionValues rfunc_ = {}
+

Raw saturation function values.

+

Maximum function values for all saturation functions in addition to relative permeability values at critical saturation points.

+
+ +
+
+std::vector<EclEpsGridProperties> gridProps_ = {}
+

Access interface for scaled saturation function end-points.

+

Represented as a vector in order to support expansion to hysteretic cases and/or directionally dependent end-point scaling.

+
+ +
+
+std::vector<CurveCollection> curves_ = {}
+

All saturation function checks that will be run for all interior cells in a grid view.

+
+ +
+
+int root_ = {0}
+

Rank to which failure reports should be collected.

+
+ +
+
+bool isRoot_ = {false}
+

Whether or not the current rank coincides with root_ in the grid view’s communicator.

+
+ +
+
+ +
+
+template<typename Scalar>
class SatfuncConsistencyChecks
+
+

Platform for running sets of consistency checks against collection of saturation function end-points

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Types

+
+
+enum class ViolationLevel : std::size_t
+

Severity level for consistency condition violation.

+

Values:

+
+
+enumerator Standard
+

Consistency condition violated, but we’re able to continue the run.

+
+ +
+
+enumerator Critical
+

Consistency condition violated and we’re not able to continue the run.

+
+ +
+
+enumerator NumLevels
+

Implementation helper. Must be last enumerator.

+
+ +
+ +
+
+using ReportRecordOutput = std::function<void(std::string_view)>
+

Call-back function type for outputting a single record of a consistency condition violation report.

+
+ +
+
+using PointIDFormatCallback = std::function<std::string(std::size_t)>
+

Call-back function type for formatting a numeric end-point ID.

+
+ +
+
+

Public Functions

+
+
+explicit SatfuncConsistencyChecks(std::string_view pointName, const std::size_t numSamplePoints)
+

Constructor

+
+
Parameters:
+
    +
  • pointName[in]

    Name/category of the points in this set of checks. Might for instance be “Grid block” or “Saturation

    +

    region”. Will be used as a column header.

    +

  • +
  • numSamplePoints[in] Upper bound on the number of end-point check violations to preserve for reporting purposes. Should normally be a small number like 5 or 10.

  • +
+
+
+
+ +
+
+~SatfuncConsistencyChecks() = default
+

Destructor.

+
+ +
+
+SatfuncConsistencyChecks(const SatfuncConsistencyChecks &rhs) = delete
+

Deleted copy constructor.

+
+ +
+
+SatfuncConsistencyChecks(SatfuncConsistencyChecks &&rhs)
+

Move-constructor.

+
+
Parameters:
+

rhs[inout]

Source object. Left in a “valid but

+

unspecified” state on exit.

+

+
+
+
+ +
+
+SatfuncConsistencyChecks &operator=(const SatfuncConsistencyChecks &rhs) = delete
+

Deleted assignment operator.

+
+ +
+
+SatfuncConsistencyChecks &operator=(SatfuncConsistencyChecks &&rhs)
+

Move-assignment operator.

+
+
Parameters:
+

rhs[inout]

Source object. Left in a “valid but

+

unspecified” state on exit.

+

+
+
Returns:
+

*this 
+
+
+.

+
+
+
+ +
+
+inline SatfuncConsistencyChecks &setPointIDFormatCallback(const PointIDFormatCallback &formatPointID)
+

Replace formatting function for end-point IDs.

+

The default formatting function is just the identity (

std::to_string() 
+
+
+) which is useful for testing, but which will for instance not capture Cartesian structure.

+
+
Parameters:
+

formatPointID[in] Call-back function type for formatting a numeric end-point ID.

+
+
Returns:
+

*this 
+
+
+

+
+
+
+ +
+
+void resetCheckSet()
+

Clear current set of end-point checks.

+
+ +
+
+void addCheck(std::unique_ptr<Check> check)
+

Add specific check to in-progress check set.

+
+
Parameters:
+

check[in] Particular end-point check.

+
+
+
+ +
+
+void finaliseCheckSet()
+

Commit current set of checks and build requisite internal support structures.

+
+ +
+
+void checkEndpoints(const std::size_t pointID, const EclEpsScalingPointsInfo<Scalar> &endPoints)
+

Run current set of checks against a specific set of end-points.

+
+
Parameters:
+
    +
  • pointID[in] Numeric identifier for this particular set of end-points. Typically a saturation region or a cell ID.

  • +
  • endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region. Will be passed directly on to

    Check::test()
    +
    +
    + for each check in the current set.

  • +
+
+
+
+ +
+
+void collectFailures(int root, const Parallel::Communication &comm)
+

Collect consistency violations from all ranks in MPI communicator.

+

Incorporates violation counts and sampled failure points into the internal structures on each rank. Aggregate results useful for subsequent call to reportFailures() on root process.

+
+
Parameters:
+
    +
  • root[in] MPI root process. This is the process onto which the counts and samples will be collected. Typically the index of the IO rank.

  • +
  • comm[in] MPI communication object.

  • +
+
+
+
+ +
+
+bool anyFailedStandardChecks() const
+

Whether or not any checks failed at the Standard level.

+
+ +
+
+bool anyFailedCriticalChecks() const
+

Whether or not any checks failed at the Critical level.

+
+ +
+
+void reportFailures(const ViolationLevel level, const ReportRecordOutput &emitReportRecord) const
+

Generate textual summary output of all failed consistency checks at specific level.

+

Reports only those conditions/checks for which there is at least one violation.

+

In a parallel run it is only safe to call this function on the MPI process to which the consistency check violations were collected in a previous call to collectFailures().

+
+
Parameters:
+
    +
  • level[in] Report’s severity level.

  • +
  • emitReportRecord[in] Call-back function for outputting a single record/line of a violation report. Typically a wrapper of

    OpmLog::info() 
    +
    +
    +. It is the responsibility of emitReportRecord() to properly display the text lines to end users.

  • +
+
+
+
+ +
+
+

Private Types

+
+
+using RandomBitGenerator = std::minstd_rand
+

Uniform random bit generator for “reservoir sampling”.

+

We don’t need mt19937 for this problem. The linear congruential engine has a smaller internal state than mt19937 and that aspect is more important here.

+
+ +
+
+using ViolationCollection = std::array<ViolationSample, static_cast<std::size_t>(ViolationLevel::NumLevels)>
+

Collection of consistency check violations.

+

One set of violations for each severity level.

+
+ +
+
+

Private Functions

+
+
+void collectFailures(int root, const Parallel::Communication &comm, ViolationSample &violation)
+

Collect violations of single severity level from all ranks in MPI communicator.

+

Incorporates violation counts and sampled failure points into the internal structures on each rank. Aggregate results useful for subsequent call to reportFailures().

+
+
Parameters:
+
    +
  • root[in] MPI root process. This is the process/rank onto which the counts and samples will be collected. Typically the index of the IO rank.

  • +
  • comm[in] MPI communication object.

  • +
  • violation[inout] Current rank’s violation structure for a single severity level. Holds aggregate values across all ranks, including updated sample points, on return.

  • +
+
+
+
+ +
+
+void buildStructure(ViolationSample &violation)
+

Allocate and initialise backing storage for a single set of sampled consistency check violations.

+
+
Parameters:
+

violation[out] On return, zeroed or otherwise initialised violation sample of proper size.

+
+
+
+ +
+
+template<typename PopulateCheckValues>
void processViolation(ViolationSample &violation, const std::size_t checkIx, const std::size_t pointID, PopulateCheckValues &&populateCheckValues)
+

Internalise a single violation into internal data structures.

+

Counts the violation and uses “reservoir sampling” (https://en.wikipedia.org/wiki/Reservoir_sampling) to determine whether or not to include the specific point into the reporting sample.

+
+
Template Parameters:
+

PopulateCheckValues – Call-back function type encapsulating block of code populate sequence of check values for a single, failed consistency check. Expected to be a callable type with a function call operator of the form

void operator()(Scalar* checkValues) const
+
+
+ in which the checkValues points the start of a sequence of values associated to particular check. The call-back function is expected to know how many values are in a valid sequence and to fill in exactly this many values.

+
+
Parameters:
+
    +
  • violation[inout] Current rank’s violation sample at particular severity level.

  • +
  • checkIx[in] Numerical check index in the range [0..battery_.size()).

  • +
  • pointID[in] Numeric identifier for this particular set of end-points. Typically a saturation region or a cell ID.

  • +
  • populateCheckValues[in] Call-back function to populate a sequence of values pertaining to specified check. Typically

    Check::exportCheckValues() 
    +
    +
    + or a copy routine to incorporate samples from multiple MPI ranks.

  • +
+
+
+
+ +
+
+void processViolation(const ViolationLevel level, const std::size_t checkIx, const std::size_t pointID)
+

Internalise a single violation into internal data structures.

+

Counts the violation and uses “reservoir sampling” (https://en.wikipedia.org/wiki/Reservoir_sampling) to determine whether or not to include the specific point into the reporting sample.

+
+
Parameters:
+
    +
  • level[in] Violation severity level.

  • +
  • checkIx[in] Numerical check index in the range [0..battery_.size()).

  • +
  • pointID[in] Numeric identifier for this particular set of end-points. Typically a saturation region or a cell ID.

  • +
+
+
+
+ +
+
+void incorporateRankViolations(const std::size_t *count, const std::size_t *pointID, const Scalar *checkValues, ViolationSample &violation)
+

Incorporate single severity level’s set of violations from single MPI rank into current rank’s internal data structures.

+
+
Parameters:
+
    +
  • count[in] Start of sequence of failure counts for all checks from single MPI rank.

  • +
  • pointID[in] Start of sequence of sampled point IDs for all checks from a single MPI rank.

  • +
  • checkValues[in] Start of sequence of sampled check values for all checks from a single MPI rank.

  • +
  • violation[inout]

  • +
+
+
+
+ +
+
+std::size_t getSampleIndex(const std::size_t sampleSize)
+

Generate random index in the sample size.

+
+
Parameters:
+

sampleSize[in] Total number of violations of a particular check.

+
+
Returns:
+

Uniformly distributed random integer in the range 0..sampleSize-1, inclusive.

+
+
+
+ +
+
+void ensureRandomBitGeneratorIsInitialised()
+

Ensure that random bit generator exists and is properly initialised.

+
+ +
+
+std::vector<std::size_t>::size_type violationPointIDStart(const std::size_t checkIx) const
+

Compute start offset into ViolationSample::pointID for particular check.

+
+
Parameters:
+

checkIx[in] Numerical check index in the range [0..battery_.size()).

+
+
Returns:
+

Start offset into ViolationSample::pointID.

+
+
+
+ +
+
+std::vector<Scalar>::size_type violationValueStart(const std::size_t checkIx, const std::size_t sampleIx) const
+

Compute start offset into ViolationSample::checkValues for particular check and sample index.

+
+
Parameters:
+
    +
  • checkIx[in] Numerical check index in the range [0..battery_.size()).

  • +
  • sampleIx[in] Numerical index in the range [0..min(count[checkIx], numSamplePoints_)).

  • +
+
+
Returns:
+

Start offset into ViolationSample::checkValues.

+
+
+
+ +
+
+void writeReportHeader(const Check *currentCheck, const std::size_t violationCount, const ReportRecordOutput &emitReportRecord) const
+

Emit violation report header.

+

Includes such information as the

Check::description()
+
+
+, the
Check::condition() 
+
+
+ and the total number of violations of this specific check.

+
+
Parameters:
+
    +
  • currentCheck[in] Current check object. Needed for the description and condition values.

  • +
  • violationCount[in] Total number of condition violations.

  • +
  • emitReportRecord[in] Call-back function for outputting a single record/line of a violation report.

  • +
+
+
+
+ +
+
+void writeTabulatedReportSample(const std::size_t nValueChar, const Check *currentCheck, const ViolationSample &violation, const std::size_t checkIx, const ReportRecordOutput &emitReportRecord) const
+

Emit tabulated sample of check violations.

+
+
Parameters:
+
    +
  • nValueChar[in] Minimum number of characters (field width) needed to display a single floating-point number (“checkValues”).

  • +
  • currentCheck[in] Current check object. Needed for the column headers in the tabulated output.

  • +
  • violation[in] Sample of consistency check violations.

  • +
  • checkIx[in] Numerical check index in the range [0..battery_.size()).

  • +
  • emitReportRecord[in] Call-back function for outputting a single record/line of a violation report.

  • +
+
+
+
+ +
+
+std::pair<std::vector<std::string>, std::string::size_type> formatPointIDs(const ViolationSample &violation, const std::size_t checkIx) const
+

Generate textual representation of all sampled point IDs for a single consistency check.

+
+
Parameters:
+
    +
  • violation[in] Sample of consistency check violations.

  • +
  • checkIx[in] Numerical check index in the range [0..battery_.size()).

  • +
+
+
Returns:
+

Sequence of formatted point IDs and the minimum number of characters needed to represent each one of these.

+
+
+
+ +
+
+std::vector<std::string> collectColumnHeaders(const Check *currentCheck) const
+

Generate sequence of table column headers for a single consistency check.

+
+
Parameters:
+

currentCheck[in] Current check object. Needed for the

Check::columnNames() 
+
+
+.

+
+
Returns:
+

Copy of the check’s column names.

+
+
+
+ +
+
+std::vector<std::size_t> sortedPointIndices(const ViolationSample &violation, const std::size_t checkIx) const
+

Generate sequence of sample indices, sorted ascendingly on the corresponding point ID.

+
+
Parameters:
+
    +
  • currentCheck[in] Current check object. Needed for the

    Check::columnNames() 
    +
    +
    +.

  • +
  • checkIx[in] Numerical check index in the range [0..battery_.size()).

  • +
+
+
Returns:
+

Ascendingly sorted sample indices.

+
+
+
+ +
+
+std::size_t numPoints(const ViolationSample &violation, const std::size_t checkIx) const
+

Compute number of sample points for a single check’s violations.

+

Effectively the minimum of the number of violations of that check and the maximum number of sample points (

this->numSamplePoints_ 
+
+
+).

+
+
Parameters:
+
    +
  • violation[in] Sample of consistency check violations.

  • +
  • checkIx[in] Numerical check index in the range [0..battery_.size()).

  • +
+
+
Returns:
+

Number of active sample points.

+
+
+
+ +
+
+std::size_t numPoints(const std::size_t violationCount) const
+

Compute number of sample points for a single check’s violations.

+

Effectively the minimum of the number of violations of that check and the maximum number of sample points (

this->numSamplePoints_ 
+
+
+).

+
+
Parameters:
+

violationCount[in] Total number of check violations.

+
+
Returns:
+

Number of active sample points.

+
+
+
+ +
+
+bool anyFailedChecks(const ViolationLevel level) const
+

Whether or not any checks failed at specified severity level.

+
+
Parameters:
+

level[in] Violation severity level.

+
+
Returns:
+

Whether or not any checks failed at severity level level.

+
+
+
+ +
+
+inline auto index(const ViolationLevel level) const
+

Convert severity level into collection index.

+
+
Parameters:
+

level[in] Violation severity level.

+
+
Returns:
+

Corresponding index into

this->violations_
+
+
+.

+
+
+
+ +
+
+template<typename Body>
void checkLoop(Body &&body)
+

Run block of code for each registered consistency check.

+

Mutable version.

+
+
Template Parameters:
+

Body – Call-back function type encapsulating block of code to run for each registered consistency check. Expected to be a callable type with a function call operator of the form

void Body::operator()(Check* checkPtr, std::size_t i)
+
+
+ in which the checkPtr points to a (mutable) Check object and i is the sequence index in which the particular check was registered in a call to addCheck().

+
+
Parameters:
+

body[inout] Block of code to run for each registered consistency check.

+
+
+
+ +
+
+template<typename Body>
void checkLoop(Body &&body) const
+

Run block of code for each registered consistency check.

+

Immutable version.

+
+
Template Parameters:
+

Body – Call-back function type encapsulating block of code to run for each registered consistency check. Expected to be a callable type with a function call operator of the form

void Body::operator()(const Check* checkPtr, std::size_t i) const
+
+
+ in which the checkPtr points to an immutable Check object and i is the sequence index in which the particular check was registered in a call to addCheck().

+
+
Parameters:
+

body[in] Block of code to run for each registered consistency check.

+
+
+
+ +
+
+

Private Members

+
+
+std::string pointName_ = {}
+

Name/category of the points in this set of checks.

+

Set by constructor. Might for instance be “Grid block” or “Saturation region”. Will be used as a column header.

+
+ +
+
+std::size_t numSamplePoints_
+

Maximum number of points retained for reporting purposes.

+
+ +
+
+PointIDFormatCallback formatPointID_ = {}
+

Formatting function for end-point IDs.

+

The default formatting function is just the identity (

std::to_string() 
+
+
+) which is useful for testing, but which will for instance not capture Cartesian structure.

+
+ +
+
+std::vector<typename std::vector<Scalar>::size_type> startCheckValues_ = {}
+

Start offsets into

ViolationSample::checkValues 
+
+
+ for each individual check.

+
+ +
+
+ViolationCollection violations_ = {}
+

Collection of sampled consistency check violations.

+

One collection for each severity level.

+
+ +
+
+std::vector<std::unique_ptr<Check>> battery_ = {}
+

Collection of checks to run against the saturation function end-points.

+
+ +
+
+std::unique_ptr<RandomBitGenerator> urbg_ = {}
+

Random bit generator for point sampling.

+

Represented as a pointer in order to avoid allocation and initialisation when the facility is not needed. This is useful when none of the consistency checks are violated which in turn is a common case in production runs.

+
+ +
+
+ +
+
+struct SaveFile
+
+
+

Public Static Attributes

+
+
+static constexpr auto *value = ""
+
+ +
+
+ +
+
+struct SaveStep
+
+
+

Public Static Attributes

+
+
+static constexpr auto *value = ""
+
+ +
+
+ +
+
+struct ScalarEntry
+
+#include <OutputExtractor.hpp>
+
+

Public Members

+
+
+std::variant<std::string_view, std::vector<std::string_view>> kw
+

A single name or a list of names for the keyword.

+
+ +
+
+ScalarFunc extract
+

Associated extraction lamda.

+
+ +
+
+ +
+
+struct ScalarEntry
+
+#include <OutputExtractor.hpp>
+

A scalar extractor descriptor.

+
+

Public Members

+
+
+ScalarBuffer *data
+

Buffer to store data in.

+
+ +
+
+ScalarFunc extract
+

Function to call for extraction.

+
+ +
+
+ +
+
+template<typename Scalar>
class ScaledSatfuncCheckPoint : public Opm::Satfunc::PhaseChecks::SatfuncCheckPointInterface<Scalar>
+
+

Callbacks for defining the scaled saturation function consistency check point of a single active grid block.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Types

+
+
+using LocalToGlobal = std::function<std::size_t(const int)>
+

Callback for translating active cell index to globally unique point ID.

+
+ +
+
+

Public Functions

+
+
+inline explicit ScaledSatfuncCheckPoint(const UnscaledSatfuncCheckPoint<Scalar> &unscaled, const EclipseState *eclipseState, const EclEpsGridProperties *epsGridProps, const LocalToGlobal &localToGlobal)
+

Constructor

+
+
Parameters:
+
    +
  • unscaled[in] Callbacks for inferring the end-points of the underlying saturation region.

  • +
  • eclipseState[in] Container of static properties such as the scaled saturation function end-points.

  • +
  • epsGridProps[in] Access interface for scaled saturation function end-points.

  • +
  • localToGlobal[in] Callback for translating active cell indices to globally unique point IDs.

  • +
+
+
+
+ +
+
+inline virtual std::optional<std::size_t> pointID(const int cellIdx) const override
+

Compute global unique, i.e., across all MPI ranks, ID of this check for a particular cell index.

+
+
Parameters:
+

cellIdx[in] Active cell index on current rank.

+
+
Returns:
+

Globally unique point ID for cellIdx

+
+
+
+ +
+
+virtual void populateCheckPoint(const int cellIdx, EclEpsScalingPointsInfo<Scalar> &endPoints) const override
+

Populate check point values for a particular cell.

+
+
Parameters:
+
    +
  • cellIdx[in] Active cell index on current rank.

  • +
  • endPoints[out] Set of saturation function end-points.

  • +
+
+
+
+ +
+
+

Private Members

+
+
+UnscaledSatfuncCheckPoint<Scalar> unscaled_
+

Callbacks for inferring the end-points of the underlying saturation region.

+
+ +
+
+const EclipseState *eclipseState_ = {nullptr}
+

Container of static properties such as the scaled saturation function end-points.

+
+ +
+
+const EclEpsGridProperties *epsGridProps_ = {nullptr}
+

Access interface for scaled saturation function end-points.

+
+ +
+
+LocalToGlobal localToGlobal_ = {}
+

Callback for translating active cell indices to globally unique point IDs.

+
+ +
+
+ +
+
+struct ScaleLinearSystem
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct SchedRestart
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct Seconds
+
+

Utility class for comparing double values representing epoch dates or elapsed time.

+

This class is used to compare double values that represent:

    +
  • Epoch dates (seconds since the Unix epoch)

  • +
  • Elapsed time (seconds since the start of the simulation)

  • +
+

+
+

Note

+

When comparing against the start of a report step or similar, it is important not to miss these points due to numerical issues. Communication between master and slave processes is based on these specific points in time.

+
+
+

Note

+

Epoch values in this century (2000-2100) fall within the range [1e9, 4e9]. A double variable cannot represent such large values with high precision. For example, the date 01-01-2020 corresponds to 1.5778368e9 seconds, and adding 1e-7 seconds to this value does not change it. Microseconds (1e-6) are approximately the smallest time units that can be represented accurately for such numbers.

+
+
+

Note

+

Report steps appear to have a maximum resolution of whole seconds. See the stepLength() function in Schedule.cpp in the opm-common module, which returns the step length in seconds.

+
+
+

Public Static Functions

+
+
+static bool compare_eq(double a, double b)
+

Determines if two double values are equal within a specified tolerance.

+

Two values a and b are considered equal if:

+
+\[ |a - b| \leq \text{tol} = \text{abstol} + \text{reltol} \times \max(|a|, |b|) \]
+
+

+

For example, if abstol = reltol = 1e-15:

    +
  • If |a| and |b| are below 1, the absolute tolerance applies.

  • +
  • If a and b are above 1, the relative tolerance applies.

  • +
+

+
+

Note

+

For epoch dates between 01-01-2000 and 01-01-2100, epoch values are in the range [1e9, 4e9]. Therefore, \( 10^{-15} \times 10^9 = 10^{-6} \), meaning differences smaller than one microsecond will be considered equal.

+
+
+

Note

+

This approach is not accurate for numbers close to zero, but such comparisons are not expected.

+
+
+
Parameters:
+
    +
  • a – First double value.

  • +
  • b – Second double value.

  • +
+
+
Returns:
+

True if a and b are considered equal within the tolerance.

+
+
+
+ +
+
+static bool compare_gt(double a, double b)
+

Determines if a is greater than b within the specified tolerance.

+
+
Parameters:
+
    +
  • a – First double value.

  • +
  • b – Second double value.

  • +
+
+
Returns:
+

True if a is greater than b.

+
+
+
+ +
+
+static bool compare_gt_or_eq(double a, double b)
+

Determines if a is greater than b within the specified tolerance.

+
+
Parameters:
+
    +
  • a – First double value.

  • +
  • b – Second double value.

  • +
+
+
Returns:
+

True if a is greater than b.

+
+
+
+ +
+
+static bool compare_lt_or_eq(double a, double b)
+

Determines if a is less than or equal to b within the specified tolerance.

+
+
Parameters:
+
    +
  • a – First double value.

  • +
  • b – Second double value.

  • +
+
+
Returns:
+

True if a is less than or equal to b.

+
+
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr double abstol = 1e-15
+

Absolute tolerance used for comparisons.

+
+ +
+
+static constexpr double reltol = 1e-15
+

Relative tolerance used for comparisons.

+
+ +
+
+ +
+
+template<class Scalar>
class SegmentState
+
+#include <SegmentState.hpp>
+
+

Public Functions

+
+
+SegmentState() = default
+
+ +
+
+SegmentState(int num_phases, const WellSegments &segments)
+
+ +
+
+Scalar pressure_drop(std::size_t index) const
+
+ +
+
+bool empty() const
+
+ +
+
+void scale_pressure(Scalar bhp)
+
+ +
+
+const std::vector<int> &segment_number() const
+
+ +
+
+std::size_t size() const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const SegmentState&) const
+
+ +
+
+

Public Members

+
+
+std::vector<Scalar> rates
+
+ +
+
+std::vector<Scalar> dissolved_gas_rate
+
+ +
+
+std::vector<Scalar> vaporized_oil_rate
+
+ +
+
+std::vector<Scalar> phase_resv_rates
+

Segment condition volume flow rates through segment (per phase)

+
+ +
+
+std::vector<Scalar> phase_velocity
+

Segment condition flow velocity through segment (per phase)

+
+ +
+
+std::vector<Scalar> phase_holdup
+

Segment condition holdup fractions through segment (per phase)

+
+ +
+
+std::vector<Scalar> phase_viscosity
+

Segment condition phase viscosities.

+
+ +
+
+std::vector<Scalar> phase_density
+

Segment condition phase densities.

+

num_phases + 2 
+
+
+ elements per segment, with the two additional elements being fluid mixture densities. Fluid mixture densities are calculated with and without ICD-related flowing phase fraction exponents, respectively. Mixture density without flowing phase fraction exponents is stored at offset num_phases, and mixture density with flowing phase fraction exponents is stored at offset
num_phases + 1 
+
+
+.

+

In other words, the phase and mixture densities are stored as

+

[{ p0, p1, …, (np - 1), mixture, mixture_with_exponents }, { p0, p1, …, (np - 1), mixture, mixture_with_exponents }, … { p0, p1, …, (np - 1), mixture, mixture_with_exponents }]

+
+ +
+
+std::vector<Scalar> pressure
+
+ +
+
+std::vector<Scalar> pressure_drop_friction
+
+ +
+
+std::vector<Scalar> pressure_drop_hydrostatic
+
+ +
+
+std::vector<Scalar> pressure_drop_accel
+
+ +
+
+

Public Static Functions

+
+
+static SegmentState serializationTestObject()
+
+ +
+
+

Private Members

+
+
+std::vector<int> m_segment_number
+
+ +
+
+ +
+
+struct SerializableSim
+
+

Abstract interface for simulator serialization ops.

+

Subclassed by Opm::SimulatorFullyImplicitBlackoil< TypeTag >

+
+

Public Functions

+
+
+virtual ~SerializableSim() = default
+
+ +
+
+virtual void loadState(HDF5Serializer &serializer, const std::string &groupName) = 0
+

Load simulator state from file.

+
+ +
+
+virtual void saveState(HDF5Serializer &serializer, const std::string &groupName) const = 0
+

Save simulator state to file.

+
+ +
+
+virtual std::array<std::string, 5> getHeader() const = 0
+

Get header info to save to file.

+
+ +
+
+virtual const std::vector<int> &getCellMapping() const = 0
+

Obtain local-to-global cell mapping.

+
+ +
+
+ +
+
+struct SerialPartitioning
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<typename Scalar>
class SGcr : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that critical gas saturation is in valid range.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar sgl_ = {}
+

Minimum gas saturation.

+
+ +
+
+Scalar sgcr_ = {}
+

Critical gas saturation.

+
+ +
+
+Scalar sgu_ = {}
+

Maximum gas saturation.

+
+ +
+
+ +
+
+template<typename Scalar>
class SGmax : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that maximum gas saturation is in valid range.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar sgu_ = {}
+

Maximum gas saturation.

+
+ +
+
+ +
+
+template<typename Scalar>
class SGmin : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that minimum gas saturation is in valid range

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar sgl_ = {}
+

Minimum gas saturation.

+
+ +
+
+ +
+
+struct ShutUnsolvableWells
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class GridView, unsigned int partitions>
class SimMeshDataAccessor
+
+#include <GridDataOutput.hpp>
+
+

Public Functions

+
+
+explicit SimMeshDataAccessor(const GridView &gridView, Dune::PartitionSet<partitions> dunePartition)
+

Construct a SimMeshDataAccessor working on a specific GridView and specialize to a Dune::PartitionSet<>.

+

+The PartitionSet of the data can be specified from one of: Dune::Partitions::all Dune::Partitions::interior Dune::Partitions::border Dune::Partitions::overlap Dune::Partitions::front Dune::Partitions::ghost Dune::Partitions::interiorBorder Dune::Partitions::interiorBorderOverlap Dune::Partitions::interiorBorderOverlapFront Dune::Partitions::all

+

N.B. To visualise ‘field’ data on the extracted grid mesh then the field variable should contain at least as many vlaues as the mesh has cells (ncells_) or vertices (nvertices_) depending on if data is cell centred or vertex centred, respectively.

+

As we are templated on the Dune::PartitionSet<partitions>, values for ncorners_, nvertices_ and ncells_ cannot change

+

This class does not work with grids containing polyhedral cells (well, it has not been tested with this kind of grid data). The user should call polyhedralCellPresent() to test if polyhedral cells are present and decide what they want to do before copying data using the data accessor methods.

+
+
Parameters:
+
    +
  • gridView – The gridView

  • +
  • PartitionSet<> – the set of cells from which to extract geometric data

  • +
+
+
+
+ +
+
+bool polyhedralCellPresent() const
+

Checks for cells that have polyhedral type within the current partition of cells

+

Returns true if a polyhedral sell is found. If this is the case then this partition is not going to be available for visualisation as this class does not yet handle polyhedral cells.

+
+ +
+
+void countEntities()
+

Count the vertices, cells and corners.

+

Count all the vertices ( the Dune::Partitions::all partition ) as then we do not need to renumber the vertices as all the subsets use references to the full set.

+
+ +
+
+template<typename T>
long writeGridPoints(T *x_inout, T *y_inout, T *z_inout, long max_size = 0) const
+

Write the positions of vertices - directly to the pointers given in parameters

+

+Returns the number of vertices written

+
+
Parameters:
+
    +
  • x_inout – to be filled with x coordinate verticies

  • +
  • y_inout – to be filled with y coordinate verticies

  • +
  • y_inout – to be filled with z coordinate verticies

  • +
  • max_size – the maximum number of elements of type T that can be written to the input pointer memory regions.

  • +
+
+
+
+ +
+
+template<typename VectType>
long writeGridPoints(VectType &x_inout, VectType &y_inout, VectType &z_inout) const
+

Write the positions of vertices - directly to the pointers given in parameters

+

+All parameters must have a size() and data() method (e.g. a std::vector<T>) and the current size() must be big enough

+

Returns the number of vertices written

+
+
Parameters:
+
    +
  • x_inout – to be filled with x coordinate verticies

  • +
  • y_inout – to be filled with y coordinate verticies

  • +
  • y_inout – to be filled with z coordinate verticies

  • +
+
+
+
+ +
+
+template<typename T>
long writeGridPoints_AOS(T *xyz_inout, long max_size = 0) const
+

Write the positions of vertices - directly to the pointers given in parameters as Array of Structures x,y,z,x,y,z,x,y,z,…

+

+Returns the number of vertices written

+
+
Parameters:
+
    +
  • xyz_inout – is the array to be filled with x,y,z coordinate verticies.

  • +
  • max_size – is the maximum number x,y,z structures with elements of type T that can be written to the input pointer memory regions.

  • +
+
+
+
+ +
+
+template<typename VectType>
long writeGridPoints_AOS(VectType &xyz_inout) const
+

Write the positions of vertices - directly to the pointers given in parameters as Array of Structures x,y,z,x,y,z,x,y,z,…

+

+Returns the number of vertices written

+
+
Parameters:
+

xyz_inout – is the array to be filled with x,y,z coordinate verticies. The object VectType must have a size() and data() method (e.g. a std::vector<T>)

+
+
+
+ +
+
+template<typename T>
long writeGridPoints_SOA(T *xyz_inout, long max_size = 0) const
+

Write the positions of vertices - directly to the pointers given in parameters as Structure of Arrays: x,x,x,…,y,y,y,…,z,z,z,…

+

+Returns the number of vertices written

+
+
Parameters:
+
    +
  • xyz_inout – is the array to be filled with x,y,z coordinate verticies.

  • +
  • max_size – number of verticies (x,…y,…z,… structures) with elements of type T that can be written to the input pointer memory regions.

  • +
+
+
+
+ +
+
+template<typename VectType>
long writeGridPoints_SOA(VectType &xyz_inout) const
+

Write the positions of vertices - directly to the pointers given in parameters as Structure of Arrays: x,x,x,…,y,y,y,…,z,z,z,…

+

+Returns the number of vertices written

+
+
Parameters:
+

xyz_inout – is the array to be filled with x,y,z coordinate verticies. The object VectType must have a size() and data() method (e.g. a std::vector<T>)

+
+
+
+ +
+
+template<typename Integer>
long writeConnectivity(Integer *connectivity_inout, ConnectivityVertexOrder whichOrder, long max_size = 0) const
+

Write the connectivity array - directly to the pointer given in parameter 1 Reorders the indices as selected either in DUNE order or VTK order.

+
+
Parameters:
+
    +
  • connectivity_inout – is the array to be filled with connectivity indexes (i.e. the index into the vertex array)

  • +
  • whichOrder, is – the order that verticies are traversed to create a cell (VTK or DUNE)

  • +
  • max_size – is used to check that the space available in the input pointer parameter will fit the number of corner values written. Returns the number of corner indices written.

  • +
+
+
+
+ +
+
+template<typename VectType>
long writeConnectivity(VectType &connectivity_inout, ConnectivityVertexOrder whichOrder) const
+

Write the connectivity array - directly to a VectType object given in parameter 1 Reorders the indices as selected either in DUNE order or VTK order.

+
+
Parameters:
+
    +
  • connectivity_inout – is the array to be filled with connectivity indexes (i.e. the index into the vertex array) The object VectType must have a size() and data() method (e.g. a std::vector<T>)

  • +
  • whichOrder, is – the order that verticies are traversed to create a cell (VTK or DUNE)

  • +
  • max_size – is used to check that the space available in the input pointer parameter will fit the number of corner values written. Returns the number of corner indices written.

  • +
+
+
+
+ +
+
+template<typename Integer>
long writeOffsetsCells(Integer *offsets_inout, long max_size = 0) const
+

Write the offsets values - directly to the pointer given in parameter 1

+

+Returns number of offset values written + 1

+
+
Parameters:
+
    +
  • offsets_inout – is the array to be filled with offsets into the connectivity array (i.e. the index into the connectivity array to determine the vertices used for the particular cell)

  • +
  • max_size – is used to check that the space available in the input pointer parameter will fit the number of cell offset values written.

  • +
+
+
+
+ +
+
+template<typename VectType>
long writeOffsetsCells(VectType &offsets_inout) const
+

Write the offsets values - directly to a VectType object given in parameter 1

+

+Returns number of offset values written + 1

+
+
Parameters:
+

offsets_inout – is the array to be filled with offsets into the connectivity array (i.e. the index into the connectivity array to determine the vertices used for the particular cell). The object VectType must have a size() and data() method (e.g. a std::vector<T>)

+
+
+
+ +
+
+template<typename Integer>
long writeCellTypes(Integer *types_inout, long max_size = 0) const
+

Write the cell types values - directly to the pointer given in parameter 1

+

+Returns number of cells type values written

+
+
Parameters:
+
    +
  • types_inout – is the array to be filled with the cell types (VTK defined values)

  • +
  • max_size – is used to check that the space available in the input pointer parameter will fit the number of cell offset values written.

  • +
+
+
+
+ +
+
+template<typename VectType>
long writeCellTypes(VectType &types_inout) const
+

Write the cell types values - directly to the VectType object given in parameter 1

+

+Returns number of cells type values written

+
+
Parameters:
+

types_inout – is the array to be filled with the cell types (VTK defined values) The object VectType must have a size() and data() method (e.g. a std::vector<T>)

+
+
+
+ +
+
+std::string getPartitionTypeString() const
+
+ +
+
+inline Dune::PartitionSet<partitions> getPartition(void)
+
+ +
+
+void printGridDetails(std::ostream &outstr) const
+
+ +
+
+inline int getNCells() const
+
+ +
+
+inline int getNVertices() const
+
+ +
+
+inline int getNCorners() const
+
+ +
+
+inline std::string getError() const
+
+ +
+
+inline void clearError()
+
+ +
+
+inline bool hasError() const
+
+ +
+
+

Protected Attributes

+
+
+GridView gridView_
+
+ +
+
+Dune::PartitionSet<partitions> dunePartition_
+
+ +
+
+unsigned int partition_value_
+
+ +
+
+int ncells_
+

Current partition grid information

+
+ +
+
+int nvertices_
+

Current partition grid information

+
+ +
+
+int ncorners_
+

Current partition grid information

+
+ +
+
+int dimw_
+
+ +
+
+

Private Members

+
+
+std::string error_
+
+ +
+
+ +
+
+class SimpleIterationCountTimeStepControl : public Opm::TimeStepControlInterface
+
+#include <TimeStepControl.hpp>
+

A simple iteration count based adaptive time step control.

+
+

Public Functions

+
+
+SimpleIterationCountTimeStepControl() = default
+
+ +
+
+SimpleIterationCountTimeStepControl(const int target_iterations, const double decayrate, const double growthrate, const bool verbose = false)
+

constructor

+
+
Parameters:
+
    +
  • target_iterations – number of desired iterations (e.g. Newton iterations) per time step in one time step

  • +
  • verbose – if true get some output (default = false)

  • +
+
+
+
+ +
+
+virtual double computeTimeStepSize(const double dt, const int iterations, const RelativeChangeInterface&, const AdaptiveSimulatorTimer&) const override
+

compute new time step size suggestions based on the PID controller

+
+
Parameters:
+
    +
  • dt – time step size used in the current step

  • +
  • iterations – number of iterations used (linear/nonlinear)

  • +
  • timeError – object to compute || u^n+1 - u^n || / || u^n+1 ||

  • +
+
+
Returns:
+

suggested time step size for the next step

+
+
+
+ +
+
+inline virtual bool timeStepAccepted(const double) const override
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const SimpleIterationCountTimeStepControl&) const
+
+ +
+
+

Public Static Functions

+
+
+static SimpleIterationCountTimeStepControl serializationTestObject()
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr TimeStepControlType Type = TimeStepControlType::SimpleIterationCount
+
+ +
+
+

Protected Attributes

+
+
+const int target_iterations_ = 0
+
+ +
+
+const double decayrate_ = 0.0
+
+ +
+
+const double growthrate_ = 0.0
+
+ +
+
+const bool verbose_ = false
+
+ +
+
+ +
+
+struct SimulationModelParams
+
+
+

Public Members

+
+
+double setupTime_
+
+ +
+
+std::unique_ptr<UDQState> udqState_
+
+ +
+
+std::unique_ptr<Action::State> actionState_
+
+ +
+
+std::unique_ptr<SummaryState> summaryState_
+
+ +
+
+std::unique_ptr<WellTestState> wtestState_
+
+ +
+
+std::shared_ptr<EclipseState> eclState_
+
+ +
+
+std::shared_ptr<Schedule> eclSchedule_
+
+ +
+
+std::shared_ptr<SummaryConfig> eclSummaryConfig_
+
+ +
+
+ +
+
+class SimulatorConvergenceOutput
+
+

Class handling convergence history output for a simulator.

+
+

Public Functions

+
+
+void startThread(const EclipseState &eclState, std::string_view convOutputOptions, std::string_view optionName, ConvergenceOutputThread::ComponentToPhaseName getPhaseName)
+

Start convergence output thread.

+

Thread starts only if explicitly requested in runtime user options.

+
+
Parameters:
+
    +
  • eclState[in] Static model object. Needed to determine run’s output directory, base name, and unit conventions.

  • +
  • convOutputOptions[in] Comma separated option string as required by class ConvergenceOutputConfiguration.

  • +
  • optionName[in] Name of command line option whose value is convOutputOptions. Used as diagnostic information only.

  • +
  • getPhaseName[in] Callable object for converting component indices into human readable component names.

  • +
+
+
+
+ +
+
+void write(const std::vector<StepReport> &reports)
+

Create convergence output requests.

+

Must not be called before startThread() or after endThread().

+

Only those reports which have not previously been emitted will be written, and only if the run actually requests convergence output at the non-linear iteration level.

+
+
Parameters:
+

reports[in] All step reports generated in the simulation run so far. Class SimulatorConvergenceOutput maintains a record of which reports have been written.

+
+
+
+ +
+
+void endThread()
+

Request that convergence output thread be shut down.

+

No additional output requests should be submitted to write() once this function is called.

+
+ +
+
+

Private Members

+
+
+std::vector<StepReport>::size_type alreadyReportedSteps_ = 0
+

Number of step reports which have already been written.

+
+ +
+
+std::optional<ConvergenceReportQueue> convergenceOutputQueue_ = {}
+

Communication channel between main thread creating output requests and output thread actually writing those requests to file on disk.

+

Nullopt unless convergence output has been requested at the non-linear iteration level.

+
+ +
+
+std::optional<ConvergenceOutputThread> convergenceOutputObject_ = {}
+

Output request controller object.

+

Nullopt unless convergence output has been requested at the non-linear iteration level.

+
+ +
+
+std::optional<std::thread> convergenceOutputThread_ = {}
+

Output request thread.

+

Calls output writing member functions on the convergenceOutputObject_.

+

Nullopt unless convergence output has been requested at the non-linear iteration level.

+
+ +
+
+ +
+
+template<class TypeTag>
class SimulatorFullyImplicitBlackoil : private Opm::SerializableSim
+
+

a simulator for the blackoil model

+
+

Public Types

+
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using BlackoilIndices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>
+
+ +
+
+using MaterialLawParams = GetPropType<TypeTag, Properties::MaterialLawParams>
+
+ +
+
+using AquiferModel = GetPropType<TypeTag, Properties::AquiferModel>
+
+ +
+
+using Model = GetPropType<TypeTag, Properties::NonlinearSystem>
+
+ +
+
+using TimeStepper = AdaptiveTimeStepping<TypeTag>
+
+ +
+
+using PolymerModule = BlackOilPolymerModule<TypeTag>
+
+ +
+
+using MICPModule = BlackOilMICPModule<TypeTag>
+
+ +
+
+using Solver = NonlinearSolver<TypeTag, Model>
+
+ +
+
+using ModelParameters = typename Model::ModelParameters
+
+ +
+
+using SolverParameters = typename Solver::SolverParameters
+
+ +
+
+using WellModel = BlackoilWellModel<TypeTag>
+
+ +
+
+

Public Functions

+
+
+inline explicit SimulatorFullyImplicitBlackoil(Simulator &simulator)
+

Initialise from parameters and objects to observe.

+
+
Parameters:
+

param[in] parameters, this class accepts the following:

+
+
+
+ +
+
+inline ~SimulatorFullyImplicitBlackoil() override
+
+ +
+
+inline SimulatorReport run(SimulatorTimer &timer)
+

Run the simulation. This will run succesive timesteps until timer.done() is true. It will modify the reservoir and well states.

+
+
Parameters:
+
    +
  • timer[inout] governs the requested reporting timesteps

  • +
  • state[inout] state of reservoir: pressure, fluxes

  • +
+
+
Returns:
+

simulation report, with timing data

+
+
+
+ +
+
+inline void init(const SimulatorTimer &timer)
+
+ +
+
+inline void updateTUNING(const Tuning &tuning)
+
+ +
+
+inline bool runStep(SimulatorTimer &timer)
+
+ +
+
+inline SimulatorReport finalize()
+
+ +
+
+inline const Grid &grid() const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline const Model &model() const
+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+
+ +
+
+

Protected Functions

+
+
+inline virtual void loadState(HDF5Serializer &serializer, const std::string &groupName) override
+

Load simulator state from hdf5 serializer.

+
+ +
+
+inline virtual void saveState(HDF5Serializer &serializer, const std::string &groupName) const override
+

Save simulator state using hdf5 serializer.

+
+ +
+
+inline virtual std::array<std::string, 5> getHeader() const override
+

Returns header data.

+
+ +
+
+inline virtual const std::vector<int> &getCellMapping() const override
+

Returns local-to-global cell mapping.

+
+ +
+
+inline std::unique_ptr<Solver> createSolver(WellModel &wellModel)
+
+ +
+
+inline const EclipseState &eclState() const
+
+ +
+
+inline const Schedule &schedule() const
+
+ +
+
+inline bool isRestart() const
+
+ +
+
+inline WellModel &wellModel_()
+
+ +
+
+inline const WellModel &wellModel_() const
+
+ +
+
+

Protected Attributes

+
+
+Simulator &simulator_
+
+ +
+
+ModelParameters modelParam_
+
+ +
+
+SolverParameters solverParam_
+
+ +
+
+std::unique_ptr<Solver> solver_
+
+ +
+
+PhaseUsage phaseUsage_
+
+ +
+
+bool terminalOutput_
+
+ +
+
+SimulatorReport report_
+
+ +
+
+std::unique_ptr<time::StopWatch> solverTimer_
+
+ +
+
+std::unique_ptr<time::StopWatch> totalTimer_
+
+ +
+
+std::unique_ptr<TimeStepper> adaptiveTimeStepping_
+
+ +
+
+SimulatorConvergenceOutput convergence_output_ = {}
+
+ +
+
+SimulatorSerializer serializer_
+
+ +
+
+ +
+
+struct SimulatorReport
+
+#include <SimulatorReport.hpp>
+
+

Public Functions

+
+
+bool operator==(const SimulatorReport&) const
+
+ +
+
+void operator+=(const SimulatorReportSingle &sr)
+
+ +
+
+void operator+=(const SimulatorReport &sr)
+
+ +
+
+void reportFullyImplicit(std::ostream &os) const
+
+ +
+
+void reportNLDD(std::ostream &os) const
+
+ +
+
+void fullReports(std::ostream &os) const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Public Members

+
+
+SimulatorReportSingle success
+
+ +
+
+SimulatorReportSingle failure
+
+ +
+
+std::vector<SimulatorReportSingle> stepreports
+
+ +
+
+

Public Static Functions

+
+
+static SimulatorReport serializationTestObject()
+
+ +
+
+ +
+
+struct SimulatorReportSingle
+
+#include <SimulatorReport.hpp>
+

A struct for returning timing data from a simulator to its caller.

+
+

Public Functions

+
+
+bool operator==(const SimulatorReportSingle&) const
+
+ +
+
+void operator+=(const SimulatorReportSingle &sr)
+

Increment this report’s times by those in sr.

+
+ +
+
+void reportStep(std::ostream &os) const
+

Print a report suitable for a single simulation step.

+
+ +
+
+void reportFullyImplicit(std::ostream &os, const SimulatorReportSingle *failedReport = nullptr) const
+

Print a report suitable for the end of a fully implicit case, leaving out the pressure/transport time.

+
+ +
+
+void reportNLDD(std::ostream &os, const SimulatorReportSingle *failedReport = nullptr) const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Public Members

+
+
+double pressure_time = 0.0
+
+ +
+
+double transport_time = 0.0
+
+ +
+
+double total_time = 0.0
+
+ +
+
+double solver_time = 0.0
+
+ +
+
+double assemble_time = 0.0
+
+ +
+
+double pre_post_time = 0.0
+
+ +
+
+double assemble_time_well = 0.0
+
+ +
+
+double linear_solve_setup_time = 0.0
+
+ +
+
+double linear_solve_time = 0.0
+
+ +
+
+double local_solve_time = 0.0
+
+ +
+
+double update_time = 0.0
+
+ +
+
+double output_write_time = 0.0
+
+ +
+
+unsigned int total_well_iterations = 0
+
+ +
+
+unsigned int total_linearizations = 0
+
+ +
+
+unsigned int total_newton_iterations = 0
+
+ +
+
+unsigned int total_linear_iterations = 0
+
+ +
+
+unsigned int min_linear_iterations = std::numeric_limits<unsigned int>::max()
+
+ +
+
+unsigned int max_linear_iterations = 0
+
+ +
+
+bool converged = false
+
+ +
+
+bool well_group_control_changed = false
+
+ +
+
+int exit_status = EXIT_SUCCESS
+
+ +
+
+double global_time = 0.0
+
+ +
+
+double timestep_length = 0.0
+
+ +
+
+int num_domains = 0
+
+ +
+
+int num_wells = 0
+
+ +
+
+int num_overlap_cells = 0
+
+ +
+
+int num_owned_cells = 0
+
+ +
+
+int converged_domains = 0
+
+ +
+
+int unconverged_domains = 0
+
+ +
+
+int accepted_unconverged_domains = 0
+
+ +
+
+

Public Static Functions

+
+
+static SimulatorReportSingle serializationTestObject()
+
+ +
+
+ +
+
+class SimulatorSerializer
+
+

Class handling simulator serialization.

+
+

Public Functions

+
+
+SimulatorSerializer(SerializableSim &simulator, Parallel::Communication &comm, const IOConfig &ioconfig, const std::string &saveSpec, int loadStep, const std::string &saveFile, const std::string &loadFile)
+

Constructor inits parameters.

+
+
Parameters:
+
    +
  • saveSpec – Specification of steps to save

  • +
  • loadStep – Step to load \paramn saveFile File to save to

  • +
  • loadFile – File to load from

  • +
+
+
+
+ +
+
+inline bool shouldLoad() const
+

Returns whether or not a state should be loaded.

+
+ +
+
+inline int loadStep() const
+

Returns step to load.

+
+ +
+
+void save(SimulatorTimer &timer)
+

Save data to file if appropriate.

+
+ +
+
+void loadTimerInfo(SimulatorTimer &timer)
+

Loads time step info from file.

+

Load timer info from serialized state.

+
+ +
+
+void loadState()
+

Load state from file.

+

Load simulator state from serialized state.

+
+ +
+
+

Private Functions

+
+
+void checkSerializedCmdLine(const std::string &current, const std::string &stored)
+

Checks for differences between command line parameters.

+
+ +
+
+

Private Members

+
+
+SerializableSim &simulator_
+

Reference to simulator to be use.

+
+ +
+
+Parallel::Communication &comm_
+

Communication to use.

+
+ +
+
+int saveStride_ = 0
+

Stride to save serialized state at, negative to only keep last.

+
+ +
+
+int saveStep_ = -1
+

Specific step to save serialized state at.

+
+ +
+
+int loadStep_ = -1
+

Step to load serialized state from.

+
+ +
+
+std::string saveFile_
+

File to save serialized state to.

+
+ +
+
+std::string loadFile_
+

File to load serialized state from.

+
+ +
+
+ +
+
+class SimulatorTimer : public Opm::SimulatorTimerInterface
+
+#include <SimulatorTimer.hpp>
+
+

Public Functions

+
+
+SimulatorTimer()
+

Default constructor.

+
+ +
+
+void init(const ParameterGroup &param)
+

Initialize from parameters. Accepts the following: num_psteps (default 1) stepsize_days (default 1)

+
+ +
+
+void init(const Schedule &schedule, std::size_t report_step = 0)
+

Use the SimulatorTimer as a shim around opm-commons Schedule class.

+

Use the SimulatorTimer as a shim around opm-parser’s Opm::TimeMap.

+
+ +
+
+virtual bool initialStep() const override
+

Whether the current step is the first step.

+
+ +
+
+int numSteps() const
+

Total number of steps.

+
+ +
+
+virtual int currentStepNum() const override
+

Current step number.

+

Current step number. This is the number of timesteps that has been completed from the start of the run. The time after initialization but before the simulation has started is timestep number zero.

+
+ +
+
+void setCurrentStepNum(int step)
+

Set current step number.

+
+ +
+
+virtual double currentStepLength() const override
+

Current step length.

+

Current step length. This is the length of the step the simulator will take in the next iteration.

+
+

Note

+

if done(), it is an error to call currentStepLength().

+
+
+ +
+
+virtual double stepLengthTaken() const override
+

Previous step length. This is the length of the step that was taken to arrive at this time.

+
+

Note

+

if no increments have been done (i.e. the timer is still in its constructed state and currentStepNum() == 0), it is an error to call stepLengthTaken().

+
+
+ +
+
+virtual double simulationTimeElapsed() const override
+

time elapsed since the start of the simulation [s].

+

Time elapsed since the start of the simulation until the beginning of the current time step [s].

+
+ +
+
+double totalTime() const
+

Total time.

+
+ +
+
+virtual boost::posix_time::ptime startDateTime() const override
+

Return start date of simulation.

+
+ +
+
+void setTotalTime(double time)
+

Set total time. This is primarily intended for multi-epoch schedules, where a timer for a given epoch does not have access to later timesteps.

+
+ +
+
+void report(std::ostream &os) const
+

Print a report with current and total time etc.

+

Print a report with current and total time etc. Note: if done(), it is an error to call report().

+
+ +
+
+SimulatorTimer &operator++()
+

advance time by currentStepLength

+

Next step.

+
+ +
+
+inline virtual void advance() override
+

advance time by currentStepLength

+
+ +
+
+virtual bool done() const override
+

Return true if op++() has been called numSteps() times.

+
+ +
+
+inline virtual bool lastStepFailed() const override
+

Always return false. Timestep failures is handled in the substepTimer

+
+ +
+
+virtual std::unique_ptr<SimulatorTimerInterface> clone() const override
+

return copy of object

+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const SimulatorTimer &rhs) const
+
+ +
+
+virtual boost::posix_time::ptime currentDateTime() const
+

Return the current time as a posix time object.

+
+ +
+
+virtual time_t currentPosixTime() const
+

Time elapsed since the start of the POSIX epoch (Jan 1st, 1970) until the current time step begins [s].

+
+ +
+
+

Public Static Functions

+
+
+static SimulatorTimer serializationTestObject()
+
+ +
+
+

Private Members

+
+
+std::vector<double> timesteps_
+
+ +
+
+int current_step_
+
+ +
+
+double current_time_
+
+ +
+
+double total_time_
+
+ +
+
+boost::gregorian::date start_date_
+
+ +
+
+ +
+
+class SimulatorTimerInterface
+
+

Interface class for SimulatorTimer objects, to be improved.

+

Subclassed by Opm::AdaptiveSimulatorTimer, Opm::SimulatorTimer

+
+

Public Functions

+
+
+inline virtual ~SimulatorTimerInterface()
+

destructor

+
+ +
+
+virtual void advance() = 0
+

advance time by currentStepLength

+
+ +
+
+virtual std::unique_ptr<SimulatorTimerInterface> clone() const = 0
+

return copy of current timer instance

+
+ +
+
+virtual double currentStepLength() const = 0
+

Current step length. This is the length of the step the simulator will take in the next iteration.

+
+

Note

+

if done(), it is an error to call currentStepLength().

+
+
+ +
+
+virtual int currentStepNum() const = 0
+

Current step number. This is the number of timesteps that has been completed from the start of the run. The time after initialization but before the simulation has started is timestep number zero.

+
+ +
+
+virtual bool done() const = 0
+

Return true if timer indicates that simulation of timer interval is finished.

+
+ +
+
+virtual bool initialStep() const = 0
+

Whether the current step is the first step.

+
+ +
+
+virtual bool lastStepFailed() const = 0
+

Return true if last time step failed.

+
+ +
+
+virtual double simulationTimeElapsed() const = 0
+

Time elapsed since the start of the simulation until the beginning of the current time step [s].

+
+ +
+
+virtual double stepLengthTaken() const = 0
+

Previous step length. This is the length of the step that was taken to arrive at this time.

+
+

Note

+

if no increments have been done (i.e. the timer is still in its constructed state and currentStepNum() == 0), it is an error to call stepLengthTaken().

+
+
+ +
+
+virtual boost::posix_time::ptime startDateTime() const = 0
+

Return start date of simulation.

+
+ +
+
+virtual boost::posix_time::ptime currentDateTime() const
+

Return the current time as a posix time object.

+
+ +
+
+virtual time_t currentPosixTime() const
+

Time elapsed since the start of the POSIX epoch (Jan 1st, 1970) until the current time step begins [s].

+
+ +
+
+inline virtual double reportStepLengthTaken() const
+

Previous report step length. This is the length of the step that was taken to arrive at this report step time.

+
+

Note

+

if no increments have been done (i.e. the timer is still in its constructed state and reportStepNum() == 0), it is an error to call stepLengthTaken().

+
+
+ +
+
+inline virtual int reportStepNum() const
+

Current report step number. This might differ from currentStepNum in case of sub stepping.

+
+ +
+
+

Protected Functions

+
+
+inline SimulatorTimerInterface()
+

Default constructor, protected to not allow explicit instances of this class.

+
+ +
+
+ +
+
+struct SingleRegion
+
+#include <InterRegFlows.hpp>
+

Minimal representation of a single named region defintion.

+

Name is typically “FIPNUM” or any additional “FIP*” array names.

+
+

Public Members

+
+
+std::string name
+

Region definition array name.

+
+ +
+
+std::reference_wrapper<const std::vector<int>> definition
+

Region definition array.

+
+ +
+
+ +
+
+template<class Scalar>
class SingleWellState
+
+#include <SingleWellState.hpp>
+
+

Public Types

+
+
+enum RateIndices
+

Values:

+
+
+enumerator dissolved_gas
+
+ +
+
+enumerator dissolved_gas_in_water
+
+ +
+
+enumerator vaporized_oil
+
+ +
+
+enumerator vaporized_water
+
+ +
+ +
+
+

Public Functions

+
+
+SingleWellState(const std::string &name, const ParallelWellInfo<Scalar> &pinfo, bool is_producer, Scalar presssure_first_connection, const std::vector<PerforationData<Scalar>> &perf_input, const PhaseUsage &pu, Scalar temp)
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+bool operator==(const SingleWellState&) const
+
+ +
+
+void reset_connection_factors(const std::vector<PerforationData<Scalar>> &new_perf_data)
+

Special purpose method to support dynamically rescaling a well’s CTFs through WELPI.

+
+
Parameters:
+

new_perf_data[in] New perforation data. Only PerforationData::connection_transmissibility_factor actually used (overwrites existing internal values).

+
+
+
+ +
+
+void update_producer_targets(const Well &ecl_well, const SummaryState &st)
+
+ +
+
+void update_injector_targets(const Well &ecl_well, const SummaryState &st)
+
+ +
+
+bool update_type_and_targets(const Well &ecl_well, const SummaryState &st)
+

update the type of the well and the targets.

+

This called after ACTIONX is executed to update well rates. The new status is in ecl_well and st.

+
+
Returns:
+

whether well was switched to a producer

+
+
+
+ +
+
+void updateStatus(WellStatus status)
+
+ +
+
+void init_timestep(const SingleWellState &other)
+
+ +
+
+void shut()
+
+ +
+
+void stop()
+
+ +
+
+void open()
+
+ +
+
+Scalar sum_solvent_rates() const
+
+ +
+
+Scalar sum_polymer_rates() const
+
+ +
+
+Scalar sum_brine_rates() const
+
+ +
+
+Scalar sum_microbial_rates() const
+
+ +
+
+Scalar sum_oxygen_rates() const
+
+ +
+
+Scalar sum_urea_rates() const
+
+ +
+
+Scalar sum_wat_mass_rates() const
+
+ +
+
+Scalar sum_filtrate_rate() const
+
+ +
+
+Scalar sum_filtrate_total() const
+
+ +
+
+

Public Members

+
+
+std::string name
+
+ +
+
+std::reference_wrapper<const ParallelWellInfo<Scalar>> parallel_info
+
+ +
+
+WellStatus status = {WellStatus::OPEN}
+
+ +
+
+bool producer
+
+ +
+
+PhaseUsage pu
+
+ +
+
+Scalar bhp = {0}
+
+ +
+
+Scalar thp = {0}
+
+ +
+
+Scalar temperature = {0}
+
+ +
+
+Scalar efficiency_scaling_factor = {1.0}
+
+ +
+
+Scalar filtrate_conc = {0}
+
+ +
+
+std::array<Scalar, 4> phase_mixing_rates = {}
+
+ +
+
+std::vector<Scalar> well_potentials
+
+ +
+
+std::vector<Scalar> productivity_index
+
+ +
+
+std::vector<Scalar> implicit_ipr_a
+
+ +
+
+std::vector<Scalar> implicit_ipr_b
+
+ +
+
+std::vector<Scalar> surface_rates
+
+ +
+
+std::vector<Scalar> reservoir_rates
+
+ +
+
+std::vector<Scalar> prev_surface_rates
+
+ +
+
+PerfData<Scalar> perf_data
+
+ +
+
+bool trivial_group_target
+
+ +
+
+SegmentState<Scalar> segments
+
+ +
+
+Events events
+
+ +
+
+WellInjectorCMode injection_cmode = {WellInjectorCMode::CMODE_UNDEFINED}
+
+ +
+
+WellProducerCMode production_cmode = {WellProducerCMode::CMODE_UNDEFINED}
+
+ +
+
+std::vector<Scalar> primaryvar
+
+ +
+
+

Public Static Functions

+
+
+static SingleWellState serializationTestObject(const ParallelWellInfo<Scalar> &pinfo)
+
+ +
+
+

Private Functions

+
+
+Scalar sum_connection_rates(const std::vector<Scalar> &connection_rates) const
+
+ +
+
+ +
+
+struct SkprpolyTable
+
+
+

Public Members

+
+
+double refConcentration
+
+ +
+
+TabulatedTwoDFunction table_func
+
+ +
+
+ +
+
+struct Slave
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class M, class X, class Y, class C>
struct SmootherTraits<Opm::ParallelOverlappingILU0<M, X, Y, C>>
+
+
+

Public Types

+
+
+using Arguments = Opm::ParallelOverlappingILU0Args<typename M::field_type>
+
+ +
+
+using Arguments = Opm::ParallelOverlappingILU0Args<typename M::field_type>
+
+ +
+
+using Arguments = Opm::ParallelOverlappingILU0Args<typename M::field_type>
+
+ +
+
+using Arguments = Opm::ParallelOverlappingILU0Args<typename M::field_type>
+
+ +
+
+using Arguments = Opm::ParallelOverlappingILU0Args<typename M::field_type>
+
+ +
+
+ +
+
+template<class Range, class Domain, class ParallelInfo, class SeqPreconditioner>
struct SmootherTraits<Opm::ParallelRestrictedOverlappingSchwarz<Range, Domain, ParallelInfo, SeqPreconditioner>>
+
+

Tells AMG how to use Opm::ParallelOverlappingILU0 smoother.

+
+
Template Parameters:
+
    +
  • Domain – The type of the Vector representing the domain.

  • +
  • Range – The type of the Vector representing the range.

  • +
  • ParallelInfo – The type of the parallel information object used, e.g. Dune::OwnerOverlapCommunication

  • +
  • SeqPreconditioner – The underlying sequential preconditioner to use.

  • +
+
+
+
+

Public Types

+
+
+typedef DefaultSmootherArgs<typename SeqPreconditioner::matrix_type::field_type> Arguments
+
+ +
+
+ +
+
+template<typename Scalar>
class SOcr_GO : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that critical oil saturation in gas/oil system is in valid range

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar sogcr_ = {}
+

Critical oil saturation in gas/oil system.

+
+ +
+
+ +
+
+template<typename Scalar>
class SOcr_OW : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that critical oil saturation in oil/water system is in valid range

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar sowcr_ = {}
+

Critical oil saturation in oil/water system.

+
+ +
+
+ +
+
+template<class TypeTag>
struct SolidEnergyLaw<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Types

+
+
+using EclThermalLawManager = ::Opm::EclThermalLawManager<Scalar, FluidSystem>
+
+ +
+
+using type = typename EclThermalLawManager::SolidEnergyLaw
+
+ +
+
+

Private Types

+
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+ +
+
+template<class Solver>
class SolutionTimeErrorSolverWrapper : public Opm::RelativeChangeInterface
+
+

Public Functions

+
+
+explicit SolutionTimeErrorSolverWrapper(const Solver &solver)
+
+ +
+
+double relativeChange() const
+
+ +
+
+

Private Members

+
+
+const Solver &solver_
+
+ +
+
+ +
+
+template<class Operator, template<class> class UnderlyingSolver, class X>
class SolverAdapter : public Dune::IterativeSolver<X, X>
+
+#include <SolverAdapter.hpp>
+

Wraps a CUDA solver to work with CPU data.

+
+
Template Parameters:
+
    +
  • Operator – the Dune::LinearOperator to use

  • +
  • UnderlyingSolver – a Dune solver like class, eg Dune::BiCGSTABSolver

  • +
  • X – the outer type to use (eg. Dune::BlockVector<Dune::FieldVector<…>>)

  • +
+
+
+
+

Public Types

+
+
+using XGPU = Opm::gpuistl::GpuVector<real_type>
+
+ +
+
+

Public Functions

+
+
+template<class Comm>
inline SolverAdapter(Operator &op, Dune::ScalarProduct<X> &sp, std::shared_ptr<Dune::Preconditioner<X, X>> prec, scalar_real_type reduction, int maxit, int verbose, const Comm &comm)
+

constructor

+

+
+Todo:
+

Use a std::forward in this function

+
+ +

+
+
Parameters:
+
    +
  • op – the linear operator (assumed CPU, the output (matrix) of which will be converted to a GPU variant)

  • +
  • sp – the scalar product (assumed CPU, this will be converted to a GPU variant)

  • +
  • reduction – the reduction factor passed to the iterative solver

  • +
  • maxit – maximum number of iterations for the linear solver

  • +
  • verbose – verbosity level

  • +
  • comm – the communication object. If this is Dune::Amg::SequentialInformation, we assume a serial setup

  • +
+
+
+
+ +
+
+inline virtual void apply(X &x, X &b, double reduction, Dune::InverseOperatorResult &res) override
+
+ +
+
+inline virtual void apply(X &x, X &b, Dune::InverseOperatorResult &res) override
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr auto block_size = domain_type::block_type::dimension
+
+ +
+
+

Private Functions

+
+
+inline UnderlyingSolver<XGPU> constructSolver(std::shared_ptr<Dune::Preconditioner<X, X>> prec, scalar_real_type reduction, int maxit, int verbose, const Dune::Amg::SequentialInformation &communication)
+
+ +
+
+inline UnderlyingSolver<XGPU> constructSolver(std::shared_ptr<Dune::Preconditioner<X, X>> prec, scalar_real_type reduction, int maxit, int verbose)
+
+ +
+
+

Private Members

+
+
+Operator &m_opOnCPUWithMatrix
+
+ +
+
+GpuSparseMatrix<real_type> m_matrix
+
+ +
+
+UnderlyingSolver<XGPU> m_underlyingSolver
+
+ +
+
+std::unique_ptr<XGPU> m_inputBuffer
+
+ +
+
+std::unique_ptr<XGPU> m_outputBuffer
+
+ +
+
+ +
+
+struct SolverContinueOnConvergenceFailure
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+template<class Scalar>
struct SolverGrowthFactor
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 2.0
+
+ +
+
+ +
+
+template<class Scalar>
struct SolverMaxGrowth
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 3.0
+
+ +
+
+ +
+
+struct SolverMaxRestarts
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 10
+
+ +
+
+ +
+
+template<class Scalar>
struct SolverMaxTimeStepInDays
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 365.0
+
+ +
+
+ +
+
+template<class Scalar>
struct SolverMinTimeStep
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-12
+
+ +
+
+ +
+
+template<class Scalar>
struct SolverRestartFactor
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.33
+
+ +
+
+ +
+
+struct SolverVerbosity
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 1
+
+ +
+
+ +
+
+struct SolveWelleqInitially
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<typename Scalar>
class SOmin_GO : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that minimum oil saturation in gas/oil system is in valid range

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar swl_ = {}
+

Minimum (connate) water saturation in gas/oil system.

+
+ +
+
+Scalar sgu_ = {}
+

Maximum gas saturation in gas/oil system.

+
+ +
+
+ +
+
+template<typename Scalar>
class SOmin_OW : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that minimum oil saturation in oil/water system is in valid range

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar sgl_ = {}
+

Minimum gas saturation. Typically zero.

+
+ +
+
+Scalar swu_ = {}
+

Minimum (connate) saturation.

+
+ +
+
+ +
+
+template<class TypeTag>
struct SparseMatrixAdapter<TypeTag, TTag::FlowIstlSolver>
+
+#include <ISTLSolver.hpp>
+

Set the type of a global jacobian matrix for linear solvers that are based on dune-istl.

+
+

Public Types

+
+
+using type = typename Linear::IstlSparseMatrixAdapter<Block>
+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numEq
+
+ +
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Block = MatrixBlock<Scalar, numEq, numEq>
+
+ +
+
+ +
+
+template<class T>
class SparseTable
+
+ +
+
+template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Types

+
+
+using type = TTag::EcfvDiscretization
+
+ +
+
+ +
+
+template<class Operator, class Comm, typename = void>
struct StandardPreconditioners
+
+
+

Public Static Functions

+
+
+static inline void add()
+
+ +
+
+static inline PreconditionerFactory<Operator, Comm>::PrecPtr createParILU(const Operator &op, const PropertyTree &prm, const Comm &comm, const int ilulevel)
+
+ +
+
+static inline std::size_t interiorIfGhostLast(const Comm &comm)
+

Helper method to determine if the local partitioning has the K interior cells from [0, K-1] and ghost cells from [K, N-1]. Returns K if true, otherwise returns N. This is motivated by usage in the ParallelOverlappingILU0 preconditioner.

+
+ +
+
+ +
+
+template<class Operator, class Comm>
struct StandardPreconditioners<Operator, Comm, typename std::enable_if_t<Opm::is_gpu_operator_v<Operator>>>
+
+
+

Public Static Functions

+
+
+static inline void add()
+
+ +
+
+ +
+
+template<class Operator>
struct StandardPreconditioners<Operator, Dune::Amg::SequentialInformation, typename std::enable_if_t<Opm::is_gpu_operator_v<Operator>>>
+
+
+

Public Types

+
+
+using O = Operator
+
+ +
+
+using C = Dune::Amg::SequentialInformation
+
+ +
+
+using F = PreconditionerFactory<O, C>
+
+ +
+
+using M = typename F::Matrix
+
+ +
+
+using V = typename F::Vector
+
+ +
+
+using P = PropertyTree
+
+ +
+
+using PrecPtr = typename F::PrecPtr
+
+ +
+
+using field_type = typename V::field_type
+
+ +
+
+

Public Static Functions

+
+
+static inline void add()
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int maxblocksize = 6
+
+ +
+
+

Private Static Functions

+
+
+template<class BlockType>
static inline Dune::BCRSMatrix<BlockType> makeCPUMatrix(const O &op)
+

This function creates a CPU matrix from the operator holding a GPU matrix.

+

This is a workaround for now since some of the GPU preconditioners need a CPU matrix for the intial setup (graph coloring). The CPU matrix is only used in the constructor, not in the update function or the apply function.

+
+ +
+
+template<int blocksizeCompileTime, class CreateType>
static inline PrecPtr dispatchOnBlockSize(const O &op, CreateType create)
+

This function dispatches the creation of the preconditioner based on the block size.

+

Note that this is needed since the GPU operators/matrices do not hold the block size compile time.

+

Also note that this function is not expected to be used in the future, since we will have a GPU constructor for the preconditioners (DILU and OPMILU0), hence removing the need for a CPU matrix and for this function.

+
+ +
+
+ +
+
+template<class Operator>
struct StandardPreconditioners<Operator, Dune::Amg::SequentialInformation, typename std::enable_if_t<!Opm::is_gpu_operator_v<Operator>>>
+
+
+

Public Static Functions

+
+
+static inline void add()
+
+ +
+
+ +
+
+template<typename TypeTag>
class StandardWell : public Opm::WellInterface<TypeTag>, public Opm::StandardWellEval<GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::Indices>>
+
+#include <StandardWell.hpp>
+
+

Public Types

+
+
+using Base = WellInterface<TypeTag>
+
+ +
+
+using StdWellEval = StandardWellEval<GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::Indices>>
+
+ +
+
+using PolymerModule = BlackOilPolymerModule<TypeTag>
+
+ +
+
+using FoamModule = BlackOilFoamModule<TypeTag>
+
+ +
+
+using Eval = typename StdWellEval::Eval
+
+ +
+
+using EvalWell = typename StdWellEval::EvalWell
+
+ +
+
+using BVectorWell = typename StdWellEval::BVectorWell
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using ModelParameters = typename Base::ModelParameters
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using RateConverterType = typename WellInterfaceFluidSystem<FluidSystem>::RateConverterType
+
+ +
+
+using SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>
+
+ +
+
+FluidState = BlackOilFluidState< Eval, FluidSystem, has_temperature, has_energy, Indices::compositionSwitchIdx >=0, has_watVapor, has_brine, has_saltPrecip, has_disgas_in_water, Indices::numPhases >
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+using PressureMatrix = Dune::BCRSMatrix<Opm::MatrixBlock<Scalar, 1, 1>>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using BVector = Dune::BlockVector<VectorBlockType>
+
+ +
+
+

Public Functions

+
+
+StandardWell(const Well &well, const ParallelWellInfo<Scalar> &pw_info, const int time_step, const ModelParameters &param, const RateConverterType &rate_converter, const int pvtRegionIdx, const int num_components, const int num_phases, const int index_of_well, const std::vector<PerforationData<Scalar>> &perf_data)
+
+ +
+
+virtual void init(const PhaseUsage *phase_usage_arg, const std::vector<Scalar> &depth_arg, const Scalar gravity_arg, const std::vector<Scalar> &B_avg, const bool changed_to_open_this_step) override
+
+ +
+
+virtual ConvergenceReport getWellConvergence(const Simulator &simulator, const WellState<Scalar> &well_state, const std::vector<Scalar> &B_avg, DeferredLogger &deferred_logger, const bool relax_tolerance) const override
+

check whether the well equations get converged for this well

+
+ +
+
+virtual void apply(const BVector &x, BVector &Ax) const override
+

Ax = Ax - C D^-1 B x.

+
+ +
+
+virtual void apply(BVector &r) const override
+

r = r - C D^-1 Rw

+
+ +
+
+void recoverWellSolutionAndUpdateWellState(const Simulator &simulator, const BVector &x, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+

using the solution x to recover the solution xw for wells and applying xw to update Well State

+
+ +
+
+void computeWellPotentials(const Simulator &simulator, const WellState<Scalar> &well_state, std::vector<Scalar> &well_potentials, DeferredLogger &deferred_logger) override
+

computing the well potentials for group control

+
+ +
+
+void updatePrimaryVariables(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+
+ +
+
+void solveEqAndUpdateWellState(const Simulator &simulator, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+
+ +
+
+void calculateExplicitQuantities(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+
+ +
+
+void updateProductivityIndex(const Simulator &simulator, const WellProdIndexCalculator<Scalar> &wellPICalc, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) const override
+
+ +
+
+virtual Scalar connectionDensity(const int globalConnIdx, const int openConnIdx) const override
+
+ +
+
+virtual void addWellContributions(SparseMatrixAdapter &mat) const override
+
+ +
+
+void addWellPressureEquations(PressureMatrix &mat, const BVector &x, const int pressureVarIndex, const bool use_well_weights, const WellState<Scalar> &well_state) const override
+
+ +
+
+bool iterateWellEqWithControl(const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger) override
+
+ +
+
+bool iterateWellEqWithSwitching(const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger, const bool fixed_control = false, const bool fixed_status = false) override
+
+ +
+
+Scalar computeWellRatesAndBhpWithThpAlqProd(const Simulator &ebos_simulator, const SummaryState &summary_state, DeferredLogger &deferred_logger, std::vector<Scalar> &potentials, Scalar alq) const
+
+ +
+
+void computeWellRatesWithThpAlqProd(const Simulator &ebos_simulator, const SummaryState &summary_state, DeferredLogger &deferred_logger, std::vector<Scalar> &potentials, Scalar alq) const
+
+ +
+
+std::optional<Scalar> computeBhpAtThpLimitProdWithAlq(const Simulator &ebos_simulator, const SummaryState &summary_state, const Scalar alq_value, DeferredLogger &deferred_logger, bool iterate_if_no_solution) const override
+
+ +
+
+void updateIPRImplicit(const Simulator &simulator, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+
+ +
+
+void computeWellRatesWithBhp(const Simulator &ebosSimulator, const Scalar &bhp, std::vector<Scalar> &well_flux, DeferredLogger &deferred_logger) const override
+
+ +
+
+virtual std::vector<Scalar> computeCurrentWellRates(const Simulator &ebosSimulator, DeferredLogger &deferred_logger) const override
+

Compute well rates based on current reservoir conditions and well variables. Used in updateWellStateRates().

+
+ +
+
+virtual std::vector<Scalar> getPrimaryVars() const override
+
+ +
+
+int setPrimaryVars(typename std::vector<Scalar>::const_iterator it) override
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numWellConservationEq = Indices::numPhases + Indices::numSolvents
+
+ +
+
+static constexpr int numWellControlEq = 1
+
+ +
+
+static constexpr int numStaticWellEq = numWellConservationEq + numWellControlEq
+
+ +
+
+static constexpr int Bhp = numStaticWellEq - numWellControlEq
+
+ +
+
+static constexpr bool has_solvent
+
+ +
+
+static constexpr bool has_zFraction
+
+ +
+
+static constexpr bool has_polymer
+
+ +
+
+static constexpr bool has_polymermw
+
+ +
+
+static constexpr bool has_foam
+
+ +
+
+static constexpr bool has_brine
+
+ +
+
+static constexpr bool has_energy
+
+ +
+
+static constexpr bool has_micp
+
+ +
+
+

Protected Types

+
+
+using WellConnectionProps = typename StdWellEval::StdWellConnections::Properties
+
+ +
+
+

Protected Functions

+
+
+void updateWellState(const Simulator &simulator, const BVectorWell &dwells, WellState<Scalar> &well_state, DeferredLogger &deferred_logger)
+
+ +
+
+WellConnectionProps computePropertiesForWellConnectionPressures(const Simulator &simulator, const WellState<Scalar> &well_state) const
+
+ +
+
+void computeWellConnectionDensitesPressures(const Simulator &simulator, const WellState<Scalar> &well_state, const WellConnectionProps &props, DeferredLogger &deferred_logger)
+
+ +
+
+void computeWellConnectionPressures(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger)
+
+ +
+
+template<class Value>
void computePerfRate(const IntensiveQuantities &intQuants, const std::vector<Value> &mob, const Value &bhp, const std::vector<Scalar> &Tw, const int perf, const bool allow_cf, std::vector<Value> &cq_s, PerforationRates<Scalar> &perf_rates, DeferredLogger &deferred_logger) const
+
+ +
+
+template<class Value>
void computePerfRate(const std::vector<Value> &mob, const Value &pressure, const Value &bhp, const Value &rs, const Value &rv, const Value &rvw, const Value &rsw, std::vector<Value> &b_perfcells_dense, const std::vector<Scalar> &Tw, const int perf, const bool allow_cf, const Value &skin_pressure, const std::vector<Value> &cmix_s, std::vector<Value> &cq_s, PerforationRates<Scalar> &perf_rates, DeferredLogger &deferred_logger) const
+
+ +
+
+void computeWellRatesWithBhpIterations(const Simulator &ebosSimulator, const Scalar &bhp, std::vector<Scalar> &well_flux, DeferredLogger &deferred_logger) const override
+
+ +
+
+std::vector<Scalar> computeWellPotentialWithTHP(const Simulator &ebosSimulator, DeferredLogger &deferred_logger, const WellState<Scalar> &well_state) const
+
+ +
+
+bool computeWellPotentialsImplicit(const Simulator &ebos_simulator, const WellState<Scalar> &well_state, std::vector<Scalar> &well_potentials, DeferredLogger &deferred_logger) const
+
+ +
+
+virtual Scalar getRefDensity() const override
+
+ +
+
+template<class Value>
void getMobility(const Simulator &simulator, const int perf, std::vector<Value> &mob, DeferredLogger &deferred_logger) const
+
+ +
+
+void updateWaterMobilityWithPolymer(const Simulator &simulator, const int perf, std::vector<EvalWell> &mob_water, DeferredLogger &deferred_logger) const
+
+ +
+
+void updatePrimaryVariablesNewton(const BVectorWell &dwells, const bool stop_or_zero_rate_target, DeferredLogger &deferred_logger)
+
+ +
+
+void updateWellStateFromPrimaryVariables(WellState<Scalar> &well_state, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
+
+ +
+
+void assembleWellEqWithoutIteration(const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger) override
+
+ +
+
+void assembleWellEqWithoutIterationImpl(const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger)
+
+ +
+
+void calculateSinglePerf(const Simulator &simulator, const int perf, WellState<Scalar> &well_state, std::vector<RateVector> &connectionRates, std::vector<EvalWell> &cq_s, EvalWell &water_flux_s, EvalWell &cq_s_zfrac_effective, DeferredLogger &deferred_logger) const
+
+ +
+
+void checkOperabilityUnderBHPLimit(const WellState<Scalar> &well_state, const Simulator &simulator, DeferredLogger &deferred_logger) override
+
+ +
+
+void checkOperabilityUnderTHPLimit(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger) override
+
+ +
+
+virtual void updateIPR(const Simulator &simulator, DeferredLogger &deferred_logger) const override
+
+ +
+
+bool allDrawDownWrongDirection(const Simulator &simulator) const
+
+ +
+
+bool openCrossFlowAvoidSingularity(const Simulator &simulator) const
+
+ +
+
+EvalWell pskin(const Scalar throughput, const EvalWell &water_velocity, const EvalWell &poly_inj_conc, DeferredLogger &deferred_logger) const
+
+ +
+
+EvalWell pskinwater(const Scalar throughput, const EvalWell &water_velocity, DeferredLogger &deferred_logger) const
+
+ +
+
+EvalWell wpolymermw(const Scalar throughput, const EvalWell &water_velocity, DeferredLogger &deferred_logger) const
+
+ +
+
+void handleInjectivityRate(const Simulator &simulator, const int perf, std::vector<EvalWell> &cq_s) const
+
+ +
+
+void handleInjectivityEquations(const Simulator &simulator, const WellState<Scalar> &well_state, const int perf, const EvalWell &water_flux_s, DeferredLogger &deferred_logger)
+
+ +
+
+void updateWaterThroughput(const double dt, WellState<Scalar> &well_state) const override
+
+ +
+
+void checkConvergenceExtraEqs(const std::vector<Scalar> &res, ConvergenceReport &report) const
+
+ +
+
+void updateConnectionRatePolyMW(const EvalWell &cq_s_poly, const IntensiveQuantities &int_quants, const WellState<Scalar> &well_state, const int perf, std::vector<RateVector> &connectionRates, DeferredLogger &deferred_logger) const
+
+ +
+
+std::optional<Scalar> computeBhpAtThpLimitProd(const WellState<Scalar> &well_state, const Simulator &simulator, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
+
+ +
+
+std::optional<Scalar> computeBhpAtThpLimitInj(const Simulator &simulator, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
+
+ +
+
+

Protected Attributes

+
+
+bool regularize_
+
+ +
+
+

Private Functions

+
+
+Eval connectionRateEnergy(const Scalar maxOilSaturation, const std::vector<EvalWell> &cq_s, const IntensiveQuantities &intQuants, DeferredLogger &deferred_logger) const
+
+ +
+
+ +
+
+template<class FluidSystem, class Indices>
class StandardWellAssemble
+
+

Class handling assemble of the equation system for StandardWell.

+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using PrimaryVariables = StandardWellPrimaryVariables<FluidSystem, Indices>
+
+ +
+
+using EvalWell = typename PrimaryVariables::EvalWell
+
+ +
+
+

Public Functions

+
+
+inline explicit StandardWellAssemble(const WellInterfaceFluidSystem<FluidSystem> &well)
+

Constructor initializes reference to well.

+
+ +
+
+void assembleControlEq(const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const PrimaryVariables &primary_variables, const Scalar rho, StandardWellEquations<Scalar, Indices::numEq> &eqns, const bool stopped_or_zero_target, DeferredLogger &deferred_logger) const
+

Assemble control equation.

+
+ +
+
+void assembleInjectivityEq(const EvalWell &eq_pskin, const EvalWell &eq_wat_vel, const int pskin_index, const int wat_vel_index, const int cell_idx, const int numWellEq, StandardWellEquations<Scalar, Indices::numEq> &eqns) const
+

Assemble injectivity equation.

+
+ +
+
+void assemblePerforationEq(const EvalWell &cq_s_effective, const int componentIdx, const int cell_idx, const int numWellEq, StandardWellEquations<Scalar, Indices::numEq> &eqns) const
+

Assemble equation for a perforation.

+
+ +
+
+void assembleZFracEq(const EvalWell &cq_s_zfrac_effective, const int cell_idx, const int numWellEq, StandardWellEquations<Scalar, Indices::numEq> &eqns) const
+

Assemble equation for Z fraction.

+
+ +
+
+void assembleSourceEq(const EvalWell &resWell_loc, const int componentIdx, const int numWellEq, StandardWellEquations<Scalar, Indices::numEq> &eqns) const
+

Assemble a source term.

+
+ +
+
+

Private Members

+
+
+const WellInterfaceFluidSystem<FluidSystem> &well_
+

Reference to well.

+
+ +
+
+ +
+
+template<class FluidSystem, class Indices>
class StandardWellConnections
+
+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using Eval = typename WellInterfaceIndices<FluidSystem, Indices>::Eval
+
+ +
+
+using EvalWell = typename StandardWellPrimaryVariables<FluidSystem, Indices>::EvalWell
+
+ +
+
+

Public Functions

+
+
+explicit StandardWellConnections(const WellInterfaceIndices<FluidSystem, Indices> &well)
+
+ +
+
+Properties computePropertiesForPressures(const WellState<Scalar> &well_state, const PressurePropertyFunctions &propFunc) const
+
+ +
+
+void computeProperties(const bool stop_or_zero_rate_target, const WellState<Scalar> &well_state, const DensityPropertyFunctions &prop_func, const Properties &props, DeferredLogger &deferred_logger)
+

Compute connection properties (densities, pressure drop, …)

+
+ +
+
+inline Scalar rho() const
+

Returns density for first perforation.

+
+ +
+
+inline Scalar rho(const typename std::vector<Scalar>::size_type i) const
+

Returns density for specific perforation/connection.

+
+
Parameters:
+

i[in] Connection index

+
+
Returns:
+

Mixture density at connection i.

+
+
+
+ +
+
+inline Scalar pressure_diff(const unsigned perf) const
+

Returns pressure drop for a given perforation.

+
+ +
+
+Eval connectionRateBrine(Scalar &rate, const Scalar vap_wat_rate, const std::vector<EvalWell> &cq_s, const std::variant<Scalar, EvalWell> &saltConcentration) const
+
+ +
+
+Eval connectionRateFoam(const std::vector<EvalWell> &cq_s, const std::variant<Scalar, EvalWell> &foamConcentration, const Phase transportPhase, DeferredLogger &deferred_logger) const
+
+ +
+
+std::tuple<Eval, EvalWell> connectionRatePolymer(Scalar &rate, const std::vector<EvalWell> &cq_s, const std::variant<Scalar, EvalWell> &polymerConcentration) const
+
+ +
+
+std::tuple<Eval, Eval, Eval> connectionRatesMICP(Scalar &rate_m, Scalar &rate_o, Scalar &rate_u, const std::vector<EvalWell> &cq_s, const std::variant<Scalar, EvalWell> &microbialConcentration, const std::variant<Scalar, EvalWell> &oxygenConcentration, const std::variant<Scalar, EvalWell> &ureaConcentration) const
+
+ +
+
+std::tuple<Eval, EvalWell> connectionRatezFraction(Scalar &rate, const Scalar dis_gas_rate, const std::vector<EvalWell> &cq_s, const std::variant<Scalar, std::array<EvalWell, 2>> &solventConcentration) const
+
+ +
+
+

Private Functions

+
+
+void computePressureDelta()
+
+ +
+
+void computeDensities(const std::vector<Scalar> &perfComponentRates, const Properties &props, DeferredLogger &deferred_logger)
+
+ +
+
+void computeDensitiesForStoppedProducer(const DensityPropertyFunctions &prop_func)
+
+ +
+
+std::vector<Scalar> calculatePerforationOutflow(const std::vector<Scalar> &perfComponentRates) const
+
+ +
+
+void initialiseConnectionMixture(const int num_comp, const int perf, const std::vector<Scalar> &q_out_perf, const std::vector<Scalar> &currentMixture, std::vector<Scalar> &previousMixture) const
+
+ +
+
+std::vector<Scalar> copyInPerforationRates(const Properties &props, const PerfData<Scalar> &perf_data) const
+
+ +
+
+

Private Members

+
+
+const WellInterfaceIndices<FluidSystem, Indices> &well_
+

Reference to well interface.

+
+ +
+
+std::vector<Scalar> perf_densities_
+

densities of the fluid in each perforation

+
+ +
+
+std::vector<Scalar> perf_pressure_diffs_
+

// pressure drop between different perforations

+
+ +
+
+ +
+
+template<class Scalar, int numEq>
class StandardWellEquationAccess
+

Class administering assembler access to equation system.

+
+

Public Types

+
+
+using BVectorWell = typename StandardWellEquations<Scalar, numEq>::BVectorWell
+
+ +
+
+using DiagMatWell = typename StandardWellEquations<Scalar, numEq>::DiagMatWell
+
+ +
+
+using OffDiatMatWell = typename StandardWellEquations<Scalar, numEq>::OffDiagMatWell
+
+ +
+
+

Public Functions

+
+
+inline explicit StandardWellEquationAccess(StandardWellEquations<Scalar, numEq> &eqns)
+

Constructor initializes reference to the equation system.

+
+ +
+
+inline BVectorWell &residual()
+

Returns a reference to residual vector.

+
+ +
+
+inline OffDiatMatWell &B()
+

Returns a reference to B matrix.

+
+ +
+
+inline OffDiatMatWell &C()
+

Returns a reference to C matrix.

+
+ +
+
+inline DiagMatWell &D()
+

Returns a reference to D matrix.

+
+ +
+
+

Private Members

+
+
+StandardWellEquations<Scalar, numEq> &eqns_
+

Reference to equation system.

+
+ +
+
+ +
+
+template<class Scalar, int numEq>
class StandardWellEquations
+
+
+

Public Types

+
+
+using VectorBlockWellType = Dune::DynamicVector<Scalar>
+
+ +
+
+using BVectorWell = Dune::BlockVector<VectorBlockWellType>
+
+ +
+
+using DiagMatrixBlockWellType = Dune::DynamicMatrix<Scalar>
+
+ +
+
+using DiagMatWell = Dune::BCRSMatrix<DiagMatrixBlockWellType>
+
+ +
+
+using OffDiagMatrixBlockWellType = Dune::DynamicMatrix<Scalar>
+
+ +
+
+using OffDiagMatWell = Dune::BCRSMatrix<OffDiagMatrixBlockWellType>
+
+ +
+
+using BVector = Dune::BlockVector<Dune::FieldVector<Scalar, numEq>>
+
+ +
+
+

Public Functions

+
+
+explicit StandardWellEquations(const ParallelWellInfo<Scalar> &parallel_well_info)
+
+ +
+
+void init(const int numWellEq, const int numPerfs, const std::vector<int> &cells)
+

Setup sparsity pattern for the matrices.

+
+
Parameters:
+
    +
  • numWellEq – Number of well equations

  • +
  • numPerfs – Number of perforations

  • +
  • cells – Cell indices for perforations

  • +
+
+
+
+ +
+
+void clear()
+

Set all coefficients to 0.

+
+ +
+
+void apply(const BVector &x, BVector &Ax) const
+

Apply linear operator to vector.

+
+ +
+
+void apply(BVector &r) const
+

Apply linear operator to vector.

+
+ +
+
+void solve(BVectorWell &dx_well) const
+

Apply inverted D matrix to residual and store in vector.

+
+ +
+
+void solve(const BVectorWell &rhs_well, BVectorWell &x_well) const
+

Apply inverted D matrix to rhs and store in vector.

+
+ +
+
+void invert()
+

Invert D matrix.

+
+ +
+
+void recoverSolutionWell(const BVector &x, BVectorWell &xw) const
+

Recover well solution.

+

xw = inv(D)*(rw - C*x)

+
+ +
+
+template<class SparseMatrixAdapter>
void extract(SparseMatrixAdapter &jacobian) const
+

Add the matrices of this well to the sparse matrix adapter.

+
+ +
+
+template<class PressureMatrix>
void extractCPRPressureMatrix(PressureMatrix &jacobian, const BVector &weights, const int pressureVarIndex, const bool use_well_weights, const WellInterfaceGeneric<Scalar> &well, const int bhp_var_index, const WellState<Scalar> &well_state) const
+

Extract CPR pressure matrix.

+
+ +
+
+unsigned int getNumBlocks() const
+

Get the number of blocks of the C and B matrices.

+
+ +
+
+void sumDistributed(Parallel::Communication comm)
+

Sum with off-process contribution.

+
+ +
+
+inline const BVectorWell &residual() const
+

Returns a const reference to the residual.

+
+ +
+
+

Private Members

+
+
+OffDiagMatWell duneB_
+
+ +
+
+OffDiagMatWell duneC_
+
+ +
+
+DiagMatWell invDuneD_
+
+ +
+
+DiagMatWell duneD_
+
+ +
+
+wellhelpers::ParallelStandardWellB<Scalar> parallelB_
+
+ +
+
+BVectorWell resWell_
+
+ +
+
+mutable BVectorWell Bx_
+
+ +
+
+mutable BVectorWell invDrw_
+
+ +
+
+std::vector<int> cells_
+
+ +
+
+

Friends

+
+
+friend class StandardWellEquationAccess< Scalar, numEq >
+
+ +
+
+ +
+
+template<class FluidSystem, class Indices>
class StandardWellEval
+
+
+

Public Types

+
+
+using EvalWell = typename PrimaryVariables::EvalWell
+
+ +
+
+using Eval = DenseAd::Evaluation<Scalar, Indices::numEq>
+
+ +
+
+using BVectorWell = typename StandardWellEquations<Scalar, Indices::numEq>::BVectorWell
+
+ +
+
+

Public Functions

+
+
+inline const StandardWellEquations<Scalar, Indices::numEq> &linSys() const
+

Returns a const reference to equation system.

+
+ +
+
+

Protected Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using PrimaryVariables = StandardWellPrimaryVariables<FluidSystem, Indices>
+
+ +
+
+using StdWellConnections = StandardWellConnections<FluidSystem, Indices>
+
+ +
+
+

Protected Functions

+
+
+explicit StandardWellEval(const WellInterfaceIndices<FluidSystem, Indices> &baseif)
+
+ +
+
+EvalWell extendEval(const Eval &in) const
+
+ +
+
+void computeAccumWell()
+
+ +
+
+ConvergenceReport getWellConvergence(const WellState<Scalar> &well_state, const std::vector<Scalar> &B_avg, const Scalar maxResidualAllowed, const Scalar tol_wells, const Scalar relaxed_tolerance_flow, const bool relax_tolerance, const bool well_is_stopped, std::vector<Scalar> &res, DeferredLogger &deferred_logger) const
+
+ +
+
+void init(std::vector<Scalar> &perf_depth, const std::vector<Scalar> &depth_arg, const bool has_polymermw)
+
+ +
+
+void updateWellStateFromPrimaryVariables(WellState<Scalar> &well_state, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
+
+ +
+
+

Protected Attributes

+
+
+const WellInterfaceIndices<FluidSystem, Indices> &baseif_
+
+ +
+
+PrimaryVariables primary_variables_
+

Primary variables for well.

+
+ +
+
+std::vector<Scalar> F0_
+
+ +
+
+StandardWellEquations<Scalar, Indices::numEq> linSys_
+

Linear equation system.

+
+ +
+
+StdWellConnections connections_
+

Connection level values.

+
+ +
+
+

Protected Static Attributes

+
+
+static constexpr int Bhp = PrimaryVariables::Bhp
+
+ +
+
+static constexpr int WQTotal = PrimaryVariables::WQTotal
+
+ +
+
+static constexpr int numWellConservationEq = PrimaryVariables::numWellConservationEq
+
+ +
+
+static constexpr bool has_wfrac_variable = PrimaryVariables::has_wfrac_variable
+
+ +
+
+static constexpr bool has_gfrac_variable = PrimaryVariables::has_gfrac_variable
+
+ +
+
+static constexpr int WFrac = PrimaryVariables::WFrac
+
+ +
+
+static constexpr int GFrac = PrimaryVariables::GFrac
+
+ +
+
+static constexpr int SFrac = PrimaryVariables::SFrac
+
+ +
+
+ +
+
+template<class FluidSystem, class Indices>
class StandardWellPrimaryVariables
+
+

Class holding primary variables for StandardWell.

+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using EvalWell = DenseAd::DynamicEvaluation<Scalar, numStaticWellEq + Indices::numEq + 1>
+

Evaluation for the well equations.

+
+ +
+
+using BVectorWell = typename StandardWellEquations<Scalar, Indices::numEq>::BVectorWell
+
+ +
+
+

Public Functions

+
+
+inline explicit StandardWellPrimaryVariables(const WellInterfaceIndices<FluidSystem, Indices> &well)
+

Constructor initializes reference to well interface.

+
+ +
+
+void resize(const int numWellEq)
+

Resize values and evaluations.

+
+ +
+
+inline int numWellEq() const
+

Returns number of well equations.

+
+ +
+
+void update(const WellState<Scalar> &well_state, const bool stop_or_zero_rate_target, DeferredLogger &deferred_logger)
+

Copy values from well state.

+
+ +
+
+void updatePolyMW(const WellState<Scalar> &well_state)
+

Copy polymer molecular weigt values from well state.

+
+ +
+
+void updateNewton(const BVectorWell &dwells, const bool stop_or_zero_rate_target, const Scalar dFLimit, const Scalar dBHPLimit, DeferredLogger &deferred_logger)
+

Update values from newton update vector.

+
+ +
+
+void updateNewtonPolyMW(const BVectorWell &dwells)
+

Update polymer molecular weight values from newton update vector.

+
+ +
+
+void checkFinite(DeferredLogger &deferred_logger) const
+

Check that all values are finite.

+
+ +
+
+void copyToWellState(WellState<Scalar> &well_state, DeferredLogger &deferred_logger) const
+

Copy values to well state.

+
+ +
+
+void copyToWellStatePolyMW(WellState<Scalar> &well_state) const
+

Copy polymer molecular weight values to well state.

+
+ +
+
+EvalWell volumeFractionScaled(const int compIdx) const
+

Returns scaled volume fraction for a component.

+
+ +
+
+EvalWell surfaceVolumeFraction(const int compIdx) const
+

Returns surface volume fraction for a component.

+
+ +
+
+EvalWell getQs(const int compIdx) const
+

Returns scaled rate for a component.

+
+ +
+
+inline Scalar value(const int idx) const
+

Returns a value.

+
+ +
+
+inline const EvalWell &eval(const int idx) const
+

Returns a const ref to an evaluation.

+
+ +
+
+inline void setValue(const int idx, const Scalar val)
+

Set a value. Note that this does not also set the corresponding evaluation.

+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numWellConservationEq = Indices::numPhases + Indices::numSolvents
+

Number of the conservation equations.

+
+ +
+
+static constexpr int numStaticWellEq = numWellConservationEq + numWellControlEq
+

Number of the well equations that will always be used.

+

Based on the solution strategy, there might be other well equations be introduced.

+
+ +
+
+static constexpr int WQTotal = 0
+

The index for the weighted total rate.

+
+ +
+
+static constexpr int Bhp = numStaticWellEq - numWellControlEq
+

The index for Bhp in primary variables and the index of well control equation.

+

They both will be the last one in their respective system.

+
+Todo:
+

: We should have indices for the well equations and well primary variables separately.

+
+ +

+
+ +
+
+static constexpr bool has_wfrac_variable = Indices::waterEnabled && Indices::oilEnabled
+
+ +
+
+static constexpr bool has_gfrac_variable = Indices::gasEnabled && Indices::numPhases > 1
+
+ +
+
+static constexpr int WFrac = has_wfrac_variable ? 1 : -1000
+
+ +
+
+static constexpr int GFrac = has_gfrac_variable ? has_wfrac_variable + 1 : -1000
+
+ +
+
+static constexpr int SFrac = !Indices::enableSolvent ? -1000 : has_wfrac_variable + has_gfrac_variable + 1
+
+ +
+
+

Protected Static Attributes

+
+
+static constexpr int numWellControlEq = 1
+

Number of the well control equations.

+
+ +
+
+

Private Functions

+
+
+void setEvaluationsFromValues()
+

Initialize evaluations from values.

+
+ +
+
+Scalar relaxationFactorFractionsProducer(const BVectorWell &dwells, DeferredLogger &deferred_logger) const
+

Calculate a relaxation factor for producers.

+

To avoid overshoot of the fractions which might result in negative rates.

+
+ +
+
+EvalWell volumeFraction(const int compIdx) const
+

Returns volume fraction for a component.

+
+ +
+
+void processFractions()
+

Handle non-reasonable fractions due to numerical overshoot.

+
+ +
+
+

Private Members

+
+
+std::vector<Scalar> value_
+

The values for the primary variables.

+

Based on different solution strategies, the wells can have different primary variables.

+
+ +
+
+std::vector<EvalWell> evaluation_
+

The Evaluation for the well primary variables.

+

Contain derivatives and are used in AD calculation

+
+ +
+
+const WellInterfaceIndices<FluidSystem, Indices> &well_
+

Reference to well interface.

+
+ +
+
+int numWellEq_ = numStaticWellEq
+

Total number of the well equations and primary variables.

+

There might be extra equations be used, numWellEq will be updated during the initialization

+
+ +
+
+ +
+
+template<class TypeTag>
struct Stencil<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Types

+
+
+using type = EcfvStencil<Scalar, GridView, false, false>
+
+ +
+
+

Private Types

+
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+ +
+
+struct StepReport
+
+
+

Public Members

+
+
+int report_step
+
+ +
+
+int current_step
+
+ +
+
+std::vector<ConvergenceReport> report
+
+ +
+
+ +
+
+struct StrictInnerIterWells
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 40
+
+ +
+
+ +
+
+struct StrictOuterIterWells
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 6
+
+ +
+
+ +
+
+template<class Grid>
struct SubDomain : public Opm::SubDomainIndices
+
+#include <SubDomain.hpp>
+

Representing a part of a grid, in a way suitable for performing local solves.

+
+

Public Functions

+
+
+inline SubDomain(const int i, std::vector<int> &&c, std::vector<bool> &&in, Dune::SubGridPart<Grid> &&v, bool s)
+
+ +
+
+

Public Members

+
+
+Dune::SubGridPart<Grid> view
+
+ +
+
+ +
+
+struct SubDomainIndices
+
+#include <SubDomain.hpp>
+

Representing a part of a grid, in a way suitable for performing local solves.

+

Subclassed by Opm::SubDomain< Grid >

+
+

Public Functions

+
+
+inline SubDomainIndices(const int i, std::vector<int> &&c, std::vector<bool> &&in, bool s)
+
+ +
+
+

Public Members

+
+
+int index
+
+ +
+
+std::vector<int> cells
+
+ +
+
+std::vector<bool> interior
+
+ +
+
+bool skip
+
+ +
+
+ +
+
+template<class Solver>
class SubStepIteration
+
+

Public Functions

+
+
+SubStepIteration(SubStepper<Solver> &substepper, AdaptiveSimulatorTimer &substep_timer, const double original_time_step, const bool final_step)
+
+ +
+
+SimulatorReport run()
+
+ +
+
+

Private Functions

+
+
+bool checkContinueOnUnconvergedSolution_(double dt) const
+
+ +
+
+void checkTimeStepMaxRestartLimit_(const int restarts) const
+
+ +
+
+void checkTimeStepMinLimit_(const double new_time_step) const
+
+ +
+
+void chopTimeStep_(const double new_time_step)
+
+ +
+
+bool chopTimeStepOrCloseFailingWells_(const double new_time_step)
+
+ +
+
+boost::posix_time::ptime currentDateTime_() const
+
+ +
+
+int getNumIterations_(const SimulatorReportSingle &substep_report) const
+
+ +
+
+double growthFactor_() const
+
+ +
+
+bool ignoreConvergenceFailure_() const
+
+ +
+
+void maybeReportSubStep_(SimulatorReportSingle substep_report) const
+
+ +
+
+double maybeRestrictTimeStepGrowth_(const double dt, double dt_estimate, const int restarts) const
+
+ +
+
+void maybeUpdateTuningAndTimeStep_()
+
+ +
+
+double maxGrowth_() const
+
+ +
+
+double minTimeStepBeforeClosingWells_() const
+
+ +
+
+double minTimeStep_() const
+
+ +
+
+double restartFactor_() const
+
+ +
+
+SimulatorReportSingle runSubStep_()
+
+ +
+
+int solverRestartMax_() const
+
+ +
+
+double suggestedNextTimestep_() const
+
+ +
+
+void setSuggestedNextStep_(double step)
+
+ +
+
+void setTimeStep_(double dt_estimate)
+
+ +
+
+Solver &solver_() const
+
+ +
+
+bool solverVerbose_() const
+
+ +
+
+const SimulatorTimer &simulatorTimer_() const
+
+ +
+
+boost::posix_time::ptime startDateTime_() const
+
+ +
+
+double timeStepControlComputeEstimate_(const double dt, const int iterations, const AdaptiveSimulatorTimer &substepTimer) const
+
+ +
+
+bool timeStepVerbose_() const
+
+ +
+
+void updateSuggestedNextStep_()
+
+ +
+
+bool useNewtonIteration_() const
+
+ +
+
+double writeOutput_() const
+
+ +
+
+

Private Members

+
+
+SubStepper<Solver> &substepper_
+
+ +
+
+AdaptiveSimulatorTimer &substep_timer_
+
+ +
+
+const double original_time_step_
+
+ +
+
+const bool final_step_
+
+ +
+
+std::string cause_of_failure_
+
+ +
+
+AdaptiveTimeStepping<TypeTag> &adaptive_time_stepping_
+
+ +
+
+ +
+
+template<class Solver>
class SubStepper
+
+

Public Functions

+
+
+SubStepper(AdaptiveTimeStepping<TypeTag> &adaptive_time_stepping, const SimulatorTimer &simulator_timer, Solver &solver, const bool is_event, const TuningUpdateCallback &tuning_updater)
+
+ +
+
+AdaptiveTimeStepping<TypeTag> &getAdaptiveTimerStepper()
+
+ +
+
+SimulatorReport run()
+
+ +
+
+

Private Functions

+
+
+bool isReservoirCouplingMaster_() const
+
+ +
+
+bool isReservoirCouplingSlave_() const
+
+ +
+
+void maybeModifySuggestedTimeStepAtBeginningOfReportStep_(const double originalTimeStep)
+
+ +
+
+bool maybeUpdateTuning_(double elapsed, double dt, int sub_step_number) const
+
+ +
+
+double maxTimeStep_() const
+
+ +
+
+SimulatorReport runStepOriginal_()
+
+ +
+
+double suggestedNextTimestep_() const
+
+ +
+
+

Private Members

+
+
+AdaptiveTimeStepping<TypeTag> &adaptive_time_stepping_
+
+ +
+
+const SimulatorTimer &simulator_timer_
+
+ +
+
+Solver &solver_
+
+ +
+
+const bool is_event_
+
+ +
+
+const TuningUpdateCallback &tuning_updater_
+
+ +
+
+

Friends

+
+
+friend class SubStepIteration< Solver >
+
+ +
+
+ +
+
+struct subsystemStructure
+

Struct that holds the structure of the small subsystems for each column.

+
+

Public Members

+
+
+std::vector<int> subsystemPointers
+

This vector holds the cumulative sum for the number of non-zero blocks for each subsystem. Works similarly to row and column pointers for the CSR and CSC matrix representations.

+
+ +
+
+std::vector<int> nzIndices
+

This vector holds the indices of the non-zero blocks for the target subsystem. These blocks are the ones that are present in the shadow set of the non-zero blocks of column j of the main matrix, as described in section 2.3 of the paper. The amount of non-zero blocks for j-th subsystem is given by subsystemPointers[j+1] - subsystemPointers[j].

+
+ +
+
+std::vector<int> knownRhsIndices
+

This vector holds the indices of the already known values of the right hand sides of the subsystems. Its purpose is to aid in the parallel solution of the subsystems.

+
+ +
+
+std::vector<int> unknownRhsIndices
+

This vector holds the indices of the unknown values of the right hand sides of the subsystems.

+
+ +
+
+ +
+
+struct subsystemStructureGPU
+

GPU version of subsystemStructure.

+
+

Public Members

+
+
+cl::Buffer subsystemPointers
+
+ +
+
+cl::Buffer nzIndices
+
+ +
+
+cl::Buffer knownRhsIndices
+
+ +
+
+cl::Buffer unknownRhsIndices
+
+ +
+
+ +
+
+template<typename T>
struct SupportedKeywordProperties
+
+
+

Public Members

+
+
+bool critical
+
+ +
+
+std::function<bool(T)> validator
+
+ +
+
+std::optional<std::string> message
+
+ +
+
+ +
+
+struct SupportedKeywords
+
+
+

Public Members

+
+
+const SupportedKeywordItems<std::string> string_items
+
+ +
+
+const SupportedKeywordItems<int> int_items
+
+ +
+
+const SupportedKeywordItems<double> double_items
+
+ +
+
+ +
+
+template<class Grid>
class SupportsFaceTag : public std::bool_constant<false>
+
+#include <SupportsFaceTag.hpp>
+
+ +
+
+template<>
class SupportsFaceTag<Dune::CpGrid> : public std::bool_constant<true>
+
+#include <SupportsFaceTag.hpp>
+
+ +
+
+template<class FluidSystem, class Region>
class SurfaceToReservoirVoidage
+
+#include <RateConverter.hpp>
+

Convert component rates at surface conditions to phase (voidage) rates at reservoir conditions.

+

The conversion uses fluid properties evaluated at average hydrocarbon pressure in regions or field.

+
+
Template Parameters:
+
    +
  • FluidSystem – Fluid system class. Expected to be a BlackOilFluidSystem

  • +
  • Region – Type of a forward region mapping. Expected to provide indexed access through

    operator[]() 
    +
    +
    + as well as inner types value_type, size_type, and const_iterator. Typically
    std::vector<int> 
    +
    +
    +.

  • +
+
+
+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using RegionId = typename RegionMapping<Region>::RegionId
+

Region identifier.

+

Integral type.

+
+ +
+
+

Public Functions

+
+
+inline SurfaceToReservoirVoidage(const PhaseUsage &phaseUsage, const Region &region)
+

Constructor.

+
+
Parameters:
+

region[in] Forward region mapping. Often corresponds to the “FIPNUM” mapping of an ECLIPSE input deck.

+
+
+
+ +
+
+template<typename ElementContext, class Simulator>
inline void defineState(const Simulator &simulator)
+

Compute pore volume averaged hydrocarbon state pressure, rs and rv.

+

Fluid properties are evaluated at average hydrocarbon state for purpose of conversion from surface rate to reservoir voidage rate.

+
+ +
+
+template<class Coeff>
void calcCoeff(const RegionId r, const int pvtRegionIdx, Coeff &coeff) const
+

Compute coefficients for surface-to-reservoir voidage conversion.

+
+
Template Parameters:
+
    +
  • Input – Type representing contiguous collection of component rates at surface conditions. Must support direct indexing through

    operator[]()
    +
    +
    +.

  • +
  • Coeff – Type representing contiguous collection of surface-to-reservoir conversion coefficients. Must support direct indexing through

    operator[]()
    +
    +
    +.

  • +
+
+
Parameters:
+
    +
  • r[in] Fluid-in-place region of the well

  • +
  • pvtRegionIdx[in] PVT region of the well

  • +
  • coeff[out] Surface-to-reservoir conversion coefficients that can be used to compute total reservoir volumes from surface volumes with the formula q_{rT} = \sum_p coeff[p] q_{sp}. However, individual phase reservoir volumes cannot be calculated from these coefficients (i.e. q_{rp} is not equal to coeff[p] q_{sp}) since they can depend on more than one surface volume rate when we have dissolved gas or vaporized oil.

  • +
+
+
+
+ +
+
+template<class Coeff, class Rates>
void calcCoeff(const RegionId r, const int pvtRegionIdx, const Rates &surface_rates, Coeff &coeff) const
+
+ +
+
+template<class Coeff>
void calcCoeff(const int pvtRegionIdx, const Scalar p, const Scalar rs, const Scalar rv, const Scalar rsw, const Scalar rvw, const Scalar T, const Scalar saltConcentration, Coeff &coeff) const
+
+ +
+
+template<class Coeff>
void calcInjCoeff(const RegionId r, const int pvtRegionIdx, Coeff &coeff) const
+
+ +
+
+template<class Rates>
void calcReservoirVoidageRates(const RegionId r, const int pvtRegionIdx, const Rates &surface_rates, Rates &voidage_rates) const
+

Convert surface volume flow rates to reservoir voidage flow rates.

+

State dependent version. Client must call

defineState() 
+
+
+ prior to invoking this member function.

+
+
Template Parameters:
+

Rates – Type representing contiguous collection of surface flow rates. Must support direct indexing through

operator[]() 
+
+
+.

+
+
Parameters:
+
    +
  • r[in] Zero based fluid-in-place region index.

  • +
  • pvtRegionIdx[in] Zero based PVT region index.

  • +
  • surface_rates[in] surface volume flow rates for all active phases.

  • +
  • voidage_rates[out] reservoir volume flow rates for all active phases.

  • +
+
+
+
+ +
+
+template<typename SurfaceRates, typename VoidageRates>
void calcReservoirVoidageRates(const int pvtRegionIdx, const Scalar p, const Scalar rs, const Scalar rv, const Scalar rsw, const Scalar rvw, const Scalar T, const Scalar saltConcentration, const SurfaceRates &surface_rates, VoidageRates &voidage_rates) const
+

Convert surface volume flow rates to reservoir voidage flow rates.

+

State independent version.

+
+
Template Parameters:
+

Rates – Type representing contiguous collection of surface flow rates. Must support direct indexing through

operator[]() 
+
+
+.

+
+
Parameters:
+
    +
  • pvtRegionIdx[in] PVT region.

  • +
  • p[in] Fluid pressure.

  • +
  • rs[in] Dissolved gas/oil ratio.

  • +
  • rv[in] Vaporised oil/gas ratio.

  • +
  • rsw[in] Dissolved gas/water ratio.

  • +
  • rwv[in] Vaporised water/gas ratio.

  • +
  • T[in] Temperature. Unused in non-thermal simulation runs.

  • +
  • saltConcentration[in] Salt concentration. Unused in simulation runs without salt precipitation.

  • +
  • surface_rates[in] Surface volume flow rates for all active phases.

  • +
  • voidage_rates[out] Reservoir volume flow rates for all active phases.

  • +
+
+
+
+ +
+
+template<class Rates>
std::pair<Scalar, Scalar> inferDissolvedVaporisedRatio(const Scalar rsMax, const Scalar rvMax, const Rates &surface_rates) const
+
+ +
+
+template<class SolventModule>
inline void calcCoeffSolvent(const RegionId r, const int pvtRegionIdx, Scalar &coeff) const
+

Compute coefficients for surface-to-reservoir voidage conversion for solvent.

+
+
Parameters:
+
    +
  • r[in] Fluid-in-place region of the well

  • +
  • pvtRegionIdx[in] PVT region of the well

  • +
  • double[out] Surface-to-reservoir conversion coefficients for solvent.

  • +
+
+
+
+ +
+
+template<class Rates>
std::pair<typename FluidSystem::Scalar, typename FluidSystem::Scalar> inferDissolvedVaporisedRatio(const Scalar rsMax, const Scalar rvMax, const Rates &surface_rates) const
+
+ +
+
+

Private Functions

+
+
+void sumRates(std::unordered_map<RegionId, Attributes> &attributes_hpv, std::unordered_map<RegionId, Attributes> &attributes_pv, Parallel::Communication comm)
+
+ +
+
+

Private Members

+
+
+const PhaseUsage phaseUsage_
+

Fluid property object.

+
+ +
+
+const RegionMapping<Region> rmap_
+

“Fluid-in-place” region mapping (forward and reverse).

+
+ +
+
+RegionAttributeHelpers::RegionAttributes<RegionId, Attributes> attr_
+
+ +
+
+ +
+
+struct SurplusState
+
+#include <GasLiftStage2.hpp>
+
+

Public Functions

+
+
+inline SurplusState(GasLiftStage2 &parent_, const Group &group_, const WellState<Scalar> &well_state_, Scalar oil_rate_, Scalar gas_rate_, Scalar water_rate_, Scalar alq_, Scalar min_eco_grad_, Scalar oil_target_, Scalar gas_target_, Scalar water_target_, Scalar liquid_target_, std::optional<Scalar> max_glift_, std::optional<Scalar> max_total_gas_)
+
+ +
+
+void addOrRemoveALQincrement(GradMap &grad_map, const std::string &well_name, bool add)
+
+ +
+
+bool checkALQlimit()
+
+ +
+
+bool checkEcoGradient(const std::string &well_name, Scalar eco_grad)
+
+ +
+
+bool checkGasTarget(Scalar delta_gas)
+
+ +
+
+bool checkLiquidTarget(Scalar delta_liquid)
+
+ +
+
+bool checkOilTarget(Scalar delta_oil)
+
+ +
+
+bool checkWaterTarget(Scalar delta_water)
+
+ +
+
+std::array<Scalar, 4> computeDelta(const std::string &name)
+
+ +
+
+void updateRates(const std::array<Scalar, 4> &delta)
+
+ +
+
+

Public Members

+
+
+GasLiftStage2 &parent
+
+ +
+
+const Group &group
+
+ +
+
+const WellState<Scalar> &well_state
+
+ +
+
+Scalar oil_rate
+
+ +
+
+Scalar gas_rate
+
+ +
+
+Scalar water_rate
+
+ +
+
+Scalar alq
+
+ +
+
+const Scalar min_eco_grad
+
+ +
+
+const Scalar oil_target
+
+ +
+
+const Scalar gas_target
+
+ +
+
+const Scalar water_target
+
+ +
+
+const Scalar liquid_target
+
+ +
+
+std::optional<Scalar> max_glift
+
+ +
+
+std::optional<Scalar> max_total_gas
+
+ +
+
+int it
+
+ +
+
+ +
+
+template<typename Scalar>
class SWcr : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that critical gas saturation is in valid range.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar swl_ = {}
+

Minimum (connate) water saturation.

+
+ +
+
+Scalar swcr_ = {}
+

Critical water saturation.

+
+ +
+
+Scalar swu_ = {}
+

Maximum water saturation.

+
+ +
+
+ +
+
+template<typename Scalar>
class SWmax : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that maximum gas saturation is in valid range.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar swu_ = {}
+

Maximum water saturation.

+
+ +
+
+ +
+
+template<typename Scalar>
class SWmin : public Opm::Satfunc::PhaseChecks::PhaseCheckBase<Scalar>
+
+

Verify that minimum gas saturation is in valid range

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline virtual std::size_t numExportedCheckValues() const override
+

Number of Scalar values involved in the check.

+
+ +
+
+inline virtual void exportCheckValues(Scalar *exportedCheckValues) const override
+

Get a linearised copy of the Scalar values involved in the check.

+
+
Parameters:
+

exportedCheckValues[inout] Pointer to contiguous sequence of at least numExportedCheckValues() Scalars.

+
+
+
+ +
+
+inline virtual std::string description() const override
+

Descriptive textual summary of this check.

+
+ +
+
+inline virtual std::string condition() const override
+

Textual representation of the consistency condition.

+
+ +
+
+inline virtual void columnNames(std::string *headers) const override
+

Retrieve names of the exported check values.

+
+
Parameters:
+

headers[inout] Pointer to contiguous sequence of at least numExportedCheckValues() strings.

+
+
+
+ +
+
+

Private Functions

+
+
+virtual void testImpl(const EclEpsScalingPointsInfo<Scalar> &endPoints) override
+

Run check against a set of saturation function end-points.

+
+
Parameters:
+

endPoints[in] Set of saturation function end-points. Might for instance be the scaled end-points of the drainage functions in a single grid block or the unscaled end-points of the tabulated saturation functions in a single saturation region.

+
+
+
+ +
+
+

Private Members

+
+
+Scalar swl_ = {}
+

Minimum (connate) water saturation.

+
+ +
+
+ +
+
+template<class T>
class SymmTensor : public Opm::VoigtContainer<T>
+
+#include <SymmTensor.hpp>
+
+

Public Types

+
+
+using field_type = T
+
+ +
+
+

Public Functions

+
+
+SymmTensor() = default
+
+ +
+
+inline SymmTensor(std::initializer_list<T> value)
+
+ +
+
+void operator+=(const T data)
+
+ +
+
+void operator+=(const SymmTensor<T> &data)
+
+ +
+
+void operator*=(const T data)
+
+ +
+
+SymmTensor<T> &operator=(const T value)
+
+ +
+
+void reset()
+
+ +
+
+T trace() const
+
+ +
+
+T traction(const Dune::FieldVector<T, 3> &normal) const
+
+ +
+
+ +
+
+template<class Scalar>
class TargetCalculator
+
+

Based on a group control mode, extract or calculate rates, and provide other conveniences.

+
+

Public Functions

+
+
+TargetCalculator(const Group::ProductionCMode cmode, const PhaseUsage &pu, const std::vector<Scalar> &resv_coeff, const Scalar group_grat_target_from_sales, const std::string &group_name, const GroupState<Scalar> &group_state, const bool use_gpmaint)
+
+ +
+
+template<typename RateType>
inline RateType calcModeRateFromRates(const std::vector<RateType> &rates) const
+
+ +
+
+template<typename RateType>
RateType calcModeRateFromRates(const RateType *rates) const
+
+ +
+
+Scalar groupTarget(const std::optional<Group::ProductionControls> &ctrl, DeferredLogger &deferred_logger) const
+
+ +
+
+GuideRateModel::Target guideTargetMode() const
+
+ +
+
+

Private Members

+
+
+Group::ProductionCMode cmode_
+
+ +
+
+const PhaseUsage &pu_
+
+ +
+
+const std::vector<Scalar> &resv_coeff_
+
+ +
+
+const Scalar group_grat_target_from_sales_
+
+ +
+
+const std::string &group_name_
+
+ +
+
+const GroupState<Scalar> &group_state_
+
+ +
+
+bool use_gpmaint_
+
+ +
+
+ +
+
+class TaskletInterface
+
+#include <tasklets.hpp>
+

The base class for tasklets.

+

Tasklets are a generic mechanism for potentially running work in a separate thread.

+

Subclassed by Opm::FunctionRunnerTasklet< Fn >

+
+

Public Functions

+
+
+inline explicit TaskletInterface(int refCount = 1)
+
+ +
+
+inline virtual ~TaskletInterface()
+
+ +
+
+virtual void run() = 0
+
+ +
+
+inline virtual bool isEndMarker() const
+
+ +
+
+inline void dereference()
+
+ +
+
+inline int referenceCount() const
+
+ +
+
+

Private Members

+
+
+int referenceCount_
+
+ +
+
+ +
+
+class TaskletRunner
+
+#include <tasklets.hpp>
+

Handles where a given tasklet is run.

+

Depending on the number of worker threads, a tasklet can either be run in a separate worker thread or by the main thread.

+
+

Public Functions

+
+
+TaskletRunner(const TaskletRunner&) = delete
+
+ +
+
+explicit TaskletRunner(unsigned numWorkers)
+

Creates a tasklet runner with numWorkers underling threads for doing work.

+

The number of worker threads may be 0. In this case, all work is done by the main thread (synchronous mode).

+
+ +
+
+~TaskletRunner()
+

Destructor.

+

If worker threads were created to run the tasklets, this method waits until all worker threads have been terminated, i.e. all scheduled tasklets are guaranteed to be completed.

+
+ +
+
+bool failure() const
+
+ +
+
+int workerThreadIndex() const
+

Returns the index of the current worker thread.

+

If the current thread is not a worker thread, -1 is returned.

+
+ +
+
+inline int numWorkerThreads() const
+

Returns the number of worker threads for the tasklet runner.

+
+ +
+
+void dispatch(std::shared_ptr<TaskletInterface> tasklet)
+

Add a new tasklet.

+

The tasklet is either run immediately or deferred to a separate thread.

+
+ +
+
+template<class Fn>
inline std::shared_ptr<FunctionRunnerTasklet<Fn>> dispatchFunction(Fn &fn, int numInvocations = 1)
+

Convenience method to construct a new function runner tasklet and dispatch it immediately.

+
+ +
+
+void barrier()
+

Make sure that all tasklets have been completed after this method has been called.

+
+ +
+
+

Protected Functions

+
+
+void run_()
+

do the work until the queue received an end tasklet

+
+ +
+
+

Protected Attributes

+
+
+std::vector<std::unique_ptr<std::thread>> threads_
+
+ +
+
+std::queue<std::shared_ptr<TaskletInterface>> taskletQueue_
+
+ +
+
+std::mutex taskletQueueMutex_
+
+ +
+
+std::condition_variable workAvailableCondition_
+
+ +
+
+

Protected Static Functions

+
+
+static void startWorkerThread_(TaskletRunner *taskletRunner, int workerThreadIndex)
+
+ +
+
+

Protected Static Attributes

+
+
+static thread_local TaskletRunner *taskletRunner_ = nullptr
+
+ +
+
+static thread_local int workerThreadIndex_ = -1
+
+ +
+
+

Private Members

+
+
+std::atomic<bool> failureFlag_ = false
+
+ +
+
+ +
+
+template<class Scalar>
struct TemperatureMax
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e9
+
+ +
+
+ +
+
+template<class Scalar>
struct TemperatureMin
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.0
+
+ +
+
+ +
+
+class TerminateThreadTasklet : public Opm::TaskletInterface
+

TerminateThreadTasklet class Empty tasklet marking thread termination.

+
+

Public Functions

+
+
+inline void run() override
+
+ +
+
+inline bool isEndMarker() const override
+
+ +
+
+ +
+
+template<class TypeTag>
struct ThermalConductionLaw<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Types

+
+
+using EclThermalLawManager = ::Opm::EclThermalLawManager<Scalar, FluidSystem>
+
+ +
+
+using type = typename EclThermalLawManager::ThermalConductionLaw
+
+ +
+
+

Private Types

+
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+ +
+
+class ThreadManager
+
+#include <threadmanager.hpp>
+

Simplifies multi-threaded capabilities.

+
+

Public Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator isFake
+
+ +
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Register all run-time parameters of the thread manager.

+
+ +
+
+static void init(bool queryCommandLineParameter = true)
+

Initialize number of threads used thread manager.

+
+
Parameters:
+

queryCommandLineParameter – if set to true we will query ThreadsPerProcess and if set (disregard the environment variable OPM_NUM_THREADS). If false we will assume that the number of OpenMP threads is already set outside of this function (e.g. by OPM_NUM_THREADS or in the simulator by the ThreadsPerProcess parameter).

+
+
+
+ +
+
+static inline unsigned maxThreads()
+

Return the maximum number of threads of the current process.

+
+ +
+
+static unsigned threadId()
+

Return the index of the current OpenMP thread.

+
+ +
+
+

Private Static Attributes

+
+
+static int numThreads_ = 1
+
+ +
+
+ +
+
+struct TimeData
+
+

Public Functions

+
+
+void measure()
+
+ +
+
+

Public Members

+
+
+std::chrono::high_resolution_clock::time_point realtimeData
+
+ +
+
+std::clock_t cputimeData
+
+ +
+
+ +
+
+class Timer
+
+#include <timer.hpp>
+

Provides an encapsulation to measure the system time.

+

This means the wall clock time used by the simulation, the CPU time used by all threads of a single process and the CPU time used by the overall simulation. (i.e., the time used by all threads of all involved processes.)

+
+

Public Functions

+
+
+Timer()
+
+ +
+
+void start()
+

Start counting the time resources used by the simulation.

+
+ +
+
+double stop()
+

Stop counting the time resources.

+

Returns the wall clock time the timer was active.

+
+ +
+
+void halt()
+

Stop the measurement reset all timing values.

+
+ +
+
+void reset()
+

Make the current point in time t=0 but do not change the status of the timer.

+
+ +
+
+double realTimeElapsed() const
+

Return the real time [s] elapsed during the periods the timer was active since the last reset.

+
+ +
+
+inline double elapsed() const
+

This is an alias for realTimeElapsed()

+

Its main purpose is to make the API of the class a superset of Dune::Timer

+
+ +
+
+double cpuTimeElapsed() const
+

Return the CPU time [s] used by all threads of the local process for the periods the timer was active.

+
+ +
+
+double globalCpuTimeElapsed() const
+

Return the CPU time [s] used by all threads of the all processes of program.

+

The value returned only differs from cpuTimeElapsed() if MPI is used.

+
+ +
+
+Timer &operator+=(const Timer &other)
+

Adds the time of another timer to the current one.

+
+ +
+
+

Private Members

+
+
+bool isStopped_
+
+ +
+
+double cpuTimeElapsed_
+
+ +
+
+double realTimeElapsed_
+
+ +
+
+TimeData startTime_
+
+ +
+
+ +
+
+template<class Scalar>
struct TimeStepAfterEventInDays
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = -1.0
+
+ +
+
+ +
+
+struct TimeStepControl
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "pid+newtoniteration"
+
+ +
+
+ +
+
+struct TimeStepControlDecayDampingFactor
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 1.0
+
+ +
+
+ +
+
+struct TimeStepControlDecayRate
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 0.75
+
+ +
+
+ +
+
+struct TimeStepControlFileName
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "timesteps"
+
+ +
+
+ +
+
+struct TimeStepControlGrowthDampingFactor
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 3.2
+
+ +
+
+ +
+
+struct TimeStepControlGrowthRate
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 1.25
+
+ +
+
+ +
+
+class TimeStepControlInterface
+
+

TimeStepControlInterface

+

Subclassed by Opm::General3rdOrderController, Opm::HardcodedTimeStepControl, Opm::PIDTimeStepControl, Opm::SimpleIterationCountTimeStepControl

+
+

Public Functions

+
+
+virtual double computeTimeStepSize(const double dt, const int iterations, const RelativeChangeInterface &relativeChange, const AdaptiveSimulatorTimer &substepTimer) const = 0
+

compute new time step size suggestions based on the PID controller

+
+
Parameters:
+
    +
  • dt – time step size used in the current step

  • +
  • iterations – number of iterations used (linear/nonlinear)

  • +
  • timeError – object to compute || u^n+1 - u^n || / || u^n+1 ||

  • +
+
+
Returns:
+

suggested time step size for the next step

+
+
+
+ +
+
+virtual bool timeStepAccepted(const double error) const = 0
+
+ +
+
+inline virtual ~TimeStepControlInterface()
+

virtual destructor (empty)

+
+ +
+
+

Protected Functions

+
+
+inline TimeStepControlInterface()
+
+ +
+
+ +
+
+struct TimeStepControlRejectCompletedStep
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct TimeStepControlSafetyFactor
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 0.8
+
+ +
+
+ +
+
+struct TimeStepControlTargetIterations
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 30
+
+ +
+
+ +
+
+struct TimeStepControlTargetNewtonIterations
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 8
+
+ +
+
+ +
+
+struct TimeStepControlTolerance
+
+
+

Public Static Attributes

+
+
+static constexpr double value = 1e-1
+
+ +
+
+ +
+
+struct TimeStepVerbosity
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 1
+
+ +
+
+ +
+
+template<class Scalar>
struct ToleranceCnv
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-2
+
+ +
+
+ +
+
+template<class Scalar>
struct ToleranceCnvEnergy
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-2
+
+ +
+
+ +
+
+template<class Scalar>
struct ToleranceCnvEnergyRelaxed
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1.0
+
+ +
+
+ +
+
+template<class Scalar>
struct ToleranceCnvRelaxed
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1.0
+
+ +
+
+ +
+
+template<class Scalar>
struct ToleranceEnergyBalance
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-7
+
+ +
+
+ +
+
+template<class Scalar>
struct ToleranceEnergyBalanceRelaxed
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-6
+
+ +
+
+ +
+
+template<class Scalar>
struct ToleranceMb
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-7
+
+ +
+
+ +
+
+template<class Scalar>
struct ToleranceMbRelaxed
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-6
+
+ +
+
+ +
+
+template<class Scalar>
struct TolerancePressureMsWells
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 0.01 * 1e5
+
+ +
+
+ +
+
+struct Tolerances
+
+#include <WellConvergence.hpp>
+
+

Public Members

+
+
+Scalar bhp
+

Tolerance for bhp controlled well.

+
+ +
+
+Scalar thp
+

Tolerance for thp controlled well.

+
+ +
+
+Scalar rates
+

Tolerance for a rate controlled well.

+
+ +
+
+Scalar grup
+

Tolerance for a grup controlled well.

+
+ +
+
+Scalar max_residual_allowed
+

Max residual allowd.

+
+ +
+
+ +
+
+template<class Scalar>
struct ToleranceWellControl
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-7
+
+ +
+
+ +
+
+template<class Scalar>
struct ToleranceWells
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1e-4
+
+ +
+
+ +
+
+template<typename TV>
struct TracerBatch
+
+#include <TracerModel.hpp>
+
+

Public Functions

+
+
+inline bool operator==(const TracerBatch &rhs) const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline TracerBatch(int phaseIdx = 0)
+
+ +
+
+inline int numTracer() const
+
+ +
+
+inline void addTracer(const int idx, const TV &concentration)
+
+ +
+
+

Public Members

+
+
+std::vector<int> idx_
+
+ +
+
+const int phaseIdx_
+
+ +
+
+std::vector<TV> concentrationInitial_
+
+ +
+
+std::vector<TV> concentration_
+
+ +
+
+std::vector<TV> storageOfTimeIndex1_
+
+ +
+
+std::vector<TV> residual_
+
+ +
+
+std::unique_ptr<TracerMatrix> mat
+
+ +
+
+

Public Static Functions

+
+
+static inline TracerBatch serializationTestObject()
+
+ +
+
+ +
+
+template<class FluidSystem>
class TracerContainer
+
+#include <TracerContainer.hpp>
+
+

Public Types

+
+
+using AssignFunction = std::function<Scalar(const unsigned)>
+
+ +
+
+

Public Functions

+
+
+void allocate(const unsigned bufferSize, const TracerConfig &tracers)
+
+ +
+
+void assignFreeConcentrations(const unsigned globalDofIdx, const AssignFunction &concentration)
+
+ +
+
+void assignSolConcentrations(const unsigned globalDofIdx, const AssignFunction &concentration)
+
+ +
+
+void outputRestart(data::Solution &sol, const TracerConfig &tracers)
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using ScalarBuffer = std::vector<Scalar>
+
+ +
+
+

Private Members

+
+
+std::vector<ScalarBuffer> freeConcentrations_ = {}
+
+ +
+
+std::vector<ScalarBuffer> solConcentrations_ = {}
+
+ +
+
+bool allocated_ = {false}
+
+ +
+
+ +
+
+template<class TypeTag, class MyTypeTag>
struct TracerModel
+
+
+

Public Types

+
+
+using type = UndefinedProperty
+
+ +
+
+ +
+
+template<class TypeTag>
class TracerModel : public Opm::GenericTracerModel<GetPropType<TypeTag, Properties::Grid>, GetPropType<TypeTag, Properties::GridView>, GetPropType<TypeTag, Properties::DofMapper>, GetPropType<TypeTag, Properties::Stencil>, GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::Scalar>>
+
+#include <TracerModel.hpp>
+

A class which handles tracers as specified in by ECL.

+
+

Public Functions

+
+
+inline explicit TracerModel(Simulator &simulator)
+
+ +
+
+inline void init(bool rst)
+
+ +
+
+inline void prepareTracerBatches()
+
+ +
+
+inline void beginTimeStep()
+
+ +
+
+inline void endTimeStep()
+

Informs the tracer model that a time step has just been finished.

+
+ +
+
+template<class Restarter>
inline void serialize(Restarter&)
+

This method writes the complete state of all tracer to the hard disk.

+
+ +
+
+template<class Restarter>
inline void deserialize(Restarter&)
+

This method restores the complete state of the tracer from disk.

+

It is the inverse of the serialize() method.

+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Protected Types

+
+
+using TracerTypeIdx = typename BaseType::TracerTypeIdx
+
+ +
+
+

Protected Functions

+
+
+template<TracerTypeIdx Index>
inline Scalar computeVolume_(const int tracerPhaseIdx, const unsigned globalDofIdx, const unsigned timeIdx) const
+
+ +
+
+template<TracerTypeIdx Index>
inline std::pair<TracerEvaluation, bool> computeFlux_(const int tracerPhaseIdx, const ElementContext &elemCtx, const unsigned scvfIdx, const unsigned timeIdx) const
+
+ +
+
+template<TracerTypeIdx Index, class TrRe>
inline Scalar storage1_(const TrRe &tr, const unsigned tIdx, const unsigned I, const unsigned I1, const bool cache)
+
+ +
+
+template<class TrRe>
inline void assembleTracerEquationVolume(TrRe &tr, const ElementContext &elemCtx, const Scalar scvVolume, const Scalar dt, unsigned I, unsigned I1)
+
+ +
+
+template<class TrRe>
inline void assembleTracerEquationFlux(TrRe &tr, const ElementContext &elemCtx, unsigned scvfIdx, unsigned I, unsigned J, const Scalar dt)
+
+ +
+
+template<class TrRe, class Well>
inline void assembleTracerEquationWell(TrRe &tr, const Well &well)
+
+ +
+
+template<class TrRe>
inline void assembleTracerEquationSource(TrRe &tr, const Scalar dt, unsigned I)
+
+ +
+
+inline void assembleTracerEquations_()
+
+ +
+
+template<TracerTypeIdx Index, class TrRe>
inline void updateElem(TrRe &tr, const Scalar scvVolume, const unsigned globalDofIdx)
+
+ +
+
+inline void updateStorageCache()
+
+ +
+
+template<TracerTypeIdx Index, class TrRe>
inline void copyForOutput(TrRe &tr, const std::vector<TracerVector> &dx, const Scalar S, const unsigned tIdx, const unsigned globalDofIdx, std::vector<TracerVectorSingle> &sc)
+
+ +
+
+template<TracerTypeIdx Index, class TrRe>
inline void assignRates(const TrRe &tr, const Well &eclWell, const std::size_t i, const std::size_t I, const Scalar rate, std::vector<WellTracerRate<Scalar>> &tracerRate, std::vector<MSWellTracerRate<Scalar>> *mswTracerRate, std::vector<WellTracerRate<Scalar>> &splitRate)
+
+ +
+
+inline void advanceTracerFields()
+
+ +
+
+

Protected Attributes

+
+
+Simulator &simulator_
+
+ +
+
+std::array<TracerBatch<TracerVector>, numPhases> tbatch
+
+ +
+
+TracerBatch<TracerVector> &wat_
+
+ +
+
+TracerBatch<TracerVector> &oil_
+
+ +
+
+TracerBatch<TracerVector> &gas_
+
+ +
+
+std::array<std::array<std::vector<Scalar>, numPhases>, 2> vol1_
+
+ +
+
+std::array<std::array<std::vector<Scalar>, numPhases>, 2> dVol_
+
+ +
+
+ElementChunks<GridView, Dune::Partitions::All> element_chunks_
+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numEq
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator waterPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator oilPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator gasPhaseIdx
+
+ +
+ +
+
+using BaseType = GenericTracerModel<GetPropType<TypeTag, Properties::Grid>, GetPropType<TypeTag, Properties::GridView>, GetPropType<TypeTag, Properties::DofMapper>, GetPropType<TypeTag, Properties::Stencil>, GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::Scalar>>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Stencil = GetPropType<TypeTag, Properties::Stencil>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using TracerEvaluation = DenseAd::Evaluation<Scalar, 1>
+
+ +
+
+using TracerMatrix = typename BaseType::TracerMatrix
+
+ +
+
+using TracerVector = typename BaseType::TracerVector
+
+ +
+
+using TracerVectorSingle = typename BaseType::TracerVectorSingle
+
+ +
+
+ +
+
+template<class TypeTag>
struct TracerModel<TypeTag, TTag::FlowBaseProblem>
+
+
+

Public Types

+
+
+using type = ::Opm::TracerModel<TypeTag>
+
+ +
+
+ +
+
+template<class TypeTag>
struct TracerModel<TypeTag, TTag::FlowBaseProblemComp>
+
+
+

Public Types

+
+
+using type = ::Opm::TracerModel<TypeTag>
+
+ +
+
+ +
+
+template<class Grid, class GridView, class ElementMapper, class CartesianIndexMapper, class Scalar>
class Transmissibility
+
+
+

Public Types

+
+
+enum class TransUpdateQuantities
+

Compute all transmissibilities.

+
+
Param global:
+

[in] Whether or not to call update()

on all processes. Also, this updates the “thermal half

+

transmissibilities” if energy is enabled.

+

+
+
Param trans:
+

[in] Indicating whether we only allocate and upate trans_ without considering thermalHalfTrans_, diffusivity_, dispersivity_. For many usage, we only need trans_, e.g. weights for domain decomposition, INIT file output. It might change following further development. Trans only update the trans_, which is related to permeability All upate rans_, thermalHalfTrans_, diffusivity_ and dispersivity_.

+
+
Param map:
+

[in] Undocumented.

+
+
Param applyNncMultRegT:
+

[in] Whether or not to apply regional multipliers to explicit NNCs. Explicit NNCs are those entered directly in the input data, e.g., through the NNC/EDITNNC/EDITNNCR keywords, or the result of generating connections to or within numerical aquifers. Default value: false, meaning do not apply regional multipliers to explicit NNCs.

+
+
+

Values:

+
+
+enumerator Trans
+
+ +
+
+enumerator All
+
+ +
+ +
+
+using DimMatrix = Dune::FieldMatrix<Scalar, dimWorld, dimWorld>
+
+ +
+
+using DimVector = Dune::FieldVector<Scalar, dimWorld>
+
+ +
+
+

Public Functions

+
+
+Transmissibility(const EclipseState &eclState, const GridView &gridView, const CartesianIndexMapper &cartMapper, const Grid &grid, std::function<std::array<double, dimWorld>(int)> centroids, bool enableEnergy, bool enableDiffusivity, bool enableDispersivity)
+
+ +
+
+inline const DimMatrix &permeability(unsigned elemIdx) const
+

Return the permeability for an element.

+
+ +
+
+Scalar transmissibility(unsigned elemIdx1, unsigned elemIdx2) const
+

Return the transmissibility for the intersection between two elements.

+
+ +
+
+Scalar transmissibilityBoundary(unsigned elemIdx, unsigned boundaryFaceIdx) const
+

Return the transmissibility for a given boundary segment.

+
+ +
+
+Scalar thermalHalfTrans(unsigned insideElemIdx, unsigned outsideElemIdx) const
+

Return the thermal “half transmissibility” for the intersection between two elements.

+

The “half transmissibility” features all sub-expressions of the “thermal

+

transmissibility” which can be precomputed, i.e. they are not dependent on the current solution:

+

+

H_t = A * (n*d)/(d*d);

+

where A is the area of the intersection between the inside and outside elements, n is the outer unit normal, and d is the distance between the center of the inside cell and the center of the intersection.

+
+ +
+
+Scalar thermalHalfTransBoundary(unsigned insideElemIdx, unsigned boundaryFaceIdx) const
+
+ +
+
+Scalar diffusivity(unsigned elemIdx1, unsigned elemIdx2) const
+

Return the diffusivity for the intersection between two elements.

+
+ +
+
+Scalar dispersivity(unsigned elemIdx1, unsigned elemIdx2) const
+

Return the dispersivity for the intersection between two elements.

+
+ +
+
+inline void finishInit(const std::function<unsigned int(unsigned int)> &map = {})
+

Actually compute the transmissibility over a face as a pre-compute step.

+

This code actually uses the direction specific “centroids” of each element. These “centroids” are not the identical barycenter of the element, but the middle of the centers of the faces of the logical Cartesian cells, i.e., the centers of the faces of the reference elements. We do things this way because the barycenter of the element can be located outside of the element for sufficiently “ugly” (i.e., thin and “non-flat”) elements which in turn leads to quite wrong permeabilities. This approach is probably not always correct either but at least it seems to be much better.

+
+ +
+
+void update(bool global, TransUpdateQuantities update_quantities = TransUpdateQuantities::All, const std::function<unsigned int(unsigned int)> &map = {}, bool applyNncMultRegT = false)
+
+ +
+
+

Protected Functions

+
+
+void updateFromEclState_(bool global)
+
+ +
+
+void removeNonCartesianTransmissibilities_(bool removeAll)
+
+ +
+
+void applyAllZMultipliers_(Scalar &trans, const FaceInfo &inside, const FaceInfo &outside, const TransMult &transMult, const std::array<int, dimWorld> &cartDims)
+

Apply the Multipliers for the case PINCH(4)==TOPBOT.

+
+
Parameters:
+

pinchTop – Whether PINCH(5) is TOP, otherwise ALL is assumed.

+
+
+
+ +
+
+std::array<std::vector<double>, 3> createTransmissibilityArrays_(const std::array<bool, 3> &is_tran)
+

Creates TRANS{XYZ} arrays for modification by FieldProps data.

+
+
Parameters:
+

is_tran – Whether TRAN{XYZ} will be modified. If entry is false the array will be empty

+
+
Returns:
+

an array of vector (TRANX, TRANY, TRANZ}

+
+
+
+ +
+
+void resetTransmissibilityFromArrays_(const std::array<bool, 3> &is_tran, const std::array<std::vector<double>, 3> &trans)
+

overwrites calculated transmissibilities

+
+
Parameters:
+
    +
  • is_tran – Whether TRAN{XYZ} have been modified.

  • +
  • trans – Arrays with modified transmissibilities TRAN{XYZ}

  • +
+
+
+
+ +
+
+template<class Intersection>
void computeFaceProperties(const Intersection &intersection, FaceInfo &inside, FaceInfo &outside, DimVector &faceAreaNormal, std::false_type) const
+
+ +
+
+template<class Intersection>
void computeFaceProperties(const Intersection &intersection, FaceInfo &inside, FaceInfo &outside, DimVector &faceAreaNormal, std::true_type) const
+
+ +
+
+void applyNncToGridTrans_(const std::unordered_map<std::size_t, int> &cartesianToCompressed)
+
+ +
+
+void applyPinchNncToGridTrans_(const std::unordered_map<std::size_t, int> &cartesianToCompressed)
+

Applies the previous calculate transmissibilities to the NNCs created via PINCH.

+
+
Parameters:
+

cartesianToCompressed – Vector containing the compressed index (or -1 for inactive cells) as the element at the cartesian index.

+
+
+
+ +
+
+void applyEditNncToGridTrans_(const std::unordered_map<std::size_t, int> &globalToLocal)
+

Multiplies the grid transmissibilities according to EDITNNC.

+
+ +
+
+void applyEditNncrToGridTrans_(const std::unordered_map<std::size_t, int> &globalToLocal)
+

Resets the grid transmissibilities according to EDITNNCR.

+
+ +
+
+void applyNncMultreg_(const std::unordered_map<std::size_t, int> &globalToLocal)
+
+ +
+
+void applyEditNncToGridTransHelper_(const std::unordered_map<std::size_t, int> &globalToLocal, const std::string &keyword, const std::vector<NNCdata> &nncs, const std::function<KeywordLocation(const NNCdata&)> &getLocation, const std::function<void(Scalar&, const Scalar&)> &apply)
+
+ +
+
+void extractPermeability_()
+
+ +
+
+void extractPermeability_(const std::function<unsigned int(unsigned int)> &map)
+
+ +
+
+void extractPorosity_()
+
+ +
+
+void extractDispersion_()
+
+ +
+
+DimVector distanceVector_(const DimVector &faceCenter, const unsigned &cellIdx) const
+
+ +
+
+void applyMultipliers_(Scalar &trans, unsigned faceIdx, unsigned cartElemIdx, const TransMult &transMult) const
+
+ +
+
+

Protected Attributes

+
+
+std::vector<DimMatrix> permeability_
+
+ +
+
+std::vector<Scalar> porosity_
+
+ +
+
+std::vector<Scalar> dispersion_
+
+ +
+
+std::unordered_map<std::uint64_t, Scalar> trans_
+
+ +
+
+const EclipseState &eclState_
+
+ +
+
+const GridView &gridView_
+
+ +
+
+const CartesianIndexMapper &cartMapper_
+
+ +
+
+const Grid &grid_
+
+ +
+
+std::function<std::array<double, dimWorld>(int)> centroids_
+
+ +
+
+std::vector<std::array<double, dimWorld>> centroids_cache_
+
+ +
+
+Scalar transmissibilityThreshold_
+
+ +
+
+std::map<std::pair<unsigned, unsigned>, Scalar> transBoundary_
+
+ +
+
+std::map<std::pair<unsigned, unsigned>, Scalar> thermalHalfTransBoundary_
+
+ +
+
+bool enableEnergy_
+
+ +
+
+bool enableDiffusivity_
+
+ +
+
+bool enableDispersivity_
+
+ +
+
+bool warnEditNNC_ = true
+
+ +
+
+std::unordered_map<std::uint64_t, Scalar> thermalHalfTrans_
+
+ +
+
+std::unordered_map<std::uint64_t, Scalar> diffusivity_
+
+ +
+
+std::unordered_map<std::uint64_t, Scalar> dispersivity_
+
+ +
+
+const LookUpData<Grid, GridView> lookUpData_
+
+ +
+
+const LookUpCartesianData<Grid, GridView> lookUpCartesianData_
+
+ +
+
+

Protected Static Functions

+
+
+static Scalar computeHalfTrans_(const DimVector &areaNormal, int faceIdx, const DimVector &distance, const DimMatrix &perm)
+
+ +
+
+static Scalar computeHalfDiffusivity_(const DimVector &areaNormal, const DimVector &distance, const Scalar poro)
+
+ +
+
+static void applyNtg_(Scalar &trans, const FaceInfo &face, const std::vector<double> &ntg)
+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator dimWorld
+
+ +
+ +
+
+ +
+
+template<class Matrix>
class UMFPack
+
+ +
+
+struct UnscaledEndPoints
+
+

Collection of saturation function end-points and function values extracted from tabulated saturation functions.

+
+

Public Members

+
+
+const satfunc::RawTableEndPoints *rtep = {nullptr}
+

Raw table end-points. Minimum, critical, and maximum saturation points for each phase for all tabulated saturation functions.

+
+ +
+
+const satfunc::RawFunctionValues *rfunc = {nullptr}
+

Raw saturation function values. Maximum function values for all saturation functions in addition to relative permeability values at critical saturation points.

+
+ +
+
+ +
+
+template<typename Scalar>
class UnscaledSatfuncCheckPoint : public Opm::Satfunc::PhaseChecks::SatfuncCheckPointInterface<Scalar>
+
+

Callbacks for defining the consistency check point of a single region.

+
+
Template Parameters:
+

Scalar – Element type. Typically float or double.

+
+
+
+

Public Functions

+
+
+inline explicit UnscaledSatfuncCheckPoint(const std::vector<int> *region, const int regIdxOffset, const UnscaledEndPoints &unscaledEndPoints)
+

Constructor

+
+
Parameters:
+
    +
  • region[in] Region index for each active cell on rank.

  • +
  • regIdxOffset[in] Region index offset. Pass one (1) if region contains one-based region indices.

  • +
  • unscaledEndPoints[in] Saturation function end-points for all tabulated saturation functions. Lifetime of members must exceed the UnscaledSatfuncCheckPoint object.

  • +
+
+
+
+ +
+
+virtual std::optional<std::size_t> pointID(const int cellIdx) const override
+

Compute locally unique, i.e., per MPI rank, ID of this check for a particular cell index.

+

Common examples include the drainage or imbibition region ID (i.e., SATNUM or IMBNUM) or the Cartesian block index of a cell.

+
+
Parameters:
+

cellIdx[in] Active cell index on current rank.

+
+
Returns:
+

Locally unique point ID for cellIdx. Nullopt if this check point does not apply to cellIdx. Typically because the underlying region of cellIdx has already been visited.

+
+
+
+ +
+
+virtual void populateCheckPoint(const int cellIdx, EclEpsScalingPointsInfo<Scalar> &endPoints) const override
+

Populate check point values for a particular cell.

+
+
Parameters:
+
    +
  • cellIdx[in] Active cell index on current rank.

  • +
  • endPoints[out] Set of saturation function end-points.

  • +
+
+
+
+ +
+
+

Private Members

+
+
+UnscaledEndPoints unscaledEndPoints_
+

Saturation function end-points for all tabulated saturation functions. Lifetime of members must exceed the UnscaledSatfuncCheckPoint object.

+
+ +
+
+int regIdxOffset_ = {}
+

Region index offset. Should be one (1) if region_ contains one-based region indices.

+
+ +
+
+const std::vector<int> *region_ = {nullptr}
+

Region index for each active cell on rank.

+
+ +
+
+mutable std::unordered_set<int> seen_ = {}
+

Cache for visited (“seen”) saturation regions.

+
+ +
+
+ +
+
+struct UnsupportedKeywordProperties
+
+
+

Public Members

+
+
+bool critical
+
+ +
+
+std::optional<std::string> message
+
+ +
+
+ +
+
+struct UpdateEquationsScaling
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct UseAverageDensityMsWells
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct UseGmres
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct UseImplicitIpr
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct UseMultisegmentWell
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct UseUpdateStabilization
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class TypeTag>
struct UseVolumetricResidual<TypeTag, TTag::FlowProblem>
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct ValidationError
+
+
+

Public Members

+
+
+bool critical
+
+ +
+
+KeywordLocation location
+
+ +
+
+std::size_t record_number
+
+ +
+
+std::optional<std::size_t> item_number
+
+ +
+
+std::optional<std::string> item_value
+
+ +
+
+std::optional<std::string> user_message
+
+ +
+
+ +
+
+struct Value
+
+

Aggregate per-region attributes along with region’s representative cell.

+
+

Public Functions

+
+
+inline explicit Value(const Attributes &attr)
+
+ +
+
+

Public Members

+
+
+Attributes attr_
+
+ +
+
+int cell_
+
+ +
+
+ +
+
+template<class TypeTag>
struct Vanguard<TypeTag, TTag::AluGridVanguard>
+
+#include <AluGridVanguard.hpp>
+
+

Public Types

+
+
+using type = Opm::FlowAluGridVanguard<TypeTag>
+
+ +
+
+ +
+
+template<class TypeTag>
struct Vanguard<TypeTag, TTag::CpGridVanguard>
+
+#include <CpGridVanguard.hpp>
+
+

Public Types

+
+
+using type = CpGridVanguard<TypeTag>
+
+ +
+
+ +
+
+template<class TypeTag>
struct Vanguard<TypeTag, TTag::PolyhedralGridVanguard>
+
+
+

Public Types

+
+
+using type = Opm::PolyhedralGridVanguard<TypeTag>
+
+ +
+
+ +
+
+template<class GridView, class Vector>
class VectorVectorDataHandle : public Dune::CommDataHandleIF<VectorVectorDataHandle<GridView, Vector>, std::decay_t<decltype(std::declval<Vector>()[0][0])>>
+
+

A data handle sending multiple data store in vectors attached to cells.

+

Each data is assumed to a container with operator[] and the class operates on a vector of these.

+
+
Template Parameters:
+
    +
  • GridView – the type of the grid view the data associated with

  • +
  • The – type of the vector of vectors.

  • +
+
+
+
+

Public Types

+
+
+using DataType = std::decay_t<decltype(std::declval<Vector>()[0][0])>
+

the data type we send

+
+ +
+
+

Public Functions

+
+
+inline VectorVectorDataHandle(Vector &data, const GridView &gridView)
+

Constructor.

+
+
Parameters:
+
    +
  • data – The vector of data vectors

  • +
  • gridView – The gridview the data is attached to.

  • +
+
+
+
+ +
+
+inline bool contains(int, int codim) const
+
+ +
+
+inline bool fixedSize(int, int) const
+
+ +
+
+template<class EntityType>
inline std::size_t size(const EntityType) const
+
+ +
+
+template<class BufferType, class EntityType>
inline void gather(BufferType &buffer, const EntityType &e) const
+
+ +
+
+template<class BufferType, class EntityType>
inline void scatter(BufferType &buffer, const EntityType &e, std::size_t n)
+
+ +
+
+

Private Members

+
+
+Vector &data_
+
+ +
+
+const GridView &gridView_
+
+ +
+
+ +
+
+template<class Scalar>
struct VFPEvaluation
+
+#include <VFPHelpers.hpp>
+

An “ADB-like” structure with a single value and a set of derivatives

+
+

Public Functions

+
+
+inline VFPEvaluation()
+
+ +
+
+

Public Members

+
+
+Scalar value
+
+ +
+
+Scalar dthp
+
+ +
+
+Scalar dwfr
+
+ +
+
+Scalar dgfr
+
+ +
+
+Scalar dalq
+
+ +
+
+Scalar dflo
+
+ +
+
+ +
+
+template<class Scalar>
class VFPHelpers
+
+#include <VFPHelpers.hpp>
+
+

Public Static Functions

+
+
+static detail::InterpData<Scalar> findInterpData(const Scalar value_in, const std::vector<double> &values)
+

Helper function to find indices etc. for linear interpolation and extrapolation

+
+
Parameters:
+
    +
  • value_in – Value to find in values

  • +
  • values – Sorted list of values to search for value in.

  • +
+
+
Returns:
+

Data required to find the interpolated value

+
+
+
+ +
+
+static detail::VFPEvaluation<Scalar> interpolate(const VFPProdTable &table, const detail::InterpData<Scalar> &flo_i, const detail::InterpData<Scalar> &thp_i, const detail::InterpData<Scalar> &wfr_i, const detail::InterpData<Scalar> &gfr_i, const detail::InterpData<Scalar> &alq_i)
+

Helper function which interpolates data using the indices etc. given in the inputs.

+
+ +
+
+static detail::VFPEvaluation<Scalar> interpolate(const VFPInjTable &table, const detail::InterpData<Scalar> &flo_i, const detail::InterpData<Scalar> &thp_i)
+

This basically models interpolate(VFPProdTable::array_type, …) which performs 5D interpolation, but here for the 2D case only

+
+ +
+
+static detail::VFPEvaluation<Scalar> bhp(const VFPProdTable &table, const Scalar aqua, const Scalar liquid, const Scalar vapour, const Scalar thp, const Scalar alq, const Scalar explicit_wfr, const Scalar explicit_gfr, const bool use_vfpexplicit)
+
+ +
+
+static detail::VFPEvaluation<Scalar> bhp(const VFPInjTable &table, const Scalar aqua, const Scalar liquid, const Scalar vapour, const Scalar thp)
+
+ +
+
+static Scalar findTHP(const std::vector<Scalar> &bhp_array, const std::vector<double> &thp_array, Scalar bhp, const bool find_largest = true)
+

This function finds the value of THP given a specific BHP. Essentially: Given the function f(thp_array(x)) = bhp_array(x), which is piecewise linear, find thp so that f(thp) = bhp.

+
+ +
+
+static std::pair<Scalar, Scalar> getMinimumBHPCoordinate(const VFPProdTable &table, const Scalar thp, const Scalar wfr, const Scalar gfr, const Scalar alq)
+

Get (flo, bhp) at minimum bhp for given thp,wfr,gfr,alq

+
+ +
+
+static std::optional<std::pair<Scalar, Scalar>> intersectWithIPR(const VFPProdTable &table, const Scalar thp, const Scalar wfr, const Scalar gfr, const Scalar alq, const Scalar ipr_a, const Scalar ipr_b, const std::function<Scalar(const Scalar)> &adjust_bhp)
+

Get (flo, bhp) at largest occuring stable vfp/ipr-intersection if it exists

+
+ +
+
+ +
+
+template<class Scalar>
class VFPInjProperties
+
+
+

Public Functions

+
+
+void addTable(const VFPInjTable &new_table)
+

Takes no ownership of data.

+
+ +
+
+template<class EvalWell>
EvalWell bhp(const int table_id, const EvalWell &aqua, const EvalWell &liquid, const EvalWell &vapour, const Scalar thp) const
+

Linear interpolation of bhp as a function of the input parameters given as Evaluation Each entry corresponds typically to one well.

+
+
Parameters:
+
    +
  • table_id – Table number to use. A negative entry (e.g., -1) will indicate that no table is used, and the corresponding BHP will be calculated as a constant -1e100.

  • +
  • aqua – Water phase

  • +
  • liquid – Oil phase

  • +
  • vapour – Gas phase

  • +
  • thp – Tubing head pressure

  • +
+
+
Returns:
+

The bottom hole pressure, interpolated/extrapolated linearly using the above parameters from the values in the input table, for each entry in the input ADB objects.

+
+
+
+ +
+
+const VFPInjTable &getTable(const int table_id) const
+

Returns the table associated with the ID, or throws an exception if the table does not exist

+
+ +
+
+bool hasTable(const int table_id) const
+

Check whether there is table associated with ID

+
+ +
+
+inline bool empty() const
+

Returns true if no vfp tables are in the current map

+
+ +
+
+Scalar bhp(const int table_id, const Scalar aqua, const Scalar liquid, const Scalar vapour, const Scalar thp) const
+

Linear interpolation of bhp as a function of the input parameters

+
+
Parameters:
+
    +
  • table_id – Table number to use

  • +
  • aqua – Water phase

  • +
  • liquid – Oil phase

  • +
  • vapour – Gas phase

  • +
  • thp – Tubing head pressure

  • +
+
+
Returns:
+

The bottom hole pressure, interpolated/extrapolated linearly using the above parameters from the values in the input table.

+
+
+
+ +
+
+Scalar thp(const int table_id, const Scalar aqua, const Scalar liquid, const Scalar vapour, const Scalar bhp) const
+

Linear interpolation of thp as a function of the input parameters

+
+
Parameters:
+
    +
  • table_id – Table number to use

  • +
  • aqua – Water phase

  • +
  • liquid – Oil phase

  • +
  • vapour – Gas phase

  • +
  • bhp – Bottom hole pressure

  • +
+
+
Returns:
+

The tubing hole pressure, interpolated/extrapolated linearly using the above parameters from the values in the input table.

+
+
+
+ +
+
+

Protected Attributes

+
+
+std::map<int, std::reference_wrapper<const VFPInjTable>> m_tables
+
+ +
+
+ +
+
+template<class Scalar>
class VFPProdProperties
+
+

Class which linearly interpolates BHP as a function of rate, tubing head pressure, water fraction, gas fraction, and artificial lift for production VFP tables, and similarly the BHP as a function of the rate and tubing head pressure.

+
+

Public Functions

+
+
+void addTable(const VFPProdTable &new_table)
+

Takes no ownership of data.

+
+ +
+
+template<class EvalWell>
EvalWell bhp(const int table_id, const EvalWell &aqua, const EvalWell &liquid, const EvalWell &vapour, const Scalar thp, const Scalar alq, const Scalar explicit_wfr, const Scalar explicit_gfr, const bool use_expvfp) const
+

Linear interpolation of bhp as a function of the input parameters given as Evalutions Each entry corresponds typically to one well.

+
+
Parameters:
+
    +
  • table_id – Table number to use. A negative entry (e.g., -1) will indicate that no table is used, and the corresponding BHP will be calculated as a constant -1e100.

  • +
  • aqua – Water phase

  • +
  • liquid – Oil phase

  • +
  • vapour – Gas phase

  • +
  • thp – Tubing head pressure

  • +
  • alq – Artificial lift or other parameter

  • +
+
+
Returns:
+

The bottom hole pressure, interpolated/extrapolated linearly using the above parameters from the values in the input table, for each entry in the input ADB objects.

+
+
+
+ +
+
+Scalar bhp(const int table_id, const Scalar aqua, const Scalar liquid, const Scalar vapour, const Scalar thp, const Scalar alq, const Scalar explicit_wfr, const Scalar explicit_gfr, const bool use_expvfp) const
+

Linear interpolation of bhp as a function of the input parameters

+
+
Parameters:
+
    +
  • table_id – Table number to use

  • +
  • aqua – Water phase

  • +
  • liquid – Oil phase

  • +
  • vapour – Gas phase

  • +
  • thp – Tubing head pressure

  • +
  • alq – Artificial lift or other parameter

  • +
+
+
Returns:
+

The bottom hole pressure, interpolated/extrapolated linearly using the above parameters from the values in the input table.

+
+
+
+ +
+
+Scalar thp(const int table_id, const Scalar aqua, const Scalar liquid, const Scalar vapour, const Scalar bhp, const Scalar alq, const Scalar explicit_wrf, const Scalar explicit_gfr, const bool use_expvfp) const
+

Linear interpolation of thp as a function of the input parameters

+
+
Parameters:
+
    +
  • table_id – Table number to use

  • +
  • aqua – Water phase

  • +
  • liquid – Oil phase

  • +
  • vapour – Gas phase

  • +
  • bhp – Bottom hole pressure

  • +
  • alq – Artificial lift or other parameter

  • +
+
+
Returns:
+

The tubing hole pressure, interpolated/extrapolated linearly using the above parameters from the values in the input table.

+
+
+
+ +
+
+const VFPProdTable &getTable(const int table_id) const
+

Returns the table associated with the ID, or throws an exception if the table does not exist

+
+ +
+
+bool hasTable(const int table_id) const
+

Check whether there is table associated with ID

+
+ +
+
+inline bool empty() const
+

Returns true if no vfp tables are in the current map

+
+ +
+
+Scalar minimumBHP(const int table_id, const Scalar thp, const Scalar wfr, const Scalar gfr, const Scalar alq) const
+

Returns minimum bhp for given thp, wfr, gfr and alq

+
+ +
+
+

Protected Functions

+
+
+std::vector<Scalar> bhpwithflo(const std::vector<Scalar> &flos, const int table_id, const Scalar wfr, const Scalar gfr, const Scalar thp, const Scalar alq, const Scalar dp) const
+
+ +
+
+

Protected Attributes

+
+
+std::map<int, std::reference_wrapper<const VFPProdTable>> m_tables
+
+ +
+
+ +
+
+template<class Scalar>
class VFPProperties
+
+#include <VFPProperties.hpp>
+

A thin wrapper class that holds one VFPProdProperties and one VFPInjProperties object.

+
+

Public Functions

+
+
+inline VFPProperties(const std::vector<std::reference_wrapper<const VFPInjTable>> &inj_tables, const std::vector<std::reference_wrapper<const VFPProdTable>> &prod_tables, const WellState<Scalar> &well_state)
+

Constructor Takes no ownership of data.

+
+
Parameters:
+
    +
  • inj_tables – A map of different VFPINJ tables.

  • +
  • prod_tables – A map of different VFPPROD tables.

  • +
+
+
+
+ +
+
+inline const VFPInjProperties<Scalar> *getInj() const
+

Returns the VFP properties for injection wells

+
+ +
+
+inline const VFPProdProperties<Scalar> *getProd() const
+

Returns the VFP properties for production wells

+
+ +
+
+inline Scalar getExplicitWFR(const int table_id, const std::size_t well_index) const
+
+ +
+
+inline Scalar getExplicitGFR(const int table_id, const std::size_t well_index) const
+
+ +
+
+

Private Members

+
+
+VFPInjProperties<Scalar> m_inj
+
+ +
+
+VFPProdProperties<Scalar> m_prod
+
+ +
+
+const WellState<Scalar> &well_state_
+
+ +
+
+ +
+
+struct ViolationSample
+

Sample of consistency check violations at single severity level.

+
+

Public Functions

+
+
+void clear()
+

Clear contents of all data members.

+
+ +
+
+

Public Members

+
+
+std::vector<std::size_t> count = {}
+

Number of consistency check violations.

+

Size equal to number of consistency checks.

+
+ +
+
+std::vector<std::size_t> pointID = {}
+

Sample of point IDs for violated consistency checks.

+

numSamplePoints_ allocated for each consistency check. Number of valid entries for check i is minimum of numSamplePoints_ and

count[i] 
+
+
+.

+
+ +
+
+std::vector<Scalar> checkValues = {}
+

Scalar values for each sampled point.

+

numSamplePoints_ allocated for each individual check, and the number of values per check determined by

Check::numExportedCheckValues() 
+
+
+. Number of valid entries for check i is minimum of numSamplePoints_ and
count[i] 
+
+
+.

+
+ +
+
+ +
+
+template<class Scalar>
class VoigtArray : public Opm::VoigtContainer<std::vector<Scalar>>
+
+#include <VoigtArray.hpp>
+
+

Public Functions

+
+
+VoigtArray() = default
+
+ +
+
+explicit VoigtArray(const std::size_t size)
+
+ +
+
+void resize(const std::size_t size)
+
+ +
+
+Scalar operator()(const VoigtIndex idx, const std::size_t i) const
+
+ +
+
+Scalar &operator()(const VoigtIndex idx, const std::size_t i)
+
+ +
+
+void assign(const std::size_t i, const VoigtContainer<Scalar> &array)
+
+ +
+
+ +
+
+template<class T>
class VoigtContainer
+
+#include <VoigtArray.hpp>
+

Subclassed by Opm::SymmTensor< T >

+
+

Public Functions

+
+
+VoigtContainer() = default
+
+ +
+
+template<class Array>
VoigtContainer(const Array &array)
+
+ +
+
+inline VoigtContainer(std::initializer_list<T> value)
+
+ +
+
+inline const T &operator[](const VoigtIndex idx) const
+
+ +
+
+inline T &operator[](const VoigtIndex idx)
+
+ +
+
+inline constexpr std::size_t size() const
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr auto indices = std::array<VoigtIndex, 9>{Opm::VoigtIndex::XX, Opm::VoigtIndex::XY, Opm::VoigtIndex::XZ, Opm::VoigtIndex::YX, Opm::VoigtIndex::YY, Opm::VoigtIndex::YZ, Opm::VoigtIndex::ZX, Opm::VoigtIndex::ZY, Opm::VoigtIndex::ZZ,}
+
+ +
+
+static constexpr auto unique_indices = std::array<VoigtIndex, 6>{Opm::VoigtIndex::XX, Opm::VoigtIndex::YY, Opm::VoigtIndex::ZZ, Opm::VoigtIndex::YZ, Opm::VoigtIndex::XZ, Opm::VoigtIndex::XY}
+
+ +
+
+static constexpr auto diag_indices = std::array<VoigtIndex, 3>{Opm::VoigtIndex::XX, Opm::VoigtIndex::YY, Opm::VoigtIndex::ZZ,}
+
+ +
+
+

Protected Attributes

+
+
+std::array<T, 6> data_ = {}
+
+ +
+
+ +
+
+template<class TypeTag>
class VtkBlackOilEnergyModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for the black oil model’s energy related quantities.

+
+

Public Functions

+
+
+inline explicit VtkBlackOilEnergyModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the multi-phase VTK output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableEnergy
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using PhaseBuffer = typename ParentType::PhaseBuffer
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+

Private Members

+
+
+VtkBlackoilEnergyParams params_ = {}
+
+ +
+
+ScalarBuffer rockInternalEnergy_ = {}
+
+ +
+
+ScalarBuffer totalThermalConductivity_ = {}
+
+ +
+
+PhaseBuffer fluidInternalEnergies_ = {}
+
+ +
+
+PhaseBuffer fluidEnthalpies_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkBlackoilEnergyParams
+
+

Struct holding the parameters for VtkBlackoilEnergyOutputModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool rockInternalEnergyOutput_
+
+ +
+
+bool totalThermalConductivityOutput_
+
+ +
+
+bool fluidInternalEnergiesOutput_
+
+ +
+
+bool fluidEnthalpiesOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkBlackOilMICPModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for the MICP model’s related quantities.

+
+

Public Functions

+
+
+inline explicit VtkBlackOilMICPModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the multi-phase VTK output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableMICP
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+

Private Members

+
+
+VtkBlackoilMICPParams params_ = {}
+
+ +
+
+ScalarBuffer microbialConcentration_ = {}
+
+ +
+
+ScalarBuffer oxygenConcentration_ = {}
+
+ +
+
+ScalarBuffer ureaConcentration_ = {}
+
+ +
+
+ScalarBuffer biofilmConcentration_ = {}
+
+ +
+
+ScalarBuffer calciteConcentration_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkBlackoilMICPParams
+
+

Struct holding the parameters for VtkBlackoilMICPModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool microbialConcentrationOutput_
+
+ +
+
+bool oxygenConcentrationOutput_
+
+ +
+
+bool ureaConcentrationOutput_
+
+ +
+
+bool biofilmConcentrationOutput_
+
+ +
+
+bool calciteConcentrationOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkBlackOilModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for the black oil model’s parameters.

+
+

Public Functions

+
+
+inline explicit VtkBlackOilModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the multi-phase VTK output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator oilPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator gasPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator waterPhaseIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator gasCompIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator oilCompIdx
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator waterCompIdx
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+

Private Members

+
+
+VtkBlackoilParams params_ = {}
+
+ +
+
+ScalarBuffer gasDissolutionFactor_ = {}
+
+ +
+
+ScalarBuffer oilVaporizationFactor_ = {}
+
+ +
+
+ScalarBuffer oilFormationVolumeFactor_ = {}
+
+ +
+
+ScalarBuffer gasFormationVolumeFactor_ = {}
+
+ +
+
+ScalarBuffer waterFormationVolumeFactor_ = {}
+
+ +
+
+ScalarBuffer oilSaturationPressure_ = {}
+
+ +
+
+ScalarBuffer gasSaturationPressure_ = {}
+
+ +
+
+ScalarBuffer saturatedOilGasDissolutionFactor_ = {}
+
+ +
+
+ScalarBuffer saturatedGasOilVaporizationFactor_ = {}
+
+ +
+
+ScalarBuffer oilSaturationRatio_ = {}
+
+ +
+
+ScalarBuffer gasSaturationRatio_ = {}
+
+ +
+
+ScalarBuffer primaryVarsMeaningPressure_ = {}
+
+ +
+
+ScalarBuffer primaryVarsMeaningWater_ = {}
+
+ +
+
+ScalarBuffer primaryVarsMeaningGas_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkBlackoilParams
+
+

Struct holding the parameters for VtkBlackoilOutputModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool gasDissolutionFactorOutput_
+
+ +
+
+bool oilVaporizationFactorOutput_
+
+ +
+
+bool oilFormationVolumeFactorOutput_
+
+ +
+
+bool gasFormationVolumeFactorOutput_
+
+ +
+
+bool waterFormationVolumeFactorOutput_
+
+ +
+
+bool oilSaturationPressureOutput_
+
+ +
+
+bool gasSaturationPressureOutput_
+
+ +
+
+bool saturatedOilGasDissolutionFactorOutput_
+
+ +
+
+bool saturatedGasOilVaporizationFactorOutput_
+
+ +
+
+bool saturationRatiosOutput_
+
+ +
+
+bool primaryVarsMeaningOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+struct VtkBlackOilPolymer
+
+
+ +
+
+template<class TypeTag>
class VtkBlackOilPolymerModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for the black oil model’s polymer related quantities.

+
+

Public Functions

+
+
+inline explicit VtkBlackOilPolymerModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the multi-phase VTK output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator enablePolymer
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+

Private Members

+
+
+VtkBlackoilPolymerParams params_ = {}
+
+ +
+
+ScalarBuffer polymerConcentration_ = {}
+
+ +
+
+ScalarBuffer polymerDeadPoreVolume_ = {}
+
+ +
+
+ScalarBuffer polymerRockDensity_ = {}
+
+ +
+
+ScalarBuffer polymerAdsorption_ = {}
+
+ +
+
+ScalarBuffer polymerViscosityCorrection_ = {}
+
+ +
+
+ScalarBuffer waterViscosityCorrection_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkBlackoilPolymerParams
+
+

Struct holding the parameters for VtkBlackoilPolymerModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool polymerConcentrationOutput_
+
+ +
+
+bool polymerDeadPoreVolumeOutput_
+
+ +
+
+bool polymerRockDensityOutput_
+
+ +
+
+bool polymerAdsorptionOutput_
+
+ +
+
+bool polymerViscosityCorrectionOutput_
+
+ +
+
+bool waterViscosityCorrectionOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkBlackOilSolventModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for the black oil model’s solvent related quantities.

+
+

Public Functions

+
+
+inline explicit VtkBlackOilSolventModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the multi-phase VTK output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator enableSolvent
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+

Private Members

+
+
+VtkBlackOilSolventParams params_ = {}
+
+ +
+
+ScalarBuffer solventSaturation_ = {}
+
+ +
+
+ScalarBuffer solventRsw_ = {}
+
+ +
+
+ScalarBuffer solventDensity_ = {}
+
+ +
+
+ScalarBuffer solventViscosity_ = {}
+
+ +
+
+ScalarBuffer solventMobility_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkBlackOilSolventParams
+
+

Struct holding the parameters for VtkBlackoilPolymerModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool solventSaturationOutput_
+
+ +
+
+bool solventRswOutput_
+
+ +
+
+bool solventDensityOutput_
+
+ +
+
+bool solventViscosityOutput_
+
+ +
+
+bool solventMobilityOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkCompositionModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for the fluid composition.

+

This module deals with the following quantities:

    +
  • Mole fraction of a component in a fluid phase

  • +
  • Mass fraction of a component in a fluid phase

  • +
  • Molarity (i.e. molar concentration) of a component in a fluid phase

  • +
  • Fugacity of all components

  • +
  • FugacityCoefficient of all components in all phases

  • +
+

+
+

Public Functions

+
+
+inline explicit VtkCompositionModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the Vtk output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numComponents
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using ComponentBuffer = typename ParentType::ComponentBuffer
+
+ +
+
+using PhaseComponentBuffer = typename ParentType::PhaseComponentBuffer
+
+ +
+
+

Private Members

+
+
+VtkCompositionParams params_ = {}
+
+ +
+
+PhaseComponentBuffer moleFrac_ = {}
+
+ +
+
+PhaseComponentBuffer massFrac_ = {}
+
+ +
+
+PhaseComponentBuffer molarity_ = {}
+
+ +
+
+ComponentBuffer totalMassFrac_ = {}
+
+ +
+
+ComponentBuffer totalMoleFrac_ = {}
+
+ +
+
+ComponentBuffer fugacity_ = {}
+
+ +
+
+PhaseComponentBuffer fugacityCoeff_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkCompositionParams
+
+

Struct holding the parameters for VtkCompositionModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool massFracOutput_
+
+ +
+
+bool moleFracOutput_
+
+ +
+
+bool totalMassFracOutput_
+
+ +
+
+bool totalMoleFracOutput_
+
+ +
+
+bool molarityOutput_
+
+ +
+
+bool fugacityOutput_
+
+ +
+
+bool fugacityCoeffOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkDiffusionModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for quantities which make sense for models which incorperate molecular diffusion.

+

This module deals with the following quantities:

    +
  • Molecular diffusion coefficients of all components in all fluid phases

  • +
  • Effective molecular diffusion coefficients of the porous medium of all components in all fluid phases

  • +
+

+
+

Public Functions

+
+
+inline explicit VtkDiffusionModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quanties relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the Vtk output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numComponents
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using Toolbox = MathToolbox<Evaluation>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using PhaseBuffer = typename ParentType::PhaseBuffer
+
+ +
+
+using PhaseComponentBuffer = typename ParentType::PhaseComponentBuffer
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+

Private Members

+
+
+VtkDiffusionParams params_ = {}
+
+ +
+
+PhaseBuffer tortuosity_ = {}
+
+ +
+
+PhaseComponentBuffer diffusionCoefficient_ = {}
+
+ +
+
+PhaseComponentBuffer effectiveDiffusionCoefficient_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkDiffusionParams
+
+

Struct holding the parameters for VtkDiffusionModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool tortuosityOutput_
+
+ +
+
+bool diffusionCoefficientOutput_
+
+ +
+
+bool effectiveDiffusionCoefficientOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkDiscreteFractureModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for quantities which make sense for all models which deal with discrete fractures in porous media.

+

This module deals with the following quantities:

    +
  • Saturations of all fluid phases in the fracture

  • +
  • Mobilities of all fluid phases in the fracture

  • +
  • Relative permeabilities of all fluid phases in the fracture

  • +
  • Porosity of the medium in the fracture

  • +
  • Norm of the intrinsic permeability of the medium in the fracture

  • +
+

+
+

Public Functions

+
+
+inline explicit VtkDiscreteFractureModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the multi-phase VTK output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator dim
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator dimWorld
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using Vanguard = GetPropType<TypeTag, Properties::Vanguard>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using DiscBaseOutputModule = GetPropType<TypeTag, Properties::DiscBaseOutputModule>
+
+ +
+
+using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using PhaseBuffer = typename ParentType::PhaseBuffer
+
+ +
+
+using PhaseVectorBuffer = typename ParentType::PhaseVectorBuffer
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+

Private Members

+
+
+VtkDiscreteFractureParams params_ = {}
+
+ +
+
+PhaseBuffer fractureSaturation_ = {}
+
+ +
+
+PhaseBuffer fractureMobility_ = {}
+
+ +
+
+PhaseBuffer fractureRelativePermeability_ = {}
+
+ +
+
+ScalarBuffer fracturePorosity_ = {}
+
+ +
+
+ScalarBuffer fractureVolumeFraction_ = {}
+
+ +
+
+ScalarBuffer fractureIntrinsicPermeability_ = {}
+
+ +
+
+PhaseVectorBuffer fractureVelocity_ = {}
+
+ +
+
+PhaseBuffer fractureVelocityWeight_ = {}
+
+ +
+
+PhaseVectorBuffer potentialGradient_ = {}
+
+ +
+
+PhaseBuffer potentialWeight_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkDiscreteFractureParams
+
+

Struct holding the parameters for VtkDiscreteFractureModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool saturationOutput_
+
+ +
+
+bool mobilityOutput_
+
+ +
+
+bool relativePermeabilityOutput_
+
+ +
+
+bool porosityOutput_
+
+ +
+
+bool intrinsicPermeabilityOutput_
+
+ +
+
+bool volumeFractionOutput_
+
+ +
+
+bool velocityOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkEnergyModule : public BaseOutputModule<TypeTag>
+
+#include <vtkenergymodule.hpp>
+

VTK output module for quantities which make sense for models which assume thermal equilibrium.

+

This module deals with the following quantities:

    +
  • Specific enthalpy of all fluid phases

  • +
  • Specific internal energy of all fluid phases

  • +
  • Volumetric internal energy of the solid phase

  • +
  • Total thermal conductivity, i.e. the conductivity of the solid and all fluid phases combined

  • +
+

+
+

Public Functions

+
+
+inline explicit VtkEnergyModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quanties relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the Vtk output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+using PhaseBuffer = typename ParentType::PhaseBuffer
+
+ +
+
+using Toolbox = typename Opm::MathToolbox<Evaluation>
+
+ +
+
+using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+

Private Members

+
+
+VtkEnergyParams params_ = {}
+
+ +
+
+PhaseBuffer enthalpy_ = {}
+
+ +
+
+PhaseBuffer internalEnergy_ = {}
+
+ +
+
+ScalarBuffer thermalConductivity_ = {}
+
+ +
+
+ScalarBuffer solidInternalEnergy_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkEnergyParams
+
+#include <vtkenergyparams.hpp>
+

Struct holding the parameters for VtkEnergyModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool solidInternalEnergyOutput_
+
+ +
+
+bool thermalConductivityOutput_
+
+ +
+
+bool enthalpyOutput_
+
+ +
+
+bool internalEnergyOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkMultiPhaseModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for quantities which make sense for all models which deal with multiple fluid phases in porous media that don’t use flashy concepts like interfacial area.

+

This module deals with the following quantities:

    +
  • Pressures of all fluid phases

  • +
  • Densities of all fluid phases

  • +
  • Saturations of all fluid phases

  • +
  • Mobilities of all fluid phases

  • +
  • Relative permeabilities of all fluid phases

  • +
  • Viscosities of all fluid phases

  • +
  • Average molar masses of all fluid phases

  • +
  • Porosity of the medium

  • +
  • Norm of the intrinsic permeability of the medium

  • +
+

+
+

Public Functions

+
+
+inline explicit VtkMultiPhaseModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities seen on an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+inline bool needExtensiveQuantities() const override
+

Returns true iff the module needs to access the extensive quantities of a context to do its job.

+

For example, this happens if velocities or gradients should be written. Always returning true here does not do any harm from the correctness perspective, but it slows down writing the output fields.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the multi-phase VTK output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator dimWorld
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using DiscBaseOutputModule = GetPropType<TypeTag, Properties::DiscBaseOutputModule>
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+using VectorBuffer = typename ParentType::VectorBuffer
+
+ +
+
+using TensorBuffer = typename ParentType::TensorBuffer
+
+ +
+
+using PhaseBuffer = typename ParentType::PhaseBuffer
+
+ +
+
+using DimVector = Dune::FieldVector<Scalar, dimWorld>
+
+ +
+
+using PhaseVectorBuffer = std::array<VectorBuffer, numPhases>
+
+ +
+
+

Private Members

+
+
+VtkMultiPhaseParams params_ = {}
+
+ +
+
+ScalarBuffer extrusionFactor_ = {}
+
+ +
+
+PhaseBuffer pressure_ = {}
+
+ +
+
+PhaseBuffer density_ = {}
+
+ +
+
+PhaseBuffer saturation_ = {}
+
+ +
+
+PhaseBuffer mobility_ = {}
+
+ +
+
+PhaseBuffer relativePermeability_ = {}
+
+ +
+
+PhaseBuffer viscosity_ = {}
+
+ +
+
+PhaseBuffer averageMolarMass_ = {}
+
+ +
+
+ScalarBuffer porosity_ = {}
+
+ +
+
+TensorBuffer intrinsicPermeability_ = {}
+
+ +
+
+PhaseVectorBuffer velocity_ = {}
+
+ +
+
+PhaseBuffer velocityWeight_ = {}
+
+ +
+
+PhaseVectorBuffer potentialGradient_ = {}
+
+ +
+
+PhaseBuffer potentialWeight_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkMultiPhaseParams
+
+

Struct holding the parameters for VtkMultiPhaseModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool extrusionFactorOutput_
+
+ +
+
+bool pressureOutput_
+
+ +
+
+bool densityOutput_
+
+ +
+
+bool saturationOutput_
+
+ +
+
+bool mobilityOutput_
+
+ +
+
+bool relativePermeabilityOutput_
+
+ +
+
+bool viscosityOutput_
+
+ +
+
+bool averageMolarMassOutput_
+
+ +
+
+bool porosityOutput_
+
+ +
+
+bool intrinsicPermeabilityOutput_
+
+ +
+
+bool velocityOutput_
+
+ +
+
+bool potentialGradientOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkPhasePresenceModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for the fluid composition.

+
+

Public Functions

+
+
+inline explicit VtkPhasePresenceModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quanties relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the Vtk output module.

+
+ +
+
+

Private Types

+
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using VtkMultiWriter = Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+

Private Members

+
+
+VtkPhasePresenceParams params_ = {}
+
+ +
+
+ScalarBuffer phasePresence_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkPhasePresenceParams
+
+

Struct holding the parameters for VtkPhasePresenceModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool phasePresenceOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkPrimaryVarsModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for the fluid composition.

+
+

Public Functions

+
+
+inline explicit VtkPrimaryVarsModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the Vtk output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numEq
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+using EqBuffer = typename ParentType::EqBuffer
+
+ +
+
+

Private Members

+
+
+VtkPrimaryVarsParams params_ = {}
+
+ +
+
+EqBuffer primaryVars_ = {}
+
+ +
+
+ScalarBuffer processRank_ = {}
+
+ +
+
+ScalarBuffer dofIndex_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkPrimaryVarsParams
+
+

Struct holding the parameters for VtkPrimaryPhaseModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool primaryVarsOutput_
+
+ +
+
+bool processRankOutput_
+
+ +
+
+bool dofIndexOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkPTFlashModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for the PT Flash calculation This module deals with the following quantities: K, equilibrium ratio for all the components L, liquid fraction in the two-phase system.

+
+

Public Functions

+
+
+inline explicit VtkPTFlashModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the Vtk output module.

+
+ +
+
+

Private Types

+
+
+enum [anonymous]
+

Values:

+
+
+enumerator numPhases
+
+ +
+ +
+
+enum [anonymous]
+

Values:

+
+
+enumerator numComponents
+
+ +
+ +
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using ComponentBuffer = typename ParentType::ComponentBuffer
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+

Private Members

+
+
+VtkPtFlashParams params_ = {}
+
+ +
+
+ComponentBuffer K_ = {}
+
+ +
+
+ScalarBuffer L_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkPtFlashParams
+
+

Struct holding the parameters for VtkPtFlashModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool LOutput_
+
+ +
+
+bool equilConstOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkTemperatureModule : public BaseOutputModule<TypeTag>
+
+

VTK output module for the temperature in which assume thermal equilibrium.

+
+

Public Functions

+
+
+inline explicit VtkTemperatureModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the Vtk output module.

+
+ +
+
+

Private Types

+
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+

Private Members

+
+
+VtkTemperatureParams params_ = {}
+
+ +
+
+ScalarBuffer temperature_ = {}
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkTemperatureParams
+
+

Struct holding the parameters for VtkTemperatureModule.

+
+

Public Functions

+
+
+void read()
+

Reads the parameter values from the parameter system.

+
+ +
+
+

Public Members

+
+
+bool temperatureOutput_
+
+ +
+
+

Public Static Functions

+
+
+static void registerParameters()
+

Registers the parameters in parameter system.

+
+ +
+
+ +
+
+template<class TypeTag>
class VtkTracerModule : public BaseOutputModule<TypeTag>
+
+#include <VtkTracerModule.hpp>
+

VTK output module for the tracer model’s parameters.

+
+

Public Functions

+
+
+inline explicit VtkTracerModule(const Simulator &simulator)
+
+ +
+
+inline void allocBuffers() override
+

Allocate memory for the scalar fields we would like to write to the VTK file.

+
+ +
+
+inline void processElement(const ElementContext &elemCtx) override
+

Modify the internal buffers according to the intensive quantities relevant for an element.

+
+ +
+
+inline void commitBuffers(BaseOutputWriter &baseWriter) override
+

Add all buffers to the VTK output writer.

+
+ +
+
+

Public Static Functions

+
+
+static inline void registerParameters()
+

Register all run-time parameters for the tracer VTK output module.

+
+ +
+
+

Private Types

+
+
+using ParentType = BaseOutputModule<TypeTag>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using Evaluation = GetPropType<TypeTag, Properties::Evaluation>
+
+ +
+
+using ElementContext = GetPropType<TypeTag, Properties::ElementContext>
+
+ +
+
+using GridView = GetPropType<TypeTag, Properties::GridView>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using VtkMultiWriter = ::Opm::VtkMultiWriter<GridView, vtkFormat>
+
+ +
+
+using BufferType = typename ParentType::BufferType
+
+ +
+
+using ScalarBuffer = typename ParentType::ScalarBuffer
+
+ +
+
+

Private Members

+
+
+std::vector<ScalarBuffer> eclFreeTracerConcentration_
+
+ +
+
+std::vector<ScalarBuffer> eclSolTracerConcentration_
+
+ +
+
+

Private Static Functions

+
+
+static inline bool eclTracerConcentrationOutput_()
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr auto vtkFormat = getPropValue<TypeTag, Properties::VtkOutputFormat>()
+
+ +
+
+ +
+
+struct VtkWriteAverageMolarMasses
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteBiofilmConcentration
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteCalciteConcentration
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteDensities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteDiffusionCoefficients
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteDofIndex
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteEffectiveDiffusionCoefficients
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteEnthalpies
+
+#include <vtkenergyparams.hpp>
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteEquilibriumConstants
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteExtrusionFactor
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteFilterVelocities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteFluidEnthalpies
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteFluidInternalEnergies
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteFractureFilterVelocities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteFractureIntrinsicPermeabilities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteFractureMobilities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteFracturePorosity
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteFractureRelativePermeabilities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteFractureSaturations
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteFractureVolumeFraction
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteFugacities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteFugacityCoeffs
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteGasDissolutionFactor
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteGasFormationVolumeFactor
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteGasSaturationPressure
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteInternalEnergies
+
+#include <vtkenergyparams.hpp>
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteIntrinsicPermeabilities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteLiquidMoleFractions
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteMassFractions
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteMicrobialConcentration
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteMobilities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteMolarities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteMoleFractions
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteOilFormationVolumeFactor
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteOilSaturationPressure
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteOilVaporizationFactor
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteOxygenConcentration
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWritePhasePresence
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWritePolymerAdsorption
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWritePolymerConcentration
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWritePolymerDeadPoreVolume
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWritePolymerRockDensity
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWritePolymerViscosityCorrection
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWritePorosity
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWritePotentialGradients
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWritePressures
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWritePrimaryVars
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWritePrimaryVarsMeaning
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteProcessRank
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteRelativePermeabilities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteRockInternalEnergy
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteSaturatedGasOilVaporizationFactor
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteSaturatedOilGasDissolutionFactor
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteSaturationRatios
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteSaturations
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteSolidInternalEnergy
+
+#include <vtkenergyparams.hpp>
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteSolventDensity
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteSolventMobility
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteSolventRsw
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteSolventSaturation
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteSolventViscosity
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteTemperature
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteThermalConductivity
+
+#include <vtkenergyparams.hpp>
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteTortuosities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteTotalMassFractions
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteTotalMoleFractions
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteTotalThermalConductivity
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteTracerConcentration
+
+#include <VtkTracerModule.hpp>
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteUreaConcentration
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+struct VtkWriteViscosities
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteWaterFormationVolumeFactor
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = false
+
+ +
+
+ +
+
+struct VtkWriteWaterViscosityCorrection
+
+
+

Public Static Attributes

+
+
+static constexpr bool value = true
+
+ +
+
+ +
+
+template<class FluidSystem>
class Water
+
+#include <InitStateEquil.hpp>
+
+

Public Functions

+
+
+Water(const TabulatedFunction &tempVdTable, const TabulatedFunction &saltVdTable, const int pvtRegionIdx, const Scalar normGrav)
+
+ +
+
+Scalar operator()(const Scalar depth, const Scalar press) const
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using TabulatedFunction = Tabulated1DFunction<Scalar>
+
+ +
+
+

Private Functions

+
+
+Scalar density(const Scalar depth, const Scalar press) const
+
+ +
+
+

Private Members

+
+
+const TabulatedFunction &tempVdTable_
+
+ +
+
+const TabulatedFunction &saltVdTable_
+
+ +
+
+const int pvtRegionIdx_
+
+ +
+
+const Scalar g_
+
+ +
+
+ +
+
+template<class Scalar>
struct WaterOnlyThreshold
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1.0
+
+ +
+
+ +
+
+struct WBPCalcID
+
+

Public Members

+
+
+std::optional<typename std::vector<WellInterfaceGeneric<Scalar>*>::size_type> openWellIdx_ = {}
+
+ +
+
+std::size_t wbpCalcIdx_ = {}
+
+ +
+
+ +
+
+template<class FluidSystem>
class WellAssemble
+
+#include <WellAssemble.hpp>
+
+

Public Functions

+
+
+explicit WellAssemble(const WellInterfaceFluidSystem<FluidSystem> &well)
+
+ +
+
+template<class EvalWell>
void assembleControlEqProd(const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const WellProductionControls &controls, const EvalWell &bhp, const std::vector<EvalWell> &rates, const std::function<EvalWell()> &bhp_from_thp, EvalWell &control_eq, DeferredLogger &deferred_logger) const
+
+ +
+
+template<class EvalWell>
void assembleControlEqInj(const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const WellInjectionControls &controls, const EvalWell &bhp, const EvalWell &injection_rate, const std::function<EvalWell()> &bhp_from_thp, EvalWell &control_eq, DeferredLogger &deferred_logger) const
+
+ +
+
+template<class EvalWell>
void assembleControlEqProd(const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const Well::ProductionControls &controls, const EvalWell &bhp, const std::vector<EvalWell> &rates, const std::function<EvalWell()> &bhp_from_thp, EvalWell &control_eq, DeferredLogger &deferred_logger) const
+
+ +
+
+template<class EvalWell>
void assembleControlEqInj(const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const Well::InjectionControls &controls, const EvalWell &bhp, const EvalWell &injection_rate, const std::function<EvalWell()> &bhp_from_thp, EvalWell &control_eq, DeferredLogger &deferred_logger) const
+
+ +
+
+

Private Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+

Private Members

+
+
+const WellInterfaceFluidSystem<FluidSystem> &well_
+
+ +
+
+

Private Static Attributes

+
+
+static constexpr int Water = BlackoilPhases::Aqua
+
+ +
+
+static constexpr int Oil = BlackoilPhases::Liquid
+
+ +
+
+static constexpr int Gas = BlackoilPhases::Vapour
+
+ +
+
+ +
+
+template<class Scalar>
class WellBhpThpCalculator
+
+

Class for computing BHP limits.

+
+

Public Functions

+
+
+inline explicit WellBhpThpCalculator(const WellInterfaceGeneric<Scalar> &well)
+

Constructor sets reference to well.

+
+ +
+
+bool wellHasTHPConstraints(const SummaryState &summaryState) const
+

Checks if well has THP constraints.

+
+ +
+
+Scalar getTHPConstraint(const SummaryState &summaryState) const
+

Get THP constraint for well.

+
+ +
+
+Scalar mostStrictBhpFromBhpLimits(const SummaryState &summaryState) const
+

Obtain the most strict BHP from BHP limits.

+
+ +
+
+Scalar calculateThpFromBhp(const std::vector<Scalar> &rates, const Scalar bhp, const Scalar rho, const std::optional<Scalar> &alq, const Scalar thp_limit, DeferredLogger &deferred_logger) const
+

Calculates THP from BHP.

+
+ +
+
+std::optional<Scalar> computeBhpAtThpLimitProd(const std::function<std::vector<Scalar>(const Scalar)> &frates, const SummaryState &summary_state, const Scalar maxPerfPress, const Scalar rho, const Scalar alq_value, const Scalar thp_limit, DeferredLogger &deferred_logger) const
+

Compute BHP from THP limit for a producer.

+
+ +
+
+std::optional<Scalar> computeBhpAtThpLimitInj(const std::function<std::vector<Scalar>(const Scalar)> &frates, const SummaryState &summary_state, const Scalar rho, const Scalar flo_rel_tol, const int max_iteration, const bool throwOnError, DeferredLogger &deferred_logger) const
+

Compute BHP from THP limit for an injector.

+
+ +
+
+void updateThp(const Scalar rho, const std::function<Scalar()> &alq_value, const std::array<unsigned, 3> &active, WellState<Scalar> &well_state, const SummaryState &summary_state, DeferredLogger &deferred_logger) const
+

Update THP.

+
+ +
+
+template<class EvalWell>
EvalWell calculateBhpFromThp(const WellState<Scalar> &well_state, const std::vector<EvalWell> &rates, const Well &well, const SummaryState &summaryState, const Scalar rho, DeferredLogger &deferred_logger) const
+
+ +
+
+Scalar calculateMinimumBhpFromThp(const WellState<Scalar> &well_state, const Well &well, const SummaryState &summaryState, const Scalar rho) const
+
+ +
+
+bool isStableSolution(const WellState<Scalar> &well_state, const Well &well, const std::vector<Scalar> &rates, const SummaryState &summaryState) const
+
+ +
+
+std::optional<Scalar> estimateStableBhp(const WellState<Scalar> &well_state, const Well &well, const std::vector<Scalar> &rates, const Scalar rho, const SummaryState &summaryState) const
+
+ +
+
+std::pair<Scalar, Scalar> getFloIPR(const WellState<Scalar> &well_state, const Well &well, const SummaryState &summary_state) const
+
+ +
+
+

Public Static Functions

+
+
+static bool bruteForceBracketCommonTHP(const std::function<Scalar(const Scalar)> &eq, const std::array<Scalar, 2> &range, Scalar &low, Scalar &high, std::optional<Scalar> &approximate_solution, const Scalar &limit, DeferredLogger &deferred_logger)
+

Find limits using brute-force solver.

+
+ +
+
+static bool bruteForceBracketCommonTHP(const std::function<Scalar(const Scalar)> &eq, Scalar &min_thp, Scalar &max_thp)
+

Find limits using brute-force solver.

+
+ +
+
+

Private Functions

+
+
+template<class ErrorPolicy>
std::optional<Scalar> computeBhpAtThpLimitInjImpl(const std::function<std::vector<Scalar>(const Scalar)> &frates, const SummaryState &summary_state, const Scalar rho, const Scalar flo_rel_tol, const int max_iteration, DeferredLogger &deferred_logger) const
+

Compute BHP from THP limit for an injector - implementation.

+
+ +
+
+std::optional<Scalar> bhpMax(const std::function<Scalar(const Scalar)> &fflo, const Scalar bhp_limit, const Scalar maxPerfPress, const Scalar vfp_flo_front, DeferredLogger &deferred_logger) const
+

Calculate max BHP.

+
+ +
+
+std::optional<Scalar> computeBhpAtThpLimit(const std::function<std::vector<Scalar>(const Scalar)> &frates, const std::function<Scalar(const std::vector<Scalar>)> &fbhp, const std::array<Scalar, 2> &range, DeferredLogger &deferred_logger) const
+

Common code for finding BHP from THP limit for producers/injectors.

+
+ +
+
+Scalar getVfpBhpAdjustment(const Scalar bph_tab, const Scalar thp_limit) const
+

Get pressure adjustment to the bhp calculated from VFP table.

+
+ +
+
+bool bisectBracket(const std::function<Scalar(const Scalar)> &eq, const std::array<Scalar, 2> &range, Scalar &low, Scalar &high, std::optional<Scalar> &approximate_solution, DeferredLogger &deferred_logger) const
+

Find limits using bisection.

+
+ +
+
+Scalar findThpFromBhpIteratively(const std::function<Scalar(const Scalar, const Scalar)> &thp_func, const Scalar bhp, const Scalar thp_limit, const Scalar dp, DeferredLogger &deferred_logger) const
+
+ +
+
+

Private Members

+
+
+const WellInterfaceGeneric<Scalar> &well_
+

Reference to well interface.

+
+ +
+
+

Private Static Functions

+
+
+static bool bruteForceBracket(const std::function<Scalar(const Scalar)> &eq, const std::array<Scalar, 2> &range, Scalar &low, Scalar &high, DeferredLogger &deferred_logger)
+

Find limits using brute-force solver.

+
+ +
+
+ +
+
+template<class TypeTag, class Model>
class WellConnectionAuxiliaryModule : public BaseAuxiliaryModule<TypeTag>
+
+
+

Public Types

+
+
+using NeighborSet = typename ::Opm::BaseAuxiliaryModule<TypeTag>::NeighborSet
+
+ +
+
+using Domain = SubDomain<Grid>
+
+ +
+
+

Public Functions

+
+
+inline WellConnectionAuxiliaryModule(Model &model, Parallel::Communication comm)
+
+ +
+
+inline unsigned numDofs() const override
+
+ +
+
+inline void addNeighbors(std::vector<NeighborSet> &neighbors) const override
+
+ +
+
+inline void applyInitial() override
+
+ +
+
+inline void linearize(SparseMatrixAdapter &jacobian, GlobalEqVector &res) override
+
+ +
+
+inline void postSolve(GlobalEqVector &deltaX) override
+
+ +
+
+inline void linearizeDomain(const Domain &domain, SparseMatrixAdapter &jacobian, GlobalEqVector &res)
+
+ +
+
+inline void postSolveDomain(const GlobalEqVector &deltaX, const Domain &domain)
+
+ +
+
+template<class Restarter>
inline void deserialize(Restarter&)
+
+ +
+
+template<class Restarter>
inline void serialize(Restarter&)
+

This method writes the complete state of the well to the harddisk.

+
+ +
+
+

Private Types

+
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using GlobalEqVector = GetPropType<TypeTag, Properties::GlobalEqVector>
+
+ +
+
+using SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>
+
+ +
+
+

Private Functions

+
+
+template<class WellType>
inline void linearizeSingleWell(SparseMatrixAdapter &jacobian, GlobalEqVector &res, const WellType &well)
+
+ +
+
+

Private Members

+
+
+Model &model_
+
+ +
+
+GlobalEqVector linearize_res_local_ = {}
+
+ +
+
+Parallel::Communication lin_comm_
+
+ +
+
+ +
+
+template<class Scalar>
class WellConstraints
+
+#include <WellConstraints.hpp>
+

Class for computing well group constraints.

+
+

Public Types

+
+
+using RateConvFunc = std::function<void(const RegionId, const int, const std::vector<Scalar>&, std::vector<Scalar>&)>
+
+ +
+
+

Public Functions

+
+
+inline explicit WellConstraints(const WellInterfaceGeneric<Scalar> &well)
+

Constructor sets reference to well.

+
+ +
+
+bool checkIndividualConstraints(SingleWellState<Scalar> &ws, const SummaryState &summaryState, const RateConvFunc &calcReservoirVoidageRates, bool &thp_limit_violated_but_not_switched, DeferredLogger &deferred_logger, const std::optional<Well::InjectionControls> &inj_controls = std::nullopt, const std::optional<Well::ProductionControls> &prod_controls = std::nullopt) const
+
+ +
+
+

Private Functions

+
+
+WellInjectorCMode activeInjectionConstraint(const SingleWellState<Scalar> &ws, const SummaryState &summaryState, bool &thp_limit_violated_but_not_switched, DeferredLogger &deferred_logger, const std::optional<Well::InjectionControls> &inj_controls = std::nullopt) const
+
+ +
+
+WellProducerCMode activeProductionConstraint(const SingleWellState<Scalar> &ws, const SummaryState &summaryState, const RateConvFunc &calcReservoirVoidageRates, bool &thp_limit_violated_but_not_switched, DeferredLogger &deferred_logger, const std::optional<Well::ProductionControls> &prod_controls = std::nullopt) const
+
+ +
+
+

Private Members

+
+
+const WellInterfaceGeneric<Scalar> &well_
+

Reference to well interface.

+
+ +
+
+ +
+
+template<class T>
class WellContainer
+
+#include <WellContainer.hpp>
+
+

Public Functions

+
+
+WellContainer() = default
+
+ +
+
+inline WellContainer(std::initializer_list<std::pair<std::string, T>> init_list)
+
+ +
+
+inline bool empty() const
+
+ +
+
+inline std::size_t size() const
+
+ +
+
+inline T &add(const std::string &name, T &&value)
+
+ +
+
+inline T &add(const std::string &name, const T &value)
+
+ +
+
+inline bool has(const std::string &name) const
+
+ +
+
+inline void copy_welldata(const WellContainer<T> &other)
+
+ +
+
+inline void copy_welldata(const WellContainer<T> &other, const std::string &name)
+
+ +
+
+inline T &operator[](std::size_t index)
+
+ +
+
+inline const T &operator[](std::size_t index) const
+
+ +
+
+inline T &operator[](const std::string &name)
+
+ +
+
+inline const T &operator[](const std::string &name) const
+
+ +
+
+inline void clear()
+
+ +
+
+inline std::vector<T>::const_iterator begin() const
+
+ +
+
+inline std::vector<T>::const_iterator end() const
+
+ +
+
+inline const std::vector<T> &data() const
+
+ +
+
+inline std::optional<int> well_index(const std::string &wname) const
+
+ +
+
+inline const std::string &well_name(std::size_t well_index) const
+
+ +
+
+inline std::vector<std::string> wells() const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline bool operator==(const WellContainer<T> &rhs) const
+
+ +
+
+

Public Static Functions

+
+
+static inline WellContainer serializationTestObject(const T &data)
+
+ +
+
+

Private Functions

+
+
+inline void update_if(std::size_t index, const std::string &name, const WellContainer<T> &other)
+
+ +
+
+

Private Members

+
+
+std::vector<T> m_data
+
+ +
+
+std::unordered_map<std::string, std::size_t> index_map
+
+ +
+
+ +
+
+template<class Scalar>
class WellContributions
+
+

This class serves to eliminate the need to include the WellContributions into the matrix (with &#8212;matrix-add-well-contributions=true) for the cusparseSolver or openclSolver. If the &#8212;matrix-add-well-contributions commandline parameter is true, this class should still be used, but be empty. StandardWell and MultisegmentWell are supported for both cusparseSolver and openclSolver. A single instance (or pointer) of this class is passed to the GpuSolver. For StandardWell, this class contains all the data and handles the computation. For MultisegmentWell, the vector ‘multisegments’ contains all the data. For more information, check the MultisegmentWellContribution class. A StandardWell uses C, D and B and performs y -= (C^T * (D^-1 * (B*x))) B and C are vectors, disguised as matrices and contain blocks of StandardWell::numEq by StandardWell::numStaticWellEq D is a block, disguised as matrix, the square block has size StandardWell::numStaticWellEq. D is actually stored as D^-1 B*x and D*B*x are a vector with numStaticWellEq doubles C*D*B*x is a blocked matrix with a symmetric sparsity pattern, contains square blocks with size numEq. For every columnindex i, j in StandardWell::duneB_, there is a block on (i, j) in C*D*B*x.

+

This class is used in 3 phases:

    +
  • get total size of all wellcontributions that must be stored here

  • +
  • allocate memory

  • +
  • copy data of wellcontributions

  • +
+

+

Subclassed by Opm::WellContributionsCuda< Scalar >, Opm::WellContributionsOCL< Scalar >, Opm::WellContributionsRocsparse< Scalar >

+
+

Public Types

+
+
+enum class MatrixType
+

StandardWell has C, D and B matrices that need to be copied.

+

Values:

+
+
+enumerator C
+
+ +
+
+enumerator D
+
+ +
+
+enumerator B
+
+ +
+ +
+
+using UMFPackIndex = SuiteSparse_long
+
+ +
+
+

Public Functions

+
+
+inline unsigned int getNumWells()
+
+ +
+
+void addNumBlocks(unsigned int numBlocks)
+

Indicate how large the next StandardWell is, this function cannot be called after alloc() is called

+
+
Parameters:
+

numBlocks[in] number of blocks in C and B of next StandardWell

+
+
+
+ +
+
+void alloc()
+

Allocate memory for the StandardWells.

+
+ +
+
+virtual ~WellContributions()
+

Empty destructor.

+
+ +
+
+void setBlockSize(unsigned int dim, unsigned int dim_wells)
+

Indicate how large the blocks of the StandardWell (C and B) are

+
+
Parameters:
+
    +
  • dim[in] number of columns

  • +
  • dim_wells[in] number of rows

  • +
+
+
+
+ +
+
+void setVectorSize(unsigned N)
+

Set size of vector that the wells are applied to

+
+
Parameters:
+

N[in] size of vector

+
+
+
+ +
+
+void addMatrix(MatrixType type, int *colIndices, Scalar *values, unsigned int val_size)
+

Store a matrix in this object, in blocked csr format, can only be called after alloc() is called

+
+
Parameters:
+
    +
  • type[in] indicate if C, D or B is sent

  • +
  • colIndices[in] columnindices of blocks in C or B, ignored for D

  • +
  • values[in] array of nonzeroes

  • +
  • val_size[in] number of blocks in C or B, ignored for D

  • +
+
+
+
+ +
+
+void addMultisegmentWellContribution(unsigned int dim, unsigned int dim_wells, unsigned int Mb, std::vector<Scalar> &Bvalues, std::vector<unsigned int> &BcolIndices, std::vector<unsigned int> &BrowPointers, unsigned int DnumBlocks, Scalar *Dvalues, UMFPackIndex *DcolPointers, UMFPackIndex *DrowIndices, std::vector<Scalar> &Cvalues)
+

Add a MultisegmentWellContribution, actually creates an object on heap that is destroyed in the destructor Matrices C and B are passed in Blocked CSR, matrix D in CSC

+
+
Parameters:
+
    +
  • dim[in] size of blocks in vectors x and y, equal to MultisegmentWell::numEq

  • +
  • dim_wells[in] size of blocks of C, B and D, equal to MultisegmentWell::numWellEq

  • +
  • Mb[in] number of blockrows in C, B and D

  • +
  • Bvalues[in] nonzero values of matrix B

  • +
  • BcolIndices[in] columnindices of blocks of matrix B

  • +
  • BrowPointers[in] rowpointers of matrix B

  • +
  • DnumBlocks[in] number of blocks in D

  • +
  • Dvalues[in] nonzero values of matrix D

  • +
  • DcolPointers[in] columnpointers of matrix D

  • +
  • DrowIndices[in] rowindices of matrix D

  • +
  • Cvalues[in] nonzero values of matrix C

  • +
+
+
+
+ +
+
+

Public Static Functions

+
+
+static std::unique_ptr<WellContributions> create(const std::string &accelerator_mode, bool useWellConn)
+
+ +
+
+

Protected Functions

+
+
+inline virtual void APIalloc()
+

API specific allocation.

+
+ +
+
+inline virtual void APIaddMatrix(MatrixType, int*, Scalar*, unsigned int)
+

Api specific upload of matrix.

+
+ +
+
+

Protected Attributes

+
+
+bool allocated = false
+
+ +
+
+unsigned int N
+
+ +
+
+unsigned int dim
+
+ +
+
+unsigned int dim_wells
+
+ +
+
+unsigned int num_blocks = 0
+
+ +
+
+unsigned int num_std_wells = 0
+
+ +
+
+unsigned int num_ms_wells = 0
+
+ +
+
+unsigned int num_blocks_so_far = 0
+
+ +
+
+unsigned int num_std_wells_so_far = 0
+
+ +
+
+std::vector<unsigned int> val_pointers
+
+ +
+
+std::vector<std::unique_ptr<MultisegmentWellContribution<Scalar>>> multisegments
+
+ +
+
+ +
+
+template<class Scalar>
class WellContributionsCuda : public Opm::WellContributions<Scalar>
+
+
+

Public Functions

+
+
+~WellContributionsCuda() override
+
+ +
+
+void setCudaStream(cudaStream_t stream)
+

Set a cudaStream to be used

+
+
Parameters:
+

stream[in] the cudaStream that is used to launch the kernel in

+
+
+
+ +
+
+void apply(Scalar *d_x, Scalar *d_y)
+

Apply all Wells in this object performs y -= (C^T * (D^-1 * (B*x))) for all Wells

+
+
Parameters:
+
    +
  • d_x[in] vector x, must be on GPU

  • +
  • d_y[inout] vector y, must be on GPU

  • +
+
+
+
+ +
+
+

Protected Types

+
+
+using MatrixType = typename WellContributions<Scalar>::MatrixType
+
+ +
+
+

Protected Functions

+
+
+virtual void APIalloc() override
+

Allocate memory for the StandardWells.

+
+ +
+
+virtual void APIaddMatrix(MatrixType type, int *colIndices, Scalar *values, unsigned int val_size) override
+

Store a matrix in this object, in blocked csr format, can only be called after alloc() is called

+
+
Parameters:
+
    +
  • type[in] indicate if C, D or B is sent

  • +
  • colIndices[in] columnindices of blocks in C or B, ignored for D

  • +
  • values[in] array of nonzeroes

  • +
  • val_size[in] number of blocks in C or B, ignored for D

  • +
+
+
+
+ +
+
+

Protected Attributes

+
+
+cudaStream_t stream
+
+ +
+
+Scalar *d_Cnnzs = nullptr
+
+ +
+
+Scalar *d_Dnnzs = nullptr
+
+ +
+
+Scalar *d_Bnnzs = nullptr
+
+ +
+
+int *d_Ccols = nullptr
+
+ +
+
+int *d_Bcols = nullptr
+
+ +
+
+Scalar *d_z1 = nullptr
+
+ +
+
+Scalar *d_z2 = nullptr
+
+ +
+
+unsigned int *d_val_pointers = nullptr
+
+ +
+
+Scalar *h_x = nullptr
+
+ +
+
+Scalar *h_y = nullptr
+
+ +
+
+ +
+
+template<class Scalar>
class WellContributionsOCL : public Opm::WellContributions<Scalar>
+
+
+

Public Functions

+
+
+void setOpenCLEnv(cl::Context *context_, cl::CommandQueue *queue_)
+
+ +
+
+void apply_stdwells(cl::Buffer d_x, cl::Buffer d_y)
+
+ +
+
+void apply_mswells(cl::Buffer d_x, cl::Buffer d_y)
+
+ +
+
+void apply(cl::Buffer d_x, cl::Buffer d_y)
+
+ +
+
+

Protected Types

+
+
+using MatrixType = typename WellContributions<Scalar>::MatrixType
+
+ +
+
+

Protected Functions

+
+
+virtual void APIalloc() override
+

Allocate memory for the StandardWells.

+
+ +
+
+virtual void APIaddMatrix(MatrixType type, int *colIndices, Scalar *values, unsigned int val_size) override
+

Api specific upload of matrix.

+
+ +
+
+

Protected Attributes

+
+
+cl::Context *context
+
+ +
+
+cl::CommandQueue *queue
+
+ +
+
+std::vector<cl::Event> events
+
+ +
+
+std::unique_ptr<cl::Buffer> d_Cnnzs_ocl
+
+ +
+
+std::unique_ptr<cl::Buffer> d_Dnnzs_ocl
+
+ +
+
+std::unique_ptr<cl::Buffer> d_Bnnzs_ocl
+
+ +
+
+std::unique_ptr<cl::Buffer> d_Ccols_ocl
+
+ +
+
+std::unique_ptr<cl::Buffer> d_Bcols_ocl
+
+ +
+
+std::unique_ptr<cl::Buffer> d_val_pointers_ocl
+
+ +
+
+std::vector<Scalar> h_x
+
+ +
+
+std::vector<Scalar> h_y
+
+ +
+
+ +
+
+template<class Scalar>
class WellContributionsRocsparse : public Opm::WellContributions<Scalar>
+
+
+

Public Functions

+
+
+void apply_stdwells(Scalar *d_x, Scalar *d_y)
+
+ +
+
+void apply_mswells(Scalar *d_x, Scalar *d_y)
+
+ +
+
+void apply(Scalar *d_x, Scalar *d_y)
+
+ +
+
+void setStream(hipStream_t stream)
+
+ +
+
+

Protected Types

+
+
+using MatrixType = typename WellContributions<Scalar>::MatrixType
+
+ +
+
+

Protected Functions

+
+
+virtual void APIalloc() override
+

Allocate memory for the StandardWells.

+
+ +
+
+virtual void APIaddMatrix(MatrixType type, int *colIndices, Scalar *values, unsigned int val_size) override
+

Api specific upload of matrix.

+
+ +
+
+

Protected Attributes

+
+
+Scalar *d_Cnnzs_hip
+
+ +
+
+Scalar *d_Dnnzs_hip
+
+ +
+
+Scalar *d_Bnnzs_hip
+
+ +
+
+unsigned *d_Ccols_hip
+
+ +
+
+unsigned *d_Bcols_hip
+
+ +
+
+unsigned *d_val_pointers_hip
+
+ +
+
+std::vector<Scalar> h_x
+
+ +
+
+std::vector<Scalar> h_y
+
+ +
+
+

Private Members

+
+
+hipStream_t stream
+
+ +
+
+ +
+
+template<class Scalar>
class WellConvergence
+
+#include <WellConvergence.hpp>
+
+

Public Functions

+
+
+inline explicit WellConvergence(const WellInterfaceGeneric<Scalar> &well)
+
+ +
+
+void checkConvergenceControlEq(const WellState<Scalar> &well_state, const Tolerances &tolerances, const Scalar well_control_residual, const bool well_is_stopped, ConvergenceReport &report, DeferredLogger &deferred_logger) const
+
+ +
+
+void checkConvergencePolyMW(const std::vector<Scalar> &res, const int Bhp, const Scalar maxResidualAllowed, ConvergenceReport &report) const
+
+ +
+
+

Private Members

+
+
+const WellInterfaceGeneric<Scalar> &well_
+
+ +
+
+ +
+
+class WellConvergenceMetric
+
+
+

Public Functions

+
+
+WellConvergenceMetric() = default
+
+ +
+
+inline WellConvergenceMetric(WellFailure::Type t, Severity s, int phase, double value, const std::string &well_name)
+
+ +
+
+inline WellFailure::Type type() const
+
+ +
+
+inline Severity severity() const
+
+ +
+
+inline int phase() const
+
+ +
+
+inline double value() const
+
+ +
+
+inline const std::string &wellName() const
+
+ +
+
+template<typename Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Private Members

+
+
+WellFailure::Type type_ = {WellFailure::Type::Invalid}
+
+ +
+
+Severity severity_ = {Severity::None}
+
+ +
+
+int phase_ = {-1}
+
+ +
+
+double value_ = {0.0}
+
+ +
+
+std::string well_name_ = {}
+
+ +
+
+ +
+
+struct WellCumDataType
+
+

Public Types

+
+
+enum WCId
+

Values:

+
+
+enumerator WellLocationi
+
+ +
+
+enumerator WellLocationj
+
+ +
+
+enumerator OilProd
+
+ +
+
+enumerator WaterProd
+
+ +
+
+enumerator GasProd
+
+ +
+
+enumerator FluidResVolProd
+
+ +
+
+enumerator OilInj
+
+ +
+
+enumerator WaterInj
+
+ +
+
+enumerator GasInj
+
+ +
+
+enumerator FluidResVolInj
+
+ +
+
+enumerator WellName
+
+ +
+
+enumerator WellType
+
+ +
+
+enumerator WellCTRL
+
+ +
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numWCValues = 10
+
+ +
+
+static constexpr int numWCNames = 3
+
+ +
+
+ +
+
+class WellFailure
+
+
+

Public Types

+
+
+enum class Type
+

Values:

+
+
+enumerator Invalid
+
+ +
+
+enumerator MassBalance
+
+ +
+
+enumerator Pressure
+
+ +
+
+enumerator ControlBHP
+
+ +
+
+enumerator ControlTHP
+
+ +
+
+enumerator ControlRate
+
+ +
+
+enumerator Unsolvable
+
+ +
+
+enumerator WrongFlowDirection
+
+ +
+ +
+
+

Public Functions

+
+
+WellFailure() = default
+
+ +
+
+inline WellFailure(Type t, Severity s, int phase, const std::string &well_name)
+
+ +
+
+inline Type type() const
+
+ +
+
+inline Severity severity() const
+
+ +
+
+inline int phase() const
+
+ +
+
+inline const std::string &wellName() const
+
+ +
+
+template<typename Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Private Members

+
+
+Type type_ = {Type::Invalid}
+
+ +
+
+Severity severity_ = {Severity::None}
+
+ +
+
+int phase_ = {-1}
+
+ +
+
+std::string well_name_ = {}
+
+ +
+
+ +
+
+template<class Scalar>
class WellFilterCake
+
+#include <WellFilterCake.hpp>
+

Class for well calculations related to filter cakes.

+
+

Public Functions

+
+
+void updatePostStep(const WellInterfaceGeneric<Scalar> &well, WellState<Scalar> &well_state, const double dt, const Scalar conc, const std::size_t water_index, DeferredLogger &deferred_logger)
+

Post-step filtration model updates.

+

Calculates the filtrate deposition volumes and associated skin factors / injectivity multipliers

+
+ +
+
+void updatePreStep(const WellInterfaceGeneric<Scalar> &well, DeferredLogger &deferred_logger)
+

Pre-step filtration model updates.

+

Applies filter cake cleaning

+
+ +
+
+inline const std::vector<Scalar> &multipliers() const
+

Returns a const-ref to multipliers.

+
+ +
+
+

Private Functions

+
+
+void updateSkinFactorsAndMultipliers(const WellInterfaceGeneric<Scalar> &well, WellState<Scalar> &well_state, const double dt, const std::size_t water_index, DeferredLogger &deferred_logger)
+

Update the multiplier for well transmissbility due to cake filtration.

+
+ +
+
+template<class Conn>
void updateMultiplier(const Conn &conn, const int perf)
+
+ +
+
+void applyCleaning(const WellInterfaceGeneric<Scalar> &well, DeferredLogger &deferred_logger)
+

Apply cleaning multipliers to skin factors and reduce cake thickness accordingly.

+

The cake thickness is re-computed to give the new (reduced) skin factor with current cake properties

+
+ +
+
+

Private Members

+
+
+std::vector<Scalar> inj_fc_multiplier_
+

Multiplier due to injection filtration cake.

+
+ +
+
+std::vector<Scalar> skin_factor_
+
+ +
+
+std::vector<Scalar> thickness_
+
+ +
+
+ +
+
+template<class Scalar>
class WellGroupConstraints
+
+

Class for computing well group constraints.

+
+

Public Types

+
+
+using RateConvFunc = std::function<void(const RegionId, const int, const std::optional<std::string>&, std::vector<Scalar>&)>
+
+ +
+
+

Public Functions

+
+
+inline explicit WellGroupConstraints(const WellInterfaceGeneric<Scalar> &well)
+

Constructor sets reference to well.

+
+ +
+
+bool checkGroupConstraints(WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const RateConvFunc &rateConverter, DeferredLogger &deferred_logger) const
+
+ +
+
+

Private Functions

+
+
+std::pair<bool, Scalar> checkGroupConstraintsInj(const Group &group, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Scalar efficiencyFactor, const Schedule &schedule, const SummaryState &summaryState, const RateConvFunc &rateConverter, DeferredLogger &deferred_logger) const
+
+ +
+
+std::pair<bool, Scalar> checkGroupConstraintsProd(const Group &group, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Scalar efficiencyFactor, const Schedule &schedule, const SummaryState &summaryState, const RateConvFunc &rateConverter, DeferredLogger &deferred_logger) const
+
+ +
+
+

Private Members

+
+
+const WellInterfaceGeneric<Scalar> &well_
+

Reference to well interface.

+
+ +
+
+ +
+
+struct WellGroupConstraintsMaxIterations
+
+
+

Public Static Attributes

+
+
+static constexpr int value = 1
+
+ +
+
+ +
+
+template<class Scalar>
class WellGroupControls
+
+

Class for computing well group controls.

+
+

Public Types

+
+
+using RateConvFunc = std::function<void(const RegionId, const int, const std::optional<std::string>&, std::vector<Scalar>&)>
+
+ +
+
+

Public Functions

+
+
+inline explicit WellGroupControls(const WellInterfaceGeneric<Scalar> &well)
+

Constructor sets reference to well.

+
+ +
+
+template<class EvalWell>
void getGroupInjectionControl(const Group &group, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const InjectorType &injectorType, const EvalWell &bhp, const EvalWell &injection_rate, const RateConvFunc &rateConverter, Scalar efficiencyFactor, EvalWell &control_eq, DeferredLogger &deferred_logger) const
+
+ +
+
+std::optional<Scalar> getGroupInjectionTargetRate(const Group &group, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const InjectorType &injectorType, const RateConvFunc &rateConverter, Scalar efficiencyFactor, DeferredLogger &deferred_logger) const
+
+ +
+
+template<class EvalWell>
void getGroupProductionControl(const Group &group, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const EvalWell &bhp, const std::vector<EvalWell> &rates, const RateConvFunc &rateConverter, Scalar efficiencyFactor, EvalWell &control_eq, DeferredLogger &deferred_logger) const
+
+ +
+
+Scalar getGroupProductionTargetRate(const Group &group, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const RateConvFunc &rateConverter, Scalar efficiencyFactor, DeferredLogger &deferred_logger) const
+
+ +
+
+

Public Static Functions

+
+
+static std::pair<Scalar, Group::ProductionCMode> getAutoChokeGroupProductionTargetRate(const std::string &name, const Group &parent, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const std::vector<Scalar> &resv_coeff, Scalar efficiencyFactor, const int reportStepIdx, const PhaseUsage &pu, const GuideRate *guideRate, DeferredLogger &deferred_logger)
+
+ +
+
+

Private Members

+
+
+const WellInterfaceGeneric<Scalar> &well_
+

Reference to well interface.

+
+ +
+
+ +
+
+template<class Scalar>
class WellGroupHelpers
+
+
+

Public Static Functions

+
+
+static Scalar sumWellPhaseRates(bool res_rates, const Opm::Group &group, const Opm::Schedule &schedule, const Opm::WellState<Scalar> &wellState, const int reportStepIdx, const int phasePos, const bool injector, const bool network = false)
+
+ +
+
+static Scalar satelliteProduction(const ScheduleState &sched, const std::vector<std::string> &groups, const GSatProd::GSatProdGroup::Rate rateComp)
+
+ +
+
+static std::optional<GSatProd::GSatProdGroup::Rate> selectRateComponent(const PhaseUsage &pu, const int phasePos)
+
+ +
+
+static void setCmodeGroup(const Group &group, const Schedule &schedule, const SummaryState &summaryState, const int reportStepIdx, GroupState<Scalar> &group_state)
+
+ +
+
+static void accumulateGroupEfficiencyFactor(const Group &group, const Schedule &schedule, const int reportStepIdx, Scalar &factor)
+
+ +
+
+static Scalar sumWellSurfaceRates(const Group &group, const Schedule &schedule, const WellState<Scalar> &wellState, const int reportStepIdx, const int phasePos, const bool injector)
+
+ +
+
+static std::pair<std::optional<std::string>, Scalar> worstOffendingWell(const Group &group, const Schedule &schedule, const int reportStepIdx, const Group::ProductionCMode &offendedControl, const PhaseUsage &pu, const Parallel::Communication &comm, const WellState<Scalar> &wellState, DeferredLogger &deferred_logger)
+

Returns the name of the worst offending well and its fraction (i.e. violated_phase / preferred_phase)

+
+ +
+
+static Scalar sumWellResRates(const Group &group, const Schedule &schedule, const WellState<Scalar> &wellState, const int reportStepIdx, const int phasePos, const bool injector)
+
+ +
+
+static Scalar sumSolventRates(const Group &group, const Schedule &schedule, const WellState<Scalar> &wellState, const int reportStepIdx, const bool injector)
+
+ +
+
+static void updateGroupTargetReduction(const Group &group, const Schedule &schedule, const int reportStepIdx, const bool isInjector, const PhaseUsage &pu, const GuideRate &guide_rate, const WellState<Scalar> &wellState, const SummaryState &summaryState, GroupState<Scalar> &group_state, std::vector<Scalar> &groupTargetReduction)
+
+ +
+
+static void updateGuideRates(const Group &group, const Schedule &schedule, const SummaryState &summary_state, const PhaseUsage &pu, int report_step, double sim_time, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Parallel::Communication &comm, GuideRate *guide_rate, std::vector<Scalar> &pot, DeferredLogger &deferred_logger)
+
+ +
+
+static void updateGuideRateForProductionGroups(const Group &group, const Schedule &schedule, const PhaseUsage &pu, const int reportStepIdx, const double &simTime, WellState<Scalar> &wellState, const GroupState<Scalar> &group_state, const Parallel::Communication &comm, GuideRate *guideRate, std::vector<Scalar> &pot)
+
+ +
+
+static void updateGuideRatesForWells(const Schedule &schedule, const PhaseUsage &pu, const int reportStepIdx, const double &simTime, const WellState<Scalar> &wellState, const Parallel::Communication &comm, GuideRate *guideRate)
+
+ +
+
+static void updateGuideRatesForInjectionGroups(const Group &group, const Schedule &schedule, const SummaryState &summaryState, const PhaseUsage &pu, const int reportStepIdx, const WellState<Scalar> &wellState, const GroupState<Scalar> &group_state, GuideRate *guideRate, DeferredLogger &deferred_logger)
+
+ +
+
+static void updateVREPForGroups(const Group &group, const Schedule &schedule, const int reportStepIdx, const WellState<Scalar> &wellState, GroupState<Scalar> &group_state)
+
+ +
+
+template<class RegionalValues>
static void updateGpMaintTargetForGroups(const Group &group, const Schedule &schedule, const RegionalValues &regional_values, const int reportStepIdx, const double dt, const WellState<Scalar> &well_state, GroupState<Scalar> &group_state)
+
+ +
+
+static void updateReservoirRatesInjectionGroups(const Group &group, const Schedule &schedule, const int reportStepIdx, const WellState<Scalar> &wellState, GroupState<Scalar> &group_state)
+
+ +
+
+static void updateSurfaceRatesInjectionGroups(const Group &group, const Schedule &schedule, const int reportStepIdx, const WellState<Scalar> &wellState, GroupState<Scalar> &group_state)
+
+ +
+
+static void updateWellRates(const Group &group, const Schedule &schedule, const int reportStepIdx, const WellState<Scalar> &wellStateNupcol, WellState<Scalar> &wellState)
+
+ +
+
+static void updateGroupProductionRates(const Group &group, const Schedule &schedule, const int reportStepIdx, const WellState<Scalar> &wellState, GroupState<Scalar> &group_state)
+
+ +
+
+static void updateNetworkLeafNodeProductionRates(const Schedule &schedule, const int reportStepIdx, const WellState<Scalar> &wellState, GroupState<Scalar> &group_state)
+
+ +
+
+static void updateWellRatesFromGroupTargetScale(const Scalar scale, const Group &group, const Schedule &schedule, const int reportStepIdx, bool isInjector, const GroupState<Scalar> &group_state, WellState<Scalar> &wellState)
+
+ +
+
+static void updateREINForGroups(const Group &group, const Schedule &schedule, const int reportStepIdx, const PhaseUsage &pu, const SummaryState &st, const WellState<Scalar> &wellState, GroupState<Scalar> &group_state, bool sum_rank)
+
+ +
+
+static std::map<std::string, Scalar> computeNetworkPressures(const Network::ExtNetwork &network, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const VFPProdProperties<Scalar> &vfp_prod_props, const Schedule &schedule, const int report_time_step)
+
+ +
+
+static GuideRate::RateVector getWellRateVector(const WellState<Scalar> &well_state, const PhaseUsage &pu, const std::string &name)
+
+ +
+
+static GuideRate::RateVector getProductionGroupRateVector(const GroupState<Scalar> &group_state, const PhaseUsage &pu, const std::string &group_name)
+
+ +
+
+static Scalar getGuideRate(const std::string &name, const Schedule &schedule, const WellState<Scalar> &wellState, const GroupState<Scalar> &group_state, const int reportStepIdx, const GuideRate *guideRate, const GuideRateModel::Target target, const PhaseUsage &pu)
+
+ +
+
+static Scalar getGuideRateInj(const std::string &name, const Schedule &schedule, const WellState<Scalar> &wellState, const GroupState<Scalar> &group_state, const int reportStepIdx, const GuideRate *guideRate, const GuideRateModel::Target target, const Phase &injectionPhase, const PhaseUsage &pu)
+
+ +
+
+static int groupControlledWells(const Schedule &schedule, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const SummaryState &summary_state, const GuideRate *guideRate, const int report_step, const std::string &group_name, const std::string &always_included_child, const bool is_production_group, const Phase injection_phase)
+
+ +
+
+static std::pair<bool, Scalar> checkGroupConstraintsInj(const std::string &name, const std::string &parent, const Group &group, const WellState<Scalar> &wellState, const GroupState<Scalar> &group_state, const int reportStepIdx, const GuideRate *guideRate, const Scalar *rates, Phase injectionPhase, const PhaseUsage &pu, const Scalar efficiencyFactor, const Schedule &schedule, const SummaryState &summaryState, const std::vector<Scalar> &resv_coeff, DeferredLogger &deferred_logger)
+
+ +
+
+static std::vector<std::string> groupChainTopBot(const std::string &bottom, const std::string &top, const Schedule &schedule, const int report_step)
+
+ +
+
+static std::string control_group(const Group &group, const GroupState<Scalar> &group_state, const int reportStepIdx, const Schedule &schedule)
+
+ +
+
+static std::pair<bool, Scalar> checkGroupConstraintsProd(const std::string &name, const std::string &parent, const Group &group, const WellState<Scalar> &wellState, const GroupState<Scalar> &group_state, const int reportStepIdx, const GuideRate *guideRate, const Scalar *rates, const PhaseUsage &pu, const Scalar efficiencyFactor, const Schedule &schedule, const SummaryState &summaryState, const std::vector<Scalar> &resv_coeff, DeferredLogger &deferred_logger)
+
+ +
+
+template<class AverageRegionalPressureType>
static void setRegionAveragePressureCalculator(const Group &group, const Schedule &schedule, const int reportStepIdx, const FieldPropsManager &fp, const PhaseUsage &pu, std::map<std::string, std::unique_ptr<AverageRegionalPressureType>> &regionalAveragePressureCalculator)
+
+ +
+
+ +
+
+struct WellInjDataType
+
+

Public Types

+
+
+enum WIId
+

Values:

+
+
+enumerator WellLocationi
+
+ +
+
+enumerator WellLocationj
+
+ +
+
+enumerator OilRate
+
+ +
+
+enumerator WaterRate
+
+ +
+
+enumerator GasRate
+
+ +
+
+enumerator FluidResVol
+
+ +
+
+enumerator BHP
+
+ +
+
+enumerator CPR
+
+ +
+
+enumerator THP
+
+ +
+
+enumerator BPR
+
+ +
+
+enumerator SteadyStateII
+
+ +
+
+enumerator WellName
+
+ +
+
+enumerator CTRLModeOil
+
+ +
+
+enumerator CTRLModeWat
+
+ +
+
+enumerator CTRLModeGas
+
+ +
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numWIValues = 9
+
+ +
+
+static constexpr int numWINames = 4
+
+ +
+
+ +
+
+template<typename TypeTag>
class WellInterface : public Opm::WellInterfaceIndices<GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::Indices>>
+
+#include <WellInterface.hpp>
+

Subclassed by Opm::MultisegmentWell< TypeTag >, Opm::StandardWell< TypeTag >

+
+

Public Types

+
+
+enum class IndividualOrGroup
+

Values:

+
+
+enumerator Individual
+
+ +
+
+enumerator Group
+
+ +
+
+enumerator Both
+
+ +
+ +
+
+using Grid = GetPropType<TypeTag, Properties::Grid>
+
+ +
+
+using Simulator = GetPropType<TypeTag, Properties::Simulator>
+
+ +
+
+using Scalar = GetPropType<TypeTag, Properties::Scalar>
+
+ +
+
+using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>
+
+ +
+
+using Indices = GetPropType<TypeTag, Properties::Indices>
+
+ +
+
+using IntensiveQuantities = GetPropType<TypeTag, Properties::IntensiveQuantities>
+
+ +
+
+using MaterialLaw = GetPropType<TypeTag, Properties::MaterialLaw>
+
+ +
+
+using SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>
+
+ +
+
+using RateVector = GetPropType<TypeTag, Properties::RateVector>
+
+ +
+
+using GasLiftSingleWell = ::Opm::GasLiftSingleWell<TypeTag>
+
+ +
+
+using GLiftEclWells = typename GasLiftGroupInfo<Scalar>::GLiftEclWells
+
+ +
+
+using VectorBlockType = Dune::FieldVector<Scalar, Indices::numEq>
+
+ +
+
+using MatrixBlockType = Dune::FieldMatrix<Scalar, Indices::numEq, Indices::numEq>
+
+ +
+
+using Eval = typename Base::Eval
+
+ +
+
+using BVector = Dune::BlockVector<VectorBlockType>
+
+ +
+
+using PressureMatrix = Dune::BCRSMatrix<Opm::MatrixBlock<Scalar, 1, 1>>
+
+ +
+
+using RateConverterType = typename WellInterfaceFluidSystem<FluidSystem>::RateConverterType
+
+ +
+
+using ModelParameters = typename Base::ModelParameters
+
+ +
+
+FluidState = BlackOilFluidState< Eval, FluidSystem, has_temperature, has_energy, Indices::compositionSwitchIdx >=0, has_watVapor, has_brine, has_saltPrecip, has_disgas_in_water, Indices::numPhases >
+
+ +
+
+

Public Functions

+
+
+WellInterface(const Well &well, const ParallelWellInfo<Scalar> &pw_info, const int time_step, const ModelParameters &param, const RateConverterType &rate_converter, const int pvtRegionIdx, const int num_components, const int num_phases, const int index_of_well, const std::vector<PerforationData<Scalar>> &perf_data)
+

Constructor.

+
+ +
+
+virtual ~WellInterface() = default
+

Virtual destructor.

+
+ +
+
+virtual void init(const PhaseUsage *phase_usage_arg, const std::vector<Scalar> &depth_arg, const Scalar gravity_arg, const std::vector<Scalar> &B_avg, const bool changed_to_open_this_step)
+
+ +
+
+virtual ConvergenceReport getWellConvergence(const Simulator &simulator, const WellState<Scalar> &well_state, const std::vector<Scalar> &B_avg, DeferredLogger &deferred_logger, const bool relax_tolerance) const = 0
+
+ +
+
+virtual void solveEqAndUpdateWellState(const Simulator &simulator, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) = 0
+
+ +
+
+void assembleWellEq(const Simulator &simulator, const double dt, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger)
+
+ +
+
+void assembleWellEqWithoutIteration(const Simulator &simulator, const double dt, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger)
+
+ +
+
+void prepareWellBeforeAssembling(const Simulator &simulator, const double dt, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger)
+
+ +
+
+virtual void computeWellRatesWithBhp(const Simulator &ebosSimulator, const Scalar &bhp, std::vector<Scalar> &well_flux, DeferredLogger &deferred_logger) const = 0
+
+ +
+
+virtual std::optional<Scalar> computeBhpAtThpLimitProdWithAlq(const Simulator &ebos_simulator, const SummaryState &summary_state, const Scalar alq_value, DeferredLogger &deferred_logger, bool iterate_if_no_solution) const = 0
+
+ +
+
+virtual void recoverWellSolutionAndUpdateWellState(const Simulator &simulator, const BVector &x, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) = 0
+

using the solution x to recover the solution xw for wells and applying xw to update Well State

+
+ +
+
+virtual void apply(const BVector &x, BVector &Ax) const = 0
+

Ax = Ax - C D^-1 B x.

+
+ +
+
+virtual void apply(BVector &r) const = 0
+

r = r - C D^-1 Rw

+
+ +
+
+virtual void computeWellPotentials(const Simulator &simulator, const WellState<Scalar> &well_state, std::vector<Scalar> &well_potentials, DeferredLogger &deferred_logger) = 0
+
+ +
+
+virtual void updateWellStateWithTarget(const Simulator &simulator, const GroupState<Scalar> &group_state, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) const
+
+ +
+
+virtual void computeWellRatesWithBhpIterations(const Simulator &simulator, const Scalar &bhp, std::vector<Scalar> &well_flux, DeferredLogger &deferred_logger) const = 0
+
+ +
+
+bool wellUnderZeroRateTarget(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger) const
+
+ +
+
+bool wellUnderZeroGroupRateTarget(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger, std::optional<bool> group_control = std::nullopt) const
+
+ +
+
+bool stoppedOrZeroRateTarget(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger) const
+
+ +
+
+bool updateWellStateWithTHPTargetProd(const Simulator &simulator, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) const
+
+ +
+
+bool updateWellControl(const Simulator &simulator, const IndividualOrGroup iog, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger)
+
+ +
+
+bool updateWellControlAndStatusLocalIteration(const Simulator &simulator, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const Scalar WQTotal, DeferredLogger &deferred_logger, const bool fixed_control = false, const bool fixed_status = false)
+
+ +
+
+virtual void updatePrimaryVariables(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger) = 0
+
+ +
+
+virtual void calculateExplicitQuantities(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger) = 0
+
+ +
+
+virtual void updateProductivityIndex(const Simulator &simulator, const WellProdIndexCalculator<Scalar> &wellPICalc, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) const = 0
+
+ +
+
+virtual void addWellContributions(SparseMatrixAdapter&) const = 0
+
+ +
+
+virtual void addWellPressureEquations(PressureMatrix &mat, const BVector &x, const int pressureVarIndex, const bool use_well_weights, const WellState<Scalar> &well_state) const = 0
+
+ +
+
+void addCellRates(RateVector &rates, int cellIdx) const
+
+ +
+
+Scalar volumetricSurfaceRateForConnection(int cellIdx, int phaseIdx) const
+
+ +
+
+void wellTesting(const Simulator &simulator, const double simulation_time, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, WellTestState &welltest_state, const PhaseUsage &phase_usage, GLiftEclWells &ecl_well_map, std::map<std::string, double> &open_times, DeferredLogger &deferred_logger)
+
+ +
+
+void checkWellOperability(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger)
+
+ +
+
+void gliftBeginTimeStepWellTestUpdateALQ(const Simulator &simulator, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const PhaseUsage &phase_usage, GLiftEclWells &ecl_well_map, DeferredLogger &deferred_logger)
+
+ +
+
+void updateWellOperability(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger)
+
+ +
+
+bool updateWellOperabilityFromWellEq(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger)
+
+ +
+
+virtual void updateWaterThroughput(const double dt, WellState<Scalar> &well_state) const = 0
+
+ +
+
+virtual std::vector<Scalar> computeCurrentWellRates(const Simulator &simulator, DeferredLogger &deferred_logger) const = 0
+

Compute well rates based on current reservoir conditions and well variables. Used in updateWellStateRates().

+
+ +
+
+void initializeProducerWellState(const Simulator &simulator, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) const
+

Modify the well_state’s rates if there is only one nonzero rate. If so, that rate is kept as is, but the others are set proportionally to the rates at bhp limit or bhp 1 bar.

+
+ +
+
+void solveWellEquation(const Simulator &simulator, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger)
+
+ +
+
+inline const std::vector<RateVector> &connectionRates() const
+
+ +
+
+std::vector<Scalar> wellIndex(const int perf, const IntensiveQuantities &intQuants, const Scalar trans_mult, const SingleWellState<Scalar> &ws) const
+
+ +
+
+void updateConnectionDFactor(const Simulator &simulator, SingleWellState<Scalar> &ws) const
+
+ +
+
+void updateConnectionTransmissibilityFactor(const Simulator &simulator, SingleWellState<Scalar> &ws) const
+
+ +
+
+virtual bool iterateWellEqWithSwitching(const Simulator &simulator, const double dt, const WellInjectionControls &inj_controls, const WellProductionControls &prod_controls, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger, const bool fixed_control = false, const bool fixed_status = false) = 0
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr bool has_solvent = getPropValue<TypeTag, Properties::EnableSolvent>()
+
+ +
+
+static constexpr bool has_zFraction = getPropValue<TypeTag, Properties::EnableExtbo>()
+
+ +
+
+static constexpr bool has_polymer = getPropValue<TypeTag, Properties::EnablePolymer>()
+
+ +
+
+static constexpr bool has_energy = getPropValue<TypeTag, Properties::EnableEnergy>()
+
+ +
+
+static const bool has_temperature = getPropValue<TypeTag, Properties::EnableTemperature>()
+
+ +
+
+static constexpr bool has_polymermw = getPropValue<TypeTag, Properties::EnablePolymerMW>()
+
+ +
+
+static constexpr bool has_foam = getPropValue<TypeTag, Properties::EnableFoam>()
+
+ +
+
+static constexpr bool has_brine = getPropValue<TypeTag, Properties::EnableBrine>()
+
+ +
+
+static constexpr bool has_watVapor = getPropValue<TypeTag, Properties::EnableVapwat>()
+
+ +
+
+static constexpr bool has_disgas_in_water = getPropValue<TypeTag, Properties::EnableDisgasInWater>()
+
+ +
+
+static constexpr bool has_saltPrecip = getPropValue<TypeTag, Properties::EnableSaltPrecipitation>()
+
+ +
+
+static constexpr bool has_micp = getPropValue<TypeTag, Properties::EnableMICP>()
+
+ +
+
+

Protected Functions

+
+
+Scalar wpolymer() const
+
+ +
+
+Scalar wfoam() const
+
+ +
+
+Scalar wsalt() const
+
+ +
+
+Scalar wmicrobes() const
+
+ +
+
+Scalar woxygen() const
+
+ +
+
+Scalar wurea() const
+
+ +
+
+virtual Scalar getRefDensity() const = 0
+
+ +
+
+std::vector<Scalar> initialWellRateFractions(const Simulator &ebosSimulator, const WellState<Scalar> &well_state) const
+
+ +
+
+virtual void checkOperabilityUnderBHPLimit(const WellState<Scalar> &well_state, const Simulator &simulator, DeferredLogger &deferred_logger) = 0
+
+ +
+
+virtual void checkOperabilityUnderTHPLimit(const Simulator &simulator, const WellState<Scalar> &well_state, DeferredLogger &deferred_logger) = 0
+
+ +
+
+virtual void updateIPR(const Simulator &simulator, DeferredLogger &deferred_logger) const = 0
+
+ +
+
+virtual void assembleWellEqWithoutIteration(const Simulator &simulator, const double dt, const WellInjectionControls &inj_controls, const WellProductionControls &prod_controls, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger) = 0
+
+ +
+
+virtual bool iterateWellEqWithControl(const Simulator &simulator, const double dt, const WellInjectionControls &inj_controls, const WellProductionControls &prod_controls, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger) = 0
+
+ +
+
+virtual void updateIPRImplicit(const Simulator &simulator, WellState<Scalar> &well_state, DeferredLogger &deferred_logger) = 0
+
+ +
+
+bool iterateWellEquations(const Simulator &simulator, const double dt, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger)
+
+ +
+
+bool solveWellWithTHPConstraint(const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger)
+
+ +
+
+std::optional<Scalar> estimateOperableBhp(const Simulator &ebos_simulator, const double dt, WellState<Scalar> &well_state, const SummaryState &summary_state, DeferredLogger &deferred_logger)
+
+ +
+
+bool solveWellWithBhp(const Simulator &simulator, const double dt, const Scalar bhp, WellState<Scalar> &well_state, DeferredLogger &deferred_logger)
+
+ +
+
+bool solveWellWithZeroRate(const Simulator &simulator, const double dt, WellState<Scalar> &well_state, DeferredLogger &deferred_logger)
+
+ +
+
+bool solveWellForTesting(const Simulator &simulator, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferred_logger)
+
+ +
+
+template<class GasLiftSingleWell>
std::unique_ptr<GasLiftSingleWell> initializeGliftWellTest_(const Simulator &simulator, WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const PhaseUsage &phase_usage, GLiftEclWells &ecl_well_map, DeferredLogger &deferred_logger)
+
+ +
+
+Eval getPerfCellPressure(const FluidState &fs) const
+
+ +
+
+template<class Value, class Callback>
void getMobility(const Simulator &simulator, const int local_perf_index, std::vector<Value> &mob, Callback &extendEval, DeferredLogger &deferred_logger) const
+
+ +
+
+void computeConnLevelProdInd(const FluidState &fs, const std::function<Scalar(const Scalar)> &connPICalc, const std::vector<Scalar> &mobility, Scalar *connPI) const
+
+ +
+
+void computeConnLevelInjInd(const FluidState &fs, const Phase preferred_phase, const std::function<Scalar(const Scalar)> &connIICalc, const std::vector<Scalar> &mobility, Scalar *connII, DeferredLogger &deferred_logger) const
+
+ +
+
+Scalar computeConnectionDFactor(const int perf, const IntensiveQuantities &intQuants, const SingleWellState<Scalar> &ws) const
+
+ +
+
+

Protected Attributes

+
+
+std::vector<RateVector> connectionRates_
+
+ +
+
+std::vector<Scalar> B_avg_
+
+ +
+
+bool changed_to_stopped_this_step_ = false
+
+ +
+
+bool thp_update_iterations = false
+
+ +
+
+

Private Types

+
+
+using Base = WellInterfaceIndices<GetPropType<TypeTag, Properties::FluidSystem>, GetPropType<TypeTag, Properties::Indices>>
+
+ +
+
+ +
+
+template<class FluidSystem>
class WellInterfaceFluidSystem : public Opm::WellInterfaceGeneric<FluidSystem::Scalar>
+
+

Subclassed by Opm::WellInterfaceIndices< FluidSystem, Indices >

+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using ModelParameters = typename WellInterfaceGeneric<Scalar>::ModelParameters
+
+ +
+
+

Public Functions

+
+
+inline const RateConverterType &rateConverter() const
+
+ +
+
+

Public Static Attributes

+
+
+static constexpr int Water = BlackoilPhases::Aqua
+
+ +
+
+static constexpr int Oil = BlackoilPhases::Liquid
+
+ +
+
+static constexpr int Gas = BlackoilPhases::Vapour
+
+ +
+
+

Protected Types

+
+
+using RateConverterType = RateConverter::SurfaceToReservoirVoidage<FluidSystem, std::vector<int>>
+
+ +
+
+

Protected Functions

+
+
+WellInterfaceFluidSystem(const Well &well, const ParallelWellInfo<Scalar> &parallel_well_info, const int time_step, const ModelParameters &param, const RateConverterType &rate_converter, const int pvtRegionIdx, const int num_components, const int num_phases, const int index_of_well, const std::vector<PerforationData<Scalar>> &perf_data)
+
+ +
+
+void calculateReservoirRates(const bool co2store, SingleWellState<Scalar> &ws) const
+
+ +
+
+bool checkIndividualConstraints(SingleWellState<Scalar> &ws, const SummaryState &summaryState, DeferredLogger &deferred_logger, const std::optional<Well::InjectionControls> &inj_controls = std::nullopt, const std::optional<Well::ProductionControls> &prod_controls = std::nullopt) const
+
+ +
+
+bool checkGroupConstraints(WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, DeferredLogger &deferred_logger) const
+
+ +
+
+bool checkConstraints(WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, DeferredLogger &deferred_logger) const
+
+ +
+
+std::optional<Scalar> getGroupInjectionTargetRate(const Group &group, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, const InjectorType &injectorType, Scalar efficiencyFactor, DeferredLogger &deferred_logger) const
+
+ +
+
+Scalar getGroupProductionTargetRate(const Group &group, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, const Schedule &schedule, const SummaryState &summaryState, Scalar efficiencyFactor, DeferredLogger &deferred_logger) const
+
+ +
+
+bool zeroGroupRateTarget(const SummaryState &summary_state, const Schedule &schedule, const WellState<Scalar> &well_state, const GroupState<Scalar> &group_state, DeferredLogger &deferredLogger) const
+
+ +
+
+

Protected Attributes

+
+
+const RateConverterType &rateConverter_
+
+ +
+
+

Protected Static Attributes

+
+
+static constexpr int INVALIDCOMPLETION = std::numeric_limits<int>::max()
+
+ +
+
+ +
+
+template<class Scalar>
class WellInterfaceGeneric
+
+
+

Public Types

+
+
+using ModelParameters = BlackoilModelParameters<Scalar>
+
+ +
+
+

Public Functions

+
+
+WellInterfaceGeneric(const Well &well, const ParallelWellInfo<Scalar> &parallel_well_info, const int time_step, const ModelParameters &param, const int pvtRegionIdx, const int num_components, const int num_phases, const int index_of_well, const std::vector<PerforationData<Scalar>> &perf_data)
+
+ +
+
+const std::vector<PerforationData<Scalar>> &perforationData() const
+

Get the perforations of the well.

+
+ +
+
+const std::string &name() const
+

Well name.

+
+ +
+
+bool isInjector() const
+

True if the well is an injector.

+
+ +
+
+bool isProducer() const
+

True if the well is a producer.

+
+ +
+
+inline const std::vector<int> &cells() const
+

Well cells.

+
+ +
+
+int indexOfWell() const
+

Index of well in the wells struct and wellState.

+
+ +
+
+void adaptRatesForVFP(std::vector<Scalar> &rates) const
+
+ +
+
+const Well &wellEcl() const
+
+ +
+
+Well &wellEcl()
+
+ +
+
+const PhaseUsage &phaseUsage() const
+
+ +
+
+bool underPredictionMode() const
+

Returns true if the well is currently in prediction mode (i.e. not history mode).

+
+ +
+
+bool isOperableAndSolvable() const
+
+ +
+
+bool useVfpExplicit() const
+
+ +
+
+bool thpLimitViolatedButNotSwitched() const
+
+ +
+
+void initCompletions()
+
+ +
+
+void closeCompletions(const WellTestState &wellTestState)
+
+ +
+
+void setVFPProperties(const VFPProperties<Scalar> *vfp_properties_arg)
+
+ +
+
+void setPrevSurfaceRates(WellState<Scalar> &well_state, const WellState<Scalar> &prev_well_state) const
+
+ +
+
+void setGuideRate(const GuideRate *guide_rate_arg)
+
+ +
+
+void setWellEfficiencyFactor(const Scalar efficiency_factor)
+
+ +
+
+void setRepRadiusPerfLength()
+
+ +
+
+void setWsolvent(const Scalar wsolvent)
+
+ +
+
+void setDynamicThpLimit(const Scalar thp_limit)
+
+ +
+
+std::optional<Scalar> getDynamicThpLimit() const
+
+ +
+
+void setDynamicThpLimit(const std::optional<Scalar> thp_limit)
+
+ +
+
+void updatePerforatedCell(std::vector<bool> &is_cell_perforated)
+
+ +
+
+bool wellHasTHPConstraints(const SummaryState &summaryState) const
+

Returns true if the well has one or more THP limits/constraints.

+
+ +
+
+inline void stopWell()
+
+ +
+
+inline void openWell()
+
+ +
+
+inline bool wellIsStopped() const
+
+ +
+
+inline int currentStep() const
+
+ +
+
+inline int pvtRegionIdx() const
+
+ +
+
+inline const GuideRate *guideRate() const
+
+ +
+
+inline int numComponents() const
+
+ +
+
+inline int numPhases() const
+
+ +
+
+inline int numLocalPerfs() const
+
+ +
+
+inline Scalar refDepth() const
+
+ +
+
+inline Scalar gravity() const
+
+ +
+
+inline const VFPProperties<Scalar> *vfpProperties() const
+
+ +
+
+inline const ParallelWellInfo<Scalar> &parallelWellInfo() const
+
+ +
+
+inline const std::vector<Scalar> &perfDepth() const
+
+ +
+
+inline std::vector<Scalar> &perfDepth()
+
+ +
+
+inline const std::vector<Scalar> &wellIndex() const
+
+ +
+
+inline const std::map<int, std::vector<int>> &getCompletions() const
+
+ +
+
+Scalar getTHPConstraint(const SummaryState &summaryState) const
+
+ +
+
+Scalar getALQ(const WellState<Scalar> &well_state) const
+
+ +
+
+Scalar wsolvent() const
+
+ +
+
+Scalar rsRvInj() const
+
+ +
+
+void initInjMult(const std::vector<Scalar> &max_inj_mult)
+
+ +
+
+void updateInjMult(std::vector<Scalar> &inj_multipliers, DeferredLogger &deferred_logger) const
+
+ +
+
+Scalar getInjMult(const int local_perf_index, const Scalar bhp, const Scalar perf_pres, DeferredLogger &dlogger) const
+
+ +
+
+bool isVFPActive(DeferredLogger &deferred_logger) const
+
+ +
+
+void reportWellSwitching(const SingleWellState<Scalar> &ws, DeferredLogger &deferred_logger) const
+
+ +
+
+inline bool changedToOpenThisStep() const
+
+ +
+
+void updateWellTestState(const SingleWellState<Scalar> &ws, const double &simulationTime, const bool &writeMessageToOPMLog, const bool zero_group_target, WellTestState &wellTestState, DeferredLogger &deferred_logger) const
+
+ +
+
+bool isPressureControlled(const WellState<Scalar> &well_state) const
+
+ +
+
+inline Scalar wellEfficiencyFactor() const
+
+ +
+
+inline void updateFilterCakeMultipliers(const std::vector<Scalar> &inj_fc_multiplier)
+

Update filter cake multipliers.

+
+ +
+
+void resetWellOperability()
+
+ +
+
+inline virtual std::vector<Scalar> getPrimaryVars() const
+
+ +
+
+inline virtual int setPrimaryVars(typename std::vector<Scalar>::const_iterator)
+
+ +
+
+virtual Scalar connectionDensity(const int globalConnIdx, const int openConnIdx) const = 0
+
+ +
+
+void addPerforations(const std::vector<RuntimePerforation> &perfs)
+
+ +
+
+

Protected Functions

+
+
+bool getAllowCrossFlow() const
+
+ +
+
+Scalar wmicrobes_() const
+
+ +
+
+Scalar wfoam_() const
+
+ +
+
+Scalar woxygen_() const
+
+ +
+
+Scalar wpolymer_() const
+
+ +
+
+Scalar wsalt_() const
+
+ +
+
+Scalar wurea_() const
+
+ +
+
+int polymerTable_() const
+
+ +
+
+int polymerInjTable_() const
+
+ +
+
+int polymerWaterTable_() const
+
+ +
+
+bool wellUnderZeroRateTargetIndividual(const SummaryState &summary_state, const WellState<Scalar> &well_state) const
+
+ +
+
+bool wellUnderGroupControl(const SingleWellState<Scalar> &ws) const
+
+ +
+
+std::pair<bool, bool> computeWellPotentials(std::vector<Scalar> &well_potentials, const WellState<Scalar> &well_state)
+
+ +
+
+void checkNegativeWellPotentials(std::vector<Scalar> &well_potentials, const bool checkOperability, DeferredLogger &deferred_logger)
+
+ +
+
+void prepareForPotentialCalculations(const SummaryState &summary_state, WellState<Scalar> &well_state, Well::InjectionControls &inj_controls, Well::ProductionControls &prod_controls) const
+
+ +
+
+inline void resetDampening()
+
+ +
+
+

Protected Attributes

+
+
+OperabilityStatus operability_status_
+
+ +
+
+Well well_ecl_
+
+ +
+
+const ParallelWellInfo<Scalar> &parallel_well_info_
+
+ +
+
+const int current_step_
+
+ +
+
+const ModelParameters &param_
+
+ +
+
+const int pvtRegionIdx_
+
+ +
+
+const int num_components_
+
+ +
+
+int number_of_phases_
+
+ +
+
+int index_of_well_
+
+ +
+
+const std::vector<PerforationData<Scalar>> *perf_data_
+
+ +
+
+mutable std::vector<Scalar> ipr_a_
+
+ +
+
+mutable std::vector<Scalar> ipr_b_
+
+ +
+
+std::vector<int> well_cells_
+
+ +
+
+std::vector<Scalar> well_index_
+
+ +
+
+int number_of_local_perforations_
+
+ +
+
+std::vector<Scalar> perf_depth_
+
+ +
+
+std::vector<Scalar> perf_rep_radius_
+
+ +
+
+std::vector<Scalar> perf_length_
+
+ +
+
+std::vector<Scalar> bore_diameters_
+
+ +
+
+std::map<int, std::vector<int>> completions_
+
+ +
+
+Scalar ref_depth_
+
+ +
+
+std::vector<int> saturation_table_number_
+
+ +
+
+Well::Status wellStatus_
+
+ +
+
+const PhaseUsage *phase_usage_
+
+ +
+
+Scalar gravity_
+
+ +
+
+Scalar wsolvent_
+
+ +
+
+std::optional<Scalar> dynamic_thp_limit_
+
+ +
+
+mutable std::vector<Scalar> inj_multiplier_
+
+ +
+
+std::vector<Scalar> prev_inj_multiplier_
+
+ +
+
+mutable std::vector<Scalar> inj_multiplier_previter_
+
+ +
+
+mutable std::vector<Scalar> inj_multiplier_damp_factor_
+
+ +
+
+std::vector<Scalar> inj_fc_multiplier_
+
+ +
+
+Scalar well_efficiency_factor_
+
+ +
+
+const VFPProperties<Scalar> *vfp_properties_
+
+ +
+
+const GuideRate *guide_rate_
+
+ +
+
+std::vector<std::string> well_control_log_
+
+ +
+
+bool changed_to_open_this_step_ = true
+
+ +
+
+ +
+
+template<class FluidSystem, class Indices>
class WellInterfaceIndices : public Opm::WellInterfaceFluidSystem<FluidSystem>
+
+
+

Public Types

+
+
+using Scalar = typename FluidSystem::Scalar
+
+ +
+
+using Eval = DenseAd::Evaluation<Scalar, Indices::numEq>
+
+ +
+
+using ModelParameters = typename WellInterfaceFluidSystem<FluidSystem>::ModelParameters
+
+ +
+
+

Public Functions

+
+
+int flowPhaseToModelCompIdx(const int phaseIdx) const
+
+ +
+
+int modelCompIdxToFlowCompIdx(const int compIdx) const
+
+ +
+
+int flowPhaseToModelPhaseIdx(const int phaseIdx) const
+
+ +
+
+Scalar scalingFactor(const int phaseIdx) const
+
+ +
+
+template<class EvalWell>
inline Eval restrictEval(const EvalWell &in) const
+
+ +
+
+

Protected Functions

+
+
+WellInterfaceIndices(const Well &well, const ParallelWellInfo<Scalar> &parallel_well_info, const int time_step, const ModelParameters &param, const typename WellInterfaceFluidSystem<FluidSystem>::RateConverterType &rate_converter, const int pvtRegionIdx, const int num_components, const int num_phases, const int index_of_well, const std::vector<PerforationData<Scalar>> &perf_data)
+
+ +
+
+ +
+
+template<class TypeTag, class MyTypeTag>
struct WellModel
+
+
+

Public Types

+
+
+using type = UndefinedProperty
+
+ +
+
+ +
+
+template<class TypeTag>
struct WellModel<TypeTag, TTag::FlowProblem>
+
+
+

Public Types

+
+
+using type = BlackoilWellModel<TypeTag>
+
+ +
+
+ +
+
+template<class WellModel, class X, class Y>
class WellModelAsLinearOperator : public Opm::LinearOperatorExtra<X, Y>
+
+#include <WellOperators.hpp>
+

Subclassed by Opm::DomainWellModelAsLinearOperator< WellModel, X, Y >

+
+

Public Types

+
+
+using Base = LinearOperatorExtra<X, Y>
+
+ +
+
+using field_type = typename Base::field_type
+
+ +
+
+using PressureMatrix = typename Base::PressureMatrix
+
+ +
+
+

Public Functions

+
+
+inline explicit WellModelAsLinearOperator(const WellModel &wm)
+
+ +
+
+inline void apply(const X &x, Y &y) const override
+

apply operator to x: \( y = A(x) \) The input vector is consistent and the output must also be consistent on the interior+border partition.

+
+ +
+
+inline void applyscaleadd(field_type alpha, const X &x, Y &y) const override
+

apply operator to x, scale and add: \( y = y + \alpha A(x) \)

+
+ +
+
+inline Dune::SolverCategory::Category category() const override
+

Category for operator. This is somewhat tricky, I consider this operator sequential since (unlike WellModelMatrixAdapter) it does not do any projections etc. but only forwards the calls to the sequential well model.

+
+ +
+
+inline virtual void addWellPressureEquations(PressureMatrix &jacobian, const X &weights, const bool use_well_weights) const override
+
+ +
+
+inline virtual void addWellPressureEquationsStruct(PressureMatrix &jacobian) const override
+
+ +
+
+inline virtual int getNumberOfExtraEquations() const override
+
+ +
+
+

Protected Functions

+
+
+template<class WellType, class ArrayType>
inline void applySingleWell(const X &x, Y &y, const WellType &well, const ArrayType &cells) const
+
+ +
+
+

Protected Attributes

+
+
+const WellModel &wellMod_
+
+ +
+
+mutable X x_local_ = {}
+
+ +
+
+mutable Y Ax_local_ = {}
+
+ +
+
+mutable Y scaleAddRes_ = {}
+
+ +
+
+ +
+
+template<class M, class X, class Y, bool overlapping>
class WellModelGhostLastMatrixAdapter : public Dune::AssembledLinearOperator<M, X, Y>
+
+#include <WellOperators.hpp>
+

Adapter to combine a matrix and another linear operator into a combined linear operator.

+

This is similar to WellModelMatrixAdapter, with the difference that here we assume a parallel ordering of rows, where ghost rows are located after interior rows.

+
+

Public Types

+
+
+using matrix_type = M
+
+ +
+
+using domain_type = X
+
+ +
+
+using range_type = Y
+
+ +
+
+using field_type = typename X::field_type
+
+ +
+
+using PressureMatrix = Dune::BCRSMatrix<MatrixBlock<field_type, 1, 1>>
+
+ +
+
+using communication_type = Dune::Communication<int>
+
+ +
+
+

Public Functions

+
+
+inline Dune::SolverCategory::Category category() const override
+
+ +
+
+inline WellModelGhostLastMatrixAdapter(const M &A, const LinearOperatorExtra<X, Y> &wellOper, const std::size_t interiorSize)
+

constructor: just store a reference to a matrix

+
+ +
+
+inline void apply(const X &x, Y &y) const override
+
+ +
+
+inline void applyscaleadd(field_type alpha, const X &x, Y &y) const override
+
+ +
+
+inline const matrix_type &getmat() const override
+
+ +
+
+inline void addWellPressureEquations(PressureMatrix &jacobian, const X &weights, const bool use_well_weights) const
+
+ +
+
+inline void addWellPressureEquationsStruct(PressureMatrix &jacobian) const
+
+ +
+
+inline int getNumberOfExtraEquations() const
+
+ +
+
+

Protected Functions

+
+
+inline void ghostLastProject(Y &y) const
+
+ +
+
+

Protected Attributes

+
+
+const matrix_type &A_
+
+ +
+
+const LinearOperatorExtra<X, Y> &wellOper_
+
+ +
+
+std::size_t interiorSize_
+
+ +
+
+ +
+
+template<class M, class X, class Y>
class WellModelMatrixAdapter : public Dune::AssembledLinearOperator<M, X, Y>
+
+#include <WellOperators.hpp>
+

Adapter to combine a matrix and another linear operator into a combined linear operator.

+

Adapts a matrix A plus another linear operator W (typically from wells) to the assembled linear operator interface by returning S from getmat() and making apply() and applyscaleadd() apply both A and W to the input vector. The adapter is for serial use only as the current parallel version in use is WellModelGhostLastMatrixAdapter.

+
+

Public Types

+
+
+using matrix_type = M
+
+ +
+
+using domain_type = X
+
+ +
+
+using range_type = Y
+
+ +
+
+using field_type = typename X::field_type
+
+ +
+
+using PressureMatrix = Dune::BCRSMatrix<MatrixBlock<field_type, 1, 1>>
+
+ +
+
+

Public Functions

+
+
+inline Dune::SolverCategory::Category category() const override
+
+ +
+
+inline WellModelMatrixAdapter(const M &A, const LinearOperatorExtra<X, Y> &wellOper)
+

constructor: just store a reference to a matrix

+
+ +
+
+inline void apply(const X &x, Y &y) const override
+
+ +
+
+inline void applyscaleadd(field_type alpha, const X &x, Y &y) const override
+
+ +
+
+inline const matrix_type &getmat() const override
+
+ +
+
+inline void addWellPressureEquations(PressureMatrix &jacobian, const X &weights, const bool use_well_weights) const
+
+ +
+
+inline void addWellPressureEquationsStruct(PressureMatrix &jacobian) const
+
+ +
+
+inline int getNumberOfExtraEquations() const
+
+ +
+
+

Protected Attributes

+
+
+const matrix_type &A_
+
+ +
+
+const LinearOperatorExtra<X, Y> &wellOper_
+
+ +
+
+ +
+
+struct WellProdDataType
+
+

Public Types

+
+
+enum WPId
+

Values:

+
+
+enumerator WellLocationi
+
+ +
+
+enumerator WellLocationj
+
+ +
+
+enumerator OilRate
+
+ +
+
+enumerator WaterRate
+
+ +
+
+enumerator GasRate
+
+ +
+
+enumerator FluidResVol
+
+ +
+
+enumerator WaterCut
+
+ +
+
+enumerator GasOilRatio
+
+ +
+
+enumerator WatGasRatio
+
+ +
+
+enumerator BHP
+
+ +
+
+enumerator CPR
+
+ +
+
+enumerator THP
+
+ +
+
+enumerator BPR
+
+ +
+
+enumerator SteadyStatePI
+
+ +
+
+enumerator WellName
+
+ +
+
+enumerator CTRLMode
+
+ +
+ +
+
+

Public Static Attributes

+
+
+static constexpr int numWPValues = 12
+
+ +
+
+static constexpr int numWPNames = 2
+
+ +
+
+ +
+
+template<class Scalar>
class WellProdIndexCalculator
+
+

Collect per-connection static information to enable calculating connection-level or well-level productivity index values when incorporating dynamic phase mobilities.

+
+

Public Functions

+
+
+explicit WellProdIndexCalculator(const Well &well)
+

Constructor

+
+
Parameters:
+

well[in] Individual well for which to collect per-connection static data.

+
+
+
+ +
+
+void reInit(const Well &well)
+

Reinitialization operation

+

Needed to repopulate the internal data members in case of changes to the Well’s properties, e.g., as a result of the Well’s CTFs being rescaled due to WELPI.

+
+
Parameters:
+

well[in] Individual well for which to collect per-connection static data.

+
+
+
+ +
+
+Scalar connectionProdIndStandard(const std::size_t connIdx, const Scalar connMobility) const
+

Compute connection-level steady-state productivity index value using dynamic phase mobility.

+
+
Parameters:
+
    +
  • connIdx[in] Linear connection index. Must be in the range 0..numConnections() - 1.

  • +
  • connMobility[in] Phase mobility at connection connIdx. Typically derived from dynamic flow state conditions in cell intersected by well’s connection connIdx.

  • +
+
+
Returns:
+

Connection-level steady-state productivity index.

+
+
+
+ +
+
+inline std::size_t numConnections() const
+

Number of connections in this well.

+

Used primarily for consistency checks.

+
+ +
+
+

Private Members

+
+
+std::vector<Scalar> standardConnFactors_ = {}
+

Static, per-connection multiplicative PI factors.

+

Corresponds to the well’s connection transmissibility factors, multiplied by a ratio of logarithms if the well has an explicit, positive drainage radius.

+
+ +
+
+ +
+
+template<class Scalar>
class WellState
+
+#include <WellState.hpp>
+

The state of a set of wells, tailored for use by the fully implicit blackoil simulator.

+
+

Public Functions

+
+
+explicit WellState(const ParallelWellInfo<Scalar> &pinfo)
+
+ +
+
+inline explicit WellState(const PhaseUsage &pu)
+
+ +
+
+inline std::size_t size() const
+
+ +
+
+inline std::vector<std::string> wells() const
+
+ +
+
+inline int numWells() const
+
+ +
+
+const ParallelWellInfo<Scalar> &parallelWellInfo(std::size_t well_index) const
+
+ +
+
+void init(const std::vector<Scalar> &cellPressures, const std::vector<Scalar> &cellTemperatures, const Schedule &schedule, const std::vector<Well> &wells_ecl, const std::vector<std::reference_wrapper<ParallelWellInfo<Scalar>>> &parallel_well_info, const int report_step, const WellState *prevState, const std::vector<std::vector<PerforationData<Scalar>>> &well_perf_data, const SummaryState &summary_state, const bool enableDistributedWells)
+

Allocate and initialize if wells is non-null. Also tries to give useful initial values to the bhp(), wellRates() and perfPhaseRatesORG() fields, depending on controls

+
+ +
+
+void resize(const std::vector<Well> &wells_ecl, const std::vector<std::reference_wrapper<ParallelWellInfo<Scalar>>> &parallel_well_info, const Schedule &schedule, const bool handle_ms_well, const std::size_t numCells, const std::vector<std::vector<PerforationData<Scalar>>> &well_perf_data, const SummaryState &summary_state, const bool enable_distributed_wells)
+
+ +
+
+inline void setCurrentWellRates(const std::string &wellName, const std::vector<Scalar> &new_rates)
+
+ +
+
+const std::vector<Scalar> &currentWellRates(const std::string &wellName) const
+
+ +
+
+inline bool hasWellRates(const std::string &wellName) const
+
+ +
+
+inline void clearWellRates()
+
+ +
+
+void gatherVectorsOnRoot(const std::vector<data::Connection> &from_connections, std::vector<data::Connection> &to_connections, const Parallel::Communication &comm) const
+
+ +
+
+data::Wells report(const int *globalCellIdxMap, const std::function<bool(const int)> &wasDynamicallyClosed) const
+
+ +
+
+void reportConnections(std::vector<data::Connection> &connections, const PhaseUsage &pu, std::size_t well_index, const int *globalCellIdxMap) const
+
+ +
+
+void initWellStateMSWell(const std::vector<Well> &wells_ecl, const WellState *prev_well_state)
+

init the MS well related.

+
+ +
+
+void communicateGroupRates(const Parallel::Communication &comm)
+
+ +
+
+void updateGlobalIsGrup(const Parallel::Communication &comm)
+
+ +
+
+void updateEfficiencyScalingFactor(const std::string &wellName, const Scalar value)
+
+ +
+
+inline bool isInjectionGrup(const std::string &name) const
+
+ +
+
+inline bool isProductionGrup(const std::string &name) const
+
+ +
+
+inline bool isOpen(const std::string &name) const
+
+ +
+
+inline Scalar getGlobalEfficiencyScalingFactor(const std::string &name) const
+
+ +
+
+inline Scalar getALQ(const std::string &name) const
+
+ +
+
+inline void setALQ(const std::string &name, Scalar value)
+
+ +
+
+inline int gliftGetDebugCounter()
+
+ +
+
+inline void gliftSetDebugCounter(int value)
+
+ +
+
+inline int gliftUpdateDebugCounter()
+
+ +
+
+inline bool gliftCheckAlqOscillation(const std::string &name) const
+
+ +
+
+inline int gliftGetAlqDecreaseCount(const std::string &name)
+
+ +
+
+inline int gliftGetAlqIncreaseCount(const std::string &name)
+
+ +
+
+inline void gliftUpdateAlqIncreaseCount(const std::string &name, bool increase)
+
+ +
+
+inline void gliftTimeStepInit()
+
+ +
+
+void updateWellsDefaultALQ(const Schedule &schedule, const int report_step, const SummaryState &summary_state)
+
+ +
+
+inline int wellNameToGlobalIdx(const std::string &name)
+
+ +
+
+inline std::string globalIdxToWellName(const int index)
+
+ +
+
+bool wellIsOwned(std::size_t well_index, const std::string &wellName) const
+
+ +
+
+bool wellIsOwned(const std::string &wellName) const
+
+ +
+
+inline bool isRank0() const
+
+ +
+
+void updateStatus(int well_index, WellStatus status)
+
+ +
+
+void openWell(int well_index)
+
+ +
+
+void shutWell(int well_index)
+
+ +
+
+void stopWell(int well_index)
+
+ +
+
+inline void switchToProducer(const std::string &name)
+
+ +
+
+inline int numPhases() const
+

The number of phases present.

+
+ +
+
+inline const PhaseUsage &phaseUsage() const
+
+ +
+
+inline std::vector<Scalar> &wellRates(std::size_t well_index)
+

One rate per well and phase.

+
+ +
+
+inline const std::vector<Scalar> &wellRates(std::size_t well_index) const
+
+ +
+
+inline const std::string &name(std::size_t well_index) const
+
+ +
+
+inline std::optional<std::size_t> index(const std::string &well_name) const
+
+ +
+
+inline const SingleWellState<Scalar> &operator[](std::size_t well_index) const
+
+ +
+
+inline const SingleWellState<Scalar> &operator[](const std::string &well_name) const
+
+ +
+
+inline SingleWellState<Scalar> &operator[](std::size_t well_index)
+
+ +
+
+inline SingleWellState<Scalar> &operator[](const std::string &well_name)
+
+ +
+
+inline const SingleWellState<Scalar> &well(std::size_t well_index) const
+
+ +
+
+inline const SingleWellState<Scalar> &well(const std::string &well_name) const
+
+ +
+
+inline SingleWellState<Scalar> &well(std::size_t well_index)
+
+ +
+
+inline SingleWellState<Scalar> &well(const std::string &well_name)
+
+ +
+
+inline bool has(const std::string &well_name) const
+
+ +
+
+bool operator==(const WellState&) const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline bool is_permanently_inactive_well(const std::string &wname) const
+
+ +
+
+

Public Static Functions

+
+
+static WellState serializationTestObject(const ParallelWellInfo<Scalar> &pinfo)
+
+ +
+
+static void calculateSegmentRates(const ParallelWellInfo<Scalar> &pw_info, const std::vector<std::vector<int>> &segment_inlets, const std::vector<std::vector<int>> &segment_perforations, const std::vector<Scalar> &perforation_rates, const int np, const int segment, std::vector<Scalar> &segment_rates)
+
+ +
+
+

Public Static Attributes

+
+
+static const std::uint64_t event_mask = ScheduleEvents::WELL_STATUS_CHANGE | ScheduleEvents::PRODUCTION_UPDATE | ScheduleEvents::INJECTION_UPDATE
+
+ +
+
+static const int Water = BlackoilPhases::Aqua
+
+ +
+
+static const int Oil = BlackoilPhases::Liquid
+
+ +
+
+static const int Gas = BlackoilPhases::Vapour
+
+ +
+
+

Private Functions

+
+
+data::Segment reportSegmentResults(const int well_id, const int seg_ix, const int seg_no) const
+
+ +
+
+void base_init(const std::vector<Scalar> &cellPressures, const std::vector<Scalar> &cellTemperatures, const std::vector<Well> &wells_ecl, const std::vector<std::reference_wrapper<ParallelWellInfo<Scalar>>> &parallel_well_info, const std::vector<std::vector<PerforationData<Scalar>>> &well_perf_data, const SummaryState &summary_state)
+

Allocate and initialize if wells is non-null. Also tries to give useful initial values to the bhp() and wellRates() fields, depending on controls. The perfRates() field is filled with zero, and perfPress() with -1e100.

+
+ +
+
+void initSingleWell(const std::vector<Scalar> &cellPressures, const std::vector<Scalar> &cellTemperatures, const Well &well, const std::vector<PerforationData<Scalar>> &well_perf_data, const ParallelWellInfo<Scalar> &well_info, const SummaryState &summary_state)
+
+ +
+
+void initSingleProducer(const Well &well, const ParallelWellInfo<Scalar> &well_info, Scalar pressure_first_connection, const std::vector<PerforationData<Scalar>> &well_perf_data, const SummaryState &summary_state)
+
+ +
+
+void initSingleInjector(const Well &well, const ParallelWellInfo<Scalar> &well_info, Scalar pressure_first_connection, Scalar temperature_first_connection, const std::vector<PerforationData<Scalar>> &well_perf_data, const SummaryState &summary_state)
+
+ +
+
+void reportConnectionFactors(const std::size_t well_index, std::vector<data::Connection> &connections) const
+
+ +
+
+void reportConnectionPressuresAndRates(const std::size_t well_index, const PhaseUsage &pu, std::vector<data::Connection> &connections) const
+
+ +
+
+void reportConnectionFilterCake(const std::size_t well_index, std::vector<data::Connection> &connections) const
+
+ +
+
+void reportFractureStatistics(const std::vector<ConnFracStatistics<Scalar>> &stats, std::vector<data::Connection> &connections) const
+
+ +
+
+

Private Members

+
+
+bool enableDistributedWells_ = false
+
+ +
+
+PhaseUsage phase_usage_
+
+ +
+
+WellContainer<SingleWellState<Scalar>> wells_
+
+ +
+
+std::optional<GlobalWellInfo<Scalar>> global_well_info
+
+ +
+
+ALQState<Scalar> alq_state
+
+ +
+
+std::map<std::string, std::pair<bool, std::vector<Scalar>>> well_rates
+
+ +
+
+std::vector<std::string> permanently_inactive_well_names_
+
+ +
+
+

Private Static Functions

+
+
+static void calculateSegmentRatesBeforeSum(const ParallelWellInfo<Scalar> &pw_info, const std::vector<std::vector<int>> &segment_inlets, const std::vector<std::vector<int>> &segment_perforations, const std::vector<Scalar> &perforation_rates, const int np, const int segment, std::vector<Scalar> &segment_rates)
+
+ +
+
+ +
+
+template<class Scalar>
class WellTest
+
+#include <WellTest.hpp>
+

Class for performing well tests.

+
+

Public Functions

+
+
+inline explicit WellTest(const WellInterfaceGeneric<Scalar> &well)
+

Constructor sets reference to well.

+
+ +
+
+void updateWellTestStateEconomic(const SingleWellState<Scalar> &ws, const double simulation_time, const bool write_message_to_opmlog, WellTestState &well_test_state, bool zero_group_target, DeferredLogger &deferred_logger) const
+
+ +
+
+void updateWellTestStatePhysical(const double simulation_time, const bool write_message_to_opmlog, WellTestState &well_test_state, DeferredLogger &deferred_logger) const
+
+ +
+
+

Private Functions

+
+
+void checkMaxGORLimit(const WellEconProductionLimits &econ_production_limits, const SingleWellState<Scalar> &ws, RatioLimitCheckReport &report) const
+
+ +
+
+void checkMaxWGRLimit(const WellEconProductionLimits &econ_production_limits, const SingleWellState<Scalar> &ws, RatioLimitCheckReport &report) const
+
+ +
+
+void checkMaxWaterCutLimit(const WellEconProductionLimits &econ_production_limits, const SingleWellState<Scalar> &ws, RatioLimitCheckReport &report) const
+
+ +
+
+template<class RatioFunc>
bool checkMaxRatioLimitWell(const SingleWellState<Scalar> &ws, const Scalar max_ratio_limit, const RatioFunc &ratioFunc) const
+
+ +
+
+template<class RatioFunc>
void checkMaxRatioLimitCompletions(const SingleWellState<Scalar> &ws, const Scalar max_ratio_limit, const RatioFunc &ratioFunc, RatioLimitCheckReport &report) const
+
+ +
+
+bool checkRateEconLimits(const WellEconProductionLimits &econ_production_limits, const std::vector<Scalar> &rates_or_potentials, DeferredLogger &deferred_logger) const
+
+ +
+
+RatioLimitCheckReport checkRatioEconLimits(const WellEconProductionLimits &econ_production_limits, const SingleWellState<Scalar> &ws, DeferredLogger &deferred_logger) const
+
+ +
+
+

Private Members

+
+
+const WellInterfaceGeneric<Scalar> &well_
+

Reference to well interface.

+
+ +
+
+ +
+
+template<class Scalar>
struct WellTracerRate
+
+#include <WellTracerRate.hpp>
+
+

Public Functions

+
+
+WellTracerRate() = default
+
+ +
+
+inline WellTracerRate(const std::string &n, const Scalar r)
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+inline bool operator==(const WellTracerRate &that) const
+
+ +
+
+

Public Members

+
+
+std::string name = {}
+
+ +
+
+Scalar rate = {}
+
+ +
+
+ +
+
+template<class Scalar>
struct WGState
+
+#include <WGState.hpp>
+
+

Public Functions

+
+
+explicit WGState(const PhaseUsage &pu)
+
+ +
+
+void wtest_state(std::unique_ptr<WellTestState> wtest_state)
+
+ +
+
+bool operator==(const WGState&) const
+
+ +
+
+template<class Serializer>
inline void serializeOp(Serializer &serializer)
+
+ +
+
+

Public Members

+
+
+WellState<Scalar> well_state
+
+ +
+
+GroupState<Scalar> group_state
+
+ +
+
+WellTestState well_test_state
+
+ +
+
+

Public Static Functions

+
+
+static WGState serializationTestObject(const ParallelWellInfo<Scalar> &pinfo)
+
+ +
+
+ +
+
+template<class Scalar>
struct ZoltanImbalanceTol
+
+
+

Public Static Attributes

+
+
+static constexpr Scalar value = 1.1
+
+ +
+
+ +
+
+struct ZoltanParams
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = "graph"
+
+ +
+
+ +
+
+template<typename Element>
struct ZoltanPartitioningControl
+
+#include <partitionCells.hpp>
+

Control parameters for on-rank subdomain partitioning using Zoltan library.

+
+
Template Parameters:
+

Element – Grid view entity type

+
+
+
+

Public Members

+
+
+double domain_imbalance = {1.03}
+

Partition imbalance, percentage units. Assumed to be the run’s value of ZoltanImbalanceTol.

+
+ +
+
+std::function<int(const Element&)> index
+

Compute a locally unique, for this MPI process, ID of a local cell/element/entity.

+
+ +
+
+std::function<int(int)> local_to_global
+

Compute a globally unique, across all MPI processes, ID for a local cell/element/entity. Might for instance return the cell’s linearised index

+

i + nx*(j + ny*k)

+

of the Cartesian cell (i,j,k).

+
+ +
+
+ +
+
+struct ZoltanPhgEdgeSizeThreshold
+
+
+

Public Static Attributes

+
+
+static constexpr auto value = 0.35
+
+ +
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+

Enums

+
+
+enum class MVType
+

Values:

+
+
+enumerator SET
+
+ +
+
+enumerator PLUS
+
+ +
+
+enumerator MINUS
+
+ +
+ +
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace Amgx
+
+ +
+
+namespace boost
+
+ +
+
+namespace posix_time
+
+ +
+
+namespace property_tree
+
+

Typedefs

+
+
+using ptree = basic_ptree<std::string, std::string, std::less<std::string>>
+
+ +
+
+ +
+
+namespace Dune
+
+

Functions

+
+
+template<class OriginalPreconditioner, class Comm, class ...Args>
std::shared_ptr<OwningBlockPreconditioner<OriginalPreconditioner, Comm>> wrapBlockPreconditioner(const Comm &comm, Args&&... args)
+
+ +
+
+template<typename T, typename A, int i>
std::ostream &operator<<(std::ostream &out, const BlockVector<FieldVector<T, i>, A> &vector)
+
+ +
+
+template<typename T, typename A, int i>
std::istream &operator>>(std::istream &input, BlockVector<FieldVector<T, i>, A> &vector)
+
+ +
+
+template<class OriginalPreconditioner, class ...Args>
std::shared_ptr<DummyUpdatePreconditioner<OriginalPreconditioner>> getDummyUpdateWrapper(Args&&... args)
+
+ +
+
+template<class OriginalPreconditioner, class ...Args>
auto getRebuildOnUpdateWrapper(Args... args)
+

Wrapper function creating and return a shared pointer to a preconditioner which is reconstructed on update.

+
+
Template Parameters:
+
    +
  • OriginalPreconditioner – - Preconditioner of your choice

  • +
  • ...Args – - Types of the arguments needed in the preconditioner constructed

  • +
+
+
Parameters:
+

...args – - Arguments needed to construct the preconditioner of choice

+
+
Returns:
+

Shared pointer to preconditioner which has an update function that reconstrcuts the preconditioner

+
+
+
+ +
+
+ +
+
+namespace Amg
+
+ +
+
+namespace MatrixMarketImpl
+
+ +
+
+namespace Hypre
+
+ +
+
+namespace Opm
+

This file contains a set of helper functions used by VFPProd / VFPInj.

+
+

Typedefs

+
+
+using IndexMapType = std::vector<int>
+
+ +
+
+using IndexMapStorageType = std::vector<IndexMapType>
+
+ +
+
+using P2PCommunicatorType = Dune::Point2PointCommunicator<Dune::SimpleMessageBuffer>
+
+ +
+
+using MessageBufferType = typename P2PCommunicatorType::MessageBufferType
+
+ +
+
+template<class Scalar>
using MatLaw = EclMaterialLawManager<ThreePhaseMaterialTraits<Scalar, 0, 1, 2>>
+
+ +
+
+template<class T>
using FS = BlackOilFluidSystem<T, BlackOilDefaultFluidSystemIndices>
+
+ +
+
+template<class Scalar, std::size_t Size>
using BFV = Dune::BlockVector<Dune::FieldVector<Scalar, Size>>
+
+ +
+
+typedef Dune::InverseOperatorResult InverseOperatorResult
+
+ +
+
+using CommSeq = Dune::Amg::SequentialInformation
+
+ +
+
+template<class Scalar, int Dim>
using OpFSeq = Dune::MatrixAdapter<Dune::BCRSMatrix<Dune::FieldMatrix<Scalar, Dim, Dim>>, Dune::BlockVector<Dune::FieldVector<Scalar, Dim>>, Dune::BlockVector<Dune::FieldVector<Scalar, Dim>>>
+
+ +
+
+template<class Scalar, int Dim>
using OpBSeq = Dune::MatrixAdapter<Dune::BCRSMatrix<MatrixBlock<Scalar, Dim, Dim>>, Dune::BlockVector<Dune::FieldVector<Scalar, Dim>>, Dune::BlockVector<Dune::FieldVector<Scalar, Dim>>>
+
+ +
+
+template<class Scalar, int Dim, bool overlap>
using OpW = WellModelMatrixAdapter<Dune::BCRSMatrix<MatrixBlock<Scalar, Dim, Dim>>, Dune::BlockVector<Dune::FieldVector<Scalar, Dim>>, Dune::BlockVector<Dune::FieldVector<Scalar, Dim>>>
+
+ +
+
+template<class Scalar, int Dim, bool overlap>
using OpWG = WellModelGhostLastMatrixAdapter<Dune::BCRSMatrix<MatrixBlock<Scalar, Dim, Dim>>, Dune::BlockVector<Dune::FieldVector<Scalar, Dim>>, Dune::BlockVector<Dune::FieldVector<Scalar, Dim>>, overlap>
+
+ +
+
+template<class Scalar>
using dIter = typename std::vector<Scalar>::iterator
+
+ +
+
+template<class Scalar>
using cdIter = typename std::vector<Scalar>::const_iterator
+
+ +
+
+typedef int RegionId
+
+ +
+
+template<class Scalar>
using AvgP = RegionAverageCalculator::AverageRegionalPressure<BlackOilFluidSystem<Scalar>, std::vector<int>>
+
+ +
+
+template<class Scalar>
using AvgPMap = std::map<std::string, std::unique_ptr<AvgP<Scalar>>>
+
+ +
+
+

Enums

+
+
+enum class NonlinearRelaxType
+

Values:

+
+
+enumerator Dampen
+
+ +
+
+enumerator SOR
+
+ +
+ +
+
+enum class DomainSolveApproach
+

Solver approach for NLDD.

+

Values:

+
+
+enumerator Jacobi
+
+ +
+
+enumerator GaussSeidel
+
+ +
+ +
+
+enum class DomainOrderingMeasure
+

Measure to use for domain ordering.

+

Values:

+
+
+enumerator AveragePressure
+
+ +
+
+enumerator MaxPressure
+
+ +
+
+enumerator Residual
+
+ +
+ +
+
+enum class ColoringType
+

Specify coloring type.

+

The coloring types have been implemented initially to parallelize DILU preconditioner and parallel sparse triangular solves. Symmetric coloring will create a dependency from row i to j if both element A_ij and A_ji exists. Lower coloring creates a dependency from row i to j (where i < j) if A_ij is nonzero. Upper coloring creates a dependecy from row i to j (where i > j) if A_ij is nonzero.

+

Values:

+
+
+enumerator SYMMETRIC
+
+ +
+
+enumerator LOWER
+
+ +
+
+enumerator UPPER
+
+ +
+ +
+
+enum class MILU_VARIANT
+

Values:

+
+
+enumerator ILU
+

Do not perform modified ILU.

+
+ +
+
+enumerator MILU_1
+

\(U_{ii} = U_{ii} +\) sum(dropped entries)

+
+ +
+
+enumerator MILU_2
+

\(U_{ii} = U_{ii} + sign(U_{ii}) * \) sum(dropped entries)

+
+ +
+
+enumerator MILU_3
+

\(U_{ii} = U_{ii} sign(U_{ii}) * \) sum(|dropped entries|)

+
+ +
+
+enumerator MILU_4
+

\(U_{ii} = U_{ii} + (U_{ii}>0?1:0) * \) sum(dropped entries)

+
+ +
+ +
+
+enum class TimeStepControlType
+

Values:

+
+
+enumerator SimpleIterationCount
+
+ +
+
+enumerator PID
+
+ +
+
+enumerator PIDAndIterationCount
+
+ +
+
+enumerator HardCodedTimeStep
+
+ +
+
+enumerator General3rdOrder
+
+ +
+ +
+
+enum class FileOutputMode
+

Values:

+
+
+enumerator OUTPUT_NONE
+

No file output.

+
+ +
+
+enumerator OUTPUT_LOG_ONLY
+

Output only to log files, no ECLIPSE output.

+
+ +
+
+enumerator OUTPUT_ALL
+

Output to all files.

+
+ +
+ +
+
+enum class VoigtIndex
+

Values:

+
+
+enumerator XX
+
+ +
+
+enumerator XY
+
+ +
+
+enumerator XZ
+
+ +
+
+enumerator YX
+
+ +
+
+enumerator YY
+
+ +
+
+enumerator YZ
+
+ +
+
+enumerator ZX
+
+ +
+
+enumerator ZY
+
+ +
+
+enumerator ZZ
+
+ +
+ +
+
+

Functions

+
+
+void printPRTHeader(const int nprocs, const int nthreads, const std::string &parameters, std::string_view moduleVersion, std::string_view compileTimestamp)
+
+ +
+
+void printFlowBanner(int nprocs, int nthreads, std::string_view moduleVersionName)
+
+ +
+
+void printFlowTrailer(int nprocs, int nthreads, const double total_setup_time, const double deck_read_time, const SimulatorReport &report)
+
+ +
+
+void registerDamarisParameters()
+

Register damaris runtime parameters.

+
+ +
+
+template<>
void serializeOp<Serializer<Serialization::MemPacker>>(Serializer<Serialization::MemPacker> &serializer)
+
+ +
+
+template<class Scalar>
void registerFlowProblemParameters()
+
+ +
+
+template void registerFlowProblemParameters< double > ()
+
+ +
+
+template<class TypeTag>
int flowMain(int argc, char **argv, bool outputCout, bool outputFiles)
+
+ +
+
+void reportNlddStatistics(const std::vector<SimulatorReport> &domain_reports, const SimulatorReport &local_report, const bool output_cout, const Parallel::Communication &comm)
+

Reports NLDD statistics after simulation.

+
+
Parameters:
+
    +
  • domain_reports – The accumulated reports per domain

  • +
  • local_report – The accumulated reports per rank

  • +
  • output_cout – Whether to output to cout

  • +
  • comm – The communication object for parallel runs

  • +
+
+
+
+ +
+
+template<class Grid, class Domain, class ElementMapper, class CartMapper>
void writeNonlinearIterationsPerCell(const std::filesystem::path &odir, const std::vector<Domain> &domains, const std::vector<SimulatorReport> &domain_reports, const Grid &grid, const ElementMapper &elementMapper, const CartMapper &cartMapper)
+

Writes the number of nonlinear iterations per cell to a file in ResInsight compatible format

+
+
Parameters:
+
    +
  • odir – The output directory

  • +
  • domains – The subdomains

  • +
  • domain_reports – The accumulated reports per domain

  • +
  • grid – The grid

  • +
  • elementMapper – The element mapper

  • +
  • cartMapper – The cartesian index mapper

  • +
+
+
+
+ +
+
+template<class Grid, class Domain, class ElementMapper, class CartMapper>
void writePartitions(const std::filesystem::path &odir, const std::vector<Domain> &domains, const Grid &grid, const ElementMapper &elementMapper, const CartMapper &cartMapper)
+

Writes the partition vector to a file in ResInsight compatible format and a partition file for each rank

+
+
Parameters:
+
    +
  • odir – The output directory

  • +
  • domains – Vector of domains

  • +
  • grid – The grid

  • +
  • elementMapper – The element mapper

  • +
  • cartMapper – The cartesian index mapper

  • +
+
+
+
+ +
+
+template<class Grid, class Domain>
void printDomainDistributionSummary(const std::vector<int> &partition_vector, const std::vector<Domain> &domains, SimulatorReport &local_reports_accumulated, std::vector<SimulatorReport> &domain_reports_accumulated, const Grid &grid, int num_wells)
+

Prints a summary of domain distribution across ranks

+
+
Parameters:
+
    +
  • partition_vector – The partition vector

  • +
  • domains – The subdomains

  • +
  • local_reports_accumulated – The accumulated reports per rank

  • +
  • domain_reports_accumulated – The accumulated reports per domain

  • +
  • grid – The grid

  • +
  • num_wells – The number of wells

  • +
+
+
+
+ +
+
+template<class Grid, class Domain>
std::vector<int> reconstitutePartitionVector(const std::vector<Domain> &domains, const Grid &grid)
+

Reconstructs the partition vector that maps each grid cell to its corresponding domain ID, accounting for domain distribution across MPI ranks.

+
+
Parameters:
+
    +
  • domains – Vector of domains

  • +
  • grid – The grid

  • +
+
+
Returns:
+

The reconstructed partition vector

+
+
+
+ +
+
+template<class GridView, class Element>
std::pair<std::vector<int>, int> partitionCells(const std::string &method, const int num_local_domains, const GridView &grid_view, const std::vector<Well> &wells, const std::unordered_map<std::string, std::set<int>> &possibleFutureConnections, const ZoltanPartitioningControl<Element> &zoltan_ctrl, const int num_neighbor_levels)
+

Partition rank’s interior cells.

+
+
Parameters:
+
    +
  • method[in] Partitioning method. Supported values are "zoltan", "simple", or a filename with the extension ".partition". The "zoltan" method invokes the Zoltan graph partitioning package and requires both MPI and an active Zoltan library. The "simple" method uses a one-dimensional load-balanced approach, and the filename method will read a precomputed partition vector from the named file.

  • +
  • num_local_domains[in] Number of subdomains. Not used when explicit partitioning is input from a file.

  • +
  • comm[in] MPI Communication object for exchanging globally unique cell IDs and for communication within the Zoltan library. Not used unless

    method == "zoltan" 
    +
    +
    +.

  • +
  • grid_view[in] View of rank’s cells, both interior and overlap cells. Not used unless

    method == "zoltan" 
    +
    +
    +.

  • +
  • wells[in] Collection of simulation model wells. Not used unless

    method == "zoltan" 
    +
    +
    +.

  • +
  • zoltan_ctrl[in] Control parameters for local Zoltan-based partitioning. Not used unless

    method == "zoltan" 
    +
    +
    +.

  • +
  • num_neighbor_levels[in] Number of neighbor levels to consider for partitioning. 0 means only direct well connections are considered, 1 means one level of neighbors, etc.

  • +
+
+
Returns:
+

Partition vector&#8212;subdomain ID for each cell in grid_view traversal order for its interior cells&#8212;and the number of subdomains on current rank.

+
+
+
+ +
+
+std::pair<std::vector<int>, int> partitionCellsFromFile(const std::string &filename, const int num_cells)
+

Read a partitioning from file, assumed to contain one number per cell, its partition number.

+
+
Returns:
+

pair containing a partition vector (partition number for each cell), and the number of partitions.

+
+
+
+ +
+
+std::pair<std::vector<int>, int> partitionCellsSimple(const int num_cells, const int num_domains)
+

Trivially simple partitioner assigning partitions en bloc, consecutively by cell index.

+
+
Returns:
+

pair containing a partition vector (partition number for each cell), and the number of partitions.

+
+
+
+ +
+
+inline DomainOrderingMeasure domainOrderingMeasureFromString(const std::string_view measure)
+
+ +
+
+template<class BridgeMatrix>
int replaceZeroDiagonal(BridgeMatrix &mat, std::vector<typename BridgeMatrix::size_type> &diag_indices)
+
+ +
+
+template<class BridgeMatrix>
void checkMemoryContiguous(const BridgeMatrix &mat)
+
+ +
+
+template<class Graph>
std::tuple<std::vector<int>, int, std::vector<std::size_t>> colorVerticesWelshPowell(const Graph &graph)
+

Color the vertices of graph.

+

It uses the algorithm of Welsh and Powell for this.

+
+
Parameters:
+

graph – The graph to color. Must adhere to the graph interface of dune-istl.

+
+
Returns:
+

A pair of a vector with the colors of the vertices and the number of colors assigned

+
+
+
+ +
+
+template<class Graph>
std::vector<std::size_t> reorderVerticesPreserving(const std::vector<int> &colors, int noColors, const std::vector<std::size_t> &verticesPerColor, const Graph &graph)
+

! Reorder colored graph preserving order of vertices with the same color.

+
+ +
+
+template<class Graph>
std::vector<std::size_t> reorderVerticesSpheres(const std::vector<int> &colors, int noColors, const std::vector<std::size_t> &verticesPerColor, const Graph &graph, typename Graph::VertexDescriptor root)
+

! Reorder Vetrices in spheres

+
+ +
+
+template<class M>
Opm::SparseTable<std::size_t> getMatrixRowColoring(const M &matrix, ColoringType coloringType)
+

Given a matrix and dependecy type, returns a SparseTable grouping the rows by which can be executed in parallel without breaking dependencies.

+

This coloring algorithm interprets the sparsity structure of a matrix as a graph. Each row is given a color or level where all the rows in the same level only have dependencies from lower levels. The level computation is done with dynamic programming, and to improve caching the rows in the same level stay in matrix order.

+
+
Parameters:
+
    +
  • matrix – A dune sparse matrix

  • +
  • coloringType – The coloringtype determines what constitutes a dependency, see ColoringType definition above

  • +
+
+
Returns:
+

SparseTable with rows of the matrix grouped into least number of groups while dependencies only come from groups with lower index

+
+
+
+ +
+
+MILU_VARIANT convertString2Milu(const std::string &milu)
+
+ +
+
+template<class T1>
auto accumulateMaskedValues(const T1 &container, const std::vector<double> *maskContainer) -> decltype(container[0] * (*maskContainer)[0])
+

Accumulates entries masked with 1.

+
+
Parameters:
+
    +
  • container – The container whose values to accumulate.

  • +
  • maskContainer – null pointer or a pointer to a container with entries 0 and 1. Only values at indices with a 1 stored will be accumulated. If null then all values will be accumulated

  • +
+
+
Returns:
+

the summ of all entries that should be represented.

+
+
+
+ +
+
+template<class Communication>
void extendCommunicatorWithWells(const Communication &comm, std::shared_ptr<Communication> &commRW, const int nw)
+
+ +
+
+PropertyTree setupPropertyTree(FlowLinearSolverParameters p, bool linearSolverMaxIterSet, bool linearSolverReductionSet)
+

Set up a property tree intended for FlexibleSolver by either reading the tree from a JSON file or creating a tree giving the default solver and preconditioner. If the latter, the parameters &#8212;linear-solver-reduction, &#8212;linear-solver-maxiter and &#8212;linear-solver-verbosity are used, but if reading from file the data in the JSON file will override any other options.

+
+ +
+
+std::string getSolverString(const FlowLinearSolverParameters &p)
+
+ +
+
+PropertyTree setupCPRW(const std::string&, const FlowLinearSolverParameters &p)
+
+ +
+
+PropertyTree setupCPR(const std::string &conf, const FlowLinearSolverParameters &p)
+
+ +
+
+PropertyTree setupAMG(const std::string &conf, const FlowLinearSolverParameters &p)
+
+ +
+
+PropertyTree setupILU(const std::string &conf, const FlowLinearSolverParameters &p)
+
+ +
+
+PropertyTree setupDILU(const std::string &conf, const FlowLinearSolverParameters &p)
+
+ +
+
+PropertyTree setupUMFPack(const std::string &conf, const FlowLinearSolverParameters &p)
+
+ +
+
+template<typename C>
auto setUseFixedOrder(C &criterion, bool booleanValue) -> decltype(criterion.setUseFixedOrder(booleanValue))
+
+ +
+
+template<typename C>
void setUseFixedOrder(C&, ...)
+
+ +
+
+std::string to_string(const ConvergenceReport::ReservoirFailure::Type t)
+
+ +
+
+std::string to_string(const ConvergenceReport::Severity s)
+
+ +
+
+std::string to_string(const ConvergenceReport::WellFailure::Type t)
+
+ +
+
+std::string to_string(const ConvergenceReport::WellFailure &wf)
+
+ +
+
+std::string to_string(const ConvergenceReport::PenaltyCard &pc)
+
+ +
+
+template<class Scalar>
void registerEclTimeSteppingParameters()
+
+ +
+
+template void registerEclTimeSteppingParameters< double > ()
+
+ +
+
+ConvergenceReport gatherConvergenceReport(const ConvergenceReport &local_report, Parallel::Communication mpi_communicator)
+

Create a global convergence report combining local (per-process) reports.

+
+ +
+
+Opm::DeferredLogger gatherDeferredLogger(const Opm::DeferredLogger &local_deferredlogger, Parallel::Communication communicator)
+

Create a global log combining local logs.

+
+ +
+
+std::string moduleVersionName()
+

Return the version name of the module, for example “2015.10” (for a release branch) or “2016.04-pre” (for a master branch).

+
+ +
+
+std::string moduleVersionHash()
+

Return a (short) git hash for the current version of the module if this is a Release build (as defined by CMake), or “debug” for Debug builds.

+
+ +
+
+std::string moduleVersion()
+

Return a string containing both the name and hash, if N is the name and H is the hash it will be “N (H)”. For example “2016.04-pre (f15be17)” or “2016.04-pre (debug)”.

+
+ +
+
+std::string compileTimestamp()
+

Return a string “dd-mm-yyyy at HH::MM::SS hrs” which is the time the binary was compiled.

+
+ +
+
+RestartValue loadParallelRestart(const EclipseIO *eclIO, Action::State &actionState, SummaryState &summaryState, const std::vector<Opm::RestartKey> &solutionKeys, const std::vector<Opm::RestartKey> &extraKeys, Parallel::Communication comm)
+
+ +
+
+data::Solution loadParallelRestartSolution(const EclipseIO *eclIO, const std::vector<Opm::RestartKey> &solutionKeys, Parallel::Communication comm, const int step)
+
+ +
+
+RestartValue loadParallelRestart(const EclipseIO *eclIO, Action::State &actionState, SummaryState &summaryState, const std::vector<RestartKey> &solutionKeys, const std::vector<RestartKey> &extraKeys, Parallel::Communication comm)
+
+ +
+
+data::Solution loadParallelRestartSolution(const EclipseIO *eclIO, const std::vector<RestartKey> &solutionKeys, Parallel::Communication comm, const int step)
+
+ +
+
+void eclStateBroadcast(Parallel::Communication comm, EclipseState &eclState, Schedule &schedule, SummaryConfig &summaryConfig, UDQState &udqState, Action::State &actionState, WellTestState &wtestState)
+

Broadcasts an eclipse state from root node in parallel runs. !

+
+
Parameters:
+
    +
  • eclState – EclipseState to broadcast !

  • +
  • schedule – Schedule to broadcast !

  • +
  • summaryConfig – SummaryConfig to broadcast

  • +
+
+
+
+ +
+
+template<class T>
void eclBroadcast(Parallel::Communication comm, T &data)
+
+ +
+
+template void eclBroadcast (Parallel::Communication, TransMult &)
+
+ +
+
+template void eclBroadcast (Parallel::Communication, Schedule &)
+
+ +
+
+template void eclBroadcast (Parallel::Communication, SummaryConfig &)
+
+ +
+
+PhaseUsage phaseUsage(const Phases &phases)
+

Determine the active phases.

+
+ +
+
+PhaseUsage phaseUsageFromDeck(const EclipseState &eclipseState)
+

Looks at presence of WATER, OIL and GAS keywords in state object to determine active phases.

+
+ +
+
+PhaseUsage phaseUsageFromDeck(const Deck &deck)
+

Looks at presence of WATER, OIL and GAS keywords in deck to determine active phases.

+
+ +
+
+void ensureOutputDirExists(const std::string &cmdline_output_dir)
+
+ +
+
+void prepareResultOutputDirectory(const std::string &baseName, const std::filesystem::path &outputDir)
+
+ +
+
+std::unique_ptr<ParseContext> setupParseContext(const bool exitOnAllErrors)
+
+ +
+
+void setupStreamLogging(const std::string &stdout_log_id)
+
+ +
+
+FileOutputMode setupLogging(Parallel::Communication &comm, const std::string &deck_filename, const std::string &cmdline_output_dir, const std::string &cmdline_output, bool output_cout_, const std::string &stdout_log_id, const bool allRanksDbgLog)
+
+ +
+
+void readDeck(Parallel::Communication comm, const std::string &deckFilename, std::shared_ptr<EclipseState> &eclipseState, std::shared_ptr<Schedule> &schedule, std::unique_ptr<UDQState> &udqState, std::unique_ptr<Action::State> &actionState, std::unique_ptr<WellTestState> &wtestState, std::shared_ptr<SummaryConfig> &summaryConfig, std::shared_ptr<Python> python, const std::string &parsingStrictness, const std::string &actionParsingStrictness, const std::string &inputSkipMode, bool initFromRestart, bool checkDeck, bool keepKeywords, const std::optional<int> &outputInterval, bool slaveMode)
+

Reads the deck and creates all necessary objects if needed.

+

If pointers already contains objects then they are used otherwise they are created and can be used outside later.

+
+ +
+
+void verifyValidCellGeometry(Parallel::Communication comm, const EclipseState &eclipseState)
+
+ +
+
+std::map<std::string, std::string> setupZoltanParams(const std::string &conf, const std::optional<double> &edgeSizeThreshold = {})
+

Form collection of Zoltan partitioning parameters from named configuration

+

+-* graph Generates configuration parameters for the “GRAPH” load-balancing method, using the “PHG” graph package.

+

-* hypergraph Generates configuration parameters for the “HYPERGRAPH” load-balancing method.

+

-* scotch Generates configuration parameters for the “GRAPH” load-balancing method, using the “Scotch” graph package.

+
+
Parameters:
+
    +
  • conf[in] Named Zoltan configuration. Must either be the name of a JSON configuration file with the filename extension “.json”, or one of the known configuration names

  • +
  • edgeSizeThreshold[in] Low-level Zoltan partitioning control parameter for when to omit a hyperedge in a hypergraph. Fraction in the range [0,1] representing a threshold above which to omit discard hyperedges. Used for conf=”graph” and conf=”hypergraph”. Nullopt to use the built-in default value.

  • +
+
+
Returns:
+

Collection of Zoltan partitioning parameters.

+
+
+
+ +
+
+std::map<std::string, std::string> setupMetisParams(const std::string &conf)
+

Form collection of METIS partitioning parameters from named configuration

+
+
Parameters:
+

conf[in] Named METIS configuration. Must either be the name of a JSON configuration file with the filename extension “.json”, or the known configuration name “default” which uses the built-in default partitioning parameters.

+
+
Returns:
+

Collection of METIS partitioning parameters.

+
+
+
+ +
+
+template<class T1, class T2>
SymmTensor<T1> operator*(const T2 value, SymmTensor<T1> t1)
+
+ +
+
+template<class T1, class T2>
SymmTensor<T1> operator*(SymmTensor<T1> t1, const T2 value)
+
+ +
+
+template<class T>
SymmTensor<T> operator+(SymmTensor<T> t1, const SymmTensor<T> &t2)
+
+ +
+
+std::string simTimeToString(const std::time_t start_time, const double sim_time)
+
+ +
+
+template<class Scalar>
bool operator<(const ParallelWellInfo<Scalar> &well1, const ParallelWellInfo<Scalar> &well2)
+
+ +
+
+template<class Scalar>
bool operator==(const ParallelWellInfo<Scalar> &well1, const ParallelWellInfo<Scalar> &well2)
+
+ +
+
+template<class Scalar>
bool operator!=(const ParallelWellInfo<Scalar> &well1, const ParallelWellInfo<Scalar> &well2)
+
+ +
+
+template<class Scalar>
bool operator<(const std::pair<std::string, bool> &pair, const ParallelWellInfo<Scalar> &well)
+
+ +
+
+template<class Scalar>
bool operator<(const ParallelWellInfo<Scalar> &well, const std::pair<std::string, bool> &pair)
+
+ +
+
+template<class Scalar>
bool operator==(const std::pair<std::string, bool> &pair, const ParallelWellInfo<Scalar> &well)
+
+ +
+
+template<class Scalar>
bool operator==(const ParallelWellInfo<Scalar> &well, const std::pair<std::string, bool> &pair)
+
+ +
+
+template<class Scalar>
bool operator!=(const std::pair<std::string, bool> &pair, const ParallelWellInfo<Scalar> &well)
+
+ +
+
+template<class Scalar>
bool operator!=(const ParallelWellInfo<Scalar> &well, const std::pair<std::string, bool> &pair)
+
+ +
+
+template<class Scalar>
std::vector<Scalar> connectionProdIndStandard(const WellProdIndexCalculator<Scalar> &wellPICalc, const std::vector<Scalar> &connMobility)
+

Compute connection-level productivity index values for all connections in a well.

+
+
Parameters:
+
    +
  • wellPICalc[in] Productivity index calculator.

  • +
  • connMobility[in] Phase mobility for each connection. Typically derived from dynamic flow state conditions in cells intersected by well’s connections. Must have one value for each

    wellPICalc.numConnections() 
    +
    +
    + well connection.

  • +
+
+
Returns:
+

Connection-level steady-state productivity index values for all connections.

+
+
+
+ +
+
+template<class Scalar>
Scalar wellProdIndStandard(const WellProdIndexCalculator<Scalar> &wellPICalc, const std::vector<Scalar> &connMobility)
+

Compute well-level productivity index value.

+
+
Parameters:
+
    +
  • wellPICalc[in] Productivity index calculator.

  • +
  • connMobility[in] Phase mobility for each connection. Typically derived from dynamic flow state conditions in cells intersected by well’s connections. Must have one value for each

    wellPICalc.numConnections() 
    +
    +
    + well connection.

  • +
+
+
Returns:
+

Well-level steady-state productivity index value.

+
+
+
+ +
+
+std::string humanReadableTime(double timeInSeconds, bool isAmendment = true)
+

Given a time step size in seconds, return it in a format which is more easily parsable by humans.

+

e.g. 874000.0 will become “10.12 days”

+
+ +
+
+std::string simulatorOutputDir()
+

Determine and check the configured directory for simulation output.

+
+ +
+
+template<class Scalar>
std::vector<Scalar> readTimeStepFile(const std::string &file)
+

Read explicitly defined time steps from file.

+
+
Parameters:
+

file – File to read

+
+
+
+ +
+
+template std::vector< double > readTimeStepFile (const std::string &)
+
+ +
+
+std::string breakLines(const std::string &msg, int indentWidth, int maxWidth)
+

Break up a string in lines suitable for terminal output.

+
+
Parameters:
+
    +
  • msg – String to print

  • +
  • indentWidth – Size of indent

  • +
  • maxWidth – Maximum with of terminal

  • +
+
+
Returns:
+

+
+
+
+ +
+
+int getTtyWidth()
+

Get the width of the tty we are attached to.

+
+
Returns:
+

Width of tty

+
+
+
+ +
+
+void assignResetTerminalSignalHandlers()
+

Assign signal handlers that reset the terminal on errors.

+
+ +
+
+void resetTerminal()
+

Resets the current TTY to a usable state if the program was aborted.

+

This is intended to be called as part of a generic exception handler

+
+ +
+
+void resetTerminal(int signum)
+

Resets the current TTY to a usable state if the program was interrupted by SIGABRT or SIGINT.

+
+ +
+
+

Variables

+
+
+std::optional<std::function<std::vector<int>(const Dune::CpGrid&)>> externalLoadBalancer
+

optional functor returning external load balancing information

+

If it is set then this will be used during loadbalance.

+
+ +
+
+template<typename T>
static constexpr bool is_gpu_operator_v = is_gpu_operator<T>::value
+
+ +
+
+template<typename T>
static constexpr bool is_gpu_matrix_v = is_gpu_matrix<T>::value
+
+ +
+
+auto noZero = [](auto val){if (val == decltype(val){0})return decltype(val){1};return val;}
+
+ +
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace Accelerator
+
+

Typedefs

+
+
+using spmv_blocked_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int, const cl::Buffer&, cl::Buffer&, const unsigned int, cl::LocalSpaceArg>
+
+ +
+
+using spmv_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int, const cl::Buffer&, cl::Buffer&, cl::LocalSpaceArg>
+
+ +
+
+using residual_blocked_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int, cl::Buffer&, const cl::Buffer&, cl::Buffer&, const unsigned int, cl::LocalSpaceArg>
+
+ +
+
+using residual_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int, cl::Buffer&, const cl::Buffer&, cl::Buffer&, cl::LocalSpaceArg>
+
+ +
+
+using ilu_apply1_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, const cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int, const unsigned int, cl::LocalSpaceArg>
+
+ +
+
+using ilu_apply2_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int, const unsigned int, cl::LocalSpaceArg>
+
+ +
+
+using stdwell_apply_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int, const unsigned int, cl::Buffer&, cl::LocalSpaceArg, cl::LocalSpaceArg, cl::LocalSpaceArg>
+
+ +
+
+using ilu_decomp_kernel_type = cl::KernelFunctor<const unsigned int, const unsigned int, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, const int, cl::LocalSpaceArg>
+
+ +
+
+using isaiL_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int>
+
+ +
+
+using isaiU_kernel_type = cl::KernelFunctor<cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, cl::Buffer&, const unsigned int>
+
+ +
+
+

Enums

+
+
+enum class SolverStatus
+

Values:

+
+
+enumerator GPU_SOLVER_SUCCESS
+
+ +
+
+enumerator GPU_SOLVER_ANALYSIS_FAILED
+
+ +
+
+enumerator GPU_SOLVER_CREATE_PRECONDITIONER_FAILED
+
+ +
+
+enumerator GPU_SOLVER_UNKNOWN_ERROR
+
+ +
+ +
+
+enum PreconditionerType
+

Values:

+
+
+enumerator BILU0
+
+ +
+
+enumerator CPR
+
+ +
+
+enumerator BISAI
+
+ +
+ +
+
+

Functions

+
+
+void sortRow(int *colIndices, int *data, int left, int right)
+

Sort a row of matrix elements from a CSR-format, where the nonzeroes are ints These ints aren’t actually nonzeroes, but represent a mapping used later

+
+
Parameters:
+
    +
  • colIndices[inout] represent keys in sorting

  • +
  • data[inout] sorted according to the colIndices

  • +
  • left[in] lower index of data of row

  • +
  • right[in] upper index of data of row

  • +
+
+
+
+ +
+
+template<class Scalar>
void blockMultSub(Scalar *a, const Scalar *b, const Scalar *c, unsigned int block_size)
+

Multiply and subtract blocks a = a - (b * c)

+
+
Parameters:
+
    +
  • a[inout] block to be subtracted from

  • +
  • b[in] input block

  • +
  • c[in] input block

  • +
  • block_size[in] size of block

  • +
+
+
+
+ +
+
+template<class Scalar>
void blockMult(const Scalar *mat1, const Scalar *mat2, Scalar *resMat, unsigned int block_size)
+
+ +
+
+template<class Scalar>
void blockMult(Scalar *mat1, Scalar *mat2, Scalar *resMat, unsigned int block_size)
+

Perform a matrix-matrix multiplication on two blocks resMat = mat1 * mat2

+
+
Parameters:
+
    +
  • mat1[in] input block 1

  • +
  • mat2[in] input block 2

  • +
  • resMat[out] output block

  • +
  • block_size[in] size of block

  • +
+
+
+
+ +
+
+unsigned int ceilDivision(const unsigned int A, const unsigned int B)
+
+ +
+
+template<class Scalar>
Scalar get_absmax(const Scalar *data, const int N)
+
+ +
+
+template<class Scalar>
void solve_transposed_3x3(const Scalar *A, const Scalar *b, Scalar *x)
+
+ +
+
+std::string getErrorString(cl_int error)
+

Translate OpenCL error codes to strings Integer - String combinations are defined in CL/cl.h

+
+
Parameters:
+

error[in] error code

+
+
+
+ +
+
+std::vector<int> buildCsrToCscOffsetMap(std::vector<int> colPointers, std::vector<int> rowIndices)
+

Similar function to csrPatternToCsc. It gives an offset map from CSR to CSC instead of the full CSR to CSC conversion. The map works as follows: if an element ‘e’ of the matrix is in the i-th position in the CSR representation, it will be in the csrToCscOffsetMap[i]-th position in the CSC representation.

+
+ +
+
+bool canBeStarted(const int rowIndex, const int *rowPointers, const int *colIndices, const std::vector<bool> &doneRows)
+

Determine whether all rows that a certain row depends on are done already

+
+
Parameters:
+
    +
  • rowIndex[in] index of the row that needs to be checked for

  • +
  • rowPointers[in] row pointers of the matrix that the row is in

  • +
  • colIndices[in] column indices of the matrix that the row is in

  • +
  • doneRows[in] array that for each row lists whether it is done or not

  • +
+
+
Returns:
+

true iff all dependencies are done and if the result itself was not done yet

+
+
+
+ +
+
+void findLevelScheduling(const int *CSRColIndices, const int *CSRRowPointers, const int *CSCRowIndices, const int *CSCColPointers, int Nb, int *numColors, int *toOrder, int *fromOrder, std::vector<int> &rowsPerColor)
+

Find a level scheduling reordering for an input matrix The toOrder and fromOrder arrays must be allocated already

+
+
Parameters:
+
    +
  • CSRColIndices[in] column indices array, obtained from storing the input matrix in the CSR format

  • +
  • CSRRowPointers[in] row pointers array, obtained from storing the input matrix in the CSR format

  • +
  • CSCRowIndices[in] row indices array, obtained from storing the input matrix in the CSC format

  • +
  • CSCColPointers[in] column pointers array, obtained from storing the input matrix in the CSC format

  • +
  • Nb[in] number of blockrows in the matrix

  • +
  • numColors[out] a pointer to the number of colors needed for the level scheduling

  • +
  • toOrder[out] the reorder pattern that was found, which lists for each index in the original order, to which index in the new order it should be moved

  • +
  • fromOrder[out] the reorder pattern that was found, which lists for each index in the new order, from which index in the original order it was moved

  • +
  • rowsPerColor[out] for each color, an array of all rowIndices in that color, this function uses emplace_back() to fill

  • +
+
+
+
+ +
+
+void csrPatternToCsc(const int *CSRColIndices, const int *CSRRowPointers, int *CSCRowIndices, int *CSCColPointers, int Nb)
+

Convert a sparsity pattern stored in the CSR format to the CSC format CSCRowIndices and CSCColPointers arrays must be allocated already Based on the csr_tocsc() function from the scipy package from python, https://github.com/scipy/scipy/blob/master/scipy/sparse/sparsetools/csr.h

+
+
Parameters:
+
    +
  • CSRColIndices[in] column indices of the CSR representation of the pattern

  • +
  • CSRRowPointers[in] row pointers of the CSR representation of the pattern

  • +
  • CSCRowIndices[inout] row indices of the result CSC representation of the pattern

  • +
  • CSCColPointers[inout] column pointers of the result CSC representation of the pattern

  • +
  • Nb[in] number of blockrows in the matrix

  • +
+
+
+
+ +
+
+ +
+
+namespace Action
+
+ +
+
+namespace Amg
+
+

Functions

+
+
+template<class Matrix, class Vector>
void getQuasiImpesWeights(const Matrix &matrix, const int pressureVarIndex, const bool transpose, Vector &weights)
+
+ +
+
+template<class Matrix, class Vector>
Vector getQuasiImpesWeights(const Matrix &matrix, const int pressureVarIndex, const bool transpose)
+
+ +
+
+template<class Vector, class GridView, class ElementContext, class Model>
void getTrueImpesWeights(int pressureVarIndex, Vector &weights, const GridView &gridView, ElementContext &elemCtx, const Model &model, std::size_t threadId)
+
+ +
+
+template<class Vector, class GridView, class ElementContext, class Model>
void getTrueImpesWeightsAnalytic(int, Vector &weights, const GridView &gridView, ElementContext &elemCtx, const Model &model, std::size_t threadId)
+
+ +
+
+ +
+
+namespace DamarisOutput
+

Below are the Damaris Keywords supported by Damaris to be filled in the built-in XML file.

+

The entries in the map below will be filled by the corresponding Damaris Keywords.

+

The command line arguments are defined in opm/simulators/flow/DamarisWriter.hpp and defaults are set in opm/simulators/flow/FlowProblemProperties.hpp

+
+

Functions

+
+
+int setPosition(const char *field, int64_t pos)
+
+ +
+
+int setParameter(const char *field, int value)
+
+ +
+
+int write(const char *field, const void *data)
+
+ +
+
+int endIteration()
+
+ +
+
+int setupWritingPars(Parallel::Communication comm, const int n_elements_local_grid, std::vector<unsigned long long> &elements_rank_offsets)
+
+ +
+
+void handleError(const int dam_err, Parallel::Communication comm, const std::string &message)
+
+ +
+
+bool FileExists(const std::string &filename_in, const Parallel::Communication &comm)
+

Returns true if the file exists. Tests to see if filename string is empty or the “#” character and if so returns false. Tests for file existance on rank 0 and passes result via MPI to all other ranks.

+
+ +
+
+std::map<std::string, std::string> getDamarisKeywords(const Parallel::Communication &comm, const std::string &OutputDir)
+

Creates the map of search strings and repacement strings that will be used to modify a templated Damaris XML file which will be used to intialize Damaris. This function will access all the OPM flow comand line arguments related to Damaris and perform checks and logic so as to create a valid XML file. N.B. The created XML file can be overridden using an environment variable FLOW_DAMARIS_XML_FILE that points to a Damaris XML file.

+

N.B. This needs to be called before damaris_init()

+
+ +
+
+std::unordered_set<std::string> getSetOfIncludedVariables()
+
+ +
+
+std::string initDamarisXmlFile()
+
+ +
+
+void initializeDamaris(const Parallel::Communication comm, const int mpiRank, const std::map<std::string, std::string> &find_replace_map)
+

Initialize Damaris by either reading a file specified by the environment variable FLOW_DAMARIS_XML_FILE or by filling in the XML file and storing it in the chosen directory

+

Initialize Damaris by either: 1/ Filling in a templated XML file and storing it in the chosen directory (output directory) 2/ Reading a file specified by the environment variable FLOW_DAMARIS_XML_FILE

+
+ +
+
+ +
+
+namespace data
+
+ +
+
+namespace Detail
+
+

Functions

+
+
+template<class Graph>
std::size_t colorGraphWelshPowell(const Graph &graph, std::deque<typename Graph::VertexDescriptor> &orderedVertices, std::vector<int> &colors, int color, int noVertices)
+
+ +
+
+template<class Graph, class Functor>
std::size_t breadthFirstSearch(const Graph &graph, typename Graph::VertexDescriptor root, Functor functor)
+
+ +
+
+ +
+
+namespace detail
+
+

Typedefs

+
+
+template<class Scalar, int Size>
using BV = Dune::BlockVector<Dune::FieldVector<Scalar, Size>>
+
+ +
+
+template<class Scalar, int Dim>
using BM = Dune::BCRSMatrix<MatrixBlock<Scalar, Dim, Dim>>
+
+ +
+
+using CommunicationType = Dune::Communication<int>
+
+ +
+
+using PolyHedralGrid3D = Dune::PolyhedralGrid<3, 3>
+
+ +
+
+template<class M>
using FieldFunct = std::function<typename M::field_type(const typename M::field_type&)>
+
+ +
+
+

Functions

+
+
+template<class GridView>
std::size_t countLocalInteriorCellsGridView(const GridView &gridView)
+

Get the number of local interior cells in a grid view.

+
+
Template Parameters:
+

GridView – Type of DUNE grid view.

+
+
Parameters:
+

gridView[in] Grid view for which to count the number of interior cells.

+
+
Returns:
+

The number of interior cell in the partition of the grid stored on this process.

+
+
+
+ +
+
+template<class Grid>
std::size_t countLocalInteriorCells(const Grid &grid)
+

Get the number of local interior cells in a grid.

+
+
Template Parameters:
+

Grid – Type of DUNE grid.

+
+
Parameters:
+

grid[in] Grid for which to count interior cells.

+
+
Returns:
+

The number of interior cells in the partition of the grid stored on this process.

+
+
+
+ +
+
+template<class Grid>
std::size_t countGlobalCells(const Grid &grid)
+

Get the number of cells of a global grid.

+

In a parallel run this is the number of cells that a grid would have if the whole grid was stored on one process only.

+
+
Template Parameters:
+

Grid – Type of DUNE grid.

+
+
Parameters:
+

grid[in] Grid for which to count global cells.

+
+
Returns:
+

The global number of cells.

+
+
+
+ +
+
+void mergeParallelLogFiles(std::string_view output_dir, std::string_view deckFilename, bool enableLoggingFalloutWarning)
+
+ +
+
+void handleExtraConvergenceOutput(const SimulatorReport &report, std::string_view option, std::string_view optionName, std::string_view output_dir, std::string_view base_name)
+
+ +
+
+void checkAllMPIProcesses()
+
+ +
+
+template<class Scalar>
void hideUnusedParameters()
+

Hides unused runtime parameters.

+
+ +
+
+int eclPositionalParameter(std::function<void(const std::string&, const std::string&)> addKey, std::set<std::string> &seenParams, std::string &errorMsg, const char **argv, int paramIdx)
+
+ +
+
+template void hideUnusedParameters< double > ()
+
+ +
+
+template<class Scalar>
void detectOscillations(const std::vector<std::vector<Scalar>> &residualHistory, const int it, const int numPhases, const Scalar relaxRelTol, const int minimumOscillatingPhases, bool &oscillate, bool &stagnate)
+

Detect oscillation or stagnation in a given residual history.

+
+ +
+
+template<class BVector, class Scalar>
void stabilizeNonlinearUpdate(BVector &dx, BVector &dxOld, const Scalar omega, NonlinearRelaxType relaxType)
+

Apply a stabilization to dx, depending on dxOld and relaxation parameters. Implemention for Dune block vectors.

+
+ +
+
+void registerSimulatorParameters()
+
+ +
+
+template<class Grid, class CartMapper, class W>
void setWellConnections(const Grid &grid, const CartMapper &cartMapper, const W &wells, const std::unordered_map<std::string, std::set<int>> &possibleFutureConnections, bool useWellConn, std::vector<std::set<int>> &wellGraph, int numJacobiBlocks)
+

Find cell IDs for wells contained in local grid.

+

Cell IDs of wells stored in a graph, so it can be used to create an adjacency pattern. Only relevant when the UseWellContribusion option is set to true

+
+
Template Parameters:
+
    +
  • The – type of the DUNE grid.

  • +
  • Well – vector type

  • +
+
+
Parameters:
+
    +
  • grid – The grid where we look for overlap cells.

  • +
  • wells – List of wells contained in grid.

  • +
  • useWellConn – Boolean that is true when UseWellContribusion is true

  • +
  • wellGraph – Cell IDs of well cells stored in a graph.

  • +
+
+
+
+ +
+
+template<class Grid, class Mapper>
void findOverlapAndInterior(const Grid &grid, const Mapper &mapper, std::vector<int> &overlapRows, std::vector<int> &interiorRows)
+

Find the rows corresponding to overlap cells.

+

Loop over grid and store cell ids of rows corresponding to overlap cells.

+
+
Template Parameters:
+

The – type of the DUNE grid.

+
+
Parameters:
+
    +
  • grid – The grid where we look for overlap cells.

  • +
  • overlapRows – List where overlap rows are stored.

  • +
  • interiorRows – List where overlap rows are stored.

  • +
+
+
+
+ +
+
+template<class Grid>
std::size_t numMatrixRowsToUseInSolver(const Grid &grid, bool ownerFirst)
+

If ownerFirst=true, returns the number of interior cells in grid, else just numCells().

+

If cells in grid is ordered so that interior/owner cells come before overlap/copy cells, the method returns the number of interior cells numInterior. In the linear solver only the first numInterior rows of the matrix are needed.

+
+ +
+
+template<class Matrix>
void makeOverlapRowsInvalid(Matrix &matrix, const std::vector<int> &overlapRows)
+

Zero out off-diagonal blocks on rows corresponding to overlap cells Diagonal blocks on ovelap rows are set to diag(1.0).

+
+ +
+
+template<class Matrix, class Grid>
std::unique_ptr<Matrix> blockJacobiAdjacency(const Grid &grid, const std::vector<int> &cell_part, std::size_t nonzeroes, const std::vector<std::set<int>> &wellConnectionsGraph)
+

Create sparsity pattern for block-Jacobi matrix based on partitioning of grid. Do not initialize the values, that is done in copyMatToBlockJac()

+
+ +
+
+template<class M>
void milu0_decomposition(M &A, FieldFunct<M> absFunctor, FieldFunct<M> signFunctor, std::vector<typename M::block_type> *diagonal)
+
+ +
+
+template<class M>
void milun_decomposition(const M &A, int n, MILU_VARIANT milu, M &ILU, Reorderer &ordering, Reorderer &inverseOrdering)
+
+ +
+
+template<typename T>
T identityFunctor(const T&)
+
+ +
+
+template<typename T>
T oneFunctor(const T&)
+
+ +
+
+template<typename T>
T signFunctor(const T&)
+
+ +
+
+template<typename T>
T isPositiveFunctor(const T&)
+
+ +
+
+template<typename T>
T absFunctor(const T&)
+
+ +
+
+template<class M>
void milu0_decomposition(M &A, std::vector<typename M::block_type> *diagonal)
+
+ +
+
+template<class M>
void ghost_last_bilu0_decomposition(M &A, size_t interiorSize)
+

Compute Blocked ILU0 decomposition, when we know junk ghost rows are located at the end of A.

+
+ +
+
+template<class M, class CRS, class InvVector>
void convertToCRS(const M &A, CRS &lower, CRS &upper, InvVector &inv)
+

compute ILU decomposition of A. A is overwritten by its decomposition

+
+ +
+
+template<class M>
void ghost_last_bilu0_decomposition(M &A, std::size_t interiorSize)
+

Compute Blocked ILU0 decomposition, when we know junk ghost rows are located at the end of A.

+
+ +
+
+template<class PI>
size_t set_interiorSize(size_t N, size_t interiorSize, const PI &comm)
+
+ +
+
+template<class TA, class TB, class TC, class PositiveSign>
static inline void multMatrixImpl(const TA &A, const TB &B, TC &ret, const PositiveSign)
+

calculates ret = A * B

+
+ +
+
+template<class TA, class TB, class TC, class PositiveSign>
static inline void multMatrixTransposedImpl(const TA &A, const TB &B, TC &ret, const PositiveSign)
+

calculates ret = sign * (A^T * B) TA, TB, and TC are not necessarily FieldMatrix, but those should follow the Dune::DenseMatrix interface.

+
+ +
+
+template<class DenseMatrixA, class DenseMatrixB, class DenseMatrixC>
static inline void multMatrixTransposed(const DenseMatrixA &A, const DenseMatrixB &B, DenseMatrixC &ret)
+

calculates ret = A^T * B

+
+ +
+
+template<class DenseMatrixA, class DenseMatrixB, class DenseMatrixC>
static inline void negativeMultMatrixTransposed(const DenseMatrixA &A, const DenseMatrixB &B, DenseMatrixC &ret)
+

calculates ret = -A^T * B

+
+ +
+
+template<class K>
static inline void multMatrix(const Dune::DynamicMatrix<K> &A, const Dune::DynamicMatrix<K> &B, Dune::DynamicMatrix<K> &ret)
+

calculates ret = A * B

+
+ +
+
+void logTimer(const AdaptiveSimulatorTimer &substepTimer)
+
+ +
+
+std::set<std::string> consistentlyFailingWells(const std::vector<StepReport> &sr, bool requireRepeatedFailures)
+
+ +
+
+void registerAdaptiveParameters()
+
+ +
+
+std::tuple<TimeStepControlType, std::unique_ptr<TimeStepControlInterface>, bool> createController(const UnitSystem &unitSystem)
+
+ +
+
+template<class Scalar>
Scalar pressureAverage(const Scalar pressurePvHydrocarbon, const Scalar pvHydrocarbon, const Scalar pressurePv, const Scalar pv, const bool hydrocarbon)
+

Calculates average pressure value.

+
+ +
+
+template<class Scalar>
std::vector<Scalar> pressureAverage(const std::vector<Scalar> &pressurePvHydrocarbon, const std::vector<Scalar> &pvHydrocarbon, const std::vector<Scalar> &pressurePv, const std::vector<Scalar> &pv, const bool hydrocarbon)
+

Calculates average pressure value for a vector.

+
+ +
+
+template double pressureAverage< double > (const double, const double, const double, const double, const bool)
+
+ +
+
+template std::vector< double > pressureAverage< double > (const std::vector< double > &, const std::vector< double > &, const std::vector< double > &, const std::vector< double > &, const bool)
+
+ +
+
+template<class Scalar>
VFPEvaluation<Scalar> operator+(VFPEvaluation<Scalar> lhs, const VFPEvaluation<Scalar> &rhs)
+
+ +
+
+template<class Scalar>
VFPEvaluation<Scalar> operator-(VFPEvaluation<Scalar> lhs, const VFPEvaluation<Scalar> &rhs)
+
+ +
+
+template<class Scalar>
VFPEvaluation<Scalar> operator*(Scalar lhs, const VFPEvaluation<Scalar> &rhs)
+
+ +
+
+template<typename T>
T getFlo(const VFPProdTable &table, const T &aqua, const T &liquid, const T &vapour)
+

Computes the flo parameter according to the flo_type_ for production tables

+
+
Returns:
+

Production rate of oil, gas or liquid.

+
+
+
+ +
+
+template<typename T>
T getFlo(const VFPInjTable &table, const T &aqua, const T &liquid, const T &vapour)
+

Computes the flo parameter according to the flo_type_ for injection tables

+
+
Returns:
+

Production rate of oil, gas or liquid.

+
+
+
+ +
+
+template<typename T>
T getWFR(const VFPProdTable &table, const T &aqua, const T &liquid, const T &vapour)
+

Computes the wfr parameter according to the wfr_type_

+
+
Returns:
+

Production rate of oil, gas or liquid.

+
+
+
+ +
+
+template<typename T>
T getGFR(const VFPProdTable &table, const T &aqua, const T &liquid, const T &vapour)
+

Computes the gfr parameter according to the gfr_type_

+
+
Returns:
+

Production rate of oil, gas or liquid.

+
+
+
+ +
+
+template<typename T>
const T &getTable(const std::map<int, std::reference_wrapper<const T>> &tables, int table_id)
+

Returns the table from the map if found, or throws an exception

+
+ +
+
+template<>
VFPProdTable::FLO_TYPE getType(const VFPProdTable &table)
+
+ +
+
+template<>
VFPProdTable::WFR_TYPE getType(const VFPProdTable &table)
+
+ +
+
+template<>
VFPProdTable::GFR_TYPE getType(const VFPProdTable &table)
+
+ +
+
+template<>
VFPInjTable::FLO_TYPE getType(const VFPInjTable &table)
+

Returns the type variable for FLO for injection tables

+
+ +
+
+template const VFPInjTable & getTable (const std::map< int, std::reference_wrapper< const VFPInjTable > > &, int)
+
+ +
+
+template const VFPProdTable & getTable (const std::map< int, std::reference_wrapper< const VFPProdTable > > &, int)
+
+ +
+
+template<typename T>
bool hasTable(const std::map<int, std::reference_wrapper<const T>> &tables, int table_id)
+

Check whether we have a table with the table number

+
+ +
+
+template<typename TYPE, typename TABLE>
TYPE getType(const TABLE &table)
+

Returns the type variable for FLO/GFR/WFR for production tables

+
+ +
+
+

Variables

+
+
+static constexpr double threshold = 1e-12
+
+ +
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace Details
+
+

Typedefs

+
+
+template<class Scalar>
using PressureMatrixType = Dune::BCRSMatrix<MatrixBlock<Scalar, 1, 1>>
+
+ +
+
+template<class Scalar>
using PressureVectorType = Dune::BlockVector<Dune::FieldVector<Scalar, 1>>
+
+ +
+
+template<class Scalar>
using SeqCoarseOperatorType = Dune::MatrixAdapter<PressureMatrixType<Scalar>, PressureVectorType<Scalar>, PressureVectorType<Scalar>>
+
+ +
+
+template<class Scalar, class Comm>
using ParCoarseOperatorType = Opm::GhostLastMatrixAdapter<PressureMatrixType<Scalar>, PressureVectorType<Scalar>, PressureVectorType<Scalar>, Comm>
+
+ +
+
+template<class Scalar, class Comm>
using CoarseOperatorType = std::conditional_t<std::is_same<Comm, Dune::Amg::SequentialInformation>::value, SeqCoarseOperatorType<Scalar>, ParCoarseOperatorType<Scalar, Comm>>
+
+ +
+
+

Functions

+
+
+template<class Matrix>
void copySubMatrix(const Matrix &A, const std::vector<int> &indices, Matrix &B)
+
+ +
+
+template<class Matrix>
Matrix extractMatrix(const Matrix &m, const std::vector<int> &indices)
+
+ +
+
+template<class Vector>
Vector extractVector(const Vector &x, const std::vector<int> &indices)
+
+ +
+
+template<class Vector>
void setGlobal(const Vector &x, const std::vector<int> &indices, Vector &global_x)
+
+ +
+
+template<class Matrix>
bool matrixEqual(const Matrix &m1, const Matrix &m2)
+
+ +
+
+template<class DenseMatrix>
DenseMatrix transposeDenseMatrix(const DenseMatrix &M)
+
+ +
+
+ +
+
+namespace details
+
+

Functions

+
+
+void printDistributionSummary(const DomainInfo &info)
+

Print a summary of domain distribution to the log

+
+
Parameters:
+

info – Struct holding info about the domains

+
+
+
+ +
+
+void writeNlddFile(const std::string &fname, std::string_view header, const std::vector<int> &data)
+

Write NLDD information to a text file

+
+
Parameters:
+
    +
  • file – File to write to

  • +
  • header – Header in file

  • +
  • data – Data to write to file

  • +
+
+
+
+ +
+
+void outputReportStep(const SimulatorTimer &timer)
+
+ +
+
+std::uint64_t isId(std::uint32_t elemIdx1, std::uint32_t elemIdx2)
+
+ +
+
+std::pair<std::uint32_t, std::uint32_t> isIdReverse(const std::uint64_t &id)
+
+ +
+
+std::uint64_t directionalIsId(std::uint32_t elemIdx1, std::uint32_t elemIdx2)
+
+ +
+
+

Variables

+
+
+constexpr unsigned elemIdxShift = 32
+
+ +
+
+ +
+
+namespace EQUIL
+

Types and routines that collectively implement a basic ECLIPSE-style equilibration-based initialisation scheme.

+

This namespace is intentionally nested to avoid name clashes with other parts of OPM.

+
+

Typedefs

+
+
+template<class Scalar>
using MatLaw = EclMaterialLawManager<ThreePhaseMaterialTraits<Scalar, 0, 1, 2>>
+
+ +
+
+template<class Scalar>
using FS = BlackOilFluidSystem<Scalar>
+
+ +
+
+using FluidSystemSimple = BlackOilFluidSystem<double>
+
+ +
+
+using SatOnlyFluidState = SimpleModularFluidState<double, 3, 3, FluidSystemSimple, false, false, false, false, true, false, false, false>
+
+ +
+
+

Functions

+
+
+template<class FluidSystem, class MaterialLawManager>
FluidSystem::Scalar minSaturations(const MaterialLawManager &materialLawManager, const int phase, const int cell)
+
+ +
+
+template<class FluidSystem, class MaterialLawManager>
FluidSystem::Scalar maxSaturations(const MaterialLawManager &materialLawManager, const int phase, const int cell)
+
+ +
+
+template<class FluidSystem, class MaterialLawManager>
FluidSystem::Scalar satFromPc(const MaterialLawManager &materialLawManager, const int phase, const int cell, const typename FluidSystem::Scalar targetPc, const bool increasing = false)
+

Compute saturation of some phase corresponding to a given capillary pressure.

+
+ +
+
+template<class FluidSystem, class MaterialLawManager>
FluidSystem::Scalar satFromSumOfPcs(const MaterialLawManager &materialLawManager, const int phase1, const int phase2, const int cell, const typename FluidSystem::Scalar targetPc)
+

Compute saturation of some phase corresponding to a given capillary pressure, where the capillary pressure function is given as a sum of two other functions.

+
+ +
+
+template<class FluidSystem, class MaterialLawManager>
FluidSystem::Scalar satFromDepth(const MaterialLawManager &materialLawManager, const typename FluidSystem::Scalar cellDepth, const typename FluidSystem::Scalar contactDepth, const int phase, const int cell, const bool increasing = false)
+

Compute saturation from depth. Used for constant capillary pressure function.

+
+ +
+
+template<class FluidSystem, class MaterialLawManager>
bool isConstPc(const MaterialLawManager &materialLawManager, const int phase, const int cell)
+

Return true if capillary pressure function is constant.

+
+ +
+
+ +
+
+namespace DeckDependent
+
+

Typedefs

+
+
+using GridView = Dune::GridView<Dune::DefaultLeafGridViewTraits<Dune::CpGrid>>
+
+ +
+
+using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>
+
+ +
+
+

Functions

+
+
+std::vector<EquilRecord> getEquil(const EclipseState &state)
+
+ +
+
+template<class GridView>
std::vector<int> equilnum(const EclipseState &eclipseState, const GridView &gridview)
+
+ +
+
+ +
+
+namespace Details
+
+

Functions

+
+
+template<typename CellRange, class Scalar>
void verticalExtent(const CellRange &cells, const std::vector<std::pair<Scalar, Scalar>> &cellZMinMax, const Parallel::Communication &comm, std::array<Scalar, 2> &span)
+
+ +
+
+template<class Scalar, class Element>
std::pair<Scalar, Scalar> cellZMinMax(const Element &element)
+
+ +
+
+template<class Scalar>
void subdivisionCentrePoints(const Scalar left, const Scalar right, const int numIntervals, std::vector<std::pair<Scalar, Scalar>> &subdiv)
+
+ +
+
+template<typename CellID, typename Scalar>
std::vector<std::pair<Scalar, Scalar>> horizontalSubdivision(const CellID cell, const std::pair<Scalar, Scalar> topbot, const int numIntervals)
+
+ +
+
+template<class Scalar, class Element>
Scalar cellCenterDepth(const Element &element)
+
+ +
+
+template<class Scalar, class Element>
std::pair<Scalar, Scalar> cellZSpan(const Element &element)
+
+ +
+
+ +
+
+namespace PhasePressODE
+
+ +
+
+namespace Miscibility
+

Types and routines relating to phase mixing in equilibration calculations.

+
+ +
+
+namespace ExceptionType
+

This class implements a deferred logger: 1) messages can be pushed back to a vector 2) a call to logMessages adds the messages to OpmLog backends

+
+

Enums

+
+
+enum ExcEnum
+

Values:

+
+
+enumerator NONE
+
+ +
+
+enumerator RUNTIME_ERROR
+
+ +
+
+enumerator INVALID_ARGUMENT
+
+ +
+
+enumerator LOGIC_ERROR
+
+ +
+
+enumerator DEFAULT
+
+ +
+
+enumerator NUMERICAL_ISSUE
+
+ +
+ +
+
+ +
+
+namespace FlowKeywordValidation
+
+

Functions

+
+
+template<>
const SupportedKeywordItems<std::string> &fullySupported()
+
+ +
+
+template<>
const SupportedKeywordItems<int> &fullySupported()
+
+ +
+
+template<>
const SupportedKeywordItems<double> &fullySupported()
+
+ +
+
+template<typename T>
const KeywordValidation::SupportedKeywordItems<T> &fullySupported()
+
+ +
+
+template<>
const SupportedKeywordItems<std::string> &partiallySupported()
+
+ +
+
+template<>
const KeywordValidation::SupportedKeywordItems<int> &partiallySupported()
+
+ +
+
+template<>
const KeywordValidation::SupportedKeywordItems<double> &partiallySupported()
+
+ +
+
+template<typename T>
const KeywordValidation::SupportedKeywordItems<T> &partiallySupported()
+
+ +
+
+const KeywordValidation::UnsupportedKeywords &unsupportedKeywords()
+
+ +
+
+ +
+
+namespace gpuistl
+
+

Enums

+
+
+enum class MatrixStorageMPScheme
+

Values:

+
+
+enumerator DOUBLE_DIAG_DOUBLE_OFFDIAG
+
+ +
+
+enumerator FLOAT_DIAG_FLOAT_OFFDIAG
+
+ +
+
+enumerator DOUBLE_DIAG_FLOAT_OFFDIAG
+
+ +
+ +
+
+

Functions

+
+
+inline MatrixStorageMPScheme makeMatrixStorageMPScheme(int scheme)
+
+ +
+
+void printDevice()
+
+ +
+
+void setDevice()
+
+ +
+
+OPM_CREATE_GPU_RESOURCE(GPUStream, cudaStream_t, cudaStreamCreate, cudaStreamDestroy)
+

Manages a CUDA stream resource.

+

This resource encapsulates a cudaStream_t handle and provides automatic creation and destruction of the CUDA stream. Use this resource to schedule and synchronize GPU kernels or other asynchronous operations.

+
+ +
+
+OPM_CREATE_GPU_RESOURCE(GPUEvent, cudaEvent_t, cudaEventCreate, cudaEventDestroy)
+

Manages a CUDA event resource.

+

This resource encapsulates a cudaEvent_t handle and provides automatic creation and destruction of the CUDA event. Use this resource to measure elapsed time or synchronize GPU executions between different streams.

+
+ +
+
+OPM_CREATE_GPU_RESOURCE (GPUGraph, cudaGraph_t, cudaGraphCreate, cudaGraphDestroy, 0)
+

Manages a CUDA graph resource.

+

This resource encapsulates a cudaGraph_t handle and provides automatic creation and destruction of a CUDA graph. It represents a series of operations captured for efficient replay, execution, or modification.

+
+ +
+
+OPM_CREATE_GPU_RESOURCE_NO_CREATE(GPUGraphExec, cudaGraphExec_t, cudaGraphExecDestroy)
+

Manages a CUDA graph execution resource.

+

This resource encapsulates a cudaGraphExec_t handle and provides automatic destruction of the CUDA graph execution object. It represents the compiled and optimized version of a CUDA graph ready for efficient execution.

+
+ +
+
+template<typename T>
std::shared_ptr<T> make_gpu_shared_ptr()
+

Creates a shared pointer managing GPU-allocated memory of the specified element type.

+

This function allocates memory on the GPU for the type T, using cudaMalloc. It returns a std::shared_ptr that automatically handles the release of GPU memory with cudaFree when no longer in use.

+
+
Template Parameters:
+

T – The element type to allocate on the GPU.

+
+
Returns:
+

A std::shared_ptr to the GPU-allocated memory.

+
+
+
+ +
+
+template<typename T>
std::shared_ptr<T> make_gpu_shared_ptr(const T &value)
+

Creates a shared pointer managing GPU-allocated memory of the specified element type.

+

This function allocates memory on the GPU for the type T, using cudaMalloc. It returns a std::shared_ptr that automatically handles the release of GPU memory with cudaFree when no longer in use.

+
+
Template Parameters:
+

T – The element type to allocate on the GPU.

+
+
Parameters:
+

value – The value to copy to the GPU-allocated memory.

+
+
Returns:
+

A std::shared_ptr to the GPU-allocated memory.

+
+
+
+ +
+
+template<typename T>
auto make_gpu_unique_ptr()
+

Creates a unique pointer managing GPU-allocated memory of the specified element type.

+

This function allocates memory on the GPU for the type T, using cudaMalloc . It returns a std::unique_ptr that automatically handles the release of GPU memory with cudaFree when no longer in use.

+
+
Template Parameters:
+

T – The element type to allocate on the GPU.

+
+
Returns:
+

A std::unique_ptr to the GPU-allocated memory.

+
+
+
+ +
+
+template<typename T>
auto make_gpu_unique_ptr(const T &value)
+

Creates a unique pointer managing GPU-allocated memory of the specified element type.

+

This function allocates memory on the GPU for the type T, using cudaMalloc. It returns a std::unique_ptr that automatically handles the release of GPU memory with cudaFree when no longer in use.

+
+
Template Parameters:
+

T – The element type to allocate on the GPU.

+
+
Parameters:
+

value – The value to copy to the GPU-allocated memory.

+
+
Returns:
+

A std::unique_ptr to the GPU-allocated memory.

+
+
+
+ +
+
+template<class T>
T copyFromGPU(const T *value)
+

Copies a value from GPU-allocated memory to the host.

+
+

Note

+

This function is involves a sychronization point, and should be used with care.

+
+
+
Parameters:
+

value – A pointer to the value on the GPU.

+
+
Returns:
+

The value copied from the GPU.

+
+
+
+ +
+
+template<class T>
T copyFromGPU(const std::shared_ptr<T> &value)
+

Copies a value from GPU-allocated memory to the host.

+
+

Note

+

This function is involves a sychronization point, and should be used with care.

+
+
+
Parameters:
+

value – A shared pointer to the value on the GPU.

+
+
Returns:
+

The value copied from the GPU.

+
+
+
+ +
+
+template<class T, class Deleter>
T copyFromGPU(const std::unique_ptr<T, Deleter> &value)
+

Copies a value from GPU-allocated memory to the host.

+
+

Note

+

This function is involves a sychronization point, and should be used with care.

+
+
+
Template Parameters:
+

Deleter – The custom deleter type.

+
+
Parameters:
+

value – A unique pointer to the value on the GPU (with a custom deleter).

+
+
Returns:
+

The value copied from the GPU.

+
+
+
+ +
+
+template<class T>
void copyToGPU(const T &value, T *ptr)
+

Copies a value from the host to GPU-allocated memory.

+
+

Note

+

This function is involves a sychronization point, and should be used with care.

+
+
+
Parameters:
+
    +
  • value – The value to copy to the GPU.

  • +
  • ptr – A pointer to the GPU-allocated memory.

  • +
+
+
+
+ +
+
+template<class T>
void copyToGPU(const T &value, const std::shared_ptr<T> &ptr)
+

Copies a value from the host to GPU-allocated memory using a shared_ptr.

+
+

Note

+

This function involves a synchronization point, and should be used with care.

+
+
+
Parameters:
+
    +
  • value – The value to copy to the GPU.

  • +
  • ptr – A shared_ptr to the GPU-allocated memory.

  • +
+
+
+
+ +
+
+template<class T, class Deleter>
void copyToGPU(const T &value, const std::unique_ptr<T, Deleter> &ptr)
+

Copies a value from the host to GPU-allocated memory using a unique_ptr.

+
+

Note

+

This function involves a synchronization point, and should be used with care.

+
+
+
Template Parameters:
+

Deleter – The custom deleter type.

+
+
Parameters:
+
    +
  • value – The value to copy to the GPU.

  • +
  • ptr – A unique_ptr to the GPU-allocated memory (with a custom deleter).

  • +
+
+
+
+ +
+
+template<class T>
PointerView<T> make_view(const std::shared_ptr<T> &ptr)
+
+ +
+
+template<class T, class Deleter>
PointerView<T> make_view(const std::unique_ptr<T, Deleter> &ptr)
+
+ +
+
+template<class T>
GpuView<T> make_view(GpuBuffer<T> &buf)
+
+ +
+
+template GpuView< double > make_view (GpuBuffer< double > &)
+
+ +
+
+template GpuView< float > make_view (GpuBuffer< float > &)
+
+ +
+
+template GpuView< int > make_view (GpuBuffer< int > &)
+
+ +
+
+template<class T>
GpuView<const T> make_view(const GpuBuffer<T> &buf)
+
+ +
+
+template GpuView< const double > make_view (const GpuBuffer< double > &)
+
+ +
+
+template GpuView< const float > make_view (const GpuBuffer< float > &)
+
+ +
+
+template GpuView< const int > make_view (const GpuBuffer< int > &)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (double, 1)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (double, 2)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (double, 3)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (double, 4)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (double, 5)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (double, 6)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (float, 1)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (float, 2)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (float, 3)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (float, 4)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (float, 5)
+
+ +
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS (float, 6)
+
+ +
+
+void setZeroAtIndexSet(const GpuVector<int> &indexSet)
+

The GpuVector class is a simple (arithmetic) vector class for the GPU.

+

+Example usage:

+
   #include <opm/simulators/linalg/gpuistl/GpuVector.hpp>
+  
+   void someFunction() {
+       auto someDataOnCPU = std::vector<double>({1.0, 2.0, 42.0, 59.9451743, 10.7132692});
+  
+       auto dataOnGPU = GpuVector<double>(someDataOnCPU);
+  
+       // Multiply by 4.0:
+       dataOnGPU *= 4.0;
+  
+       // Get data back on CPU in another vector:
+       auto stdVectorOnCPU = dataOnGPU.asStdVector();
+   }
+  
+   @tparam T the type to store. Can be either float, double or int.
+  /
+template <typename T>
+class GpuVector
+{
+public:
+    using field_type = T;
+    using size_type = size_t;
+
+
+    GpuVector(const GpuVector<T>& other);
+
+    explicit GpuVector(const std::vector<T>& data);
+
+    GpuVector& operator=(const GpuVector<T>& other);
+
+    template<int BlockDimension>
+    explicit GpuVector(const Dune::BlockVector<Dune::FieldVector<T, BlockDimension>>& bvector)
+        : GpuVector(bvector.dim())
+    {
+        copyFromHost(bvector);
+    }
+
+    GpuVector& operator=(T scalar);
+
+    explicit GpuVector(const size_t numberOfElements);
+
+
+    GpuVector(const T* dataOnHost, const size_t numberOfElements);
+
+    virtual ~GpuVector();
+
+    T* data();
+
+    const T* data() const;
+
+    template <int BlockDimension>
+    void copyFromHost(const Dune::BlockVector<Dune::FieldVector<T, BlockDimension>>& bvector)
+    {
+        // TODO: [perf] vector.dim() can be replaced by bvector.N() * BlockDimension
+        if (detail::to_size_t(m_numberOfElements) != bvector.dim()) {
+            OPM_THROW(std::runtime_error,
+                      fmt::format("Given incompatible vector size. GpuVector has size {}, \n"
+                                  "however, BlockVector has N() = {}, and dim = {}.",
+                                  m_numberOfElements,
+                                  bvector.N(),
+                                  bvector.dim()));
+        }
+        const auto dataPointer = static_cast<const T*>(&(bvector[0][0]));
+        copyFromHost(dataPointer, m_numberOfElements);
+    }
+
+    template <int BlockDimension>
+    void copyToHost(Dune::BlockVector<Dune::FieldVector<T, BlockDimension>>& bvector) const
+    {
+        // TODO: [perf] vector.dim() can be replaced by bvector.N() * BlockDimension
+        if (detail::to_size_t(m_numberOfElements) != bvector.dim()) {
+            OPM_THROW(std::runtime_error,
+                      fmt::format("Given incompatible vector size. GpuVector has size {},\n however, the BlockVector "
+                                  "has has N() = {}, and dim() = {}.",
+                                  m_numberOfElements,
+                                  bvector.N(),
+                                  bvector.dim()));
+        }
+        const auto dataPointer = static_cast<T*>(&(bvector[0][0]));
+        copyToHost(dataPointer, m_numberOfElements);
+    }
+
+    void copyFromHost(const T* dataPointer, size_t numberOfElements);
+    void copyFromHost(const T* dataPointer, size_t numberOfElements, cudaStream_t stream);
+
+    void copyToHost(T* dataPointer, size_t numberOfElements) const;
+
+    void copyFromHost(const std::vector<T>& data);
+
+    void copyToHost(std::vector<T>& data) const;
+
+    void copyFromDeviceToDevice(const GpuVector<T>& other) const;
+
+    void prepareSendBuf(GpuVector<T>& buffer, const GpuVector<int>& indexSet) const;
+    void syncFromRecvBuf(GpuVector<T>& buffer, const GpuVector<int>& indexSet) const;
+
+    GpuVector<T>& operator*=(const T& scalar);
+
+    GpuVector<T>& axpy(T alpha, const GpuVector<T>& y);
+
+    GpuVector<T>& operator+=(const GpuVector<T>& other);
+
+    GpuVector<T>& operator-=(const GpuVector<T>& other);
+
+    T dot(const GpuVector<T>& other) const;
+
+    T two_norm() const;
+
+    T dot(const GpuVector<T>& other, const GpuVector<int>& indexSet, GpuVector<T>& buffer) const;
+
+    T two_norm(const GpuVector<int>& indexSet, GpuVector<T>& buffer) const;
+
+
+    T dot(const GpuVector<T>& other, const GpuVector<int>& indexSet) const;
+
+    T two_norm(const GpuVector<int>& indexSet) const;
+
+
+    size_type dim() const;
+
+
+    std::vector<T> asStdVector() const;
+
+    template <int blockSize>
+    Dune::BlockVector<Dune::FieldVector<T, blockSize>> asDuneBlockVector() const
+    {
+        OPM_ERROR_IF(dim() % blockSize != 0,
+                     fmt::format("blockSize is not a multiple of dim(). Given blockSize = {}, and dim() = {}",
+                                 blockSize,
+                                 dim()));
+
+        Dune::BlockVector<Dune::FieldVector<T, blockSize>> returnValue(dim() / blockSize);
+        copyToHost(returnValue);
+        return returnValue;
+    }
+
+
+
+

Note

+

we currently only support simple raw primitives for T (double, float and int)

+
+
+

Note

+

We currently only support arithmetic operations on double and float.

+
+
+

Note

+

this vector has no notion of block size. The user is responsible for allocating the correct number of primitives (double or floats)

+
+
+ +
+
+std::string toDebugString()
+
+ +
+
+void assertSameSize(const GpuVector<T> &other) const
+
+ +
+
+void assertSameSize(int size) const
+
+ +
+
+void assertHasElements() const
+
+ +
+
+void setDevice(int mpiRank, int numberOfMpiRanks)
+

Sets the correct CUDA device in the setting of MPI.

+
+

Note

+

This assumes that every node has equally many GPUs, all of the same caliber

+
+
+

Note

+

This probably needs to be called before MPI_Init if one uses GPUDirect transfers (see eg. https://devtalk.nvidia.com/default/topic/752046/teaching-and-curriculum-support/multi-gpu-system-running-mpi-cuda-/ )

+
+
+

Note

+

If no CUDA device is present, this does nothing.

+
+
+ +
+
+void printDevice(int mpiRank, int numberOfMpiRanks)
+
+ +
+
+

Variables

+
+
+T *m_dataOnDevice = nullptr
+
+ +
+
+const int m_numberOfElements
+
+ +
+
+detail::CuBlasHandle &m_cuBlasHandle
+
+ +
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace detail
+

Contains wrappers to make the CuBLAS library behave as a modern C++ library with function overlading.

+

In simple terms, this allows one to call say cublasScal on both double and single precisision, instead of calling cublasDscal and cublasSscal respectively.

+

Contains wrappers to make the CuSPARSE library behave as a modern C++ library with function overlading.

+

In simple terms, this allows one to call say cusparseBsrilu02_analysis on both double and single precisision, instead of calling cusparseDbsrilu02_analysis and cusparseDbsrilu02_analysis respectively.

+

Simple utility structs to test for the existence of functions in types.

+

Note that there are alternatives to this, see for instance https://stackoverflow.com/questions/257288/templated-check-for-the-existence-of-a-class-member-function , however, this is by far the cleanest approach for where this is going to be used for now.

+

TODO: Use the requires-keyword once C++20 becomes availble (https://en.cppreference.com/w/cpp/language/constraints ). With C++20 this file can be removed.

+

Provides various utilities for doing signed to unsigned conversion, unsigned to signed, 32 bits to 64 bits and 64 bits to 32 bits.

+

The main use case within cuistl is that the cusparse library requires signed int for all its size parameters, while Dune::BlockVector (and relatives) use unsigned size_t.

+
+

Typedefs

+
+
+using GpuSparseMatrixDescription = CuSparseResource<cusparseMatDescr_t>
+

GpuSparseMatrixDescription holder. This is internal information needed for most calls to the CuSparse API.

+
+ +
+
+using GpuSparseMatrixDescriptionPtr = std::shared_ptr<CuSparseResource<cusparseMatDescr_t>>
+

Pointer to GpuSparseMatrixDescription holder. This is internal information needed for most calls to the CuSparse API.

+
+ +
+
+

Functions

+
+
+template<typename func>
int tuneThreadBlockSize(func &f, std::string descriptionOfFunction)
+

Function that tests the best thread block size, assumes the provided function depends on threadblock-size.

+
+
Template Parameters:
+

The – type of the function to tune

+
+
Parameters:
+

f – the function to tune, which takes the thread block size as the input

+
+
+
+ +
+
+inline std::vector<int> createReorderedToNatural(const Opm::SparseTable<size_t> &levelSets)
+
+ +
+
+inline std::vector<int> createNaturalToReordered(const Opm::SparseTable<size_t> &levelSets)
+
+ +
+
+template<class M, class field_type, class GPUM>
inline std::unique_ptr<GPUM> createReorderedMatrix(const M &naturalMatrix, const std::vector<int> &reorderedToNatural)
+
+ +
+
+template<class M, class field_type, class GPUM>
inline std::tuple<std::unique_ptr<GPUM>, std::unique_ptr<GPUM>> extractLowerAndUpperMatrices(const M &naturalMatrix, const std::vector<int> &reorderedToNatural)
+
+ +
+
+inline std::string getCublasErrorMessage(cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

getCublasErrorMessage generates the error message to display for a given error.

+

+
+Todo:
+

Refactor to use std::source_location once we shift to C++20

+
+ +

+
+

Note

+

This function is mostly for internal use.

+
+
+
Parameters:
+
    +
  • error – the error code from cublas

  • +
  • expression – the expresison (say “cublasCreate(&handle)”)

  • +
  • filename – the code file the error occured in (typically FILE)

  • +
  • functionName – name of the function the error occured in (typically func)

  • +
  • lineNumber – the line number the error occured in (typically LINE)

  • +
+
+
Returns:
+

An error message to be displayed.

+
+
+
+ +
+
+inline void cublasSafeCall(cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

cublasSafeCall checks the return type of the CUBLAS expression (function call) and throws an exception if it does not equal CUBLAS_STATUS_SUCCESS.

+

+Example usage:

#include <opm/simulators/linalg/gpuistl/detail/cublas_safe_call.hpp>
+#include <cublas_v2.h>
+
+void some_function() {
+    cublasHandle_t cublasHandle;
+    cudaSafeCall(cublasCreate(&cublasHandle), "cublasCreate(&cublasHandle)", __FILE__, __func__, __LINE__);
+}
+
+
+

+

+
+Todo:
+

Refactor to use std::source_location once we shift to C++20

+
+ +

+
+

Note

+

It is probably easier to use the macro OPM_CUBLAS_SAFE_CALL

+
+
+
Parameters:
+
    +
  • error – the error code from cublas

  • +
  • expression – the expresison (say “cublasCreate(&handle)”)

  • +
  • filename – the code file the error occured in (typically FILE)

  • +
  • functionName – name of the function the error occured in (typically func)

  • +
  • lineNumber – the line number the error occured in (typically LINE)

  • +
+
+
+
+ +
+
+inline cublasStatus_t cublasWarnIfError(cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

cublasWarnIfError checks the return type of the CUBLAS expression (function call) and issues a warning if it does not equal CUBLAS_STATUS_SUCCESS.

+

+Example usage:

#include <opm/simulators/linalg/gpuistl/detail/cublas_safe_call.hpp>
+#include <cublas_v2.h>
+
+void some_function() {
+    cublasHandle_t cublasHandle;
+    cublasWarnIfError(cublasCreate(&cublasHandle), "cublasCreate(&cublasHandle)", __FILE__, __func__, __LINE__);
+}
+
+
+

+

+
+Todo:
+

Refactor to use std::source_location once we shift to C++20

+
+ +

+
+

Note

+

It is probably easier to use the macro OPM_CUBLAS_WARN_IF_ERROR

+
+
+

Note

+

Prefer the cublasSafeCall/OPM_CUBLAS_SAFE_CALL counterpart unless you really don’t want to throw an exception.

+
+
+
Parameters:
+
    +
  • error – the error code from cublas

  • +
  • expression – the expresison (say “cublasCreate(&handle)”)

  • +
  • filename – the code file the error occured in (typically FILE)

  • +
  • functionName – name of the function the error occured in (typically func)

  • +
  • lineNumber – the line number the error occured in (typically LINE)

  • +
+
+
Returns:
+

the error sent in (for convenience).

+
+
+
+ +
+
+inline cublasStatus_t cublasScal(cublasHandle_t handle, int n, const double *alpha, double *x, int incx)
+
+ +
+
+inline cublasStatus_t cublasScal(cublasHandle_t handle, int n, const float *alpha, float *x, int incx)
+
+ +
+
+inline cublasStatus_t cublasScal(cublasHandle_t handle, int n, const int *alpha, int *x, int incx)
+
+ +
+
+inline cublasStatus_t cublasAxpy(cublasHandle_t handle, int n, const double *alpha, const double *x, int incx, double *y, int incy)
+
+ +
+
+inline cublasStatus_t cublasAxpy(cublasHandle_t handle, int n, const float *alpha, const float *x, int incx, float *y, int incy)
+
+ +
+
+inline cublasStatus_t cublasAxpy(cublasHandle_t handle, int n, const int *alpha, const int *x, int incx, int *y, int incy)
+
+ +
+
+inline cublasStatus_t cublasDot(cublasHandle_t handle, int n, const double *x, int incx, const double *y, int incy, double *result)
+
+ +
+
+inline cublasStatus_t cublasDot(cublasHandle_t handle, int n, const float *x, int incx, const float *y, int incy, float *result)
+
+ +
+
+inline cublasStatus_t cublasDot(cublasHandle_t handle, int n, const int *x, int incx, const int *y, int incy, int *result)
+
+ +
+
+inline cublasStatus_t cublasNrm2(cublasHandle_t handle, int n, const double *x, int incx, double *result)
+
+ +
+
+inline cublasStatus_t cublasNrm2(cublasHandle_t handle, int n, const float *x, int incx, float *result)
+
+ +
+
+inline cublasStatus_t cublasNrm2(cublasHandle_t handle, int n, const int *x, int incx, int *result)
+
+ +
+
+inline GpuSparseMatrixDescriptionPtr createMatrixDescription()
+

createMatrixDescription creates a default matrix description

+
+
Returns:
+

a matrix description to a general sparse matrix with zero based indexing.

+
+
+
+ +
+
+inline GpuSparseMatrixDescriptionPtr createLowerDiagonalDescription()
+

createLowerDiagonalDescription creates a lower diagonal matrix description

+
+

Note

+

This will assume it has a unit diagonal

+
+
+
Returns:
+

a lower diagonal matrix description overlapped with options from Opm::gpuistl::detail::createMatrixDescription()

+
+
+
+ +
+
+inline GpuSparseMatrixDescriptionPtr createUpperDiagonalDescription()
+

createUpperDiagonalDescription creates an upper diagonal matrix description

+
+

Note

+

This will assume it has a non-unit diagonal.

+
+
+
Returns:
+

an upper diagonal matrix description overlapped with options from Opm::gpuistl::detail::createMatrixDescription()

+
+
+
+ +
+
+inline std::string getCusparseErrorCodeToString(int code)
+

getCusparseErrorCodeToString Converts an error code returned from a cusparse function a human readable string.

+
+
Parameters:
+

code – an error code from a cusparse routine

+
+
Returns:
+

a human readable string.

+
+
+
+ +
+
+inline std::string getCusparseErrorMessage(cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

getCusparseErrorMessage generates the error message to display for a given error.

+

+
+Todo:
+

Refactor to use std::source_location once we shift to C++20

+
+ +

+
+

Note

+

This function is mostly for internal use.

+
+
+
Parameters:
+
    +
  • error – the error code from cublas

  • +
  • expression – the expresison (say “cusparseCreate(&handle)”)

  • +
  • filename – the code file the error occured in (typically FILE)

  • +
  • functionName – name of the function the error occured in (typically func)

  • +
  • lineNumber – the line number the error occured in (typically LINE)

  • +
+
+
Returns:
+

An error message to be displayed.

+
+
+
+ +
+
+inline void cusparseSafeCall(cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

cusparseSafeCall checks the return type of the CUSPARSE expression (function call) and throws an exception if it does not equal CUSPARSE_STATUS_SUCCESS.

+

Example usage:

#include <opm/simulators/linalg/gpuistl/detail/cusparse_safe_call.hpp>
+#include <cublas_v2.h>
+
+void some_function() {
+    cusparseHandle_t cusparseHandle;
+    cusparseSafeCall(cusparseCreate(&cusparseHandle), "cusparseCreate(&cusparseHandle)", __FILE__, __func__,
+__LINE__);
+}
+
+
+

+

+
+Todo:
+

Refactor to use std::source_location once we shift to C++20

+
+ +

+
+

Note

+

It is probably easier to use the macro OPM_CUBLAS_SAFE_CALL

+
+
+ +
+
+inline cusparseStatus_t cusparseWarnIfError(cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

cusparseWarnIfError checks the return type of the CUSPARSE expression (function call) and issues a warning if it does not equal CUSPARSE_STATUS_SUCCESS.

+

+Example usage:

#include <opm/simulators/linalg/gpuistl/detail/cusparse_safe_call.hpp>
+#include <cublas_v2.h>
+
+void some_function() {
+    cusparseHandle_t cusparseHandle;
+    cusparseWarnIfError(cusparseCreate(&cusparseHandle), "cusparseCreate(&cusparseHandle)", __FILE__, __func__,
+__LINE__);
+}
+
+
+

+

+
+Todo:
+

Refactor to use std::source_location once we shift to C++20

+
+ +

+
+

Note

+

It is probably easier to use the macro OPM_CUSPARSE_WARN_IF_ERROR

+
+
+

Note

+

Prefer the cusparseSafeCall/OPM_CUSPARSE_SAFE_CALL counterpart unless you really don’t want to throw an exception.

+
+
+
Parameters:
+
    +
  • error – the error code from cublas

  • +
  • expression – the expresison (say “cublasCreate(&handle)”)

  • +
  • filename – the code file the error occured in (typically FILE)

  • +
  • functionName – name of the function the error occured in (typically func)

  • +
  • lineNumber – the line number the error occured in (typically LINE)

  • +
+
+
Returns:
+

the error sent in (for convenience).

+
+
+
+ +
+
+inline cusparseStatus_t cusparseBsrilu02_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, double *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void *pBuffer)
+
+ +
+
+inline cusparseStatus_t cusparseBsrsv2_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, const double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, cusparseSolvePolicy_t policy, void *pBuffer)
+
+ +
+
+inline cusparseStatus_t cusparseBsrsv2_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, const float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, cusparseSolvePolicy_t policy, void *pBuffer)
+
+ +
+
+inline cusparseStatus_t cusparseBsrilu02_analysis(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, float *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void *pBuffer)
+
+ +
+
+inline cusparseStatus_t cusparseBsrsv2_solve(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const double *alpha, const cusparseMatDescr_t descrA, const double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const double *f, double *x, cusparseSolvePolicy_t policy, void *pBuffer)
+
+ +
+
+inline cusparseStatus_t cusparseBsrsv2_solve(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const float *alpha, const cusparseMatDescr_t descrA, const float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, const float *f, float *x, cusparseSolvePolicy_t policy, void *pBuffer)
+
+ +
+
+inline cusparseStatus_t cusparseBsrilu02_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, double *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, int *pBufferSizeInBytes)
+
+ +
+
+inline cusparseStatus_t cusparseBsrilu02_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, float *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, int *pBufferSizeInBytes)
+
+ +
+
+inline cusparseStatus_t cusparseBsrsv2_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int *pBufferSizeInBytes)
+
+ +
+
+inline cusparseStatus_t cusparseBsrsv2_bufferSize(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nnzb, const cusparseMatDescr_t descrA, float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, bsrsv2Info_t info, int *pBufferSizeInBytes)
+
+ +
+
+inline cusparseStatus_t cusparseBsrilu02(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, double *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void *pBuffer)
+
+ +
+
+inline cusparseStatus_t cusparseBsrilu02(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, float *bsrSortedVal, const int *bsrSortedRowPtr, const int *bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void *pBuffer)
+
+ +
+
+inline cusparseStatus_t cusparseBsrmv(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nb, int nnzb, const double *alpha, const cusparseMatDescr_t descrA, const double *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, const double *x, const double *beta, double *y)
+
+ +
+
+inline cusparseStatus_t cusparseBsrmv(cusparseHandle_t handle, cusparseDirection_t dirA, cusparseOperation_t transA, int mb, int nb, int nnzb, const float *alpha, const cusparseMatDescr_t descrA, const float *bsrSortedValA, const int *bsrSortedRowPtrA, const int *bsrSortedColIndA, int blockDim, const float *x, const float *beta, float *y)
+
+ +
+
+template<class Matrix>
const Matrix makeMatrixWithNonzeroDiagonal(const Matrix &matrix, const typename Matrix::field_type replacementValue = std::numeric_limits<typename Matrix::field_type>::epsilon())
+

makeMatrixWithNonzeroDiagonal creates a new matrix with the zero diagonal elements (when viewed as a matrix of scalrars) set to replacementValue

+
+

Note

+

This modification is needed for the CuSparse implementation of ILU0. While the the algorithm operates on block matrices, it still requires that the scalar matrix has no zero diagonal elements.

+
+
+
Parameters:
+
    +
  • matrix – the matrix to replace

  • +
  • replacementValue – the value to set in the diagonal elements that are zero

  • +
+
+
Returns:
+

a new matrix with non non-zero diagonal elements.

+
+
+
+ +
+
+inline std::string getCudaErrorMessage(cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

getCudaErrorMessage generates the error message to display for a given error.

+

+
+Todo:
+

Refactor to use std::source_location once we shift to C++20

+
+ +

+
+

Note

+

This function is mostly for internal use.

+
+
+
Parameters:
+
    +
  • error – the error code from cublas

  • +
  • expression – the expresison (say “cudaMalloc(&pointer, 1)”)

  • +
  • filename – the code file the error occured in (typically FILE)

  • +
  • functionName – name of the function the error occured in (typically func)

  • +
  • lineNumber – the line number the error occured in (typically LINE)

  • +
+
+
Returns:
+

An error message to be displayed.

+
+
+
+ +
+
+inline void cudaSafeCall(cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

cudaSafeCall checks the return type of the GPU expression (function call) and throws an exception if it does not equal cudaSuccess.

+

Example usage:

#include <opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp>
+#include <cuda_runtime.h>
+
+void some_function() {
+    void* somePointer;
+    cudaSafeCall(cudaMalloc(&somePointer, 1), "cudaMalloc(&somePointer, 1)", __FILE__, __func__, __LINE__);
+}
+
+
+

+

+
+Todo:
+

Refactor to use std::source_location once we shift to C++20

+
+ +

+
+

Note

+

It is probably easier to use the macro OPM_GPU_SAFE_CALL

+
+
+ +
+
+inline void cudaWarnIfError(cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

cudaWarnIfError checks the return type of the GPU expression (function call) and issues a warning if it does not equal cudaSuccess.

+

+Example usage:

#include <opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp>
+#include <cuda_runtime.h>
+
+void some_function() {
+    void* somePointer;
+    cudaWarnIfError(cudaMalloc(&somePointer, 1), "cudaMalloc(&somePointer, 1)", __FILE__, __func__, __LINE__);
+}
+
+
+

+

+
+Todo:
+

Refactor to use std::source_location once we shift to C++20

+
+ +

+
+

Note

+

It is probably easier to use the macro OPM_GPU_WARN_IF_ERROR

+
+
+

Note

+

Prefer the cudaSafeCall/OPM_GPU_SAFE_CALL counterpart unless you really don’t want to throw an exception.

+
+
+
Parameters:
+
    +
  • error – the error code from cublas

  • +
  • expression – the expresison (say “cudaMalloc(&pointer, 1)”)

  • +
  • filename – the code file the error occured in (typically FILE)

  • +
  • functionName – name of the function the error occured in (typically func)

  • +
  • lineNumber – the line number the error occured in (typically LINE)

  • +
+
+
+
+ +
+
+template<class T, int blocksize>
void copyMatDataToReordered(const T *srcMatrix, const int *srcRowIndices, T *dstMatrix, int *dstRowIndices, int *naturalToReordered, size_t numberOfRows, int threadBlockSize)
+

Reorders the elements of a matrix by copying them from one matrix to another using a permutation list.

+
+
Parameters:
+
    +
  • srcMatrix – The source matrix we will copy data from

  • +
  • srcRowIndices – Pointer to vector on GPU containing row indices for the source matrix compliant wiht bsr format

  • +
  • dstMatrix[out] The destination matrix that we copy data to

  • +
  • dstRowIndices – Pointer to vector on GPU containing riw indices for the destination matrix compliant wiht bsr format

  • +
  • naturalToReordered – Permuation list that converts indices in the src matrix to the indices in the dst matrix

  • +
  • numberOfRows – The number of rows in the matrices

  • +
+
+
+
+ +
+
+template<class T, int blocksize>
void copyMatDataToReorderedSplit(const T *srcMatrix, const int *srcRowIndices, const int *srcColumnIndices, T *dstLowerMatrix, int *dstLowerRowIndices, T *dstUpperMatrix, int *dstUpperRowIndices, T *dstDiag, int *naturalToReordered, size_t numberOfRows, int threadBlockSize)
+

Reorders the elements of a matrix by copying them from one matrix to a split matrix using a permutation list.

+
+
Parameters:
+
    +
  • srcMatrix – The source matrix we will copy data from

  • +
  • srcRowIndices – Pointer to vector on GPU containing row indices for the source matrix compliant wiht bsr format

  • +
  • dstLowerMatrix[out] The destination of entries that originates from the strictly lower triangular matrix

  • +
  • dstRowIndices – Pointer to vector on GPU containing rww indices for the destination lower matrix compliant wiht bsr format

  • +
  • dstUpperMatrix[out] The destination of entries that originates from the strictly upper triangular matrix

  • +
  • dstRowIndices – Pointer to vector on GPU containing riw indices for the destination upper matrix compliant wiht bsr format

  • +
  • dstDiag[out] The destination buffer for the diagonal part of the matrix

  • +
  • naturalToReordered – Permuation list that converts indices in the src matrix to the indices in the dst matrix

  • +
  • numberOfRows – The number of rows in the matrices

  • +
+
+
+
+ +
+
+inline constexpr size_t getThreads(size_t numberOfRows)
+
+ +
+
+inline size_t getBlocks(size_t numberOfRows)
+
+ +
+
+template<class Kernel>
inline int getCudaRecomendedThreadBlockSize(Kernel k, int suggestedThrBlockSize = -1)
+
+ +
+
+inline int getNumberOfBlocks(int wantedThreads, int threadBlockSize)
+
+ +
+
+template<class T>
inline bool isGPUPointer(const T *ptr)
+

Checks whether the given pointer is associated with GPU device memory.

+

This function retrieves CUDA pointer attributes for the provided pointer and determines whether it references device memory. It returns true if the pointer corresponds to GPU memory; otherwise, it returns false.

+
+
Template Parameters:
+

T – Type of elements pointed to by the input pointer.

+
+
Parameters:
+

ptr – Pointer to the memory that needs to be checked.

+
+
Returns:
+

True if the pointer represents GPU memory, false otherwise.

+
+
+
+ +
+
+template<class T, class D>
inline bool isGPUPointer(const std::unique_ptr<T, D> &ptr)
+

Checks if the given std::unique_ptr with custom deleter refers to GPU memory.

+
+
Template Parameters:
+
    +
  • T – The type stored within the pointer.

  • +
  • D – The custom deleter type.

  • +
+
+
Parameters:
+

ptr – The std::unique_ptr object to inspect.

+
+
Returns:
+

true if the pointer addresses GPU memory; otherwise false.

+
+
+
+ +
+
+template<class T>
inline bool isGPUPointer(const std::shared_ptr<T> &ptr)
+

Checks if the given std::shared_ptr refers to GPU memory.

+
+
Template Parameters:
+

T – The type stored within the pointer.

+
+
Parameters:
+

ptr – The std::shared_ptr object to inspect.

+
+
Returns:
+

true if the pointer addresses GPU memory; otherwise false.

+
+
+
+ +
+
+inline bool isValidMatrixStorageMPScheme(int scheme)
+
+ +
+
+__host__ __device__ constexpr bool storeDiagonalAsFloat (MatrixStorageMPScheme scheme)
+
+ +
+
+__host__ __device__ constexpr bool storeOffDiagonalAsFloat (MatrixStorageMPScheme scheme)
+
+ +
+
+__host__ __device__ constexpr bool usingMixedPrecision (MatrixStorageMPScheme scheme)
+
+ +
+
+template<class PreconditionerType>
constexpr bool shouldCallPreconditionerPre()
+

Tests (compile time) if the preconditioner type needs to call pre() before a call to apply()

+
+

Note

+

This is mostly used to avoid unneeded copying back and front to the GPU, as well as avoiding communication.

+
+
+ +
+
+template<class PreconditionerType>
constexpr bool shouldCallPreconditionerPost()
+

Tests (compile time) if the preconditioner type needs to call post() after a call to apply(…)

+
+

Note

+

This is mostly used to avoid unneeded copying back and front to the GPU, as well as avoiding communication.

+
+
+ +
+
+inline int to_int(std::size_t s)
+

to_int converts a (on most relevant platforms) 64 bits unsigned size_t to a signed 32 bits signed int

+

+
+Todo:
+

This can be done for more generic types, but then it is probably wise to wait for C++20’s cmp-functions

+
+ +

+
+
Parameters:
+

s – the unsigned integer

+
+
Throws:
+

std::invalid_argument – exception if s is out of range for an int

+
+
Returns:
+

converted s to int if s is within the range of int

+
+
+
+ +
+
+inline __host__ __device__ std::size_t to_size_t (int i)
+

to_size_t converts a (on most relevant platforms) a 32 bit signed int to a 64 bits unsigned int

+

+
+Todo:
+

This can be done for more generic types, but then it is probably wise to wait for C++20’s cmp-functions

+
+ +

+
+
Parameters:
+

i – the signed integer

+
+
Throws:
+

std::invalid_argument – if i is negative.

+
+
Returns:
+

converted i to size_t if it is a non-negative integer.

+
+
+
+ +
+
+template<class T>
void setVectorValue(T *deviceData, size_t numberOfElements, const T &value)
+

setVectorValue sets every element of deviceData to value

+
+
Parameters:
+
    +
  • deviceData – pointer to GPU memory

  • +
  • numberOfElements – number of elements to set to value

  • +
  • value – the value to use

  • +
+
+
+
+ +
+
+template<class T>
void setZeroAtIndexSet(T *deviceData, size_t numberOfElements, const int *indices)
+

setZeroAtIndexSet sets deviceData to zero in the indices of contained in indices

+
+
Parameters:
+
    +
  • deviceData – the data to operate on (device memory)

  • +
  • numberOfElements – number of indices

  • +
  • indices – the indices to use (device memory)

  • +
+
+
+
+ +
+
+template<class T>
T innerProductAtIndices(cublasHandle_t cublasHandle, const T *deviceA, const T *deviceB, T *buffer, size_t numberOfElements, const int *indices)
+

innerProductAtIndices computes the inner product between deviceA[indices] and deviceB[indices]

+
+

Note

+

This is equivalent to projecting the vectors to the indices contained in indices, then doing the inner product of those projected vectors.

+
+
+
Parameters:
+
    +
  • cublasHandle – a valid (initialized) cublas handle

  • +
  • deviceA – data A (device memory)

  • +
  • deviceB – data B (device memory)

  • +
  • buffer – a buffer with number of elements equal to numberOfElements (device memory)

  • +
  • numberOfElements – number of indices

  • +
  • indices – the indices to compute the inner product over (device memory)

  • +
+
+
Returns:
+

the result of the inner product

+
+
+
+ +
+
+template<class T>
void prepareSendBuf(const T *deviceA, T *buffer, size_t numberOfElements, const int *indices)
+
+ +
+
+template<class T>
void syncFromRecvBuf(T *deviceA, T *buffer, size_t numberOfElements, const int *indices)
+
+ +
+
+template<class T>
void weightedDiagMV(const T *squareBlockVector, const size_t numberOfRows, const size_t blocksize, T relaxationFactor, const T *srcVec, T *dstVec)
+

Compue the weighted matrix vector product where the matrix is diagonal, the diagonal is a vector, meaning we compute the Hadamard product.

+
+

Note

+

This is implemented as a faster way to multiply a diagonal matrix with a blockvector. We need only store the diagonal of the matrix and use this product.

+
+
+
Parameters:
+
    +
  • squareBlockVector – A GpuVector whose elements are NxN matrix blocks

  • +
  • numberOfRows – The number of rows in the vector

  • +
  • blocksize – The sidelength of the square block elements in the vector

  • +
  • src_vec – A pointer to the data of the GpuVector we multiply the blockvector with

  • +
  • dst_vec[out] A pointer to the data of the GpuVector we store the result in

  • +
+
+
+
+ +
+
+

Variables

+
+
+constexpr const auto CUSPARSE_MATRIX_ORDER = CUSPARSE_DIRECTION_ROW
+
+ +
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace [anonymous]
+
+ +
+
+namespace DILU
+
+

Functions

+
+
+template<class T, int blocksize>
void solveLowerLevelSet(T *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const T *dInv, const T *d, T *v, int threadBlockSize, cudaStream_t stream)
+

Perform a lower solve on certain rows in a matrix that can safely be computed in parallel.

+
+
Parameters:
+
    +
  • reorderedMat – pointer to GPU memory containing nonzerovalues of the sparse matrix. The matrix reordered such that rows in the same level sets are contiguous

  • +
  • rowIndices – Pointer to vector on GPU containing row indices compliant wiht bsr format

  • +
  • colIndices – Pointer to vector on GPU containing col indices compliant wiht bsr format

  • +
  • indexConversion – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • dInv – The diagonal matrix used by the Diagonal ILU preconditioner. Must be reordered in the same way as reorderedMat

  • +
  • d – Stores the defect

  • +
  • v[out] Will store the results of the lower solve

  • +
+
+
+
+ +
+
+template<int blocksize, class LinearSolverScalar, class MatrixScalar, class DiagonalScalar>
void solveLowerLevelSetSplit(MatrixScalar *reorderedUpperMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const DiagonalScalar *dInv, const LinearSolverScalar *d, LinearSolverScalar *v, int threadBlockSize, cudaStream_t stream)
+

Perform a lower solve on certain rows in a matrix that can safely be computed in parallel.

+
+
Parameters:
+
    +
  • reorderedUpperMat – pointer to GPU memory containing nonzerovalues of the sparse matrix. The matrix reordered such that rows in the same level sets are contiguous. Thismatrix is assumed to be strictly lower triangular

  • +
  • rowIndices – Pointer to vector on GPU containing row indices compliant wiht bsr format

  • +
  • colIndices – Pointer to vector on GPU containing col indices compliant wiht bsr format

  • +
  • indexConversion – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • dInv – The diagonal matrix used by the Diagonal ILU preconditioner. Must be reordered in the same way as reorderedUpperMat

  • +
  • d – Stores the defect

  • +
  • v[out] Will store the results of the lower solve

  • +
+
+
+
+ +
+
+template<class T, int blocksize>
void solveUpperLevelSet(T *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const T *dInv, T *v, int threadBlockSize, cudaStream_t stream)
+

Perform an upper solve on certain rows in a matrix that can safely be computed in parallel.

+
+
Parameters:
+
    +
  • reorderedMat – pointer to GPU memory containing nonzerovalues of the sparse matrix. The matrix reordered such that rows in the same level sets are contiguous

  • +
  • rowIndices – Pointer to vector on GPU containing row indices compliant wiht bsr format

  • +
  • colIndices – Pointer to vector on GPU containing col indices compliant wiht bsr format

  • +
  • indexConversion – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • dInv – The diagonal matrix used by the Diagonal ILU preconditioner

  • +
  • v[out] Will store the results of the lower solve. To begin with it should store the output from the lower solve

  • +
+
+
+
+ +
+
+template<int blocksize, class LinearSolverScalar, class MatrixScalar, class DiagonalScalar>
void solveUpperLevelSetSplit(MatrixScalar *reorderedUpperMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const DiagonalScalar *dInv, LinearSolverScalar *v, int threadBlockSize, cudaStream_t stream)
+

Perform an upper solve on certain rows in a matrix that can safely be computed in parallel.

+
+
Parameters:
+
    +
  • reorderedUpperMat – pointer to GPU memory containing nonzerovalues of the sparse matrix. The matrix reordered such that rows in the same level sets are contiguous. This matrix is assumed to be strictly upper triangular

  • +
  • rowIndices – Pointer to vector on GPU containing row indices compliant wiht bsr format

  • +
  • colIndices – Pointer to vector on GPU containing col indices compliant wiht bsr format

  • +
  • indexConversion – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • dInv – The diagonal matrix used by the Diagonal ILU preconditioner

  • +
  • v[out] Will store the results of the lower solve. To begin with it should store the output from the lower solve

  • +
+
+
+
+ +
+
+template<class T, int blocksize>
void computeDiluDiagonal(T *reorderedMat, int *rowIndices, int *colIndices, int *reorderedToNatural, int *naturalToReordered, int startIdx, int rowsInLevelSet, T *dInv, int threadBlockSize)
+

Computes the ILU0 of the diagonal elements of the reordered matrix and stores it in a reordered vector containing the diagonal blocks.

+
+
Parameters:
+
    +
  • reorderedMat – pointer to GPU memory containing nonzerovalues of the sparse matrix. The matrix reordered such that rows in the same level sets are contiguous

  • +
  • rowIndices – Pointer to vector on GPU containing row indices compliant wiht bsr format

  • +
  • colIndices – Pointer to vector on GPU containing col indices compliant wiht bsr format

  • +
  • reorderedToNatural – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • naturalToreordered – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • dInv[out] The diagonal matrix used by the Diagonal ILU preconditioner

  • +
+
+
+
+ +
+
+template<int blocksize, class InputScalar, class OutputScalar, MatrixStorageMPScheme>
void computeDiluDiagonalSplit(const InputScalar *srcReorderedLowerMat, int *lowerRowIndices, int *lowerColIndices, const InputScalar *srcReorderedUpperMat, int *upperRowIndices, int *upperColIndices, const InputScalar *srcDiagonal, int *reorderedToNatural, int *naturalToReordered, int startIdx, int rowsInLevelSet, InputScalar *dInv, OutputScalar *dstDiagonal, OutputScalar *dstLowerMat, OutputScalar *dstUpperMat, int threadBlockSize)
+

Computes the ILU0 of the diagonal elements of the split reordered matrix and stores it in a reordered vector containing the diagonal blocks.

+
+
Parameters:
+
    +
  • reorderedLowerMat – pointer to GPU memory containing nonzerovalues of the strictly lower triangular sparse matrix. The matrix reordered such that rows in the same level sets are contiguous

  • +
  • lowerRowIndices – Pointer to vector on GPU containing row indices of the lower matrix compliant wiht bsr format

  • +
  • lowerColIndices – Pointer to vector on GPU containing col indices of the lower matrix compliant wiht bsr format

  • +
  • reorderedUpperMat – pointer to GPU memory containing nonzerovalues of the strictly upper triangular sparse matrix. The matrix reordered such that rows in the same level sets are contiguous

  • +
  • upperRowIndices – Pointer to vector on GPU containing row indices of the upper matrix compliant wiht bsr format

  • +
  • upperColIndices – Pointer to vector on GPU containing col indices of the upper matrix compliant wiht bsr format

  • +
  • reorderedToNatural – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • diagonal – The diagonal elements of the reordered matrix

  • +
  • naturalToreordered – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • dInv[out] The diagonal matrix used by the Diagonal ILU preconditioner

  • +
+
+
+
+ +
+
+ +
+
+namespace ILU0
+
+

Functions

+
+
+template<class T, int blocksize>
void solveUpperLevelSet(T *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, T *v, int threadBlockSize, cudaStream_t stream)
+

Perform a upper solve on certain rows in a matrix that can safely be computed in parallel.

+
+
Parameters:
+
    +
  • reorderedMat – pointer to GPU memory containing nonzerovalues of the sparse matrix. The matrix reordered such that rows in the same level sets are contiguous

  • +
  • rowIndices – Pointer to vector on GPU containing row indices compliant wiht bsr format

  • +
  • colIndices – Pointer to vector on GPU containing col indices compliant wiht bsr format

  • +
  • indexConversion – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • v[out] Will store the results of the upper solve

  • +
  • threadBlockSize – The number of threads per threadblock. Leave as -1 if no blocksize is already chosen

  • +
+
+
+
+ +
+
+template<class T, int blocksize>
void solveLowerLevelSet(T *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const T *d, T *v, int threadBlockSize, cudaStream_t stream)
+

Perform a lower solve on certain rows in a matrix that can safely be computed in parallel.

+
+
Parameters:
+
    +
  • reorderedMat – pointer to GPU memory containing nonzerovalues of the sparse matrix. The matrix reordered such that rows in the same level sets are contiguous

  • +
  • rowIndices – Pointer to vector on GPU containing row indices compliant wiht bsr format

  • +
  • colIndices – Pointer to vector on GPU containing col indices compliant wiht bsr format

  • +
  • indexConversion – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • d – Stores the defect

  • +
  • v[out] Will store the results of the lower solve

  • +
  • threadBlockSize – The number of threads per threadblock. Leave as -1 if no blocksize is already chosen

  • +
+
+
+
+ +
+
+template<int blocksize, class LinearSolverScalar, class MatrixScalar, class DiagonalScalar>
void solveUpperLevelSetSplit(MatrixScalar *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const DiagonalScalar *dInv, LinearSolverScalar *v, int threadBlockSize, cudaStream_t stream)
+

Perform an upper solve on certain rows in a matrix that can safely be computed in parallel.

+
+
Parameters:
+
    +
  • reorderedUpperMat – pointer to GPU memory containing nonzerovalues of the sparse matrix. The matrix reordered such that rows in the same level sets are contiguous. This matrix is assumed to be strictly upper triangular

  • +
  • rowIndices – Pointer to vector on GPU containing row indices compliant wiht bsr format

  • +
  • colIndices – Pointer to vector on GPU containing col indices compliant wiht bsr format

  • +
  • indexConversion – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • dInv – The diagonal elements of the LU factorization. Store the inverse of the diagonal entries

  • +
  • v[out] Will store the results of the lower solve. To begin with it should store the output from the lower solve

  • +
  • threadBlockSize – The number of threads per threadblock. Leave as -1 if no blocksize is already chosen

  • +
+
+
+
+ +
+
+template<int blocksize, class LinearSolverScalar, class MatrixScalar>
void solveLowerLevelSetSplit(MatrixScalar *reorderedLowerMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const LinearSolverScalar *d, LinearSolverScalar *v, int threadBlockSize, cudaStream_t stream)
+

Perform an lower solve on certain rows in a matrix that can safely be computed in parallel.

+
+
Parameters:
+
    +
  • reorderedLowerMat – pointer to GPU memory containing nonzerovalues of the sparse matrix. The matrix reordered such that rows in the same level sets are contiguous. This matrix is assumed to be strictly lower triangular

  • +
  • rowIndices – Pointer to vector on GPU containing row indices compliant wiht bsr format

  • +
  • colIndices – Pointer to vector on GPU containing col indices compliant wiht bsr format

  • +
  • indexConversion – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • dInv – The diagonal elements of the LU factorization. Store the inverse of the diagonal entries

  • +
  • d – Stores the defect

  • +
  • v[out] Will store the results of the lower solve. To begin with it should store the output from the lower solve

  • +
  • threadBlockSize – The number of threads per threadblock. Leave as -1 if no blocksize is already chosen

  • +
+
+
+
+ +
+
+template<class T, int blocksize>
void LUFactorization(T *reorderedMat, int *rowIndices, int *columnIndices, int *naturalToReordered, int *reorderedToNatual, size_t rowsInLevelSet, int startIdx, int threadBlockSize)
+

Computes the ILU Factorization of the input bcsr matrix, which is stored in a reordered way. The diagonal elements store the inverse of the diagonal entries.

+
+
Parameters:
+
    +
  • reorderedMat[out] pointer to GPU memory containing nonzerovalues of the sparse matrix. The matrix reordered such that rows in the same level sets are contiguous

  • +
  • rowIndices – Pointer to vector on GPU containing row indices compliant wiht bsr format

  • +
  • colIndices – Pointer to vector on GPU containing col indices compliant wiht bsr format

  • +
  • naturalToreordered – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • reorderedToNatural – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • threadBlockSize – The number of threads per threadblock. Leave as -1 if no blocksize is already chosen

  • +
+
+
+
+ +
+
+template<int blocksize, class InputScalar, class OutputScalar, MatrixStorageMPScheme mixedPrecisionScheme>
void LUFactorizationSplit(InputScalar *srcReorderedLowerMat, int *lowerRowIndices, int *lowerColIndices, InputScalar *srcReorderedUpperMat, int *upperRowIndices, int *upperColIndices, InputScalar *srcDiagonal, OutputScalar *dstReorderedLowerMat, OutputScalar *dstReorderedUpperMat, OutputScalar *dstDiagonal, int *reorderedToNatural, int *naturalToReordered, int startIdx, int rowsInLevelSet, int threadBlockSize)
+

Computes the ILU0 factorization in-place of a bcsr matrix stored in a split format (lower, diagonal and upper triangular part)

+

TODO: update this doucmentation

+
+
Parameters:
+
    +
  • reorderedLowerMat[out] pointer to GPU memory containing nonzerovalues of the strictly lower triangular sparse matrix. The matrix reordered such that rows in the same level sets are contiguous

  • +
  • lowerRowIndices – Pointer to vector on GPU containing row indices of the lower matrix compliant wiht bsr format

  • +
  • lowerColIndices – Pointer to vector on GPU containing col indices of the lower matrix compliant wiht bsr format

  • +
  • reorderedUpperMat[out] pointer to GPU memory containing nonzerovalues of the strictly upper triangular sparse matrix. The matrix reordered such that rows in the same level sets are contiguous

  • +
  • upperRowIndices – Pointer to vector on GPU containing row indices of the upper matrix compliant wiht bsr format

  • +
  • upperColIndices – Pointer to vector on GPU containing col indices of the upper matrix compliant wiht bsr format

  • +
  • diagonal[out] The diagonal elements of the ILU0 factorization inverted

  • +
  • reorderedToNatural – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • naturalToreordered – Integer array containing mapping an index in the reordered matrix to its corresponding index in the natural ordered matrix

  • +
  • startIdx – Index of the first row of the matrix to be solve

  • +
  • rowsInLevelSet – Number of rows in this level set, which number the amount of rows solved in parallel by this function

  • +
  • threadBlockSize – The number of threads per threadblock. Leave as -1 if no blocksize is already chosen

  • +
+
+
+
+ +
+
+ +
+
+namespace JAC
+
+

Functions

+
+
+template<class T, int blocksize>
void invertDiagonalAndFlatten(const T *mat, const int *rowIndices, const int *colIndices, size_t numberOfRows, T *vec)
+

This function receives a matrix, and the inverse of the matrix containing only its diagonal is stored in d_vec.

+
+
Parameters:
+
    +
  • mat – pointer to GPU memory containing nonzerovalues of the sparse matrix

  • +
  • rowIndices – Pointer to vector on GPU containing row indices compliant wiht bsr format

  • +
  • colIndices – Pointer to vector on GPU containing col indices compliant wiht bsr format

  • +
  • numberOfRows – Integer describing the number of rows in the matrix

  • +
  • vec[out] Pointer to the vector where the inverse of the diagonal matrix should be stored

  • +
+
+
+
+ +
+
+ +
+
+namespace GridDataOutput
+
+

Typedefs

+
+
+template<class T>
using DV = DamarisOutput::DamarisVar<T>
+
+ +
+
+

Enums

+
+
+enum ConnectivityVertexOrder
+

Allows selection of order of vertices in writeConnectivity()

+

Values:

+
+
+enumerator DUNE
+
+ +
+
+enumerator VTK
+
+ +
+ +
+
+ +
+
+namespace Helper
+
+

Functions

+
+
+template<class SimulatorType, class VectorType, class Communicator>
void writeVector(const SimulatorType &simulator, const VectorType &rhs, const std::string &sysName, const Communicator *comm)
+

Output a Dune ISTL vector to file in MatrixMarket format.

+
+
Template Parameters:
+
    +
  • SimulatorType – Packaged simulator type. Expected to provide, among other services, an episode index, a simulation time, and a physical model.

  • +
  • VectorType – Object type for a linear system vector object. Typically a linear system vector type from the Dune ISTL.

  • +
  • Communicator – ISTL communication type. Typically

    Dune::OwnerOverlapCopyCommunication<> 
    +
    +
    + or similar.

  • +
+
+
Parameters:
+
    +
  • simulator[in] Simulator object.

  • +
  • rhs[in] Linear system right-hand side vector. Expected to be a Dune ISTL vector.

  • +
  • sysName[in] Name of linear system/physical model. Incorporated into the name of the MatrixMarket output file.

  • +
  • comm[in] Dune ISTL communication object. Unused in builds without MPI support. You may use a nullptr value in a sequential run of an MPI-enabled build to signify that parallel output is unneeded.

  • +
+
+
+
+ +
+
+template<class SimulatorType, class MatrixType, class Communicator>
void writeMatrix(const SimulatorType &simulator, const MatrixType &matrix, const std::string &sysName, const Communicator *comm)
+

Output a Dune ISTL matrix to file in MatrixMarket format.

+
+
Template Parameters:
+
    +
  • SimulatorType – Packaged simulator type. Expected to provide, among other services, an episode index, a simulation time, and a physical model.

  • +
  • MatrixType – Object type for a linear system matrix object. Typically a linear system matrix type from the Dune ISTL.

  • +
  • Communicator – ISTL communication type. Typically

    Dune::OwnerOverlapCopyCommunication<> 
    +
    +
    + or similar.

  • +
+
+
Parameters:
+
    +
  • simulator[in] Simulator object.

  • +
  • matrix[in] Linear system coefficient matrix. Expected to be a Dune ISTL (sparse) matrix.

  • +
  • sysName[in] Name of linear system/physical model. Incorporated into the name of the MatrixMarket output file.

  • +
  • comm[in] Dune ISTL communication object. Unused in builds without MPI support. You may use a nullptr value in a sequential run of an MPI-enabled build to signify that parallel output is unneeded.

  • +
+
+
+
+ +
+
+template<class SimulatorType, class MatrixType, class VectorType, class Communicator>
void writeSystem(const SimulatorType &simulator, const MatrixType &matrix, const VectorType &rhs, const std::string &sysName, const Communicator *comm)
+

Output a Dune ISTL linear system to files in MatrixMarket format.

+

This function will create one output file for the coefficient matrix and another output file for the system right-hand side vector.

+
+
Template Parameters:
+
    +
  • SimulatorType – Packaged simulator type. Expected to provide, among other services, an episode index, a simulation time, and a physical model.

  • +
  • MatrixType – Object type for a linear system matrix object. Typically a linear system matrix type from the Dune ISTL.

  • +
  • VectorType – Object type for a linear system vector object. Typically a linear system vector type from the Dune ISTL.

  • +
  • Communicator – ISTL communication type. Typically

    Dune::OwnerOverlapCopyCommunication<> 
    +
    +
    + or similar.

  • +
+
+
Parameters:
+
    +
  • simulator[in] Simulator object.

  • +
  • matrix[in] Linear system coefficient matrix. Expected to be a Dune ISTL (sparse) matrix.

  • +
  • rhs[in] Linear system right-hand side vector. Expected to be a Dune ISTL vector.

  • +
  • sysName[in] Name of linear system/physical model. Incorporated into the name of the MatrixMarket output file.

  • +
  • comm[in] Dune ISTL communication object. Unused in builds without MPI support. You may use a nullptr value in a sequential run of an MPI-enabled build to signify that parallel output is unneeded.

  • +
+
+
+
+ +
+
+template<class SimulatorType, class MatrixType, class VectorType, class Communicator>
void writeSystem(const SimulatorType &simulator, const MatrixType &matrix, const VectorType &rhs, const Communicator *comm)
+

Output a Dune ISTL linear system from linearising a set of flow equations to files in MatrixMarket format.

+

This function will create one output file for the coefficient matrix and another output file for the system right-hand side vector.

+
+
Template Parameters:
+
    +
  • SimulatorType – Packaged simulator type. Expected to provide, among other services, an episode index, a simulation time, and a physical model.

  • +
  • MatrixType – Object type for a linear system matrix object. Typically a linear system matrix type from the Dune ISTL.

  • +
  • VectorType – Object type for a linear system vector object. Typically a linear system vector type from the Dune ISTL.

  • +
  • Communicator – ISTL communication type. Typically

    Dune::OwnerOverlapCopyCommunication<> 
    +
    +
    + or similar.

  • +
+
+
Parameters:
+
    +
  • simulator[in] Simulator object.

  • +
  • matrix[in] Linear system coefficient matrix. Expected to be a Dune ISTL (sparse) matrix.

  • +
  • rhs[in] Linear system right-hand side vector. Expected to be a Dune ISTL vector.

  • +
  • comm[in] Dune ISTL communication object. Unused in builds without MPI support. You may use a nullptr value in a sequential run of an MPI-enabled build to signify that parallel output is unneeded.

  • +
+
+
+
+ +
+
+template<class SimulatorType, class MatrixType, class VectorType, class Communicator>
void writeMechSystem(const SimulatorType &simulator, const MatrixType &matrix, const VectorType &rhs, const Communicator *comm)
+

Output a Dune ISTL linear system from linearising a set of geo-mechanical equations to files in MatrixMarket format.

+

This function will create one output file for the coefficient matrix and another output file for the system right-hand side vector.

+
+
Template Parameters:
+
    +
  • SimulatorType – Packaged simulator type. Expected to provide, among other services, an episode index, a simulation time, and a physical model.

  • +
  • MatrixType – Object type for a linear system matrix object. Typically a linear system matrix type from the Dune ISTL.

  • +
  • VectorType – Object type for a linear system vector object. Typically a linear system vector type from the Dune ISTL.

  • +
  • Communicator – ISTL communication type. Typically

    Dune::OwnerOverlapCopyCommunication<> 
    +
    +
    + or similar.

  • +
+
+
Parameters:
+
    +
  • simulator[in] Simulator object.

  • +
  • matrix[in] Linear system coefficient matrix. Expected to be a Dune ISTL (sparse) matrix.

  • +
  • rhs[in] Linear system right-hand side vector. Expected to be a Dune ISTL vector.

  • +
  • comm[in] Dune ISTL communication object. Unused in builds without MPI support. You may use a nullptr value in a sequential run of an MPI-enabled build to signify that parallel output is unneeded.

  • +
+
+
+
+ +
+
+ +
+
+namespace detail
+
+

Functions

+
+
+template<class SimulatorType, class LinalgObjectType, class Communicator>
void writeMatrixMarketObject(const SimulatorType &simulator, const LinalgObjectType &linalgObject, const std::string &objName, const Communicator *comm)
+

Output a linear algebra object to file in MatrixMarket format.

+

Common implementation function.

+
+
Template Parameters:
+
    +
  • SimulatorType – Packaged simulator type. Expected to provide, among other services, an episode index, a simulation time, and a physical model.

  • +
  • LinalgObjectType – Object type for a linear algebra object. Expected to be a coefficient matrix type or a linear system vector type from the Dune ISTL.

  • +
  • Communicator – ISTL communication type. Typically

    Dune::OwnerOverlapCopyCommunication<> 
    +
    +
    + or similar.

  • +
+
+
Parameters:
+
    +
  • simulator[in] Simulator object.

  • +
  • linalgObject[in] Linear algebra object. Expected to be a Dune ISTL matrix or vector.

  • +
  • objName[in] Name of linear algebra object. Incorporated into the name of the MatrixMarket output file.

  • +
  • comm[in] Dune ISTL communication object. Unused in builds without MPI support. You may use a nullptr value in a sequential run of an MPI-enabled build to signify that parallel output is unneeded.

  • +
+
+
+
+ +
+
+ +
+
+namespace KeywordValidation
+
+

Typedefs

+
+
+using UnsupportedKeywords = std::map<std::string, UnsupportedKeywordProperties>
+
+ +
+
+template<typename T>
using SupportedSingleKeywordItems = std::map<std::size_t, SupportedKeywordProperties<T>>
+
+ +
+
+template<typename T>
using SupportedKeywordItems = std::map<std::string, SupportedSingleKeywordItems<T>>
+
+ +
+
+using ValidationFunction = std::function<void(const DeckKeyword&, std::vector<ValidationError>&)>
+
+ +
+
+

Functions

+
+
+std::string get_error_report(const std::vector<ValidationError> &errors, const bool include_noncritical, const bool include_critical)
+
+ +
+
+std::unordered_map<std::string, ValidationFunction> specialValidation()
+
+ +
+
+ +
+
+namespace Mpi
+
+ +
+
+namespace detail
+
+

Functions

+
+
+std::size_t mpi_buffer_size(const std::size_t bufsize, const std::size_t position)
+
+ +
+
+

Variables

+
+
+constexpr int NumFip = static_cast<int>(FIPConfig::OutputField::NUM_FIP_REPORT)
+
+ +
+
+template<typename T>
constexpr bool is_pod_v = std::is_standard_layout_v<T> && std::is_trivial_v<T>
+
+ +
+
+ +
+
+namespace mswellhelpers
+
+

Typedefs

+
+
+template<class Scalar, int Dim>
using Vec = Dune::BlockVector<Dune::FieldVector<Scalar, Dim>>
+
+ +
+
+template<class Scalar, int M, int N = M>
using Mat = Dune::BCRSMatrix<Dune::FieldMatrix<Scalar, M, N>>
+
+ +
+
+

Functions

+
+
+template<typename MatrixType, typename VectorType>
VectorType applyUMFPack(Dune::UMFPack<MatrixType> &linsolver, VectorType x)
+

Applies umfpack and checks for singularity.

+
+ +
+
+template<typename VectorType, typename MatrixType>
Dune::Matrix<typename MatrixType::block_type> invertWithUMFPack(const int size, const int bsize, Dune::UMFPack<MatrixType> &linsolver)
+

Applies umfpack and checks for singularity.

+
+ +
+
+template<typename MatrixType, typename VectorType>
VectorType invDX(const MatrixType &D, VectorType x, DeferredLogger &deferred_logger)
+
+ +
+
+template<typename ValueType, typename Scalar>
ValueType frictionPressureLoss(const Scalar l, const Scalar diameter, const Scalar area, const Scalar roughness, const ValueType &density, const ValueType &w, const ValueType &mu)
+
+ +
+
+template<typename ValueType, typename Scalar>
ValueType valveContrictionPressureLoss(const ValueType &mass_rate, const ValueType &density, const Scalar area_con, const Scalar cv)
+
+ +
+
+template<typename ValueType, typename Scalar>
ValueType velocityHead(const Scalar area, const ValueType &mass_rate, const ValueType &density)
+
+ +
+
+template<typename ValueType, typename Scalar>
ValueType emulsionViscosity(const ValueType &water_fraction, const ValueType &water_viscosity, const ValueType &oil_fraction, const ValueType &oil_viscosity, const SICD &sicd)
+
+ +
+
+ +
+
+namespace Network
+
+ +
+
+namespace Parallel
+
+

Typedefs

+
+
+using MPIComm = typename Dune::MPIHelper::MPICommunicator
+
+ +
+
+using Communication = Dune::Communication<MPIComm>
+
+ +
+
+ +
+
+namespace Parameters
+
+

Typedefs

+
+
+using PositionalArgumentCallback = std::function<int(std::function<void(const std::string&, const std::string&)>, std::set<std::string>&, std::string&, int, const char**, int, int)>
+

Callback function for command line parsing.

+
+ +
+
+

Functions

+
+
+void reset()
+

Reset parameter system.

+
+ +
+
+bool IsRegistrationOpen()
+

Query whether parameter registration is open or not.

+
+
Returns:
+

True if registration is open, false otherwise

+
+
+
+ +
+
+void endRegistration()
+

Indicate that all parameters are registered for a given type tag.

+

If registerParam is called after the invocation of endParamRegistration, a std::logic_error exception will be thrown.

+
+ +
+
+void getLists(std::vector<Parameter> &usedParams, std::vector<Parameter> &unusedParams)
+

Retrieves the lists of parameters specified at runtime and their values.

+

The two arguments besides the TypeTag are assumed to be STL containers which store std::pair<std::string, std::string>.

+
+ +
+
+void printUsage(const std::string &helpPreamble, std::ostream &os, const std::string &errorMsg = "", const bool showAll = false)
+

Print a usage message for all run-time parameters.

+
+
Parameters:
+
    +
  • helpPreamble – The string that is printed after the error message and before the list of parameters.

  • +
  • errorMsg – The error message to be printed, if any

  • +
  • os – The std::ostream which should be used.

  • +
+
+
+
+ +
+
+bool parseParameterFile(const std::string &fileName, bool overwrite = true)
+

Read the parameters from an INI-style file.

+

This function does some basic syntax checks.

+
+ +
+
+std::string parseCommandLineOptions(int argc, const char **argv, const PositionalArgumentCallback &posArgCallback, const std::string &helpPreamble = "")
+

Parse the parameters provided on the command line.

+

This function does some basic syntax checks.

+
+
Parameters:
+
    +
  • argc – The number of parameters passed by the operating system to the main() function

  • +
  • argv – The array of strings passed by the operating system to the main() function

  • +
  • helpPreamble – If non-empty, the &#8212;help and -h parameters will be recognized and the content of the string will be printed before the list of command line parameters

  • +
+
+
Returns:
+

Empty string if everything worked out. Otherwise the thing that could not be read.

+
+
+
+ +
+
+void printValues(std::ostream &os)
+

Print values of the run-time parameters.

+
+
Parameters:
+

os – The std::ostream on which the message should be printed

+
+
+
+ +
+
+bool printUnused(std::ostream &os)
+

Print the list of unused run-time parameters.

+
+
Parameters:
+

os – The std::ostream on which the message should be printed

+
+
Returns:
+

true if something was printed

+
+
+
+ +
+
+template<class Param>
auto Get(bool errorIfNotRegistered = true)
+

Retrieve a runtime parameter.

+

The default value is specified in the parameter struct.

+

Example:

+
// Retrieves value UpwindWeight, default
+// is taken from the property UpwindWeight
+::Opm::Parameters::get<::Opm::Parameters::UpwindWeight>();
+
+
+
+ +
+
+template<class Param>
void SetDefault(decltype(Param::value) new_value)
+

Set a runtime parameter.

+

Override the default value specified.

+

Example:

+
// Set the value UpwindWeight
+::Opm::Parameters::Set<::Opm::Parameters::UpwindWeight>(3.0);
+
+
+
+ +
+
+template<class Param>
bool IsSet(bool errorIfNotRegistered = true)
+

Returns true if a parameter has been specified at runtime, false otherwise.

+

If the parameter in question has not been registered, this throws an exception.

+
+ +
+
+template<class Param>
void Register(const char *usageString)
+

Register a run-time parameter.

+

In OPM, parameters can only be used after they have been registered.

+

Example:

+
// Registers a run-time parameter "UpwindWeight"
+   and the description "Relative weight of the upwind node."
+Register<UpwindWeight>("Relative weight of the upwind node.");
+
+
+
+ +
+
+template<class Param>
void Hide()
+

Indicate that a given parameter should not be mentioned in the help message.

+

This allows to deal with unused parameters

+
+ +
+
+ +
+
+namespace detail
+
+

Functions

+
+
+template<class ParamType>
ParamType Get_(const std::string &paramName, ParamType defaultValue, bool errorIfNotRegistered)
+

Private implementation.

+
+ +
+
+void Hide_(const std::string &paramName)
+

Private implementation.

+
+ +
+
+bool IsSet_(const std::string &paramName, bool errorIfNotRegistered)
+

Private implementation.

+
+ +
+
+void Register_(const std::string &paramName, const std::string &paramTypeName, const std::string &defaultValue, const char *usageString)
+

Private implementation.

+
+ +
+
+void SetDefault_(const std::string &paramName, const std::string &paramValue)
+

Private implementation.

+
+ +
+
+template bool Get_ (const std::string &, bool, bool)
+
+ +
+
+template double Get_ (const std::string &, double, bool)
+
+ +
+
+template float Get_ (const std::string &, float, bool)
+
+ +
+
+template int Get_ (const std::string &, int, bool)
+
+ +
+
+template long Get_ (const std::string &, long, bool)
+
+ +
+
+template std::string Get_ (const std::string &, std::string, bool)
+
+ +
+
+template unsigned Get_ (const std::string &, unsigned, bool)
+
+ +
+
+template<class Parameter>
auto getParamName()
+

get the name data member of a parameter

+
+ +
+
+ +
+
+namespace Properties
+
+ +
+
+namespace TTag
+
+ +
+
+namespace PVUtil
+
+

Functions

+
+
+template<class PV>
std::size_t pack(const PV &privar)
+
+ +
+
+template<class PV>
void unPack(PV &privar, const std::size_t meanings)
+
+ +
+
+

Variables

+
+
+constexpr int fbits = 4
+
+ +
+
+ +
+
+namespace Pybind
+
+

Functions

+
+
+void export_all(py::module &m)
+
+ +
+
+void export_PyBlackOilSimulator(py::module &m)
+
+ +
+
+ +
+
+namespace RateConverter
+
+

Typedefs

+
+
+template<class Scalar>
using FS = BlackOilFluidSystem<Scalar, BlackOilDefaultFluidSystemIndices>
+
+ +
+
+ +
+
+namespace RegionAttributeHelpers
+
+ +
+
+namespace PhasePos
+

Convenience functions for querying numerical IDs (“positions”) of active phases.

+
+

Functions

+
+
+inline int water(const PhaseUsage &pu)
+

Numerical ID of active water phase.

+
+
Parameters:
+

pu[in] Active phase object.

+
+
Returns:
+

Non-negative index/position of water if active, -1 if not.

+
+
+
+ +
+
+inline int oil(const PhaseUsage &pu)
+

Numerical ID of active oil phase.

+
+
Parameters:
+

pu[in] Active phase object.

+
+
Returns:
+

Non-negative index/position of oil if active, -1 if not.

+
+
+
+ +
+
+inline int gas(const PhaseUsage &pu)
+

Numerical ID of active gas phase.

+
+
Parameters:
+

pu[in] Active phase object.

+
+
Returns:
+

Non-negative index/position of gas if active, -1 if not.

+
+
+
+ +
+
+ +
+
+namespace PhaseUsed
+

Convenience functions for querying presence/absence of active phases.

+
+

Functions

+
+
+inline bool water(const PhaseUsage &pu)
+

Active water predicate.

+
+
Parameters:
+

pu[in] Active phase object.

+
+
Returns:
+

Whether or not water is an active phase.

+
+
+
+ +
+
+inline bool oil(const PhaseUsage &pu)
+

Active oil predicate.

+
+
Parameters:
+

pu[in] Active phase object.

+
+
Returns:
+

Whether or not oil is an active phase.

+
+
+
+ +
+
+inline bool gas(const PhaseUsage &pu)
+

Active gas predicate.

+
+
Parameters:
+

pu[in] Active phase object.

+
+
Returns:
+

Whether or not gas is an active phase.

+
+
+
+ +
+
+ +
+
+namespace Select
+

Convenience tools for processing region spesific attributes

+
+ +
+
+namespace RegionAverageCalculator
+
+ +
+
+namespace ReservoirCoupling
+
+

Enums

+
+
+enum class MessageTag : int
+

Values:

+
+
+enumerator SlaveSimulationStartDate
+
+ +
+
+enumerator SlaveActivationDate
+
+ +
+
+enumerator SlaveProcessTermination
+
+ +
+
+enumerator SlaveNextReportDate
+
+ +
+
+enumerator SlaveNextTimeStep
+
+ +
+
+enumerator MasterGroupNames
+
+ +
+
+enumerator MasterGroupNamesSize
+
+ +
+ +
+
+

Functions

+
+
+void custom_error_handler_(MPI_Comm *comm, int *err, const std::string &msg)
+
+ +
+
+void custom_error_handler_slave_(MPI_Comm *comm, int *err, ...)
+
+ +
+
+void custom_error_handler_master_(MPI_Comm *comm, int *err, ...)
+
+ +
+
+void setErrhandler(MPI_Comm comm, bool is_master)
+
+ +
+
+ +
+
+namespace Satfunc
+
+ +
+
+namespace satfunc
+
+ +
+
+namespace PhaseChecks
+
+ +
+
+namespace Gas
+
+ +
+
+namespace Oil
+
+ +
+
+namespace ThreePointHorizontal
+
+ +
+
+namespace Water
+
+ +
+
+namespace Serialization
+
+ +
+
+namespace detail
+
+ +
+
+namespace util
+
+

Functions

+
+
+std::pair<std::vector<int>, int> compressAndCountPartitionIDs(std::vector<int> &&parts0)
+
+ +
+
+std::vector<int> compressPartitionIDs(std::vector<int> &&parts0)
+
+ +
+
+void compressPartitionIDs(std::vector<int> &parts0)
+
+ +
+
+ +
+
+namespace wellhelpers
+
+

Typedefs

+
+
+template<class Scalar, int Dim>
using Vec = Dune::BlockVector<Dune::FieldVector<Scalar, Dim>>
+
+ +
+
+template<class Scalar>
using DynVec = Dune::BlockVector<Dune::DynamicVector<Scalar>>
+
+ +
+
+template<class Scalar>
using DMatrix = Dune::DynamicMatrix<Scalar>
+
+ +
+
+using Comm = Parallel::Communication
+
+ +
+
+

Functions

+
+
+template<class Scalar>
Scalar computeHydrostaticCorrection(const Scalar well_ref_depth, const Scalar vfp_ref_depth, const Scalar rho, const Scalar gravity)
+
+ +
+
+template<typename MatrixType, typename VectorType, typename Comm>
void sumDistributedWellEntries(MatrixType &mat, VectorType &vec, const Comm &comm)
+

Sums entries of the diagonal Matrix for distributed wells.

+
+ +
+
+template<class DenseMatrix>
DenseMatrix transposeDenseDynMatrix(const DenseMatrix &M)
+
+ +
+
+bool rateControlWithZeroProdTarget(const WellProductionControls &controls, WellProducerCMode mode)
+

Helper to check whether the well is under zero production rate control.

+
+ +
+
+bool rateControlWithZeroInjTarget(const WellInjectionControls &controls, WellInjectorCMode mode)
+

Helper to check whether the well is under zero injection rate control.

+
+ +
+
+ +
+
+namespace WGHelpers
+
+ +
+
+namespace P2PCommunicatorType
+
+ +
+
+namespace rocalution
+
+ +
+
+namespace std
+
+ +
+
+file blackoilbrineparams.cpp
+
+#include <config.h>
+ +
+#include <cassert>
+
+#include <cstddef>
+
+#include <stdexcept>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file blackoilbrineparams.hpp
+
+#include <opm/material/common/Tabulated1DFunction.hpp>
+
+#include <vector>
+

Contains the parameters required to extend the black-oil model by brine.

+
+ +
+
+file blackoilextboparams.cpp
+
+#include <config.h>
+ +
+#include <cstddef>
+
+#include <stdexcept>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file blackoilextboparams.hpp
+
+#include <opm/material/common/Tabulated1DFunction.hpp>
+
+#include <opm/material/common/UniformXTabulated2DFunction.hpp>
+
+#include <vector>
+

Contains the parameters required to extend the black-oil model by solvent component. For details, refer: [*] T.H. Sandve, O. Sævareid and I. Aavatsmark: “Improved Extended Blackoil Formulation for CO2 EOR Simulations.” in ECMOR XVII – The 17th European Conference on the Mathematics of Oil Recovery, September 2020.

+
+ +
+
+file blackoilfoamparams.cpp
+
+#include <config.h>
+ +
+#include <cstddef>
+
+#include <stdexcept>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file blackoilfoamparams.hpp
+
+#include <opm/material/common/Tabulated1DFunction.hpp>
+
+#include <vector>
+

Contains the parameters to extend the black-oil model to include the effects of foam.

+
+ +
+
+file blackoilmicpparams.cpp
+
+#include <config.h>
+ +
+#include <algorithm>
+
+#include <stdexcept>
+
+#include <type_traits>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file blackoilmicpparams.hpp
+
+#include <opm/material/common/Tabulated1DFunction.hpp>
+
+#include <vector>
+

Contains the parameters required to extend the black-oil model by MICP.

+
+ +
+
+file blackoilnewtonmethod.hpp
+
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/blackoil/blackoilmicpmodules.hh>
+ +
+#include <opm/models/nonlinear/newtonmethod.hh>
+
+#include <opm/models/utils/signum.hh>
+
+#include <algorithm>
+
+#include <cmath>
+
+#include <vector>
+

A newton solver which is specific to the black oil model.

+
+ +
+
+file blackoilnewtonmethodparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file blackoilnewtonmethodparams.hpp
+

A newton solver which is specific to the black oil model.

+
+ +
+
+file blackoilpolymerparams.cpp
+
+#include <config.h>
+ +
+#include <cassert>
+
+#include <cstddef>
+
+#include <stdexcept>
+
+#include <type_traits>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file blackoilpolymerparams.hpp
+
+#include <opm/material/common/Tabulated1DFunction.hpp>
+
+#include <opm/material/common/IntervalTabulated2DFunction.hpp>
+
+#include <map>
+
+#include <vector>
+

Contains the parameters required to extend the black-oil model by polymer.

+
+ +
+
+file blackoilsolventparams.cpp
+
+#include <config.h>
+ +
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file blackoilsolventparams.hpp
+
+#include <opm/material/fluidsystems/blackoilpvt/SolventPvt.hpp>
+
+#include <opm/material/fluidsystems/blackoilpvt/Co2GasPvt.hpp>
+
+#include <opm/material/fluidsystems/blackoilpvt/H2GasPvt.hpp>
+
+#include <opm/material/fluidsystems/blackoilpvt/BrineCo2Pvt.hpp>
+
+#include <opm/material/fluidsystems/blackoilpvt/BrineH2Pvt.hpp>
+
+#include <opm/material/common/Tabulated1DFunction.hpp>
+

Contains the parameters required to extend the black-oil model by solvents.

+
+ +
+
+file restart.cpp
+
+#include <config.h>
+ +
+ +
+
+file restart.hpp
+
+#include <dune/geometry/dimension.hh>
+
+#include <dune/grid/common/rangegenerators.hh>
+
+#include <fstream>
+
+#include <iostream>
+
+#include <sstream>
+
+#include <stdexcept>
+
+#include <string>
+

Load or save a state of a problem to/from the harddisk.

+
+ +
+
+file vtkblackoilenergymodule.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <opm/material/densead/Math.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+ +
+#include <opm/models/io/vtkmultiwriter.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+

VTK output module for the black oil model’s energy related quantities.

+
+ +
+
+file vtkblackoilenergyparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkblackoilenergyparams.hpp
+

VTK output module for the black oil model’s energy related quantities.

+
+ +
+
+file vtkblackoilmicpmodule.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <opm/material/densead/Math.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+ +
+#include <opm/models/io/vtkmultiwriter.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+

VTK output module for the MICP model’s related quantities.

+
+ +
+
+file vtkblackoilmicpparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkblackoilmicpparams.hpp
+

VTK output module for the MICP model’s related quantities.

+
+ +
+
+file vtkblackoilmodule.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <opm/material/densead/Math.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+ +
+#include <opm/models/io/vtkmultiwriter.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+
+#include <algorithm>
+
+#include <type_traits>
+

VTK output module for the black oil model’s parameters.

+
+ +
+
+file vtkblackoilparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkblackoilparams.hpp
+

VTK output module for the black oil model’s parameters.

+
+ +
+
+file vtkblackoilpolymermodule.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <opm/material/densead/Math.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+ +
+#include <opm/models/io/vtkmultiwriter.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+

VTK output module for the black oil model’s polymer related quantities.

+
+ +
+
+file vtkblackoilpolymerparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkblackoilpolymerparams.hpp
+

VTK output module for the black oil model’s polymer related quantities.

+
+ +
+
+file vtkblackoilsolventmodule.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <opm/material/densead/Math.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+ +
+#include <opm/models/io/vtkmultiwriter.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+

VTK output module for the black oil model’s solvent related quantities.

+
+ +
+
+file vtkblackoilsolventparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkblackoilsolventparams.hpp
+

VTK output module for the black oil model’s solvent related quantities.

+
+ +
+
+file vtkcompositionmodule.hpp
+
+#include <opm/material/common/MathToolbox.hpp>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+ +
+#include <opm/models/io/vtkmultiwriter.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+

VTK output module for the fluid composition.

+

This module deals with the following quantities:

    +
  • Mole fraction of a component in a fluid phase

  • +
  • Mass fraction of a component in a fluid phase

  • +
  • Molarity (i.e. molar concentration) of a component in a fluid phase

  • +
  • Fugacity of all components

  • +
  • FugacityCoefficient of all components in all phases

  • +
+

+
+ +
+
+file vtkcompositionparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkcompositionparams.hpp
+

VTK output module for the fluid composition.

+

This module deals with the following quantities:

    +
  • Mole fraction of a component in a fluid phase

  • +
  • Mass fraction of a component in a fluid phase

  • +
  • Molarity (i.e. molar concentration) of a component in a fluid phase

  • +
  • Fugacity of all components

  • +
  • FugacityCoefficient of all components in all phases

  • +
+

+
+ +
+
+file vtkdiffusionmodule.hpp
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/material/densead/Math.hpp>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+ +
+#include <opm/models/io/vtkmultiwriter.hh>
+
+#include <opm/models/utils/propertysystem.hh>
+ +

VTK output module for quantities which make sense for models which incorperate molecular diffusion.

+

This module deals with the following quantities:

    +
  • Molecular diffusion coefficients of all components in all fluid phases

  • +
  • Effective molecular diffusion coefficients of the porous medium of all components in all fluid phases

  • +
+

+
+ +
+
+file vtkdiffusionparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkdiffusionparams.hpp
+

VTK output module for quantities which make sense for models which incorperate molecular diffusion.

+

This module deals with the following quantities:

    +
  • Molecular diffusion coefficients of all components in all fluid phases

  • +
  • Effective molecular diffusion coefficients of the porous medium of all components in all fluid phases

  • +
+

+
+ +
+
+file vtkdiscretefracturemodule.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <opm/material/common/Valgrind.hpp>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+ +
+#include <opm/models/io/vtkmultiwriter.hh>
+
+#include <opm/models/utils/propertysystem.hh>
+ +
+#include <algorithm>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <cstdio>
+
+#include <cstddef>
+

VTK output module for quantities which make sense for all models which deal with discrete fractures in porous media.

+

This module deals with the following quantities:

    +
  • Saturations of all fluid phases in the fracture

  • +
  • Mobilities of all fluid phases in the fracture

  • +
  • Relative permeabilities of all fluid phases in the fracture

  • +
  • Porosity of the medium in the fracture

  • +
  • Norm of the intrinsic permeability of the medium in the fracture

  • +
+

+
+ +
+
+file vtkdiscretefractureparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkdiscretefractureparams.hpp
+

VTK output module for quantities which make sense for all models which deal with discrete fractures in porous media.

+

This module deals with the following quantities:

    +
  • Saturations of all fluid phases in the fracture

  • +
  • Mobilities of all fluid phases in the fracture

  • +
  • Relative permeabilities of all fluid phases in the fracture

  • +
  • Porosity of the medium in the fracture

  • +
  • Norm of the intrinsic permeability of the medium in the fracture

  • +
+

+
+ +
+
+file vtkenergymodule.hpp
+
+#include <opm/material/common/MathToolbox.hpp>
+
+#include <opm/models/io/baseoutputmodule.hh>
+ +
+#include <opm/models/io/vtkmultiwriter.hh>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+

VTK output module for quantities which make sense for models which assume thermal equilibrium.

+

This module deals with the following quantities:

    +
  • Specific enthalpy of all fluid phases

  • +
  • Specific internal energy of all fluid phases

  • +
  • Volumetric internal energy of the solid phase

  • +
  • Total thermal conductivity, i.e. the conductivity of the solid and all fluid phases combined

  • +
+

+
+ +
+
+file vtkenergyparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkenergyparams.hpp
+

VTK output module for quantities which make sense for models which assume thermal equilibrium.

+

This module deals with the following quantities:

    +
  • Specific enthalpy of all fluid phases

  • +
  • Specific internal energy of all fluid phases

  • +
  • Volumetric internal energy of the solid phase

  • +
  • Total thermal conductivity, i.e. the conductivity of the solid and all fluid phases combined

  • +
+

+
+ +
+
+file vtkmultiphasemodule.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <opm/material/common/MathToolbox.hpp>
+
+#include <opm/material/common/Valgrind.hpp>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+ +
+#include <opm/models/io/vtkmultiwriter.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+
+#include <algorithm>
+
+#include <array>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <cstddef>
+
+#include <cstdio>
+

VTK output module for quantities which make sense for all models which deal with multiple fluid phases in porous media that don’t use flashy concepts like interfacial area.

+

This module deals with the following quantities:

    +
  • Pressures of all fluid phases

  • +
  • Densities of all fluid phases

  • +
  • Saturations of all fluid phases

  • +
  • Mobilities of all fluid phases

  • +
  • Relative permeabilities of all fluid phases

  • +
  • Viscosities of all fluid phases

  • +
  • Average molar masses of all fluid phases

  • +
  • Porosity of the medium

  • +
  • Norm of the intrinsic permeability of the medium

  • +
+

+
+ +
+
+file vtkmultiphaseparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkmultiphaseparams.hpp
+

VTK output module for quantities which make sense for all models which deal with multiple fluid phases in porous media that don’t use flashy concepts like interfacial area.

+

This module deals with the following quantities:

    +
  • Pressures of all fluid phases

  • +
  • Densities of all fluid phases

  • +
  • Saturations of all fluid phases

  • +
  • Mobilities of all fluid phases

  • +
  • Relative permeabilities of all fluid phases

  • +
  • Viscosities of all fluid phases

  • +
  • Average molar masses of all fluid phases

  • +
  • Porosity of the medium

  • +
  • Norm of the intrinsic permeability of the medium

  • +
+

+
+ +
+
+file vtkphasepresencemodule.hpp
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+ +
+#include <opm/models/io/vtkmultiwriter.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+

VTK output module for the fluid composition.

+
+ +
+
+file vtkphasepresenceparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkphasepresenceparams.hpp
+

VTK output module for the fluid composition.

+
+ +
+
+file vtkprimaryvarsmodule.hpp
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+
+#include <opm/models/io/vtkmultiwriter.hh>
+ + +
+#include <opm/models/utils/propertysystem.hh>
+

VTK output module for the fluid composition.

+
+ +
+
+file vtkprimaryvarsparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkprimaryvarsparams.hpp
+

VTK output module for the fluid composition.

+
+ +
+
+file vtkptflashmodule.hpp
+
+#include <opm/material/common/MathToolbox.hpp>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+
+#include <opm/models/io/vtkmultiwriter.hh>
+ + +
+#include <opm/models/utils/propertysystem.hh>
+

VTK output module for the PT Flash calculation This module deals with the following quantities: K, equilibrium ratio for all the components L, liquid fraction in the two-phase system.

+
+ +
+
+file vtkptflashparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtkptflashparams.hpp
+

VTK output module for the PT Flash calculation This module deals with the following quantities: K, equilibrium ratio for all the components L, liquid fraction in the two-phase system.

+
+ +
+
+file vtktemperaturemodule.hpp
+
+#include <opm/material/common/MathToolbox.hpp>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+
+#include <opm/models/io/vtkmultiwriter.hh>
+ + +
+#include <opm/models/utils/propertysystem.hh>
+

VTK output module for the temperature in which assume thermal equilibrium.

+
+ +
+
+file vtktemperatureparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file vtktemperatureparams.hpp
+

VTK output module for the temperature in which assume thermal equilibrium.

+
+ +
+
+file newtonmethodparams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file newtonmethodparams.hpp
+
+ +
+
+file tasklets.cpp
+
+#include <config.h>
+ +
+#include <atomic>
+
+#include <condition_variable>
+
+#include <iostream>
+
+#include <mutex>
+
+#include <queue>
+
+#include <stdexcept>
+
+#include <thread>
+
+ +
+
+file tasklets.hpp
+
+#include <atomic>
+
+#include <condition_variable>
+
+#include <memory>
+
+#include <mutex>
+
+#include <queue>
+
+#include <thread>
+

Provides a mechanism to dispatch work to separate threads.

+
+ +
+
+file threadmanager.cpp
+
+#include <config.h>
+ +
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+ +
+ +
+
+file threadmanager.hpp
+

Simplifies multi-threaded capabilities.

+
+ +
+
+file parametersystem.cpp
+
+#include <config.h>
+ +
+#include <dune/common/parametertree.hh>
+ +
+#include <algorithm>
+
+#include <charconv>
+
+#include <fstream>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <sys/ioctl.h>
+
+#include <unistd.h>
+

This file provides the infrastructure to retrieve run-time parameters.

+

Internally, runtime parameters are implemented using Dune::ParameterTree with the default value taken from the parameter definition.

+
+ +
+
+file parametersystem.hpp
+
+#include <dune/common/classname.hh>
+
+#include <cstring>
+
+#include <functional>
+
+#include <set>
+
+#include <sstream>
+
+#include <string>
+
+#include <type_traits>
+
+#include <vector>
+

This file provides the infrastructure to retrieve run-time parameters.

+

Internally, runtime parameters are implemented using Dune::ParameterTree with the default value taken from the parameter definition.

+
+ +
+
+file simulatorutils.cpp
+
+#include <config.h>
+ +
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+ +
+#include <cmath>
+
+#include <fstream>
+
+#include <iomanip>
+
+#include <sstream>
+
+#include <sys/stat.h>
+
+#include <unistd.h>
+
+#include <vector>
+
+ +
+
+file simulatorutils.hpp
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file terminal.cpp
+
+#include <config.h>
+ +
+#include <csignal>
+
+#include <iostream>
+
+#include <string.h>
+
+#include <sys/ioctl.h>
+
+#include <unistd.h>
+
+ +
+
+file terminal.hpp
+
+#include <string>
+
+ +
+
+file timer.cpp
+
+#include <config.h>
+ +
+ +
+
+file timer.hpp
+
+#include <chrono>
+

Provides an encapsulation to measure the system time.

+

This means the wall clock time used by the simulation, the CPU time used by all threads of a single process and the CPU time used by the overall simulation. (i.e., the time used by all threads of all involved processes.)

+
+ +
+
+file AquiferAnalytical.hpp
+
+#include <dune/grid/common/partitionset.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/input/eclipse/EclipseState/Aquifer/Aquancon.hpp>
+
+#include <opm/material/common/MathToolbox.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/material/densead/Math.hpp>
+
+#include <opm/material/fluidstates/BlackOilFluidState.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/utils/basicproperties.hh>
+
+#include <opm/output/data/Aquifer.hpp>
+ + +
+#include <algorithm>
+
+#include <cmath>
+
+#include <cstddef>
+
+#include <limits>
+
+#include <numeric>
+
+#include <optional>
+
+#include <vector>
+
+ +
+
+file AquiferCarterTracy.hpp
+
+#include <opm/common/utility/numeric/linearInterpolation.hpp>
+
+#include <opm/input/eclipse/EclipseState/Aquifer/AquiferCT.hpp>
+
+#include <opm/output/data/Aquifer.hpp>
+ +
+#include <cstddef>
+
+#include <stdexcept>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file AquiferConstantFlux.hpp
+
+
+#include <opm/input/eclipse/EclipseState/Aquifer/Aquancon.hpp>
+
+#include <opm/input/eclipse/EclipseState/Aquifer/AquiferFlux.hpp>
+
+#include <opm/material/common/MathToolbox.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <cassert>
+
+#include <numeric>
+
+#include <vector>
+
+ +
+
+file AquiferFetkovich.hpp
+
+
+#include <opm/input/eclipse/EclipseState/Aquifer/Aquifetp.hpp>
+
+#include <opm/output/data/Aquifer.hpp>
+
+#include <stdexcept>
+
+#include <vector>
+
+ +
+
+file AquiferGridUtils.hpp
+
+#include <opm/grid/CpGrid.hpp>
+
+#include <algorithm>
+
+#include <vector>
+
+ +
+
+file AquiferInterface.hpp
+
+#include <opm/models/common/multiphasebaseproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+
+#include <opm/output/data/Aquifer.hpp>
+
+ +
+
+file AquiferNumerical.hpp
+
+#include <dune/grid/common/partitionset.hh>
+
+#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp>
+
+#include <opm/material/common/MathToolbox.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/output/data/Aquifer.hpp>
+ + +
+#include <algorithm>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <vector>
+
+ +
+
+file BlackoilAquiferModel.hpp
+
+#include <opm/input/eclipse/EclipseState/Aquifer/Aquancon.hpp>
+
+#include <opm/input/eclipse/EclipseState/Aquifer/AquiferCT.hpp>
+
+#include <opm/input/eclipse/EclipseState/Aquifer/Aquifetp.hpp>
+
+#include <opm/output/data/Aquifer.hpp>
+ + + + + +
+#include <opm/material/densead/Math.hpp>
+
+#include <vector>
+
+#include <type_traits>
+
+#include <string_view>
+ +
+ +
+
+file BlackoilAquiferModel_impl.hpp
+
+#include <config.h>
+ + +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <string_view>
+
+ +
+
+file SupportsFaceTag.hpp
+
+ +
+
+file ActionHandler.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/utility/TimeService.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/ActionContext.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/Actions.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/ActionX.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/SimulatorUpdate.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/State.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellMatcher.hpp>
+ + + +
+#include <chrono>
+
+#include <cstddef>
+
+#include <ctime>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <vector>
+
+#include <fmt/chrono.h>
+
+#include <fmt/format.h>
+
+#include <fmt/ranges.h>
+
+ +
+
+file ActionHandler.hpp
+
+
+#include <functional>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <vector>
+
+ +
+
+file AluGridCartesianIndexMapper.hpp
+
+#include <dune/alugrid/grid.hh>
+
+#include <dune/alugrid/3d/gridview.hh>
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <dune/grid/common/datahandleif.hh>
+
+#include <dune/grid/utility/persistentcontainer.hh>
+
+#include <array>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <vector>
+
+ +
+
+file AluGridCartesianIndexMapper_BACKUP_46117.hpp
+
+#include <dune/alugrid/grid.hh>
+
+#include <dune/alugrid/3d/gridview.hh>
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <dune/grid/common/datahandleif.hh>
+
+#include <dune/grid/utility/persistentcontainer.hh>
+
+#include <array>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <vector>
+
+ +
+
+file AluGridCartesianIndexMapper_BASE_46117.hpp
+
+#include <dune/alugrid/grid.hh>
+
+#include <dune/alugrid/3d/gridview.hh>
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <dune/grid/common/datahandleif.hh>
+
+#include <dune/grid/utility/persistentcontainer.hh>
+
+#include <array>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <vector>
+
+ +
+
+file AluGridCartesianIndexMapper_LOCAL_46117.hpp
+
+#include <dune/alugrid/grid.hh>
+
+#include <dune/alugrid/3d/gridview.hh>
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <dune/grid/common/datahandleif.hh>
+
+#include <dune/grid/utility/persistentcontainer.hh>
+
+#include <array>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <vector>
+
+ +
+
+file AluGridCartesianIndexMapper_REMOTE_46117.hpp
+
+#include <dune/alugrid/grid.hh>
+
+#include <dune/alugrid/3d/gridview.hh>
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <dune/grid/common/datahandleif.hh>
+
+#include <dune/grid/utility/persistentcontainer.hh>
+
+#include <array>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <vector>
+
+ +
+
+file AluGridLevelCartesianIndexMapper.hpp
+
+#include <dune/alugrid/grid.hh>
+
+#include <opm/grid/common/LevelCartesianIndexMapper.hpp>
+ +
+#include <array>
+
+#include <memory>
+
+ +
+
+file AluGridVanguard.hpp
+
+#include <dune/alugrid/common/fromtogridfactory.hh>
+
+#include <dune/alugrid/dgf.hh>
+
+#include <dune/alugrid/grid.hh>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/grid/CpGrid.hpp>
+
+#include <opm/grid/cpgrid/LevelCartesianIndexMapper.hpp>
+
+#include <opm/models/common/multiphasebaseproperties.hh>
+ + + + + +
+#include <array>
+
+#include <cstddef>
+
+#include <memory>
+
+#include <tuple>
+
+#include <vector>
+

Helper class for grid instantiation of ECL file-format using problems.

+

This class uses Dune::ALUGrid as the simulation grid.

+
+ +
+
+file Banners.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+ +
+#include <fmt/format.h>
+
+#include <ctime>
+
+#include <iomanip>
+
+#include <iostream>
+
+#include <sstream>
+
+#include <sys/utsname.h>
+
+#include <thread>
+
+#include <unistd.h>
+
+ +
+
+file Banners.hpp
+
+#include <string>
+
+#include <string_view>
+
+ +
+
+file BaseAquiferModel.hpp
+
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+
+#include <opm/models/utils/basicproperties.hh>
+
+#include <opm/models/utils/propertysystem.hh>
+
+#include <opm/output/data/Aquifer.hpp>
+
+#include <stdexcept>
+

The base class which specifies the API of aquifer models.

+

This class only provides the API for the actual aquifer model, it does not do anything on its own.

+
+ +
+
+file BlackoilModel.hpp
+
+ + + + + + + + + + + + +
+#include <memory>
+
+#include <tuple>
+
+#include <vector>
+
+#include <fmt/format.h>
+ +
+ +
+
+file BlackoilModel_impl.hpp
+
+#include <config.h>
+ +
+#include <dune/common/timer.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+ + +
+#include <algorithm>
+
+#include <iomanip>
+
+#include <limits>
+
+#include <stdexcept>
+
+#include <sstream>
+
+#include <fmt/format.h>
+
+ +
+
+file BlackoilModelConvergenceMonitor.cpp
+
+#include <config.h>
+ +
+#include <algorithm>
+
+#include <cmath>
+
+#include <limits>
+
+ +
+
+file BlackoilModelConvergenceMonitor.hpp
+
+ +
+ +
+
+file BlackoilModelNldd.hpp
+
+#include <dune/common/timer.hh>
+
+#include <opm/grid/common/SubGridPart.hpp>
+ + + + + + + + + + + + + + +
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <array>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <cstddef>
+
+#include <filesystem>
+
+#include <memory>
+
+#include <numeric>
+
+#include <set>
+
+#include <sstream>
+
+#include <string>
+
+#include <type_traits>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file BlackoilModelParameters.cpp
+
+#include <config.h>
+ +
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+ +
+#include <algorithm>
+
+#include <stdexcept>
+
+ +
+
+file BlackoilModelParameters.hpp
+
+
+#include <string>
+
+ +
+
+file BlackoilModelProperties.hpp
+
+
+#include <tuple>
+
+ +
+
+file CollectDataOnIORank.cpp
+
+#include <config.h>
+ +
+#include <opm/grid/CpGrid.hpp>
+
+ +
+
+file CollectDataOnIORank.hpp
+
+#include <opm/grid/common/p2pcommunicator.hh>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
+
+#include <opm/output/data/Aquifer.hpp>
+
+#include <opm/output/data/Cells.hpp>
+
+#include <opm/output/data/Groups.hpp>
+
+#include <opm/output/data/Solution.hpp>
+
+#include <opm/output/data/Wells.hpp>
+ + +
+#include <array>
+
+#include <cstddef>
+
+#include <map>
+
+#include <set>
+
+#include <string>
+
+#include <type_traits>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file CollectDataOnIORank_impl.hpp
+
+
+#include <dune/common/version.hh>
+
+#include <dune/grid/common/gridenums.hh>
+
+#include <dune/grid/common/mcmgmapper.hh>
+
+#include <dune/grid/common/partitionset.hh>
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file CompositionalContainer.cpp
+
+#include <config.h>
+ +
+#include <opm/material/fluidsystems/GenericOilGasWaterFluidSystem.hpp>
+
+#include <opm/output/data/Solution.hpp>
+
+#include <algorithm>
+
+#include <tuple>
+
+#include <fmt/format.h>
+
+

Defines

+
+
+INSTANTIATE_COMP_THREEPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP_TWOPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP(NUM)
+
+ +
+
+ +
+
+file CompositionalContainer.hpp
+
+#include <array>
+
+#include <functional>
+
+#include <map>
+
+#include <string>
+
+#include <vector>
+

Output module for the results black oil model writing in ECL binary format.

+
+ +
+
+file ConvergenceOutputConfiguration.cpp
+
+
+#include <algorithm>
+
+#include <cstddef>
+
+#include <regex>
+
+#include <stdexcept>
+
+#include <string_view>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <utility>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+#include <fmt/ranges.h>
+
+ +
+
+file ConvergenceOutputConfiguration.hpp
+
+#include <cstddef>
+
+#include <string_view>
+
+ +
+
+file countGlobalCells.hpp
+
+
+#include <dune/grid/common/gridview.hh>
+
+#include <algorithm>
+
+#include <vector>
+
+ +
+
+file CpGridVanguard.hpp
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/models/common/multiphasebaseproperties.hh>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+ + + + +
+#include <array>
+
+#include <functional>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <tuple>
+
+#include <vector>
+

Helper class for grid instantiation of ECL file-format using problems.

+

This class uses Dune::CpGrid as the simulation grid.

+
+ +
+
+file DamarisParameters.cpp
+
+#include <config.h>
+ + +
+ +
+
+file DamarisParameters.hpp
+

Collects necessary output values and pass them to Damaris server processes.

+

Currently only passing through PRESSURE, GLOBAL_CELL_INDEX and MPI_RANK information. This class now passes through the 3D mesh information to Damaris to enable in situ visualization via Paraview or Ascent. And developed so that variables specified through the Eclipse input deck will be available to Damaris.

+
+ +
+
+file DamarisWriter.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <Damaris.h>
+
+#include <fmt/format.h>
+
+#include <limits>
+
+#include <stdexcept>
+
+ +
+
+file DamarisWriter.hpp
+
+#include <dune/grid/common/partitionset.hh>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+ + + + + + + + + + +
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <memory>
+
+#include <numeric>
+
+#include <string>
+
+#include <vector>
+
+#include <unordered_set>
+

Collects necessary output values and pass them to Damaris server processes.

+

Currently only passing through PRESSURE, GLOBAL_CELL_INDEX and MPI_RANK information. This class now passes through the 3D mesh information to Damaris to enable in situ visualization via Paraview or Ascent. And developed so that variables specified through the Eclipse input deck will be available to Damaris.

+
+ +
+
+file DummyGradientCalculator.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+
+#include <stdexcept>
+

This is a “dummy” gradient calculator which does not do anything.

+

The blackoil simulator does not need any gradients: Volume fluxes are calculated via pressure differences instead of pressure gradients (i.e., transmissibilities instead of permeabilities), and an energy equation and molecular diffusion are not supported.

+
+ +
+
+file EclGenericWriter.cpp
+
+#include <config.h>
+
+#include <opm/grid/CpGrid.hpp>
+
+#include <opm/grid/cpgrid/GridHelpers.hpp>
+ +
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file EclGenericWriter.hpp
+
+ + + +
+#include <map>
+
+#include <memory>
+
+#include <string>
+
+#include <utility>
+
+#include <vector>
+

Collects necessary output values and pass it to opm-common’s ECL output.

+

Caveats:

    +
  • For this class to do do anything meaningful, you will have to have the OPM module opm-common with ECL writing enabled.

  • +
  • The only DUNE grid which is currently supported is Dune::CpGrid from the OPM module “opm-grid”. Using another grid won’t fail at compile time but you will provoke a fatal exception as soon as you try to write an ECL output file.

  • +
  • This class requires to use the black oil model with the element centered finite volume discretization.

  • +
+

+
+ +
+
+file EclGenericWriter_impl.hpp
+
+#include <dune/grid/common/mcmgmapper.hh>
+
+#include <opm/grid/GridHelpers.hpp>
+
+#include <opm/grid/utility/cartesianToCompressed.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/RegionSetMatcher.hpp>
+
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/State.hpp>
+
+#include <opm/input/eclipse/Schedule/RPTConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/SummaryState.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQState.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellMatcher.hpp>
+
+#include <opm/input/eclipse/Units/UnitSystem.hpp>
+
+#include <opm/output/eclipse/EclipseIO.hpp>
+
+#include <opm/output/eclipse/RestartValue.hpp>
+
+#include <opm/output/eclipse/Summary.hpp>
+ +
+#include <algorithm>
+
+#include <array>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <functional>
+
+#include <map>
+
+#include <memory>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file EclWriter.hpp
+
+#include <dune/grid/common/partitionset.hh>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/Schedule/RPTConfig.hpp>
+
+#include <opm/input/eclipse/Units/UnitSystem.hpp>
+
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/output/eclipse/Inplace.hpp>
+
+#include <opm/output/eclipse/RestartValue.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/common/multiphasebaseproperties.hh>
+ + + + + + + + +
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+#include <limits>
+
+#include <map>
+
+#include <memory>
+
+#include <optional>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <utility>
+
+#include <vector>
+

Collects necessary output values and pass it to opm-common’s ECL output.

+

Caveats:

    +
  • For this class to do do anything meaningful, you will have to have the OPM module opm-common with ECL writing enabled.

  • +
  • The only DUNE grid which is currently supported is Dune::CpGrid from the OPM module “opm-grid”. Using another grid won’t fail at compile time but you will provoke a fatal exception as soon as you try to write an ECL output file.

  • +
  • This class requires to use the black oil model with the element centered finite volume discretization.

  • +
+

+
+ +
+
+file EquilibrationHelpers.cpp
+
+#include <config.h>
+ +
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file EquilibrationHelpers.hpp
+
+#include <opm/material/common/Tabulated1DFunction.hpp>
+
+#include <opm/input/eclipse/EclipseState/InitConfig/Equil.hpp>
+
+#include <memory>
+
+#include <vector>
+

Auxiliary routines that to solve the ODEs that emerge from the hydrostatic equilibrium problem.

+
+ +
+
+file EquilibrationHelpers_impl.hpp
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/utility/numeric/RootFinders.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp>
+
+#include <opm/material/fluidstates/SimpleModularFluidState.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+ +
+#include <fmt/format.h>
+
+ +
+
+file InitStateEquil.cpp
+
+#include <config.h>
+ +
+#include <opm/grid/CpGrid.hpp>
+
+

Defines

+
+
+INSTANTIATE_COMP(T, GridView, Mapper)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file InitStateEquil.hpp
+
+#include <opm/models/utils/propertysystem.hh>
+
+#include <opm/material/common/Tabulated1DFunction.hpp>
+
+#include <opm/material/fluidstates/SimpleModularFluidState.hpp>
+ +
+#include <array>
+
+#include <cstddef>
+
+#include <memory>
+
+#include <utility>
+
+#include <vector>
+
+#include <string>
+

Routines that actually solve the ODEs that emerge from the hydrostatic equilibrium problem.

+
+ +
+
+file InitStateEquil_impl.hpp
+
+#include <dune/grid/common/mcmgmapper.hh>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/grid/utility/RegionMapping.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/RsvdTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/RvvdTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/RvwvdTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/PbvdTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/PdvdTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/SaltvdTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/RtempvdTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/SaltpvdTable.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+ + + +
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <limits>
+
+#include <stdexcept>
+
+ +
+
+file EquilInitializer.hpp
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp>
+
+#include <opm/material/fluidstates/BlackOilFluidState.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+
+#include <opm/models/utils/propertysystem.hh>
+ +
+#include <vector>
+

Computes the initial condition based on the EQUIL keyword from ECL.

+

So far, it uses the “initStateEquil()” function from opm-core. Since this method is very much glued into the opm-core data structures, it should be reimplemented in the medium to long term for some significant memory savings and less significant performance improvements.

+
+ +
+
+file ExtboContainer.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Units/UnitSystem.hpp>
+
+#include <opm/output/data/Solution.hpp>
+
+#include <algorithm>
+
+#include <array>
+
+#include <string>
+
+#include <tuple>
+
+ +
+
+file ExtboContainer.hpp
+
+#include <vector>
+

Output module for the results black oil model writing in ECL binary format.

+
+ +
+
+file ExtraConvergenceOutputThread.cpp
+
+ + +
+#include <algorithm>
+
+#include <array>
+
+#include <cassert>
+
+#include <condition_variable>
+
+#include <cstddef>
+
+#include <filesystem>
+
+#include <fstream>
+
+#include <functional>
+
+#include <iomanip>
+
+#include <iterator>
+
+#include <limits>
+
+#include <mutex>
+
+#include <numeric>
+
+#include <optional>
+
+#include <ostream>
+
+#include <sstream>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <string_view>
+
+#include <tuple>
+
+#include <type_traits>
+
+#include <unordered_map>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file ExtraConvergenceOutputThread.hpp
+
+
+#include <condition_variable>
+
+#include <functional>
+
+#include <memory>
+
+#include <mutex>
+
+#include <string_view>
+
+#include <vector>
+
+ +
+
+file FemCpGridCompat.hpp
+

This file ensures that flow can be compiled in the presence of dune-fem.

+

It implements a few work-arounds for some incompatibilities with the Dune grid interface of CpGrid. A better way would be to make CpGrid conforming.

+
+ +
+
+file FIBlackoilModel.hpp
+
+#include <opm/models/blackoil/blackoilmodel.hh>
+
+#include <opm/models/utils/propertysystem.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/grid/CpGrid.hpp>
+
+#include <opm/grid/utility/ElementChunks.hpp>
+ + +
+#include <cstddef>
+
+#include <stdexcept>
+
+#include <type_traits>
+
+ +
+
+file FIPContainer.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/material/fluidsystems/BlackOilDefaultFluidSystemIndices.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/material/fluidsystems/GenericOilGasWaterFluidSystem.hpp>
+
+#include <opm/output/data/Solution.hpp>
+
+#include <algorithm>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+INSTANTIATE_COMP_THREEPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP_TWOPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP(NUM)
+
+ +
+
+ +
+
+file FIPContainer.hpp
+
+#include <opm/output/eclipse/Inplace.hpp>
+
+#include <array>
+
+#include <cstddef>
+
+#include <map>
+
+#include <unordered_map>
+
+#include <string>
+
+#include <vector>
+

Output module for the results black oil model writing in ECL binary format.

+
+ +
+
+file FlowBaseProblemProperties.hpp
+
+#include <opm/material/thermal/EclThermalLawManager.hpp>
+
+#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
+
+#include <opm/models/utils/propertysystem.hh>
+ + + + + + +
+#include <tuple>
+
+ +
+
+file FlowBaseVanguard.hpp
+
+#include <dune/grid/common/partitionset.hh>
+
+#include <opm/grid/common/GridEnums.hpp>
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <opm/grid/LookUpCellCentroid.hh>
+
+#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+
+#include <opm/models/io/basevanguard.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+ + +
+#include <array>
+
+#include <cstddef>
+
+#include <unordered_map>
+
+#include <vector>
+

Helper class for grid instantiation of ECL file-format using problems.

+
+ +
+
+file FlowGenericProblem.cpp
+
+#include <config.h>
+
+#include <dune/grid/common/defaultgridview.hh>
+
+#include <dune/grid/common/gridview.hh>
+
+#include <opm/grid/CpGrid.hpp>
+
+#include <opm/grid/LookUpData.hh>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+ +
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file FlowGenericProblem.hpp
+
+#include <opm/material/common/UniformXTabulated2DFunction.hpp>
+
+#include <opm/material/common/Tabulated1DFunction.hpp>
+ +
+#include <array>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <string>
+
+#include <vector>
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+ +
+
+file FlowGenericProblem_impl.hpp
+
+#include <config.h>
+ +
+#include <dune/common/parametertree.hh>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/OverburdTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/RockwnodTable.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/utils/basicparameters.hh>
+ + + + +
+#include <boost/date_time.hpp>
+
+#include <fmt/format.h>
+
+#include <fmt/ranges.h>
+
+#include <iostream>
+
+#include <stdexcept>
+
+ +
+
+file FlowGenericVanguard.cpp
+
+#include <config.h>
+ +
+#include <dune/common/version.hh>
+
+#include <dune/common/parallel/mpihelper.hh>
+
+#include <dune/common/timer.hh>
+
+#include <opm/common/utility/MemPacker.hpp>
+
+#include <opm/common/utility/Serializer.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/utility/TimeService.hpp>
+
+#include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Runspec.hpp>
+
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/input/eclipse/Python/Python.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/Actions.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/ASTNode.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/State.hpp>
+
+#include <opm/input/eclipse/Schedule/GasLiftOpt.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GConSale.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GroupEconProductionLimits.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GConSump.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GSatProd.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GuideRateConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Network/Balance.hpp>
+
+#include <opm/input/eclipse/Schedule/Network/ExtNetwork.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+
+#include <opm/input/eclipse/Schedule/OilVaporizationProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp>
+
+#include <opm/input/eclipse/Schedule/RFTConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/RPTConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/SummaryState.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQActive.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQASTNode.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQParams.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQState.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/NameOrder.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WDFAC.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellBrineProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellEconProductionLimits.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellFoamProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellFractureSeeds.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellMICPProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellPolymerProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTracerProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WListManager.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WVFPDP.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WVFPEXP.hpp>
+
+#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
+ + + +
+#include <algorithm>
+
+#include <filesystem>
+
+#include <stdexcept>
+
+#include <fmt/format.h>
+
+ +
+
+file FlowGenericVanguard.hpp
+
+#include <dune/common/parallel/communication.hh>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/grid/common/GridEnums.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
+ +
+#include <cassert>
+
+#include <memory>
+
+#include <optional>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <utility>
+
+#include <vector>
+

Helper class for grid instantiation of ECL file-format using problems.

+
+ +
+
+file FlowMain.hpp
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/IOConfig/IOConfig.hpp>
+
+#include <opm/input/eclipse/EclipseState/InitConfig/InitConfig.hpp>
+
+#include <opm/models/utils/start.hh>
+
+ +
+
+file FlowProblem.hpp
+
+#include <dune/common/version.hh>
+
+#include <dune/common/fvector.hh>
+
+#include <dune/common/fmatrix.hh>
+
+#include <opm/common/utility/TimeService.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+
+#include <opm/material/common/ConditionalStorage.hpp>
+
+#include <opm/material/common/Valgrind.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp>
+
+#include <opm/material/thermal/EclThermalLawManager.hpp>
+
+#include <opm/models/common/directionalmobility.hh>
+
+#include <opm/models/utils/pffgridvector.hh>
+
+#include <opm/models/discretization/ecfv/ecfvdiscretization.hh>
+
+#include <opm/output/eclipse/EclipseIO.hpp>
+ + + + + + + + + + + + + + +
+#include <opm/utility/CopyablePtr.hpp>
+
+#include <algorithm>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <set>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <vector>
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+ +
+
+file FlowProblemBlackoil.hpp
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/material/fluidsystems/blackoilpvt/DryGasPvt.hpp>
+
+#include <opm/material/fluidsystems/blackoilpvt/WetGasPvt.hpp>
+
+#include <opm/material/fluidsystems/blackoilpvt/LiveOilPvt.hpp>
+
+#include <opm/material/fluidsystems/blackoilpvt/DeadOilPvt.hpp>
+
+#include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityOilPvt.hpp>
+
+#include <opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.hpp>
+
+#include <opm/models/blackoil/blackoillocalresidualtpfa.hh>
+
+#include <opm/output/eclipse/EclipseIO.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+ + + + + + + + +
+#include <algorithm>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <string_view>
+
+#include <vector>
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+ +
+
+file FlowProblemBlackoilProperties.hpp
+
+#include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp>
+
+#include <opm/models/utils/propertysystem.hh>
+ + + + + +
+#include <tuple>
+
+ +
+
+file FlowProblemComp.hpp
+
+ + +
+#include <opm/material/fluidstates/CompositionalFluidState.hpp>
+
+#include <opm/material/thermal/EclThermalLawManager.hpp>
+
+#include <opm/input/eclipse/EclipseState/Compositional/CompositionalConfig.hpp>
+
+#include <algorithm>
+
+#include <functional>
+
+#include <set>
+
+#include <string>
+
+#include <vector>
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+ +
+
+file FlowProblemCompProperties.hpp
+
+#include <opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp>
+
+#include <opm/models/utils/propertysystem.hh>
+ +
+#include <tuple>
+
+ +
+
+file FlowProblemParameters.cpp
+
+#include <config.h>
+ +
+#include <opm/models/common/multiphasebaseparameters.hh>
+ + + +
+ +
+
+file FlowProblemParameters.hpp
+
+#include <opm/input/eclipse/Parser/ParserKeywords/E.hpp>
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+ +
+
+file FlowsContainer.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Units/UnitSystem.hpp>
+
+#include <opm/material/fluidsystems/BlackOilDefaultFluidSystemIndices.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/material/fluidsystems/GenericOilGasWaterFluidSystem.hpp>
+
+#include <opm/output/data/Solution.hpp>
+
+#include <algorithm>
+
+#include <tuple>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+INSTANTIATE_COMP_THREEPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP_TWOPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP(NUM)
+
+ +
+
+ +
+
+file FlowsContainer.hpp
+
+#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
+ +
+#include <array>
+
+#include <cstddef>
+
+#include <map>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file FlowsData.hpp
+
+#include <cstddef>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file FlowThresholdPressure.hpp
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/material/densead/Math.hpp>
+
+#include <opm/models/common/multiphasebaseproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+
+#include <opm/models/utils/propertysystem.hh>
+ +
+#include <algorithm>
+

This class calculates the threshold pressure for grid faces according to the Eclipse Reference Manual.

+

If the difference of the pressure potential between two cells is below the threshold pressure, the pressure potential difference is assumed to be zero, if it is larger than the threshold pressure, it is reduced by the threshold pressure.

+
+ +
+
+file FlowUtils.cpp
+
+ + +
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/utility/String.hpp>
+
+#include <opm/models/common/multiphasebaseparameters.hh>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+ + + + + + + +
+#include <opm/models/utils/basicparameters.hh>
+ + + + +
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <filesystem>
+
+#include <fstream>
+
+#include <string>
+
+#include <unistd.h>
+
+#include <vector>
+
+ +
+
+file FlowUtils.hpp
+
+#include <functional>
+
+#include <set>
+
+#include <string_view>
+
+ +
+
+file GenericCpGridVanguard.cpp
+
+#include <config.h>
+ +
+#include <dune/grid/common/mcmgmapper.hh>
+
+#include <dune/grid/common/partitionset.hh>
+
+#include <dune/common/version.hh>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/utility/ActiveGridCells.hpp>
+
+#include <opm/grid/cpgrid/GridHelpers.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/LgrCollection.hpp>
+ + + + +
+#include <cassert>
+
+#include <fstream>
+
+#include <iterator>
+
+#include <numeric>
+
+#include <optional>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file GenericCpGridVanguard.hpp
+
+#include <opm/grid/CpGrid.hpp>
+
+#include <opm/grid/cpgrid/LevelCartesianIndexMapper.hpp>
+ +
+#include <functional>
+
+#include <memory>
+
+#include <optional>
+
+#include <vector>
+

Helper class for grid instantiation of ECL file-format using problems.

+

This class uses Dune::CpGrid as the simulation grid.

+
+ +
+
+file GenericOutputBlackoilModule.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/utility/Visitor.hpp>
+
+#include <opm/grid/common/CommunicationUtils.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclHysteresisConfig.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/material/fluidsystems/BlackOilDefaultFluidSystemIndices.hpp>
+
+#include <opm/material/fluidsystems/GenericOilGasWaterFluidSystem.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Runspec.hpp>
+
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/RFTConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/RPTConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/SummaryState.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+ +
+#include <opm/output/data/Solution.hpp>
+ +
+#include <algorithm>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <initializer_list>
+
+#include <string>
+
+#include <string_view>
+
+#include <tuple>
+
+#include <utility>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+INSTANTIATE_COMP_THREEPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP_TWOPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP(NUM)
+
+ +
+
+ +
+
+file GenericOutputBlackoilModule.hpp
+
+#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
+
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/output/data/Wells.hpp>
+
+#include <opm/output/eclipse/Inplace.hpp>
+ + + + + + + + + + + + +
+#include <array>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <map>
+
+#include <optional>
+
+#include <unordered_map>
+
+#include <utility>
+
+#include <vector>
+

Output module for the results black oil model writing in ECL binary format.

+
+ +
+
+file GenericThresholdPressure.cpp
+
+#include <config.h>
+
+#include <opm/grid/CpGrid.hpp>
+ +
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file GenericThresholdPressure.hpp
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <opm/grid/LookUpData.hh>
+
+#include <vector>
+
+ +
+
+file GenericThresholdPressure_impl.hpp
+
+
+#include <dune/grid/common/mcmgmapper.hh>
+
+#include <dune/grid/common/rangegenerators.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/Eqldims.hpp>
+
+#include <opm/input/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp>
+
+#include <opm/input/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp>
+
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <cstddef>
+
+#include <limits>
+
+#include <stdexcept>
+
+ +
+
+file GenericTracerModel.cpp
+
+#include <config.h>
+ +
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file GenericTracerModel.hpp
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <opm/input/eclipse/EclipseState/Phase.hpp>
+
+#include <opm/models/blackoil/blackoilmodel.hh>
+
+#include <opm/simulators/linalg/matrixblock.hh>
+ +
+#include <array>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <memory>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <vector>
+

A class which handles tracers as specified in by ECL.

+
+ +
+
+file GenericTracerModel_impl.hpp
+
+#include <dune/istl/operators.hh>
+
+#include <dune/istl/solvers.hh>
+
+#include <dune/istl/schwarz.hh>
+
+#include <dune/istl/preconditioners.hh>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/grid/CpGrid.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/TracerVdTable.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTracerProperties.hpp>
+
+#include <opm/models/discretization/ecfv/ecfvstencil.hh>
+ +
+#include <opm/simulators/linalg/ilufirstelement.hh>
+ + +
+#include <fmt/format.h>
+
+#include <array>
+
+#include <functional>
+
+#include <memory>
+
+#include <set>
+
+#include <stdexcept>
+
+#include <string>
+

A class which handles tracers as specified in by ECL.

+
+ +
+
+file InterRegFlows.cpp
+
+
+#include <algorithm>
+
+#include <stdexcept>
+
+ +
+
+file InterRegFlows.hpp
+
+#include <opm/output/data/InterRegFlowMap.hpp>
+
+#include <algorithm>
+
+#include <cstddef>
+
+#include <string>
+
+#include <utility>
+
+#include <vector>
+

MPI-aware facility for converting collection of tuples of region ID pairs and associate flow rates into a sparse (CSR) adjacency matrix representation of a graph. Supports O(nnz) compression.

+
+ +
+
+file KeywordValidation.cpp
+
+#include <string>
+
+#include <type_traits>
+
+#include <fmt/format.h>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/utility/OpmInputError.hpp>
+
+#include <opm/input/eclipse/Deck/Deck.hpp>
+
+#include <opm/input/eclipse/Deck/DeckKeyword.hpp>
+
+#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
+
+#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
+
+#include <opm/input/eclipse/Parser/ParseContext.hpp>
+ +
+ +
+
+file KeywordValidation.hpp
+
+#include <opm/input/eclipse/Deck/DeckItem.hpp>
+
+#include <opm/common/OpmLog/KeywordLocation.hpp>
+ +
+#include <algorithm>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <initializer_list>
+
+#include <map>
+
+#include <optional>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <vector>
+
+ +
+
+file LogOutputHelper.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/SummaryState.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellEnums.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+
+#include <opm/output/eclipse/report/WellSpecification.hpp>
+ + +
+#include <algorithm>
+
+#include <cmath>
+
+#include <iomanip>
+
+#include <numeric>
+
+#include <sstream>
+
+#include <string_view>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file LogOutputHelper.hpp
+
+#include <opm/output/eclipse/Inplace.hpp>
+
+#include <cstddef>
+
+#include <map>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <vector>
+
+#include <boost/date_time.hpp>
+
+ +
+
+file Main.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Python/Python.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/State.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQState.hpp>
+ + +
+#include <iostream>
+
+#include <fcntl.h>
+
+#include <unistd.h>
+
+ +
+
+file Main.hpp
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/models/utils/propertysystem.hh>
+ + + + +
+#include <dune/common/parallel/mpihelper.hh>
+
+#include <cassert>
+
+#include <charconv>
+
+#include <cstdlib>
+
+#include <filesystem>
+
+#include <iostream>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <string_view>
+
+#include <type_traits>
+
+#include <utility>
+
+ +
+
+file MainDispatchDynamic.cpp
+
+#include <config.h>
+ +
+#include <flow/flow_blackoil.hpp>
+
+#include <flow/flow_blackoil_legacyassembly.hpp>
+
+#include <flow/flow_brine.hpp>
+
+#include <flow/flow_brine_precsalt_vapwat.hpp>
+
+#include <flow/flow_brine_saltprecipitation.hpp>
+
+#include <flow/flow_energy.hpp>
+
+#include <flow/flow_extbo.hpp>
+
+#include <flow/flow_foam.hpp>
+
+#include <flow/flow_gasoil.hpp>
+
+#include <flow/flow_gasoil_energy.hpp>
+
+#include <flow/flow_gasoildiffuse.hpp>
+
+#include <flow/flow_gaswater.hpp>
+
+#include <flow/flow_gaswater_brine.hpp>
+
+#include <flow/flow_gaswater_dissolution.hpp>
+
+#include <flow/flow_gaswater_dissolution_diffuse.hpp>
+
+#include <flow/flow_gaswater_energy.hpp>
+
+#include <flow/flow_gaswater_saltprec_energy.hpp>
+
+#include <flow/flow_gaswater_saltprec_vapwat.hpp>
+
+#include <flow/flow_gaswater_solvent.hpp>
+
+#include <flow/flow_micp.hpp>
+
+#include <flow/flow_oilwater.hpp>
+
+#include <flow/flow_oilwater_brine.hpp>
+
+#include <flow/flow_oilwater_polymer.hpp>
+
+#include <flow/flow_oilwater_polymer_injectivity.hpp>
+
+#include <flow/flow_onephase.hpp>
+
+#include <flow/flow_onephase_energy.hpp>
+
+#include <flow/flow_polymer.hpp>
+
+#include <flow/flow_solvent.hpp>
+
+#include <flow/flow_solvent_foam.hpp>
+
+#include <cstdlib>
+
+#include <iostream>
+
+ +
+
+file MechContainer.cpp
+
+#include <config.h>
+ +
+#include <opm/common/utility/Visitor.hpp>
+
+#include <opm/output/data/Solution.hpp>
+
+#include <algorithm>
+
+#include <array>
+
+#include <tuple>
+
+#include <variant>
+
+ +
+
+file MechContainer.hpp
+
+#include <dune/common/fvector.hh>
+ +
+#include <array>
+
+#include <cstddef>
+
+#include <map>
+
+#include <string>
+
+#include <vector>
+

Output module for the results black oil model writing in ECL binary format.

+
+ +
+
+file MICPContainer.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Units/UnitSystem.hpp>
+
+#include <opm/output/data/Solution.hpp>
+ +
+#include <algorithm>
+
+#include <array>
+
+#include <string>
+
+#include <tuple>
+
+ +
+
+file MICPContainer.hpp
+
+#include <vector>
+

Output module for the results black oil model writing in ECL binary format.

+
+ +
+
+file MixingRateControls.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <algorithm>
+
+#include <limits>
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file MixingRateControls.hpp
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/material/common/MathToolbox.hpp>
+
+#include <limits>
+
+#include <vector>
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+ +
+
+file NewTranFluxModule.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <dune/common/fmatrix.hh>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
+
+#include <opm/material/common/MathToolbox.hpp>
+
+#include <opm/material/common/Valgrind.hpp>
+
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/utils/signum.hh>
+
+#include <opm/models/blackoil/blackoillocalresidualtpfa.hh>
+
+#include <array>
+

This file contains the flux module which is used for flow problems.

+

This approach to fluxes is very specific to two-point flux approximation and applies what the Eclipse Technical Description calls the “NEWTRAN” transmissibility approach.

+
+ +
+
+file NlddReporting.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+ + + +
+#include <fmt/format.h>
+
+#include <sstream>
+
+#include <vector>
+
+ +
+
+file NlddReporting.hpp
+
+#include <dune/grid/common/gridenums.hh>
+
+#include <dune/grid/common/partitionset.hh>
+ + +
+#include <algorithm>
+
+#include <cmath>
+
+#include <filesystem>
+
+#include <fstream>
+
+#include <limits>
+
+#include <numeric>
+
+#include <string_view>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file NonlinearSolver.cpp
+
+#include <config.h>
+ +
+#include <dune/common/fvector.hh>
+
+#include <dune/istl/bvector.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <cmath>
+
+#include <stdexcept>
+
+

Defines

+
+
+INSTANTIATE(T, Size)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file NonlinearSolver.hpp
+
+#include <dune/common/fmatrix.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/Exceptions.hpp>
+ +
+#include <opm/models/nonlinear/newtonmethodproperties.hh>
+
+#include <opm/models/utils/propertysystem.hh>
+
+#include <opm/models/utils/basicproperties.hh>
+ + + +
+#include <memory>
+
+ +
+
+file OutputBlackoilModule.hpp
+
+#include <dune/common/fvector.hh>
+ +
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/utility/Visitor.hpp>
+
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/material/common/Valgrind.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
+
+#include <opm/material/fluidstates/BlackOilFluidState.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+
+#include <opm/output/data/Cells.hpp>
+
+#include <opm/output/eclipse/EclipseIO.hpp>
+
+#include <opm/output/eclipse/Inplace.hpp>
+ + + + +
+#include <algorithm>
+
+#include <array>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <type_traits>
+
+#include <utility>
+
+#include <vector>
+

Output module for the results black oil model writing in ECL binary format.

+
+ +
+
+file OutputCompositionalModule.hpp
+
+#include <dune/grid/common/gridenums.hh>
+ +
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/material/common/Valgrind.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/common/multiphasebaseproperties.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+ + + + +
+#include <algorithm>
+
+#include <cstddef>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <type_traits>
+
+#include <utility>
+
+#include <vector>
+

Output module for the results black oil model writing in ECL binary format.

+
+ +
+
+file OutputExtractor.hpp
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/utility/Visitor.hpp>
+
+#include <opm/material/common/Valgrind.hpp>
+
+#include <opm/models/common/multiphasebaseproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+
+#include <opm/models/utils/basicproperties.hh>
+
+#include <opm/models/utils/propertysystem.hh>
+
+#include <algorithm>
+
+#include <array>
+
+#include <unordered_map>
+
+#include <set>
+
+#include <variant>
+
+#include <vector>
+
+#include <fmt/format.h>
+

Output module for the results black oil model writing in ECL binary format.

+
+ +
+
+file partitionCells.cpp
+
+#include <config.h>
+ + + +
+#include <opm/grid/CpGrid.hpp>
+
+#include <opm/grid/polyhedralgrid.hh>
+
+#include <opm/common/utility/CSRGraphFromCoordinates.hpp>
+
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <filesystem>
+
+#include <fstream>
+
+#include <iterator>
+
+#include <numeric>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <string_view>
+
+#include <tuple>
+
+#include <type_traits>
+
+#include <unordered_map>
+
+#include <utility>
+
+#include <vector>
+
+

Defines

+
+
+InstantiatePartitionCells(Grid)
+
+ +
+
+

Typedefs

+
+
+using PolyGrid = Dune::PolyhedralGrid<3, 3, double>
+
+ +
+
+

Functions

+
+
+InstantiatePartitionCells(Dune::CpGrid)
+
+ +
+
+InstantiatePartitionCells(PolyGrid)
+
+ +
+
+ +
+
+file partitionCells.hpp
+
+#include <functional>
+
+#include <set>
+
+#include <string>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file PolyhedralGridVanguard.hpp
+
+#include <opm/grid/polyhedralgrid.hh>
+
+#include <opm/grid/polyhedralgrid/levelcartesianindexmapper.hh>
+
+#include <opm/models/common/multiphasebaseproperties.hh>
+ + +
+#include <array>
+
+#include <functional>
+
+#include <string>
+
+#include <tuple>
+
+#include <unordered_set>
+

Helper class for grid instantiation of ECL file-format using problems.

+

This class uses Dune::PolyhedralGrid as the simulation grid.

+
+ +
+
+file priVarsPacking.hpp
+
+#include <cstddef>
+
+ +
+
+file Pybind11Exporter.hpp
+
+#include <pybind11/pybind11.h>
+
+#include <pybind11/numpy.h>
+
+#include <pybind11/stl.h>
+
+ +
+
+file PyBlackOilSimulator.hpp
+
+#include <python/simulators/PyMain.hpp>
+ +
+#include <opm/models/utils/propertysystem.hh>
+ + + + + +
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <map>
+
+#include <memory>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file PyFluidState.hpp
+
+#include <opm/models/utils/propertysystem.hh>
+
+#include <exception>
+
+#include <iostream>
+
+#include <map>
+
+#include <memory>
+
+#include <string>
+
+#include <vector>
+
+#include “PyFluidState_impl.hpp
+
+ +
+
+file PyFluidState_impl.hpp
+
+#include <fmt/format.h>
+
+ +
+
+file PyMaterialState.hpp
+
+#include <opm/models/common/multiphasebaseproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+
+#include <opm/models/utils/basicproperties.hh>
+
+#include <opm/models/utils/propertysystem.hh>
+
+#include <cstddef>
+
+#include <memory>
+
+#include “PyMaterialState_impl.hpp
+
+ +
+
+file PyMaterialState_impl.hpp
+
+#include <fmt/format.h>
+
+ +
+
+file RegionPhasePVAverage.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/Grid/FieldProps.hpp>
+ +
+#include <algorithm>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <vector>
+
+ +
+
+file RegionPhasePVAverage.hpp
+
+
+#include <cstddef>
+
+#include <functional>
+
+#include <string>
+
+#include <string_view>
+
+#include <vector>
+
+ +
+
+file ReservoirCoupling.cpp
+
+#include <config.h>
+ + +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <fmt/format.h>
+
+ +
+
+file ReservoirCoupling.hpp
+
+#include <mpi.h>
+
+#include <cmath>
+
+#include <iostream>
+
+#include <memory>
+
+ +
+
+file ReservoirCouplingMaster.cpp
+
+#include <config.h>
+ + +
+#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp>
+
+#include <opm/input/eclipse/Schedule/ResCoup/MasterGroup.hpp>
+
+#include <opm/input/eclipse/Schedule/ResCoup/Slaves.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ +
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <filesystem>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file ReservoirCouplingMaster.hpp
+
+ +
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <mpi.h>
+
+#include <filesystem>
+
+#include <vector>
+
+ +
+
+file ReservoirCouplingSlave.cpp
+
+#include <config.h>
+ + +
+#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp>
+
+#include <opm/input/eclipse/Schedule/ResCoup/MasterGroup.hpp>
+
+#include <opm/input/eclipse/Schedule/ResCoup/Slaves.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ +
+#include <dune/common/parallel/mpitraits.hh>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file ReservoirCouplingSlave.hpp
+
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+ + +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <mpi.h>
+
+#include <vector>
+
+ +
+
+file ReservoirCouplingSpawnSlaves.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp>
+
+#include <opm/input/eclipse/Schedule/ResCoup/MasterGroup.hpp>
+
+#include <opm/input/eclipse/Schedule/ResCoup/Slaves.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ +
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <dune/common/parallel/mpitraits.hh>
+
+#include <filesystem>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file ReservoirCouplingSpawnSlaves.hpp
+
+ + +
+#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <mpi.h>
+
+#include <filesystem>
+
+#include <vector>
+
+ +
+
+file RFTContainer.cpp
+
+#include <config.h>
+ +
+#include <opm/grid/common/CommunicationUtils.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/Schedule/RFTConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/material/fluidsystems/BlackOilDefaultFluidSystemIndices.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/material/fluidsystems/GenericOilGasWaterFluidSystem.hpp>
+
+#include <opm/output/data/Wells.hpp>
+
+#include <algorithm>
+
+#include <tuple>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+INSTANTIATE_COMP_THREEPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP_TWOPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP(NUM)
+
+ +
+
+ +
+
+file RFTContainer.hpp
+
+
+#include <cstddef>
+
+#include <functional>
+
+#include <map>
+
+#include <string>
+
+#include <vector>
+

Output module for the results black oil model writing in ECL binary format.

+
+ +
+
+file RSTConv.cpp
+
+#include <config.h>
+ +
+#include <dune/common/fvector.hh>
+
+#include <dune/istl/bvector.hh>
+
+#include <opm/input/eclipse/Schedule/RSTConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/output/data/Solution.hpp>
+
+#include <algorithm>
+
+#include <cmath>
+
+#include <numeric>
+
+

Defines

+
+
+INSTANTIATE(T, SIZE)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file RSTConv.hpp
+
+#include <array>
+
+#include <functional>
+
+#include <vector>
+ +
+ +
+
+file SimulatorConvergenceOutput.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/IOConfig/IOConfig.hpp>
+ +
+#include <algorithm>
+
+#include <iterator>
+
+#include <string_view>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file SimulatorConvergenceOutput.hpp
+
+
+#include <cstddef>
+
+#include <optional>
+
+#include <string_view>
+
+#include <thread>
+
+#include <vector>
+
+ +
+
+file SimulatorFullyImplicitBlackoil.cpp
+
+#include <config.h>
+ +
+ +
+
+file SimulatorFullyImplicitBlackoil.hpp
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/input/eclipse/Units/UnitSystem.hpp>
+
+#include <opm/grid/utility/StopWatch.hpp>
+ + + + + + + + + + + + + +
+#include <filesystem>
+
+#include <memory>
+
+#include <string>
+
+#include <string_view>
+
+#include <utility>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file SimulatorReportBanners.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+ +
+#include <boost/date_time.hpp>
+
+#include <sstream>
+
+ +
+
+file SimulatorReportBanners.hpp
+
+ +
+
+file SimulatorSerializer.cpp
+
+#include <config.h>
+ +
+#include <dune/common/hash.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/utility/String.hpp>
+
+#include <opm/input/eclipse/EclipseState/IOConfig/IOConfig.hpp>
+ + +
+#include <algorithm>
+
+#include <filesystem>
+
+#include <stdexcept>
+
+ +
+
+file SimulatorSerializer.hpp
+
+
+#include <array>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file SolutionContainers.cpp
+
+#include <config.h>
+ +

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file SolutionContainers.hpp
+
+#include <vector>
+

This problem simulates an input file given in the data format used by the commercial ECLiPSE simulator.

+
+ +
+
+file SubDomain.hpp
+
+#include <opm/grid/common/SubGridPart.hpp>
+
+#include <fmt/format.h>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file TracerContainer.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/TracerConfig.hpp>
+
+#include <opm/material/fluidsystems/BlackOilDefaultFluidSystemIndices.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/material/fluidsystems/GenericOilGasWaterFluidSystem.hpp>
+
+#include <opm/output/data/Solution.hpp>
+
+#include <algorithm>
+
+#include <utility>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+INSTANTIATE_COMP_THREEPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP_TWOPHASE(NUM)
+
+ +
+
+INSTANTIATE_COMP(NUM)
+
+ +
+
+ +
+
+file TracerContainer.hpp
+
+#include <functional>
+
+#include <vector>
+

Output module for the results black oil model writing in ECL binary format.

+
+ +
+
+file TracerModel.hpp
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/grid/utility/ElementChunks.hpp>
+ +
+#include <opm/models/utils/propertysystem.hh>
+ + + +
+#include <array>
+
+#include <cstddef>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <vector>
+

A class which handles tracers as specified in by ECL.

+
+ +
+
+file Transmissibility.cpp
+
+#include <config.h>
+
+#include <opm/grid/CpGrid.hpp>
+ +
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file Transmissibility.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <dune/common/fmatrix.hh>
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <opm/grid/LookUpData.hh>
+
+#include <array>
+
+#include <functional>
+
+#include <map>
+
+#include <cstdint>
+
+#include <unordered_map>
+
+#include <vector>
+
+ +
+
+file Transmissibility_impl.hpp
+
+#include <config.h>
+ +
+#include <dune/common/version.hh>
+
+#include <dune/grid/common/mcmgmapper.hh>
+
+#include <opm/common/OpmLog/KeywordLocation.hpp>
+
+#include <opm/common/utility/ThreadSafeMapBuilder.hpp>
+
+#include <opm/grid/CpGrid.hpp>
+
+#include <opm/grid/utility/ElementChunks.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/TransMult.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+ +
+#include <algorithm>
+
+#include <array>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <cstddef>
+
+#include <cstdint>
+
+#include <functional>
+
+#include <initializer_list>
+
+#include <sstream>
+
+#include <stdexcept>
+
+#include <type_traits>
+
+#include <utility>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file TTagFlowProblemTPFA.hpp
+
+#include <tuple>
+
+ +
+
+file ValidationFunctions.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Deck/Deck.hpp>
+ +
+ +
+
+file ValidationFunctions.hpp
+
+#include <functional>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <vector>
+
+ +
+
+file VtkTracerModule.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/models/discretization/common/fvbaseparameters.hh>
+
+#include <opm/models/io/baseoutputmodule.hh>
+
+#include <opm/models/io/vtkmultiwriter.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+
+#include <string>
+
+#include <vector>
+

VTK output module for the tracer model’s parameters.

+
+ +
+
+file AmgxPreconditioner.hpp
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+ + +
+#include <dune/common/fmatrix.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <amgx_c.h>
+
+#include <vector>
+
+ +
+
+file DILU.hpp
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+ +
+#include <dune/common/fmatrix.hh>
+
+#include <dune/common/unused.hh>
+
+#include <dune/common/version.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+ +
+#include <cstddef>
+
+#include <optional>
+
+#include <vector>
+
+ +
+
+file extractMatrix.hpp
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <vector>
+
+ +
+
+file ExtractParallelGridInformationToISTL.cpp
+
+#include <config.h>
+ + +
+#include <dune/common/version.hh>
+
+#include <dune/common/shared_ptr.hh>
+
+#include <opm/grid/CpGrid.hpp>
+
+ +
+
+file ExtractParallelGridInformationToISTL.hpp
+
+ +
+
+file ExtraSmoothers.hpp
+
+#include “DILU.hpp
+
+ +
+
+file findOverlapRowsAndColumns.hpp
+
+#include <opm/grid/common/WellConnections.hpp>
+
+#include <opm/grid/common/CartesianIndexMapper.hpp>
+
+#include <cstddef>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file FlexibleSolver.hpp
+
+
+#include <dune/istl/solver.hh>
+
+#include <dune/istl/paamg/pinfo.hh>
+
+ +
+
+file FlexibleSolver1.cpp
+
+#include “config.h”
+ +
+ +
+
+file FlexibleSolver2.cpp
+
+#include “config.h”
+ +
+ +
+
+file FlexibleSolver3.cpp
+
+#include “config.h”
+ +
+ +
+
+file FlexibleSolver4.cpp
+
+#include “config.h”
+ +
+ +
+
+file FlexibleSolver5.cpp
+
+#include “config.h”
+ +
+ +
+
+file FlexibleSolver6.cpp
+
+#include “config.h”
+ +
+ +
+
+file FlexibleSolver_impl.hpp
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <opm/simulators/linalg/ilufirstelement.hh>
+ + + + +
+#include <dune/common/fmatrix.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/istl/solvers.hh>
+
+#include <dune/istl/umfpack.hh>
+
+#include <dune/istl/owneroverlapcopy.hh>
+
+#include <dune/istl/paamg/pinfo.hh>
+
+

Defines

+
+
+INSTANTIATE_FLEXIBLESOLVER_OP(...)
+
+ +
+
+INSTANTIATE_FLEXIBLESOLVER(T, N)
+
+ +
+
+

Typedefs

+
+
+template<class Scalar, int N>
using BV = Dune::BlockVector<Dune::FieldVector<Scalar, N>>
+
+ +
+
+template<class Scalar, int N>
using OBM = Dune::BCRSMatrix<Opm::MatrixBlock<Scalar, N, N>>
+
+ +
+
+template<class Scalar, int N>
using SeqOpM = Dune::MatrixAdapter<OBM<Scalar, N>, BV<Scalar, N>, BV<Scalar, N>>
+
+ +
+
+template<class Scalar, int N>
using SeqOpW = Opm::WellModelMatrixAdapter<OBM<Scalar, N>, BV<Scalar, N>, BV<Scalar, N>>
+
+ +
+
+ +
+
+file FlowLinearSolverParameters.cpp
+
+#include <config.h>
+ +
+#include <opm/simulators/linalg/linalgparameters.hh>
+ +
+ +
+
+file FlowLinearSolverParameters.hpp
+
+
+#include <opm/simulators/linalg/linalgparameters.hh>
+
+#include <opm/simulators/linalg/linalgproperties.hh>
+
+ +
+
+file getQuasiImpesWeights.hpp
+
+#include <dune/common/fvector.hh>
+ +
+#include <opm/material/common/MathToolbox.hpp>
+
+#include <algorithm>
+
+#include <cmath>
+
+ +
+
+file amgclSolverBackend.cpp
+
+#include <config.h>
+ + +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+
+#include <boost/property_tree/json_parser.hpp>
+
+#include <algorithm>
+
+#include <fstream>
+
+#include <ios>
+
+#include <ostream>
+
+#include <memory>
+
+#include <mutex>
+
+#include <sstream>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <tuple>
+
+#include <vector>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file amgclSolverBackend.hpp
+
+ + +
+#include <boost/property_tree/ptree.hpp>
+
+#include <amgcl/amg.hpp>
+
+#include <amgcl/backend/builtin.hpp>
+
+#include <amgcl/adapter/crs_tuple.hpp>
+
+#include <amgcl/make_block_solver.hpp>
+
+#include <amgcl/relaxation/as_preconditioner.hpp>
+
+#include <amgcl/relaxation/ilu0.hpp>
+
+#include <amgcl/solver/bicgstab.hpp>
+
+#include <amgcl/preconditioner/runtime.hpp>
+
+#include <amgcl/value_type/static_matrix.hpp>
+
+#include <memory>
+
+#include <mutex>
+
+#include <type_traits>
+
+#include <vector>
+
+ +
+
+file BlockedMatrix.cpp
+
+#include <config.h>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ + +
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file BlockedMatrix.hpp
+
+ +
+
+file CprCreation.cpp
+
+#include <config.h>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+
+#include <dune/common/shared_ptr.hh>
+ + + + + + +
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file CprCreation.hpp
+
+#include <dune/istl/paamg/matrixhierarchy.hh>
+
+#include <dune/istl/umfpack.hh>
+ + +
+#include <type_traits>
+
+ +
+
+file cuda_header.hpp
+
+#include <cuda_runtime.h>
+
+#include <sstream>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+

Defines

+
+
+cudaCheckLastError(msg)
+

Runtime error checking of CUDA functions Usage: cudaMalloc(…); cudaCheckLastError(“Error could not allocate memory”);

+
+ +
+
+

Functions

+
+
+inline void __cudaCheckError(const char *file, const int line, const char *msg)
+
+ +
+
+ +
+
+file cusparseSolverBackend.hpp
+
+#include “cublas_v2.h”
+
+#include “cusparse_v2.h”
+ + + +
+ +
+
+file cuWellContributions.hpp
+
+
+#include <cuda_runtime.h>
+
+ +
+
+file GpuBridge.cpp
+
+#include <config.h>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include “dune/istl/bcrsmatrix.hh”
+
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ + + +
+#include <type_traits>
+
+

Defines

+
+
+INSTANTIATE_GPU_FUNCTIONS(T, n)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+

Typedefs

+
+
+using InverseOperatorResult = Dune::InverseOperatorResult
+
+ +
+
+ +
+
+file GpuBridge.hpp
+
+#include “dune/istl/solver.hh”
+ +
+ +
+
+file GpuResult.hpp
+
+ +
+
+file GpuSolver.hpp
+
+ +
+#include <memory>
+
+ +
+
+file Matrix.hpp
+
+#include <vector>
+
+ +
+
+file Misc.cpp
+
+#include <config.h>
+ +
+#include <cmath>
+
+#include <algorithm>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file Misc.hpp
+
+ +
+
+file MultisegmentWellContribution.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+ +
+
+file MultisegmentWellContribution.hpp
+
+#include <vector>
+
+#include <umfpack.h>
+
+#include <dune/common/version.hh>
+
+ +
+
+file ChowPatelIlu.cpp
+
+#include <config.h>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+ + +
+ +
+
+file ChowPatelIlu.hpp
+
+#include <mutex>
+ +
+ +
+
+file opencl.cpp
+
+#include <config.h>
+ +
+#include <string>
+
+ +
+
+file opencl.hpp
+
+#include <CL/cl2.hpp>
+
+#include <string>
+
+

Defines

+
+
+CL_HPP_ENABLE_EXCEPTIONS
+

This file includes the relevant OpenCL header(s) All gpu files using OpenCL declarations should include this header

+
+ +
+
+CL_TARGET_OPENCL_VERSION
+
+ +
+
+CL_HPP_TARGET_OPENCL_VERSION
+
+ +
+
+CL_HPP_MINIMUM_VERSION
+
+ +
+
+CL_HPP_MINIMUM_OPENCL_VERSION
+
+ +
+
+ +
+
+file openclBILU0.cpp
+
+#include <config.h>
+
+#include <algorithm>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+ + + + +
+#include <sstream>
+
+#include <thread>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+

Variables

+
+
+std::shared_ptr<std::thread> copyThread
+
+ +
+
+ +
+
+file openclBILU0.hpp
+
+ + + +
+#include <memory>
+
+#include <mutex>
+
+ +
+
+file openclBISAI.cpp
+
+#include <config.h>
+
+#include <algorithm>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+ + + + + + + +
+#include <sstream>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file openclBISAI.hpp
+
+#include <mutex>
+ + + +
+ +
+
+file openclCPR.cpp
+
+#include <config.h>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+
+#include <dune/common/shared_ptr.hh>
+ + + + + + + + +
+#include <type_traits>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file openclCPR.hpp
+
+#include <dune/istl/paamg/matrixhierarchy.hh>
+
+#include <dune/istl/umfpack.hh>
+ + + + + + + +
+ +
+
+file openclKernels.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+ + +
+#include <cmath>
+
+#include <sstream>
+
+ +
+
+file openclKernels.hpp
+
+#include <string>
+
+#include <memory>
+
+#include <cstddef>
+ +
+

Defines

+
+
+DECLARE_ILU(T)
+
+ +
+
+DECLARE_INSTANCE(T)
+
+ +
+
+ +
+
+file OpenclMatrix.cpp
+
+#include <config.h>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ + + +
+ +
+
+file OpenclMatrix.hpp
+
+#include <vector>
+ +
+ +
+
+file openclPreconditioner.cpp
+
+#include <config.h>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ + + + +
+#include <memory>
+
+#include <string>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file openclPreconditioner.hpp
+
+ +
+ +
+
+file openclSolverBackend.cpp
+
+#include <config.h>
+
+#include <cmath>
+
+#include <sstream>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+ + + + + +
+

Defines

+
+
+COPY_ROW_BY_ROW
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file openclSolverBackend.hpp
+
+ + + + +
+ +
+
+file openclWellContributions.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ +
+ +
+
+file openclWellContributions.hpp
+
+ + +
+#include <memory>
+
+#include <vector>
+
+ +
+
+file Preconditioner.hpp
+
+#include <memory>
+
+ +
+
+file Reorder.cpp
+
+
+#include <cassert>
+
+#include <vector>
+
+ +
+
+file Reorder.hpp
+
+#include <vector>
+
+ +
+
+file hipKernels.cpp
+
+#include <config.h>
+
+#include <cmath>
+
+#include <sstream>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+ + +
+#include <hip/hip_runtime.h>
+
+ +
+
+file hipKernels.hpp
+
+#include <string>
+
+#include <memory>
+
+#include <cstddef>
+
+#include <hip/hip_runtime_api.h>
+
+#include <hip/hip_version.h>
+
+ +
+
+file rocalutionSolverBackend.cpp
+
+#include <config.h>
+
+#include <cmath>
+
+#include <sstream>
+
+#include <fmt/format.h>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+ +
+#include <rocalution.hpp>
+
+#include <base/matrix_formats_ind.hpp>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file rocalutionSolverBackend.hpp
+
+ + +
+ +
+
+file rocsparseBILU0.cpp
+
+#include <config.h>
+
+#include <algorithm>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+ + + +
+#include <sstream>
+
+#include <thread>
+
+#include <type_traits>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+

Variables

+
+
+std::shared_ptr<std::thread> copyThread
+
+ +
+
+ +
+
+file rocsparseBILU0.hpp
+
+ +
+#include <rocblas/rocblas.h>
+
+#include <rocsparse/rocsparse.h>
+
+#include <hip/hip_version.h>
+
+ +
+
+file rocsparseCPR.cpp
+
+#include <config.h>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+
+#include <dune/common/shared_ptr.hh>
+ + + + + + + +
+#include <type_traits>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file rocsparseCPR.hpp
+
+#include <mutex>
+ + + + + + +
+ +
+
+file rocsparseMatrix.cpp
+
+#include <config.h>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ + + + +
+#include <sstream>
+
+#include <iostream>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file rocsparseMatrix.hpp
+
+#include <hip/hip_runtime_api.h>
+
+ +
+
+file rocsparsePreconditioner.cpp
+
+#include <config.h>
+
+#include <memory>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ + + +
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file rocsparsePreconditioner.hpp
+
+
+#include <rocsparse/rocsparse.h>
+
+ +
+
+file rocsparseSolverBackend.cpp
+
+#include <config.h>
+
+#include <sstream>
+
+#include <stdexcept>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/timer.hh>
+ + + + + +
+#include <cstddef>
+
+#include <type_traits>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file rocsparseSolverBackend.hpp
+
+#include <memory>
+ + + + +
+#include <rocblas/rocblas.h>
+
+#include <rocsparse/rocsparse.h>
+
+#include <hip/hip_version.h>
+
+ +
+
+file rocsparseWellContributions.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ + +
+#include <hip/hip_runtime.h>
+
+ +
+
+file rocsparseWellContributions.hpp
+
+
+#include <hip/hip_runtime_api.h>
+
+#include <vector>
+
+ +
+
+file WellContributions.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+ +
+ +
+
+file WellContributions.hpp
+
+#include <memory>
+
+#include <vector>
+
+#include <umfpack.h>
+
+#include <dune/common/version.hh>
+
+ +
+
+file autotuner.hpp
+
+#include <cuda.h>
+
+#include <cuda_runtime.h>
+
+#include <functional>
+
+#include <limits>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+ +
+#include <string>
+
+#include <utility>
+
+ +
+
+file coloringAndReorderingUtils.hpp
+
+#include <fmt/core.h>
+
+#include <memory>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/grid/utility/SparseTable.hpp>
+ +
+#include <tuple>
+
+#include <vector>
+
+ +
+
+file cublas_safe_call.hpp
+
+#include <cublas_v2.h>
+
+#include <exception>
+
+#include <fmt/core.h>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <string_view>
+
+

Defines

+
+
+CHECK_CUBLAS_ERROR_TYPE(code, x)
+
+ +
+
+OPM_CUBLAS_SAFE_CALL(expression)
+

OPM_CUBLAS_SAFE_CALL checks the return type of the cublas expression (function call) and throws an exception if it does not equal CUBLAS_STATUS_SUCCESS.

+

Example usage:

#include <cublas_v2.h>
+#include <opm/simulators/linalg/gpuistl/detail/cublas_safe_call.hpp>
+
+void some_function() {
+    cublasHandle_t cublasHandle;
+    OPM_CUBLAS_SAFE_CALL(cublasCreate(&cublasHandle));
+}
+
+
+

+
+

Note

+

This should be used for any call to cuBlas unless you have a good reason not to.

+
+
+ +
+
+OPM_CUBLAS_WARN_IF_ERROR(expression)
+

OPM_CUBLAS_WARN_IF_ERROR checks the return type of the cublas expression (function call) and issues a warning if it does not equal CUBLAS_STATUS_SUCCESS.

+

Example usage:

#include <cublas_v2.h>
+#include <opm/simulators/linalg/gpuistl/detail/cublas_safe_call.hpp>
+
+void some_function() {
+    cublasHandle_t cublasHandle;
+    OPM_CUBLAS_WARN_IF_ERROR(cublasCreate(&cublasHandle));
+}
+
+
+

+
+

Note

+

Prefer the cublasSafeCall/OPM_CUBLAS_SAFE_CALL counterpart unless you really don’t want to throw an exception.

+
+
+ +
+
+ +
+
+file cublas_wrapper.hpp
+
+#include <cublas_v2.h>
+
+#include <opm/common/ErrorMacros.hpp>
+
+ +
+
+file CuBlasHandle.cpp
+
+#include <cublas_v2.h>
+ + +
+ +
+
+file CuBlasHandle.hpp
+
+#include <cublas_v2.h>
+
+#include <memory>
+
+ +
+
+file cuda_check_last_error.hpp
+
+#include <cuda_runtime.h>
+
+#include <fmt/core.h>
+ +
+

Defines

+
+
+OPM_CUDA_CHECK_DEVICE_SYNCHRONIZE
+

OPM_CUDA_CHECK_DEVICE_SYNCHRONIZE checks the return type of cudaDeviceSynchronize(), and throws an exception if cudaDeviceSynchronize() does not equal cudaSuccess.

+

Example usage:

#include <opm/simulators/linalg/gpuistl/detail/cuda_check_last_error.hpp>
+
+void some_function() {
+    OPM_CUDA_CHECK_DEVICE_SYNCHRONIZE;
+}
+
+
+

+
+

Note

+

This can be used to debug the code, or simply make sure that no error has occured.

+
+
+

Note

+

This is a rather heavy operation, so prefer to use only in Debug mode (see OPM_CUDA_CHECK_DEVICE_SYNCHRONIZE_IF_DEBUG)

+
+
+ +
+
+OPM_CUDA_CHECK_DEVICE_SYNCHRONIZE_IF_DEBUG
+

OPM_CUDA_CHECK_DEVICE_SYNCHRONIZE_IF_DEBUG checks the return type of cudaDeviceSynchronize only if NDEBUG is not defined, and throws an exception if cudaDeviceSynchronize() does not equal cudaSuccess.

+

Example usage:

#include <opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp>
+
+void some_function() {
+    OPM_CUDA_CHECK_DEVICE_SYNCHRONIZE_IF_DEBUG;
+}
+
+
+

+
+

Note

+

This can be used to debug the code, or simply make sure that no error has occured.

+
+
+ +
+
+OPM_CUDA_CHECK_LAST_ERROR
+

OPM_CUDA_CHECK_LAST_ERROR checks the return type of cudaGetLastError(), and throws an exception if cudaGetLastError() does not equal cudaSuccess.

+

Example usage:

#include <opm/simulators/linalg/gpuistl/detail/cuda_check_last_error.hpp>
+
+void some_function() {
+    OPM_CUDA_CHECK_LAST_ERROR;
+}
+
+
+

+
+

Note

+

This can be used to debug the code, or simply make sure that no error has occured.

+
+
+ +
+
+OPM_CUDA_CHECK_LAST_ERROR_IF_DEBUG
+

OPM_CUDA_CHECK_LAST_ERROR_IF_DEBUG checks the return type of cudaGetLastError() only if NDEBUG is not defined, and throws an exception if cudaGetLastError() does not equal cudaSuccess.

+

Example usage:

#include <opm/simulators/linalg/gpuistl/detail/cuda_check_last_error.hpp>
+
+void some_function() {
+    OPM_CUDA_CHECK_LAST_ERROR_IF_DEBUG;
+}
+
+
+

+
+

Note

+

This can be used to debug the code, or simply make sure that no error has occured.

+
+
+ +
+
+ +
+
+file CuMatrixDescription.hpp
+
+ +
+ +
+
+file cusparse_constants.hpp
+
+#include <cusparse.h>
+
+ +
+
+file cusparse_safe_call.hpp
+
+#include <cusparse.h>
+
+#include <exception>
+
+#include <fmt/core.h>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+

Defines

+
+
+CHECK_CUSPARSE_ERROR_TYPE(code, x)
+
+ +
+
+OPM_CUSPARSE_SAFE_CALL(expression)
+

OPM_CUSPARSE_SAFE_CALL checks the return type of the cusparse expression (function call) and throws an exception if it does not equal CUSPARSE_STATUS_SUCCESS.

+

Example usage:

#include <opm/simulators/linalg/gpuistl/detail/cusparse_safe_call.hpp>
+#include <cusparse.h>
+
+void some_function() {
+    cusparseHandle_t cusparseHandle;
+    OPM_CUSPARSE_SAFE_CALL(cusparseCreate(&cusparseHandle));
+}
+
+
+

+
+

Note

+

This should be used for any call to cuSparse unless you have a good reason not to.

+
+
+ +
+
+OPM_CUSPARSE_WARN_IF_ERROR(expression)
+

OPM_CUSPARSE_WARN_IF_ERROR checks the return type of the cusparse expression (function call) and issues a warning if it does not equal CUSPARSE_STATUS_SUCCESS.

+

Example usage:

#include <opm/simulators/linalg/gpuistl/detail/cusparse_safe_call.hpp>
+#include <cusparse.h>
+
+void some_function() {
+    cusparseHandle_t cusparseHandle;
+    OPM_CUSPARSE_WARN_IF_ERROR(cusparseCreate(&cusparseHandle));
+}
+
+
+

+
+

Note

+

Prefer the cusparseSafeCall/OPM_CUBLAS_SAFE_CALL counterpart unless you really don’t want to throw an exception.

+
+
+ +
+
+ +
+
+file cusparse_wrapper.hpp
+
+#include <cusparse.h>
+
+#include <type_traits>
+
+ +
+
+file CuSparseHandle.cpp
+
+ +
+ +
+
+file CuSparseHandle.hpp
+
+#include <cusparse.h>
+
+#include <memory>
+
+ +
+
+file CuSparseResource.hpp
+
+#include <cusparse.h>
+
+#include <functional>
+
+#include <memory>
+
+#include <type_traits>
+ +
+ +
+
+file CuSparseResource_impl.hpp
+
+#include <exception>
+
+#include <opm/common/ErrorMacros.hpp>
+ +
+ +
+
+file deviceBlockOperations.hpp
+
+#include <config.h>
+
+#include <cuda_runtime.h>
+
+ +
+
+file fix_zero_diagonal.hpp
+
+#include <limits>
+
+#include <vector>
+
+ +
+
+file gpu_safe_call.hpp
+
+#include <cuda_runtime.h>
+
+#include <fmt/core.h>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <string_view>
+
+

Defines

+
+
+OPM_GPU_SAFE_CALL(expression)
+

OPM_GPU_SAFE_CALL checks the return type of the GPU expression (function call) and throws an exception if it does not equal cudaSuccess.

+

Example usage:

#include <opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp>
+#include <cuda_runtime.h>
+
+void some_function() {
+    void* somePointer;
+    OPM_GPU_SAFE_CALL(cudaMalloc(&somePointer, 1));
+}
+
+
+

+
+

Note

+

This should be used for any call to the GPU runtime API unless you have a good reason not to.

+
+
+ +
+
+OPM_GPU_WARN_IF_ERROR(expression)
+

OPM_GPU_WARN_IF_ERROR checks the return type of the GPU expression (function call) and issues a warning if it does not equal cudaSuccess.

+

Example usage:

#include <opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp>
+#include <cuda_runtime.h>
+
+void some_function() {
+    void* somePointer;
+    OPM_GPU_WARN_IF_ERROR(cudaMalloc(&somePointer, 1));
+}
+
+
+

+
+

Note

+

Prefer the cudaSafeCall/OPM_GPU_SAFE_CALL counterpart unless you really don’t want to throw an exception.

+
+
+ +
+
+ +
+
+file gpusparse_matrix_operations.hpp
+
+#include <cstddef>
+
+#include <vector>
+
+ +
+
+file gpuThreadUtils.hpp
+
+#include <cstddef>
+
+#include <cuda.h>
+
+#include <cuda_runtime.h>
+ +
+ +
+
+file has_function.hpp
+
+#include <type_traits>
+
+ +
+
+file is_gpu_pointer.hpp
+
+#include <cuda.h>
+
+#include <cuda_runtime.h>
+
+#include <memory>
+ +
+ +
+
+file kernel_enums.hpp
+
+#include <cuda_runtime.h>
+
+ +
+
+file preconditioner_should_call_post_pre.hpp
+
+
+ +
+
+file DILUKernels.hpp
+
+#include <cstddef>
+
+#include <cuda.h>
+
+#include <cuda_runtime.h>
+ +
+#include <vector>
+
+ +
+
+file ILU0Kernels.hpp
+
+#include <cstddef>
+
+#include <vector>
+ +
+ +
+
+file JacKernels.hpp
+
+#include <cstddef>
+
+#include <vector>
+
+ +
+
+file safe_conversion.hpp
+
+#include <cstddef>
+
+#include <fmt/format.h>
+
+#include <limits>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <type_traits>
+
+#include <cuda_runtime.h>
+
+ +
+
+file vector_operations.hpp
+
+#include <cstddef>
+
+#include <cublas_v2.h>
+
+ +
+
+file device_management.cpp
+
+#include <config.h>
+ + +
+ +
+
+file device_management.hpp
+
+ +
+
+file gpu_resources.hpp
+
+#include <cuda.h>
+
+#include <cuda_runtime.h>
+ +
+#include <type_traits>
+
+

Defines

+
+
+OPM_CREATE_GPU_RESOURCE(name, type, create, destroy, ...)
+

Creates an RAII-style GPU resource class.

+

This macro automatically generates a class that:

    +
  • Defines a resource type and a corresponding instance.

  • +
  • Initializes the resource in the constructor via the provided creation function.

  • +
  • Cleans up the resource in the destructor via the provided destruction function.

  • +
+

+

+Usage example:

OPM_CREATE_GPU_RESOURCE(MyResource, ResourceType, createFunction, destroyFunction, args...);
+
+
+

+

This ensures correct setup and teardown of GPU resources without clutter in user code.

+
+
Tparam name:
+

The class name to be defined.

+
+
Tparam type:
+

The underlying resource type to manage.

+
+
Tparam create:
+

The function used to create or allocate the resource.

+
+
Tparam destroy:
+

The function used to destroy or deallocate the resource.

+
+
Parameters:
+
    +
  • ... – Additional arguments forwarded to the creation function.

  • +
+
+
+
+ +
+
+OPM_CREATE_GPU_RESOURCE_NO_CREATE(name, type, destroy)
+

A helper macro for creating a GPU resource wrapper without invoking creation logic.

+

This macro, closely related to OPM_CREATE_GPU_RESOURCE, provides a class that manages a GPU resource of the specified type. Upon destruction, it automatically destroys the underlying resource to ensure proper cleanup of GPU memory or handles.

+

Usage:

    +
  • Construct an instance of this wrapper to store a GPU resource.

  • +
  • The resource is destroyed when the wrapper goes out of scope.

  • +
+

+

Use OPM_CREATE_GPU_RESOURCE for variants that require resource creation logic.

+
+
Tparam name:
+

Name of the wrapper class to manage the GPU resource.

+
+
Tparam type:
+

The type of the GPU resource to manage.

+
+
Tparam destroy:
+

The function or macro used to destroy the resource.

+
+
+
+ +
+
+ +
+
+file gpu_smart_pointer.hpp
+
+#include <cuda_runtime.h>
+
+#include <memory>
+
+#include <opm/common/utility/gpuDecorators.hpp>
+ + +

defines convenience classes and functions for using std::shared_ptr and std::unique_ptr with GPU allocated memory.

+
+ +
+
+file GpuBlockPreconditioner.hpp
+
+#include <dune/common/shared_ptr.hh>
+
+#include <memory>
+ + + +
+ +
+
+file GpuBuffer.cpp
+
+#include <cuda.h>
+
+#include <cuda_runtime.h>
+
+#include <algorithm>
+
+#include <fmt/core.h>
+ +
+ +
+
+file GpuBuffer.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <dune/istl/bvector.hh>
+
+#include <exception>
+
+#include <fmt/core.h>
+
+#include <opm/common/ErrorMacros.hpp>
+ + +
+#include <vector>
+
+#include <string>
+
+#include <cuda_runtime.h>
+
+ +
+
+file GpuDILU.cpp
+
+#include <chrono>
+
+#include <config.h>
+
+#include <dune/common/fmatrix.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <fmt/core.h>
+
+#include <limits>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+ + + + + + + + +
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <tuple>
+
+#include <functional>
+
+#include <utility>
+
+#include <string>
+
+

Defines

+
+
+INSTANTIATE_CUDILU_DUNE(realtype, blockdim)
+
+ +
+
+

Functions

+
+
+INSTANTIATE_CUDILU_DUNE (double, 1)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (double, 2)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (double, 3)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (double, 4)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (double, 5)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (double, 6)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 1)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 2)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 3)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 4)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 5)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 6)
+
+ +
+
+ +
+
+file GpuDILU.hpp
+
+#include <memory>
+
+#include <opm/grid/utility/SparseTable.hpp>
+ + + + +
+#include <vector>
+
+#include <map>
+
+#include <utility>
+
+ +
+
+file GpuJac.cpp
+
+#include <dune/common/fmatrix.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <fmt/core.h>
+
+#include <opm/common/ErrorMacros.hpp>
+ + + + +
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <stdexcept>
+
+

Defines

+
+
+INSTANTIATE_CUJAC_DUNE(realtype)
+
+ +
+
+

Functions

+
+
+INSTANTIATE_CUJAC_DUNE(double)
+
+ +
+
+INSTANTIATE_CUJAC_DUNE(float)
+
+ +
+
+ +
+
+file GpuJac.hpp
+
+#include <dune/istl/preconditioner.hh>
+ + + + + +
+ +
+
+file GpuOwnerOverlapCopy.hpp
+
+#include <dune/istl/owneroverlapcopy.hh>
+ +
+#include <mpi.h>
+
+#include <memory>
+
+#include <mutex>
+
+#include <vector>
+
+ +
+
+file GpuSeqILU0.cpp
+
+ +
+#include <cuda.h>
+
+#include <cuda_runtime.h>
+
+#include <cusparse.h>
+
+#include <dune/common/fmatrix.hh>
+
+#include <dune/common/fvector.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/istl/bvector.hh>
+
+#include <fmt/core.h>
+
+#include <opm/common/ErrorMacros.hpp>
+ + + + + + +
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <type_traits>
+
+

Defines

+
+
+INSTANTIATE_GPUSEQILU0_DUNE(realtype, blockdim)
+
+ +
+
+

Functions

+
+
+INSTANTIATE_GPUSEQILU0_DUNE (double, 1)
+
+ +
+
+INSTANTIATE_GPUSEQILU0_DUNE (double, 2)
+
+ +
+
+INSTANTIATE_GPUSEQILU0_DUNE (double, 3)
+
+ +
+
+INSTANTIATE_GPUSEQILU0_DUNE (double, 4)
+
+ +
+
+INSTANTIATE_GPUSEQILU0_DUNE (double, 5)
+
+ +
+
+INSTANTIATE_GPUSEQILU0_DUNE (double, 6)
+
+ +
+
+INSTANTIATE_GPUSEQILU0_DUNE (float, 1)
+
+ +
+
+INSTANTIATE_GPUSEQILU0_DUNE (float, 2)
+
+ +
+
+INSTANTIATE_GPUSEQILU0_DUNE (float, 3)
+
+ +
+
+INSTANTIATE_GPUSEQILU0_DUNE (float, 4)
+
+ +
+
+INSTANTIATE_GPUSEQILU0_DUNE (float, 5)
+
+ +
+
+INSTANTIATE_GPUSEQILU0_DUNE (float, 6)
+
+ +
+
+ +
+
+file GpuSeqILU0.hpp
+
+#include <dune/istl/preconditioner.hh>
+ + + + + + + +
+ +
+
+file GpuSparseMatrix.cpp
+
+
+#include <cuda.h>
+
+#include <dune/common/fmatrix.hh>
+
+#include <dune/common/fvector.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/istl/bvector.hh>
+
+#include <fmt/core.h>
+ + + + +
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <type_traits>
+
+

Defines

+
+
+INSTANTIATE_CUSPARSE_DUNE_MATRIX_CONSTRUCTION_FUNTIONS(realtype, blockdim)
+
+ +
+
+ +
+
+file GpuSparseMatrix.hpp
+
+#include <cusparse.h>
+
+#include <iostream>
+
+#include <memory>
+
+#include <opm/common/ErrorMacros.hpp>
+ + + + +
+#include <vector>
+
+ +
+
+file GpuVector.cpp
+
+#include <cublas_v2.h>
+
+#include <cuda.h>
+
+#include <cuda_runtime.h>
+
+#include <fmt/core.h>
+ + + + + +
+ +
+
+file GpuVector.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <dune/istl/bvector.hh>
+
+#include <exception>
+
+#include <fmt/core.h>
+
+#include <opm/common/ErrorMacros.hpp>
+ + +
+#include <vector>
+
+#include <string>
+
+ +
+
+file GpuView.cpp
+
+#include <cuda.h>
+
+#include <cuda_runtime.h>
+
+#include <algorithm>
+
+#include <fmt/core.h>
+ + +
+ +
+
+file GpuView.hpp
+
+#include <dune/common/fvector.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/utility/gpuDecorators.hpp>
+ +
+#include <stdexcept>
+
+#include <vector>
+
+#include <fmt/core.h>
+
+ +
+
+file OpmGpuILU0.cpp
+
+#include <chrono>
+
+#include <config.h>
+
+#include <dune/common/fmatrix.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <fmt/core.h>
+
+#include <functional>
+
+#include <limits>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+ + + + + + + + +
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <string>
+
+#include <tuple>
+
+#include <utility>
+
+

Defines

+
+
+INSTANTIATE_CUDILU_DUNE(realtype, blockdim)
+
+ +
+
+

Functions

+
+
+INSTANTIATE_CUDILU_DUNE (double, 1)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (double, 2)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (double, 3)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (double, 4)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (double, 5)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (double, 6)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 1)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 2)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 3)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 4)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 5)
+
+ +
+
+INSTANTIATE_CUDILU_DUNE (float, 6)
+
+ +
+
+ +
+
+file OpmGpuILU0.hpp
+
+#include <memory>
+
+#include <opm/grid/utility/SparseTable.hpp>
+ + + + + +
+#include <optional>
+
+#include <type_traits>
+
+#include <vector>
+
+ +
+
+file PreconditionerAdapter.hpp
+
+#include <cusparse.h>
+
+#include <dune/istl/preconditioner.hh>
+ + + + +
+ +
+
+file PreconditionerConvertFieldTypeAdapter.hpp
+
+#include <cusparse.h>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/istl/preconditioner.hh>
+ + + + + + + + +
+ +
+
+file PreconditionerCPUMatrixToGPUMatrix.hpp
+
+
+#include <dune/istl/preconditioner.hh>
+ + + + +
+ +
+
+file PreconditionerHolder.hpp
+
+
+ +
+
+file set_device.cpp
+
+#include <config.h>
+
+#include <sstream>
+
+#include <cuda_runtime.h>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+ + + +
+ +
+
+file set_device.hpp
+
+ +
+
+file SolverAdapter.hpp
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/istl/operators.hh>
+
+#include <dune/istl/paamg/pinfo.hh>
+
+#include <dune/istl/schwarz.hh>
+
+#include <dune/istl/solver.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+ + + + + +
+#include <memory>
+
+ +
+
+file GraphColoring.hpp
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/grid/utility/SparseTable.hpp>
+
+#include <algorithm>
+
+#include <cstddef>
+
+#include <deque>
+
+#include <limits>
+
+#include <numeric>
+
+#include <queue>
+
+#include <string>
+
+#include <tuple>
+
+#include <vector>
+
+ +
+
+file HyprePreconditioner.hpp
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+ + +
+#include <dune/common/fmatrix.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <HYPRE.h>
+
+#include <HYPRE_parcsr_ls.h>
+
+#include <HYPRE_krylov.h>
+
+#include <_hypre_utilities.h>
+
+#include <vector>
+
+#include <numeric>
+
+ +
+
+file is_gpu_operator.hpp
+
+#include <type_traits>
+
+ +
+
+file ISTLSolver.cpp
+
+#include <config.h>
+
+#include <opm/common/TimingMacros.hpp>
+ +
+#include <dune/istl/schwarz.hh>
+
+#include <opm/grid/CpGrid.hpp>
+ + + +
+#include <fmt/format.h>
+
+

Defines

+
+
+INSTANTIATE_FLEX(T, Dim)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file ISTLSolver.hpp
+
+#include <dune/istl/owneroverlapcopy.hh>
+
+#include <dune/istl/solver.hh>
+
+#include <opm/common/CriticalError.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+
+#include <opm/models/common/multiphasebaseproperties.hh>
+ +
+#include <opm/models/utils/propertysystem.hh>
+ + + + + +
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <opm/simulators/linalg/istlsparsematrixadapter.hh>
+ + + + + + +
+#include <any>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <memory>
+
+#include <set>
+
+#include <sstream>
+
+#include <string>
+
+#include <tuple>
+
+#include <vector>
+
+ +
+
+file ISTLSolverGpuBridge.cpp
+
+#include <config.h>
+
+#include <opm/common/TimingMacros.hpp>
+ +
+#include <dune/istl/schwarz.hh>
+
+#include <opm/grid/CpGrid.hpp>
+ + + +
+#include <fmt/format.h>
+ + +
+#include <opm/grid/polyhedralgrid.hh>
+
+#include <thread>
+
+

Defines

+
+
+INSTANTIATE_GRID(T, Dim, Grid)
+
+ +
+
+INSTANTIATE(T, Dim)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+

Variables

+
+
+std::shared_ptr<std::thread> copyThread
+
+ +
+
+ +
+
+file ISTLSolverGpuBridge.hpp
+
+
+#include <cstddef>
+
+#include <memory>
+
+#include <set>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file MatrixMarketSpecializations.hpp
+
+#include <dune/istl/matrixmarket.hh>
+
+ +
+
+file MILU.cpp
+
+#include <config.h>
+ +
+#include <dune/common/version.hh>
+
+#include <dune/common/fmatrix.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/istl/ilu.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <array>
+
+#include <algorithm>
+
+

Defines

+
+
+INSTANTIATE(T, ...)
+
+ +
+
+INSTANTIATE_ILUN(...)
+
+ +
+
+INSTANTIATE_FULL(T, ...)
+
+ +
+
+INSTANTIATE_DIM(T, Dim)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file MILU.hpp
+
+#include <cmath>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file OwningBlockPreconditioner.hpp
+
+#include <opm/common/TimingMacros.hpp>
+ +
+#include <dune/istl/schwarz.hh>
+
+ +
+
+file OwningTwoLevelPreconditioner.hpp
+
+ +
+#include <opm/simulators/linalg/twolevelmethodcpr.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/fmatrix.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/istl/paamg/amg.hh>
+
+#include <fstream>
+
+#include <type_traits>
+
+ +
+
+file ParallelIstlInformation.cpp
+
+#include <config.h>
+
+ +
+
+file ParallelIstlInformation.hpp
+
+#include <vector>
+
+ +
+
+file ParallelOverlappingILU0.cpp
+
+#include <config.h>
+ +
+#include <dune/istl/owneroverlapcopy.hh>
+
+

Defines

+
+
+INSTANTIATE_PAR(T, Dim, ...)
+
+ +
+
+INSTANTIATE(T, Dim)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file ParallelOverlappingILU0.hpp
+
+#include <opm/common/TimingMacros.hpp>
+ + +
+#include <dune/istl/paamg/smoother.hh>
+
+#include <cstddef>
+
+#include <vector>
+
+#include <type_traits>
+
+ +
+
+file ParallelOverlappingILU0_BACKUP_13742.hpp
+
+ +
+#include <dune/common/version.hh>
+
+#include <dune/istl/paamg/smoother.hh>
+
+#include <cstddef>
+
+#include <vector>
+
+#include <type_traits>
+
+ +
+
+file ParallelOverlappingILU0_BASE_13742.hpp
+
+ + +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/version.hh>
+
+#include <dune/istl/preconditioner.hh>
+
+#include <dune/istl/ilu.hh>
+
+#include <dune/istl/paamg/smoother.hh>
+
+#include <dune/istl/paamg/graph.hh>
+
+#include <dune/istl/paamg/pinfo.hh>
+
+#include <type_traits>
+
+#include <numeric>
+
+#include <limits>
+
+#include <cstddef>
+
+#include <string>
+
+ +
+
+file ParallelOverlappingILU0_impl.hpp
+
+
+#include <dune/common/version.hh>
+
+#include <dune/istl/ilu.hh>
+
+#include <dune/istl/owneroverlapcopy.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+ +
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <cassert>
+
+ +
+
+file ParallelOverlappingILU0_LOCAL_13742.hpp
+
+ +
+#include <dune/common/version.hh>
+
+#include <dune/istl/paamg/smoother.hh>
+
+#include <cstddef>
+
+#include <vector>
+
+#include <type_traits>
+
+ +
+
+file ParallelOverlappingILU0_REMOTE_13742.hpp
+
+ + +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/common/version.hh>
+
+#include <dune/istl/preconditioner.hh>
+
+#include <dune/istl/ilu.hh>
+
+#include <dune/istl/paamg/smoother.hh>
+
+#include <dune/istl/paamg/graph.hh>
+
+#include <dune/istl/paamg/pinfo.hh>
+
+#include <type_traits>
+
+#include <numeric>
+
+#include <limits>
+
+#include <cstddef>
+
+#include <string>
+
+ +
+
+file ParallelRestrictedAdditiveSchwarz.hpp
+
+#include <opm/common/utility/platform_dependent/disable_warnings.h>
+
+#include <dune/istl/preconditioner.hh>
+
+#include <dune/istl/paamg/smoother.hh>
+
+#include <opm/common/utility/platform_dependent/reenable_warnings.h>
+
+ +
+
+file PreconditionerFactory.hpp
+
+#include <opm/common/TimingMacros.hpp>
+ +
+#include <dune/istl/paamg/aggregates.hh>
+
+#include <dune/istl/paamg/matrixhierarchy.hh>
+
+#include <cstddef>
+
+#include <map>
+
+#include <memory>
+
+#include <limits>
+
+#include <string>
+
+ +
+
+file PreconditionerFactory1.cpp
+
+#include <config.h>
+ +
+ +
+
+file PreconditionerFactory2.cpp
+
+#include <config.h>
+ +
+ +
+
+file PreconditionerFactory3.cpp
+
+#include <config.h>
+ +
+ +
+
+file PreconditionerFactory4.cpp
+
+#include <config.h>
+ +
+ +
+
+file PreconditionerFactory5.cpp
+
+#include <config.h>
+ +
+ +
+
+file PreconditionerFactory6.cpp
+
+#include <config.h>
+ +
+ +
+
+file PreconditionerFactory_impl.hpp
+
+#include <config.h>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+ + + + + + + + + + + + +
+#include <opm/simulators/linalg/amgcpr.hh>
+
+#include <opm/simulators/linalg/ilufirstelement.hh>
+
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <dune/common/unused.hh>
+
+#include <dune/istl/owneroverlapcopy.hh>
+
+#include <dune/istl/paamg/amg.hh>
+
+#include <dune/istl/paamg/fastamg.hh>
+
+#include <dune/istl/paamg/kamg.hh>
+
+#include <dune/istl/preconditioners.hh>
+ +
+#include <cassert>
+ +
+

Defines

+
+
+INSTANTIATE_PF_SEQ(T, Dim)
+
+ +
+
+INSTANTIATE_PF(T, Dim)
+
+ +
+
+ +
+
+file PreconditionerFactoryGPUIncludeWrapper.hpp
+
+ +
+
+file PreconditionerWithUpdate.hpp
+
+#include <dune/istl/preconditioner.hh>
+
+#include <memory>
+
+ +
+
+file PressureBhpTransferPolicy.hpp
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/simulators/linalg/matrixblock.hh>
+ +
+#include <opm/simulators/linalg/twolevelmethodcpr.hh>
+
+#include <dune/istl/paamg/pinfo.hh>
+ +
+#include <cstddef>
+
+ +
+
+file PressureSolverPolicy.hpp
+
+ +
+#include <dune/istl/solver.hh>
+
+#include <dune/istl/owneroverlapcopy.hh>
+
+ +
+
+file PressureTransferPolicy.hpp
+
+#include <opm/simulators/linalg/twolevelmethodcpr.hh>
+ +
+#include <opm/simulators/linalg/matrixblock.hh>
+ +
+#include <cstddef>
+
+ +
+
+file PropertyTree.cpp
+
+#include <config.h>
+ +
+#include <boost/property_tree/json_parser.hpp>
+
+#include <cstddef>
+
+#include <memory>
+
+#include <optional>
+
+#include <ostream>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file PropertyTree.hpp
+
+#include <functional>
+
+#include <iosfwd>
+
+#include <memory>
+
+#include <optional>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file setupPropertyTree.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+ +
+#include <filesystem>
+
+#include <boost/version.hpp>
+
+ +
+
+file setupPropertyTree.hpp
+
+
+#include <string>
+
+ +
+
+file SmallDenseMatrixUtils.hpp
+
+#include <dune/common/dynmatrix.hh>
+
+ +
+
+file StandardPreconditioners.hpp
+
+ + +
+ +
+
+file StandardPreconditioners_gpu_mpi.hpp
+
+ +
+
+file StandardPreconditioners_gpu_serial.hpp
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <type_traits>
+
+ +
+
+file StandardPreconditioners_mpi.hpp
+
+ +
+
+file StandardPreconditioners_serial.hpp
+
+ +
+
+file WellOperators.hpp
+
+#include <dune/common/parallel/communication.hh>
+
+#include <dune/istl/operators.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/simulators/linalg/matrixblock.hh>
+
+#include <dune/common/shared_ptr.hh>
+
+#include <dune/istl/paamg/smoother.hh>
+
+#include <cstddef>
+
+ +
+
+file WriteSystemMatrixHelper.hpp
+
+#include <dune/istl/matrixmarket.hh>
+ +
+#include <filesystem>
+
+#include <iomanip>
+
+#include <sstream>
+
+#include <string>
+
+ +
+
+file opm-simulators_doxygen_main.hpp
+
+

Defines

+
+
+OPM_OPM
+
+ +
+
+ +
+
+file AdaptiveSimulatorTimer.cpp
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <ostream>
+
+#include <numeric>
+
+#include <vector>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+ +
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+ +
+
+file AdaptiveSimulatorTimer.hpp
+
+#include <cassert>
+
+#include <iosfwd>
+
+#include <vector>
+
+#include <limits>
+
+#include <algorithm>
+
+#include <memory>
+
+#include <numeric>
+ +
+ +
+
+file AdaptiveTimeStepping.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+ + +
+#include <boost/date_time.hpp>
+
+#include <set>
+
+#include <sstream>
+
+ +
+
+file AdaptiveTimeStepping.hpp
+
+#include <opm/models/utils/basicproperties.hh>
+
+#include <opm/models/utils/propertysystem.hh>
+ + + + + +
+#include <functional>
+
+#include <memory>
+
+#include <set>
+
+#include <string>
+
+#include <tuple>
+
+#include <vector>
+ +
+ +
+
+file AdaptiveTimeStepping_impl.hpp
+
+#include <config.h>
+ + +
+#include <dune/istl/istlexception.hh>
+
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/grid/utility/StopWatch.hpp>
+
+#include <opm/input/eclipse/Schedule/Tuning.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+
+#include <opm/input/eclipse/Units/UnitSystem.hpp>
+ + +
+#include <algorithm>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <sstream>
+
+#include <stdexcept>
+
+#include <boost/date_time/posix_time/posix_time.hpp>
+
+#include <fmt/format.h>
+
+#include <fmt/ranges.h>
+
+ +
+
+file ConvergenceReport.cpp
+
+
+#include <cassert>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <fmt/format.h>
+
+ +
+
+file ConvergenceReport.hpp
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <numeric>
+
+#include <string>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file EclTimeSteppingParams.cpp
+
+#include <config.h>
+ + +
+ +
+
+file EclTimeSteppingParams.hpp
+
+ +
+
+file gatherConvergenceReport.cpp
+
+#include “config.h”
+ + +
+ +
+
+file gatherConvergenceReport.hpp
+
+ +
+ +
+
+file SimulatorReport.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+
+#include <cstddef>
+
+#include <iomanip>
+
+#include <ostream>
+
+#include <fmt/format.h>
+
+ +
+
+file SimulatorReport.hpp
+
+#include <cassert>
+
+#include <cstdlib>
+
+#include <iosfwd>
+
+#include <limits>
+
+#include <vector>
+
+ +
+
+file SimulatorTimer.cpp
+
+#include “config.h”
+ +
+#include <opm/common/utility/parameters/ParameterGroup.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+
+#include <boost/date_time/gregorian/gregorian_types.hpp>
+
+#include <boost/date_time/posix_time/conversion.hpp>
+
+#include <cstddef>
+
+#include <numeric>
+
+#include <ostream>
+
+ +
+
+file SimulatorTimer.hpp
+
+
+#include <boost/date_time/gregorian/gregorian_types.hpp>
+
+#include <cstddef>
+
+#include <iosfwd>
+
+#include <memory>
+
+#include <vector>
+
+ +
+
+file SimulatorTimerInterface.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Units/Units.hpp>
+
+#include <boost/date_time/posix_time/conversion.hpp>
+
+ +
+
+file SimulatorTimerInterface.hpp
+
+#include <memory>
+
+ +
+
+file TimeStepControl.cpp
+
+#include <config.h>
+
+#include <algorithm>
+
+#include <array>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <iostream>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <fstream>
+
+#include <limits>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+ + +
+#include <fmt/format.h>
+
+ +
+
+file TimeStepControl.hpp
+
+ +
+#include <string>
+
+#include <vector>
+
+ +
+
+file TimeStepControlInterface.hpp
+
+
+ +
+
+file BlackoilPhases.cpp
+
+
+#include <algorithm>
+
+#include <vector>
+
+ +
+
+file BlackoilPhases.hpp
+
+#include <array>
+
+#include <vector>
+
+ +
+
+file ComponentName.cpp
+
+#include <config.h>
+ +
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/models/blackoil/blackoilvariableandequationindices.hh>
+
+#include <opm/models/blackoil/blackoilonephaseindices.hh>
+
+#include <opm/models/blackoil/blackoiltwophaseindices.hh>
+
+#include <cassert>
+ +
+ +
+
+file ComponentName.hpp
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file compressPartition.cpp
+
+
+#include <algorithm>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file compressPartition.hpp
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file DamarisKeywords.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <Damaris.h>
+
+#include <damaris/env/Environment.hpp>
+
+#include <fmt/format.h>
+
+#include <fstream>
+
+#include <map>
+
+#include <random>
+
+#include <stdexcept>
+
+#include <string>
+
+ +
+
+file DamarisKeywords.hpp
+
+ + +
+#include <map>
+
+#include <string>
+
+#include <sstream>
+
+#include <algorithm>
+
+#include <unordered_set>
+
+ +
+
+file DamarisOutputModule.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+ + +
+#include <Damaris.h>
+
+#include <damaris/model/ModifyModel.hpp>
+
+#include <fmt/format.h>
+
+

Defines

+
+
+XSD_CXX11_TEMPLATE_ALIAS
+
+ +
+
+ +
+
+file DamarisOutputModule.hpp
+
+
+#include <map>
+
+#include <string>
+
+ +
+
+file DamarisVar.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <Damaris.h>
+
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <array>
+
+#include <cassert>
+
+#include <string_view>
+
+#include <typeinfo>
+
+ +
+
+file DamarisVar.hpp
+
+#include <cstddef>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file DeferredLogger.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+ +
+
+file DeferredLogger.hpp
+
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file DeferredLoggingErrorHelpers.hpp
+
+#include <opm/common/Exceptions.hpp>
+ + + +
+#include <string>
+
+#include <exception>
+
+#include <stdexcept>
+
+

Defines

+
+
+OPM_DEFLOG_THROW(Exception, message, deferred_logger)
+
+ +
+
+OPM_DEFLOG_PROBLEM(Exception, message, deferred_logger)
+
+ +
+
+OPM_BEGIN_PARALLEL_TRY_CATCH()
+

Macro to setup the try of a parallel try-catch.

+

Use OPM_END_PARALLEL_TRY_CATCH or OPM_END_PARALLEL_TRY_CATCH_LOG fot the catch part.

+
+ +
+
+OPM_PARALLEL_CATCH_CLAUSE(obptc_exc_type, obptc_exc_msg)
+

Inserts catch classes for the parallel try-catch.

+

There is a clause that will catch anything

+
+ +
+
+OPM_END_PARALLEL_TRY_CATCH(prefix, comm)
+

Catch exception and throw in a parallel try-catch clause.

+

Assumes that OPM_BEGIN_PARALLEL_TRY_CATCH() was called to initiate the try-catch clause

+
+ +
+
+OPM_END_PARALLEL_TRY_CATCH_LOG(obptc_logger, obptc_prefix, obptc_output, comm)
+

Catch exception, log, and throw in a parallel try-catch clause.

+

Assumes that OPM_BEGIN_PARALLEL_TRY_CATCH() was called to initiate the try-catch clause

+
+ +
+
+

Functions

+
+
+inline void checkForExceptionsAndThrow(Opm::ExceptionType::ExcEnum exc_type, const std::string &message, Opm::Parallel::Communication comm)
+
+ +
+
+inline void logAndCheckForExceptionsAndThrow(Opm::DeferredLogger &deferred_logger, Opm::ExceptionType::ExcEnum exc_type, const std::string &message, const bool terminal_output, Opm::Parallel::Communication comm)
+
+ +
+
+inline void logAndCheckForProblemsAndThrow(Opm::DeferredLogger &deferred_logger, Opm::ExceptionType::ExcEnum exc_type, const std::string &message, const bool terminal_output, Opm::Parallel::Communication comm)
+
+ +
+
+ +
+
+file FullySupportedFlowKeywords.cpp
+
+
+ +
+
+file FullySupportedFlowKeywords.hpp
+
+
+#include <string>
+
+ +
+
+file gatherDeferredLogger.cpp
+
+#include “config.h”
+ +
+ +
+
+file gatherDeferredLogger.hpp
+
+
+ +
+
+file GridDataOutput.cpp
+
+#include <config.h>
+ +
+#include <opm/grid/CpGrid.hpp>
+ +
+

Defines

+
+
+INSTANCE(part, ...)
+
+ +
+
+ +
+
+file GridDataOutput.hpp
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <dune/grid/common/partitionset.hh>
+
+#include <iosfwd>
+
+#include <string>
+

Allows model geometry data to be passed to external code - via a copy direct to input pointers.

+

This data extractor provides the full set of vertices (corresponding to Dune::Partition::all) and then allows a user to specify Dune sub-partitions to get the references into the vertex array and element (aka cell) types for the sub-partition. This allows the full set of vertices to be reused for visualisation of the various sub-partitions, at the expense of copying all the vertices. Typically a user is interested in the interiorBorder elements which make use of the bulk (~80%) of the vertices. This saves having to renumber the indexes to the vertices for the sub-partitions. The vertex data can be retrieved as seperate x, y and z arrays, or as a single array of array of structures, or as single structure of arrays based array.

+

Example:
+
+
+ From the opm-simulators repository #include <opm/simulators/utils/GridDataOutput.hpp>

+

N.B. does not seem to be able to be allocated with new operator. Opm::GridDataOutput::SimMeshDataAccessor

geomData(gridView,

+

Dune::Partition::interior );

+

+

geomData.printGridDetails();

+

int nvert = geomData.getNVertices(); example using seperate x, y and z arrays int nvert = geomData.getNVertices(); double * x_vert = new double[nvert]; double * y_vert = new double[nvert]; double * z_vert = new double[nvert]; geomData.writeGridPoints(x_vert,y_vert,z_vert, nvert);

+

… do something with vertex data x_vert, y_vert and z_vert ….

+

delete [] x_vert; delete [] y_vert; delete [] z_vert;

+

example using AOS double * xyz_vert_aos = new double[nvert*3]; geomData.writeGridPoints_AOS(xyz_vert_aos, nvert);

+

… do something with vertex data xyz_vert_aos….

+

delete [] xyz_vert_aos;

+

example using SOA with std::vector<double> std::vector<double> xyz_vert_soa(nvert*3); geomData.writeGridPoints_SOA(xyz_vert_soa);

+

… do something with vertex data xyz_vert_soa….

+
+ +
+
+file GridDataOutput_impl.hpp
+
+
+#include <dune/grid/common/rangegenerators.hh>
+
+#include <dune/grid/io/file/vtk/common.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <iterator>
+
+#include <ostream>
+
+ +
+
+file HDF5File.cpp
+
+#include <config.h>
+ +
+#include <opm/common/utility/String.hpp>
+ +
+#include <cassert>
+
+#include <cstddef>
+
+#include <filesystem>
+
+#include <stdexcept>
+
+ +
+
+file HDF5File.hpp
+
+
+#include <hdf5.h>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file HDF5Serializer.cpp
+
+#include <config.h>
+ +
+#include <algorithm>
+
+#include <cstdlib>
+
+ +
+
+file HDF5Serializer.hpp
+
+#include <opm/common/utility/Serializer.hpp>
+ + + +
+#include <cstddef>
+
+#include <limits>
+
+#include <string>
+
+ +
+
+file initDamarisXmlFile.cpp
+
+#include <string>
+
+ +
+
+file InstantiationIndicesMacros.hpp
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/material/fluidsystems/BlackOilDefaultFluidSystemIndices.hpp>
+
+#include <opm/models/blackoil/blackoilvariableandequationindices.hh>
+
+#include <opm/models/blackoil/blackoilonephaseindices.hh>
+
+#include <opm/models/blackoil/blackoiltwophaseindices.hh>
+
+

Defines

+
+
+INSTANTIATE_CLASS(CLASS, T, ...)
+
+ +
+
+INSTANTIATE_TYPE_INDICES(CLASS, T)
+
+ +
+
+

Typedefs

+
+
+template<class Scalar>
using FS = Opm::BlackOilFluidSystem<Scalar, Opm::BlackOilDefaultFluidSystemIndices>
+

Macro INSTANTIATE_TYPE_INDICES is used to to instantiate a template class with various predefined index configurations.

+

+The macro internally uses INSTANTIATE_CLASS to instantiate the provided class template with combinations of BlackOilOnePhaseIndices, BlackOilTwoPhaseIndices, and BlackOilVariableAndEquationIndices (three phase variants). These indices represent different configurations for different physical systems to be simulated.

+

\usage Example usage in a source file:

#include <opm/simulators/utils/InstantiationIndicesMacros.hpp>
+
+INSTANTIATE_TYPE_INDICES(MyClass, double)
+
+#if FLOW_INSTANTIATE_FLOAT
+INSTANTIATE_TYPE_INDICES(MyClass, float)
+#endif
+
+
+

+

This will instantiate MyClass with all predefined index configurations for both double and float scalar types (if FLOW_INSTANTIATE_FLOAT is defined).

+
+
Param CLASS:
+

The name of the class template to instantiate.

+
+
Param T:
+

The scalar type (e.g., double or float) used in the instantiation.

+
+
+
+ +
+
+ +
+
+file moduleVersion.cpp
+
+
+#include “project-timestamp.h”
+
+#include “project-version.h”
+
+ +
+
+file moduleVersion.hpp
+
+#include <string>
+
+ +
+
+file MPIPacker.cpp
+
+#include <config.h>
+ +
+#include <opm/common/utility/TimeService.hpp>
+
+#include <opm/input/eclipse/EclipseState/IOConfig/FIPConfig.hpp>
+
+#include <bitset>
+
+#include <cstdint>
+
+#include <ctime>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <type_traits>
+
+ +
+
+file MPIPacker.hpp
+
+#include <opm/common/utility/TimeService.hpp>
+ +
+#include <dune/common/parallel/mpitraits.hh>
+
+#include <bitset>
+
+#include <cstddef>
+
+#include <limits>
+
+#include <string>
+
+

Defines

+
+
+ADD_PACK_SPECIALIZATION(T)
+
+ +
+
+ +
+
+file MPISerializer.hpp
+
+#include <opm/common/utility/Serializer.hpp>
+ + +
+ +
+
+file ParallelCommunication.hpp
+
+#include <dune/common/version.hh>
+
+#include <dune/common/parallel/mpihelper.hh>
+
+ +
+
+file ParallelEclipseState.cpp
+
+#include “opm/input/eclipse/EclipseState/Grid/FieldProps.hpp”
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/Grid/FIPRegionStatistics.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/FieldData.hpp>
+
+#include <opm/input/eclipse/EclipseState/Runspec.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <cstddef>
+
+#include <map>
+
+#include <regex>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file ParallelEclipseState.hpp
+
+#include <dune/common/version.hh>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/TranCalculator.hpp>
+
+#include <dune/common/parallel/mpihelper.hh>
+ +
+#include <functional>
+
+ +
+
+file ParallelFileMerger.cpp
+
+
+#include <fstream>
+
+#include <iostream>
+
+ +
+
+file ParallelFileMerger.hpp
+
+#include <filesystem>
+
+#include <iosfwd>
+
+#include <memory>
+
+#include <regex>
+
+#include <string>
+
+ +
+
+file ParallelNLDDPartitioningZoltan.cpp
+
+#include <config.h>
+ + + +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/utility/CSRGraphFromCoordinates.hpp>
+
+#include <zoltan.h>
+
+#include <algorithm>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <numeric>
+
+#include <stdexcept>
+
+#include <utility>
+
+#include <vector>
+
+#include <set>
+
+#include <map>
+
+

Defines

+
+
+HAVE_MPI
+
+ +
+
+ +
+
+file ParallelNLDDPartitioningZoltan.hpp
+
+
+#include <cstddef>
+
+#include <functional>
+
+#include <map>
+
+#include <string>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file ParallelRestart.cpp
+
+#include <config.h>
+
+#include “ParallelRestart.hpp
+
+#include <opm/output/eclipse/EclipseIO.hpp>
+
+#include <opm/input/eclipse/EclipseState/Util/OrderedMap.hpp>
+
+#include <opm/output/eclipse/RestartValue.hpp>
+
+#include <opm/input/eclipse/Schedule/SummaryState.hpp>
+
+ +
+
+file ParallelRestart.hpp
+
+
+#include <vector>
+
+ +
+
+file ParallelSerialization.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/TransMult.hpp>
+
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/Actions.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/ASTNode.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/State.hpp>
+
+#include <opm/input/eclipse/Schedule/GasLiftOpt.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GConSale.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GConSump.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GroupEconProductionLimits.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GSatProd.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GuideRateConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/SICD.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/Valve.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+
+#include <opm/input/eclipse/Schedule/Network/Balance.hpp>
+
+#include <opm/input/eclipse/Schedule/Network/ExtNetwork.hpp>
+
+#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp>
+
+#include <opm/input/eclipse/Schedule/RFTConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/RPTConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQASTNode.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQActive.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQState.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/NameOrder.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WDFAC.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellBrineProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellEconProductionLimits.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellFoamProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellFractureSeeds.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellMICPProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellPolymerProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTracerProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WList.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WListManager.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WVFPDP.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WVFPEXP.hpp>
+ +
+#include <dune/common/parallel/mpihelper.hh>
+
+ +
+
+file ParallelSerialization.hpp
+
+
+ +
+
+file PartiallySupportedFlowKeywords.cpp
+
+
+ +
+
+file PartiallySupportedFlowKeywords.hpp
+
+
+#include <string>
+
+ +
+
+file phaseUsageFromDeck.cpp
+
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/input/eclipse/Deck/Deck.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Runspec.hpp>
+
+ +
+
+file phaseUsageFromDeck.hpp
+
+
+ +
+
+file PressureAverage.cpp
+
+#include <config.h>
+ +
+#include <cassert>
+
+#include <cstddef>
+
+ +
+
+file PressureAverage.hpp
+
+#include <vector>
+
+ +
+
+file PropsDataHandle.hpp
+
+ +
+
+file readDeck.cpp
+
+#include “config.h”
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/OpmLog/EclipsePRTLog.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/utility/OpmInputError.hpp>
+
+#include <opm/common/utility/String.hpp>
+
+#include <opm/io/eclipse/EclIOdata.hpp>
+
+#include <opm/io/eclipse/ERst.hpp>
+
+#include <opm/io/eclipse/RestartFileView.hpp>
+
+#include <opm/io/eclipse/rst/aquifer.hpp>
+
+#include <opm/io/eclipse/rst/state.hpp>
+
+#include <opm/input/eclipse/Deck/Deck.hpp>
+
+#include <opm/input/eclipse/EclipseState/checkDeck.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/FieldData.hpp>
+
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/input/eclipse/Parser/ErrorGuard.hpp>
+
+#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
+
+#include <opm/input/eclipse/Parser/ParseContext.hpp>
+
+#include <opm/input/eclipse/Parser/Parser.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/State.hpp>
+
+#include <opm/input/eclipse/Schedule/ArrayDimChecker.hpp>
+
+#include <opm/input/eclipse/Schedule/ResCoup/ReservoirCouplingInfo.hpp>
+
+#include <opm/input/eclipse/Schedule/ResCoup/MasterGroup.hpp>
+
+#include <opm/input/eclipse/Schedule/ResCoup/Slaves.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/UDQ/UDQState.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
+
+#include <opm/input/eclipse/Units/UnitSystem.hpp>
+ + + + + + + +
+#include <fmt/format.h>
+
+#include <cstdlib>
+
+#include <cstdint>
+
+#include <filesystem>
+
+#include <memory>
+
+#include <regex>
+
+#include <sstream>
+
+#include <stdexcept>
+
+#include <utility>
+
+ +
+
+file readDeck.hpp
+
+
+#include <filesystem>
+
+#include <memory>
+
+#include <optional>
+
+#include <string>
+
+ +
+
+file GasPhaseConsistencyChecks.cpp
+
+#include <config.h>
+ + +
+#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
+
+ +
+
+file GasPhaseConsistencyChecks.hpp
+
+ +
+#include <cstddef>
+
+#include <string>
+
+ +
+
+file OilPhaseConsistencyChecks.cpp
+
+#include <config.h>
+ + +
+#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
+
+ +
+
+file OilPhaseConsistencyChecks.hpp
+
+ +
+#include <cstddef>
+
+#include <string>
+
+ +
+
+file PhaseCheckBase.cpp
+
+#include <config.h>
+ +
+ +
+
+file PhaseCheckBase.hpp
+
+
+ +
+
+file RelpermDiagnostics.cpp
+
+ +
+#include <opm/material/fluidmatrixinteractions/EclEpsGridProperties.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp>
+
+#include <opm/input/eclipse/EclipseState/Runspec.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/TableManager.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/SgfnTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/SgofTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/SgwfnTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/SlgofTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/Sof2Table.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/Sof3Table.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/SsfnTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/SwfnTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/SwofTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/WsfTable.hpp>
+
+#include <opm/input/eclipse/EclipseState/Tables/GsfTable.hpp>
+
+#include <opm/grid/CpGrid.hpp>
+
+#include <opm/grid/polyhedralgrid.hh>
+
+#include <opm/grid/cpgrid/LevelCartesianIndexMapper.hpp>
+
+#include <opm/grid/polyhedralgrid/levelcartesianindexmapper.hh>
+
+

Defines

+
+
+INSTANCE_DIAGNOSIS(...)
+
+ +
+
+ +
+
+file RelpermDiagnostics.hpp
+
+#include <vector>
+
+#include <utility>
+
+#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
+
+ +
+
+file SatfuncCheckPointInterface.hpp
+
+#include <cstddef>
+
+#include <optional>
+
+ +
+
+file SatfuncConsistencyCheckManager.cpp
+
+#include <config.h>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/EndpointScaling.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/FieldProps.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp>
+
+#include <opm/input/eclipse/EclipseState/Phase.hpp>
+
+#include <opm/input/eclipse/EclipseState/Runspec.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclEpsGridProperties.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
+ + + + + + + + +
+#include <algorithm>
+
+#include <array>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <initializer_list>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <string_view>
+
+#include <utility>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file SatfuncConsistencyCheckManager.hpp
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclEpsGridProperties.hpp>
+ + + +
+#include <dune/grid/common/partitionset.hh>
+
+#include <dune/grid/common/rangegenerators.hh>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <memory>
+
+#include <string>
+
+#include <string_view>
+
+#include <type_traits>
+
+#include <vector>
+
+ +
+
+file SatfuncConsistencyChecks.cpp
+
+#include <config.h>
+ + +
+#include <opm/grid/common/CommunicationUtils.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
+
+#include <algorithm>
+
+#include <array>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <limits>
+
+#include <memory>
+
+#include <numeric>
+
+#include <tuple>
+
+#include <utility>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file SatfuncConsistencyChecks.hpp
+
+
+#include <cstddef>
+
+#include <functional>
+
+#include <memory>
+
+#include <random>
+
+#include <string>
+
+#include <string_view>
+
+#include <vector>
+
+ +
+
+file ScaledSatfuncCheckPoint.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclEpsGridProperties.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
+ + +
+ +
+
+file ScaledSatfuncCheckPoint.hpp
+
+ +
+#include <cstddef>
+
+#include <functional>
+
+#include <optional>
+
+ +
+
+file ThreePointHorizontalConsistencyChecks.cpp
+
+#include <config.h>
+ + +
+#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
+
+ +
+
+file ThreePointHorizontalConsistencyChecks.hpp
+
+ +
+#include <cstddef>
+
+#include <string>
+
+ +
+
+file UnscaledSatfuncCheckPoint.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp>
+
+#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
+ +
+#include <cstddef>
+
+#include <optional>
+
+#include <unordered_set>
+
+#include <vector>
+
+ +
+
+file UnscaledSatfuncCheckPoint.hpp
+
+
+#include <cstddef>
+
+#include <optional>
+
+#include <unordered_set>
+
+#include <vector>
+
+ +
+
+file WaterPhaseConsistencyChecks.cpp
+
+#include <config.h>
+ + +
+#include <opm/material/fluidmatrixinteractions/EclEpsScalingPoints.hpp>
+
+ +
+
+file WaterPhaseConsistencyChecks.hpp
+
+ +
+#include <cstddef>
+
+#include <string>
+
+ +
+
+file SerializationPackers.cpp
+
+#include <config.h>
+ +
+#include <boost/date_time/gregorian/gregorian.hpp>
+
+ +
+
+file SerializationPackers.hpp
+
+#include <opm/common/utility/MemPacker.hpp>
+
+#include <boost/date_time/gregorian/gregorian_types.hpp>
+
+ +
+
+file SetupPartitioningParams.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <boost/version.hpp>
+
+#include <filesystem>
+
+#include <map>
+
+#include <optional>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <string_view>
+
+#include <fmt/format.h>
+
+ +
+
+file SetupPartitioningParams.hpp
+
+#include <map>
+
+#include <optional>
+
+#include <string>
+
+ +
+
+file SymmTensor.cpp
+
+#include <config.h>
+ +
+#include <algorithm>
+
+

Defines

+
+
+INSTANTIATE_OPS(T1, T2)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file SymmTensor.hpp
+
+#include <dune/common/fvector.hh>
+ +
+#include <utility>
+
+ +
+
+file UnsupportedFlowKeywords.cpp
+
+
+ +
+
+file UnsupportedFlowKeywords.hpp
+
+
+ +
+
+file VectorVectorDataHandle.hpp
+
+#include <dune/grid/common/datahandleif.hh>
+
+#include <cstddef>
+
+#include <utility>
+

A datahandle sending data located in multiple vectors.

+

+
Author

Markus Blatt, OPM-OP AS

+
+
+

+
+ +
+
+file VoigtArray.cpp
+
+#include <config.h>
+ +
+#include <dune/common/fvector.hh>
+
+#include <algorithm>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file VoigtArray.hpp
+
+#include <algorithm>
+
+#include <array>
+
+#include <cstddef>
+
+#include <initializer_list>
+
+#include <type_traits>
+
+#include <vector>
+
+ +
+
+file ALQState.cpp
+
+
+#include <cstddef>
+
+#include <stdexcept>
+
+ +
+
+file ALQState.hpp
+
+#include <map>
+
+#include <string>
+
+ +
+
+file BlackoilWellModel.hpp
+
+#include <dune/common/fmatrix.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/istl/matrixmatrix.hh>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/Group.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
+
+#include <opm/material/densead/Math.hpp>
+ + +
+#include <opm/simulators/linalg/matrixblock.hh>
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+#include <cstddef>
+
+#include <map>
+
+#include <memory>
+
+#include <string>
+
+#include <tuple>
+
+#include <vector>
+ +
+ +
+
+file BlackoilWellModel_impl.hpp
+
+#include <config.h>
+ +
+#include <opm/grid/utility/cartesianToCompressed.hpp>
+
+#include <opm/common/utility/numeric/RootFinders.hpp>
+
+#include <opm/input/eclipse/Schedule/Network/Balance.hpp>
+
+#include <opm/input/eclipse/Schedule/Network/ExtNetwork.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/PAvgDynamicSourceData.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellMatcher.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestConfig.hpp>
+
+#include <opm/input/eclipse/Units/UnitSystem.hpp>
+ + + + + + + + + + + + +
+#include <algorithm>
+
+#include <cassert>
+
+#include <iomanip>
+
+#include <utility>
+
+#include <optional>
+
+#include <fmt/format.h>
+
+ +
+
+file BlackoilWellModelConstraints.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+ + + +
+#include <fmt/format.h>
+
+#include <stdexcept>
+
+ +
+
+file BlackoilWellModelConstraints.hpp
+
+#include <opm/input/eclipse/Schedule/Group/Group.hpp>
+
+#include <optional>
+
+#include <utility>
+
+ +
+
+file BlackoilWellModelGasLift.cpp
+
+#include <config.h>
+ + + + + +
+#include <fmt/format.h>
+
+ +
+
+file BlackoilWellModelGasLift.hpp
+
+#include “opm/models/utils/basicproperties.hh”
+ +
+#include <memory>
+
+#include <map>
+
+#include <string>
+ +
+ +
+
+file BlackoilWellModelGasLift_impl.hpp
+
+#include <config.h>
+ +
+#include <opm/common/TimingMacros.hpp>
+ +
+

Defines

+
+
+OPM_BLACKOILWELLMODEL_GASLIFT_IMPL_HEADER_INCLUDED
+
+ +
+
+OPM_BLACKOILWELLMODEL_GASLIFT_IMPL_HEADER_INCLUDED
+
+ +
+
+ +
+
+file BlackoilWellModelGeneric.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/output/data/GuideRateValue.hpp>
+
+#include <opm/output/data/Groups.hpp>
+
+#include <opm/output/data/Wells.hpp>
+
+#include <opm/output/eclipse/RestartValue.hpp>
+
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Action/SimulatorUpdate.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GConSale.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GroupEconProductionLimits.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GConSump.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GuideRateConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
+
+#include <opm/input/eclipse/Schedule/Network/Balance.hpp>
+
+#include <opm/input/eclipse/Schedule/Network/ExtNetwork.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestConfig.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+ + + + + + + + + + + + + + +
+#include <algorithm>
+
+#include <cassert>
+
+#include <functional>
+
+#include <stdexcept>
+
+#include <sstream>
+
+#include <tuple>
+
+#include <unordered_map>
+
+#include <unordered_set>
+
+#include <utility>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file BlackoilWellModelGeneric.hpp
+
+#include <opm/output/data/GuideRateValue.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/PAvg.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/PAvgCalculator.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/PAvgCalculatorCollection.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
+ + + + + + + + + + + +
+#include <algorithm>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <map>
+
+#include <memory>
+
+#include <optional>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <unordered_set>
+
+#include <vector>
+
+ +
+
+file BlackoilWellModelGuideRates.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/Group.hpp>
+
+#include <opm/output/data/Groups.hpp>
+
+#include <opm/output/data/GuideRateValue.hpp>
+ + + +
+#include <fmt/format.h>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <stack>
+
+#include <stdexcept>
+
+#include <string_view>
+
+#include <tuple>
+
+#include <unordered_map>
+
+#include <unordered_set>
+
+#include <utility>
+
+ +
+
+file BlackoilWellModelGuideRates.hpp
+
+#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
+
+#include <string>
+
+#include <unordered_map>
+
+ +
+
+file BlackoilWellModelNldd.cpp
+
+#include <config.h>
+ +
+ +
+
+file BlackoilWellModelNldd.hpp
+
+#include <opm/grid/utility/SparseTable.hpp>
+ + + +
+#include <map>
+
+#include <string>
+
+#include <vector>
+ +
+ +
+
+file BlackoilWellModelNldd_impl.hpp
+
+#include <config.h>
+ +
+#include <algorithm>
+
+ +
+
+file BlackoilWellModelRestart.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/Group/GuideRateConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/output/data/Groups.hpp>
+ + + +
+ +
+
+file BlackoilWellModelRestart.hpp
+
+#include <opm/input/eclipse/Schedule/Group/GuideRateModel.hpp>
+
+#include <opm/output/data/Wells.hpp>
+
+#include <vector>
+
+ +
+
+file BlackoilWellModelWBP.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+ +
+#include <cassert>
+
+ +
+
+file BlackoilWellModelWBP.hpp
+
+#include <opm/output/data/Wells.hpp>
+ + +
+#include <cstddef>
+
+#include <optional>
+
+#include <vector>
+
+ +
+
+file ConnectionIndexMap.hpp
+
+#include <cstddef>
+
+#include <vector>
+
+ +
+
+file ConnFiltrateData.cpp
+
+
+ +
+
+file ConnFiltrateData.hpp
+
+#include <vector>
+
+ +
+
+file ConnFracStatistics.hpp
+
+
+#include <array>
+
+#include <cstddef>
+
+#include <type_traits>
+
+ +
+
+file FractionCalculator.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+ + + +
+#include <cassert>
+
+ +
+
+file FractionCalculator.hpp
+
+#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
+
+#include <string>
+
+ +
+
+file GasLiftCommon.cpp
+
+#include <config.h>
+ + + +
+#include <fmt/format.h>
+
+ +
+
+file GasLiftCommon.hpp
+
+
+#include <string>
+
+ +
+
+file GasLiftGroupInfo.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/GasLiftOpt.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+ +
+#include <fmt/format.h>
+
+#include <stdexcept>
+
+ +
+
+file GasLiftGroupInfo.hpp
+
+ +
+#include <map>
+
+#include <optional>
+
+#include <string>
+
+#include <tuple>
+
+#include <vector>
+
+ +
+
+file GasLiftSingleWell.hpp
+
+#include <opm/models/utils/propertysystem.hh>
+ +
+#include <opm/models/discretization/common/fvbaseproperties.hh>
+ + +
+#include <optional>
+ +
+ +
+
+file GasLiftSingleWell_impl.hpp
+
+#include <config.h>
+ +
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/input/eclipse/Schedule/GasLiftOpt.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <string>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file GasLiftSingleWellGeneric.cpp
+
+#include <config.h>
+
+#include <opm/common/TimingMacros.hpp>
+ +
+#include <opm/input/eclipse/Schedule/GasLiftOpt.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+ + + + +
+#include <fmt/format.h>
+
+#include <cassert>
+
+#include <sstream>
+
+ +
+
+file GasLiftSingleWellGeneric.hpp
+
+#include <opm/input/eclipse/Schedule/Well/WellProductionControls.hpp>
+ + + +
+#include <optional>
+
+#include <set>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <tuple>
+
+#include <utility>
+
+ +
+
+file GasLiftStage2.cpp
+
+#include <config.h>
+ +
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/input/eclipse/Schedule/GasLiftOpt.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+ + + + + + + +
+#include <algorithm>
+
+#include <cstddef>
+
+#include <optional>
+
+#include <string>
+
+#include <fmt/format.h>
+
+ +
+
+file GasLiftStage2.hpp
+
+ +
+#include <map>
+
+#include <memory>
+
+#include <optional>
+
+#include <string>
+
+#include <tuple>
+
+#include <vector>
+
+ +
+
+file GasLiftWellState.hpp
+
+#include <optional>
+
+#include <utility>
+
+ +
+
+file GlobalWellInfo.cpp
+
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <stdexcept>
+
+ +
+
+file GlobalWellInfo.hpp
+
+#include <cstddef>
+
+#include <map>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file GroupEconomicLimitsChecker.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/EclipseState.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GroupEconProductionLimits.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestConfig.hpp>
+ + + +
+#include <fmt/format.h>
+
+#include <ctime>
+
+#include <chrono>
+
+#include <sstream>
+
+#include <iomanip>
+
+ +
+
+file GroupEconomicLimitsChecker.hpp
+
+
+#include <opm/input/eclipse/Schedule/Group/GroupEconProductionLimits.hpp>
+
+#include <opm/input/eclipse/Units/UnitSystem.hpp>
+
+#include <array>
+
+#include <map>
+
+#include <string>
+
+ +
+
+file GroupState.cpp
+
+#include <iterator>
+
+#include <opm/json/JsonObject.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GConSump.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+ +
+ +
+
+file GroupState.hpp
+
+#include <opm/input/eclipse/EclipseState/Phase.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GPMaint.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/Group.hpp>
+ + +
+#include <map>
+
+#include <vector>
+
+#include <utility>
+
+ +
+
+file MSWellHelpers.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/SICD.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/Segment.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/material/densead/Math.hpp>
+ + + +
+#include <dune/istl/preconditioners.hh>
+
+#include <dune/istl/solvers.hh>
+
+#include <cmath>
+
+#include <cstddef>
+
+

Defines

+
+
+INSTANTIATE_PARALLELLMSWELLB(T, M, N)
+
+ +
+
+INSTANTIATE_ALL_PARALLELLMSWELLB(T)
+
+ +
+
+INSTANTIATE_UMF(T, Dim)
+
+ +
+
+INSTANTIATE_IMPL(T, ...)
+
+ +
+
+INSTANTIATE_EVAL(T, Dim)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file MSWellHelpers.hpp
+
+#include <dune/istl/matrix.hh>
+
+ +
+
+file MultisegmentWell.hpp
+
+#include <opm/models/common/multiphasebaseproperties.hh>
+ + +
+#include “MultisegmentWell_impl.hpp
+
+ +
+
+file MultisegmentWell_impl.hpp
+
+#include <config.h>
+ +
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/Segment.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/Valve.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Connection.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+
+#include <opm/material/densead/EvaluationFormat.hpp>
+ + + + +
+#include <algorithm>
+
+#include <cstddef>
+
+#include <string>
+
+

Defines

+
+
+EXTRA_DEBUG_MSW
+
+ +
+
+ +
+
+file MultisegmentWellAssemble.cpp
+
+#include <config.h>
+ +
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/models/blackoil/blackoilvariableandequationindices.hh>
+
+#include <opm/models/blackoil/blackoilonephaseindices.hh>
+
+#include <opm/models/blackoil/blackoiltwophaseindices.hh>
+ + + + + + + + + +
+ +
+
+file MultisegmentWellAssemble.hpp
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+ +
+
+file MultisegmentWellEquations.cpp
+
+#include <config.h>
+ +
+#include <dune/istl/umfpack.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+
+#include <opm/simulators/linalg/istlsparsematrixadapter.hh>
+
+#include <opm/simulators/linalg/matrixblock.hh>
+ + + + +
+#include <cstddef>
+
+#include <numeric>
+
+#include <stdexcept>
+
+

Defines

+
+
+EXTRA_DEBUG_MSW
+
+ +
+
+INSTANTIATE(T, numWellEq, numEq)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file MultisegmentWellEquations.hpp
+
+ + +
+#include <dune/common/fmatrix.hh>
+
+#include <dune/common/fvector.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/istl/bvector.hh>
+
+#include <memory>
+
+ +
+
+file MultisegmentWellEval.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/models/blackoil/blackoilvariableandequationindices.hh>
+
+#include <opm/models/blackoil/blackoilonephaseindices.hh>
+
+#include <opm/models/blackoil/blackoiltwophaseindices.hh>
+ + + + + + + +
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <array>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <numeric>
+
+#include <utility>
+
+#include <vector>
+ +
+ +
+
+file MultisegmentWellEval.hpp
+
+ + + + +
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file MultisegmentWellGeneric.cpp
+
+#include <config.h>
+ +
+#include <opm/common/utility/numeric/RootFinders.hpp>
+
+#include <opm/input/eclipse/Schedule/VFPInjTable.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+ + + + + + + +
+#include <cmath>
+
+#include <fmt/format.h>
+
+ +
+
+file MultisegmentWellGeneric.hpp
+
+#include <vector>
+
+ +
+
+file MultisegmentWellPrimaryVariables.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+
+#include <opm/material/fluidsystems/BlackOilDefaultFluidSystemIndices.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/models/blackoil/blackoilvariableandequationindices.hh>
+
+#include <opm/models/blackoil/blackoilonephaseindices.hh>
+
+#include <opm/models/blackoil/blackoiltwophaseindices.hh>
+ + + + + +
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <limits>
+ +
+ +
+
+file MultisegmentWellPrimaryVariables.hpp
+
+#include <opm/material/densead/Evaluation.hpp>
+ +
+#include <opm/input/eclipse/Schedule/SummaryState.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+
+#include <array>
+
+#include <cstddef>
+
+#include <vector>
+
+ +
+
+file MultisegmentWellSegments.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/AICD.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/material/densead/EvaluationFormat.hpp>
+
+#include <opm/material/fluidsystems/BlackOilDefaultFluidSystemIndices.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/models/blackoil/blackoilvariableandequationindices.hh>
+
+#include <opm/models/blackoil/blackoilonephaseindices.hh>
+
+#include <opm/models/blackoil/blackoiltwophaseindices.hh>
+ + + + + +
+#include <fmt/format.h>
+
+#include <array>
+
+#include <cmath>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <utility>
+
+#include <vector>
+ +
+ +
+
+file MultisegmentWellSegments.hpp
+
+ +
+#include <cstddef>
+
+#include <vector>
+
+ +
+
+file ParallelPAvgCalculator.cpp
+
+#include <config.h>
+ + +
+#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/PAvgCalculator.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <functional>
+
+ +
+
+file ParallelPAvgCalculator.hpp
+
+#include <opm/input/eclipse/Schedule/Well/PAvgCalculator.hpp>
+ +
+#include <functional>
+
+ +
+
+file ParallelPAvgDynamicSourceData.cpp
+
+#include <config.h>
+ + +
+#include <opm/grid/common/CommunicationUtils.hpp>
+
+#include <algorithm>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <iterator>
+
+#include <numeric>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file ParallelPAvgDynamicSourceData.hpp
+
+#include <opm/input/eclipse/Schedule/Well/PAvgDynamicSourceData.hpp>
+ +
+#include <cstddef>
+
+#include <functional>
+
+#include <vector>
+
+ +
+
+file ParallelWBPCalculation.cpp
+
+#include <config.h>
+ + + + + +
+#include <opm/input/eclipse/Schedule/Well/PAvgCalculator.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/PAvgCalculatorCollection.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/grid/common/CommunicationUtils.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <tuple>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file ParallelWBPCalculation.hpp
+
+ + +
+#include <opm/input/eclipse/Schedule/Well/PAvgCalculator.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/PAvgCalculatorCollection.hpp>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <memory>
+
+#include <vector>
+
+ +
+
+file ParallelWellInfo.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <fmt/format.h>
+
+#include <cassert>
+
+#include <iterator>
+
+#include <numeric>
+
+

Defines

+
+
+INSTANTIATE_BROADCAST_FIRST_PERF_DENSEAD_EVALUATION(T, DIM)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file ParallelWellInfo.hpp
+
+#include <dune/common/parallel/communicator.hh>
+
+#include <dune/common/parallel/interface.hh>
+
+#include <dune/common/parallel/mpihelper.hh>
+
+#include <dune/common/parallel/plocalindex.hh>
+
+#include <dune/common/parallel/remoteindices.hh>
+ +
+#include <memory>
+
+#include <unordered_map>
+
+ +
+
+file PerfData.cpp
+
+ +
+ +
+
+file PerfData.hpp
+
+ +
+#include <cstddef>
+
+#include <vector>
+
+#include <array>
+
+ +
+
+file PerforationData.hpp
+
+#include <cstddef>
+
+ +
+
+file RateConverter.cpp
+
+#include <config.h>
+ +
+#include <opm/material/fluidsystems/BlackOilDefaultFluidSystemIndices.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <algorithm>
+
+#include <cmath>
+
+#include <stdexcept>
+
+#include <string>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file RateConverter.hpp
+
+#include <opm/grid/utility/RegionMapping.hpp>
+ + + + +
+#include <dune/grid/common/gridenums.hh>
+
+#include <dune/grid/common/rangegenerators.hh>
+
+#include <array>
+
+#include <cassert>
+
+#include <unordered_map>
+
+#include <utility>
+
+#include <vector>
+

Facility for converting component rates at surface conditions to phase (voidage) rates at reservoir conditions.

+

This uses the average hydrocarbon pressure to define fluid properties. The facility is intended to support Reservoir Voidage rates only (‘RESV’).

+
+ +
+
+file RatioCalculator.cpp
+
+#include <config.h>
+ +
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/material/densead/EvaluationFormat.hpp>
+ + +
+#include <fmt/format.h>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file RatioCalculator.hpp
+
+#include <opm/material/densead/Math.hpp>
+
+#include <string>
+
+#include <string_view>
+
+#include <vector>
+
+ +
+
+file RegionAttributeHelpers.hpp
+
+
+#include <opm/grid/utility/RegionMapping.hpp>
+
+#include <dune/grid/common/gridenums.hh>
+
+#include <algorithm>
+
+#include <memory>
+
+#include <stdexcept>
+
+#include <type_traits>
+
+#include <unordered_map>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file RegionAverageCalculator.hpp
+
+ + +
+#include <dune/grid/common/gridenums.hh>
+
+#include <dune/grid/common/rangegenerators.hh>
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <numeric>
+
+#include <unordered_map>
+

Facility for converting component rates at surface conditions to phase (voidage) rates at reservoir conditions.

+

This uses the average hydrocarbon pressure to define fluid properties. The facility is intended to support Reservoir Voidage rates only (‘RESV’).

+
+ +
+
+file RunningStatistics.hpp
+
+#include <cmath>
+
+#include <limits>
+
+#include <optional>
+
+ +
+
+file RuntimePerforation.hpp
+
+ +
+
+file SegmentState.cpp
+
+
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+
+#include <algorithm>
+
+#include <cstddef>
+
+#include <iterator>
+
+#include <stdexcept>
+
+#include <vector>
+
+ +
+
+file SegmentState.hpp
+
+#include <cstddef>
+
+#include <vector>
+
+ +
+
+file SingleWellState.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+ +
+ +
+
+file SingleWellState.hpp
+
+#include <functional>
+
+#include <vector>
+
+#include <opm/input/eclipse/Schedule/Well/WellEnums.hpp>
+
+#include <opm/input/eclipse/Schedule/Events.hpp>
+ + + + +
+ +
+
+file StandardWell.hpp
+
+ + + + + + + +
+#include <opm/models/blackoil/blackoilpolymermodules.hh>
+
+#include <opm/models/blackoil/blackoilsolventmodules.hh>
+
+#include <opm/models/blackoil/blackoilextbomodules.hh>
+
+#include <opm/models/blackoil/blackoilfoammodules.hh>
+
+#include <opm/models/blackoil/blackoilbrinemodules.hh>
+
+#include <opm/models/blackoil/blackoilmicpmodules.hh>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
+ +
+#include <dune/common/dynvector.hh>
+
+#include <dune/common/dynmatrix.hh>
+
+#include <memory>
+
+#include <optional>
+
+#include “StandardWell_impl.hpp
+
+ +
+
+file StandardWell_impl.hpp
+
+#include <config.h>
+ +
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+ + + + + +
+#include <algorithm>
+
+#include <cstddef>
+
+#include <functional>
+
+#include <fmt/format.h>
+
+ +
+
+file StandardWellAssemble.cpp
+
+#include <config.h>
+ +
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/models/blackoil/blackoilvariableandequationindices.hh>
+
+#include <opm/models/blackoil/blackoilonephaseindices.hh>
+
+#include <opm/models/blackoil/blackoiltwophaseindices.hh>
+ + + + + + + + +
+ +
+
+file StandardWellAssemble.hpp
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+ +
+
+file StandardWellConnections.cpp
+
+#include <config.h>
+ +
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/models/blackoil/blackoilvariableandequationindices.hh>
+
+#include <opm/models/blackoil/blackoilonephaseindices.hh>
+
+#include <opm/models/blackoil/blackoiltwophaseindices.hh>
+ + + + + + +
+#include <algorithm>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <functional>
+
+#include <limits>
+
+#include <numeric>
+
+#include <stdexcept>
+
+#include <string_view>
+
+#include <tuple>
+
+#include <variant>
+
+#include <vector>
+
+#include <fmt/format.h>
+ +
+ +
+
+file StandardWellConnections.hpp
+
+
+#include <array>
+
+#include <functional>
+
+#include <tuple>
+
+#include <variant>
+
+#include <vector>
+
+ +
+
+file StandardWellEquations.cpp
+
+#include <config.h>
+
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/common/TimingMacros.hpp>
+ +
+#include <opm/simulators/linalg/istlsparsematrixadapter.hh>
+
+#include <opm/simulators/linalg/matrixblock.hh>
+ + +
+#include <algorithm>
+
+#include <cmath>
+
+#include <cstddef>
+
+

Defines

+
+
+INSTANTIATE(T, N)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file StandardWellEquations.hpp
+
+ +
+#include <opm/common/TimingMacros.hpp>
+
+#include <dune/common/dynmatrix.hh>
+
+#include <dune/common/dynvector.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/istl/bvector.hh>
+
+ +
+
+file StandardWellEval.cpp
+
+#include <config.h>
+ +
+#include <opm/material/densead/EvaluationFormat.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/models/blackoil/blackoilvariableandequationindices.hh>
+
+#include <opm/models/blackoil/blackoilonephaseindices.hh>
+
+#include <opm/models/blackoil/blackoiltwophaseindices.hh>
+ + + + + + + +
+#include <cmath>
+
+#include <cstddef>
+
+#include <fmt/format.h>
+ +
+ +
+
+file StandardWellEval.hpp
+
+ + +
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <vector>
+
+ +
+
+file StandardWellPrimaryVariables.cpp
+
+#include <config.h>
+ +
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+
+#include <dune/common/dynvector.hh>
+
+#include <dune/istl/bvector.hh>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/models/blackoil/blackoilvariableandequationindices.hh>
+
+#include <opm/models/blackoil/blackoilonephaseindices.hh>
+
+#include <opm/models/blackoil/blackoiltwophaseindices.hh>
+ + + +
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <limits>
+
+#include <string>
+ +
+ +
+
+file StandardWellPrimaryVariables.hpp
+
+#include <opm/material/densead/Evaluation.hpp>
+ +
+#include <vector>
+
+ +
+
+file TargetCalculator.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+ + + +
+#include <cassert>
+
+#include <stdexcept>
+
+

Defines

+
+
+INSTANTIATE_TARGET_CALCULATOR(T, ...)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file TargetCalculator.hpp
+
+#include <opm/input/eclipse/Schedule/Group/Group.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
+
+#include <optional>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file VFPHelpers.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/material/densead/Math.hpp>
+
+#include <opm/input/eclipse/Schedule/VFPInjTable.hpp>
+
+#include <opm/input/eclipse/Schedule/VFPProdTable.hpp>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <stdexcept>
+
+

Defines

+
+
+INSTANTIATE(...)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file VFPHelpers.hpp
+
+#include <functional>
+
+#include <map>
+
+#include <vector>
+
+#include <optional>
+
+ +
+
+file VFPInjProperties.cpp
+
+#include “config.h”
+ +
+#include <opm/input/eclipse/Schedule/VFPInjTable.hpp>
+
+#include <opm/material/densead/Math.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+ +
+#include <limits>
+
+

Defines

+
+
+INSTANTIATE(T, ...)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file VFPInjProperties.hpp
+
+#include <functional>
+
+#include <map>
+
+#include <vector>
+
+ +
+
+file VFPProdProperties.cpp
+
+#include “config.h”
+ +
+#include <opm/material/densead/Math.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/input/eclipse/Schedule/VFPProdTable.hpp>
+ +
+#include <cstddef>
+
+

Defines

+
+
+INSTANTIATE(T, ...)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file VFPProdProperties.hpp
+
+#include <functional>
+
+#include <map>
+
+#include <vector>
+
+ +
+
+file VFPProperties.hpp
+
+ + + +
+#include <cstddef>
+
+ +
+
+file WellAssemble.cpp
+
+#include <config.h>
+ +
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+ + + + + + + + +
+#include <opm/input/eclipse/Schedule/Network/ExtNetwork.hpp>
+
+#include <cassert>
+
+#include <stdexcept>
+
+

Defines

+
+
+INSTANTIATE_METHODS(A, ...)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file WellAssemble.hpp
+
+
+#include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellEnums.hpp>
+
+#include <functional>
+
+ +
+
+file WellBhpThpCalculator.cpp
+
+#include <config.h>
+ +
+#include <opm/common/utility/numeric/RootFinders.hpp>
+
+#include <opm/input/eclipse/Schedule/VFPInjTable.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Units/Units.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WVFPDP.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+ + + + + +
+#include <cassert>
+
+#include <cmath>
+
+#include <optional>
+
+#include <fmt/format.h>
+
+

Defines

+
+
+INSTANTIATE(T, ...)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+

Variables

+
+
+static constexpr bool extraBhpAtThpLimitOutput = false
+
+ +
+
+static constexpr bool extraThpFromBhpOutput = false
+
+ +
+
+ +
+
+file WellBhpThpCalculator.hpp
+
+#include <functional>
+
+#include <optional>
+
+#include <vector>
+
+ +
+
+file WellConnectionAuxiliaryModule.hpp
+
+#include <opm/models/discretization/common/baseauxiliarymodule.hh>
+ + + +
+ +
+
+file WellConstraints.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/Well/WVFPEXP.hpp>
+ + + + +
+ +
+
+file WellConstraints.hpp
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <functional>
+
+#include <vector>
+
+#include <optional>
+
+ +
+
+file WellContainer.hpp
+
+#include <initializer_list>
+
+#include <optional>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <unordered_map>
+
+#include <vector>
+
+ +
+
+file WellConvergence.cpp
+
+#include <config.h>
+ + + + + +
+#include <cmath>
+
+#include <stdexcept>
+
+ +
+
+file WellConvergence.hpp
+
+#include <vector>
+
+ +
+
+file WellFilterCake.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+ + + + +
+#include <fmt/format.h>
+
+#include <stdexcept>
+
+ +
+
+file WellFilterCake.hpp
+
+#include <cstddef>
+
+#include <vector>
+
+ +
+
+file WellGroupConstraints.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+ + + + +
+ +
+
+file WellGroupConstraints.hpp
+
+#include <functional>
+
+#include <utility>
+
+#include <vector>
+
+#include <string>
+
+#include <optional>
+
+ +
+
+file WellGroupControls.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/EclipseState/Phase.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GConSale.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/Group.hpp>
+
+#include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
+
+#include <opm/material/densead/Evaluation.hpp>
+ + + + + + +
+#include <algorithm>
+
+#include <cstddef>
+
+#include <cassert>
+
+

Defines

+
+
+INSTANTIATE(T, ...)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file WellGroupControls.hpp
+
+#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
+
+#include <string>
+
+#include <functional>
+
+#include <optional>
+
+#include <vector>
+
+ +
+
+file WellGroupHelpers.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GConSump.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GConSale.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GSatProd.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GPMaint.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/Group.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GuideRateConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Network/ExtNetwork.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+ + + + + + + + + + +
+#include <opm/common/TimingMacros.hpp>
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <set>
+
+#include <stack>
+
+#include <stdexcept>
+
+

Defines

+
+
+EXTRA_DEBUG_NETWORK
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file WellGroupHelpers.hpp
+
+#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
+
+#include <opm/input/eclipse/Schedule/Group/GSatProd.hpp>
+
+#include <opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
+ +
+#include <opm/input/eclipse/Schedule/ScheduleState.hpp>
+
+#include <map>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file WellHelpers.cpp
+
+#include <config.h>
+
+#include <opm/common/TimingMacros.hpp>
+ +
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellInjectionControls.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellProductionControls.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellEnums.hpp>
+ +
+#include <fmt/format.h>
+
+#include <cstddef>
+
+#include <vector>
+
+

Defines

+
+
+INSTANTIATE(T, Dim)
+
+ +
+
+INSTANTIATE_WE(T, Dim)
+
+ +
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file WellHelpers.hpp
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/common/dynmatrix.hh>
+
+ +
+
+file WellInterface.hpp
+
+#include <opm/common/OpmLog/OpmLog.hpp>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
+
+#include <opm/material/fluidstates/BlackOilFluidState.hpp>
+
+#include <opm/models/blackoil/blackoilproperties.hh>
+
+#include <opm/simulators/linalg/linalgproperties.hh>
+ + + + + + + + + + + +
+#include <dune/common/fmatrix.hh>
+
+#include <dune/istl/bcrsmatrix.hh>
+
+#include <dune/istl/matrixmatrix.hh>
+
+#include <opm/material/densead/Evaluation.hpp>
+
+#include <vector>
+
+#include “WellInterface_impl.hpp
+
+ +
+
+file WellInterface_impl.hpp
+
+#include <config.h>
+ +
+#include <opm/common/Exceptions.hpp>
+
+#include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WDFAC.hpp>
+ + + + + +
+#include <dune/common/version.hh>
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <cstddef>
+
+#include <utility>
+
+#include <fmt/format.h>
+
+ +
+
+file WellInterfaceFluidSystem.cpp
+
+#include <config.h>
+ +
+#include <opm/grid/utility/RegionMapping.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+ + + + + + + + + + + +
+ +
+
+file WellInterfaceFluidSystem.hpp
+
+ +
+#include <limits>
+
+#include <optional>
+
+#include <vector>
+
+ +
+
+file WellInterfaceGeneric.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/FilterCake.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellBrineProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellFoamProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellMICPProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellPolymerProperties.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WVFPEXP.hpp>
+ + + + + + + + + +
+#include <fmt/format.h>
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <cmath>
+
+#include <cstddef>
+
+#include <stdexcept>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file WellInterfaceGeneric.hpp
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+ + +
+#include <map>
+
+#include <optional>
+
+#include <string>
+
+#include <vector>
+
+ +
+
+file WellInterfaceIndices.cpp
+
+#include <config.h>
+ +
+#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>
+
+#include <opm/models/blackoil/blackoilvariableandequationindices.hh>
+
+#include <opm/models/blackoil/blackoilonephaseindices.hh>
+
+#include <opm/models/blackoil/blackoiltwophaseindices.hh>
+
+#include <cassert>
+ +
+ +
+
+file WellInterfaceIndices.hpp
+
+#include <opm/material/densead/Evaluation.hpp>
+ +
+ +
+
+file WellProdIndexCalculator.cpp
+
+
+#include <opm/input/eclipse/Schedule/Well/Connection.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <algorithm>
+
+#include <cmath>
+
+#include <numeric>
+
+#include <stdexcept>
+
+#include <vector>
+
+

Defines

+
+
+INSTANTIATE_TYPE(T)
+
+ +
+
+ +
+
+file WellProdIndexCalculator.hpp
+
+#include <cstddef>
+
+#include <vector>
+
+ +
+
+file WellState.cpp
+
+#include <config.h>
+ +
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
+
+#include <opm/input/eclipse/Schedule/Schedule.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/Well.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/output/data/Wells.hpp>
+ + + + + +
+#include <opm/grid/common/p2pcommunicator.hh>
+
+#include <algorithm>
+
+#include <cassert>
+
+#include <initializer_list>
+
+#include <numeric>
+
+#include <optional>
+
+#include <set>
+
+#include <stdexcept>
+
+#include <type_traits>
+
+#include <utility>
+
+#include <vector>
+
+#include <fmt/format.h>
+
+ +
+
+file WellState.hpp
+
+#include <dune/common/version.hh>
+
+#include <dune/common/parallel/mpihelper.hh>
+
+#include <opm/common/ErrorMacros.hpp>
+
+#include <opm/input/eclipse/Schedule/Events.hpp>
+
+#include <opm/output/data/Wells.hpp>
+ + + + + + + + +
+#include <algorithm>
+
+#include <cstddef>
+
+#include <cstdint>
+
+#include <functional>
+
+#include <map>
+
+#include <optional>
+
+#include <string>
+
+#include <utility>
+
+#include <vector>
+
+ +
+
+file WellTest.cpp
+
+#include <config.h>
+ +
+#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellEconProductionLimits.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestConfig.hpp>
+
+#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
+ + + + +
+ +
+
+file WellTest.hpp
+
+#include <limits>
+
+#include <vector>
+
+ +
+
+file WellTracerRate.hpp
+
+#include <string>
+
+#include <unordered_map>
+
+ +
+
+file WGState.cpp
+
+ +
+ +
+
+file WGState.hpp
+
+ +
+#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
+
+#include <memory>
+
+ +
+
+page Todo List
+

+
+Member Opm::gpuistl::detail::cublasSafeCall  (cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

Refactor to use std::source_location once we shift to C++20

+
+ +
+
+Member Opm::gpuistl::detail::cublasWarnIfError  (cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

Refactor to use std::source_location once we shift to C++20

+
+ +
+
+Member Opm::gpuistl::detail::cudaSafeCall  (cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

Refactor to use std::source_location once we shift to C++20

+
+ +
+
+Member Opm::gpuistl::detail::cudaWarnIfError  (cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

Refactor to use std::source_location once we shift to C++20

+
+ +
+
+Member Opm::gpuistl::detail::cusparseSafeCall  (cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

Refactor to use std::source_location once we shift to C++20

+
+ +
+
+Member Opm::gpuistl::detail::cusparseWarnIfError  (cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

Refactor to use std::source_location once we shift to C++20

+
+ +
+
+Member Opm::gpuistl::detail::getCublasErrorMessage  (cublasStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

Refactor to use std::source_location once we shift to C++20

+
+ +
+
+Member Opm::gpuistl::detail::getCudaErrorMessage  (cudaError_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

Refactor to use std::source_location once we shift to C++20

+
+ +
+
+Member Opm::gpuistl::detail::getCusparseErrorMessage  (cusparseStatus_t error, const std::string_view &expression, const std::string_view &filename, const std::string_view &functionName, size_t lineNumber)
+

Refactor to use std::source_location once we shift to C++20

+
+ +
+
+Member Opm::gpuistl::detail::to_int  (std::size_t s)
+

This can be done for more generic types, but then it is probably wise to wait for C++20’s cmp-functions

+
+ +
+
+Member Opm::gpuistl::detail::to_size_t  (int i)
+

This can be done for more generic types, but then it is probably wise to wait for C++20’s cmp-functions

+
+ +
+
+Class Opm::gpuistl::GpuDILU< CPUMatrixT, X, Y, l >
+

Remove the reliance on CPUMatrix. We should be able to use the GPU matrix type directly.

+
+ +
+
+Class Opm::gpuistl::OpmGpuILU0< CPUMatrixT, X, Y, l >
+

Remove the reliance on CPUMatrix. We should be able to use the GPU matrix type directly.

+
+ +
+
+Member Opm::gpuistl::SolverAdapter< Operator, UnderlyingSolver, X >::SolverAdapter  (Operator &op, Dune::ScalarProduct< X > &sp, std::shared_ptr< Dune::Preconditioner< X, X > > prec, scalar_real_type reduction, int maxit, int verbose, const Comm &comm)
+

Use a std::forward in this function

+
+ +
+
+Member Opm::ParallelWellInfo< Scalar >::sumPerfValues  (It begin, It end) const
+

cater for overlap later. Currently only owner

+
+ +
+
+Member Opm::StandardWellPrimaryVariables< FluidSystem, Indices >::Bhp
+

: We should have indices for the well equations and well primary variables separately.

+
+ +

+
+ +
+
+dir opm/simulators/aquifers
+
+ +
+
+dir opm/models/blackoil
+
+ +
+
+dir opm/simulators/linalg/gpubridge/cuda
+
+ +
+
+dir opm/simulators/linalg/gpuistl/detail
+
+ +
+
+dir opm/simulators/flow/equil
+
+ +
+
+dir opm/simulators/flow
+
+ +
+
+dir opm/simulators/linalg/gpubridge
+
+ +
+
+dir opm/simulators/linalg/gpuistl
+
+ +
+
+dir opm/models/io
+
+ +
+
+dir opm/simulators/linalg
+
+ +
+
+dir opm/models
+
+ +
+
+dir opm/models/nonlinear
+
+ +
+
+dir opm/simulators/linalg/gpubridge/opencl
+
+ +
+
+dir opm
+
+ +
+
+dir opm/models/parallel
+
+ +
+
+dir opm/simulators/linalg/gpuistl/detail/preconditionerKernels
+
+ +
+
+dir opm/simulators/flow/python
+
+ +
+
+dir opm/simulators/linalg/gpubridge/rocm
+
+ +
+
+dir opm/simulators/utils/satfunc
+
+ +
+
+dir opm/simulators
+
+ +
+
+dir opm/simulators/timestepping
+
+ +
+
+dir opm/models/utils
+
+ +
+
+dir opm/simulators/utils
+
+ +
+
+dir opm/simulators/wells
+
+ +
+
+page Documentation for the opm-simulators library.
+

Solvers and simulators

+

The opm-simulators module is the home for the Flow reservoir simulators and library functionality on which they depend.

+
+ +
+ +