Skip to content

Commit

Permalink
Rename variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Ahrenkiel authored and Phil Ahrenkiel committed Jan 1, 2024
1 parent e7ab732 commit 1b5b6d4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/HPWH.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3414,17 +3414,17 @@ void HPWH::updateTankTemps(double drawVolume_L,
remainingDrawVolume_N = 0.;
}

double totalHeatExpelled_kJ = 0.;
double totalExpelledHeat_kJ = 0.;
while (remainingDrawVolume_N > 0.)
{

// draw no more than one node at a time
double incrementalDrawVolume_N =
remainingDrawVolume_N > 1. ? 1. : remainingDrawVolume_N;

double heatOutput_kJ = nodeCp_kJperC * incrementalDrawVolume_N * tankTemps_C.back();
totalHeatExpelled_kJ += heatOutput_kJ;
tankTemps_C.back() -= heatOutput_kJ / nodeCp_kJperC;
double outputHeat_kJ = nodeCp_kJperC * incrementalDrawVolume_N * tankTemps_C.back();
totalExpelledHeat_kJ += outputHeat_kJ;
tankTemps_C.back() -= outputHeat_kJ / nodeCp_kJperC;

for (int i = getNumNodes() - 1; i >= 0; --i)
{
Expand All @@ -3444,18 +3444,18 @@ void HPWH::updateTankTemps(double drawVolume_L,

if (i > 0)
{
double heatTransferred_kJ =
double transferT_C =
incrementalDrawVolume_N * (1. - inletFraction) * tankTemps_C[i - 1];
tankTemps_C[i] += heatTransferred_kJ;
tankTemps_C[i - 1] -= heatTransferred_kJ;
tankTemps_C[i] += transferT_C;
tankTemps_C[i - 1] -= transferT_C;
}
}

remainingDrawVolume_N -= incrementalDrawVolume_N;
mixTankInversions();
}

outletTemp_C = totalHeatExpelled_kJ / drawCp_kJperC;
outletTemp_C = totalExpelledHeat_kJ / drawCp_kJperC;
}

// account for mixing at the bottom of the tank
Expand Down

0 comments on commit 1b5b6d4

Please sign in to comment.