some cleaning up

no funtionality changes.
This commit is contained in:
Kai Bao 2018-10-31 15:32:50 +01:00
parent 702c6e7b1f
commit 0c24a30459
3 changed files with 17 additions and 46 deletions

View File

@ -158,7 +158,7 @@ namespace Opm {
well->setVFPProperties(vfp_properties_.get()); well->setVFPProperties(vfp_properties_.get());
} }
// Close wells and completions due to economical reasons // Close completions due to economical reasons
for (auto& well : well_container_) { for (auto& well : well_container_) {
well->closeCompletions(wellTestState_); well->closeCompletions(wellTestState_);
} }

View File

@ -152,15 +152,6 @@ namespace Opm
const bool& writeMessageToOPMLog, const bool& writeMessageToOPMLog,
WellTestState& wellTestState) const; WellTestState& wellTestState) const;
void updateWellTestStatePhysical(const WellState& well_state,
const double simulation_time,
const bool write_message_to_opmlog,
WellTestState& well_test_state) const;
void updateWellTestStateEconomic(const WellState& well_state,
const double simulation_time,
const bool write_message_to_opmlog,
WellTestState& well_test_state) const;
void setWellEfficiencyFactor(const double efficiency_factor); void setWellEfficiencyFactor(const double efficiency_factor);
@ -205,8 +196,6 @@ namespace Opm
virtual void addWellContributions(Mat&) const virtual void addWellContributions(Mat&) const
{} {}
void solveWellForTesting(Simulator& ebosSimulator, WellState& well_state, const std::vector<double>& B_avg, bool terminal_output);
void closeCompletions(WellTestState& wellTestState); void closeCompletions(WellTestState& wellTestState);
const Well* wellEcl() const; const Well* wellEcl() const;
@ -333,9 +322,16 @@ namespace Opm
double scalingFactor(const int comp_idx) const; double scalingFactor(const int comp_idx) const;
void wellTestingEcnomic(Simulator& simulator, const std::vector<double>& B_avg, void wellTestingEconomic(Simulator& simulator, const std::vector<double>& B_avg,
const double simulation_time, const int report_step, const bool terminal_output, const double simulation_time, const int report_step, const bool terminal_output,
const WellState& well_state, WellTestState& welltest_state); const WellState& well_state, WellTestState& welltest_state);
void updateWellTestStateEconomic(const WellState& well_state,
const double simulation_time,
const bool write_message_to_opmlog,
WellTestState& well_test_state) const;
void solveWellForTesting(Simulator& ebosSimulator, WellState& well_state, const std::vector<double>& B_avg, bool terminal_output);
}; };

View File

@ -649,35 +649,10 @@ namespace Opm
return; return;
} }
// updating well test state based on physical (THP/BHP) limits.
updateWellTestStatePhysical(well_state, simulationTime, writeMessageToOPMLog, wellTestState);
// updating well test state based on Economic limits. // updating well test state based on Economic limits.
updateWellTestStateEconomic(well_state, simulationTime, writeMessageToOPMLog, wellTestState); updateWellTestStateEconomic(well_state, simulationTime, writeMessageToOPMLog, wellTestState);
}
// TODO: well can be shut/closed due to other reasons
template<typename TypeTag>
void
WellInterface<TypeTag>::
updateWellTestStatePhysical(const WellState& /* well_state */,
const double /* simulation_time */,
const bool /* write_message_to_opmlog */,
WellTestState& /* well_test_state */) const
{
// TODO: other facilities are required to make the following action work
/* if (!isOperable()) {
well_test_state.addClosedWell(name(), WellTestConfig::Reason::PHYSICAL, simulation_time);
if (write_message_to_opmlog) {
// TODO: considering auto shut in?
const std::string msg = "well " + name()
+ std::string(" will be shut as it can not operate under current reservoir condition");
OpmLog::info(msg);
}
} */
} }
@ -832,8 +807,8 @@ namespace Opm
WellTestState& well_test_state) WellTestState& well_test_state)
{ {
if (testing_reason == WellTestConfig::Reason::ECONOMIC) { if (testing_reason == WellTestConfig::Reason::ECONOMIC) {
wellTestingEcnomic(simulator, B_avg, simulation_time, report_step, wellTestingEconomic(simulator, B_avg, simulation_time, report_step,
terminal_output, well_state, well_test_state); terminal_output, well_state, well_test_state);
} }
} }
@ -844,9 +819,9 @@ namespace Opm
template<typename TypeTag> template<typename TypeTag>
void void
WellInterface<TypeTag>:: WellInterface<TypeTag>::
wellTestingEcnomic(Simulator& simulator, const std::vector<double>& B_avg, wellTestingEconomic(Simulator& simulator, const std::vector<double>& B_avg,
const double simulation_time, const int report_step, const bool terminal_output, const double simulation_time, const int report_step, const bool terminal_output,
const WellState& well_state, WellTestState& welltest_state) const WellState& well_state, WellTestState& welltest_state)
{ {
WellState well_state_copy = well_state; WellState well_state_copy = well_state;