@@ -285,7 +285,7 @@ namespace PlantPipingSystemsManager {
285
285
Real64 ZoneTemp = 0.0 ;
286
286
287
287
// Set ZoneTemp equal to the average air temperature of the zones the coupled surfaces are part of.
288
- for (auto &z : thisDomain.ZoneCoupledSurfaces ) {
288
+ for (auto const &z : thisDomain.ZoneCoupledSurfaces ) {
289
289
int ZoneNum = z.Zone ;
290
290
ZoneTemp += state.dataZoneTempPredictorCorrector ->zoneHeatBalance (ZoneNum).ZTAV ;
291
291
}
@@ -428,7 +428,7 @@ namespace PlantPipingSystemsManager {
428
428
for (int DomainNum = 0 ; DomainNum < TotalNumDomains; ++DomainNum) {
429
429
430
430
// Convenience
431
- auto &thisDomain = state.dataPlantPipingSysMgr ->domains [DomainNum];
431
+ auto const &thisDomain = state.dataPlantPipingSysMgr ->domains [DomainNum];
432
432
433
433
// validate pipe domain-circuit name-to-index references
434
434
for (auto &thisCircuit : thisDomain.circuits ) {
@@ -437,25 +437,25 @@ namespace PlantPipingSystemsManager {
437
437
438
438
// correct segment locations for: INTERNAL DATA STRUCTURE Y VALUE MEASURED FROM BOTTOM OF DOMAIN,
439
439
// INPUT WAS MEASURED FROM GROUND SURFACE
440
- for (auto &thisCircuit : thisDomain.circuits ) {
440
+ for (auto const &thisCircuit : thisDomain.circuits ) {
441
441
for (auto &thisSegment : thisCircuit->pipeSegments ) {
442
442
thisSegment->PipeLocation .Y = thisDomain.Extents .yMax - thisSegment->PipeLocation .Y ;
443
443
}
444
444
}
445
445
446
446
// correct segment locations for: BASEMENT X SHIFT
447
447
if (thisDomain.HasBasement && thisDomain.BasementZone .ShiftPipesByWidth ) {
448
- for (auto &thisCircuit : thisDomain.circuits ) {
448
+ for (auto const &thisCircuit : thisDomain.circuits ) {
449
449
for (auto &thisSegment : thisCircuit->pipeSegments ) {
450
450
thisSegment->PipeLocation .X += thisDomain.BasementZone .Width ;
451
451
}
452
452
}
453
453
}
454
454
455
455
// now we will have good values of pipe segment locations, we can validate them
456
- for (auto &thisCircuit : thisDomain.circuits ) {
456
+ for (auto const &thisCircuit : thisDomain.circuits ) {
457
457
// check to make sure it isn't outside the domain
458
- for (auto &thisSegment : thisCircuit->pipeSegments ) {
458
+ for (auto const &thisSegment : thisCircuit->pipeSegments ) {
459
459
if ((thisSegment->PipeLocation .X > thisDomain.Extents .xMax ) || (thisSegment->PipeLocation .X < 0.0 ) ||
460
460
(thisSegment->PipeLocation .Y > thisDomain.Extents .yMax ) || (thisSegment->PipeLocation .Y < 0.0 )) {
461
461
ShowSevereError (state,
@@ -1106,7 +1106,6 @@ namespace PlantPipingSystemsManager {
1106
1106
int NumAlphas; // Number of Alphas for each GetObjectItem call
1107
1107
int NumNumbers; // Number of Numbers for each GetObjectItem call
1108
1108
int IOStatus; // Used in GetObjectItem
1109
- int CurIndex;
1110
1109
1111
1110
// initialize these counters properly so they can be incremented within the DO loop
1112
1111
int DomainNum = StartingDomainNumForBasement - 1 ;
@@ -1173,7 +1172,7 @@ namespace PlantPipingSystemsManager {
1173
1172
}
1174
1173
1175
1174
// Basement zone depth
1176
- CurIndex = 11 ;
1175
+ int CurIndex = 11 ;
1177
1176
thisDomain.BasementZone .Depth = state.dataIPShortCut ->rNumericArgs (CurIndex);
1178
1177
if (thisDomain.BasementZone .Depth >= thisDomain.Extents .yMax || thisDomain.BasementZone .Depth <= 0.0 ) {
1179
1178
ShowSevereError (state, format (" Invalid {}" , state.dataIPShortCut ->cNumericFieldNames (CurIndex)));
@@ -1378,7 +1377,7 @@ namespace PlantPipingSystemsManager {
1378
1377
1379
1378
// Total surface area
1380
1379
Real64 ThisArea = 0.0 ;
1381
- for (auto &z : thisDomain.ZoneCoupledSurfaces ) {
1380
+ for (auto const &z : thisDomain.ZoneCoupledSurfaces ) {
1382
1381
ThisArea += z.SurfaceArea ;
1383
1382
}
1384
1383
@@ -1655,9 +1654,6 @@ namespace PlantPipingSystemsManager {
1655
1654
DataLoopNode::ConnectionType::Inlet,
1656
1655
NodeInputManager::CompFluidStream::Primary,
1657
1656
DataLoopNode::ObjectIsNotParent);
1658
- if (thisCircuit.InletNodeNum == 0 ) {
1659
- CurIndex = 2 ;
1660
- }
1661
1657
thisCircuit.OutletNodeName = state.dataIPShortCut ->cAlphaArgs (3 );
1662
1658
thisCircuit.OutletNodeNum = NodeInputManager::GetOnlySingleNode (state,
1663
1659
thisCircuit.OutletNodeName ,
@@ -1668,9 +1664,6 @@ namespace PlantPipingSystemsManager {
1668
1664
DataLoopNode::ConnectionType::Outlet,
1669
1665
NodeInputManager::CompFluidStream::Primary,
1670
1666
DataLoopNode::ObjectIsNotParent);
1671
- if (thisCircuit.OutletNodeNum == 0 ) {
1672
- CurIndex = 3 ;
1673
- }
1674
1667
BranchNodeConnections::TestCompSet (
1675
1668
state, ObjName_HorizTrench, thisTrenchName, thisCircuit.InletNodeName , thisCircuit.OutletNodeName , " Piping System Circuit Nodes" );
1676
1669
@@ -2123,8 +2116,8 @@ namespace PlantPipingSystemsManager {
2123
2116
this ->developMesh (state);
2124
2117
2125
2118
// would be OK to do some post-mesh error handling here I think
2126
- for (auto &thisDomainCircuit : this ->circuits ) {
2127
- for (auto &segment : thisDomainCircuit->pipeSegments ) {
2119
+ for (auto const &thisDomainCircuit : this ->circuits ) {
2120
+ for (auto const &segment : thisDomainCircuit->pipeSegments ) {
2128
2121
if (!segment->PipeCellCoordinatesSet ) {
2129
2122
ShowSevereError (state, format (" PipingSystems:{}:Pipe segment index not set." , RoutineName));
2130
2123
ShowContinueError (state, " ...Possibly because pipe segment was placed outside of the domain." );
@@ -2356,7 +2349,7 @@ namespace PlantPipingSystemsManager {
2356
2349
Real64 ThisCellMax;
2357
2350
2358
2351
Real64 MaxDivAmount = 0.0 ;
2359
- for (auto &radCell : CellToCheck.PipeCellData .Soil ) {
2352
+ for (auto const &radCell : CellToCheck.PipeCellData .Soil ) {
2360
2353
ThisCellMax = std::abs (radCell.Temperature - radCell.Temperature_PrevIteration );
2361
2354
if (ThisCellMax > MaxDivAmount) {
2362
2355
MaxDivAmount = ThisCellMax;
@@ -2751,7 +2744,7 @@ namespace PlantPipingSystemsManager {
2751
2744
2752
2745
// 'NOTE: pipe location y values have already been corrected to be measured from the bottom surface
2753
2746
// 'in input they are measured by depth, but internally they are referred to by distance from y = 0, or the bottom boundary
2754
- for (auto &thisCircuit : this ->circuits ) {
2747
+ for (auto const &thisCircuit : this ->circuits ) {
2755
2748
2756
2749
// set up a convenience variable here
2757
2750
// 'account for the pipe and insulation if necessary
@@ -3029,7 +3022,7 @@ namespace PlantPipingSystemsManager {
3029
3022
3030
3023
// 'loop across all partitions
3031
3024
for (int Index = 0 ; Index < (int )ThesePartitionCenters.size (); ++Index) {
3032
- auto &thisPartitionCenter = ThesePartitionCenters[Index];
3025
+ auto const &thisPartitionCenter = ThesePartitionCenters[Index];
3033
3026
3034
3027
Real64 const ThisCellWidthBy2 = thisPartitionCenter.TotalWidth / 2.0 ;
3035
3028
PartitionType ThisPartitionType = thisPartitionCenter.partitionType ;
@@ -3142,10 +3135,10 @@ namespace PlantPipingSystemsManager {
3142
3135
// MODIFIED na
3143
3136
// RE-ENGINEERED na
3144
3137
3145
- int cellCountUpToNow = 0 ;
3146
3138
std::vector<Real64> tempCellWidths;
3147
3139
3148
3140
if (PartitionsExist) {
3141
+ int cellCountUpToNow = 0 ;
3149
3142
3150
3143
for (int i = 0 ; i < (int )ThesePartitionRegions.size (); ++i) {
3151
3144
auto &thisPartition = ThesePartitionRegions[i];
@@ -3266,7 +3259,7 @@ namespace PlantPipingSystemsManager {
3266
3259
default :
3267
3260
if (thisRegion.thisRegionType == DirDirection) {
3268
3261
Real64 StartingPointCounter = thisRegion.Min ;
3269
- for (auto &cellWidth : thisRegion.CellWidths ) {
3262
+ for (auto const &cellWidth : thisRegion.CellWidths ) {
3270
3263
RetVal.push_back (StartingPointCounter);
3271
3264
StartingPointCounter += cellWidth;
3272
3265
}
@@ -3459,22 +3452,20 @@ namespace PlantPipingSystemsManager {
3459
3452
// Check if vertical insulation present
3460
3453
if (this ->VertInsPresentFlag ) {
3461
3454
if (InsulationYIndex != 0 ) { // Partial vertical insulation
3462
- if (CellYIndex <= this -> y_max_index && CellYIndex > InsulationYIndex) {
3455
+ if (CellYIndex > InsulationYIndex) {
3463
3456
cellType = CellType::VertInsulation;
3464
3457
++NumInsulationCells;
3465
3458
}
3466
3459
} else { // Vertical insulation extends to depth of basement floor
3467
- if (CellYIndex <= this ->y_max_index && CellYIndex > YFloorIndex) {
3468
- cellType = CellType::VertInsulation;
3469
- ++NumInsulationCells;
3470
- }
3460
+ cellType = CellType::VertInsulation;
3461
+ ++NumInsulationCells;
3471
3462
}
3472
3463
}
3473
3464
}
3474
3465
} else if (CellYIndex == this ->y_max_index ) { // Surface cells
3475
3466
cellType = CellType::GroundSurface;
3476
3467
++NumGroundSurfaceCells;
3477
- } else if (CellYIndex == 0 || CellXIndex == 0 || CellZIndex == 0 ) { // Farfield boundary
3468
+ } else if (CellXIndex == 0 || CellZIndex == 0 ) { // Farfield boundary
3478
3469
cellType = CellType::FarfieldBoundary;
3479
3470
}
3480
3471
} else if (CellXIndex == MaxBasementXNodeIndex && CellYIndex == MinBasementYNodeIndex) {
@@ -3507,7 +3498,7 @@ namespace PlantPipingSystemsManager {
3507
3498
bool HasInsulation (false );
3508
3499
RadialSizing PipeSizing;
3509
3500
Circuit *circuitReference = nullptr ;
3510
- for (auto &thisCircuit : this ->circuits ) {
3501
+ for (auto const &thisCircuit : this ->circuits ) {
3511
3502
for (auto &segment : thisCircuit->pipeSegments ) {
3512
3503
if (XYRectangle.contains (segment->PipeLocation )) {
3513
3504
// 'inform the cell that it is a pipe node
@@ -3842,7 +3833,7 @@ namespace PlantPipingSystemsManager {
3842
3833
3843
3834
bool CircuitInletCellSet = false ;
3844
3835
3845
- for (auto &segment : thisCircuit->pipeSegments ) {
3836
+ for (auto const &segment : thisCircuit->pipeSegments ) {
3846
3837
switch (segment->FlowDirection ) {
3847
3838
case SegmentFlow::IncreasingZ:
3848
3839
SegmentInletCellX = segment->PipeCellCoordinates .X ;
@@ -5178,7 +5169,7 @@ namespace PlantPipingSystemsManager {
5178
5169
NextOuterRadialCellTemperature = cell.PipeCellData .Pipe .Temperature ;
5179
5170
}
5180
5171
} else {
5181
- auto &nextOuterMostSoilCell = cell.PipeCellData .Soil [numSoilCells - 2 ];
5172
+ auto const &nextOuterMostSoilCell = cell.PipeCellData .Soil [numSoilCells - 2 ];
5182
5173
NextOuterRadialCellOuterRadius = nextOuterMostSoilCell.OuterRadius ;
5183
5174
NextOuterRadialCellRadialCentroid = nextOuterMostSoilCell.RadialCentroid ;
5184
5175
NextOuterRadialCellConductivity = nextOuterMostSoilCell.Properties .Conductivity ;
@@ -5858,12 +5849,12 @@ namespace PlantPipingSystemsManager {
5858
5849
// 'calculate this cell's new Cp value based on the cell temperature
5859
5850
if (CellTemp <= frzAllIce) { // totally frozen
5860
5851
rhoCp = this ->Moisture .rhoCP_soil_ice ;
5861
- } else if (( CellTemp > frzAllIce) && (CellTemp < frzIceTrans) ) { // in between totally frozen and ice transition
5852
+ } else if (CellTemp < frzIceTrans) { // in between totally frozen and ice transition
5862
5853
rhoCp = this ->Moisture .rhoCP_soil_ice +
5863
5854
(this ->Moisture .rhoCP_soil_transient - this ->Moisture .rhoCP_soil_ice ) / (frzIceTrans - frzAllIce) * (CellTemp - frzAllIce);
5864
- } else if (( CellTemp >= frzIceTrans) && (CellTemp <= frzLiqTrans) ) { // in between ice transition and liquid transition
5855
+ } else if (CellTemp <= frzLiqTrans) { // in between ice transition and liquid transition
5865
5856
rhoCp = this ->Moisture .rhoCP_soil_transient ;
5866
- } else if (( CellTemp > frzLiqTrans) && (CellTemp < frzAllLiq) ) { // in between liquid transition and all liquid
5857
+ } else if (CellTemp < frzAllLiq) { // in between liquid transition and all liquid
5867
5858
rhoCp = this ->Moisture .rhoCp_soil_liq_1 +
5868
5859
(this ->Moisture .rhoCP_soil_transient - this ->Moisture .rhoCP_soil_liq ) / (frzAllLiq - frzLiqTrans) * (frzAllLiq - CellTemp);
5869
5860
} else { // ( CellTemp >= frzAllLiq ) --- greater than or equal to all liquid
0 commit comments