My Project
Opm Namespace Reference

This file contains a set of helper functions used by VFPProd / VFPInj. More...

Namespaces

 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.
 

Classes

class  BlackoilPhases
 
struct  PhaseUsage
 
class  RelpermDiagnostics
 This class is intend to be a relperm diagnostics, to detect wrong input of relperm table and endpoints. More...
 
class  AquiferAnalytical
 
class  AquiferCarterTracy
 
class  AquiferFetkovich
 
class  AquiferInterface
 
class  AquiferNumerical
 
class  SupportsFaceTag
 
class  SupportsFaceTag< Dune::CpGrid >
 
class  BlackoilAquiferModel
 Class for handling the blackoil well model. More...
 
class  BlackoilModelEbos
 A model implementation for three-phase black oil. More...
 
struct  BlackoilModelParametersEbos
 Solver parameters for the BlackoilModel. More...
 
class  FlowMainEbos
 
class  Main
 
class  NonlinearSolverEbos
 A nonlinear solver class suitable for general fully-implicit models, as well as pressure, transport and sequential models. More...
 
class  SimulatorFullyImplicitBlackoilEbos
 a simulator for the blackoil model More...
 
class  BdaBridge
 BdaBridge acts as interface between opm-simulators with the BdaSolvers. More...
 
class  WellContributionsCuda
 
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. More...
 
class  WellContributionsOCL
 
class  WellContributions
 This class serves to eliminate the need to include the WellContributions into the matrix (with –matrix-add-well-contributions=true) for the cusparseSolver If the –matrix-add-well-contributions commandline parameter is true, this class should not be used So far, StandardWell and MultisegmentWell are supported StandardWells are only supported for cusparseSolver (CUDA), MultisegmentWells are supported for both cusparseSolver and openclSolver A single instance (or pointer) of this class is passed to the BdaSolver. More...
 
class  ISTLSolverEbos
 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 . More...
 
struct  FlowLinearSolverParameters
 This class carries all parameters for the NewtonIterationBlackoilInterleaved class. More...
 
class  MatrixBlock
 
class  PreconditionerFactory
 This is an object factory for creating preconditioners. More...
 
class  ParallelOverlappingILU0
 A two-step version of an overlapping Schwarz preconditioner using one step ILU0 as. More...
 
class  ParallelOverlappingILU0Args
 
class  ParallelRestrictedOverlappingSchwarz
 Block parallel preconditioner. More...
 
struct  AMGHelper
 
struct  AMGSmootherArgsHelper
 
struct  AMGSmootherArgsHelper< Opm::ParallelOverlappingILU0< M, V, V, C > >
 
struct  StandardPreconditioners
 
struct  StandardPreconditioners< Operator, Dune::Amg::SequentialInformation >
 
class  PressureBhpTransferPolicy
 
class  PressureTransferPolicy
 
class  PropertyTree
 
class  LinearOperatorExtra
 Linear operator wrapper for well model. More...
 
class  WellModelAsLinearOperator
 
class  WellModelMatrixAdapter
 Adapter to combine a matrix and another linear operator into a combined linear operator. More...
 
class  WellModelGhostLastMatrixAdapter
 Adapter to combine a matrix and another linear operator into a combined linear operator. More...
 
class  AdaptiveSimulatorTimer
 Simulation timer for adaptive time stepping. More...
 
class  AdaptiveTimeSteppingEbos
 
class  ConvergenceReport
 Represents the convergence status of the whole simulator, to make it possible to query and store the reasons for convergence failures. More...
 
struct  SimulatorReportSingle
 A struct for returning timing data from a simulator to its caller. More...
 
struct  SimulatorReport
 
class  SimulatorTimer
 
class  SimulatorTimerInterface
 Interface class for SimulatorTimer objects, to be improved. More...
 
class  SimpleIterationCountTimeStepControl
 A simple iteration count based adaptive time step control. More...
 
class  PIDTimeStepControl
 PID controller based adaptive time step control as suggested in: Turek and Kuzmin. More...
 
class  PIDAndIterationCountTimeStepControl
 PID controller based adaptive time step control as above that also takes an target iteration into account. More...
 
class  HardcodedTimeStepControl
 HardcodedTimeStepControl Input generated from summary file using the ert application: More...
 
