Class for handling the blackoil well network model. More...

#include <BlackoilWellModelNetwork.hpp>

Inheritance diagram for Opm::BlackoilWellModelNetwork< TypeTag >:
Inheritance graph

Public Member Functions

 BlackoilWellModelNetwork (BlackoilWellModel< TypeTag > &well_model)
 
std::tuple< bool, Scalar > update (const bool mandatory_network_balance, DeferredLogger &deferred_logger, const bool relax_network_tolerance=false)
 
void doPreStepRebalance (DeferredLogger &deferred_logger)
 
bool active () const
 return true if network is active (at least one network well in prediction mode) More...
 
const std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > & nodePressures () const
 
void setNodePressures (const std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > &values)
 
void setFromRestart (const std::optional< std::map< std::string, double > > &restart_pressures)
 
void setNodePressureOverrides (std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > overrides)
 Pressures that a reservoir coupling master imposes on nodes of the production network, by node (group) name. More...
 
void initialize (const int report_step)
 Initialize wells according to network configuration. More...
 
void initializeWell (WellInterfaceGeneric< GetPropType< TypeTag, Properties::Scalar >, GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType > &well)
 Initialize a single well according to network configuration. More...
 
void updateActiveState (const int report_step)
 Checks if network is active (at least one network well on prediction). More...
 
bool needPreStepRebalance (const int report_step) const
 
bool shouldBalance (const int reportStepIndex) const
 
bool willBalanceOnNextIteration (const int reportStepIndex) const
 Checks if we will perform a network re-balance on the next Newton iteration. More...
 
GetPropType< TypeTag, Properties::Scalar > updatePressures (const int reportStepIdx, const GetPropType< TypeTag, Properties::Scalar > damping_factor, const GetPropType< TypeTag, Properties::Scalar > update_upper_bound)
 
void assignNodeAndBranchValues (std::map< std::string, data::NodeData > &nodevalues, std::map< std::string, data::BranchData > &branchvalues, std::map< std::string, data::BranchData > &converged_branchvalues, const int reportStepIdx) const
 
void commitState ()
 
void resetState ()
 
void serializeOp (Serializer &serializer)
 
bool operator== (const BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar >, GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType > &rhs) const
 

Protected Member Functions

bool computeWellGroupThp (const double dt, DeferredLogger &local_deferredLogger)
 
const std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > & nodePressures (const details::NetworkDomain domain) const
 
std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > & nodePressures (const details::NetworkDomain domain)
 
void imposeWellThpLimit (WellInterfaceGeneric< GetPropType< TypeTag, Properties::Scalar >, GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType > &well, const GetPropType< TypeTag, Properties::Scalar > limit)
 Apply a network THP limit and retain it across well reconstruction or network detachment. More...
 
NetworkPressures computePressures (const Network::ExtNetwork &network, const VFPProdProperties< GetPropType< TypeTag, Properties::Scalar > > &vfp_prod_props, const UnitSystem &unit_system, const int reportStepIdx, const Parallel::Communication &comm) const
 
NetworkPressures computePressures (const Network::ExtNetwork &network, const VFPInjProperties< GetPropType< TypeTag, Properties::Scalar > > &vfp_inj_props, const UnitSystem &unit_system, const int reportStepIdx, const Parallel::Communication &comm) const
 
void updateActiveStateImpl (const Network::ExtNetwork &network)
 
const std::map< std::string, data::BranchData > & branchData (const details::NetworkDomain domain) const
 
std::map< std::string, data::BranchData > & branchData (const details::NetworkDomain domain)
 
const std::set< std::string > & invalidNodes (const details::NetworkDomain domain) const
 
std::set< std::string > & invalidNodes (const details::NetworkDomain domain)
 
void applyNodePressureOverrides_ ()
 
void syncLegacyProductionState_ ()
 
void syncProductionDomainState_ ()
 

Static Protected Member Functions

static constexpr details::NetworkDomain productionNetworkDomain ()
 

Protected Attributes

BlackoilWellModel< TypeTag > & well_model_
 
std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > node_pressure_overrides_
 See setNodePressureOverrides(). More...
 
bool active_
 
std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > node_pressures_
 
std::map< std::string, data::BranchData > branch_data_
 
std::array< std::map< std::string, GetPropType< TypeTag, Properties::Scalar > >, details::domainIndex(details::NetworkDomain::Count)> domain_node_pressures_
 
std::array< std::map< std::string, data::BranchData >, details::domainIndex(details::NetworkDomain::Count)> domain_branch_data_
 
std::array< std::set< std::string >, details::domainIndex(details::NetworkDomain::Count)> domain_invalid_nodes_
 
int invalid_nodes_report_step_
 
std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > last_valid_node_pressures_
 
std::map< std::string, data::BranchData > last_valid_branch_data_
 
std::array< std::map< std::string, GetPropType< TypeTag, Properties::Scalar > >, details::domainIndex(details::NetworkDomain::Count)> last_valid_domain_node_pressures_
 
