Skip to content

Commit

Permalink
10638 Reorganization and Input File Mods
Browse files Browse the repository at this point in the history
Reorganized some of the sizing routine into a new subroutine that covers both heating and cooling.  Also made two minor typo corrections in existing input files and made mods to one so that the code in question actually gets used (added design sizing specifications).  Only diffs would likely be in the file that has design specifications added since that was the source of the defect.
  • Loading branch information
RKStrand committed Aug 20, 2024
1 parent 56e6b6c commit 195aee7
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 43 deletions.
94 changes: 54 additions & 40 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7945,48 +7945,27 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum)
}

// initialize capacity sizing variables: cooling
SizingMethod = CoolingCapacitySizing;
CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingCapMethod;
EqSizing.SizingMethod(SizingMethod) = CapSizingMethod;
if (CapSizingMethod == CoolingDesignCapacity || CapSizingMethod == CapacityPerFloorArea ||
CapSizingMethod == FractionOfAutosizedCoolingCapacity) {
if (CapSizingMethod == CoolingDesignCapacity) {
if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity > 0.0) {
EqSizing.CoolingCapacity = true;
EqSizing.DesCoolingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity;
}
} else if (CapSizingMethod == CapacityPerFloorArea) {
EqSizing.CoolingCapacity = true;
EqSizing.DesCoolingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity *
state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea;
state.dataSize->DataScalableCapSizingON = true;
} else if (CapSizingMethod == FractionOfAutosizedCoolingCapacity) {
state.dataSize->DataFracOfAutosizedCoolingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity;
state.dataSize->DataScalableCapSizingON = true;
}
}
initCapSizingVars(state,
CoolingCapacitySizing,
state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingCapMethod,
EqSizing.SizingMethod(SizingMethod),
state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledCoolingCapacity,
EqSizing.CoolingCapacity,
EqSizing.DesCoolingLoad,
state.dataSize->DataScalableCapSizingON,
state.dataSize->DataFracOfAutosizedCoolingCapacity);

// initialize capacity sizing variables: heating
SizingMethod = HeatingCapacitySizing;
CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod;
EqSizing.SizingMethod(SizingMethod) = CapSizingMethod;
if (CapSizingMethod == HeatingDesignCapacity || CapSizingMethod == CapacityPerFloorArea ||
CapSizingMethod == FractionOfAutosizedHeatingCapacity) {
if (CapSizingMethod == HeatingDesignCapacity) {
if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity > 0.0) {
EqSizing.HeatingCapacity = true;
EqSizing.DesHeatingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity;
}
} else if (CapSizingMethod == CapacityPerFloorArea) {
EqSizing.HeatingCapacity = true;
EqSizing.DesHeatingLoad = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity *
state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea;
state.dataSize->DataScalableCapSizingON = true;
} else if (CapSizingMethod == FractionOfAutosizedHeatingCapacity) {
state.dataSize->DataFracOfAutosizedHeatingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity;
state.dataSize->DataScalableCapSizingON = true;
}
}
initCapSizingVars(state,
HeatingCapacitySizing,
state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod,
EqSizing.SizingMethod(SizingMethod),
state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity,
EqSizing.HeatingCapacity,
EqSizing.DesHeatingLoad,
state.dataSize->DataScalableCapSizingON,
state.dataSize->DataFracOfAutosizedHeatingCapacity);

} else {
// no scalable sizing method has been specified. Sizing proceeds using the method
// specified in the zoneHVAC object
Expand Down Expand Up @@ -8879,6 +8858,41 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum)
state.dataSize->DataScalableCapSizingON = false;
}

void initCapSizingVars(EnergyPlusData &state,
int sizingMethod,
int capSizingMethod,
int &eqSizingMethod,
Real64 scaledCapacity,
bool &modeCapacity,
Real64 &designLoad,
bool &scalableCapSizingOn,
Real64 &fracOfAutosizedCapacity)
{
using namespace DataSizing;
using HVAC::CoolingCapacitySizing;
using HVAC::HeatingCapacitySizing;

eqSizingMethod = capSizingMethod;
if (capSizingMethod == CoolingDesignCapacity || capSizingMethod == HeatingDesignCapacity || capSizingMethod == CapacityPerFloorArea ||
capSizingMethod == FractionOfAutosizedCoolingCapacity || capSizingMethod == FractionOfAutosizedHeatingCapacity) {
if ((capSizingMethod == CoolingDesignCapacity && sizingMethod == CoolingCapacitySizing) ||
(capSizingMethod == HeatingDesignCapacity && sizingMethod == HeatingCapacitySizing)) {
if (scaledCapacity > 0.0) {
modeCapacity = true;
designLoad = scaledCapacity;
}
} else if (capSizingMethod == CapacityPerFloorArea) {
modeCapacity = true;
designLoad = scaledCapacity * state.dataHeatBal->Zone(state.dataSize->DataZoneNumber).FloorArea;
scalableCapSizingOn = true;
} else if ((capSizingMethod == FractionOfAutosizedCoolingCapacity && sizingMethod == CoolingCapacitySizing) ||
(capSizingMethod == FractionOfAutosizedHeatingCapacity && sizingMethod == HeatingCapacitySizing)) {
fracOfAutosizedCapacity = scaledCapacity;
scalableCapSizingOn = true;
}
}
}