class  RelativeChangeInterface
 RelativeChangeInterface. More...
 
class  TimeStepControlInterface
 TimeStepControlInterface. More...
 
class  DeferredLogger
 
class  ParallelFieldPropsManager
 Parallel frontend to the field properties. More...
 
class  ParallelEclipseState
 Parallel frontend to the EclipseState. More...
 
class  VectorVectorDataHandle
 A data handle sending multiple data store in vectors attached to cells. More...
 
class  ALQState
 
class  BlackoilWellModel
 Class for handling the blackoil well model. More...
 
class  BlackoilWellModelGeneric
 Class for handling the blackoil well model. More...
 
class  GasLiftCommon
 
class  GasLiftGroupInfo
 
class  GasLiftSingleWell
 
class  GasLiftSingleWellGeneric
 
class  GasLiftStage2
 
class  GasLiftWellState
 
class  GlobalWellInfo
 
class  GroupState
 
class  MultisegmentWell
 
class  WellInterfaceIndices
 
class  MultisegmentWellEval
 
class  MultisegmentWellGeneric
 
struct  CopyGatherScatter
 
class  CommunicateAboveBelow
 Class to facilitate getting values associated with the above/below perforation. More...
 
class  GlobalPerfContainerFactory
 A factory for creating a global data representation for distributed wells. More...
 
class  ParallelWellInfo
 Class encapsulating some information about parallel wells. More...
 
class  CheckDistributedWellConnections
 Class checking that all connections are on active cells. More...
 
class  PerfData
 
struct  PerforationData
 Static data associated with a well perforation. More...
 
class  SegmentState
 
class  SingleWellState
 
class  StandardWell
 
class  StandardWellEval
 
class  StandardWellGeneric
 
class  VFPInjProperties
 
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. More...
 
class  VFPProperties
 A thin wrapper class that holds one VFPProdProperties and one VFPInjProperties object. More...
 
class  WellConnectionAuxiliaryModule
 
class  WellContainer
 
class  WellInterface
 
class  WellInterfaceFluidSystem
 
class  WellInterfaceEval
 
class  WellInterfaceGeneric
 
class  WellProdIndexCalculator
 Collect per-connection static information to enable calculating connection-level or well-level productivity index values when incorporating dynamic phase mobilities. More...
 
class  WellState
 The state of a set of wells, tailored for use by the fully implicit blackoil simulator. More...
 
struct  WGState
 

Typedefs

typedef Dune::InverseOperatorResult InverseOperatorResult
 
using CommSeq = Dune::Amg::SequentialInformation
 
template<int Dim>
using OpFSeq = Dune::MatrixAdapter< Dune::BCRSMatrix< Dune::FieldMatrix< double, Dim, Dim > >, Dune::BlockVector< Dune::FieldVector< double, Dim > >, Dune::BlockVector< Dune::FieldVector< double, Dim > >>
 
template<int Dim>
using OpBSeq = Dune::MatrixAdapter< Dune::BCRSMatrix< Opm::MatrixBlock< double, Dim, Dim > >, Dune::BlockVector< Dune::FieldVector< double, Dim > >, Dune::BlockVector< Dune::FieldVector< double, Dim > >>
 
template<int Dim, bool overlap>
using OpW = WellModelMatrixAdapter< Dune::BCRSMatrix< MatrixBlock< double, Dim, Dim > >, Dune::BlockVector< Dune::FieldVector< double, Dim > >, Dune::BlockVector< Dune::FieldVector< double, Dim > >, overlap >
 
template<int Dim, bool overlap>
using OpWG = WellModelGhostLastMatrixAdapter< Dune::BCRSMatrix< MatrixBlock< double, Dim, Dim > >, Dune::BlockVector< Dune::FieldVector< double, Dim > >, Dune::BlockVector< Dune::FieldVector< double, Dim > >, overlap >
 
using FluidSys = BlackOilFluidSystem< double, BlackOilDefaultIndexTraits >
 

Enumerations

enum class  MILU_VARIANT {
  ILU = 0 , MILU_1 = 1 , MILU_2 = 2 , MILU_3 = 3 ,
  MILU_4 = 4
}
 
