mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Silence warnings and fix whitespace.
This commit is contained in:
parent
97876530e3
commit
e7e4cf6f20
@ -426,15 +426,15 @@ namespace Opm {
|
||||
void updateGroupIndividualControls(Opm::DeferredLogger& deferred_logger, std::set<std::string>& switched_groups);
|
||||
void updateGroupIndividualControl(const Group& group, Opm::DeferredLogger& deferred_logger, std::set<std::string>& switched_groups);
|
||||
bool checkGroupConstraints(const Group& group, Opm::DeferredLogger& deferred_logger) const;
|
||||
Group::ProductionCMode checkGroupProductionConstraints(const Group& group, Opm::DeferredLogger& deferred_logger) const;
|
||||
Group::InjectionCMode checkGroupInjectionConstraints(const Group& group, const Phase& phase, Opm::DeferredLogger& deferred_logger) const;
|
||||
Group::ProductionCMode checkGroupProductionConstraints(const Group& group, Opm::DeferredLogger& deferred_logger) const;
|
||||
Group::InjectionCMode checkGroupInjectionConstraints(const Group& group, const Phase& phase) const;
|
||||
|
||||
void updateGroupHigherControls(Opm::DeferredLogger& deferred_logger, std::set<std::string>& switched_groups);
|
||||
void checkGroupHigherConstraints(const Group& group, Opm::DeferredLogger& deferred_logger, std::set<std::string>& switched_groups);
|
||||
|
||||
void actionOnBrokenConstraints(const Group& group, const Group::ExceedAction& exceed_action, const Group::ProductionCMode& newControl, const int reportStepIdx, Opm::DeferredLogger& deferred_logger);
|
||||
void actionOnBrokenConstraints(const Group& group, const Group::ExceedAction& exceed_action, const Group::ProductionCMode& newControl, Opm::DeferredLogger& deferred_logger);
|
||||
|
||||
void actionOnBrokenConstraints(const Group& group, const Group::InjectionCMode& newControl, const Phase& topUpPhase, const int reportStepIdx, Opm::DeferredLogger& deferred_logger);
|
||||
void actionOnBrokenConstraints(const Group& group, const Group::InjectionCMode& newControl, const Phase& topUpPhase, Opm::DeferredLogger& deferred_logger);
|
||||
|
||||
WellInterfacePtr getWell(const std::string& well_name) const;
|
||||
|
||||
|
@ -1131,7 +1131,7 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (checkGroupConvergence) {
|
||||
const int reportStepIdx = ebosSimulator_.episodeIndex();
|
||||
const Group& fieldGroup = schedule().getGroup("FIELD", reportStepIdx);
|
||||
@ -1308,7 +1308,6 @@ namespace Opm {
|
||||
summaryConfig.hasSummaryKey( "WOPP:" + well->name()) ||
|
||||
summaryConfig.hasSummaryKey( "WGPP:" + well->name())) && well->isProducer());
|
||||
|
||||
const Well& eclWell = well->wellEcl();
|
||||
bool needPotentialsForGuideRate = true;//eclWell.getGuideRatePhase() == Well::GuideRateTarget::UNDEFINED;
|
||||
if (write_restart_file || needed_for_summary || needPotentialsForGuideRate)
|
||||
{
|
||||
@ -1761,25 +1760,23 @@ namespace Opm {
|
||||
if (!group.hasInjectionControl(phase)) {
|
||||
continue;
|
||||
}
|
||||
Group::InjectionCMode newControl = checkGroupInjectionConstraints(group, phase, deferred_logger);
|
||||
Group::InjectionCMode newControl = checkGroupInjectionConstraints(group, phase);
|
||||
if (newControl != Group::InjectionCMode::NONE)
|
||||
{
|
||||
switched_groups.insert(group.name());
|
||||
actionOnBrokenConstraints(group, newControl, phase, reportStepIdx, deferred_logger);
|
||||
actionOnBrokenConstraints(group, newControl, phase, deferred_logger);
|
||||
}
|
||||
}
|
||||
} else if (!skip && group.isProductionGroup())
|
||||
{
|
||||
}
|
||||
if (!skip && group.isProductionGroup()) {
|
||||
Group::ProductionCMode newControl = checkGroupProductionConstraints(group, deferred_logger);
|
||||
const auto& summaryState = ebosSimulator_.vanguard().summaryState();
|
||||
const auto controls = group.productionControls(summaryState);
|
||||
if (newControl != Group::ProductionCMode::NONE)
|
||||
{
|
||||
switched_groups.insert(group.name());
|
||||
actionOnBrokenConstraints(group, controls.exceed_action, newControl, reportStepIdx, deferred_logger);
|
||||
actionOnBrokenConstraints(group, controls.exceed_action, newControl, deferred_logger);
|
||||
}
|
||||
} else {
|
||||
//neither production or injecting group FIELD?
|
||||
}
|
||||
|
||||
// call recursively down the group hiearchy
|
||||
@ -1794,30 +1791,24 @@ namespace Opm {
|
||||
checkGroupConstraints(const Group& group, Opm::DeferredLogger& deferred_logger) const {
|
||||
|
||||
const int reportStepIdx = ebosSimulator_.episodeIndex();
|
||||
if (group.isInjectionGroup())
|
||||
{
|
||||
if (group.isInjectionGroup()) {
|
||||
const Phase all[] = {Phase::WATER, Phase::OIL, Phase::GAS};
|
||||
for (Phase phase : all) {
|
||||
if (!group.hasInjectionControl(phase)) {
|
||||
continue;
|
||||
}
|
||||
Group::InjectionCMode newControl = checkGroupInjectionConstraints(group, phase, deferred_logger);
|
||||
if (newControl != Group::InjectionCMode::NONE)
|
||||
{
|
||||
Group::InjectionCMode newControl = checkGroupInjectionConstraints(group, phase);
|
||||
if (newControl != Group::InjectionCMode::NONE) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if (group.isProductionGroup())
|
||||
{
|
||||
}
|
||||
if (group.isProductionGroup()) {
|
||||
Group::ProductionCMode newControl = checkGroupProductionConstraints(group, deferred_logger);
|
||||
const auto& summaryState = ebosSimulator_.vanguard().summaryState();
|
||||
const auto controls = group.productionControls(summaryState);
|
||||
if (newControl != Group::ProductionCMode::NONE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
//neither production or injecting group FIELD?
|
||||
}
|
||||
|
||||
// call recursively down the group hiearchy
|
||||
@ -1827,8 +1818,9 @@ namespace Opm {
|
||||
}
|
||||
return violated;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename TypeTag>
|
||||
Group::ProductionCMode
|
||||
BlackoilWellModel<TypeTag>::
|
||||
@ -1839,7 +1831,6 @@ namespace Opm {
|
||||
const auto& comm = ebosSimulator_.vanguard().grid().comm();
|
||||
const auto& well_state = well_state_;
|
||||
|
||||
|
||||
const auto controls = group.productionControls(summaryState);
|
||||
const Group::ProductionCMode& currentControl = well_state.currentProductionGroupControl(group.name());
|
||||
|
||||
@ -1931,15 +1922,15 @@ namespace Opm {
|
||||
if (group.has_control(Group::ProductionCMode::PRBL))
|
||||
{
|
||||
OPM_DEFLOG_THROW(std::runtime_error, "Group " + group.name() + "PRBL control for production groups not implemented", deferred_logger);
|
||||
}
|
||||
}
|
||||
return Group::ProductionCMode::NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename TypeTag>
|
||||
Group::InjectionCMode
|
||||
BlackoilWellModel<TypeTag>::
|
||||
checkGroupInjectionConstraints(const Group& group, const Phase& phase, Opm::DeferredLogger& deferred_logger) const {
|
||||
checkGroupInjectionConstraints(const Group& group, const Phase& phase) const {
|
||||
|
||||
const int reportStepIdx = ebosSimulator_.episodeIndex();
|
||||
const auto& summaryState = ebosSimulator_.vanguard().summaryState();
|
||||
@ -2069,15 +2060,15 @@ namespace Opm {
|
||||
if (gconsale.sales_target < 0.0) {
|
||||
OPM_THROW(std::runtime_error, "Group " + group.name() + " has sale rate target less then zero. Not implemented in Flow" );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return Group::InjectionCMode::NONE;
|
||||
return Group::InjectionCMode::NONE;
|
||||
}
|
||||
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
actionOnBrokenConstraints(const Group& group, const Group::ExceedAction& exceed_action, const Group::ProductionCMode& newControl, const int reportStepIdx, Opm::DeferredLogger& deferred_logger) {
|
||||
actionOnBrokenConstraints(const Group& group, const Group::ExceedAction& exceed_action, const Group::ProductionCMode& newControl, Opm::DeferredLogger& deferred_logger) {
|
||||
|
||||
auto& well_state = well_state_;
|
||||
const Group::ProductionCMode& oldControl = well_state.currentProductionGroupControl(group.name());
|
||||
@ -2132,7 +2123,7 @@ namespace Opm {
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
actionOnBrokenConstraints(const Group& group, const Group::InjectionCMode& newControl, const Phase& controlPhase, const int reportStepIdx, Opm::DeferredLogger& deferred_logger) {
|
||||
actionOnBrokenConstraints(const Group& group, const Group::InjectionCMode& newControl, const Phase& controlPhase, Opm::DeferredLogger& deferred_logger) {
|
||||
auto& well_state = well_state_;
|
||||
const Group::InjectionCMode& oldControl = well_state.currentInjectionGroupControl(controlPhase, group.name());
|
||||
|
||||
@ -2224,7 +2215,7 @@ namespace Opm {
|
||||
deferred_logger);
|
||||
if (changed.first) {
|
||||
switched_groups.insert(group.name());
|
||||
actionOnBrokenConstraints(group, Group::InjectionCMode::FLD, phase, reportStepIdx, deferred_logger);
|
||||
actionOnBrokenConstraints(group, Group::InjectionCMode::FLD, phase, deferred_logger);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2259,7 +2250,7 @@ namespace Opm {
|
||||
if (changed.first) {
|
||||
switched_groups.insert(group.name());
|
||||
const auto exceed_action = group.productionControls(summaryState).exceed_action;
|
||||
actionOnBrokenConstraints(group, exceed_action, Group::ProductionCMode::FLD, reportStepIdx, deferred_logger);
|
||||
actionOnBrokenConstraints(group, exceed_action, Group::ProductionCMode::FLD, deferred_logger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1795,7 +1795,6 @@ namespace Opm
|
||||
EvalWell control_eq(0.0);
|
||||
|
||||
const auto& well = well_ecl_;
|
||||
const double efficiencyFactor = well.getEfficiencyFactor();
|
||||
|
||||
auto getRates = [&]() {
|
||||
std::vector<EvalWell> rates(3, 0.0);
|
||||
|
@ -772,7 +772,6 @@ namespace Opm
|
||||
EvalWell control_eq(numWellEq_ + numEq, 0.0);
|
||||
|
||||
const auto& well = well_ecl_;
|
||||
const double efficiencyFactor = well.getEfficiencyFactor();
|
||||
|
||||
auto getRates = [&]() {
|
||||
std::vector<EvalWell> rates(3, EvalWell(numWellEq_ + numEq, 0.0));
|
||||
|
@ -486,9 +486,7 @@ namespace Opm
|
||||
DeferredLogger& deferred_logger) const;
|
||||
|
||||
bool checkIndividualConstraints(WellState& well_state,
|
||||
const Schedule& schedule,
|
||||
const SummaryState& summaryState,
|
||||
DeferredLogger& deferred_logger) const;
|
||||
const SummaryState& summaryState) const;
|
||||
|
||||
bool checkGroupConstraints(WellState& well_state,
|
||||
const Schedule& schedule,
|
||||
|
@ -485,7 +485,7 @@ namespace Opm
|
||||
|
||||
bool changed = false;
|
||||
if (iog == IndividualOrGroup::Individual) {
|
||||
changed = checkIndividualConstraints(well_state, schedule, summaryState, deferred_logger);
|
||||
changed = checkIndividualConstraints(well_state, summaryState);
|
||||
} else if (iog == IndividualOrGroup::Group) {
|
||||
changed = checkGroupConstraints(well_state, schedule, summaryState, deferred_logger);
|
||||
} else {
|
||||
@ -1460,7 +1460,7 @@ namespace Opm
|
||||
const SummaryState& summaryState,
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
const bool ind_broken = checkIndividualConstraints(well_state, schedule, summaryState, deferred_logger);
|
||||
const bool ind_broken = checkIndividualConstraints(well_state, summaryState);
|
||||
if (ind_broken) {
|
||||
return true;
|
||||
} else {
|
||||
@ -1475,9 +1475,7 @@ namespace Opm
|
||||
template <typename TypeTag>
|
||||
bool
|
||||
WellInterface<TypeTag>::checkIndividualConstraints(WellState& well_state,
|
||||
const Schedule& schedule,
|
||||
const SummaryState& summaryState,
|
||||
DeferredLogger& deferred_logger) const
|
||||
const SummaryState& summaryState) const
|
||||
{
|
||||
const auto& well = well_ecl_;
|
||||
const PhaseUsage& pu = phaseUsage();
|
||||
@ -1680,7 +1678,6 @@ namespace Opm
|
||||
const int well_index = index_of_well_;
|
||||
|
||||
if (well.isInjector()) {
|
||||
const auto controls = well.injectionControls(summaryState);
|
||||
Opm::Well::InjectorCMode& currentControl = well_state.currentInjectionControls()[well_index];
|
||||
|
||||
if (currentControl != Well::InjectorCMode::GRUP) {
|
||||
@ -1708,7 +1705,6 @@ namespace Opm
|
||||
}
|
||||
|
||||
if (well.isProducer( )) {
|
||||
const auto controls = well.productionControls(summaryState);
|
||||
Well::ProducerCMode& currentControl = well_state.currentProductionControls()[well_index];
|
||||
|
||||
if (currentControl != Well::ProducerCMode::GRUP) {
|
||||
@ -1973,7 +1969,6 @@ namespace Opm
|
||||
control_eq = total_rate - controls.resv_rate;
|
||||
} else {
|
||||
std::vector<double> hrates(number_of_phases_, 0.);
|
||||
const PhaseUsage& pu = phaseUsage();
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
||||
hrates[pu.phase_pos[Water]] = controls.water_rate;
|
||||
}
|
||||
@ -2044,9 +2039,11 @@ namespace Opm
|
||||
const auto& well = well_ecl_;
|
||||
const auto pu = phaseUsage();
|
||||
|
||||
// Setting some defaults to silence warnings below.
|
||||
// Will be overwritten in the switch statement.
|
||||
int phasePos = -1;
|
||||
Well::GuideRateTarget wellTarget;
|
||||
Phase injectionPhase;
|
||||
Well::GuideRateTarget wellTarget = Well::GuideRateTarget::UNDEFINED;
|
||||
Phase injectionPhase = Phase::WATER;
|
||||
switch (injectorType) {
|
||||
case InjectorType::WATER:
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user