From b6c93d38bcadd2b2a99cd9d757359222edd11e08 Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Tue, 2 Jul 2024 13:53:20 +0200 Subject: [PATCH 1/2] Complete hydro logs --- .../hydro/management/HydroInputsChecker.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/solver/hydro/management/HydroInputsChecker.cpp b/src/solver/hydro/management/HydroInputsChecker.cpp index ff94990ee2..a2f6298f9d 100644 --- a/src/solver/hydro/management/HydroInputsChecker.cpp +++ b/src/solver/hydro/management/HydroInputsChecker.cpp @@ -99,6 +99,7 @@ bool HydroInputsChecker::checkWeeklyMinGeneration(uint year, const Data::Area& a const auto& srcinflows = area.hydro.series->storage.getColumn(year); const auto& srcmingen = area.hydro.series->mingen.getColumn(year); // Weekly minimum generation <= Weekly inflows for each week + bool ret = true; for (uint week = 0; week < calendar_.maxWeeksInYear - 1; ++week) { double totalWeekMingen = 0.0; @@ -122,15 +123,16 @@ bool HydroInputsChecker::checkWeeklyMinGeneration(uint year, const Data::Area& a << " the minimum generation of " << totalWeekMingen << " MW in week " << week + 1 << " of TS-" << area.hydro.series->mingen.getSeriesIndex(year) + 1 << " is incompatible with the inflows of " << totalWeekInflows << " MW."; - return false; + ret = false; } } - return true; + return ret; } bool HydroInputsChecker::checkYearlyMinGeneration(uint year, const Data::Area& area) { const auto& data = area.hydro.managementData.at(year); + bool ret = true; if (data.totalYearMingen > data.totalYearInflows) { // Yearly minimum generation <= Yearly inflows @@ -138,14 +140,15 @@ bool HydroInputsChecker::checkYearlyMinGeneration(uint year, const Data::Area& a << " the minimum generation of " << data.totalYearMingen << " MW of TS-" << area.hydro.series->mingen.getSeriesIndex(year) + 1 << " is incompatible with the inflows of " << data.totalYearInflows << " MW."; - return false; + ret = false; } - return true; + return ret; } bool HydroInputsChecker::checkMonthlyMinGeneration(uint year, const Data::Area& area) { const auto& data = area.hydro.managementData.at(year); + bool ret = true; for (uint month = 0; month != 12; ++month) { uint realmonth = calendar_.months[month].realmonth; @@ -158,10 +161,10 @@ bool HydroInputsChecker::checkMonthlyMinGeneration(uint year, const Data::Area& << area.hydro.series->mingen.getSeriesIndex(year) + 1 << " is incompatible with the inflows of " << data.totalMonthInflows[realmonth] << " MW."; - return false; + ret = false; } } - return true; + return ret; } bool HydroInputsChecker::checkGenerationPowerConsistency(uint year) @@ -222,7 +225,7 @@ void HydroInputsChecker::CheckFinalReservoirLevelsConfiguration(uint year) errorCollector_); if (!validator.check()) { - errorCollector_(area.name) << "hydro final level : infeasibility"; + errorCollector_(area.name) << "hydro final level : infeasibility for area " << area.name << " please check the corresponding final level data (scenario-builder)"; } if (validator.finalLevelFineForUse()) { From 4681a67839f0aa0a2b3a81a1ba4915f2a17d8427 Mon Sep 17 00:00:00 2001 From: Florian OMNES <26088210+flomnes@users.noreply.github.com> Date: Tue, 2 Jul 2024 14:04:20 +0200 Subject: [PATCH 2/2] Formatting --- src/solver/hydro/management/HydroInputsChecker.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/solver/hydro/management/HydroInputsChecker.cpp b/src/solver/hydro/management/HydroInputsChecker.cpp index a2f6298f9d..d9956e94a2 100644 --- a/src/solver/hydro/management/HydroInputsChecker.cpp +++ b/src/solver/hydro/management/HydroInputsChecker.cpp @@ -225,7 +225,9 @@ void HydroInputsChecker::CheckFinalReservoirLevelsConfiguration(uint year) errorCollector_); if (!validator.check()) { - errorCollector_(area.name) << "hydro final level : infeasibility for area " << area.name << " please check the corresponding final level data (scenario-builder)"; + errorCollector_(area.name) + << "hydro final level : infeasibility for area " << area.name + << " please check the corresponding final level data (scenario-builder)"; } if (validator.finalLevelFineForUse()) {