enum class  FileOutputMode { OUTPUT_NONE = 0 , OUTPUT_LOG_ONLY = 1 , OUTPUT_ALL = 3 }
 

Functions

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.
 
template<class TypeTag >
int flowEbosMain (int argc, char **argv, bool outputCout, bool outputFiles)
 
void outputReportStep (const SimulatorTimer &timer)
 
void outputTimestampFIP (const SimulatorTimer &timer, const std::string &title, const std::string &version)
 
template<class BridgeMatrix >
int replaceZeroDiagonal (BridgeMatrix &mat, std::vector< typename BridgeMatrix::size_type > &diag_indices)
 
template<class BridgeMatrix >
void checkMemoryContiguous (const BridgeMatrix &mat)
 
 INSTANTIATE_BDA_FUNCTIONS (1)
 
 INSTANTIATE_BDA_FUNCTIONS (2)
 
 INSTANTIATE_BDA_FUNCTIONS (3)
 
 INSTANTIATE_BDA_FUNCTIONS (4)
 
 INSTANTIATE_BDA_FUNCTIONS (5)
 
 INSTANTIATE_BDA_FUNCTIONS (6)
 
template<class Graph >
std::tuple< std::vector< int >, int, std::vector< std::size_t > > colorVerticesWelshPowell (const Graph &graph)
 Color the vertices of graph. More...
 
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
 
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. More...
 
template<class Communication >
void extendCommunicatorWithWells (const Communication &comm, std::shared_ptr< Communication > &commRW, const int nw)
 
template std::string PropertyTree::get< std::string > (const std::string &key) const
 
template std::string PropertyTree::get< std::string > (const std::string &key, const std::string &defValue) const
 
template void PropertyTree::put< std::string > (const std::string &key, const std::string &value)
 
PropertyTree setupPropertyTree (FlowLinearSolverParameters p, bool LinearSolverMaxIterSet, bool CprMaxEllIterSet)
 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. More...
 
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 ([[maybe_unused]] const std::string &conf, const FlowLinearSolverParameters &p)
 
PropertyTree setupILU ([[maybe_unused]] 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)
 
void logTimer (const AdaptiveSimulatorTimer &substepTimer)
 
ConvergenceReport gatherConvergenceReport (const ConvergenceReport &local_report, Parallel::Communication mpi_communicator[[maybe_unused]])
 
ConvergenceReport gatherConvergenceReport (const ConvergenceReport &local_report, Parallel::Communication 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)". More...
 
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)
 
RestartValue loadParallelRestart (const EclipseIO *eclIO, Action::State &actionState, SummaryState &summaryState, const std::vector< RestartKey > &solutionKeys, const std::vector< RestartKey > &extraKeys, Parallel::Communication comm)
 
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. More...
 
template<class T >
void eclBroadcast (Parallel::Communication comm, T &data)
 
template void eclBroadcast< TransMult > (Parallel::Communication, TransMult &)
 
template void eclBroadcast< Schedule > (Parallel::Communication, Schedule &)
 
void ensureOutputDirExists (const std::string &cmdline_output_dir)
 
FileOutputMode setupLogging (int mpi_rank_, 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< Deck > &deck, 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::unique_ptr< ErrorGuard > errorGuard, std::shared_ptr< Python > python, std::unique_ptr< ParseContext > parseContext, bool initFromRestart, bool checkDeck, const std::optional< int > &outputInterval)
 Reads the deck and creates all necessary objects if needed. More...
 
void verifyValidCellGeometry (Parallel::Communication comm, const EclipseState &eclipseState)
 
std::map< std::string, std::string > setupZoltanParams (const std::string &conf)
 
bool has_control (int controls, Group::InjectionCMode cmode)
 
bool operator< (const ParallelWellInfo &well1, const ParallelWellInfo &well2)
 
bool operator== (const ParallelWellInfo &well1, const ParallelWellInfo &well2)
 
bool operator!= (const ParallelWellInfo &well1, const ParallelWellInfo &well2)
 
bool operator< (const std::pair< std::string, bool > &pair, const ParallelWellInfo &well)
 
bool operator< (const ParallelWellInfo &well, const std::pair< std::string, bool > &pair)
 
bool operator== (const std::pair< std::string, bool > &pair, const ParallelWellInfo &well)
 
