#include <WellState.hpp>

Inheritance diagram for Opm::WellState< Scalar >:
Inheritance graph

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< Scalar > &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)
 
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 std::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< Scalar > &new_rates)
 
const std::vector< Scalar > & currentWellRates (const std::string &wellName) const
 
bool hasWellRates (const std::string &wellName) const
 
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. More...
 
void communicateGroupRates (const Parallel::Communication &comm)
 
void updateGlobalIsGrup (const Parallel::Communication &comm)
 
bool isInjectionGrup (const std::string &name) const
 
bool isProductionGrup (const std::string &name) const
 
Scalar getALQ (const std::string &name) const
 
void setALQ (const std::string &name, Scalar 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 ()
 
void updateWellsDefaultALQ (const std::vector< Well > &wells_ecl, const SummaryState &summary_state)
 
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. More...
 
const PhaseUsagephaseUsage () const
 
std::vector< Scalar > & wellRates (std::size_t well_index)
 One rate per well and phase. More...
 
const std::vector< Scalar > & 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 SingleWellState< Scalar > & operator[] (std::size_t well_index) const
 
const SingleWellState< Scalar > & operator[] (const std::string &well_name) const
 
SingleWellState< Scalar > & operator[] (std::size_t well_index)
 
SingleWellState< Scalar > & operator[] (const std::string &well_name)
 
const SingleWellState< Scalar > & well (std::size_t well_index) const
 
const SingleWellState< Scalar > & well (const std::string &well_name) const
 
SingleWellState< Scalar > & well (std::size_t well_index)
 
SingleWellState< Scalar > & well (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< Scalar > &perforation_rates, const int np, const int segment, std::vector< Scalar > &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

template<class Scalar>
class Opm::WellState< Scalar >

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

Constructor & Destructor Documentation

◆ WellState() [1/2]

template<class Scalar >
Opm::WellState< Scalar >::WellState ( const ParallelWellInfo pinfo)
explicit

◆ WellState() [2/2]

template<class Scalar >
Opm::WellState< Scalar >::WellState ( const PhaseUsage pu)
inlineexplicit

Member Function Documentation

◆ calculateSegmentRates()

template<class Scalar >
static void Opm::WellState< Scalar >::calculateSegmentRates ( 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 
)
static

◆ clearWellRates()

template<class Scalar >
void Opm::WellState< Scalar >::clearWellRates ( )
inline

◆ communicateGroupRates()

template<class Scalar >
void Opm::WellState< Scalar >::communicateGroupRates ( const Parallel::Communication comm)

◆ currentWellRates()

template<class Scalar >
const std::vector< Scalar > & Opm::WellState< Scalar >::currentWellRates ( const std::string &  wellName) const

◆ gatherVectorsOnRoot()

template<class Scalar >
void Opm::WellState< Scalar >::gatherVectorsOnRoot ( const std::vector< data::Connection > &  from_connections,
std::vector< data::Connection > &  to_connections,
const Parallel::Communication comm 
) const

◆ getALQ()

template<class Scalar >
Scalar Opm::WellState< Scalar >::getALQ ( const std::string &  name) const
inline

◆ gliftCheckAlqOscillation()

template<class Scalar >
bool Opm::WellState< Scalar >::gliftCheckAlqOscillation ( const std::string &  name) const
inline

◆ gliftGetAlqDecreaseCount()

template<class Scalar >
int Opm::WellState< Scalar >::gliftGetAlqDecreaseCount ( const std::string &  name)
inline

◆ gliftGetAlqIncreaseCount()

template<class Scalar >
int Opm::WellState< Scalar >::gliftGetAlqIncreaseCount ( const std::string &  name)
inline

◆ gliftGetDebugCounter()

template<class Scalar >
int Opm::WellState< Scalar >::gliftGetDebugCounter ( )
inline

◆ gliftSetDebugCounter()

template<class Scalar >
void Opm::WellState< Scalar >::gliftSetDebugCounter ( int  value)
inline

◆ gliftTimeStepInit()

template<class Scalar >
void Opm::WellState< Scalar >::gliftTimeStepInit ( )
inline

◆ gliftUpdateAlqIncreaseCount()

template<class Scalar >
void Opm::WellState< Scalar >::gliftUpdateAlqIncreaseCount ( const std::string &  name,
bool  increase 
)
inline

◆ gliftUpdateDebugCounter()

template<class Scalar >
int Opm::WellState< Scalar >::gliftUpdateDebugCounter ( )
inline

◆ globalIdxToWellName()

template<class Scalar >
std::string Opm::WellState< Scalar >::globalIdxToWellName ( const int  index)
inline

◆ has()

template<class Scalar >
bool Opm::WellState< Scalar >::has ( const std::string &  well_name) const
inline

◆ hasWellRates()

template<class Scalar >
bool Opm::WellState< Scalar >::hasWellRates ( const std::string &  wellName) const
inline

◆ index()

template<class Scalar >
std::optional< std::size_t > Opm::WellState< Scalar >::index ( const std::string &  well_name) const
inline

◆ init()

template<class Scalar >
void Opm::WellState< Scalar >::init ( const std::vector< Scalar > &  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< Scalar > *  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

◆ initWellStateMSWell()

template<class Scalar >
void Opm::WellState< Scalar >::initWellStateMSWell ( const std::vector< Well > &  wells_ecl,
const WellState< Scalar > *  prev_well_state 
)

init the MS well related.

◆ isInjectionGrup()

template<class Scalar >
bool Opm::WellState< Scalar >::isInjectionGrup ( const std::string &  name) const
inline

◆ isProductionGrup()

template<class Scalar >
bool Opm::WellState< Scalar >::isProductionGrup ( const std::string &  name) const
inline

◆ name()

◆ numPhases()

◆ numWells()

template<class Scalar >
int Opm::WellState< Scalar >::numWells ( ) const
inline

◆ openWell()

template<class Scalar >
void Opm::WellState< Scalar >::openWell ( int  well_index)

◆ operator==()

template<class Scalar >
bool Opm::WellState< Scalar >::operator== ( const WellState< Scalar > &  ) const

◆ operator[]() [1/4]

template<class Scalar >
SingleWellState< Scalar > & Opm::WellState< Scalar >::operator[] ( const std::string &  well_name)
inline

◆ operator[]() [2/4]

template<class Scalar >
const SingleWellState< Scalar > & Opm::WellState< Scalar >::operator[] ( const std::string &  well_name) const
inline

◆ operator[]() [3/4]

template<class Scalar >
SingleWellState< Scalar > & Opm::WellState< Scalar >::operator[] ( std::size_t  well_index)
inline

◆ operator[]() [4/4]

template<class Scalar >
const SingleWellState< Scalar > & Opm::WellState< Scalar >::operator[] ( std::size_t  well_index) const
inline

◆ parallelWellInfo()

template<class Scalar >
const ParallelWellInfo & Opm::WellState< Scalar >::parallelWellInfo ( std::size_t  well_index) const

◆ phaseUsage()

template<class Scalar >
const PhaseUsage & Opm::WellState< Scalar >::phaseUsage ( ) const
inline

◆ report()

template<class Scalar >
data::Wells Opm::WellState< Scalar >::report ( const int *  globalCellIdxMap,
const std::function< bool(const int)> &  wasDynamicallyClosed 
) const

◆ reportConnections()

template<class Scalar >
void Opm::WellState< Scalar >::reportConnections ( std::vector< data::Connection > &  connections,
const PhaseUsage pu,
std::size_t  well_index,
const int *  globalCellIdxMap 
) const

◆ resize()

template<class Scalar >
void Opm::WellState< Scalar >::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 std::size_t  numCells,
const std::vector< std::vector< PerforationData > > &  well_perf_data,
const SummaryState &  summary_state 
)

◆ serializationTestObject()

template<class Scalar >
static WellState Opm::WellState< Scalar >::serializationTestObject ( const ParallelWellInfo pinfo)
static

◆ serializeOp()

template<class Scalar >
template<class Serializer >
void Opm::WellState< Scalar >::serializeOp ( Serializer &  serializer)
inline

◆ setALQ()

template<class Scalar >
void Opm::WellState< Scalar >::setALQ ( const std::string &  name,
Scalar  value 
)
inline

◆ setCurrentWellRates()

template<class Scalar >
void Opm::WellState< Scalar >::setCurrentWellRates ( const std::string &  wellName,
const std::vector< Scalar > &  new_rates 
)
inline

◆ shutWell()

template<class Scalar >
void Opm::WellState< Scalar >::shutWell ( int  well_index)

◆ size()

template<class Scalar >
std::size_t Opm::WellState< Scalar >::size ( ) const
inline

◆ stopWell()

template<class Scalar >
void Opm::WellState< Scalar >::stopWell ( int  well_index)

◆ updateGlobalIsGrup()

template<class Scalar >
void Opm::WellState< Scalar >::updateGlobalIsGrup ( const Parallel::Communication comm)

◆ updateStatus()

template<class Scalar >
void Opm::WellState< Scalar >::updateStatus ( int  well_index,
WellStatus  status 
)

◆ updateWellsDefaultALQ()

template<class Scalar >
void Opm::WellState< Scalar >::updateWellsDefaultALQ ( const std::vector< Well > &  wells_ecl,
const SummaryState &  summary_state 
)

◆ well() [1/4]

template<class Scalar >
SingleWellState< Scalar > & Opm::WellState< Scalar >::well ( const std::string &  well_name)
inline

◆ well() [2/4]

template<class Scalar >
const SingleWellState< Scalar > & Opm::WellState< Scalar >::well ( const std::string &  well_name) const
inline

◆ well() [3/4]

template<class Scalar >
SingleWellState< Scalar > & Opm::WellState< Scalar >::well ( std::size_t  well_index)
inline

◆ well() [4/4]

template<class Scalar >
const SingleWellState< Scalar > & Opm::WellState< Scalar >::well ( std::size_t  well_index) const
inline

References Opm::WellState< Scalar >::operator[]().

Referenced by Opm::MultisegmentWell< TypeTag >::assembleWellEqWithoutIteration(), Opm::StandardWell< TypeTag >::assembleWellEqWithoutIterationImpl(), Opm::StandardWell< TypeTag >::calculateSinglePerf(), Opm::StandardWell< TypeTag >::canProduceInjectWithCurrentBhp(), Opm::StandardWell< TypeTag >::computeWellPotentials(), Opm::MultisegmentWell< TypeTag >::computeWellPotentialsImplicit(), Opm::StandardWell< TypeTag >::computeWellPotentialsImplicit(), Opm::MultisegmentWell< TypeTag >::computeWellRatesWithBhp(), Opm::StandardWell< TypeTag >::computeWellRatesWithBhpIterations(), Opm::MultisegmentWell< TypeTag >::computeWellRatesWithBhpIterations(), Opm::WellInterface< TypeTag >::estimateOperableBhp(), Opm::VFPProperties::getExplicitGFR(), Opm::VFPProperties::getExplicitWFR(), Opm::StandardWell< TypeTag >::handleInjectivityEquations(), Opm::WellInterface< TypeTag >::initialWellRateFractions(), Opm::MultisegmentWell< TypeTag >::iterateWellEqWithSwitching(), Opm::StandardWell< TypeTag >::iterateWellEqWithSwitching(), Opm::WellInterface< TypeTag >::prepareWellBeforeAssembling(), Opm::WellInterface< TypeTag >::solveWellEquation(), Opm::WellInterface< TypeTag >::solveWellForTesting(), Opm::WellInterface< TypeTag >::solveWellWithBhp(), Opm::WellInterface< TypeTag >::solveWellWithTHPConstraint(), Opm::StandardWell< TypeTag >::updateConnectionRatePolyMW(), Opm::MultisegmentWell< TypeTag >::updateIPRImplicit(), Opm::StandardWell< TypeTag >::updateIPRImplicit(), Opm::MultisegmentWell< TypeTag >::updateProductivityIndex(), Opm::StandardWell< TypeTag >::updateProductivityIndex(), Opm::StandardWell< TypeTag >::updateWaterThroughput(), Opm::WellInterface< TypeTag >::updateWellControl(), Opm::WellInterface< TypeTag >::updateWellControlAndStatusLocalIteration(), Opm::WellInterface< TypeTag >::updateWellOperability(), Opm::StandardWell< TypeTag >::updateWellState(), Opm::MultisegmentWell< TypeTag >::updateWellState(), Opm::WellInterface< TypeTag >::updateWellStateRates(), Opm::WellInterface< TypeTag >::updateWellStateWithTarget(), Opm::WellInterface< TypeTag >::updateWellStateWithTHPTargetProd(), and Opm::WellInterface< TypeTag >::wellTesting().

◆ wellIsOwned() [1/2]

template<class Scalar >
bool Opm::WellState< Scalar >::wellIsOwned ( const std::string &  wellName) const

◆ wellIsOwned() [2/2]

template<class Scalar >
bool Opm::WellState< Scalar >::wellIsOwned ( std::size_t  well_index,
const std::string &  wellName 
) const

◆ wellNameToGlobalIdx()

template<class Scalar >
int Opm::WellState< Scalar >::wellNameToGlobalIdx ( const std::string &  name)
inline

◆ wellRates() [1/2]

template<class Scalar >
std::vector< Scalar > & Opm::WellState< Scalar >::wellRates ( std::size_t  well_index)
inline

One rate per well and phase.

Referenced by Opm::StandardWell< TypeTag >::computeWellRatesWithBhpIterations().

◆ wellRates() [2/2]

template<class Scalar >
const std::vector< Scalar > & Opm::WellState< Scalar >::wellRates ( std::size_t  well_index) const
inline

◆ wells()

template<class Scalar >
std::vector< std::string > Opm::WellState< Scalar >::wells ( ) const
inline

Member Data Documentation

◆ event_mask

template<class Scalar >
const uint64_t Opm::WellState< Scalar >::event_mask = ScheduleEvents::WELL_STATUS_CHANGE + ScheduleEvents::PRODUCTION_UPDATE + ScheduleEvents::INJECTION_UPDATE
static

◆ Gas

template<class Scalar >
const int Opm::WellState< Scalar >::Gas = BlackoilPhases::Vapour
static

◆ Oil

template<class Scalar >
const int Opm::WellState< Scalar >::Oil = BlackoilPhases::Liquid
static

◆ Water

template<class Scalar >
const int Opm::WellState< Scalar >::Water = BlackoilPhases::Aqua
static

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