@@ -218,15 +218,12 @@ void GetPipesHeatTransfer(EnergyPlusData &state)
218
218
bool ErrorsFound (false ); // Set to true if errors in input,
219
219
220
220
// fatal at end of routine
221
- int IOStatus; // Used in GetObjectItem
222
- int Item; // Item to be "gotten"
223
- int PipeItem;
221
+ int IOStatus; // Used in GetObjectItem
224
222
int NumAlphas; // Number of Alphas for each GetObjectItem call
225
223
int NumNumbers; // Number of Numbers for each GetObjectItem call
226
224
int NumOfPipeHTInt; // Number of Pipe Heat Transfer objects
227
225
int NumOfPipeHTExt; // Number of Pipe Heat Transfer objects
228
226
int NumOfPipeHTUG; // Number of Pipe Heat Transfer objects
229
- int NumSections; // total number of sections in pipe
230
227
auto &cCurrentModuleObject = state.dataIPShortCut ->cCurrentModuleObject ;
231
228
// Initializations and allocations
232
229
cCurrentModuleObject = " Pipe:Indoor" ;
@@ -242,10 +239,10 @@ void GetPipesHeatTransfer(EnergyPlusData &state)
242
239
243
240
state.dataPipeHT ->PipeHT .allocate (state.dataPipeHT ->nsvNumOfPipeHT );
244
241
state.dataPipeHT ->PipeHTUniqueNames .reserve (static_cast <unsigned >(state.dataPipeHT ->nsvNumOfPipeHT ));
245
- Item = 0 ;
242
+ int Item = 0 ;
246
243
247
244
cCurrentModuleObject = " Pipe:Indoor" ;
248
- for (PipeItem = 1 ; PipeItem <= NumOfPipeHTInt; ++PipeItem) {
245
+ for (int PipeItem = 1 ; PipeItem <= NumOfPipeHTInt; ++PipeItem) {
249
246
++Item;
250
247
// get the object name
251
248
state.dataInputProcessing ->inputProcessor ->getObjectItem (state,
@@ -399,7 +396,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state)
399
396
} // end of input loop
400
397
401
398
cCurrentModuleObject = " Pipe:Outdoor" ;
402
- for (PipeItem = 1 ; PipeItem <= NumOfPipeHTExt; ++PipeItem) {
399
+ for (int PipeItem = 1 ; PipeItem <= NumOfPipeHTExt; ++PipeItem) {
403
400
++Item;
404
401
// get the object name
405
402
state.dataInputProcessing ->inputProcessor ->getObjectItem (state,
@@ -534,7 +531,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state)
534
531
} // end of input loop
535
532
536
533
cCurrentModuleObject = " Pipe:Underground" ;
537
- for (PipeItem = 1 ; PipeItem <= NumOfPipeHTUG; ++PipeItem) {
534
+ for (int PipeItem = 1 ; PipeItem <= NumOfPipeHTUG; ++PipeItem) {
538
535
539
536
++Item;
540
537
// get the object name
@@ -693,7 +690,6 @@ void GetPipesHeatTransfer(EnergyPlusData &state)
693
690
GetGroundTempModelAndInit (state, state.dataIPShortCut ->cAlphaArgs (7 ), state.dataIPShortCut ->cAlphaArgs (8 ));
694
691
695
692
// Select number of pipe sections. Hanby's optimal number of 20 section is selected.
696
- NumSections = NumPipeSections;
697
693
state.dataPipeHT ->PipeHT (Item).NumSections = NumPipeSections;
698
694
699
695
// For buried pipes, we need to allocate the cartesian finite difference array
@@ -707,7 +703,7 @@ void GetPipesHeatTransfer(EnergyPlusData &state)
707
703
708
704
for (Item = 1 ; Item <= state.dataPipeHT ->nsvNumOfPipeHT ; ++Item) {
709
705
// Select number of pipe sections. Hanby's optimal number of 20 section is selected.
710
- NumSections = NumPipeSections;
706
+ int NumSections = NumPipeSections;
711
707
state.dataPipeHT ->PipeHT (Item).NumSections = NumPipeSections;
712
708
713
709
// We need to allocate the Hanby model arrays for all pipes, including buried
@@ -1191,9 +1187,6 @@ void PipeHTData::CalcPipesHeatTransfer(EnergyPlusData &state, ObjexxFCL::Optiona
1191
1187
Real64 EnvHeatTransCoef (0.0 ); // external convection coefficient (outside pipe)
1192
1188
Real64 FluidNodeHeatCapacity (0.0 ); // local var for MCp for single node of pipe
1193
1189
1194
- int PipeDepth (0 );
1195
- int PipeWidth (0 );
1196
- int curnode;
1197
1190
Real64 TempBelow;
1198
1191
Real64 TempBeside;
1199
1192
Real64 TempAbove;
@@ -1274,8 +1267,8 @@ void PipeHTData::CalcPipesHeatTransfer(EnergyPlusData &state, ObjexxFCL::Optiona
1274
1267
1275
1268
if (present (LengthIndex)) { // Just simulate the single section if being called from Pipe:Underground
1276
1269
1277
- PipeDepth = this ->PipeNodeDepth ;
1278
- PipeWidth = this ->PipeNodeWidth ;
1270
+ int PipeDepth = this ->PipeNodeDepth ;
1271
+ int PipeWidth = this ->PipeNodeWidth ;
1279
1272
TempBelow = this ->T (PipeWidth, PipeDepth + 1 , LengthIndex, TimeIndex::Current);
1280
1273
TempBeside = this ->T (PipeWidth - 1 , PipeDepth, LengthIndex, TimeIndex::Current);
1281
1274
TempAbove = this ->T (PipeWidth, PipeDepth - 1 , LengthIndex, TimeIndex::Current);
@@ -1301,7 +1294,7 @@ void PipeHTData::CalcPipesHeatTransfer(EnergyPlusData &state, ObjexxFCL::Optiona
1301
1294
1302
1295
// start loop along pipe
1303
1296
// b1 must not be zero but this should have been checked on input
1304
- for (curnode = 1 ; curnode <= this ->NumSections ; ++curnode) {
1297
+ for (int curnode = 1 ; curnode <= this ->NumSections ; ++curnode) {
1305
1298
this ->TentativeFluidTemp (curnode) = (A2 * this ->TentativeFluidTemp (curnode - 1 ) +
1306
1299
A3 / B1 * (B3 * state.dataPipeHT ->nsvEnvironmentTemp + B4 * this ->PreviousPipeTemp (curnode)) +
1307
1300
A4 * this ->PreviousFluidTemp (curnode)) /
@@ -1356,7 +1349,6 @@ void PipeHTData::CalcBuriedPipeSoil(EnergyPlusData &state) // Current Simulation
1356
1349
1357
1350
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
1358
1351
int IterationIndex (0 ); // Index when stepping through equations
1359
- int LengthIndex (0 ); // Index for nodes along length of pipe
1360
1352
int DepthIndex (0 ); // Index for nodes in the depth direction
1361
1353
int WidthIndex (0 ); // Index for nodes in the width direction
1362
1354
Real64 ConvCoef (0.0 ); // Current convection coefficient = f(Wind Speed,Roughness)
@@ -1394,7 +1386,7 @@ void PipeHTData::CalcBuriedPipeSoil(EnergyPlusData &state) // Current Simulation
1394
1386
}
1395
1387
1396
1388
// Store computed values in T_O array
1397
- for (LengthIndex = 2 ; LengthIndex <= this ->NumSections ; ++LengthIndex) {
1389
+ for (int LengthIndex = 2 ; LengthIndex <= this ->NumSections ; ++LengthIndex) {
1398
1390
for (DepthIndex = 1 ; DepthIndex <= this ->NumDepthNodes - 1 ; ++DepthIndex) {
1399
1391
for (WidthIndex = 2 ; WidthIndex <= this ->PipeNodeWidth ; ++WidthIndex) {
1400
1392
T_O (WidthIndex, DepthIndex, LengthIndex) = this ->T (WidthIndex, DepthIndex, LengthIndex, TimeIndex::Tentative);
@@ -1403,7 +1395,7 @@ void PipeHTData::CalcBuriedPipeSoil(EnergyPlusData &state) // Current Simulation
1403
1395
}
1404
1396
1405
1397
// Loop along entire length of pipe, analyzing cross sects
1406
- for (LengthIndex = 1 ; LengthIndex <= this ->NumSections ; ++LengthIndex) {
1398
+ for (int LengthIndex = 1 ; LengthIndex <= this ->NumSections ; ++LengthIndex) {
1407
1399
for (DepthIndex = 1 ; DepthIndex <= this ->NumDepthNodes - 1 ; ++DepthIndex) {
1408
1400
for (WidthIndex = 2 ; WidthIndex <= this ->PipeNodeWidth ; ++WidthIndex) {
1409
1401
@@ -1479,7 +1471,7 @@ void PipeHTData::CalcBuriedPipeSoil(EnergyPlusData &state) // Current Simulation
1479
1471
// -Update node for cartesian system
1480
1472
this ->T (WidthIndex, DepthIndex, LengthIndex, TimeIndex::Tentative) = this ->PipeTemp (LengthIndex);
1481
1473
1482
- } else if (DepthIndex != 1 ) { // Not surface node
1474
+ } else { // Not surface node
1483
1475
1484
1476
// -Coefficients and Temperatures
1485
1477
NodeLeft = this ->T (WidthIndex - 1 , DepthIndex, LengthIndex, TimeIndex::Current);
@@ -1515,7 +1507,7 @@ void PipeHTData::CalcBuriedPipeSoil(EnergyPlusData &state) // Current Simulation
1515
1507
}
1516
1508
1517
1509
// Check for convergence
1518
- for (LengthIndex = 2 ; LengthIndex <= this ->NumSections ; ++LengthIndex) {
1510
+ for (int LengthIndex = 2 ; LengthIndex <= this ->NumSections ; ++LengthIndex) {
1519
1511
for (DepthIndex = 1 ; DepthIndex <= this ->NumDepthNodes - 1 ; ++DepthIndex) {
1520
1512
for (WidthIndex = 2 ; WidthIndex <= this ->PipeNodeWidth ; ++WidthIndex) {
1521
1513
Ttemp = this ->T (WidthIndex, DepthIndex, LengthIndex, TimeIndex::Tentative);
0 commit comments