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> 40 template<
class Scalar,
class IndexTraits>
class BlackoilWellModelGeneric;
41 template<
typename Scalar,
typename IndexTraits>
class WellInterfaceGeneric;
48 template<
typename Scalar,
typename IndexTraits>
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);
73 void initializeWell(WellInterfaceGeneric<Scalar,IndexTraits>& well);
89 Scalar updatePressures(
const int reportStepIdx,
90 const Scalar damping_factor,
91 const Scalar update_upper_bound);
93 void assignNodeAndBranchValues(std::map<std::string, data::NodeData>& nodevalues,
94 std::map<std::string, data::BranchData>& branchvalues,
95 std::map<std::string, data::BranchData>& converged_branchvalues,
96 const int reportStepIdx)
const;
100 this->last_valid_node_pressures_ = this->node_pressures_;
101 this->last_valid_branch_data_ = this->branch_data_;
106 this->node_pressures_ = this->last_valid_node_pressures_;
107 this->branch_data_ = this->last_valid_branch_data_;
110 template<
class Serializer>
111 void serializeOp(Serializer& serializer)
113 serializer(node_pressures_);
114 serializer(last_valid_node_pressures_);
115 serializer(branch_data_);
116 serializer(last_valid_branch_data_);
119 bool operator==(
const BlackoilWellModelNetworkGeneric<Scalar,IndexTraits>& rhs)
const;
122 std::pair<std::map<std::string, Scalar>, std::map<std::string, data::BranchData>>
123 computePressures(
const Network::ExtNetwork& network,
124 const VFPProdProperties<Scalar>& vfp_prod_props,
125 const UnitSystem& unit_system,
126 const int reportStepIdx,
127 const Parallel::Communication& comm)
const;
131 BlackoilWellModelGeneric<Scalar,IndexTraits>& well_model_;
134 std::map<std::string, Scalar> node_pressures_;
136 std::map<std::string, data::BranchData> branch_data_;
138 std::map<std::string, Scalar> last_valid_node_pressures_;
140 std::map<std::string, data::BranchData> last_valid_branch_data_;
Class which linearly interpolates BHP as a function of rate, tubing head pressure, water fraction, gas fraction, and artificial lift for production VFP tables, and similarly the BHP as a function of the rate and tubing head pressure.
Definition: BlackoilWellModelNetworkGeneric.hpp:42
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:331
Structs needed for tpfalinearizer and its gpuparams struct extracted to be defined in one place that ...
Definition: blackoilbioeffectsmodules.hh:45
bool willBalanceOnNextIteration(const int reportStepIndex) const
Checks if we will perform a network re-balance on the next Newton iteration.
Definition: BlackoilWellModelNetworkGeneric.cpp:162
Class for handling the blackoil well network model.
Definition: BlackoilWellModelGeneric.hpp:65
bool needPreStepRebalance(const int report_step) const
Checks if there are reasons to perform a pre-step network re-balance.
Definition: BlackoilWellModelNetworkGeneric.cpp:117
bool shouldBalance(const int reportStepIndex) const
Checks if we shall perform a network re-balance.
Definition: BlackoilWellModelNetworkGeneric.cpp:136
void initialize(const int report_step)
Initialize wells according to network configuration.
Definition: BlackoilWellModelNetworkGeneric.cpp:319
void updateActiveState(const int report_step)
Checks if network is active (at least one network well on prediction).
Definition: BlackoilWellModelNetworkGeneric.cpp:67