GroupEconomicLimitsChecker: drop indent for namespace

This commit is contained in:
Arne Morten Kvarving
2024-02-19 09:49:02 +01:00
parent 137741e572
commit 88bc65c201
2 changed files with 75 additions and 69 deletions

View File

@@ -40,7 +40,8 @@
namespace Opm { namespace Opm {
std::string simTimeToString(const std::time_t start_time, const double sim_time) { std::string simTimeToString(const std::time_t start_time, const double sim_time)
{
const auto start_timep = std::chrono::system_clock::from_time_t(start_time); const auto start_timep = std::chrono::system_clock::from_time_t(start_time);
const auto sim_duration = std::chrono::duration_cast<std::chrono::system_clock::duration>( const auto sim_duration = std::chrono::duration_cast<std::chrono::system_clock::duration>(
std::chrono::duration<double>(sim_time) std::chrono::duration<double>(sim_time)
@@ -52,15 +53,13 @@ std::string simTimeToString(const std::time_t start_time, const double sim_time)
} }
GroupEconomicLimitsChecker:: GroupEconomicLimitsChecker::
GroupEconomicLimitsChecker( GroupEconomicLimitsChecker(const BlackoilWellModelGeneric& well_model,
const BlackoilWellModelGeneric &well_model, WellTestState& well_test_state,
WellTestState &well_test_state, const Group& group,
const Group &group,
const double simulation_time, const double simulation_time,
const int report_step_idx, const int report_step_idx,
DeferredLogger &deferred_logger DeferredLogger& deferred_logger)
) : : well_model_{well_model}
well_model_{well_model}
, group_{group} , group_{group}
, simulation_time_{simulation_time} , simulation_time_{simulation_time}
, report_step_idx_{report_step_idx} , report_step_idx_{report_step_idx}
@@ -397,4 +396,5 @@ throwNotImplementedError(const std::string &error) const
const std::string msg = fmt::format("Group: {} : GECON : {} not implemented", this->group_.name(), error); const std::string msg = fmt::format("Group: {} : GECON : {} not implemented", this->group_.name(), error);
OPM_DEFLOG_THROW(std::runtime_error, msg, this->deferred_logger_); OPM_DEFLOG_THROW(std::runtime_error, msg, this->deferred_logger_);
} }
} // namespace Opm } // namespace Opm

View File

@@ -37,17 +37,15 @@ class Group;
template<class Scalar> class WellState; template<class Scalar> class WellState;
class WellTestState; class WellTestState;
class GroupEconomicLimitsChecker class GroupEconomicLimitsChecker
{ {
public: public:
GroupEconomicLimitsChecker( GroupEconomicLimitsChecker(const BlackoilWellModelGeneric& well_model,
const BlackoilWellModelGeneric &well_model, WellTestState& well_test_state,
WellTestState &well_test_state, const Group& group,
const Group &group,
const double simulation_time, const double simulation_time,
const int report_step_idx, const int report_step_idx,
DeferredLogger &deferred_logger DeferredLogger& deferred_logger);
);
void closeWells(); void closeWells();
bool minGasRate(); bool minGasRate();
bool minOilRate(); bool minOilRate();
@@ -59,34 +57,42 @@ class WellTestState;
int numProducersOpenInitially(); int numProducersOpenInitially();
int numProducersOpen(); int numProducersOpen();
void activateEndRun(); void activateEndRun();
std::string message_separator(const char sep_char='*', const size_t sep_length=110) const { return std::string(sep_length, sep_char); } std::string message_separator(const char sep_char = '*',
const size_t sep_length = 110) const
{ return std::string(sep_length, sep_char); }
static constexpr int NUM_PHASES = 3; static constexpr int NUM_PHASES = 3;
private:
void displayDebugMessage(const std::string &msg) const; private:
void addPrintMessage(const std::string &msg, const double value, const double limit, const UnitSystem::measure measure); void displayDebugMessage(const std::string& msg) const;
void addPrintMessage(const std::string& msg,
const double value,
const double limit,
const UnitSystem::measure measure);
bool closeWellsRecursive(const Group& group, int level = 0); bool closeWellsRecursive(const Group& group, int level = 0);
void throwNotImplementedError(const std::string &error) const; void throwNotImplementedError(const std::string& error) const;
const BlackoilWellModelGeneric &well_model_;
const Group &group_; const BlackoilWellModelGeneric& well_model_;
const Group& group_;
const double simulation_time_; const double simulation_time_;
const int report_step_idx_; const int report_step_idx_;
DeferredLogger &deferred_logger_; DeferredLogger& deferred_logger_;
const std::string date_string_; const std::string date_string_;
const UnitSystem& unit_system_; const UnitSystem& unit_system_;
const WellState<double>& well_state_; const WellState<double>& well_state_;
WellTestState &well_test_state_; WellTestState& well_test_state_;
const Schedule &schedule_; const Schedule& schedule_;
GroupEconProductionLimits::GEconGroupProp gecon_props_; GroupEconProductionLimits::GEconGroupProp gecon_props_;
bool debug_ = true; bool debug_ = true;
std::array<double,NUM_PHASES> production_rates_; std::array<double,NUM_PHASES> production_rates_;
std::map<int, BlackoilPhases::PhaseIndex> phase_idx_map_ = { std::map<int, BlackoilPhases::PhaseIndex> phase_idx_map_ = {
{0, BlackoilPhases::Liquid}, {0, BlackoilPhases::Liquid},
{1, BlackoilPhases::Vapour}, {1, BlackoilPhases::Vapour},
{2, BlackoilPhases::Aqua}}; {2, BlackoilPhases::Aqua}
};
std::map<BlackoilPhases::PhaseIndex, int> phase_idx_reverse_map_; std::map<BlackoilPhases::PhaseIndex, int> phase_idx_reverse_map_;
std::string message_; std::string message_;
}; };
} // namespace Opm } // namespace Opm