std::array< std::map< std::string, data::BranchData >, details::domainIndex(details::NetworkDomain::Count)> last_valid_domain_branch_data_
 
std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > well_group_thp_calc_
 

Detailed Description

template<typename TypeTag>
class Opm::BlackoilWellModelNetwork< TypeTag >

Class for handling the blackoil well network model.

Constructor & Destructor Documentation

◆ BlackoilWellModelNetwork()

template<typename TypeTag >
Opm::BlackoilWellModelNetwork< TypeTag >::BlackoilWellModelNetwork ( BlackoilWellModel< TypeTag > &  well_model)

Member Function Documentation

◆ active()

bool Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::active ( ) const
inlineinherited

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

◆ applyNodePressureOverrides_()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::applyNodePressureOverrides_ ( )
protectedinherited

Sets the cached production node pressures of the overridden nodes to the override values. Does not sync the legacy state.

◆ assignNodeAndBranchValues()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::assignNodeAndBranchValues ( std::map< std::string, data::NodeData > &  nodevalues,
std::map< std::string, data::BranchData > &  branchvalues,
std::map< std::string, data::BranchData > &  converged_branchvalues,
const int  reportStepIdx 
) const
inherited

◆ branchData() [1/2]

std::map< std::string, data::BranchData > & Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::branchData ( const details::NetworkDomain  domain)
inlineprotectedinherited

◆ branchData() [2/2]

const std::map< std::string, data::BranchData > & Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::branchData ( const details::NetworkDomain  domain) const
inlineprotectedinherited

◆ commitState()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::commitState ( )
inlineinherited

◆ computePressures() [1/2]

NetworkPressures Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::computePressures ( const Network::ExtNetwork &  network,
const VFPInjProperties< GetPropType< TypeTag, Properties::Scalar > > &  vfp_inj_props,
const UnitSystem &  unit_system,
const int  reportStepIdx,
const Parallel::Communication &  comm 
) const
protectedinherited

◆ computePressures() [2/2]

NetworkPressures Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::computePressures ( const Network::ExtNetwork &  network,
const VFPProdProperties< GetPropType< TypeTag, Properties::Scalar > > &  vfp_prod_props,
const UnitSystem &  unit_system,
const int  reportStepIdx,
const Parallel::Communication &  comm 
) const
protectedinherited

◆ computeWellGroupThp()

template<typename TypeTag >
bool Opm::BlackoilWellModelNetwork< TypeTag >::computeWellGroupThp ( const double  dt,
DeferredLogger &  local_deferredLogger 
)
protected

This function is to be used for well groups in an extended network that act as a subsea manifold The wells of such group should have a common THP and total phase rate(s) obeying (if possible) the well group constraint set by GCONPROD

References Opm::DeferredLogger::debug(), Opm::ExceptionType::NONE, and Opm::to_string().

◆ doPreStepRebalance()

template<typename TypeTag >
void Opm::BlackoilWellModelNetwork< TypeTag >::doPreStepRebalance ( DeferredLogger &  deferred_logger)

◆ imposeWellThpLimit()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::imposeWellThpLimit ( WellInterfaceGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType > &  well,
const GetPropType< TypeTag, Properties::Scalar >  limit 
)
protectedinherited

Apply a network THP limit and retain it across well reconstruction or network detachment.

◆ initialize()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::initialize ( const int  report_step)
inherited

Initialize wells according to network configuration.

◆ initializeWell()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::initializeWell ( WellInterfaceGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType > &  well)
inherited

Initialize a single well according to network configuration.

◆ invalidNodes() [1/2]

std::set< std::string > & Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::invalidNodes ( const details::NetworkDomain  domain)
inlineprotectedinherited

◆ invalidNodes() [2/2]

const std::set< std::string > & Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::invalidNodes ( const details::NetworkDomain  domain) const
inlineprotectedinherited

◆ needPreStepRebalance()

bool Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::needPreStepRebalance ( const int  report_step) const
inherited

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.)

◆ nodePressures() [1/3]

const std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > & Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::nodePressures ( ) const
inlineinherited

◆ nodePressures() [2/3]

std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > & Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::nodePressures ( const details::NetworkDomain  domain)
inlineprotectedinherited

◆ nodePressures() [3/3]

const std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > & Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::nodePressures ( const details::NetworkDomain  domain) const
inlineprotectedinherited

◆ operator==()

bool Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::operator== ( const BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType > &  rhs) const
inherited

◆ productionNetworkDomain()

static constexpr details::NetworkDomain Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::productionNetworkDomain ( )
inlinestaticconstexprprotectedinherited

◆ resetState()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::resetState ( )
inherited

Restores the state saved by commitState(). The node pressure overrides are kept, as they are the current boundary condition, so they are applied to the restored pressures again.

◆ serializeOp()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::serializeOp ( Serializer &  serializer)
inlineinherited

◆ setFromRestart()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::setFromRestart ( const std::optional< std::map< std::string, double > > &  restart_pressures)
inherited

