Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits > Class Template Reference

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

#include <BlackoilWellModelNetworkGeneric.hpp>

Inheritance diagram for Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >:
Inheritance graph

Classes

struct  NetworkPressures
 Result of one network pressure evaluation for one network (domain). More...
 

Public Member Functions

 BlackoilWellModelNetworkGeneric (BlackoilWellModelGeneric< Scalar, IndexTraits > &well_model)
 
virtual ~BlackoilWellModelNetworkGeneric ()=default
 
bool active () const
 return true if network is active (at least one network well in prediction mode) More...
 
const std::map< std::string, Scalar > & nodePressures () const
 
void setNodePressures (const std::map< std::string, Scalar > &values)
 
void setFromRestart (const std::optional< std::map< std::string, double > > &restart_pressures)
 
void setNodePressureOverrides (std::map< std::string, 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< Scalar, IndexTraits > &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...
 
Scalar updatePressures (const int reportStepIdx, const Scalar damping_factor, const 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 ()
 
template<class Serializer >
void serializeOp (Serializer &serializer)
 
bool operator== (const BlackoilWellModelNetworkGeneric< Scalar, IndexTraits > &rhs) const
 

Protected Member Functions

void imposeWellThpLimit (WellInterfaceGeneric< Scalar, IndexTraits > &well, const 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< Scalar > &vfp_prod_props, const UnitSystem &unit_system, const int reportStepIdx, const Parallel::Communication &comm) const
 
NetworkPressures computePressures (const Network::ExtNetwork &network, const VFPInjProperties< 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, Scalar > & nodePressures (const details::NetworkDomain domain) const
 
std::map< std::string, Scalar > & nodePressures (const details::NetworkDomain domain)
 
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

std::map< std::string, Scalar > node_pressure_overrides_
 See setNodePressureOverrides(). More...
 
bool active_ {false}
 
BlackoilWellModelGeneric< Scalar, IndexTraits > & well_model_
 
std::map< std::string, Scalar > node_pressures_
 
std::map< std::string, data::BranchData > branch_data_
 
std::array< std::map< std::string, 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_ {-1}
 
std::map< std::string, Scalar > last_valid_node_pressures_
 
std::map< std::string, data::BranchData > last_valid_branch_data_
 
std::array< std::map< std::string, 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, Scalar > well_group_thp_calc_
 

Detailed Description

template<typename Scalar, typename IndexTraits>
class Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >

Class for handling the blackoil well network model.

Constructor & Destructor Documentation

◆ BlackoilWellModelNetworkGeneric()

template<typename Scalar , typename IndexTraits >
Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::BlackoilWellModelNetworkGeneric ( BlackoilWellModelGeneric< Scalar, IndexTraits > &  well_model)

◆ ~BlackoilWellModelNetworkGeneric()

template<typename Scalar , typename IndexTraits >
virtual Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::~BlackoilWellModelNetworkGeneric ( )
virtualdefault

Member Function Documentation

◆ active()

template<typename Scalar , typename IndexTraits >
bool Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::active ( ) const
inline

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

References Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::active_.

◆ applyNodePressureOverrides_()

template<typename Scalar , typename IndexTraits >
void Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::applyNodePressureOverrides_ ( )
protected

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

◆ assignNodeAndBranchValues()

template<typename Scalar , typename IndexTraits >
void Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::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

◆ branchData() [1/2]

template<typename Scalar , typename IndexTraits >
std::map< std::string, data::BranchData > & Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::branchData ( const details::NetworkDomain  domain)
inlineprotected

◆ branchData() [2/2]

◆ commitState()

◆ computePressures() [1/2]

template<typename Scalar , typename IndexTraits >
NetworkPressures Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::computePressures ( const Network::ExtNetwork &  network,
const VFPInjProperties< Scalar > &  vfp_inj_props,
const UnitSystem &  unit_system,
const int  reportStepIdx,
const Parallel::Communication &  comm 
) const
protected

◆ computePressures() [2/2]

template<typename Scalar , typename IndexTraits >
NetworkPressures Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::computePressures ( const Network::ExtNetwork &  network,
const VFPProdProperties< Scalar > &  vfp_prod_props,
const UnitSystem &  unit_system,
const int  reportStepIdx,
const Parallel::Communication &  comm 
) const
protected

◆ imposeWellThpLimit()

template<typename Scalar , typename IndexTraits >
void Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::imposeWellThpLimit ( WellInterfaceGeneric< Scalar, IndexTraits > &  well,
const Scalar  limit 
)
protected

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

◆ initialize()

template<typename Scalar , typename IndexTraits >
void Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::initialize ( const int  report_step)

Initialize wells according to network configuration.

◆ initializeWell()

template<typename Scalar , typename IndexTraits >
void Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::initializeWell ( WellInterfaceGeneric< Scalar, IndexTraits > &  well)

Initialize a single well according to network configuration.

◆ invalidNodes() [1/2]

template<typename Scalar , typename IndexTraits >
std::set< std::string > & Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::invalidNodes ( const details::NetworkDomain  domain)
inlineprotected

◆ invalidNodes() [2/2]

template<typename Scalar , typename IndexTraits >
const std::set< std::string > & Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::invalidNodes ( const details::NetworkDomain  domain) const
inlineprotected

◆ needPreStepRebalance()

template<typename Scalar , typename IndexTraits >
bool Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::needPreStepRebalance ( 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.)

◆ nodePressures() [1/3]

◆ nodePressures() [2/3]

template<typename Scalar , typename IndexTraits >
std::map< std::string, Scalar > & Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::nodePressures ( const details::NetworkDomain  domain)
inlineprotected

◆ nodePressures() [3/3]

template<typename Scalar , typename IndexTraits >
const std::map< std::string, Scalar > & Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::nodePressures ( const details::NetworkDomain  domain) const
inlineprotected

◆ operator==()

template<typename Scalar , typename IndexTraits >
bool Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::operator== ( const BlackoilWellModelNetworkGeneric< Scalar, IndexTraits > &  rhs) const

◆ productionNetworkDomain()

template<typename Scalar , typename IndexTraits >
static constexpr details::NetworkDomain Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::productionNetworkDomain ( )
inlinestaticconstexprprotected

◆ resetState()

template<typename Scalar , typename IndexTraits >
void Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::resetState ( )

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

◆ setFromRestart()

template<typename Scalar , typename IndexTraits >
void Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::setFromRestart ( const std::optional< std::map< std::string, double > > &  restart_pressures)

◆ setNodePressureOverrides()

template<typename Scalar , typename IndexTraits >
void Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::setNodePressureOverrides ( std::map< std::string, Scalar >  overrides)

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

template<typename Scalar , typename IndexTraits >
void Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::setNodePressures ( const std::map< std::string, Scalar > &  values)
inline

◆ shouldBalance()

template<typename Scalar , typename IndexTraits >
bool Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::shouldBalance ( const int  reportStepIndex) const

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

◆ syncLegacyProductionState_()

◆ syncProductionDomainState_()

◆ updateActiveState()

template<typename Scalar , typename IndexTraits >
void Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::updateActiveState ( const int  report_step)

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

◆ updateActiveStateImpl()

template<typename Scalar , typename IndexTraits >
void Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::updateActiveStateImpl ( const Network::ExtNetwork &  network)
protected

◆ updatePressures()

template<typename Scalar , typename IndexTraits >
Scalar Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::updatePressures ( const int  reportStepIdx,
const Scalar  damping_factor,
const Scalar  update_upper_bound 
)

◆ willBalanceOnNextIteration()

template<typename Scalar , typename IndexTraits >
bool Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::willBalanceOnNextIteration ( const int  reportStepIndex) const

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

Member Data Documentation

◆ active_

template<typename Scalar , typename IndexTraits >
bool Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::active_ {false}
protected

◆ branch_data_

◆ domain_branch_data_

◆ domain_invalid_nodes_

template<typename Scalar , typename IndexTraits >
std::array<std::set<std::string>, details::domainIndex(details::NetworkDomain::Count)> Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::domain_invalid_nodes_
protected

◆ domain_node_pressures_

◆ invalid_nodes_report_step_

template<typename Scalar , typename IndexTraits >
int Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::invalid_nodes_report_step_ {-1}
protected

◆ last_valid_branch_data_

template<typename Scalar , typename IndexTraits >
std::map<std::string, data::BranchData> Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::last_valid_branch_data_
protected

◆ last_valid_domain_branch_data_

template<typename Scalar , typename IndexTraits >
std::array<std::map<std::string, data::BranchData>, details::domainIndex(details::NetworkDomain::Count)> Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::last_valid_domain_branch_data_
protected

◆ last_valid_domain_node_pressures_

template<typename Scalar , typename IndexTraits >
std::array<std::map<std::string, Scalar>, details::domainIndex(details::NetworkDomain::Count)> Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::last_valid_domain_node_pressures_
protected

◆ last_valid_node_pressures_

template<typename Scalar , typename IndexTraits >
std::map<std::string, Scalar> Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::last_valid_node_pressures_
protected

◆ node_pressure_overrides_

template<typename Scalar , typename IndexTraits >
std::map<std::string, Scalar> Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::node_pressure_overrides_
protected

◆ node_pressures_

◆ well_group_thp_calc_

template<typename Scalar , typename IndexTraits >
std::map<std::string, Scalar> Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::well_group_thp_calc_
protected

◆ well_model_

template<typename Scalar , typename IndexTraits >
BlackoilWellModelGeneric<Scalar,IndexTraits>& Opm::BlackoilWellModelNetworkGeneric< Scalar, IndexTraits >::well_model_
protected

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