Skip to content

Commit

Permalink
Reduce scope
Browse files Browse the repository at this point in the history
  • Loading branch information
rraustad committed Aug 21, 2024
1 parent def3f7a commit c6497e7
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7684,7 +7684,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum)
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxCoolAirVolFlow = sizingCoolingAirFlow.size(state, TempSize, errorsFound);

} else if (SAFMethod == FlowPerCoolingCapacity) {
SizingMethod = CoolingCapacitySizing;
SizingMethod = CoolingCapacitySizing; // either this isn't needed or needs to be assigned to EqSizing
TempSize = AutoSize;
PrintFlag = false;
state.dataSize->DataScalableSizingON = true;
Expand Down Expand Up @@ -7769,7 +7769,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum)
sizingHeatingAirFlow.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxHeatAirVolFlow = sizingHeatingAirFlow.size(state, TempSize, errorsFound);
} else if (SAFMethod == FlowPerHeatingCapacity) {
SizingMethod = HeatingCapacitySizing;
SizingMethod = HeatingCapacitySizing; // either this isn't needed or needs to be assigned to EqSizing
TempSize = AutoSize;
PrintFlag = false;
state.dataSize->DataScalableSizingON = true;
Expand All @@ -7783,7 +7783,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum)
sizerHeatingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName);
state.dataSize->DataAutosizedHeatingCapacity = sizerHeatingCapacity.size(state, TempSize, errorsFound);
state.dataSize->DataFlowPerHeatingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow;
SizingMethod = HeatingAirflowSizing;
SizingMethod = HeatingAirflowSizing; // either this isn't needed or needs to be assigned to EqSizing
PrintFlag = true;
TempSize = AutoSize;
errorsFound = false;
Expand Down Expand Up @@ -8011,7 +8011,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum)

FieldNum = 3; // N3, \field Supply Air Flow Rate During Heating Operation
SizingString = state.dataHVACVarRefFlow->VRFTUNumericFields(VRFTUNum).FieldNames(FieldNum) + " [m3/s]";
int SizingMethod = HeatingAirflowSizing;
int SizingMethod = HeatingAirflowSizing; // either this isn't needed or needs to be assigned to EqSizing
TempSize = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxHeatAirVolFlow;
errorsFound = false;
HeatingAirFlowSizer sizingHeatingAirFlow;
Expand Down Expand Up @@ -8366,7 +8366,6 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum)
} else {
SizingString = "Supplemental Heating Coil Nominal Capacity [W]";
if (TempSize == DataSizing::AutoSize) {
IsAutoSize = true;
bool errorsFound = false;
HeatingCapacitySizer sizerHeatingCapacity;
sizerHeatingCapacity.overrideSizingString(SizingString);
Expand Down Expand Up @@ -8882,9 +8881,8 @@ void VRFCondenserEquipment::SizeVRFCondenser(EnergyPlusData &state)
if (this->CondenserType == DataHeatBalance::RefrigCondenserType::Water) {

bool ErrorsFound = false;
int PltSizCondNum = 0;

if (this->WaterCondVolFlowRate == DataSizing::AutoSize) {
int PltSizCondNum = 0;
if (this->SourcePlantLoc.loopNum > 0) PltSizCondNum = state.dataPlnt->PlantLoop(this->SourcePlantLoc.loopNum).PlantSizNum;
if (PltSizCondNum > 0) {
rho = FluidProperties::GetDensityGlycol(state,
Expand Down Expand Up @@ -9613,8 +9611,6 @@ void ReportVRFTerminalUnit(EnergyPlusData &state, int const VRFTUNum) // index t

using namespace DataSizing;

int DXCoolingCoilIndex; // - index to DX cooling coil
int DXHeatingCoilIndex; // - index to DX heating coil
Real64 TotalConditioning; // - sum of sensible and latent rates
Real64 SensibleConditioning; // - sensible rate
Real64 LatentConditioning; // - latent rate
Expand All @@ -9625,8 +9621,6 @@ void ReportVRFTerminalUnit(EnergyPlusData &state, int const VRFTUNum) // index t
bool HRHeatRequestFlag; // - indicates TU could be in heat mode
bool HRCoolRequestFlag; // - indicates TU could be in cool mode

DXCoolingCoilIndex = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolCoilIndex;
DXHeatingCoilIndex = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HeatCoilIndex;
VRFCond = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).VRFSysNum;
TUListIndex = state.dataHVACVarRefFlow->VRF(VRFCond).ZoneTUListPtr;
IndexToTUInTUList = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).IndexToTUInTUList;
Expand Down Expand Up @@ -10010,7 +10004,6 @@ void InitializeOperatingMode(EnergyPlusData &state,
Real64 SPTempHi; // thermostat setpoint high
Real64 SPTempLo; // thermostat setpoint low
int NumTU; // loop counter, number of TU's in list
int TUIndex; // index to TU
Real64 ZoneLoad; // current zone load (W)
Real64 LoadToCoolingSP; // thermostat load to cooling setpoint (W)
Real64 LoadToHeatingSP; // thermostat load to heating setpoint (W)
Expand Down Expand Up @@ -10040,7 +10033,7 @@ void InitializeOperatingMode(EnergyPlusData &state,
for (NumTU = 1; NumTU <= state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).NumTUInList; ++NumTU) {
// make sure TU's have been sized before looping through each one of them to determine operating mode
if (any(state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).TerminalUnitNotSizedYet)) break;
TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU);
int TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU);

// check to see if coil is present
if (state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).CoolingCoilPresent(NumTU)) {
Expand Down Expand Up @@ -13990,10 +13983,7 @@ void VRFCondenserEquipment::VRFOU_CalcCompC(EnergyPlusData &state,
Real64 CondHeat = Q_evap_req * C_cap_operation0 / this->RatedEvapCapacity; // 150130 To be confirmed
int CAPFT = this->OUCoolingCAPFT(CounterCompSpdTemp);

// Update Te' (SmallLoadTe) to meet the required evaporator capacity
MinOutdoorUnitTe = 6;
P_discharge = this->refrig->getSatPressure(state, T_discharge, RoutineName);

MinRefriPe = this->refrig->getSatPressure(state, -15, RoutineName);
MinOutdoorUnitPe = max(P_discharge - this->CompMaxDeltaP, MinRefriPe);
MinOutdoorUnitTe = this->refrig->getSatTemperature(state, max(min(MinOutdoorUnitPe, RefPHigh), RefPLow), RoutineName);
Expand Down

5 comments on commit c6497e7

@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.

CppCheck-HVACVRF (rraustad) - x86_64-MacOS-10.18-clang-15.0.0: OK (3665 of 3665 tests passed, 0 test warnings)

Build Badge Test Badge

@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-HVACVRF (rraustad) - Win64-Windows-10-VisualStudio-16: OK (2871 of 2871 tests passed, 0 test warnings)

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

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

CppCheck-HVACVRF (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2077 of 2077 tests passed, 0 test warnings)

Build Badge Test Badge Coverage 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-HVACVRF (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (797 of 797 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.