bool operator== (const ParallelWellInfo &well, const std::pair< std::string, bool > &pair)
 
bool operator!= (const std::pair< std::string, bool > &pair, const ParallelWellInfo &well)
 
bool operator!= (const ParallelWellInfo &well, const std::pair< std::string, bool > &pair)
 
std::vector< double > connectionProdIndStandard (const WellProdIndexCalculator &wellPICalc, const std::vector< double > &connMobility)
 Compute connection-level productivity index values for all connections in a well. More...
 
double wellProdIndStandard (const WellProdIndexCalculator &wellPICalc, const std::vector< double > &connMobility)
 Compute well-level productivity index value. More...
 
template void WellState::updateGlobalIsGrup< Parallel::Communication > (const Parallel::Communication &comm)
 
template void WellState::communicateGroupRates< Parallel::Communication > (const Parallel::Communication &comm)
 

Detailed Description

This file contains a set of helper functions used by VFPProd / VFPInj.

Enumeration Type Documentation

◆ FileOutputMode

enum Opm::FileOutputMode
strong
Enumerator
OUTPUT_NONE 

No file output.

OUTPUT_LOG_ONLY 

Output only to log files, no ECLIPSE output.

OUTPUT_ALL 

Output to all files.

◆ MILU_VARIANT

enum Opm::MILU_VARIANT
strong
Enumerator
ILU 

Do not perform modified ILU.

MILU_1 

$U_{ii} = U_{ii} +$ sum(dropped entries)

MILU_2 

$U_{ii} = U_{ii} + sign(U_{ii}) * $ sum(dropped entries)

MILU_3 

$U_{ii} = U_{ii} sign(U_{ii}) * $ sum(|dropped entries|)

MILU_4 

$U_{ii} = U_{ii} + (U_{ii}>0?1:0) * $ sum(dropped entries)

Function Documentation

◆ accumulateMaskedValues()

template<class T1 >
auto Opm::accumulateMaskedValues ( const T1 &  container,
const std::vector< double > *  maskContainer 
) -> decltype(container[0] *(*maskContainer)[0])

Accumulates entries masked with 1.

Parameters
containerThe container whose values to accumulate.
maskContainernull 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.

◆ colorVerticesWelshPowell()

template<class Graph >
std::tuple<std::vector<int>, int, std::vector<std::size_t> > Opm::colorVerticesWelshPowell ( const Graph &  graph)

Color the vertices of graph.

It uses the algorithm of Welsh and Powell for this.

Parameters
graphThe 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

◆ connectionProdIndStandard()

std::vector< double > Opm::connectionProdIndStandard ( const WellProdIndexCalculator wellPICalc,
const std::vector< double > &  connMobility 
)

Compute connection-level productivity index values for all connections in a well.

Parameters
[in]wellPICalcProductivity index calculator.
[in]connMobilityPhase 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.

◆ eclStateBroadcast()

void Opm::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
eclStateEclipseState to broadcast !
scheduleSchedule to broadcast !
summaryConfigSummaryConfig to broadcast

◆ moduleVersion()

std::string Opm::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)".

◆ readDeck()

void Opm::readDeck ( Parallel::Communication  comm,
const std::string &  deckFilename,
std::shared_ptr< Deck > &  deck,
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::unique_ptr< ErrorGuard >  errorGuard,
std::shared_ptr< Python >  python,
std::unique_ptr< ParseContext >  parseContext,
bool  initFromRestart,
bool  checkDeck,
const std::optional< int > &  outputInterval 
)

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.

◆ setupPropertyTree()

PropertyTree Opm::setupPropertyTree ( FlowLinearSolverParameters  p,
bool  LinearSolverMaxIterSet,
bool  CprMaxEllIterSet 
)

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 –linear-solver-reduction, –linear-solver-maxiter and –linear-solver-verbosity are used, but if reading from file the data in the JSON file will override any other options.

◆ wellProdIndStandard()

double Opm::wellProdIndStandard ( const WellProdIndexCalculator wellPICalc,
const std::vector< double > &  connMobility 
)

Compute well-level productivity index value.

Parameters
[in]wellPICalcProductivity index calculator.
[in]connMobilityPhase 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.