◆ setNodePressureOverrides()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::setNodePressureOverrides ( std::map< std::string, GetPropType< TypeTag, Properties::Scalar > >  overrides)
inherited

Pressures that a reservoir coupling master imposes on nodes of the production network, by node (group) name.

A reservoir coupling slave takes the pressure of a node that is a master group's leaf in the master's network from the master. The pressure computation uses it as the fixed pressure of the node, instead of the one in the deck, and the nodes below it follow from it with the pressure drops in their branches. So the THP limits of the slave's wells are the master's pressure plus those drops whenever they are set, and not only after the master's message is received. The node itself is not damped by updatePressures(). Only production network nodes with a fixed pressure in the deck are overridden. The cached pressures of the overridden nodes are set to the imposed values at once, so that what is computed from them before the next pressure update, such as the common THP of an auto-choke group below such a node, uses the current imposed pressure.

◆ setNodePressures()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::setNodePressures ( const std::map< std::string, GetPropType< TypeTag, Properties::Scalar > > &  values)
inlineinherited

◆ shouldBalance()

bool Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::shouldBalance ( const int  reportStepIndex) const
inherited

Checks if we shall perform a network re-balance. This is typically controlled by the NETBALAN keyword.

◆ syncLegacyProductionState_()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::syncLegacyProductionState_ ( )
inlineprotectedinherited

◆ syncProductionDomainState_()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::syncProductionDomainState_ ( )
inlineprotectedinherited

◆ update()

template<typename TypeTag >
std::tuple< bool, typename BlackoilWellModelNetwork< TypeTag >::Scalar > Opm::BlackoilWellModelNetwork< TypeTag >::update ( const bool  mandatory_network_balance,
DeferredLogger &  deferred_logger,
const bool  relax_network_tolerance = false 
)

◆ updateActiveState()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::updateActiveState ( const int  report_step)
inherited

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

◆ updateActiveStateImpl()

void Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::updateActiveStateImpl ( const Network::ExtNetwork &  network)
protectedinherited

◆ updatePressures()

GetPropType< TypeTag, Properties::Scalar > Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::updatePressures ( const int  reportStepIdx,
const GetPropType< TypeTag, Properties::Scalar >  damping_factor,
const GetPropType< TypeTag, Properties::Scalar >  update_upper_bound 
)
inherited

◆ willBalanceOnNextIteration()

bool Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::willBalanceOnNextIteration ( const int  reportStepIndex) const
inherited

Checks if we will perform a network re-balance on the next Newton iteration.

Member Data Documentation

◆ active_

bool Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::active_
protectedinherited

◆ branch_data_

std::map<std::string, data::BranchData> Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::branch_data_
protectedinherited

◆ domain_branch_data_

std::array<std::map<std::string, data::BranchData>, details::domainIndex(details::NetworkDomain::Count)> Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::domain_branch_data_
protectedinherited

◆ domain_invalid_nodes_

std::array<std::set<std::string>, details::domainIndex(details::NetworkDomain::Count)> Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::domain_invalid_nodes_
protectedinherited

◆ domain_node_pressures_

std::array<std::map<std::string, GetPropType< TypeTag, Properties::Scalar > >, details::domainIndex(details::NetworkDomain::Count)> Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::domain_node_pressures_
protectedinherited

◆ invalid_nodes_report_step_

int Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::invalid_nodes_report_step_
protectedinherited

◆ last_valid_branch_data_

std::map<std::string, data::BranchData> Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::last_valid_branch_data_
protectedinherited

◆ last_valid_domain_branch_data_

std::array<std::map<std::string, data::BranchData>, details::domainIndex(details::NetworkDomain::Count)> Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::last_valid_domain_branch_data_
protectedinherited

◆ last_valid_domain_node_pressures_

std::array<std::map<std::string, GetPropType< TypeTag, Properties::Scalar > >, details::domainIndex(details::NetworkDomain::Count)> Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::last_valid_domain_node_pressures_
protectedinherited

◆ last_valid_node_pressures_

std::map<std::string, GetPropType< TypeTag, Properties::Scalar > > Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::last_valid_node_pressures_
protectedinherited

◆ node_pressure_overrides_

std::map<std::string, GetPropType< TypeTag, Properties::Scalar > > Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::node_pressure_overrides_
protectedinherited

◆ node_pressures_

std::map<std::string, GetPropType< TypeTag, Properties::Scalar > > Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::node_pressures_
protectedinherited

◆ well_group_thp_calc_

std::map<std::string, GetPropType< TypeTag, Properties::Scalar > > Opm::BlackoilWellModelNetworkGeneric< GetPropType< TypeTag, Properties::Scalar > , GetPropType< TypeTag, Properties::FluidSystem >::IndexTraitsType >::well_group_thp_calc_
protectedinherited

◆ well_model_

template<typename TypeTag >
BlackoilWellModel<TypeTag>& Opm::BlackoilWellModelNetwork< TypeTag >::well_model_
protected

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