Skip to content

Commit

Permalink
Don't apply reverse spinning if the cluster is no force gen [ANT-2293] (
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin authored Nov 4, 2024
1 parent 94703f4 commit 39708a6
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions src/libs/antares/study/parts/thermal/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,22 +403,29 @@ void Data::ThermalCluster::reverseCalculationOfSpinning()
{
// Nothing to do if the spinning is equal to zero
// because it will the same multiply all entries of the matrix by 1.
if (!Utils::isZero(spinning))
if (Utils::isZero(spinning))
{
logs.debug() << " Calculation of spinning (reverse)... " << parentArea->name
<< "::" << pName;

auto& ts = series.timeSeries;
// The formula
// const double s = 1. - cluster.spinning / 100.;
return;
}

// All values in the matrix will be multiply by this coeff
// It is no really useful to test if the result of the formula
// is equal to zero, since the method `Matrix::multiplyAllValuesBy()`
// already does this test.
ts.multiplyAllEntriesBy(1. / (1. - (spinning / 100.)));
ts.roundAllEntries();
// No ts have been generated, no need to save them into input or it will apply spinning twice
if (tsGenBehavior == LocalTSGenerationBehavior::forceNoGen)
{
return;
}

logs.debug() << " Calculation of spinning (reverse)... " << parentArea->name << "::" << pName;

auto& ts = series.timeSeries;
// The formula
// const double s = 1. - cluster.spinning / 100.;

// All values in the matrix will be multiply by this coeff
// It is no really useful to test if the result of the formula
// is equal to zero, since the method `Matrix::multiplyAllValuesBy()`
// already does this test.
ts.multiplyAllEntriesBy(1. / (1. - (spinning / 100.)));
ts.roundAllEntries();
}

void Data::ThermalCluster::reset()
Expand Down

0 comments on commit 39708a6

Please sign in to comment.