Skip to content

Commit

Permalink
reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
rraustad committed Sep 12, 2024
1 parent 1ed05e1 commit 5f03783
Showing 1 changed file with 22 additions and 30 deletions.
52 changes: 22 additions & 30 deletions src/EnergyPlus/LowTempRadiantSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2669,16 +2669,14 @@ namespace LowTempRadiantSystem {
std::string CompType; // component type
std::string SizingString; // input field sizing description (e.g., Nominal Capacity)
Real64 TempSize; // autosized value of coil input field
int FieldNum = 1; // IDD numeric field number where input field description is found
int FieldNum; // IDD numeric field number where input field description is found
bool PrintFlag; // TRUE when sizing information is reported in the eio file
int CapSizingMethod; // capacity sizing methods (HeatingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedCoolingCapacity, and
// FractionOfAutosizedHeatingCapacity )
Real64 DesCoilLoad; // design autosized or user specified capacity
Real64 WaterVolFlowMaxDes; // Design water volume flow rate for reproting
Real64 WaterVolFlowMaxUser; // User hard-sized water volume flow rate for reproting

auto &ZoneEqSizing = state.dataSize->ZoneEqSizing;

DesCoilLoad = 0.0;
state.dataSize->DataScalableCapSizingON = false;
state.dataSize->DataFracOfAutosizedHeatingCapacity = 1.0;
Expand All @@ -2692,6 +2690,7 @@ namespace LowTempRadiantSystem {
}

if (state.dataSize->CurZoneEqNum > 0) {
auto &zoneEqSizing = state.dataSize->ZoneEqSizing(state.dataSize->CurZoneEqNum);

CompType = "ZoneHVAC:LowTemperatureRadiant:Electric";
CompName = state.dataLowTempRadSys->ElecRadSys(RadSysNum).Name;
Expand All @@ -2700,7 +2699,7 @@ namespace LowTempRadiantSystem {
PrintFlag = true;
SizingString = state.dataLowTempRadSys->ElecRadSysNumericFields(RadSysNum).FieldNames(FieldNum) + " [W]";
CapSizingMethod = state.dataLowTempRadSys->ElecRadSys(RadSysNum).HeatingCapMethod;
ZoneEqSizing(state.dataSize->CurZoneEqNum).SizingMethod(SizingMethod) = CapSizingMethod;
zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod;

if (!IsAutoSize && !state.dataSize->ZoneSizingRunDone) { // simulation continue
if (CapSizingMethod == HeatingDesignCapacity && state.dataLowTempRadSys->ElecRadSys(RadSysNum).ScaledHeatingCapacity > 0.0) {
Expand Down Expand Up @@ -2750,21 +2749,18 @@ namespace LowTempRadiantSystem {
} else if (CapSizingMethod == CapacityPerFloorArea) {
if (state.dataSize->ZoneSizingRunDone) {
CheckZoneSizing(state, CompType, CompName);
ZoneEqSizing(state.dataSize->CurZoneEqNum).HeatingCapacity = true;
ZoneEqSizing(state.dataSize->CurZoneEqNum).DesHeatingLoad =
state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesHeatLoad;
zoneEqSizing.HeatingCapacity = true;
zoneEqSizing.DesHeatingLoad = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesHeatLoad;
}
TempSize = state.dataLowTempRadSys->ElecRadSys(RadSysNum).ScaledHeatingCapacity *
Zone(state.dataLowTempRadSys->ElecRadSys(RadSysNum).ZonePtr).FloorArea;
state.dataSize->DataScalableCapSizingON = true;

} else if (CapSizingMethod == FractionOfAutosizedHeatingCapacity) {
CheckZoneSizing(state, CompType, CompName);
ZoneEqSizing(state.dataSize->CurZoneEqNum).HeatingCapacity = true;
ZoneEqSizing(state.dataSize->CurZoneEqNum).DesHeatingLoad =
state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesHeatLoad;
TempSize = ZoneEqSizing(state.dataSize->CurZoneEqNum).DesHeatingLoad *
state.dataLowTempRadSys->ElecRadSys(RadSysNum).ScaledHeatingCapacity;
zoneEqSizing.HeatingCapacity = true;
zoneEqSizing.DesHeatingLoad = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesHeatLoad;
TempSize = zoneEqSizing.DesHeatingLoad * state.dataLowTempRadSys->ElecRadSys(RadSysNum).ScaledHeatingCapacity;
state.dataSize->DataScalableCapSizingON = true;
} else {
TempSize = state.dataLowTempRadSys->ElecRadSys(RadSysNum).ScaledHeatingCapacity;
Expand Down Expand Up @@ -2792,13 +2788,14 @@ namespace LowTempRadiantSystem {
}

if (state.dataSize->CurZoneEqNum > 0) {
auto &zoneEqSizing = state.dataSize->ZoneEqSizing(state.dataSize->CurZoneEqNum);

int SizingMethod = HeatingCapacitySizing;
FieldNum = 2;
PrintFlag = true;
SizingString = state.dataLowTempRadSys->HydronicRadiantSysNumericFields(RadSysNum).FieldNames(FieldNum) + " [W]";
CapSizingMethod = state.dataLowTempRadSys->HydrRadSys(RadSysNum).HeatingCapMethod;
ZoneEqSizing(state.dataSize->CurZoneEqNum).SizingMethod(SizingMethod) = CapSizingMethod;
zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod;

if (!IsAutoSize && !state.dataSize->ZoneSizingRunDone) { // simulation continue
if (CapSizingMethod == HeatingDesignCapacity && state.dataLowTempRadSys->HydrRadSys(RadSysNum).ScaledHeatingCapacity > 0.0) {
Expand Down Expand Up @@ -2848,20 +2845,17 @@ namespace LowTempRadiantSystem {
} else if (CapSizingMethod == CapacityPerFloorArea) {
if (state.dataSize->ZoneSizingRunDone) {
CheckZoneSizing(state, CompType, CompName);
ZoneEqSizing(state.dataSize->CurZoneEqNum).HeatingCapacity = true;
ZoneEqSizing(state.dataSize->CurZoneEqNum).DesHeatingLoad =
state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesHeatLoad;
zoneEqSizing.HeatingCapacity = true;
zoneEqSizing.DesHeatingLoad = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesHeatLoad;
}
TempSize = state.dataLowTempRadSys->HydrRadSys(RadSysNum).ScaledHeatingCapacity *
Zone(state.dataLowTempRadSys->HydrRadSys(RadSysNum).ZonePtr).FloorArea;
state.dataSize->DataScalableCapSizingON = true;
} else if (CapSizingMethod == FractionOfAutosizedHeatingCapacity) {
CheckZoneSizing(state, CompType, CompName);
ZoneEqSizing(state.dataSize->CurZoneEqNum).HeatingCapacity = true;
ZoneEqSizing(state.dataSize->CurZoneEqNum).DesHeatingLoad =
state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesHeatLoad;
TempSize = ZoneEqSizing(state.dataSize->CurZoneEqNum).DesHeatingLoad *
state.dataLowTempRadSys->HydrRadSys(RadSysNum).ScaledHeatingCapacity;
zoneEqSizing.HeatingCapacity = true;
zoneEqSizing.DesHeatingLoad = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesHeatLoad;
TempSize = zoneEqSizing.DesHeatingLoad * state.dataLowTempRadSys->HydrRadSys(RadSysNum).ScaledHeatingCapacity;
state.dataSize->DataScalableCapSizingON = true;
} else {
TempSize = state.dataLowTempRadSys->HydrRadSys(RadSysNum).ScaledHeatingCapacity;
Expand Down Expand Up @@ -2974,13 +2968,14 @@ namespace LowTempRadiantSystem {
}

if (state.dataSize->CurZoneEqNum > 0) {
auto &zoneEqSizing = state.dataSize->ZoneEqSizing(state.dataSize->CurZoneEqNum);

int SizingMethod = CoolingCapacitySizing;
FieldNum = 4;
PrintFlag = true;
SizingString = state.dataLowTempRadSys->HydronicRadiantSysNumericFields(RadSysNum).FieldNames(FieldNum) + " [W]";
CapSizingMethod = state.dataLowTempRadSys->HydrRadSys(RadSysNum).CoolingCapMethod;
ZoneEqSizing(state.dataSize->CurZoneEqNum).SizingMethod(SizingMethod) = CapSizingMethod;
zoneEqSizing.SizingMethod(SizingMethod) = CapSizingMethod;

if (!IsAutoSize && !state.dataSize->ZoneSizingRunDone) { // simulation continue
if (CapSizingMethod == CoolingDesignCapacity && state.dataLowTempRadSys->HydrRadSys(RadSysNum).ScaledCoolingCapacity > 0.0) {
Expand Down Expand Up @@ -3029,20 +3024,17 @@ namespace LowTempRadiantSystem {
} else if (CapSizingMethod == CapacityPerFloorArea) {
if (state.dataSize->ZoneSizingRunDone) {
CheckZoneSizing(state, CompType, CompName);
ZoneEqSizing(state.dataSize->CurZoneEqNum).CoolingCapacity = true;
ZoneEqSizing(state.dataSize->CurZoneEqNum).DesCoolingLoad =
state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesCoolLoad;
zoneEqSizing.CoolingCapacity = true;
zoneEqSizing.DesCoolingLoad = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesCoolLoad;
}
TempSize = state.dataLowTempRadSys->HydrRadSys(RadSysNum).ScaledCoolingCapacity *
Zone(state.dataLowTempRadSys->HydrRadSys(RadSysNum).ZonePtr).FloorArea;
state.dataSize->DataScalableCapSizingON = true;
} else if (CapSizingMethod == FractionOfAutosizedCoolingCapacity) {
CheckZoneSizing(state, CompType, CompName);
ZoneEqSizing(state.dataSize->CurZoneEqNum).CoolingCapacity = true;
ZoneEqSizing(state.dataSize->CurZoneEqNum).DesCoolingLoad =
state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesCoolLoad;
TempSize = ZoneEqSizing(state.dataSize->CurZoneEqNum).DesCoolingLoad *
state.dataLowTempRadSys->HydrRadSys(RadSysNum).ScaledCoolingCapacity;
zoneEqSizing.CoolingCapacity = true;
zoneEqSizing.DesCoolingLoad = state.dataSize->FinalZoneSizing(state.dataSize->CurZoneEqNum).NonAirSysDesCoolLoad;
TempSize = zoneEqSizing.DesCoolingLoad * state.dataLowTempRadSys->HydrRadSys(RadSysNum).ScaledCoolingCapacity;
state.dataSize->DataScalableCapSizingON = true;

} else {
Expand Down

4 comments on commit 5f03783

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

CppCheck-LowTempRadiantSystems (rraustad) - Win64-Windows-10-VisualStudio-16: OK (2900 of 2900 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.

CppCheck-LowTempRadiantSystems (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (2922 of 2922 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.

CppCheck-LowTempRadiantSystems (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-RelWithDebInfo: OK (2106 of 2106 tests passed, 0 test warnings)

Build Badge Test Badge Coverage 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.

CppCheck-LowTempRadiantSystems (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-RelWithDebInfo: OK (799 of 799 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.