Skip to content

Commit

Permalink
Prune TermUnitFinalZoneSizing
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwitte committed Jul 19, 2023
1 parent a3e6ec1 commit 6ed366e
Show file tree
Hide file tree
Showing 8 changed files with 229 additions and 50 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/Autosizing/Base.hh
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ struct BaseSizer
EPVector<DataSizing::ZoneEqSizingData> zoneEqSizing;
EPVector<DataAirLoop::OutsideAirSysProps> outsideAirSys;
EPVector<DataSizing::TermUnitSizingData> termUnitSizing;
EPVector<DataSizing::ZoneSizingData> termUnitFinalZoneSizing;
EPVector<DataSizing::TermUnitZoneSizingData> termUnitFinalZoneSizing;
EPVector<DataSizing::ZoneSizingData> finalZoneSizing;
EPVector<DataSizing::SystemSizingData> finalSysSizing;
EPVector<DataSizing::PlantSizingData> plantSizData;
Expand Down
120 changes: 106 additions & 14 deletions src/EnergyPlus/DataSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,26 +105,26 @@ Real64 TermUnitSizingData::applyTermUnitSizingHeatFlow(Real64 const heatFlowWith
return adjustedFlow;
}

void ZoneSizingData::scaleZoneCooling(Real64 const ratio // Scaling ratio
)
void TermUnitZoneSizingData::scaleZoneCooling(Real64 const ratio)
{
// Apply scaling ratio to TermUnitFinalZoneSizing cooling flow and load
this->DesCoolVolFlow = this->DesCoolVolFlow * ratio;
this->DesCoolMassFlow = this->DesCoolMassFlow * ratio;
this->DesCoolLoad = this->DesCoolLoad * ratio;
this->CoolFlowSeq = this->CoolFlowSeq * ratio;
this->CoolLoadSeq = this->CoolLoadSeq * ratio;
this->DesCoolVolFlow *= ratio;
this->DesCoolMassFlow *= ratio;
this->DesCoolLoad *= ratio;
for (auto &cfs : this->CoolFlowSeq) {
cfs *= ratio;
}

This comment has been minimized.

Copy link
@rraustad

rraustad Jul 20, 2023

Contributor

Curious what the machine language looks like between these 2 (old line 115 versus this new loop). And CoolLoadSeq is used in ZoneSizing arrays and not needed in TU sizing array so that was deleted here.

This comment has been minimized.

Copy link
@mjwitte

mjwitte Jul 20, 2023

Author Contributor

Previously this was an Array1D, so the was somewhere in the ObjexxFCL header. Now it's an EPVector, so we need the loop here.

}

void ZoneSizingData::scaleZoneHeating(Real64 const ratio // Scaling ratio
)
void TermUnitZoneSizingData::scaleZoneHeating(Real64 const ratio)
{
// Apply scaling ratio to TermUnitFinalZoneSizing heating flow and load
this->DesHeatVolFlow = this->DesHeatVolFlow * ratio;
this->DesHeatMassFlow = this->DesHeatMassFlow * ratio;
this->DesHeatLoad = this->DesHeatLoad * ratio;
this->HeatFlowSeq = this->HeatFlowSeq * ratio;
this->HeatLoadSeq = this->HeatLoadSeq * ratio;
this->DesHeatVolFlow *= ratio;
this->DesHeatMassFlow *= ratio;
this->DesHeatLoad *= ratio;
for (auto &cfs : this->HeatFlowSeq) {
cfs *= ratio;
}
}

void ZoneSizingData::zeroMemberData()
Expand Down Expand Up @@ -314,6 +314,98 @@ void ZoneSizingData::allocateMemberArrays(int const numOfTimeStepInDay)
this->LatentHeatFlowSeq.dimension(numOfTimeStepInDay, 0.0);
}

