My Project
Opm::WellState Class Reference

The state of a set of wells, tailored for use by the fully implicit blackoil simulator. More...

#include <WellState.hpp>

Public Member Functions

 WellState (const ParallelWellInfo &pinfo)
 
 WellState (const PhaseUsage &pu)
 
std::size_t size () const
 
std::vector< std::string > wells () const
 
int numWells () const
 
const ParallelWellInfoparallelWellInfo (std::size_t well_index) const
 
void init (const std::vector< double > &cellPressures, const Schedule &schedule, const std::vector< Well > &wells_ecl, const std::vector< std::reference_wrapper< ParallelWellInfo > > &parallel_well_info, const int report_step, const WellState *prevState, const std::vector< std::vector< PerforationData > > &well_perf_data, const SummaryState &summary_state)
 Allocate and initialize if wells is non-null. More...
 
void resize (const std::vector< Well > &wells_ecl, const std::vector< std::reference_wrapper< ParallelWellInfo > > &parallel_well_info, const Schedule &schedule, const bool handle_ms_well, const size_t numCells, const std::vector< std::vector< PerforationData > > &well_perf_data, const SummaryState &summary_state)
 
void setCurrentWellRates (const std::string &wellName, const std::vector< double > &new_rates)
 
const std::vector< double > & currentWellRates (const std::string &wellName) const
 
bool hasWellRates (const std::string &wellName) const
 
void clearWellRates ()
 
template<class Communication >
void gatherVectorsOnRoot (const std::vector< data::Connection > &from_connections, std::vector< data::Connection > &to_connections, const 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.
 
template<class Comm >
void communicateGroupRates (const Comm &comm)
 
template<class Comm >
void updateGlobalIsGrup (const Comm &comm)
 
bool isInjectionGrup (const std::string &name) const
 
bool isProductionGrup (const std::string &name) const
 
double getALQ (const std::string &name) const
 
void setALQ (const std::string &name, double value)
 
int gliftGetDebugCounter ()
 
void gliftSetDebugCounter (int value)
 
int gliftUpdateDebugCounter ()
 
bool gliftCheckAlqOscillation (const std::string &name) const
 
int gliftGetAlqDecreaseCount (const std::string &name)
 
int gliftGetAlqIncreaseCount (const std::string &name)
 
void gliftUpdateAlqIncreaseCount (const std::string &name, bool increase)
 
void gliftTimeStepInit ()
 
int wellNameToGlobalIdx (const std::string &name)
 
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
 
void updateStatus (int well_index, WellStatus status)
 
void openWell (int well_index)
 
void shutWell (int well_index)
 
void stopWell (int well_index)
 
int numPhases () const
 The number of phases present.
 
const PhaseUsagephaseUsage () const
 
std::vector< double > & wellRates (std::size_t well_index)
 One rate per well and phase.
 
const std::vector< double > & wellRates (std::size_t well_index) const
 
const std::string & name (std::size_t well_index) const
 
std::optional< std::size_t > index (const std::string &well_name) const
 
const SingleWellStateoperator[] (std::size_t well_index) const
 
const SingleWellStateoperator[] (const std::string &well_name) const
 
SingleWellStateoperator[] (std::size_t well_index)
 
SingleWellStateoperator[] (const std::string &well_name)
 
const SingleWellStatewell (std::size_t well_index) const
 
const SingleWellStatewell (const std::string &well_name) const
 
SingleWellStatewell (std::size_t well_index)
 
SingleWellStatewell (const std::string &well_name)
 
bool has (const std::string &well_name) const
 
bool operator== (const WellState &) const
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 

Static Public Member Functions

static WellState serializationTestObject (const ParallelWellInfo &pinfo)
 
static void calculateSegmentRates (const std::vector< std::vector< int > > &segment_inlets, const std::vector< std::vector< int > > &segment_perforations, const std::vector< double > &perforation_rates, const int np, const int segment, std::vector< double > &segment_rates)
 

Static Public Attributes

static const 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
 

Detailed Description

The state of a set of wells, tailored for use by the fully implicit blackoil simulator.

Member Function Documentation

◆ init()

void Opm::WellState::init ( const std::vector< double > &  cellPressures,
const Schedule &  schedule,
const std::vector< Well > &  wells_ecl,
const std::vector< std::reference_wrapper< ParallelWellInfo > > &  parallel_well_info,
const int  report_step,
const WellState prevState,
const std::vector< std::vector< PerforationData > > &  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(), wellRates() and perfPhaseRatesORG() fields, depending on controls


The documentation for this class was generated from the following files: