Merge pull request #4394 from akva2/well_enums

Clean up Well.hpp includes
This commit is contained in:
Markus Blatt 2023-01-18 14:13:35 +01:00 committed by GitHub
commit 212de0735c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 65 additions and 46 deletions

View File

@ -36,6 +36,7 @@
#include <opm/input/eclipse/Schedule/Action/State.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/UDQ/UDQConfig.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Schedule/Well/WellMatcher.hpp>
#include <opm/simulators/wells/BlackoilWellModelGeneric.hpp>

View File

@ -34,6 +34,7 @@
#include <opm/input/eclipse/Schedule/RFTConfig.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/SummaryState.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
#include <opm/input/eclipse/Units/Units.hpp>

View File

@ -32,6 +32,7 @@
#include <opm/input/eclipse/Schedule/Action/State.hpp>
#include <opm/input/eclipse/Schedule/OilVaporizationProperties.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
#include <opm/input/eclipse/Schedule/SummaryState.hpp>
#include <opm/input/eclipse/Schedule/UDQ/UDQState.hpp>

View File

@ -46,8 +46,7 @@
#include <opm/input/eclipse/Schedule/UDQ/UDQConfig.hpp>
#include <opm/input/eclipse/Schedule/Well/NameOrder.hpp>
#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
#include <opm/input/eclipse/Schedule/Well/WList.hpp>
#include <opm/input/eclipse/Schedule/Well/WListManager.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Schedule/Well/WellBrineProperties.hpp>
#include <opm/input/eclipse/Schedule/Well/WellEconProductionLimits.hpp>
#include <opm/input/eclipse/Schedule/Well/WellFoamProperties.hpp>
@ -56,6 +55,8 @@
#include <opm/input/eclipse/Schedule/Well/WellTestConfig.hpp>
#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
#include <opm/input/eclipse/Schedule/Well/WellTracerProperties.hpp>
#include <opm/input/eclipse/Schedule/Well/WList.hpp>
#include <opm/input/eclipse/Schedule/Well/WListManager.hpp>
#include <opm/input/eclipse/Schedule/Well/WVFPEXP.hpp>
#include <ebos/eclmpiserializer.hh>

View File

@ -25,6 +25,7 @@
#include <opm/input/eclipse/Schedule/Group/GuideRateConfig.hpp>
#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/output/data/Groups.hpp>

View File

@ -21,6 +21,7 @@
#include <opm/simulators/wells/GasLiftGroupInfo.hpp>
#include <opm/input/eclipse/Schedule/GasLiftOpt.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
namespace Opm {

View File

@ -22,13 +22,13 @@
#include <opm/input/eclipse/Schedule/GasLiftOpt.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/simulators/utils/DeferredLogger.hpp>
#include <opm/simulators/wells/GasLiftWellState.hpp>
#include <opm/simulators/wells/GroupState.hpp>
#include <opm/simulators/wells/WellState.hpp>
#include <fmt/format.h>
#include <cassert>
@ -455,7 +455,7 @@ GasLiftSingleWellGeneric::debugShowProducerControlMode() const
{
const int well_index = this->well_state_.index(this->well_name_).value();
const Well::ProducerCMode& control_mode = this->well_state_.well(well_index).production_cmode;
const std::string msg = fmt::format("Current control mode is: {}", Well::ProducerCMode2String(control_mode));
const std::string msg = fmt::format("Current control mode is: {}", WellProducerCMode2String(control_mode));
displayDebugMessage_(msg);
}

View File

@ -25,7 +25,7 @@
#include <opm/core/props/BlackoilPhases.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Schedule/Well/WellProductionControls.hpp>
#include <opm/simulators/wells/GasLiftGroupInfo.hpp>
#include <opm/simulators/wells/GasLiftCommon.hpp>
#include <opm/simulators/wells/GroupState.hpp>
@ -337,7 +337,7 @@ protected:
GasLiftGroupInfo& group_info_;
const PhaseUsage& phase_usage_;
GLiftSyncGroups& sync_groups_;
const Well::ProductionControls controls_;
const WellProductionControls controls_;
double increment_;
double max_alq_;

View File

@ -20,13 +20,13 @@
#if HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
#include <opm/simulators/wells/GlobalWellInfo.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <stdexcept>
#include <opm/simulators/wells/GlobalWellInfo.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
namespace Opm {

View File

@ -25,12 +25,13 @@
#include <string>
#include <vector>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
namespace Opm {
class Schedule;
class Well;
enum class WellInjectorCMode;
enum class WellProducerCMode;
enum class WellStatus;
/*
@ -71,8 +72,8 @@ public:
bool in_injecting_group(const std::string& wname) const;
std::size_t well_index(const std::string& wname) const;
const std::string& well_name(std::size_t well_index) const;
void update_injector(std::size_t well_index, Well::Status well_status, Well::InjectorCMode injection_cmode);
void update_producer(std::size_t well_index, Well::Status well_status, Well::ProducerCMode production_cmode);
void update_injector(std::size_t well_index, WellStatus well_status, WellInjectorCMode injection_cmode);
void update_producer(std::size_t well_index, WellStatus well_status, WellProducerCMode production_cmode);
void clear();
private:

View File

@ -29,8 +29,6 @@
#include <opm/material/densead/Evaluation.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <array>
#include <memory>
#include <utility>

View File

@ -20,6 +20,8 @@
#include <config.h>
#include <opm/simulators/wells/SingleWellState.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Units/Units.hpp>
#include <opm/simulators/wells/PerforationData.hpp>

View File

@ -23,7 +23,7 @@
#include <functional>
#include <vector>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Schedule/Well/WellEnums.hpp>
#include <opm/input/eclipse/Schedule/Events.hpp>
#include <opm/simulators/wells/SegmentState.hpp>
@ -34,6 +34,8 @@
namespace Opm {
struct PerforationData;
class SummaryState;
class Well;
class SingleWellState {
public:
@ -48,7 +50,7 @@ public:
std::string name;
std::reference_wrapper<const ParallelWellInfo> parallel_info;
Well::Status status{Well::Status::OPEN};
WellStatus status{WellStatus::OPEN};
bool producer;
PhaseUsage pu;
double bhp{0};
@ -66,8 +68,8 @@ public:
bool trivial_target;
SegmentState segments;
Events events;
Well::InjectorCMode injection_cmode{Well::InjectorCMode::CMODE_UNDEFINED};
Well::ProducerCMode production_cmode{Well::ProducerCMode::CMODE_UNDEFINED};
WellInjectorCMode injection_cmode{WellInjectorCMode::CMODE_UNDEFINED};
WellProducerCMode production_cmode{WellProducerCMode::CMODE_UNDEFINED};
/// Special purpose method to support dynamically rescaling a well's
@ -80,7 +82,7 @@ public:
void update_producer_targets(const Well& ecl_well, const SummaryState& st);
void update_injector_targets(const Well& ecl_well, const SummaryState& st);
void update_targets(const Well& ecl_well, const SummaryState& st);
void updateStatus(Well::Status status);
void updateStatus(WellStatus status);
void init_timestep(const SingleWellState& other);
void shut();
void stop();
@ -92,6 +94,7 @@ public:
double sum_solvent_rates() const;
double sum_polymer_rates() const;
double sum_brine_rates() const;
private:
double sum_connection_rates(const std::vector<double>& connection_rates) const;
};

View File

@ -27,7 +27,6 @@
#include <opm/core/props/BlackoilPhases.hpp>
#include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <functional>
@ -41,6 +40,8 @@ class Schedule;
class SummaryState;
template<class FluidSystem> class WellInterfaceFluidSystem;
class WellState;
class WellInjectionControls;
class WellProductionControls;
template<class FluidSystem>
class WellAssemble {
@ -56,7 +57,7 @@ public:
const GroupState& group_state,
const Schedule& schedule,
const SummaryState& summaryState,
const Well::ProductionControls& controls,
const WellProductionControls& controls,
const EvalWell& bhp,
const std::vector<EvalWell>& rates, // Always 3 canonical rates.
const std::function<EvalWell()>& bhp_from_thp,
@ -68,7 +69,7 @@ public:
const GroupState& group_state,
const Schedule& schedule,
const SummaryState& summaryState,
const Well::InjectionControls& controls,
const WellInjectionControls& controls,
const EvalWell& bhp,
const EvalWell& injection_rate,
const std::function<EvalWell()>& bhp_from_thp,

View File

@ -24,6 +24,7 @@
#include <opm/grid/CpGrid.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
#include <algorithm>

View File

@ -150,7 +150,7 @@ activeInjectionConstraint(const SingleWellState& ws,
"The THP limit is violated for injector " +
well_.name() +
". But the rate will increase if switched to THP. " +
"The well is therefore kept at " + Well::InjectorCMode2String(currentControl));
"The well is therefore kept at " + WellInjectorCMode2String(currentControl));
}
}
}
@ -274,7 +274,7 @@ activeProductionConstraint(const SingleWellState& ws,
"The THP limit is violated for producer " +
well_.name() +
". But the rate will increase if switched to THP. " +
"The well is therefore kept at " + Well::ProducerCMode2String(currentControl));
"The well is therefore kept at " + WellProducerCMode2String(currentControl));
}
}
}

View File

@ -24,8 +24,6 @@
#ifndef OPM_WELL_CONSTRAINTS_HEADER_INCLUDED
#define OPM_WELL_CONSTRAINTS_HEADER_INCLUDED
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <functional>
#include <utility>
#include <vector>
@ -37,7 +35,10 @@ class DeferredLogger;
using RegionId = int;
class Rates;
class SingleWellState;
class SummaryState;
class WellInterfaceGeneric;
enum class WellInjectorCMode;
enum class WellProducerCMode;
//! \brief Class for computing well group constraints.
class WellConstraints {
@ -57,13 +58,13 @@ public:
DeferredLogger& deferred_logger) const;
private:
Well::InjectorCMode
WellInjectorCMode
activeInjectionConstraint(const SingleWellState& ws,
const SummaryState& summaryState,
bool& thp_limit_violated_but_not_switched,
DeferredLogger& deferred_logger) const;
Well::ProducerCMode
WellProducerCMode
activeProductionConstraint(const SingleWellState& ws,
const SummaryState& summaryState,
const RateConvFunc& calcReservoirVoidageRates,

View File

@ -27,6 +27,7 @@
#include <opm/input/eclipse/Schedule/Group/GPMaint.hpp>
#include <opm/input/eclipse/Schedule/Group/Group.hpp>
#include <opm/input/eclipse/Schedule/Network/ExtNetwork.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/material/fluidsystems/BlackOilFluidSystem.hpp>

View File

@ -28,7 +28,6 @@
#include <opm/common/ErrorMacros.hpp>
#include <opm/common/Exceptions.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Schedule/Well/WellTestState.hpp>
#include <opm/core/props/BlackoilPhases.hpp>
@ -65,6 +64,9 @@ namespace Opm {
namespace Opm
{
class WellInjectionProperties;
class WellProductionProperties;
template<typename TypeTag>
class WellInterface : public WellInterfaceIndices<GetPropType<TypeTag, Properties::FluidSystem>,
GetPropType<TypeTag, Properties::Indices>,
@ -327,8 +329,8 @@ protected:
virtual void assembleWellEqWithoutIteration(const Simulator& ebosSimulator,
const double dt,
const Well::InjectionControls& inj_controls,
const Well::ProductionControls& prod_controls,
const WellInjectionControls& inj_controls,
const WellProductionControls& prod_controls,
WellState& well_state,
const GroupState& group_state,
DeferredLogger& deferred_logger) = 0;
@ -336,8 +338,8 @@ protected:
// iterate well equations with the specified control until converged
virtual bool iterateWellEqWithControl(const Simulator& ebosSimulator,
const double dt,
const Well::InjectionControls& inj_controls,
const Well::ProductionControls& prod_controls,
const WellInjectionControls& inj_controls,
const WellProductionControls& prod_controls,
WellState& well_state,
const GroupState& group_state,
DeferredLogger& deferred_logger) = 0;

View File

@ -419,9 +419,9 @@ void WellInterfaceGeneric::reportWellSwitching(const SingleWellState& ws, Deferr
std::string from = well_control_log_[0];
std::string to;
if (isInjector()) {
to = Well::InjectorCMode2String(ws.injection_cmode);
to = WellInjectorCMode2String(ws.injection_cmode);
} else {
to = Well::ProducerCMode2String(ws.production_cmode);
to = WellProducerCMode2String(ws.production_cmode);
}
// only report the final switching
if (from != to) {

View File

@ -193,9 +193,9 @@ namespace Opm
auto& ws = well_state.well(this->index_of_well_);
std::string from;
if (well.isInjector()) {
from = Well::InjectorCMode2String(ws.injection_cmode);
from = WellInjectorCMode2String(ws.injection_cmode);
} else {
from = Well::ProducerCMode2String(ws.production_cmode);
from = WellProducerCMode2String(ws.production_cmode);
}
bool oscillating = std::count(this->well_control_log_.begin(), this->well_control_log_.end(), from) >= param_.max_number_of_well_switches_;
@ -229,9 +229,9 @@ namespace Opm
if (changed) {
std::string to;
if (well.isInjector()) {
to = Well::InjectorCMode2String(ws.injection_cmode);
to = WellInjectorCMode2String(ws.injection_cmode);
} else {
to = Well::ProducerCMode2String(ws.production_cmode);
to = WellProducerCMode2String(ws.production_cmode);
}
std::ostringstream ss;
ss << " Switching control mode for well " << this->name()
@ -427,13 +427,13 @@ namespace Opm
thp_control = ws.injection_cmode == Well::InjectorCMode::THP;
if (thp_control) {
ws.injection_cmode = Well::InjectorCMode::BHP;
this->well_control_log_.push_back(Well::InjectorCMode2String(Well::InjectorCMode::THP));
this->well_control_log_.push_back(WellInjectorCMode2String(Well::InjectorCMode::THP));
}
} else {
thp_control = ws.production_cmode == Well::ProducerCMode::THP;
if (thp_control) {
ws.production_cmode = Well::ProducerCMode::BHP;
this->well_control_log_.push_back(Well::ProducerCMode2String(Well::ProducerCMode::THP));
this->well_control_log_.push_back(WellProducerCMode2String(Well::ProducerCMode::THP));
}
}
if (thp_control) {

View File

@ -25,6 +25,7 @@
#include <opm/common/ErrorMacros.hpp>
#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
#include <opm/simulators/utils/ParallelCommunication.hpp>
@ -773,7 +774,7 @@ void WellState::shutWell(int well_index)
ws.shut();
}
void WellState::updateStatus(int well_index, Well::Status status)
void WellState::updateStatus(int well_index, WellStatus status)
{
auto& ws = this->well(well_index);
ws.updateStatus(status);

View File

@ -34,7 +34,6 @@
#include <opm/output/data/Wells.hpp>
#include <opm/input/eclipse/Schedule/Events.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh>
@ -51,6 +50,7 @@ namespace Opm
class ParallelWellInfo;
class Schedule;
enum class WellStatus;
/// The state of a set of wells, tailored for use by the fully
/// implicit blackoil simulator.
@ -211,7 +211,7 @@ public:
bool wellIsOwned(const std::string& wellName) const;
void updateStatus(int well_index, Well::Status status);
void updateStatus(int well_index, WellStatus status);
void openWell(int well_index);
void shutWell(int well_index);

View File

@ -29,6 +29,7 @@
#include <opm/input/eclipse/Python/Python.hpp>
#include <opm/input/eclipse/Parser/Parser.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
using namespace Opm;

View File

@ -44,6 +44,7 @@
#include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
#include <opm/input/eclipse/Schedule/Schedule.hpp>
#include <opm/input/eclipse/Schedule/SummaryState.hpp>
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
#include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
#include <opm/input/eclipse/Units/Units.hpp>
#include <opm/common/utility/TimeService.hpp>