void TermUnitZoneSizingData::allocateMemberArrays(int const numOfTimeStepInDay)
{
this->HeatFlowSeq.dimension(numOfTimeStepInDay, 0.0);
this->CoolFlowSeq.dimension(numOfTimeStepInDay, 0.0);
this->HeatFlowSeqNoOA.dimension(numOfTimeStepInDay, 0.0);
this->CoolFlowSeqNoOA.dimension(numOfTimeStepInDay, 0.0);
this->HeatZoneTempSeq.dimension(numOfTimeStepInDay, 0.0);
this->HeatZoneRetTempSeq.dimension(numOfTimeStepInDay, 0.0);
this->CoolZoneTempSeq.dimension(numOfTimeStepInDay, 0.0);
this->CoolZoneRetTempSeq.dimension(numOfTimeStepInDay, 0.0);
}

void TermUnitZoneSizingData::copyFromZoneSizing(ZoneSizingData const &sourceData)
{
this->ZoneName = sourceData.ZoneName;
this->ADUName = sourceData.ADUName;
this->CoolDesTemp = sourceData.CoolDesTemp;
this->HeatDesTemp = sourceData.HeatDesTemp;
this->CoolDesHumRat = sourceData.CoolDesHumRat;
this->HeatDesHumRat = sourceData.HeatDesHumRat;
this->DesOAFlowPPer = sourceData.DesOAFlowPPer;
this->DesOAFlowPerArea = sourceData.DesOAFlowPerArea;
this->DesCoolMinAirFlow = sourceData.DesCoolMinAirFlow;
this->DesCoolMinAirFlowFrac = sourceData.DesCoolMinAirFlowFrac;
this->DesHeatMaxAirFlow = sourceData.DesHeatMaxAirFlow;
this->DesHeatMaxAirFlowFrac = sourceData.DesHeatMaxAirFlowFrac;
this->ZoneNum = sourceData.ZoneNum;
this->DesHeatMassFlow = sourceData.DesHeatMassFlow;
this->DesHeatMassFlowNoOA = sourceData.DesHeatMassFlowNoOA;
this->DesHeatOAFlowFrac = sourceData.DesHeatOAFlowFrac;
this->DesCoolMassFlow = sourceData.DesCoolMassFlow;
this->DesCoolMassFlowNoOA = sourceData.DesCoolMassFlowNoOA;
this->DesCoolOAFlowFrac = sourceData.DesCoolOAFlowFrac;
this->DesHeatLoad = sourceData.DesHeatLoad;
this->NonAirSysDesHeatLoad = sourceData.NonAirSysDesHeatLoad;
this->DesCoolLoad = sourceData.DesCoolLoad;
this->NonAirSysDesCoolLoad = sourceData.NonAirSysDesCoolLoad;
this->DesHeatVolFlow = sourceData.DesHeatVolFlow;
this->DesHeatVolFlowNoOA = sourceData.DesHeatVolFlowNoOA;
this->NonAirSysDesHeatVolFlow = sourceData.NonAirSysDesHeatVolFlow;
this->DesCoolVolFlow = sourceData.DesCoolVolFlow;
this->DesCoolVolFlowNoOA = sourceData.DesCoolVolFlowNoOA;
this->NonAirSysDesCoolVolFlow = sourceData.NonAirSysDesCoolVolFlow;
this->DesHeatVolFlowMax = sourceData.DesHeatVolFlowMax;
this->DesCoolVolFlowMin = sourceData.DesCoolVolFlowMin;
this->DesHeatCoilInTempTU = sourceData.DesHeatCoilInTempTU;
this->DesCoolCoilInTempTU = sourceData.DesCoolCoilInTempTU;
this->DesHeatCoilInHumRatTU = sourceData.DesHeatCoilInHumRatTU;
this->DesCoolCoilInHumRatTU = sourceData.DesCoolCoilInHumRatTU;
this->ZoneTempAtHeatPeak = sourceData.ZoneTempAtHeatPeak;
this->ZoneRetTempAtHeatPeak = sourceData.ZoneRetTempAtHeatPeak;
this->ZoneTempAtCoolPeak = sourceData.ZoneTempAtCoolPeak;
this->ZoneRetTempAtCoolPeak = sourceData.ZoneRetTempAtCoolPeak;
this->ZoneHumRatAtHeatPeak = sourceData.ZoneHumRatAtHeatPeak;
this->ZoneHumRatAtCoolPeak = sourceData.ZoneHumRatAtCoolPeak;
this->TimeStepNumAtHeatMax = sourceData.TimeStepNumAtHeatMax;
this->TimeStepNumAtCoolMax = sourceData.TimeStepNumAtCoolMax;
this->HeatDDNum = sourceData.HeatDDNum;
this->CoolDDNum = sourceData.CoolDDNum;
this->MinOA = sourceData.MinOA;
this->DesCoolMinAirFlow2 = sourceData.DesCoolMinAirFlow2;
this->DesHeatMaxAirFlow2 = sourceData.DesHeatMaxAirFlow2;
for (int t = 1; t <= this->HeatFlowSeq.size(); ++t) {

This comment has been minimized.

Copy link
@rraustad

rraustad Jul 20, 2023

Contributor

I don't know the answer but I think this should be for (size_t t = but this does work which adds to my confusion.

This comment has been minimized.

Copy link
@mjwitte

mjwitte Jul 20, 2023

Author Contributor

It works, but it's got warnings.

this->HeatFlowSeq(t) = sourceData.HeatFlowSeq(t);
this->HeatFlowSeqNoOA(t) = sourceData.HeatFlowSeqNoOA(t);
this->CoolFlowSeq(t) = sourceData.CoolFlowSeq(t);
this->CoolFlowSeqNoOA(t) = sourceData.CoolFlowSeqNoOA(t);
this->HeatZoneTempSeq(t) = sourceData.HeatZoneTempSeq(t);
this->HeatZoneRetTempSeq(t) = sourceData.HeatZoneRetTempSeq(t);
this->CoolZoneTempSeq(t) = sourceData.CoolZoneTempSeq(t);
this->CoolZoneRetTempSeq(t) = sourceData.CoolZoneRetTempSeq(t);
}
this->ZoneADEffCooling = sourceData.ZoneADEffCooling;
this->ZoneADEffHeating = sourceData.ZoneADEffHeating;
this->ZoneSecondaryRecirculation = sourceData.ZoneSecondaryRecirculation;
this->ZoneVentilationEff = sourceData.ZoneVentilationEff;
this->ZonePrimaryAirFraction = sourceData.ZonePrimaryAirFraction;
this->ZonePrimaryAirFractionHtg = sourceData.ZonePrimaryAirFractionHtg;
this->ZoneOAFracCooling = sourceData.ZoneOAFracCooling;
this->ZoneOAFracHeating = sourceData.ZoneOAFracHeating;
this->TotalOAFromPeople = sourceData.TotalOAFromPeople;
this->TotalOAFromArea = sourceData.TotalOAFromArea;
this->TotPeopleInZone = sourceData.TotPeopleInZone;
this->TotalZoneFloorArea = sourceData.TotalZoneFloorArea;
this->SupplyAirAdjustFactor = sourceData.SupplyAirAdjustFactor;
this->ZpzClgByZone = sourceData.ZpzClgByZone;
this->ZpzHtgByZone = sourceData.ZpzHtgByZone;
this->VozClgByZone = sourceData.VozClgByZone;
this->VozHtgByZone = sourceData.VozHtgByZone;
this->VpzMinByZoneSPSized = sourceData.VpzMinByZoneSPSized;
}

void resetHVACSizingGlobals(EnergyPlusData &state,
int const curZoneEqNum,
int const curSysNum,
Expand Down
Loading

5 comments on commit 6ed366e

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SpaceSizingHVAC (mjwitte) - Win64-Windows-10-VisualStudio-16: OK (2667 of 2667 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SpaceSizingHVAC (mjwitte) - x86_64-MacOS-10.17-clang-13.0.0: OK (3440 of 3440 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SpaceSizingHVAC (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.3: OK (3481 of 3481 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SpaceSizingHVAC (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-UnitTestsCoverage-Debug: OK (1894 of 1894 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SpaceSizingHVAC (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-IntegrationCoverage-Debug: OK (776 of 776 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.