Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete hydro logs #2221

Merged
merged 2 commits into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 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,9 @@ 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
Loading