Skip to content

Commit

Permalink
remove unused enum value, fix loop limits bug in economics after refa…
Browse files Browse the repository at this point in the history
…ctor
  • Loading branch information
mitchute committed Oct 13, 2020
1 parent 391b5ed commit de11039
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/BoilerSteam.hh
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace BoilerSteam {

// Default Constructor
BoilerSpecs()
: FuelType(DataGlobalConstants::ResourceType::Unknown), Available(false), ON(false), MissingSetPointErrDone(false), UseLoopSetPoint(false), DesMassFlowRate(0.0),
: FuelType(DataGlobalConstants::ResourceType::None), Available(false), ON(false), MissingSetPointErrDone(false), UseLoopSetPoint(false), DesMassFlowRate(0.0),
MassFlowRate(0.0), NomCap(0.0), NomCapWasAutoSized(false), NomEffic(0.0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0),
OperPartLoadRat(0.0), TempUpLimitBoilerOut(0.0), BoilerMaxOperPress(0.0), BoilerPressCheck(0.0), SizFac(0.0), BoilerInletNodeNum(0),
BoilerOutletNodeNum(0), FullLoadCoef(3, 0.0), TypeNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), PressErrIndex(0),
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Boilers.hh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ namespace Boilers {

// Default Constructor
BoilerSpecs()
: FuelType(DataGlobalConstants::ResourceType::Unknown), TypeNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), Available(false),
: FuelType(DataGlobalConstants::ResourceType::None), TypeNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), Available(false),
ON(false), NomCap(0.0),
NomCapWasAutoSized(false), NomEffic(0.0), TempDesBoilerOut(0.0), FlowMode(DataPlant::FlowMode::NOTSET), ModulatedFlowSetToLoop(false),
ModulatedFlowErrDone(false), VolFlowRate(0.0), VolFlowRateWasAutoSized(false), DesMassFlowRate(0.0), MassFlowRate(0.0), SizFac(0.0),
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/DXCoils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ namespace DXCoils {
ErrIndex4(0), LowAmbErrIndex(0), HighAmbErrIndex(0), PLFErrIndex(0), PLRErrIndex(0), PrintLowAmbMessage(false),
PrintHighAmbMessage(false), EvapWaterSupplyMode(WaterSupplyFromMains), EvapWaterSupTankID(0), EvapWaterTankDemandARRID(0),
CondensateCollectMode(CondensateDiscarded), CondensateTankID(0), CondensateTankSupplyARRID(0), CondensateVdot(0.0), CondensateVol(0.0),
CurrentEndTimeLast(0.0), TimeStepSysLast(0.0), FuelTypeNum(DataGlobalConstants::ResourceType::Unknown), NumOfSpeeds(0), PLRImpact(false),
CurrentEndTimeLast(0.0), TimeStepSysLast(0.0), FuelTypeNum(DataGlobalConstants::ResourceType::None), NumOfSpeeds(0), PLRImpact(false),
LatentImpact(false), MSFuelWasteHeat(0.0),
MSHPHeatRecActive(false), MSHPDesignSpecIndex(0), CoolingCoilPresent(true), HeatingCoilPresent(true), ISHundredPercentDOASDXCoil(false),
SHRFTemp(MaxModes, 0), SHRFTempErrorIndex(0), SHRFFlow(MaxModes, 0), SHRFFlowErrorIndex(0), SHRFTemp2(0), SHRFFlow2(0),
Expand Down
9 changes: 4 additions & 5 deletions src/EnergyPlus/DataGlobalConstants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ namespace DataGlobalConstants {
int const endUseRefrigeration(13);
int const endUseCogeneration(14);

std::vector<ResourceType> AllResourceTypes({ResourceType::Unknown,
ResourceType::None,
std::vector<ResourceType> AllResourceTypes({ResourceType::None,
ResourceType::Electricity,
ResourceType::Natural_Gas,
ResourceType::Gasoline,
Expand Down Expand Up @@ -177,10 +176,10 @@ namespace DataGlobalConstants {
} else if (SELECT_CASE_var == "COAL") {
return ResourceType::Coal;

} else if ((SELECT_CASE_var == "FUELOILNO1") || (SELECT_CASE_var == "FuelOilNo1")) {
} else if (SELECT_CASE_var == "FUELOILNO1") {
return ResourceType::FuelOil_1;

} else if ((SELECT_CASE_var == "FUELOILNO2") || (SELECT_CASE_var == "FuelOilNo2")) {
} else if (SELECT_CASE_var == "FUELOILNO2") {
return ResourceType::FuelOil_2;

} else if (SELECT_CASE_var == "PROPANE") {
Expand Down Expand Up @@ -301,7 +300,7 @@ namespace DataGlobalConstants {
return ResourceType::PlantLoopCoolingDemand;

} else {
return ResourceType::Unknown;
return ResourceType::None;
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/EnergyPlus/DataGlobalConstants.hh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ namespace DataGlobalConstants {

// Resource Types
enum class ResourceType {
Unknown,
None,
Electricity,
Natural_Gas,
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/DataZoneEquipment.hh
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ namespace DataZoneEquipment {

// Default Constructor
EquipMeterData()
: ReportVarUnits(OutputProcessor::Unit::None), ResourceType(DataGlobalConstants::ResourceType::Unknown), EndUse_CompMode(0), ReportVarIndex(0),
: ReportVarUnits(OutputProcessor::Unit::None), ResourceType(DataGlobalConstants::ResourceType::None), EndUse_CompMode(0), ReportVarIndex(0),
ReportVarIndexType(OutputProcessor::TimeStepType::TimeStepZone), ReportVarType(0), CurMeterReading(0.0)
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/EconomicLifeCycleCost.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,7 @@ namespace EconomicLifeCycleCost {
}
// compute the Single Present Value factors based on the discount rate
SPV.allocate(lengthStudyYears);
for (int year = 1; year <= lengthStudyYears; ++lengthStudyYears) {
for (int year = 1; year <= lengthStudyYears; ++year) {
std::map<DataGlobalConstants::ResourceType, Real64> yearMap;
for (auto iResource : DataGlobalConstants::AllResourceTypes) {
yearMap.insert(std::pair<DataGlobalConstants::ResourceType, Real64> (iResource, 0.0));
Expand Down
6 changes: 3 additions & 3 deletions src/EnergyPlus/EconomicLifeCycleCost.hh
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ namespace EconomicLifeCycleCost {
// last year is baseDateYear + lengthStudyYears - 1

// Default Constructor
UsePriceEscalationType() : resource(DataGlobalConstants::ResourceType::Unknown), escalationStartYear(0), escalationStartMonth(0)
UsePriceEscalationType() : resource(DataGlobalConstants::ResourceType::None), escalationStartYear(0), escalationStartMonth(0)
{
}
};
Expand All @@ -249,7 +249,7 @@ namespace EconomicLifeCycleCost {
// last year is baseDateYear + lengthStudyYears - 1

// Default Constructor
UseAdjustmentType() : resource(DataGlobalConstants::ResourceType::Unknown)
UseAdjustmentType() : resource(DataGlobalConstants::ResourceType::None)
{
}
};
Expand All @@ -270,7 +270,7 @@ namespace EconomicLifeCycleCost {
Array1D<Real64> yrPresVal; // present value by year, first year is baseDateYear

// Default Constructor
CashFlowType() : SourceKind(0), Resource(DataGlobalConstants::ResourceType::Unknown), Category(0), pvKind(0), presentValue(0.), orginalCost(0.)
CashFlowType() : SourceKind(0), Resource(DataGlobalConstants::ResourceType::None), Category(0), pvKind(0), presentValue(0.), orginalCost(0.)
{
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/EconomicTariff.hh
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ namespace EconomicTariff {

// Default Constructor
TariffType()
: reportMeterIndx(0), kindElectricMtr(0), kindWaterMtr(0), kindGasMtr(0), resourceNum(DataGlobalConstants::ResourceType::Unknown),
: reportMeterIndx(0), kindElectricMtr(0), kindWaterMtr(0), kindGasMtr(0), resourceNum(DataGlobalConstants::ResourceType::None),
convChoice(0), energyConv(0.0), demandConv(0.0),
periodSchIndex(0), seasonSchIndex(0), monthSchIndex(0), demandWindow(0), demWinTime(0.0), monthChgVal(0.0), monthChgPt(0),
minMonthChgVal(0.0), minMonthChgPt(0), chargeSchIndex(0), baseUseSchIndex(0), buyOrSell(0), firstCategory(0), lastCategory(0),
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HVACVariableRefrigerantFlow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ namespace HVACVariableRefrigerantFlow {
OperatingMode(0), ElecPower(0.0), ElecCoolingPower(0.0), ElecHeatingPower(0.0), CoolElecConsumption(0.0), HeatElecConsumption(0.0),
CrankCaseHeaterPower(0.0), CrankCaseHeaterElecConsumption(0.0), EvapCondPumpElecPower(0.0), EvapCondPumpElecConsumption(0.0),
EvapWaterConsumpRate(0.0), HRMaxTempLimitIndex(0), CoolingMaxTempLimitIndex(0), HeatingMaxTempLimitIndex(0),
FuelTypeNum(DataGlobalConstants::ResourceType::Unknown),
FuelTypeNum(DataGlobalConstants::ResourceType::None),
SUMultiplier(0.0), TUCoolingLoad(0.0), TUHeatingLoad(0.0), SwitchedMode(false), OperatingCOP(0.0), MinOATHeatRecovery(0.0),
MaxOATHeatRecovery(0.0), HRCAPFTCool(0), HRCAPFTCoolConst(0.9), HRInitialCoolCapFrac(0.5), HRCoolCapTC(0.15), HREIRFTCool(0),
HREIRFTCoolConst(1.1), HRInitialCoolEIRFrac(1.0), HRCoolEIRTC(0.0), HRCAPFTHeat(0), HRCAPFTHeatConst(1.1), HRInitialHeatCapFrac(1.0),
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HeatingCoils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ namespace HeatingCoils {
int AirLoopNum; // Airloop number
// Default Constructor
HeatingCoilEquipConditions()
: HCoilType_Num(0), FuelType_Num(DataGlobalConstants::ResourceType::Unknown), SchedPtr(0), InsuffTemperatureWarn(0),
: HCoilType_Num(0), FuelType_Num(DataGlobalConstants::ResourceType::None), SchedPtr(0), InsuffTemperatureWarn(0),
InletAirMassFlowRate(0.0), OutletAirMassFlowRate(0.0),
InletAirTemp(0.0), OutletAirTemp(0.0), InletAirHumRat(0.0), OutletAirHumRat(0.0), InletAirEnthalpy(0.0), OutletAirEnthalpy(0.0),
HeatingCoilLoad(0.0), HeatingCoilRate(0.0), FuelUseLoad(0.0), ElecUseLoad(0.0), FuelUseRate(0.0), ElecUseRate(0.0), Efficiency(0.0),
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Plant/MeterData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace DataPlant {

// Default Constructor
MeterData()
: ReportVarUnits(OutputProcessor::Unit::None), ResourceType(DataGlobalConstants::ResourceType::Unknown), EndUse_CompMode(0), ReportVarIndex(0),
: ReportVarUnits(OutputProcessor::Unit::None), ResourceType(DataGlobalConstants::ResourceType::None), EndUse_CompMode(0), ReportVarIndex(0),
ReportVarIndexType(OutputProcessor::TimeStepType::TimeStepZone), ReportVarType(0), CurMeterReading(0.0)
{
}
Expand Down
4 changes: 2 additions & 2 deletions tst/EnergyPlus/unit/DataGlobalConstants.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ TEST_F(EnergyPlusFixture, DataGlobalConstants_AssignResourceTypeNum)
EXPECT_EQ(DataGlobalConstants::ResourceType::CarbonEquivalent, DataGlobalConstants::AssignResourceTypeNum("Carbon Equivalent"));
EXPECT_EQ(DataGlobalConstants::ResourceType::PlantLoopHeatingDemand, DataGlobalConstants::AssignResourceTypeNum("PlantLoopHeatingDemand"));
EXPECT_EQ(DataGlobalConstants::ResourceType::PlantLoopCoolingDemand, DataGlobalConstants::AssignResourceTypeNum("PlantLoopCoolingDemand"));
EXPECT_EQ(DataGlobalConstants::ResourceType::Unknown, DataGlobalConstants::AssignResourceTypeNum("XYZ"));
EXPECT_EQ(DataGlobalConstants::ResourceType::None, DataGlobalConstants::AssignResourceTypeNum("XYZ"));
}

TEST_F(EnergyPlusFixture, DataGlobalConstants_GetResourceTypeChar)
Expand Down Expand Up @@ -157,7 +157,7 @@ TEST_F(EnergyPlusFixture, DataGlobalConstants_GetResourceTypeChar)
EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::CarbonEquivalent), "Carbon Equivalent");
EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::PlantLoopHeatingDemand), "PlantLoopHeatingDemand");
EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::PlantLoopCoolingDemand), "PlantLoopCoolingDemand");
EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::Unknown), "Unknown");
EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::None), "Unknown");
EXPECT_EQ(DataGlobalConstants::GetResourceTypeChar(DataGlobalConstants::ResourceType::None), "Unknown");
}

5 comments on commit de11039

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

global_dataGlobals_2_again (mitchute) - x86_64-MacOS-10.15-clang-11.0.0: OK (2984 of 2984 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.

global_dataGlobals_2_again (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3024 of 3024 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.

global_dataGlobals_2_again (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1548 of 1548 tests passed, 0 test warnings)

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

global_dataGlobals_2_again (mitchute) - Win64-Windows-10-VisualStudio-16: OK (2240 of 2240 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.

global_dataGlobals_2_again (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (721 of 722 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 721
  • Timeout: 1

Build Badge Test Badge Coverage Badge

Please sign in to comment.