Skip to content

Commit

Permalink
Use static_cast<int>.
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Ahrenkiel authored and Phil Ahrenkiel committed Jan 22, 2024
1 parent 58a6704 commit 82e4d3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/HPWHHeatSources.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1029,11 +1029,11 @@ double HPWH::HeatSource::addHeatExternal(double externalT_C,

// mix with node above from outlet to inlet
// mix inlet water at target temperature with inlet node
for (std::size_t nodeIndex = externalOutletHeight; nodeIndex <= externalInletHeight;
for (std::size_t nodeIndex = externalOutletHeight; static_cast<int>(nodeIndex) <= externalInletHeight;
++nodeIndex)
{
double& mixT_C =
(nodeIndex == externalInletHeight) ? targetT_C : hpwh->tankTemps_C[nodeIndex + 1];
(static_cast<int>(nodeIndex) == externalInletHeight) ? targetT_C : hpwh->tankTemps_C[nodeIndex + 1];
hpwh->tankTemps_C[nodeIndex] =
(1. - nodeFrac) * hpwh->tankTemps_C[nodeIndex] + nodeFrac * mixT_C;
}
Expand Down Expand Up @@ -1153,11 +1153,11 @@ double HPWH::HeatSource::addHeatExternalMP(double externalT_C,

// mix with node above from outlet to inlet
// mix inlet water at target temperature with inlet node
for (std::size_t nodeIndex = externalOutletHeight; nodeIndex <= externalInletHeight;
for (std::size_t nodeIndex = externalOutletHeight; static_cast<int>(nodeIndex) <= externalInletHeight;
++nodeIndex)
{
double& mixT_C =
(nodeIndex == externalInletHeight) ? targetT_C : hpwh->tankTemps_C[nodeIndex + 1];
(static_cast<int>(nodeIndex) == externalInletHeight) ? targetT_C : hpwh->tankTemps_C[nodeIndex + 1];
hpwh->tankTemps_C[nodeIndex] =
(1. - nodeFrac) * hpwh->tankTemps_C[nodeIndex] + nodeFrac * mixT_C;
}
Expand Down

0 comments on commit 82e4d3b

Please sign in to comment.