void VRFCondenserEquipment::SizeVRFCondenser(EnergyPlusData &state)
{

Expand Down
10 changes: 10 additions & 0 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,16 @@ namespace HVACVariableRefrigerantFlow {

void SizeVRF(EnergyPlusData &state, int const VRFTUNum);

void initCapSizingVars(EnergyPlusData &state,
int sizingMethod,
int capSizingMethod,
int &eqSizingMethod,
Real64 scaledCapacity,
bool &modeCapacity,
Real64 &designLoad,
bool &scalableCapSizingOn,
Real64 &fracOfAutosizedCapacity);

void SimVRF(EnergyPlusData &state,
int VRFTUNum,
bool FirstHVACIteration,
Expand Down
30 changes: 28 additions & 2 deletions testfiles/VariableRefrigerantFlow_5Zone.idf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! VariableRefrigerantFlow_5Zone.idf
! Basic file description: 1 story building divided into 4 exterior and one interior conditioned zones and return plenum.
!
! Highlights: Varible Refrigerant Flow AC system
! Highlights: Variable Refrigerant Flow AC system
!
! Simulation Location/Run: Miami Intl Ap FL USA TMY3 722020, 2 design days, 2 run periods,
!
Expand Down Expand Up @@ -519,11 +519,37 @@
20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W}
, !- Rated Heating Capacity Sizing Ratio {W/W}
TU1-NightCycleManagerList, !- Availability Manager List Name
, !- Design Specification ZoneHVAC Sizing Object Name
VRFSizingRules1, !- Design Specification ZoneHVAC Sizing Object Name
, !- Supplemental Heating Coil Object Type
, !- Supplemental Heating Coil Name
; !- Maximum Supply Air Temperature from Supplemental Heater {C}

DesignSpecification:ZoneHVAC:Sizing,
VRFSizingRules1, !- Name
SupplyAirFlowRate, !- Cooling Supply Air Flow Rate Method
autosize, !- Cooling Supply Air Flow Rate {m3/s}
, !- Cooling Supply Air Flow Rate Per Floor Area {m3/s-m2}
, !- Cooling Fraction of Autosized Cooling Supply Air Flow Rate
, !- Cooling Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W}
SupplyAirFlowRate, !- No Load Supply Air Flow Rate Method
0.0, !- No Load Supply Air Flow Rate {m3/s}
, !- No Load Supply Air Flow Rate Per Floor Area {m3/s-m2}
, !- No Load Fraction of Cooling Supply Air Flow Rate
, !- No Load Fraction of Heating Supply Air Flow Rate
SupplyAirFlowRate, !- Heating Supply Air Flow Rate Method
autosize, !- Heating Supply Air Flow Rate {m3/s}
, !- Heating Supply Air Flow Rate Per Floor Area {m3/s-m2}
, !- Heating Fraction of Heating Supply Air Flow Rate
, !- Heating Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W}
CoolingDesignCapacity, !- Cooling Design Capacity Method
autosize, !- Cooling Design Capacity {W}
, !- Cooling Design Capacity Per Floor Area {W/m2}
, !- Fraction of Autosized Cooling Design Capacity
CapacityPerFloorArea, !- Heating Design Capacity Method
, !- Heating Design Capacity {W}
156.89549, !- Heating Design Capacity Per Floor Area {W/m2}
; !- Fraction of Autosized Heating Design Capacity

AvailabilityManagerAssignmentList,
TU1-NightCycleManagerList, !- Name
AvailabilityManager:NightCycle, !- Availability Manager 1 Object Type
Expand Down
2 changes: 1 addition & 1 deletion testfiles/VariableRefrigerantFlow_5Zone_wAirloop.idf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! VariableRefrigerantFlow_5Zone.idf
! Basic file description: 1 story building divided into 4 exterior and one interior conditioned zones and return plenum.
!
! Highlights: Varible Refrigerant Flow AC system
! Highlights: Variable Refrigerant Flow AC system
!
! Simulation Location/Run: Miami Intl Ap FL USA TMY3 722020, 2 design days, 2 run periods,
!
Expand Down

5 comments on commit 195aee7

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

10638VRFSizingBasedOnWrongSizingType (RKStrand) - Win64-Windows-10-VisualStudio-16: OK (2869 of 2869 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.

10638VRFSizingBasedOnWrongSizingType (RKStrand) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3354 of 3703 tests passed, 4 test warnings)

Messages:\n

  • 349 tests had: Table big diffs.
  • 5 tests had: AUD diffs.
  • 5 tests had: BND diffs.
  • 9 tests had: EIO diffs.
  • 5 tests had: ESO big diffs.
  • 2 tests had: MTD diffs.
  • 1 test had: MTR big diffs.
  • 7 tests had: Table string diffs.
  • 4 tests had: Table small diffs.
  • 4 tests had: ESO small diffs.
  • 1 test had: MDD diffs.
  • 1 test had: IDF diffs.
  • 3 tests had: MTR small diffs.
  • 1 test had: ERR diffs.

Failures:\n

regression Test Summary

  • Passed: 463
  • Failed: 349

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.

10638VRFSizingBasedOnWrongSizingType (RKStrand) - x86_64-MacOS-10.18-clang-15.0.0: OK (3314 of 3662 tests passed, 4 test warnings)

Messages:\n

  • 348 tests had: Table big diffs.
  • 5 tests had: AUD diffs.
  • 5 tests had: BND diffs.
  • 9 tests had: EIO diffs.
  • 5 tests had: ESO big diffs.
  • 2 tests had: MTD diffs.
  • 1 test had: MTR big diffs.
  • 7 tests had: Table string diffs.
  • 4 tests had: Table small diffs.
  • 4 tests had: ESO small diffs.
  • 1 test had: MDD diffs.
  • 1 test had: IDF diffs.
  • 3 tests had: MTR small diffs.
  • 1 test had: ERR diffs.

Failures:\n

regression Test Summary

  • Passed: 444
  • Failed: 348

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.

10638VRFSizingBasedOnWrongSizingType (RKStrand) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2076 of 2076 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.

10638VRFSizingBasedOnWrongSizingType (RKStrand) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (796 of 796 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.