mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
GroupState: template Scalar type
This commit is contained in:
parent
be57843296
commit
67f1811234
@ -382,7 +382,7 @@ void BlackoilWellModelConstraints::
|
|||||||
actionOnBrokenConstraints(const Group& group,
|
actionOnBrokenConstraints(const Group& group,
|
||||||
const Group::InjectionCMode& newControl,
|
const Group::InjectionCMode& newControl,
|
||||||
const Phase& controlPhase,
|
const Phase& controlPhase,
|
||||||
GroupState& group_state,
|
GroupState<double>& group_state,
|
||||||
DeferredLogger& deferred_logger) const
|
DeferredLogger& deferred_logger) const
|
||||||
{
|
{
|
||||||
auto oldControl = wellModel_.groupState().injection_control(group.name(), controlPhase);
|
auto oldControl = wellModel_.groupState().injection_control(group.name(), controlPhase);
|
||||||
@ -407,7 +407,7 @@ actionOnBrokenConstraints(const Group& group,
|
|||||||
const Group::ProductionCMode& newControl,
|
const Group::ProductionCMode& newControl,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
std::optional<std::string>& worst_offending_well,
|
std::optional<std::string>& worst_offending_well,
|
||||||
GroupState& group_state,
|
GroupState<double>& group_state,
|
||||||
DeferredLogger& deferred_logger) const
|
DeferredLogger& deferred_logger) const
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -499,7 +499,7 @@ updateGroupIndividualControl(const Group& group,
|
|||||||
std::map<std::pair<std::string,Opm::Phase>,std::string>& switched_inj,
|
std::map<std::pair<std::string,Opm::Phase>,std::string>& switched_inj,
|
||||||
std::map<std::string, std::string>& switched_prod,
|
std::map<std::string, std::string>& switched_prod,
|
||||||
std::map<std::string, std::pair<std::string, std::string>>& closed_offending_wells,
|
std::map<std::string, std::pair<std::string, std::string>>& closed_offending_wells,
|
||||||
GroupState& group_state,
|
GroupState<double>& group_state,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
DeferredLogger& deferred_logger) const
|
DeferredLogger& deferred_logger) const
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,7 @@ namespace Opm {
|
|||||||
|
|
||||||
class BlackoilWellModelGeneric;
|
class BlackoilWellModelGeneric;
|
||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
class SummaryState;
|
class SummaryState;
|
||||||
template<class Scalar> class WellState;
|
template<class Scalar> class WellState;
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ public:
|
|||||||
void actionOnBrokenConstraints(const Group& group,
|
void actionOnBrokenConstraints(const Group& group,
|
||||||
const Group::InjectionCMode& newControl,
|
const Group::InjectionCMode& newControl,
|
||||||
const Phase& controlPhase,
|
const Phase& controlPhase,
|
||||||
GroupState& group_state,
|
GroupState<double>& group_state,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
//! \brief Execute action on broken constraint for a production well group. Return true if a group control is changed
|
//! \brief Execute action on broken constraint for a production well group. Return true if a group control is changed
|
||||||
@ -66,7 +66,7 @@ public:
|
|||||||
const Group::ProductionCMode& newControl,
|
const Group::ProductionCMode& newControl,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
std::optional<std::string>& worst_offending_well,
|
std::optional<std::string>& worst_offending_well,
|
||||||
GroupState& group_state,
|
GroupState<double>& group_state,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
//! \brief Update the individual controls for wells in a group. Return true if a group control is changed
|
//! \brief Update the individual controls for wells in a group. Return true if a group control is changed
|
||||||
@ -75,7 +75,7 @@ public:
|
|||||||
std::map<std::pair<std::string,Opm::Phase>,std::string>& switched_inj,
|
std::map<std::pair<std::string,Opm::Phase>,std::string>& switched_inj,
|
||||||
std::map<std::string, std::string>& switched_prod,
|
std::map<std::string, std::string>& switched_prod,
|
||||||
std::map<std::string, std::pair<std::string, std::string>>& closed_offending_wells,
|
std::map<std::string, std::pair<std::string, std::string>>& closed_offending_wells,
|
||||||
GroupState& group_state,
|
GroupState<double>& group_state,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ public:
|
|||||||
std::vector<Well> getLocalWells(const int timeStepIdx) const;
|
std::vector<Well> getLocalWells(const int timeStepIdx) const;
|
||||||
const Schedule& schedule() const { return schedule_; }
|
const Schedule& schedule() const { return schedule_; }
|
||||||
const PhaseUsage& phaseUsage() const { return phase_usage_; }
|
const PhaseUsage& phaseUsage() const { return phase_usage_; }
|
||||||
const GroupState& groupState() const { return this->active_wgstate_.group_state; }
|
const GroupState<double>& groupState() const { return this->active_wgstate_.group_state; }
|
||||||
std::vector<const WellInterfaceGeneric*> genericWells() const
|
std::vector<const WellInterfaceGeneric*> genericWells() const
|
||||||
{ return {well_container_generic_.begin(), well_container_generic_.end()}; }
|
{ return {well_container_generic_.begin(), well_container_generic_.end()}; }
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ public:
|
|||||||
{
|
{
|
||||||
return this->nupcol_wgstate_.well_state;
|
return this->nupcol_wgstate_.well_state;
|
||||||
}
|
}
|
||||||
GroupState& groupState() { return this->active_wgstate_.group_state; }
|
GroupState<double>& groupState() { return this->active_wgstate_.group_state; }
|
||||||
|
|
||||||
WellTestState& wellTestState() { return this->active_wgstate_.well_test_state; }
|
WellTestState& wellTestState() { return this->active_wgstate_.well_test_state; }
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ loadRestartWellData(const std::string& well_name,
|
|||||||
void BlackoilWellModelRestart::
|
void BlackoilWellModelRestart::
|
||||||
loadRestartGroupData(const std::string& group,
|
loadRestartGroupData(const std::string& group,
|
||||||
const data::GroupData& value,
|
const data::GroupData& value,
|
||||||
GroupState& grpState) const
|
GroupState<double>& grpState) const
|
||||||
{
|
{
|
||||||
using GPMode = Group::ProductionCMode;
|
using GPMode = Group::ProductionCMode;
|
||||||
using GIMode = Group::InjectionCMode;
|
using GIMode = Group::InjectionCMode;
|
||||||
@ -224,7 +224,7 @@ loadRestartData(const data::Wells& rst_wells,
|
|||||||
const data::GroupAndNetworkValues& grpNwrkValues,
|
const data::GroupAndNetworkValues& grpNwrkValues,
|
||||||
const bool handle_ms_well,
|
const bool handle_ms_well,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
GroupState& grpState) const
|
GroupState<double>& grpState) const
|
||||||
{
|
{
|
||||||
using rt = data::Rates::opt;
|
using rt = data::Rates::opt;
|
||||||
const auto& phases = wellModel_.phaseUsage();
|
const auto& phases = wellModel_.phaseUsage();
|
||||||
|
@ -35,7 +35,7 @@ namespace data {
|
|||||||
struct GroupData;
|
struct GroupData;
|
||||||
class GroupAndNetworkValues;
|
class GroupAndNetworkValues;
|
||||||
}
|
}
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
class GuideRate;
|
class GuideRate;
|
||||||
class GuideRateConfig;
|
class GuideRateConfig;
|
||||||
struct PerforationData;
|
struct PerforationData;
|
||||||
@ -69,7 +69,7 @@ public:
|
|||||||
const data::GroupAndNetworkValues& grpNwrkValues,
|
const data::GroupAndNetworkValues& grpNwrkValues,
|
||||||
const bool handle_ms_well,
|
const bool handle_ms_well,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
GroupState& grpState) const;
|
GroupState<double>& grpState) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! \brief Loads per-connection data from restart structures.
|
//! \brief Loads per-connection data from restart structures.
|
||||||
@ -95,7 +95,7 @@ private:
|
|||||||
//! \brief Loads per-group data from restart structures.
|
//! \brief Loads per-group data from restart structures.
|
||||||
void loadRestartGroupData(const std::string& group,
|
void loadRestartGroupData(const std::string& group,
|
||||||
const data::GroupData& value,
|
const data::GroupData& value,
|
||||||
GroupState& grpState) const;
|
GroupState<double>& grpState) const;
|
||||||
|
|
||||||
const BlackoilWellModelGeneric& wellModel_; //!< Reference to well model
|
const BlackoilWellModelGeneric& wellModel_; //!< Reference to well model
|
||||||
};
|
};
|
||||||
|
@ -34,7 +34,7 @@ namespace Opm::WellGroupHelpers {
|
|||||||
|
|
||||||
FractionCalculator::FractionCalculator(const Schedule& schedule,
|
FractionCalculator::FractionCalculator(const Schedule& schedule,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int report_step,
|
const int report_step,
|
||||||
const GuideRate* guide_rate,
|
const GuideRate* guide_rate,
|
||||||
const GuideRateModel::Target target,
|
const GuideRateModel::Target target,
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
struct PhaseUsage;
|
struct PhaseUsage;
|
||||||
class Schedule;
|
class Schedule;
|
||||||
template<class Scalar> class WellState;
|
template<class Scalar> class WellState;
|
||||||
@ -39,7 +39,7 @@ class FractionCalculator
|
|||||||
public:
|
public:
|
||||||
FractionCalculator(const Schedule& schedule,
|
FractionCalculator(const Schedule& schedule,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int report_step,
|
const int report_step,
|
||||||
const GuideRate* guide_rate,
|
const GuideRate* guide_rate,
|
||||||
const GuideRateModel::Target target,
|
const GuideRateModel::Target target,
|
||||||
@ -63,7 +63,7 @@ private:
|
|||||||
GuideRate::RateVector getGroupRateVector(const std::string& group_name);
|
GuideRate::RateVector getGroupRateVector(const std::string& group_name);
|
||||||
const Schedule& schedule_;
|
const Schedule& schedule_;
|
||||||
const WellState<double>& well_state_;
|
const WellState<double>& well_state_;
|
||||||
const GroupState& group_state_;
|
const GroupState<double>& group_state_;
|
||||||
int report_step_;
|
int report_step_;
|
||||||
const GuideRate* guide_rate_;
|
const GuideRate* guide_rate_;
|
||||||
GuideRateModel::Target target_;
|
GuideRateModel::Target target_;
|
||||||
|
@ -31,7 +31,7 @@ namespace Opm {
|
|||||||
GasLiftCommon::
|
GasLiftCommon::
|
||||||
GasLiftCommon(
|
GasLiftCommon(
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
const GroupState &group_state,
|
const GroupState<double>& group_state,
|
||||||
DeferredLogger &deferred_logger,
|
DeferredLogger &deferred_logger,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
bool glift_debug
|
bool glift_debug
|
||||||
|
@ -28,7 +28,7 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
|
|
||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
template<class Scalar> class WellState;
|
template<class Scalar> class WellState;
|
||||||
|
|
||||||
class GasLiftCommon
|
class GasLiftCommon
|
||||||
@ -39,7 +39,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
GasLiftCommon(
|
GasLiftCommon(
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
const GroupState &group_state,
|
const GroupState<double>& group_state,
|
||||||
DeferredLogger &deferred_logger,
|
DeferredLogger &deferred_logger,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
bool debug
|
bool debug
|
||||||
@ -55,7 +55,7 @@ protected:
|
|||||||
MessageType msg_type = MessageType::INFO) const;
|
MessageType msg_type = MessageType::INFO) const;
|
||||||
|
|
||||||
WellState<double>& well_state_;
|
WellState<double>& well_state_;
|
||||||
const GroupState& group_state_;
|
const GroupState<double>& group_state_;
|
||||||
DeferredLogger &deferred_logger_;
|
DeferredLogger &deferred_logger_;
|
||||||
const Parallel::Communication& comm_;
|
const Parallel::Communication& comm_;
|
||||||
bool debug;
|
bool debug;
|
||||||
|
@ -42,7 +42,7 @@ GasLiftGroupInfo(
|
|||||||
const PhaseUsage &phase_usage,
|
const PhaseUsage &phase_usage,
|
||||||
DeferredLogger &deferred_logger,
|
DeferredLogger &deferred_logger,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
const GroupState &group_state,
|
const GroupState<double>& group_state,
|
||||||
const Communication &comm,
|
const Communication &comm,
|
||||||
bool glift_debug
|
bool glift_debug
|
||||||
) :
|
) :
|
||||||
|
@ -35,7 +35,7 @@ namespace Opm
|
|||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class GasLiftOpt;
|
class GasLiftOpt;
|
||||||
class Group;
|
class Group;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
class Schedule;
|
class Schedule;
|
||||||
class SummaryState;
|
class SummaryState;
|
||||||
class Well;
|
class Well;
|
||||||
@ -75,7 +75,7 @@ public:
|
|||||||
const PhaseUsage& phase_usage,
|
const PhaseUsage& phase_usage,
|
||||||
DeferredLogger& deferred_logger,
|
DeferredLogger& deferred_logger,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
bool glift_debug
|
bool glift_debug
|
||||||
);
|
);
|
||||||
|
@ -47,7 +47,7 @@ namespace Opm
|
|||||||
const SummaryState &summary_state,
|
const SummaryState &summary_state,
|
||||||
DeferredLogger &deferred_logger,
|
DeferredLogger &deferred_logger,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
GasLiftGroupInfo &group_info,
|
GasLiftGroupInfo &group_info,
|
||||||
GLiftSyncGroups &sync_groups,
|
GLiftSyncGroups &sync_groups,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
|
@ -39,7 +39,7 @@ namespace Opm
|
|||||||
|
|
||||||
GasLiftSingleWellGeneric::GasLiftSingleWellGeneric(DeferredLogger& deferred_logger,
|
GasLiftSingleWellGeneric::GasLiftSingleWellGeneric(DeferredLogger& deferred_logger,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Well& ecl_well,
|
const Well& ecl_well,
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
GasLiftGroupInfo& group_info,
|
GasLiftGroupInfo& group_info,
|
||||||
|
@ -43,7 +43,7 @@ class Schedule;
|
|||||||
class SummaryState;
|
class SummaryState;
|
||||||
class WellInterfaceGeneric;
|
class WellInterfaceGeneric;
|
||||||
template<class Scalar> class WellState;
|
template<class Scalar> class WellState;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
|
|
||||||
class GasLiftSingleWellGeneric : public GasLiftCommon
|
class GasLiftSingleWellGeneric : public GasLiftCommon
|
||||||
{
|
{
|
||||||
@ -105,7 +105,7 @@ protected:
|
|||||||
GasLiftSingleWellGeneric(
|
GasLiftSingleWellGeneric(
|
||||||
DeferredLogger& deferred_logger,
|
DeferredLogger& deferred_logger,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Well& ecl_well,
|
const Well& ecl_well,
|
||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
GasLiftGroupInfo& group_info,
|
GasLiftGroupInfo& group_info,
|
||||||
|
@ -29,7 +29,7 @@ GasLiftSingleWell(const WellInterface<TypeTag> &well,
|
|||||||
const SummaryState &summary_state,
|
const SummaryState &summary_state,
|
||||||
DeferredLogger &deferred_logger,
|
DeferredLogger &deferred_logger,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState &group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
GasLiftGroupInfo &group_info,
|
GasLiftGroupInfo &group_info,
|
||||||
GLiftSyncGroups &sync_groups,
|
GLiftSyncGroups &sync_groups,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
|
@ -46,7 +46,7 @@ GasLiftStage2::GasLiftStage2(
|
|||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger &deferred_logger,
|
DeferredLogger &deferred_logger,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
const GroupState &group_state,
|
const GroupState<double>& group_state,
|
||||||
GLiftProdWells &prod_wells,
|
GLiftProdWells &prod_wells,
|
||||||
GLiftOptWells &glift_wells,
|
GLiftOptWells &glift_wells,
|
||||||
GasLiftGroupInfo& group_info,
|
GasLiftGroupInfo& group_info,
|
||||||
|
@ -37,7 +37,7 @@ class DeferredLogger;
|
|||||||
class GasLiftOpt;
|
class GasLiftOpt;
|
||||||
class GasLiftWellState;
|
class GasLiftWellState;
|
||||||
class Group;
|
class Group;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
class Schedule;
|
class Schedule;
|
||||||
class WellInterfaceGeneric;
|
class WellInterfaceGeneric;
|
||||||
template<class Scalar> class WellState;
|
template<class Scalar> class WellState;
|
||||||
@ -63,7 +63,7 @@ public:
|
|||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger,
|
DeferredLogger& deferred_logger,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
GLiftProdWells& prod_wells,
|
GLiftProdWells& prod_wells,
|
||||||
GLiftOptWells& glift_wells,
|
GLiftOptWells& glift_wells,
|
||||||
GasLiftGroupInfo& group_info,
|
GasLiftGroupInfo& group_info,
|
||||||
|
@ -29,11 +29,13 @@
|
|||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
GroupState::GroupState(std::size_t np) :
|
template<class Scalar>
|
||||||
|
GroupState<Scalar>::GroupState(std::size_t np) :
|
||||||
num_phases(np)
|
num_phases(np)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
GroupState GroupState::serializationTestObject()
|
template<class Scalar>
|
||||||
|
GroupState<Scalar> GroupState<Scalar>::serializationTestObject()
|
||||||
{
|
{
|
||||||
GroupState result(3);
|
GroupState result(3);
|
||||||
result.m_production_rates = {{"test1", {1.0, 2.0}}};
|
result.m_production_rates = {{"test1", {1.0, 2.0}}};
|
||||||
@ -52,7 +54,9 @@ GroupState GroupState::serializationTestObject()
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GroupState::operator==(const GroupState& other) const {
|
template<class Scalar>
|
||||||
|
bool GroupState<Scalar>::operator==(const GroupState& other) const
|
||||||
|
{
|
||||||
return this->m_production_rates == other.m_production_rates &&
|
return this->m_production_rates == other.m_production_rates &&
|
||||||
this->production_controls == other.production_controls &&
|
this->production_controls == other.production_controls &&
|
||||||
this->prod_red_rates == other.prod_red_rates &&
|
this->prod_red_rates == other.prod_red_rates &&
|
||||||
@ -68,19 +72,27 @@ bool GroupState::operator==(const GroupState& other) const {
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
bool GroupState::has_production_rates(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
bool GroupState<Scalar>::has_production_rates(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->m_production_rates.find(gname);
|
auto group_iter = this->m_production_rates.find(gname);
|
||||||
return (group_iter != this->m_production_rates.end());
|
return (group_iter != this->m_production_rates.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupState::update_production_rates(const std::string& gname, const std::vector<double>& rates) {
|
template<class Scalar>
|
||||||
|
void GroupState<Scalar>::update_production_rates(const std::string& gname,
|
||||||
|
const std::vector<Scalar>& rates)
|
||||||
|
{
|
||||||
if (rates.size() != this->num_phases)
|
if (rates.size() != this->num_phases)
|
||||||
throw std::logic_error("Wrong number of phases");
|
throw std::logic_error("Wrong number of phases");
|
||||||
|
|
||||||
this->m_production_rates[gname] = rates;
|
this->m_production_rates[gname] = rates;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<double>& GroupState::production_rates(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
const std::vector<Scalar>&
|
||||||
|
GroupState<Scalar>::production_rates(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->m_production_rates.find(gname);
|
auto group_iter = this->m_production_rates.find(gname);
|
||||||
if (group_iter == this->m_production_rates.end())
|
if (group_iter == this->m_production_rates.end())
|
||||||
throw std::logic_error("No such group");
|
throw std::logic_error("No such group");
|
||||||
@ -90,19 +102,29 @@ const std::vector<double>& GroupState::production_rates(const std::string& gname
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
bool GroupState::has_production_reduction_rates(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
bool GroupState<Scalar>::
|
||||||
|
has_production_reduction_rates(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->prod_red_rates.find(gname);
|
auto group_iter = this->prod_red_rates.find(gname);
|
||||||
return (group_iter != this->prod_red_rates.end());
|
return (group_iter != this->prod_red_rates.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupState::update_production_reduction_rates(const std::string& gname, const std::vector<double>& rates) {
|
template<class Scalar>
|
||||||
|
void GroupState<Scalar>::
|
||||||
|
update_production_reduction_rates(const std::string& gname,
|
||||||
|
const std::vector<Scalar>& rates)
|
||||||
|
{
|
||||||
if (rates.size() != this->num_phases)
|
if (rates.size() != this->num_phases)
|
||||||
throw std::logic_error("Wrong number of phases");
|
throw std::logic_error("Wrong number of phases");
|
||||||
|
|
||||||
this->prod_red_rates[gname] = rates;
|
this->prod_red_rates[gname] = rates;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<double>& GroupState::production_reduction_rates(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
const std::vector<Scalar>&
|
||||||
|
GroupState<Scalar>::production_reduction_rates(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->prod_red_rates.find(gname);
|
auto group_iter = this->prod_red_rates.find(gname);
|
||||||
if (group_iter == this->prod_red_rates.end())
|
if (group_iter == this->prod_red_rates.end())
|
||||||
throw std::logic_error("No such group");
|
throw std::logic_error("No such group");
|
||||||
@ -112,19 +134,29 @@ const std::vector<double>& GroupState::production_reduction_rates(const std::str
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
bool GroupState::has_injection_reduction_rates(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
bool GroupState<Scalar>::
|
||||||
|
has_injection_reduction_rates(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->inj_red_rates.find(gname);
|
auto group_iter = this->inj_red_rates.find(gname);
|
||||||
return (group_iter != this->inj_red_rates.end());
|
return (group_iter != this->inj_red_rates.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupState::update_injection_reduction_rates(const std::string& gname, const std::vector<double>& rates) {
|
template<class Scalar>
|
||||||
|
void GroupState<Scalar>::
|
||||||
|
update_injection_reduction_rates(const std::string& gname,
|
||||||
|
const std::vector<Scalar>& rates)
|
||||||
|
{
|
||||||
if (rates.size() != this->num_phases)
|
if (rates.size() != this->num_phases)
|
||||||
throw std::logic_error("Wrong number of phases");
|
throw std::logic_error("Wrong number of phases");
|
||||||
|
|
||||||
this->inj_red_rates[gname] = rates;
|
this->inj_red_rates[gname] = rates;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<double>& GroupState::injection_reduction_rates(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
const std::vector<Scalar>&
|
||||||
|
GroupState<Scalar>::injection_reduction_rates(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->inj_red_rates.find(gname);
|
auto group_iter = this->inj_red_rates.find(gname);
|
||||||
if (group_iter == this->inj_red_rates.end())
|
if (group_iter == this->inj_red_rates.end())
|
||||||
throw std::logic_error("No such group");
|
throw std::logic_error("No such group");
|
||||||
@ -133,19 +165,30 @@ const std::vector<double>& GroupState::injection_reduction_rates(const std::stri
|
|||||||
}
|
}
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
bool GroupState::has_injection_surface_rates(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
bool GroupState<Scalar>::
|
||||||
|
has_injection_surface_rates(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->inj_surface_rates.find(gname);
|
auto group_iter = this->inj_surface_rates.find(gname);
|
||||||
return (group_iter != this->inj_surface_rates.end());
|
return (group_iter != this->inj_surface_rates.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupState::update_injection_surface_rates(const std::string& gname, const std::vector<double>& rates) {
|
template<class Scalar>
|
||||||
|
void GroupState<Scalar>::
|
||||||
|
update_injection_surface_rates(const std::string& gname,
|
||||||
|
const std::vector<Scalar>& rates)
|
||||||
|
{
|
||||||
if (rates.size() != this->num_phases)
|
if (rates.size() != this->num_phases)
|
||||||
throw std::logic_error("Wrong number of phases");
|
throw std::logic_error("Wrong number of phases");
|
||||||
|
|
||||||
this->inj_surface_rates[gname] = rates;
|
this->inj_surface_rates[gname] = rates;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<double>& GroupState::injection_surface_rates(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
const std::vector<Scalar>&
|
||||||
|
GroupState<Scalar>::
|
||||||
|
injection_surface_rates(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->inj_surface_rates.find(gname);
|
auto group_iter = this->inj_surface_rates.find(gname);
|
||||||
if (group_iter == this->inj_surface_rates.end())
|
if (group_iter == this->inj_surface_rates.end())
|
||||||
throw std::logic_error("No such group");
|
throw std::logic_error("No such group");
|
||||||
@ -155,19 +198,29 @@ const std::vector<double>& GroupState::injection_surface_rates(const std::string
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
bool GroupState::has_injection_reservoir_rates(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
bool GroupState<Scalar>::
|
||||||
|
has_injection_reservoir_rates(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->inj_resv_rates.find(gname);
|
auto group_iter = this->inj_resv_rates.find(gname);
|
||||||
return (group_iter != this->inj_resv_rates.end());
|
return (group_iter != this->inj_resv_rates.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupState::update_injection_reservoir_rates(const std::string& gname, const std::vector<double>& rates) {
|
template<class Scalar>
|
||||||
|
void GroupState<Scalar>::
|
||||||
|
update_injection_reservoir_rates(const std::string& gname,
|
||||||
|
const std::vector<Scalar>& rates)
|
||||||
|
{
|
||||||
if (rates.size() != this->num_phases)
|
if (rates.size() != this->num_phases)
|
||||||
throw std::logic_error("Wrong number of phases");
|
throw std::logic_error("Wrong number of phases");
|
||||||
|
|
||||||
this->inj_resv_rates[gname] = rates;
|
this->inj_resv_rates[gname] = rates;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<double>& GroupState::injection_reservoir_rates(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
const std::vector<Scalar>&
|
||||||
|
GroupState<Scalar>::injection_reservoir_rates(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->inj_resv_rates.find(gname);
|
auto group_iter = this->inj_resv_rates.find(gname);
|
||||||
if (group_iter == this->inj_resv_rates.end())
|
if (group_iter == this->inj_resv_rates.end())
|
||||||
throw std::logic_error("No such group");
|
throw std::logic_error("No such group");
|
||||||
@ -177,14 +230,22 @@ const std::vector<double>& GroupState::injection_reservoir_rates(const std::stri
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
void GroupState::update_injection_rein_rates(const std::string& gname, const std::vector<double>& rates) {
|
template<class Scalar>
|
||||||
|
void GroupState<Scalar>::
|
||||||
|
update_injection_rein_rates(const std::string& gname,
|
||||||
|
const std::vector<Scalar>& rates)
|
||||||
|
{
|
||||||
if (rates.size() != this->num_phases)
|
if (rates.size() != this->num_phases)
|
||||||
throw std::logic_error("Wrong number of phases");
|
throw std::logic_error("Wrong number of phases");
|
||||||
|
|
||||||
this->inj_rein_rates[gname] = rates;
|
this->inj_rein_rates[gname] = rates;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<double>& GroupState::injection_rein_rates(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
const std::vector<Scalar>&
|
||||||
|
GroupState<Scalar>::
|
||||||
|
injection_rein_rates(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->inj_rein_rates.find(gname);
|
auto group_iter = this->inj_rein_rates.find(gname);
|
||||||
if (group_iter == this->inj_rein_rates.end())
|
if (group_iter == this->inj_rein_rates.end())
|
||||||
throw std::logic_error("No such group");
|
throw std::logic_error("No such group");
|
||||||
@ -194,11 +255,17 @@ const std::vector<double>& GroupState::injection_rein_rates(const std::string& g
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
void GroupState::update_injection_vrep_rate(const std::string& gname, double rate) {
|
template<class Scalar>
|
||||||
|
void GroupState<Scalar>::
|
||||||
|
update_injection_vrep_rate(const std::string& gname, Scalar rate)
|
||||||
|
{
|
||||||
this->inj_vrep_rate[gname] = rate;
|
this->inj_vrep_rate[gname] = rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
double GroupState::injection_vrep_rate(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
Scalar GroupState<Scalar>::
|
||||||
|
injection_vrep_rate(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->inj_vrep_rate.find(gname);
|
auto group_iter = this->inj_vrep_rate.find(gname);
|
||||||
if (group_iter == this->inj_vrep_rate.end())
|
if (group_iter == this->inj_vrep_rate.end())
|
||||||
throw std::logic_error("No such group");
|
throw std::logic_error("No such group");
|
||||||
@ -208,11 +275,17 @@ double GroupState::injection_vrep_rate(const std::string& gname) const {
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
void GroupState::update_grat_sales_target(const std::string& gname, double target) {
|
template<class Scalar>
|
||||||
|
void GroupState<Scalar>::
|
||||||
|
update_grat_sales_target(const std::string& gname, Scalar target)
|
||||||
|
{
|
||||||
this->m_grat_sales_target[gname] = target;
|
this->m_grat_sales_target[gname] = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
double GroupState::grat_sales_target(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
Scalar GroupState<Scalar>::
|
||||||
|
grat_sales_target(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->m_grat_sales_target.find(gname);
|
auto group_iter = this->m_grat_sales_target.find(gname);
|
||||||
if (group_iter == this->m_grat_sales_target.end())
|
if (group_iter == this->m_grat_sales_target.end())
|
||||||
throw std::logic_error("No such group");
|
throw std::logic_error("No such group");
|
||||||
@ -220,13 +293,19 @@ double GroupState::grat_sales_target(const std::string& gname) const {
|
|||||||
return group_iter->second;
|
return group_iter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GroupState::has_grat_sales_target(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
bool GroupState<Scalar>::
|
||||||
|
has_grat_sales_target(const std::string& gname) const
|
||||||
|
{
|
||||||
return (this->m_grat_sales_target.count(gname) > 0);
|
return (this->m_grat_sales_target.count(gname) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
bool GroupState::has_production_control(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
bool GroupState<Scalar>::
|
||||||
|
has_production_control(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->production_controls.find(gname);
|
auto group_iter = this->production_controls.find(gname);
|
||||||
if (group_iter == this->production_controls.end())
|
if (group_iter == this->production_controls.end())
|
||||||
return false;
|
return false;
|
||||||
@ -234,11 +313,18 @@ bool GroupState::has_production_control(const std::string& gname) const {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupState::production_control(const std::string& gname, Group::ProductionCMode cmode) {
|
template<class Scalar>
|
||||||
|
void GroupState<Scalar>::
|
||||||
|
production_control(const std::string& gname,
|
||||||
|
Group::ProductionCMode cmode)
|
||||||
|
{
|
||||||
this->production_controls[gname] = cmode;
|
this->production_controls[gname] = cmode;
|
||||||
}
|
}
|
||||||
|
|
||||||
Group::ProductionCMode GroupState::production_control(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
Group::ProductionCMode
|
||||||
|
GroupState<Scalar>::production_control(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->production_controls.find(gname);
|
auto group_iter = this->production_controls.find(gname);
|
||||||
if (group_iter == this->production_controls.end())
|
if (group_iter == this->production_controls.end())
|
||||||
throw std::logic_error("Could not find any control for production group: " + gname);
|
throw std::logic_error("Could not find any control for production group: " + gname);
|
||||||
@ -248,15 +334,26 @@ Group::ProductionCMode GroupState::production_control(const std::string& gname)
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
bool GroupState::has_injection_control(const std::string& gname, Phase phase) const {
|
template<class Scalar>
|
||||||
|
bool GroupState<Scalar>::
|
||||||
|
has_injection_control(const std::string& gname, Phase phase) const
|
||||||
|
{
|
||||||
return this->injection_controls.count(std::make_pair(phase, gname)) > 0;
|
return this->injection_controls.count(std::make_pair(phase, gname)) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GroupState::injection_control(const std::string& gname, Phase phase, Group::InjectionCMode cmode) {
|
template<class Scalar>
|
||||||
|
void GroupState<Scalar>::
|
||||||
|
injection_control(const std::string& gname,
|
||||||
|
Phase phase, Group::InjectionCMode cmode)
|
||||||
|
{
|
||||||
this->injection_controls[ std::make_pair(phase, gname) ] = cmode;
|
this->injection_controls[ std::make_pair(phase, gname) ] = cmode;
|
||||||
}
|
}
|
||||||
|
|
||||||
Group::InjectionCMode GroupState::injection_control(const std::string& gname, Phase phase) const {
|
template<class Scalar>
|
||||||
|
Group::InjectionCMode
|
||||||
|
GroupState<Scalar>::
|
||||||
|
injection_control(const std::string& gname, Phase phase) const
|
||||||
|
{
|
||||||
auto key = std::make_pair(phase, gname);
|
auto key = std::make_pair(phase, gname);
|
||||||
auto group_iter = this->injection_controls.find( key );
|
auto group_iter = this->injection_controls.find( key );
|
||||||
if (group_iter == this->injection_controls.end())
|
if (group_iter == this->injection_controls.end())
|
||||||
@ -267,7 +364,9 @@ Group::InjectionCMode GroupState::injection_control(const std::string& gname, Ph
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
GPMaint::State& GroupState::gpmaint(const std::string& gname) {
|
template<class Scalar>
|
||||||
|
GPMaint::State& GroupState<Scalar>::gpmaint(const std::string& gname)
|
||||||
|
{
|
||||||
if (!this->gpmaint_state.has(gname))
|
if (!this->gpmaint_state.has(gname))
|
||||||
this->gpmaint_state.add(gname, GPMaint::State{});
|
this->gpmaint_state.add(gname, GPMaint::State{});
|
||||||
return this->gpmaint_state[gname];
|
return this->gpmaint_state[gname];
|
||||||
@ -276,11 +375,16 @@ GPMaint::State& GroupState::gpmaint(const std::string& gname) {
|
|||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
|
||||||
void GroupState::update_gpmaint_target(const std::string& gname, double target) {
|
template<class Scalar>
|
||||||
|
void GroupState<Scalar>::
|
||||||
|
update_gpmaint_target(const std::string& gname, Scalar target)
|
||||||
|
{
|
||||||
this->m_gpmaint_target[gname] = target;
|
this->m_gpmaint_target[gname] = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
double GroupState::gpmaint_target(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
Scalar GroupState<Scalar>::gpmaint_target(const std::string& gname) const
|
||||||
|
{
|
||||||
auto group_iter = this->m_gpmaint_target.find(gname);
|
auto group_iter = this->m_gpmaint_target.find(gname);
|
||||||
if (group_iter == this->m_gpmaint_target.end())
|
if (group_iter == this->m_gpmaint_target.end())
|
||||||
throw std::logic_error("No such group");
|
throw std::logic_error("No such group");
|
||||||
@ -288,8 +392,13 @@ double GroupState::gpmaint_target(const std::string& gname) const {
|
|||||||
return group_iter->second;
|
return group_iter->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GroupState::has_gpmaint_target(const std::string& gname) const {
|
template<class Scalar>
|
||||||
|
bool GroupState<Scalar>::
|
||||||
|
has_gpmaint_target(const std::string& gname) const
|
||||||
|
{
|
||||||
return (this->m_gpmaint_target.count(gname) > 0);
|
return (this->m_gpmaint_target.count(gname) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template class GroupState<double>;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
|
template<class Scalar>
|
||||||
class GroupState {
|
class GroupState {
|
||||||
public:
|
public:
|
||||||
GroupState() = default;
|
GroupState() = default;
|
||||||
@ -41,38 +42,43 @@ public:
|
|||||||
bool operator==(const GroupState& other) const;
|
bool operator==(const GroupState& other) const;
|
||||||
|
|
||||||
bool has_production_rates(const std::string& gname) const;
|
bool has_production_rates(const std::string& gname) const;
|
||||||
void update_production_rates(const std::string& gname, const std::vector<double>& rates);
|
void update_production_rates(const std::string& gname,
|
||||||
const std::vector<double>& production_rates(const std::string& gname) const;
|
const std::vector<Scalar>& rates);
|
||||||
|
const std::vector<Scalar>& production_rates(const std::string& gname) const;
|
||||||
|
|
||||||
bool has_production_reduction_rates(const std::string& gname) const;
|
bool has_production_reduction_rates(const std::string& gname) const;
|
||||||
void update_production_reduction_rates(const std::string& gname, const std::vector<double>& rates);
|
void update_production_reduction_rates(const std::string& gname,
|
||||||
const std::vector<double>& production_reduction_rates(const std::string& gname) const;
|
const std::vector<Scalar>& rates);
|
||||||
|
const std::vector<Scalar>& production_reduction_rates(const std::string& gname) const;
|
||||||
|
|
||||||
bool has_injection_reduction_rates(const std::string& gname) const;
|
bool has_injection_reduction_rates(const std::string& gname) const;
|
||||||
void update_injection_reduction_rates(const std::string& gname, const std::vector<double>& rates);
|
void update_injection_reduction_rates(const std::string& gname,
|
||||||
const std::vector<double>& injection_reduction_rates(const std::string& gname) const;
|
const std::vector<Scalar>& rates);
|
||||||
|
const std::vector<Scalar>& injection_reduction_rates(const std::string& gname) const;
|
||||||
|
|
||||||
bool has_injection_reservoir_rates(const std::string& gname) const;
|
bool has_injection_reservoir_rates(const std::string& gname) const;
|
||||||
void update_injection_reservoir_rates(const std::string& gname, const std::vector<double>& rates);
|
void update_injection_reservoir_rates(const std::string& gname,
|
||||||
const std::vector<double>& injection_reservoir_rates(const std::string& gname) const;
|
const std::vector<Scalar>& rates);
|
||||||
|
const std::vector<Scalar>& injection_reservoir_rates(const std::string& gname) const;
|
||||||
|
|
||||||
bool has_injection_surface_rates(const std::string& gname) const;
|
bool has_injection_surface_rates(const std::string& gname) const;
|
||||||
void update_injection_surface_rates(const std::string& gname, const std::vector<double>& rates);
|
void update_injection_surface_rates(const std::string& gname,
|
||||||
const std::vector<double>& injection_surface_rates(const std::string& gname) const;
|
const std::vector<Scalar>& rates);
|
||||||
|
const std::vector<Scalar>& injection_surface_rates(const std::string& gname) const;
|
||||||
|
|
||||||
|
void update_injection_rein_rates(const std::string& gname,
|
||||||
|
const std::vector<Scalar>& rates);
|
||||||
|
const std::vector<Scalar>& injection_rein_rates(const std::string& gname) const;
|
||||||
|
|
||||||
void update_injection_rein_rates(const std::string& gname, const std::vector<double>& rates);
|
void update_injection_vrep_rate(const std::string& gname, Scalar rate);
|
||||||
const std::vector<double>& injection_rein_rates(const std::string& gname) const;
|
Scalar injection_vrep_rate(const std::string& gname) const;
|
||||||
|
|
||||||
void update_injection_vrep_rate(const std::string& gname, double rate);
|
void update_grat_sales_target(const std::string& gname, Scalar target);
|
||||||
double injection_vrep_rate(const std::string& gname) const;
|
Scalar grat_sales_target(const std::string& gname) const;
|
||||||
|
|
||||||
void update_grat_sales_target(const std::string& gname, double target);
|
|
||||||
double grat_sales_target(const std::string& gname) const;
|
|
||||||
bool has_grat_sales_target(const std::string& gname) const;
|
bool has_grat_sales_target(const std::string& gname) const;
|
||||||
|
|
||||||
void update_gpmaint_target(const std::string& gname, double target);
|
void update_gpmaint_target(const std::string& gname, Scalar target);
|
||||||
double gpmaint_target(const std::string& gname) const;
|
Scalar gpmaint_target(const std::string& gname) const;
|
||||||
bool has_gpmaint_target(const std::string& gname) const;
|
bool has_gpmaint_target(const std::string& gname) const;
|
||||||
|
|
||||||
bool has_production_control(const std::string& gname) const;
|
bool has_production_control(const std::string& gname) const;
|
||||||
@ -84,12 +90,11 @@ public:
|
|||||||
Group::InjectionCMode injection_control(const std::string& gname, Phase phase) const;
|
Group::InjectionCMode injection_control(const std::string& gname, Phase phase) const;
|
||||||
|
|
||||||
std::size_t data_size() const;
|
std::size_t data_size() const;
|
||||||
std::size_t collect(double * data) const;
|
std::size_t collect(Scalar* data) const;
|
||||||
std::size_t distribute(const double * data);
|
std::size_t distribute(const Scalar* data);
|
||||||
|
|
||||||
GPMaint::State& gpmaint(const std::string& gname);
|
GPMaint::State& gpmaint(const std::string& gname);
|
||||||
|
|
||||||
|
|
||||||
template<class Comm>
|
template<class Comm>
|
||||||
void communicate_rates(const Comm& comm)
|
void communicate_rates(const Comm& comm)
|
||||||
{
|
{
|
||||||
@ -125,11 +130,9 @@ public:
|
|||||||
sz += this->inj_vrep_rate.size();
|
sz += this->inj_vrep_rate.size();
|
||||||
|
|
||||||
// Make a vector and collect all data into it.
|
// Make a vector and collect all data into it.
|
||||||
std::vector<double> data(sz);
|
std::vector<Scalar> data(sz);
|
||||||
std::size_t pos = 0;
|
std::size_t pos = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// That the collect function mutates the vector v is an artifact for
|
// That the collect function mutates the vector v is an artifact for
|
||||||
// testing.
|
// testing.
|
||||||
auto collect = [&data, &pos](auto& v) {
|
auto collect = [&data, &pos](auto& v) {
|
||||||
@ -183,17 +186,16 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::size_t num_phases{};
|
std::size_t num_phases{};
|
||||||
std::map<std::string, std::vector<double>> m_production_rates;
|
std::map<std::string, std::vector<Scalar>> m_production_rates;
|
||||||
std::map<std::string, Group::ProductionCMode> production_controls;
|
std::map<std::string, Group::ProductionCMode> production_controls;
|
||||||
std::map<std::string, std::vector<double>> prod_red_rates;
|
std::map<std::string, std::vector<Scalar>> prod_red_rates;
|
||||||
std::map<std::string, std::vector<double>> inj_red_rates;
|
std::map<std::string, std::vector<Scalar>> inj_red_rates;
|
||||||
std::map<std::string, std::vector<double>> inj_surface_rates;
|
std::map<std::string, std::vector<Scalar>> inj_surface_rates;
|
||||||
std::map<std::string, std::vector<double>> inj_resv_rates;
|
std::map<std::string, std::vector<Scalar>> inj_resv_rates;
|
||||||
std::map<std::string, std::vector<double>> inj_rein_rates;
|
std::map<std::string, std::vector<Scalar>> inj_rein_rates;
|
||||||
std::map<std::string, double> inj_vrep_rate;
|
std::map<std::string, Scalar> inj_vrep_rate;
|
||||||
std::map<std::string, double> m_grat_sales_target;
|
std::map<std::string, Scalar> m_grat_sales_target;
|
||||||
std::map<std::string, double> m_gpmaint_target;
|
std::map<std::string, Scalar> m_gpmaint_target;
|
||||||
|
|
||||||
|
|
||||||
std::map<std::pair<Phase, std::string>, Group::InjectionCMode> injection_controls;
|
std::map<std::pair<Phase, std::string>, Group::InjectionCMode> injection_controls;
|
||||||
WellContainer<GPMaint::State> gpmaint_state;
|
WellContainer<GPMaint::State> gpmaint_state;
|
||||||
|
@ -78,32 +78,32 @@ namespace Opm
|
|||||||
const int index_of_well,
|
const int index_of_well,
|
||||||
const std::vector<PerforationData>& perf_data);
|
const std::vector<PerforationData>& perf_data);
|
||||||
|
|
||||||
virtual void init(const PhaseUsage* phase_usage_arg,
|
void init(const PhaseUsage* phase_usage_arg,
|
||||||
const std::vector<double>& depth_arg,
|
const std::vector<double>& depth_arg,
|
||||||
const double gravity_arg,
|
const double gravity_arg,
|
||||||
const int num_cells,
|
const int num_cells,
|
||||||
const std::vector< Scalar >& B_avg,
|
const std::vector<Scalar>& B_avg,
|
||||||
const bool changed_to_open_this_step) override;
|
const bool changed_to_open_this_step) override;
|
||||||
|
|
||||||
void initPrimaryVariablesEvaluation() override;
|
void initPrimaryVariablesEvaluation() override;
|
||||||
|
|
||||||
/// updating the well state based the current control mode
|
/// updating the well state based the current control mode
|
||||||
virtual void updateWellStateWithTarget(const Simulator& simulator,
|
void updateWellStateWithTarget(const Simulator& simulator,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
DeferredLogger& deferred_logger) const override;
|
DeferredLogger& deferred_logger) const override;
|
||||||
|
|
||||||
/// check whether the well equations get converged for this well
|
/// check whether the well equations get converged for this well
|
||||||
virtual ConvergenceReport getWellConvergence(const SummaryState& summary_state,
|
ConvergenceReport getWellConvergence(const SummaryState& summary_state,
|
||||||
const WellState<Scalar>& well_state,
|
const WellState<Scalar>& well_state,
|
||||||
const std::vector<double>& B_avg,
|
const std::vector<double>& B_avg,
|
||||||
DeferredLogger& deferred_logger,
|
DeferredLogger& deferred_logger,
|
||||||
const bool relax_tolerance) const override;
|
const bool relax_tolerance) const override;
|
||||||
|
|
||||||
/// Ax = Ax - C D^-1 B x
|
/// Ax = Ax - C D^-1 B x
|
||||||
virtual void apply(const BVector& x, BVector& Ax) const override;
|
void apply(const BVector& x, BVector& Ax) const override;
|
||||||
/// r = r - C D^-1 Rw
|
/// r = r - C D^-1 Rw
|
||||||
virtual void apply(BVector& r) const override;
|
void apply(BVector& r) const override;
|
||||||
|
|
||||||
/// using the solution x to recover the solution xw for wells and applying
|
/// using the solution x to recover the solution xw for wells and applying
|
||||||
/// xw to update Well State
|
/// xw to update Well State
|
||||||
@ -259,7 +259,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger) override;
|
DeferredLogger& deferred_logger) override;
|
||||||
|
|
||||||
virtual bool iterateWellEqWithSwitching(const Simulator& simulator,
|
virtual bool iterateWellEqWithSwitching(const Simulator& simulator,
|
||||||
@ -267,7 +267,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger,
|
DeferredLogger& deferred_logger,
|
||||||
const bool fixed_control = false,
|
const bool fixed_control = false,
|
||||||
const bool fixed_status = false) override;
|
const bool fixed_status = false) override;
|
||||||
@ -277,7 +277,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger) override;
|
DeferredLogger& deferred_logger) override;
|
||||||
|
|
||||||
virtual void updateWaterThroughput(const double dt, WellState<Scalar>& well_state) const override;
|
virtual void updateWaterThroughput(const double dt, WellState<Scalar>& well_state) const override;
|
||||||
|
@ -84,7 +84,7 @@ private:
|
|||||||
template<class FluidSystem, class Indices>
|
template<class FluidSystem, class Indices>
|
||||||
void MultisegmentWellAssemble<FluidSystem,Indices>::
|
void MultisegmentWellAssemble<FluidSystem,Indices>::
|
||||||
assembleControlEq(const WellState<Scalar>& well_state,
|
assembleControlEq(const WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
|
@ -30,7 +30,7 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
|
|
||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
template<class Scalar, int numWellEq, int numEq> class MultisegmentWellEquations;
|
template<class Scalar, int numWellEq, int numEq> class MultisegmentWellEquations;
|
||||||
template<class FluidSystem, class Indices> class MultisegmentWellPrimaryVariables;
|
template<class FluidSystem, class Indices> class MultisegmentWellPrimaryVariables;
|
||||||
class Schedule;
|
class Schedule;
|
||||||
@ -71,7 +71,7 @@ public:
|
|||||||
|
|
||||||
//! \brief Assemble control equation.
|
//! \brief Assemble control equation.
|
||||||
void assembleControlEq(const WellState<Scalar>& well_state,
|
void assembleControlEq(const WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
|
@ -38,7 +38,6 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
|
|
||||||
class ConvergenceReport;
|
class ConvergenceReport;
|
||||||
class GroupState;
|
|
||||||
class Schedule;
|
class Schedule;
|
||||||
class WellContributions;
|
class WellContributions;
|
||||||
class SummaryState;
|
class SummaryState;
|
||||||
|
@ -172,7 +172,7 @@ namespace Opm
|
|||||||
void
|
void
|
||||||
MultisegmentWell<TypeTag>::
|
MultisegmentWell<TypeTag>::
|
||||||
updateWellStateWithTarget(const Simulator& simulator,
|
updateWellStateWithTarget(const Simulator& simulator,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
DeferredLogger& deferred_logger) const
|
DeferredLogger& deferred_logger) const
|
||||||
{
|
{
|
||||||
@ -1435,7 +1435,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return true;
|
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return true;
|
||||||
@ -1587,7 +1587,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger,
|
DeferredLogger& deferred_logger,
|
||||||
const bool fixed_control /*false*/,
|
const bool fixed_control /*false*/,
|
||||||
const bool fixed_status /*false*/)
|
const bool fixed_status /*false*/)
|
||||||
@ -1778,7 +1778,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return;
|
if (!this->isOperableAndSolvable() && !this->wellIsStopped()) return;
|
||||||
|
@ -200,7 +200,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger) override;
|
DeferredLogger& deferred_logger) override;
|
||||||
|
|
||||||
// iterate well equations including control switching
|
// iterate well equations including control switching
|
||||||
@ -209,7 +209,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger,
|
DeferredLogger& deferred_logger,
|
||||||
const bool fixed_control = false,
|
const bool fixed_control = false,
|
||||||
const bool fixed_status = false) override;
|
const bool fixed_status = false) override;
|
||||||
@ -355,7 +355,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger) override;
|
DeferredLogger& deferred_logger) override;
|
||||||
|
|
||||||
void assembleWellEqWithoutIterationImpl(const Simulator& simulator,
|
void assembleWellEqWithoutIterationImpl(const Simulator& simulator,
|
||||||
@ -363,7 +363,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
void calculateSinglePerf(const Simulator& simulator,
|
void calculateSinglePerf(const Simulator& simulator,
|
||||||
|
@ -85,7 +85,7 @@ template<class FluidSystem, class Indices>
|
|||||||
void
|
void
|
||||||
StandardWellAssemble<FluidSystem,Indices>::
|
StandardWellAssemble<FluidSystem,Indices>::
|
||||||
assembleControlEq(const WellState<Scalar>& well_state,
|
assembleControlEq(const WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
|
@ -29,7 +29,7 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
|
|
||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
class Schedule;
|
class Schedule;
|
||||||
template<class Scalar, int numEq> class StandardWellEquations;
|
template<class Scalar, int numEq> class StandardWellEquations;
|
||||||
template<class FluidSystem, class Indices> class StandardWellPrimaryVariables;
|
template<class FluidSystem, class Indices> class StandardWellPrimaryVariables;
|
||||||
@ -53,7 +53,7 @@ public:
|
|||||||
|
|
||||||
//! \brief Assemble control equation.
|
//! \brief Assemble control equation.
|
||||||
void assembleControlEq(const WellState<Scalar>& well_state,
|
void assembleControlEq(const WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
|
@ -36,7 +36,6 @@ namespace Opm
|
|||||||
|
|
||||||
class ConvergenceReport;
|
class ConvergenceReport;
|
||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class GroupState;
|
|
||||||
class Schedule;
|
class Schedule;
|
||||||
class SummaryState;
|
class SummaryState;
|
||||||
class WellContributions;
|
class WellContributions;
|
||||||
|
@ -333,7 +333,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
// TODO: only_wells should be put back to save some computation
|
// TODO: only_wells should be put back to save some computation
|
||||||
@ -359,7 +359,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
// try to regularize equation if the well does not converge
|
// try to regularize equation if the well does not converge
|
||||||
@ -2283,7 +2283,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
const int max_iter = this->param_.max_inner_iter_wells_;
|
const int max_iter = this->param_.max_inner_iter_wells_;
|
||||||
@ -2330,7 +2330,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger,
|
DeferredLogger& deferred_logger,
|
||||||
const bool fixed_control /*false*/,
|
const bool fixed_control /*false*/,
|
||||||
const bool fixed_status /*false*/)
|
const bool fixed_status /*false*/)
|
||||||
|
@ -42,7 +42,7 @@ TargetCalculator::TargetCalculator(const Group::ProductionCMode cmode,
|
|||||||
const std::vector<double>& resv_coeff,
|
const std::vector<double>& resv_coeff,
|
||||||
const double group_grat_target_from_sales,
|
const double group_grat_target_from_sales,
|
||||||
const std::string& group_name,
|
const std::string& group_name,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const bool use_gpmaint)
|
const bool use_gpmaint)
|
||||||
: cmode_(cmode)
|
: cmode_(cmode)
|
||||||
, pu_(pu)
|
, pu_(pu)
|
||||||
@ -157,7 +157,7 @@ InjectionTargetCalculator::InjectionTargetCalculator(const Group::InjectionCMode
|
|||||||
const std::vector<double>& resv_coeff,
|
const std::vector<double>& resv_coeff,
|
||||||
const std::string& group_name,
|
const std::string& group_name,
|
||||||
const double sales_target,
|
const double sales_target,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Phase& injection_phase,
|
const Phase& injection_phase,
|
||||||
const bool use_gpmaint,
|
const bool use_gpmaint,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
|
@ -32,7 +32,7 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
|
|
||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
struct PhaseUsage;
|
struct PhaseUsage;
|
||||||
|
|
||||||
namespace WellGroupHelpers
|
namespace WellGroupHelpers
|
||||||
@ -48,7 +48,7 @@ namespace WellGroupHelpers
|
|||||||
const std::vector<double>& resv_coeff,
|
const std::vector<double>& resv_coeff,
|
||||||
const double group_grat_target_from_sales,
|
const double group_grat_target_from_sales,
|
||||||
const std::string& group_name,
|
const std::string& group_name,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const bool use_gpmaint);
|
const bool use_gpmaint);
|
||||||
|
|
||||||
template <typename RateType>
|
template <typename RateType>
|
||||||
@ -70,7 +70,7 @@ namespace WellGroupHelpers
|
|||||||
const std::vector<double>& resv_coeff_;
|
const std::vector<double>& resv_coeff_;
|
||||||
const double group_grat_target_from_sales_;
|
const double group_grat_target_from_sales_;
|
||||||
const std::string& group_name_;
|
const std::string& group_name_;
|
||||||
const GroupState& group_state_;
|
const GroupState<double>& group_state_;
|
||||||
bool use_gpmaint_;
|
bool use_gpmaint_;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ namespace WellGroupHelpers
|
|||||||
const std::vector<double>& resv_coeff,
|
const std::vector<double>& resv_coeff,
|
||||||
const std::string& group_name,
|
const std::string& group_name,
|
||||||
const double sales_target,
|
const double sales_target,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Phase& injection_phase,
|
const Phase& injection_phase,
|
||||||
const bool use_gpmaint,
|
const bool use_gpmaint,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
@ -105,7 +105,7 @@ namespace WellGroupHelpers
|
|||||||
const std::vector<double>& resv_coeff_;
|
const std::vector<double>& resv_coeff_;
|
||||||
const std::string& group_name_;
|
const std::string& group_name_;
|
||||||
double sales_target_;
|
double sales_target_;
|
||||||
const GroupState& group_state_;
|
const GroupState<double>& group_state_;
|
||||||
bool use_gpmaint_;
|
bool use_gpmaint_;
|
||||||
int pos_;
|
int pos_;
|
||||||
GuideRateModel::Target target_;
|
GuideRateModel::Target target_;
|
||||||
|
@ -36,7 +36,7 @@ WGState WGState::serializationTestObject(const ParallelWellInfo& pinfo)
|
|||||||
{
|
{
|
||||||
WGState result(PhaseUsage{});
|
WGState result(PhaseUsage{});
|
||||||
result.well_state = WellState<double>::serializationTestObject(pinfo);
|
result.well_state = WellState<double>::serializationTestObject(pinfo);
|
||||||
result.group_state = GroupState::serializationTestObject();
|
result.group_state = GroupState<double>::serializationTestObject();
|
||||||
result.well_test_state = WellTestState::serializationTestObject();
|
result.well_test_state = WellTestState::serializationTestObject();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -42,7 +42,7 @@ struct WGState {
|
|||||||
void wtest_state(WellTestState wtest_state);
|
void wtest_state(WellTestState wtest_state);
|
||||||
|
|
||||||
WellState<double> well_state;
|
WellState<double> well_state;
|
||||||
GroupState group_state;
|
GroupState<double> group_state;
|
||||||
WellTestState well_test_state;
|
WellTestState well_test_state;
|
||||||
|
|
||||||
bool operator==(const WGState&) const;
|
bool operator==(const WGState&) const;
|
||||||
|
@ -54,7 +54,7 @@ template<class EvalWell>
|
|||||||
void
|
void
|
||||||
WellAssemble<FluidSystem>::
|
WellAssemble<FluidSystem>::
|
||||||
assembleControlEqProd(const WellState<Scalar>& well_state,
|
assembleControlEqProd(const WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const Well::ProductionControls& controls,
|
const Well::ProductionControls& controls,
|
||||||
@ -190,7 +190,7 @@ template<class EvalWell>
|
|||||||
void
|
void
|
||||||
WellAssemble<FluidSystem>::
|
WellAssemble<FluidSystem>::
|
||||||
assembleControlEqInj(const WellState<Scalar>& well_state,
|
assembleControlEqInj(const WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const Well::InjectionControls& controls,
|
const Well::InjectionControls& controls,
|
||||||
@ -278,7 +278,7 @@ assembleControlEqInj(const WellState<Scalar>& well_state,
|
|||||||
#define INSTANCE_METHODS(A,...) \
|
#define INSTANCE_METHODS(A,...) \
|
||||||
template void WellAssemble<A>:: \
|
template void WellAssemble<A>:: \
|
||||||
assembleControlEqProd<__VA_ARGS__>(const WellState<typename A::Scalar>&, \
|
assembleControlEqProd<__VA_ARGS__>(const WellState<typename A::Scalar>&, \
|
||||||
const GroupState&, \
|
const GroupState<typename A::Scalar>&, \
|
||||||
const Schedule&, \
|
const Schedule&, \
|
||||||
const SummaryState&, \
|
const SummaryState&, \
|
||||||
const Well::ProductionControls&, \
|
const Well::ProductionControls&, \
|
||||||
@ -289,7 +289,7 @@ assembleControlEqProd<__VA_ARGS__>(const WellState<typename A::Scalar>&, \
|
|||||||
DeferredLogger&) const; \
|
DeferredLogger&) const; \
|
||||||
template void WellAssemble<A>:: \
|
template void WellAssemble<A>:: \
|
||||||
assembleControlEqInj<__VA_ARGS__>(const WellState<typename A::Scalar>&, \
|
assembleControlEqInj<__VA_ARGS__>(const WellState<typename A::Scalar>&, \
|
||||||
const GroupState&, \
|
const GroupState<typename A::Scalar>&, \
|
||||||
const Schedule&, \
|
const Schedule&, \
|
||||||
const SummaryState&, \
|
const SummaryState&, \
|
||||||
const Well::InjectionControls&, \
|
const Well::InjectionControls&, \
|
||||||
|
@ -36,7 +36,7 @@ namespace Opm
|
|||||||
|
|
||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class Group;
|
class Group;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
class Schedule;
|
class Schedule;
|
||||||
class SummaryState;
|
class SummaryState;
|
||||||
template<class FluidSystem> class WellInterfaceFluidSystem;
|
template<class FluidSystem> class WellInterfaceFluidSystem;
|
||||||
@ -56,7 +56,7 @@ public:
|
|||||||
|
|
||||||
template<class EvalWell>
|
template<class EvalWell>
|
||||||
void assembleControlEqProd(const WellState<Scalar>& well_state,
|
void assembleControlEqProd(const WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const WellProductionControls& controls,
|
const WellProductionControls& controls,
|
||||||
@ -68,7 +68,7 @@ public:
|
|||||||
|
|
||||||
template<class EvalWell>
|
template<class EvalWell>
|
||||||
void assembleControlEqInj(const WellState<Scalar>& well_state,
|
void assembleControlEqInj(const WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const WellInjectionControls& controls,
|
const WellInjectionControls& controls,
|
||||||
|
@ -37,7 +37,7 @@ std::pair<bool, double>
|
|||||||
WellGroupConstraints::
|
WellGroupConstraints::
|
||||||
checkGroupConstraintsInj(const Group& group,
|
checkGroupConstraintsInj(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const double efficiencyFactor,
|
const double efficiencyFactor,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
@ -95,7 +95,7 @@ std::pair<bool, double>
|
|||||||
WellGroupConstraints::
|
WellGroupConstraints::
|
||||||
checkGroupConstraintsProd(const Group& group,
|
checkGroupConstraintsProd(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const double efficiencyFactor,
|
const double efficiencyFactor,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
@ -125,7 +125,7 @@ checkGroupConstraintsProd(const Group& group,
|
|||||||
|
|
||||||
bool WellGroupConstraints::
|
bool WellGroupConstraints::
|
||||||
checkGroupConstraints(WellState<double>& well_state,
|
checkGroupConstraints(WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const RateConvFunc& rateConverter,
|
const RateConvFunc& rateConverter,
|
||||||
|
@ -35,7 +35,7 @@ namespace Opm
|
|||||||
|
|
||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class Group;
|
class Group;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
enum class InjectorType;
|
enum class InjectorType;
|
||||||
using RegionId = int;
|
using RegionId = int;
|
||||||
class Schedule;
|
class Schedule;
|
||||||
@ -52,7 +52,7 @@ public:
|
|||||||
using RateConvFunc = std::function<void(const RegionId, const int, const std::optional<std::string>&, std::vector<double>&)>;
|
using RateConvFunc = std::function<void(const RegionId, const int, const std::optional<std::string>&, std::vector<double>&)>;
|
||||||
|
|
||||||
bool checkGroupConstraints(WellState<double>& well_state,
|
bool checkGroupConstraints(WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const RateConvFunc& rateConverter,
|
const RateConvFunc& rateConverter,
|
||||||
@ -62,7 +62,7 @@ private:
|
|||||||
std::pair<bool, double>
|
std::pair<bool, double>
|
||||||
checkGroupConstraintsInj(const Group& group,
|
checkGroupConstraintsInj(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const double efficiencyFactor,
|
const double efficiencyFactor,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
@ -72,7 +72,7 @@ private:
|
|||||||
std::pair<bool, double>
|
std::pair<bool, double>
|
||||||
checkGroupConstraintsProd(const Group& group,
|
checkGroupConstraintsProd(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const double efficiencyFactor,
|
const double efficiencyFactor,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
|
@ -48,7 +48,7 @@ template<class EvalWell>
|
|||||||
void WellGroupControls::
|
void WellGroupControls::
|
||||||
getGroupInjectionControl(const Group& group,
|
getGroupInjectionControl(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const InjectorType& injectorType,
|
const InjectorType& injectorType,
|
||||||
@ -188,7 +188,7 @@ std::optional<double>
|
|||||||
WellGroupControls::
|
WellGroupControls::
|
||||||
getGroupInjectionTargetRate(const Group& group,
|
getGroupInjectionTargetRate(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const InjectorType& injectorType,
|
const InjectorType& injectorType,
|
||||||
@ -303,7 +303,7 @@ getGroupInjectionTargetRate(const Group& group,
|
|||||||
template<class EvalWell>
|
template<class EvalWell>
|
||||||
void WellGroupControls::getGroupProductionControl(const Group& group,
|
void WellGroupControls::getGroupProductionControl(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const EvalWell& bhp,
|
const EvalWell& bhp,
|
||||||
@ -410,7 +410,7 @@ void WellGroupControls::getGroupProductionControl(const Group& group,
|
|||||||
double WellGroupControls::
|
double WellGroupControls::
|
||||||
getGroupProductionTargetRate(const Group& group,
|
getGroupProductionTargetRate(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const RateConvFunc& rateConverter,
|
const RateConvFunc& rateConverter,
|
||||||
@ -506,7 +506,7 @@ getGroupProductionTargetRate(const Group& group,
|
|||||||
template void WellGroupControls:: \
|
template void WellGroupControls:: \
|
||||||
getGroupInjectionControl<__VA_ARGS__>(const Group&, \
|
getGroupInjectionControl<__VA_ARGS__>(const Group&, \
|
||||||
const WellState<double>&, \
|
const WellState<double>&, \
|
||||||
const GroupState&, \
|
const GroupState<double>&, \
|
||||||
const Schedule&, \
|
const Schedule&, \
|
||||||
const SummaryState&, \
|
const SummaryState&, \
|
||||||
const InjectorType&, \
|
const InjectorType&, \
|
||||||
@ -519,7 +519,7 @@ getGroupInjectionControl<__VA_ARGS__>(const Group&, \
|
|||||||
template void WellGroupControls:: \
|
template void WellGroupControls:: \
|
||||||
getGroupProductionControl<__VA_ARGS__>(const Group&, \
|
getGroupProductionControl<__VA_ARGS__>(const Group&, \
|
||||||
const WellState<double>&, \
|
const WellState<double>&, \
|
||||||
const GroupState&, \
|
const GroupState<double>&, \
|
||||||
const Schedule&, \
|
const Schedule&, \
|
||||||
const SummaryState&, \
|
const SummaryState&, \
|
||||||
const __VA_ARGS__& bhp, \
|
const __VA_ARGS__& bhp, \
|
||||||
|
@ -34,7 +34,7 @@ namespace Opm
|
|||||||
|
|
||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class Group;
|
class Group;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
enum class InjectorType;
|
enum class InjectorType;
|
||||||
using RegionId = int;
|
using RegionId = int;
|
||||||
class Schedule;
|
class Schedule;
|
||||||
@ -53,7 +53,7 @@ public:
|
|||||||
template<class EvalWell>
|
template<class EvalWell>
|
||||||
void getGroupInjectionControl(const Group& group,
|
void getGroupInjectionControl(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const InjectorType& injectorType,
|
const InjectorType& injectorType,
|
||||||
@ -67,7 +67,7 @@ public:
|
|||||||
std::optional<double>
|
std::optional<double>
|
||||||
getGroupInjectionTargetRate(const Group& group,
|
getGroupInjectionTargetRate(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const InjectorType& injectorType,
|
const InjectorType& injectorType,
|
||||||
@ -78,7 +78,7 @@ public:
|
|||||||
template<class EvalWell>
|
template<class EvalWell>
|
||||||
void getGroupProductionControl(const Group& group,
|
void getGroupProductionControl(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const EvalWell& bhp,
|
const EvalWell& bhp,
|
||||||
@ -90,7 +90,7 @@ public:
|
|||||||
|
|
||||||
double getGroupProductionTargetRate(const Group& group,
|
double getGroupProductionTargetRate(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const RateConvFunc& rateConverter,
|
const RateConvFunc& rateConverter,
|
||||||
|
@ -136,7 +136,7 @@ namespace WellGroupHelpers
|
|||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
GroupState& group_state)
|
GroupState<double>& group_state)
|
||||||
{
|
{
|
||||||
|
|
||||||
for (const std::string& groupName : group.groups()) {
|
for (const std::string& groupName : group.groups()) {
|
||||||
@ -270,7 +270,7 @@ namespace WellGroupHelpers
|
|||||||
const Opm::PhaseUsage& pu,
|
const Opm::PhaseUsage& pu,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
GuideRate* guideRate,
|
GuideRate* guideRate,
|
||||||
Opm::DeferredLogger& deferred_logger)
|
Opm::DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
@ -331,7 +331,7 @@ namespace WellGroupHelpers
|
|||||||
const PhaseUsage& pu,
|
const PhaseUsage& pu,
|
||||||
const GuideRate& guide_rate,
|
const GuideRate& guide_rate,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state,
|
GroupState<double>& group_state,
|
||||||
std::vector<double>& groupTargetReduction)
|
std::vector<double>& groupTargetReduction)
|
||||||
{
|
{
|
||||||
const int np = wellState.numPhases();
|
const int np = wellState.numPhases();
|
||||||
@ -467,7 +467,7 @@ namespace WellGroupHelpers
|
|||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
bool isInjector,
|
bool isInjector,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
WellState<double>& wellState) {
|
WellState<double>& wellState) {
|
||||||
for (const std::string& groupName : group.groups()) {
|
for (const std::string& groupName : group.groups()) {
|
||||||
bool individual_control = false;
|
bool individual_control = false;
|
||||||
@ -535,7 +535,7 @@ namespace WellGroupHelpers
|
|||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state)
|
GroupState<double>& group_state)
|
||||||
{
|
{
|
||||||
for (const std::string& groupName : group.groups()) {
|
for (const std::string& groupName : group.groups()) {
|
||||||
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
||||||
@ -559,7 +559,7 @@ namespace WellGroupHelpers
|
|||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state)
|
GroupState<double>& group_state)
|
||||||
{
|
{
|
||||||
for (const std::string& groupName : group.groups()) {
|
for (const std::string& groupName : group.groups()) {
|
||||||
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
||||||
@ -583,7 +583,7 @@ namespace WellGroupHelpers
|
|||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state)
|
GroupState<double>& group_state)
|
||||||
{
|
{
|
||||||
for (const std::string& groupName : group.groups()) {
|
for (const std::string& groupName : group.groups()) {
|
||||||
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
||||||
@ -637,7 +637,7 @@ namespace WellGroupHelpers
|
|||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state)
|
GroupState<double>& group_state)
|
||||||
{
|
{
|
||||||
for (const std::string& groupName : group.groups()) {
|
for (const std::string& groupName : group.groups()) {
|
||||||
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
||||||
@ -658,7 +658,7 @@ namespace WellGroupHelpers
|
|||||||
const PhaseUsage& pu,
|
const PhaseUsage& pu,
|
||||||
const SummaryState& st,
|
const SummaryState& st,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state,
|
GroupState<double>& group_state,
|
||||||
bool sum_rank)
|
bool sum_rank)
|
||||||
{
|
{
|
||||||
const int np = wellState.numPhases();
|
const int np = wellState.numPhases();
|
||||||
@ -694,7 +694,7 @@ namespace WellGroupHelpers
|
|||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const double dt,
|
const double dt,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
GroupState& group_state)
|
GroupState<double>& group_state)
|
||||||
{
|
{
|
||||||
for (const std::string& groupName : group.groups()) {
|
for (const std::string& groupName : group.groups()) {
|
||||||
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
|
||||||
@ -780,7 +780,7 @@ namespace WellGroupHelpers
|
|||||||
std::map<std::string, double>
|
std::map<std::string, double>
|
||||||
computeNetworkPressures(const Opm::Network::ExtNetwork& network,
|
computeNetworkPressures(const Opm::Network::ExtNetwork& network,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const VFPProdProperties& vfp_prod_props,
|
const VFPProdProperties& vfp_prod_props,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int report_time_step)
|
const int report_time_step)
|
||||||
@ -925,7 +925,9 @@ namespace WellGroupHelpers
|
|||||||
}
|
}
|
||||||
|
|
||||||
GuideRate::RateVector
|
GuideRate::RateVector
|
||||||
getProductionGroupRateVector(const GroupState& group_state, const PhaseUsage& pu, const std::string& group_name)
|
getProductionGroupRateVector(const GroupState<double>& group_state,
|
||||||
|
const PhaseUsage& pu,
|
||||||
|
const std::string& group_name)
|
||||||
{
|
{
|
||||||
return getGuideRateVector(group_state.production_rates(group_name), pu);
|
return getGuideRateVector(group_state.production_rates(group_name), pu);
|
||||||
}
|
}
|
||||||
@ -933,7 +935,7 @@ namespace WellGroupHelpers
|
|||||||
double getGuideRate(const std::string& name,
|
double getGuideRate(const std::string& name,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const GuideRate* guideRate,
|
const GuideRate* guideRate,
|
||||||
const GuideRateModel::Target target,
|
const GuideRateModel::Target target,
|
||||||
@ -987,7 +989,7 @@ namespace WellGroupHelpers
|
|||||||
double getGuideRateInj(const std::string& name,
|
double getGuideRateInj(const std::string& name,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const GuideRate* guideRate,
|
const GuideRate* guideRate,
|
||||||
const GuideRateModel::Target target,
|
const GuideRateModel::Target target,
|
||||||
@ -1038,7 +1040,7 @@ namespace WellGroupHelpers
|
|||||||
|
|
||||||
int groupControlledWells(const Schedule& schedule,
|
int groupControlledWells(const Schedule& schedule,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int report_step,
|
const int report_step,
|
||||||
const std::string& group_name,
|
const std::string& group_name,
|
||||||
const std::string& always_included_child,
|
const std::string& always_included_child,
|
||||||
@ -1110,7 +1112,7 @@ namespace WellGroupHelpers
|
|||||||
const std::string& parent,
|
const std::string& parent,
|
||||||
const Group& group,
|
const Group& group,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const GuideRate* guideRate,
|
const GuideRate* guideRate,
|
||||||
const double* rates,
|
const double* rates,
|
||||||
@ -1256,7 +1258,7 @@ namespace WellGroupHelpers
|
|||||||
const std::string& parent,
|
const std::string& parent,
|
||||||
const Group& group,
|
const Group& group,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const GuideRate* guideRate,
|
const GuideRate* guideRate,
|
||||||
const double* rates,
|
const double* rates,
|
||||||
@ -1534,7 +1536,7 @@ namespace WellGroupHelpers
|
|||||||
const int report_step,
|
const int report_step,
|
||||||
const double sim_time,
|
const double sim_time,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
GuideRate* guide_rate,
|
GuideRate* guide_rate,
|
||||||
std::vector<double>& pot,
|
std::vector<double>& pot,
|
||||||
@ -1552,7 +1554,7 @@ namespace WellGroupHelpers
|
|||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const double& simTime,
|
const double& simTime,
|
||||||
WellState<double>& wellState,
|
WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
GuideRate* guideRate,
|
GuideRate* guideRate,
|
||||||
std::vector<double>& pot)
|
std::vector<double>& pot)
|
||||||
@ -1668,7 +1670,7 @@ namespace WellGroupHelpers
|
|||||||
int,
|
int,
|
||||||
double,
|
double,
|
||||||
const WellState<double>&,
|
const WellState<double>&,
|
||||||
GroupState&);
|
GroupState<double>&);
|
||||||
template void WellGroupHelpers::setRegionAveragePressureCalculator<AvgP>(const Group&,
|
template void WellGroupHelpers::setRegionAveragePressureCalculator<AvgP>(const Group&,
|
||||||
const Schedule&,
|
const Schedule&,
|
||||||
const int,
|
const int,
|
||||||
|
@ -34,7 +34,7 @@ namespace Opm
|
|||||||
|
|
||||||
class DeferredLogger;
|
class DeferredLogger;
|
||||||
class Group;
|
class Group;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
namespace Network { class ExtNetwork; }
|
namespace Network { class ExtNetwork; }
|
||||||
struct PhaseUsage;
|
struct PhaseUsage;
|
||||||
class Schedule;
|
class Schedule;
|
||||||
@ -53,7 +53,7 @@ namespace WellGroupHelpers
|
|||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
GroupState& group_state);
|
GroupState<double>& group_state);
|
||||||
|
|
||||||
void accumulateGroupEfficiencyFactor(const Group& group,
|
void accumulateGroupEfficiencyFactor(const Group& group,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
@ -87,7 +87,7 @@ namespace WellGroupHelpers
|
|||||||
const PhaseUsage& pu,
|
const PhaseUsage& pu,
|
||||||
const GuideRate& guide_rate,
|
const GuideRate& guide_rate,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state,
|
GroupState<double>& group_state,
|
||||||
std::vector<double>& groupTargetReduction);
|
std::vector<double>& groupTargetReduction);
|
||||||
|
|
||||||
void updateGuideRates(const Group& group,
|
void updateGuideRates(const Group& group,
|
||||||
@ -97,7 +97,7 @@ namespace WellGroupHelpers
|
|||||||
int report_step,
|
int report_step,
|
||||||
double sim_time,
|
double sim_time,
|
||||||
WellState<double>& well_state,
|
WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
GuideRate* guide_rate,
|
GuideRate* guide_rate,
|
||||||
std::vector<double>& pot,
|
std::vector<double>& pot,
|
||||||
@ -109,7 +109,7 @@ namespace WellGroupHelpers
|
|||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const double& simTime,
|
const double& simTime,
|
||||||
WellState<double>& wellState,
|
WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
GuideRate* guideRate,
|
GuideRate* guideRate,
|
||||||
std::vector<double>& pot);
|
std::vector<double>& pot);
|
||||||
@ -128,7 +128,7 @@ namespace WellGroupHelpers
|
|||||||
const Opm::PhaseUsage& pu,
|
const Opm::PhaseUsage& pu,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
GuideRate* guideRate,
|
GuideRate* guideRate,
|
||||||
Opm::DeferredLogger& deferred_logger);
|
Opm::DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
@ -136,19 +136,19 @@ namespace WellGroupHelpers
|
|||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state);
|
GroupState<double>& group_state);
|
||||||
|
|
||||||
void updateReservoirRatesInjectionGroups(const Group& group,
|
void updateReservoirRatesInjectionGroups(const Group& group,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state);
|
GroupState<double>& group_state);
|
||||||
|
|
||||||
void updateSurfaceRatesInjectionGroups(const Group& group,
|
void updateSurfaceRatesInjectionGroups(const Group& group,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state);
|
GroupState<double>& group_state);
|
||||||
|
|
||||||
void updateWellRates(const Group& group,
|
void updateWellRates(const Group& group,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
@ -160,14 +160,14 @@ namespace WellGroupHelpers
|
|||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state);
|
GroupState<double>& group_state);
|
||||||
|
|
||||||
void updateWellRatesFromGroupTargetScale(const double scale,
|
void updateWellRatesFromGroupTargetScale(const double scale,
|
||||||
const Group& group,
|
const Group& group,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
bool isInjector,
|
bool isInjector,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
WellState<double>& wellState);
|
WellState<double>& wellState);
|
||||||
|
|
||||||
void updateREINForGroups(const Group& group,
|
void updateREINForGroups(const Group& group,
|
||||||
@ -176,7 +176,7 @@ namespace WellGroupHelpers
|
|||||||
const PhaseUsage& pu,
|
const PhaseUsage& pu,
|
||||||
const SummaryState& st,
|
const SummaryState& st,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
GroupState& group_state,
|
GroupState<double>& group_state,
|
||||||
bool sum_rank);
|
bool sum_rank);
|
||||||
|
|
||||||
|
|
||||||
@ -199,26 +199,30 @@ namespace WellGroupHelpers
|
|||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const double dt,
|
const double dt,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
GroupState& group_state);
|
GroupState<double>& group_state);
|
||||||
|
|
||||||
std::map<std::string, double>
|
std::map<std::string, double>
|
||||||
computeNetworkPressures(const Opm::Network::ExtNetwork& network,
|
computeNetworkPressures(const Opm::Network::ExtNetwork& network,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const VFPProdProperties& vfp_prod_props,
|
const VFPProdProperties& vfp_prod_props,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const int report_time_step);
|
const int report_time_step);
|
||||||
|
|
||||||
GuideRate::RateVector
|
GuideRate::RateVector
|
||||||
getWellRateVector(const WellState<double>& well_state, const PhaseUsage& pu, const std::string& name);
|
getWellRateVector(const WellState<double>& well_state,
|
||||||
|
const PhaseUsage& pu,
|
||||||
|
const std::string& name);
|
||||||
|
|
||||||
GuideRate::RateVector
|
GuideRate::RateVector
|
||||||
getProductionGroupRateVector(const GroupState& group_state, const PhaseUsage& pu, const std::string& group_name);
|
getProductionGroupRateVector(const GroupState<double>& group_state,
|
||||||
|
const PhaseUsage& pu,
|
||||||
|
const std::string& group_name);
|
||||||
|
|
||||||
double getGuideRate(const std::string& name,
|
double getGuideRate(const std::string& name,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const GuideRate* guideRate,
|
const GuideRate* guideRate,
|
||||||
const GuideRateModel::Target target,
|
const GuideRateModel::Target target,
|
||||||
@ -228,7 +232,7 @@ namespace WellGroupHelpers
|
|||||||
double getGuideRateInj(const std::string& name,
|
double getGuideRateInj(const std::string& name,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const GuideRate* guideRate,
|
const GuideRate* guideRate,
|
||||||
const GuideRateModel::Target target,
|
const GuideRateModel::Target target,
|
||||||
@ -237,7 +241,7 @@ namespace WellGroupHelpers
|
|||||||
|
|
||||||
int groupControlledWells(const Schedule& schedule,
|
int groupControlledWells(const Schedule& schedule,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int report_step,
|
const int report_step,
|
||||||
const std::string& group_name,
|
const std::string& group_name,
|
||||||
const std::string& always_included_child,
|
const std::string& always_included_child,
|
||||||
@ -249,7 +253,7 @@ namespace WellGroupHelpers
|
|||||||
const std::string& parent,
|
const std::string& parent,
|
||||||
const Group& group,
|
const Group& group,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const GuideRate* guideRate,
|
const GuideRate* guideRate,
|
||||||
const double* rates,
|
const double* rates,
|
||||||
@ -278,7 +282,7 @@ namespace WellGroupHelpers
|
|||||||
const std::string& parent,
|
const std::string& parent,
|
||||||
const Group& group,
|
const Group& group,
|
||||||
const WellState<double>& wellState,
|
const WellState<double>& wellState,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const int reportStepIdx,
|
const int reportStepIdx,
|
||||||
const GuideRate* guideRate,
|
const GuideRate* guideRate,
|
||||||
const double* rates,
|
const double* rates,
|
||||||
|
@ -170,20 +170,20 @@ public:
|
|||||||
void assembleWellEq(const Simulator& simulator,
|
void assembleWellEq(const Simulator& simulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
void assembleWellEqWithoutIteration(const Simulator& simulator,
|
void assembleWellEqWithoutIteration(const Simulator& simulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
// TODO: better name or further refactoring the function to make it more clear
|
// TODO: better name or further refactoring the function to make it more clear
|
||||||
void prepareWellBeforeAssembling(const Simulator& simulator,
|
void prepareWellBeforeAssembling(const Simulator& simulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ public:
|
|||||||
DeferredLogger& deferred_logger) = 0;
|
DeferredLogger& deferred_logger) = 0;
|
||||||
|
|
||||||
virtual void updateWellStateWithTarget(const Simulator& simulator,
|
virtual void updateWellStateWithTarget(const Simulator& simulator,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
@ -238,12 +238,12 @@ public:
|
|||||||
bool updateWellControl(const Simulator& simulator,
|
bool updateWellControl(const Simulator& simulator,
|
||||||
const IndividualOrGroup iog,
|
const IndividualOrGroup iog,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger) /* const */;
|
DeferredLogger& deferred_logger) /* const */;
|
||||||
|
|
||||||
bool updateWellControlAndStatusLocalIteration(const Simulator& simulator,
|
bool updateWellControlAndStatusLocalIteration(const Simulator& simulator,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
const double WQTotal,
|
const double WQTotal,
|
||||||
@ -291,7 +291,7 @@ public:
|
|||||||
void wellTesting(const Simulator& simulator,
|
void wellTesting(const Simulator& simulator,
|
||||||
const double simulation_time,
|
const double simulation_time,
|
||||||
/* const */ WellState<Scalar>& well_state,
|
/* const */ WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
WellTestState& welltest_state,
|
WellTestState& welltest_state,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
@ -303,7 +303,7 @@ public:
|
|||||||
const Simulator& simulator,
|
const Simulator& simulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState &group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
void gliftBeginTimeStepWellTestUpdateALQ(const Simulator& simulator,
|
void gliftBeginTimeStepWellTestUpdateALQ(const Simulator& simulator,
|
||||||
@ -338,7 +338,7 @@ public:
|
|||||||
|
|
||||||
void solveWellEquation(const Simulator& simulator,
|
void solveWellEquation(const Simulator& simulator,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
const std::vector<RateVector>& connectionRates() const
|
const std::vector<RateVector>& connectionRates() const
|
||||||
@ -414,7 +414,7 @@ protected:
|
|||||||
const WellInjectionControls& inj_controls,
|
const WellInjectionControls& inj_controls,
|
||||||
const WellProductionControls& prod_controls,
|
const WellProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger) = 0;
|
DeferredLogger& deferred_logger) = 0;
|
||||||
|
|
||||||
// iterate well equations with the specified control until converged
|
// iterate well equations with the specified control until converged
|
||||||
@ -423,7 +423,7 @@ protected:
|
|||||||
const WellInjectionControls& inj_controls,
|
const WellInjectionControls& inj_controls,
|
||||||
const WellProductionControls& prod_controls,
|
const WellProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger) = 0;
|
DeferredLogger& deferred_logger) = 0;
|
||||||
|
|
||||||
virtual bool iterateWellEqWithSwitching(const Simulator& simulator,
|
virtual bool iterateWellEqWithSwitching(const Simulator& simulator,
|
||||||
@ -431,7 +431,7 @@ protected:
|
|||||||
const WellInjectionControls& inj_controls,
|
const WellInjectionControls& inj_controls,
|
||||||
const WellProductionControls& prod_controls,
|
const WellProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger,
|
DeferredLogger& deferred_logger,
|
||||||
const bool fixed_control = false,
|
const bool fixed_control = false,
|
||||||
const bool fixed_status = false) = 0;
|
const bool fixed_status = false) = 0;
|
||||||
@ -443,7 +443,7 @@ protected:
|
|||||||
bool iterateWellEquations(const Simulator& simulator,
|
bool iterateWellEquations(const Simulator& simulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
bool solveWellWithTHPConstraint(const Simulator& simulator,
|
bool solveWellWithTHPConstraint(const Simulator& simulator,
|
||||||
@ -451,7 +451,7 @@ protected:
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
std::optional<double> estimateOperableBhp(const Simulator& simulator,
|
std::optional<double> estimateOperableBhp(const Simulator& simulator,
|
||||||
@ -473,7 +473,7 @@ protected:
|
|||||||
|
|
||||||
bool solveWellForTesting(const Simulator& simulator,
|
bool solveWellForTesting(const Simulator& simulator,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger);
|
DeferredLogger& deferred_logger);
|
||||||
|
|
||||||
Eval getPerfCellPressure(const FluidState& fs) const;
|
Eval getPerfCellPressure(const FluidState& fs) const;
|
||||||
|
@ -178,7 +178,7 @@ template <typename FluidSystem>
|
|||||||
bool
|
bool
|
||||||
WellInterfaceFluidSystem<FluidSystem>::
|
WellInterfaceFluidSystem<FluidSystem>::
|
||||||
checkGroupConstraints(WellState<double>& well_state,
|
checkGroupConstraints(WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
DeferredLogger& deferred_logger) const
|
DeferredLogger& deferred_logger) const
|
||||||
@ -205,7 +205,7 @@ template <typename FluidSystem>
|
|||||||
bool
|
bool
|
||||||
WellInterfaceFluidSystem<FluidSystem>::
|
WellInterfaceFluidSystem<FluidSystem>::
|
||||||
checkConstraints(WellState<double>& well_state,
|
checkConstraints(WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
DeferredLogger& deferred_logger) const
|
DeferredLogger& deferred_logger) const
|
||||||
@ -240,7 +240,7 @@ std::optional<double>
|
|||||||
WellInterfaceFluidSystem<FluidSystem>::
|
WellInterfaceFluidSystem<FluidSystem>::
|
||||||
getGroupInjectionTargetRate(const Group& group,
|
getGroupInjectionTargetRate(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const InjectorType& injectorType,
|
const InjectorType& injectorType,
|
||||||
@ -268,7 +268,7 @@ double
|
|||||||
WellInterfaceFluidSystem<FluidSystem>::
|
WellInterfaceFluidSystem<FluidSystem>::
|
||||||
getGroupProductionTargetRate(const Group& group,
|
getGroupProductionTargetRate(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
double efficiencyFactor,
|
double efficiencyFactor,
|
||||||
|
@ -37,7 +37,7 @@ namespace RateConverter
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Group;
|
class Group;
|
||||||
class GroupState;
|
template<class Scalar> class GroupState;
|
||||||
class Schedule;
|
class Schedule;
|
||||||
struct RatioLimitCheckReport;
|
struct RatioLimitCheckReport;
|
||||||
template<class Scalar> class SingleWellState;
|
template<class Scalar> class SingleWellState;
|
||||||
@ -84,13 +84,13 @@ protected:
|
|||||||
const std::optional<Well::ProductionControls>& prod_controls = std::nullopt) const;
|
const std::optional<Well::ProductionControls>& prod_controls = std::nullopt) const;
|
||||||
|
|
||||||
bool checkGroupConstraints(WellState<double>& well_state,
|
bool checkGroupConstraints(WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
|
|
||||||
bool checkConstraints(WellState<double>& well_state,
|
bool checkConstraints(WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
DeferredLogger& deferred_logger) const;
|
DeferredLogger& deferred_logger) const;
|
||||||
@ -98,7 +98,7 @@ protected:
|
|||||||
std::optional<double>
|
std::optional<double>
|
||||||
getGroupInjectionTargetRate(const Group& group,
|
getGroupInjectionTargetRate(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
const InjectorType& injectorType,
|
const InjectorType& injectorType,
|
||||||
@ -108,7 +108,7 @@ protected:
|
|||||||
double
|
double
|
||||||
getGroupProductionTargetRate(const Group& group,
|
getGroupProductionTargetRate(const Group& group,
|
||||||
const WellState<double>& well_state,
|
const WellState<double>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<double>& group_state,
|
||||||
const Schedule& schedule,
|
const Schedule& schedule,
|
||||||
const SummaryState& summaryState,
|
const SummaryState& summaryState,
|
||||||
double efficiencyFactor,
|
double efficiencyFactor,
|
||||||
|
@ -44,7 +44,6 @@ class VFPProperties;
|
|||||||
class WellTestState;
|
class WellTestState;
|
||||||
template<class Scalar> class WellState;
|
template<class Scalar> class WellState;
|
||||||
template<class Scalar> class SingleWellState;
|
template<class Scalar> class SingleWellState;
|
||||||
class GroupState;
|
|
||||||
class Group;
|
class Group;
|
||||||
class Schedule;
|
class Schedule;
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ namespace Opm
|
|||||||
updateWellControl(const Simulator& simulator,
|
updateWellControl(const Simulator& simulator,
|
||||||
const IndividualOrGroup iog,
|
const IndividualOrGroup iog,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger) /* const */
|
DeferredLogger& deferred_logger) /* const */
|
||||||
{
|
{
|
||||||
const auto& summary_state = simulator.vanguard().summaryState();
|
const auto& summary_state = simulator.vanguard().summaryState();
|
||||||
@ -263,7 +263,7 @@ namespace Opm
|
|||||||
WellInterface<TypeTag>::
|
WellInterface<TypeTag>::
|
||||||
updateWellControlAndStatusLocalIteration(const Simulator& simulator,
|
updateWellControlAndStatusLocalIteration(const Simulator& simulator,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
const double wqTotal,
|
const double wqTotal,
|
||||||
@ -348,7 +348,7 @@ namespace Opm
|
|||||||
wellTesting(const Simulator& simulator,
|
wellTesting(const Simulator& simulator,
|
||||||
const double simulation_time,
|
const double simulation_time,
|
||||||
/* const */ WellState<Scalar>& well_state,
|
/* const */ WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
WellTestState& well_test_state,
|
WellTestState& well_test_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
@ -446,7 +446,7 @@ namespace Opm
|
|||||||
iterateWellEquations(const Simulator& simulator,
|
iterateWellEquations(const Simulator& simulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
const auto& summary_state = simulator.vanguard().summaryState();
|
const auto& summary_state = simulator.vanguard().summaryState();
|
||||||
@ -481,7 +481,7 @@ namespace Opm
|
|||||||
const Well::InjectionControls& inj_controls,
|
const Well::InjectionControls& inj_controls,
|
||||||
const Well::ProductionControls& prod_controls,
|
const Well::ProductionControls& prod_controls,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
const auto& summary_state = simulator.vanguard().summaryState();
|
const auto& summary_state = simulator.vanguard().summaryState();
|
||||||
@ -596,7 +596,7 @@ namespace Opm
|
|||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
// Solve a well using single bhp-constraint (but close if not operable under this)
|
// Solve a well using single bhp-constraint (but close if not operable under this)
|
||||||
auto group_state = GroupState(); // empty group
|
auto group_state = GroupState<Scalar>(); // empty group
|
||||||
auto inj_controls = Well::InjectionControls(0);
|
auto inj_controls = Well::InjectionControls(0);
|
||||||
auto prod_controls = Well::ProductionControls(0);
|
auto prod_controls = Well::ProductionControls(0);
|
||||||
auto& ws = well_state.well(this->index_of_well_);
|
auto& ws = well_state.well(this->index_of_well_);
|
||||||
@ -634,7 +634,7 @@ namespace Opm
|
|||||||
const auto well_status_orig = this->wellStatus_;
|
const auto well_status_orig = this->wellStatus_;
|
||||||
this->stopWell();
|
this->stopWell();
|
||||||
|
|
||||||
auto group_state = GroupState(); // empty group
|
auto group_state = GroupState<Scalar>(); // empty group
|
||||||
auto inj_controls = Well::InjectionControls(0);
|
auto inj_controls = Well::InjectionControls(0);
|
||||||
auto prod_controls = Well::ProductionControls(0);
|
auto prod_controls = Well::ProductionControls(0);
|
||||||
const bool converged = this->iterateWellEqWithSwitching(simulator, dt, inj_controls, prod_controls, well_state, group_state, deferred_logger, /*fixed_control*/true, /*fixed_status*/ true);
|
const bool converged = this->iterateWellEqWithSwitching(simulator, dt, inj_controls, prod_controls, well_state, group_state, deferred_logger, /*fixed_control*/true, /*fixed_status*/ true);
|
||||||
@ -647,7 +647,7 @@ namespace Opm
|
|||||||
WellInterface<TypeTag>::
|
WellInterface<TypeTag>::
|
||||||
solveWellForTesting(const Simulator& simulator,
|
solveWellForTesting(const Simulator& simulator,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
// keep a copy of the original well state
|
// keep a copy of the original well state
|
||||||
@ -682,7 +682,7 @@ namespace Opm
|
|||||||
WellInterface<TypeTag>::
|
WellInterface<TypeTag>::
|
||||||
solveWellEquation(const Simulator& simulator,
|
solveWellEquation(const Simulator& simulator,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
if (!this->isOperableAndSolvable() && !this->wellIsStopped())
|
if (!this->isOperableAndSolvable() && !this->wellIsStopped())
|
||||||
@ -740,7 +740,7 @@ namespace Opm
|
|||||||
assembleWellEq(const Simulator& simulator,
|
assembleWellEq(const Simulator& simulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -757,7 +757,7 @@ namespace Opm
|
|||||||
assembleWellEqWithoutIteration(const Simulator& simulator,
|
assembleWellEqWithoutIteration(const Simulator& simulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
const auto& summary_state = simulator.vanguard().summaryState();
|
const auto& summary_state = simulator.vanguard().summaryState();
|
||||||
@ -776,7 +776,7 @@ namespace Opm
|
|||||||
prepareWellBeforeAssembling(const Simulator& simulator,
|
prepareWellBeforeAssembling(const Simulator& simulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
const bool old_well_operable = this->operability_status_.isOperableAndSolvable();
|
const bool old_well_operable = this->operability_status_.isOperableAndSolvable();
|
||||||
@ -893,7 +893,7 @@ namespace Opm
|
|||||||
const Simulator& simulator,
|
const Simulator& simulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
const GroupState &group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
DeferredLogger& deferred_logger)
|
DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
const auto& well_name = this->name();
|
const auto& well_name = this->name();
|
||||||
@ -1023,7 +1023,7 @@ namespace Opm
|
|||||||
void
|
void
|
||||||
WellInterface<TypeTag>::
|
WellInterface<TypeTag>::
|
||||||
updateWellStateWithTarget(const Simulator& simulator,
|
updateWellStateWithTarget(const Simulator& simulator,
|
||||||
const GroupState& group_state,
|
const GroupState<Scalar>& group_state,
|
||||||
WellState<Scalar>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
DeferredLogger& deferred_logger) const
|
DeferredLogger& deferred_logger) const
|
||||||
{
|
{
|
||||||
|
@ -39,9 +39,10 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(GroupStateCreate) {
|
BOOST_AUTO_TEST_CASE(GroupStateCreate)
|
||||||
|
{
|
||||||
std::size_t num_phases{3};
|
std::size_t num_phases{3};
|
||||||
GroupState gs(num_phases);
|
GroupState<double> gs(num_phases);
|
||||||
|
|
||||||
BOOST_CHECK(!gs.has_production_rates("AGROUP"));
|
BOOST_CHECK(!gs.has_production_rates("AGROUP"));
|
||||||
BOOST_CHECK_THROW( gs.update_production_rates("AGROUP", {0}), std::exception);
|
BOOST_CHECK_THROW( gs.update_production_rates("AGROUP", {0}), std::exception);
|
||||||
|
@ -103,7 +103,8 @@ BOOST_AUTO_TEST_CASE(NAME) \
|
|||||||
|
|
||||||
namespace Opm { using ALQS = ALQState<double>; }
|
namespace Opm { using ALQS = ALQState<double>; }
|
||||||
TEST_FOR_TYPE_NAMED(ALQS, ALQState)
|
TEST_FOR_TYPE_NAMED(ALQS, ALQState)
|
||||||
TEST_FOR_TYPE(GroupState)
|
namespace Opm { using GroupS = GroupState<double>; }
|
||||||
|
TEST_FOR_TYPE_NAMED(GroupS, GroupState)
|
||||||
TEST_FOR_TYPE(HardcodedTimeStepControl)
|
TEST_FOR_TYPE(HardcodedTimeStepControl)
|
||||||
TEST_FOR_TYPE(Inplace)
|
TEST_FOR_TYPE(Inplace)
|
||||||
namespace Opm { using PerfD = PerfData<double>; }
|
namespace Opm { using PerfD = PerfData<double>; }
|
||||||
|
Loading…
Reference in New Issue
Block a user