Skip to content

Commit

Permalink
Complete hydro logs
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Jul 2, 2024
1 parent c2b21cc commit b6c93d3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/solver/hydro/management/HydroInputsChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -122,30 +123,32 @@ 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
errorCollector_(area.name)
<< " 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;
Expand All @@ -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)
Expand Down Expand Up @@ -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())
{
Expand Down

0 comments on commit b6c93d3

Please sign in to comment.