23#ifndef OPM_BLACKOILWELLMODEL_NETWORK_GENERIC_HEADER_INCLUDED
24#define OPM_BLACKOILWELLMODEL_NETWORK_GENERIC_HEADER_INCLUDED
26#include <opm/input/eclipse/Schedule/Network/ExtNetwork.hpp>
28#include <opm/output/data/Groups.hpp>
30#include <opm/simulators/flow/NewtonIterationContext.hpp>
31#include <opm/simulators/utils/ParallelCommunication.hpp>
48template<
typename Scalar,
typename IndexTraits>
49class BlackoilWellModelNetworkGeneric
54 virtual ~BlackoilWellModelNetworkGeneric() =
default;
60 const std::map<std::string, Scalar>&
61 nodePressures()
const {
return node_pressures_; }
64 void setNodePressures(
const std::map<std::string, Scalar>& values)
65 { node_pressures_ = values; }
67 void setFromRestart(
const std::optional<std::map<std::string, double>>& restart_pressures);
91 Scalar updatePressures(
const int reportStepIdx,
92 const Scalar damping_factor,
93 const Scalar update_upper_bound);
95 void assignNodeValues(std::map<std::string, data::NodeData>& nodevalues,
96 const int reportStepIdx)
const;
99 { this->last_valid_node_pressures_ = this->node_pressures_; }
102 { this->node_pressures_ = this->last_valid_node_pressures_; }
104 template<
class Serializer>
105 void serializeOp(Serializer& serializer)
107 serializer(node_pressures_);
108 serializer(last_valid_node_pressures_);
111 bool operator==(
const BlackoilWellModelNetworkGeneric<Scalar,IndexTraits>& rhs)
const;
114 std::map<std::string, Scalar>
115 computePressures(
const Network::ExtNetwork& network,
116 const VFPProdProperties<Scalar>& vfp_prod_props,
117 const UnitSystem& unit_system,
118 const int reportStepIdx,
119 const Parallel::Communication& comm)
const;
123 BlackoilWellModelGeneric<Scalar,IndexTraits>& well_model_;
126 std::map<std::string, Scalar> node_pressures_;
128 std::map<std::string, Scalar> last_valid_node_pressures_;
Class for handling the blackoil well model.
Definition BlackoilWellModelGeneric.hpp:97
bool willBalanceOnNextIteration(const int reportStepIndex, const NewtonIterationContext &iterCtx) const
Checks if we will perform a network re-balance on the next Newton iteration.
Definition BlackoilWellModelNetworkGeneric.cpp:133
void initialize(const int report_step)
Initialize wells according to network configuration.
Definition BlackoilWellModelNetworkGeneric.cpp:282
bool needPreStepRebalance(const int report_step) const
Checks if there are reasons to perform a pre-step network re-balance.
Definition BlackoilWellModelNetworkGeneric.cpp:89
void updateActiveState(const int report_step)
Checks if network is active (at least one network well on prediction).
Definition BlackoilWellModelNetworkGeneric.cpp:67
bool active() const
return true if network is active (at least one network well in prediction mode)
Definition BlackoilWellModelNetworkGeneric.hpp:57
void initializeWell(WellInterfaceGeneric< Scalar, IndexTraits > &well)
Initialize a single well according to network configuration.
Definition BlackoilWellModelNetworkGeneric.cpp:294
bool shouldBalance(const int reportStepIndex, const NewtonIterationContext &iterCtx) const
Checks if we shall perform a network re-balance.
Definition BlackoilWellModelNetworkGeneric.cpp:108
Class which linearly interpolates BHP as a function of rate, tubing head pressure,...
Definition VFPProdProperties.hpp:38
Definition WellInterfaceGeneric.hpp:53
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:45
Context for iteration-dependent decisions in the Newton solver.
Definition NewtonIterationContext.hpp:43